/*! For license information please see app-d41ce016cbcaf08823a3.cjs.LICENSE.txt */ (self.webpackChunkroot=self.webpackChunkroot||[]).push([[524],{0:(e,t,n)=>{"use strict";e.exports=n.p+"img/asoLogo-eb0c34a967f39c0e7e3a.jpg"},384:(e,t,n)=>{"use strict";e.exports=n.p+"img/avatarGroup-faca1e69e2c224b7eebe.png"},477:()=>{},1037:(e,t,n)=>{"use strict";e.exports=n.p+"svg/dnsBlank-d9b5a36b6d641e2b1cd9.svg"},1205:(e,t,n)=>{"use strict";e.exports=n.p+"img/formPositionUnranked-8efe2960cfc090ba51df.png"},1416:(e,t,n)=>{"use strict";e.exports=n.p+"img/googlePlan-b18cf281f99a8608e7a9.png"},1446:(e,t,n)=>{"use strict";e.exports=n.p+"img/googleMaps-093b110e04f11e43e677.png"},1931:(e,t,n)=>{"use strict";e.exports=n.p+"img/google-3994b2066e10d4d349a4.png"},2281:(e,t,n)=>{"use strict";e.exports=n.p+"img/login2x-a7058a62cb4dc68d53e5.png"},2599:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankHandGlobe-724d35d1342815318f84.svg"},2630:(e,t,n)=>{"use strict";e.exports=n.p+"svg/alert-c575e88c07bbcb08605f.svg"},2647:(e,t,n)=>{"use strict";e.exports=n.p+"img/login-ba738216a561ebc04664.png"},2830:()=>{!function(e){const t=e.nl=e.nl||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 van %1","Align center":"Midden uitlijnen","Align left":"Links uitlijnen","Align right":"Rechts uitlijnen",Aquamarine:"Aquamarijn",Black:"Zwart","Block quote":"Blok citaat",Blue:"Blauw",Bold:"Vet","Break text":"","Bulleted List":"Ongenummerde lijst",Cancel:"Annuleren","Centered image":"Gecentreerde afbeelding","Change image text alternative":"Verander alt-tekst van de afbeelding","Choose heading":"Kies kop","Dim grey":"Gedimd grijs","Document colors":"Document kleur",Downloadable:"Downloadbaar","Dropdown toolbar":"Drop-down werkbalk","Edit block":"Blok aanpassen","Edit link":"Bewerk link","Editor toolbar":"Editor welkbalk","Font Background Color":"Tekst achtergrondkleur","Font Color":"Tekstkleur","Full size image":"Afbeelding op volledige grootte",Green:"Groen",Grey:"Grijs",Heading:"Koppen","Heading 1":"Kop 1","Heading 2":"Kop 2","Heading 3":"Kop 3","Heading 4":"Kop 4","Heading 5":"Kop 5","Heading 6":"Kop 6","Image resize list":"","Image toolbar":"Afbeeldingswerkbalk","image widget":"afbeeldingswidget","In line":"","Insert image":"Afbeelding toevoegen","Insert paragraph after block":"Voeg paragraaf toe na blok","Insert paragraph before block":"Voeg paragraaf toe voor blok",Italic:"Cursief",Justify:"Volledig uitlijnen","Left aligned image":"Links uitgelijnde afbeelding","Light blue":"Lichtblauw","Light green":"Lichtgroen","Light grey":"Lichtgrijs",Link:"Link","Link URL":"Link URL",Next:"Volgende","Numbered List":"Genummerde lijst","Open in a new tab":"Open een nieuw tabblad","Open link in new tab":"Open link in nieuw tabblad",Orange:"Oranje",Original:"Origineel",Paragraph:"Paragraaf",Previous:"Vorige",Purple:"Paars",Red:"Rood",Redo:"Opnieuw","Remove color":"Verwijder kleur","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Rich Text Editor":"Tekstbewerker","Rich Text Editor, %0":"Tekstbewerker, %0","Right aligned image":"Rechts uitgelijnde afbeelding",Save:"Opslaan","Select all":"Selecteer alles","Show more items":"Meer items weergeven","Side image":"Afbeelding naast tekst","Text alignment":"Tekst uitlijning","Text alignment toolbar":"Tekst uitlijning werkbalk","Text alternative":"Alt-tekst","This link has no URL":"Deze link heeft geen URL",Turquoise:"Turquoise",Underline:"Onderlijnen",Undo:"Ongedaan maken",Unlink:"Verwijder link","Upload failed":"Uploaden afbeelding mislukt","Upload in progress":"Bezig met uploaden",White:"Wit","Widget toolbar":"Widget werkbalk","Wrap text":"",Yellow:"Geel"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},3574:(e,t,n)=>{"use strict";e.exports=n.p+"svg/done2-fe55d02679b93e21cc5f.svg"},3780:(e,t,n)=>{"use strict";e.exports=n.p+"svg/check-b496988ef222b46ee39a.svg"},4025:(e,t,n)=>{"use strict";e.exports=n.p+"img/ignPlan-d4659acd351e7c1a33e4.png"},4236:(e,t,n)=>{"use strict";e.exports=n.p+"img/background404-7cbee4be29173b045b3e.jpg"},4362:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankSwissArmyKnife-1600d89a247ad1dab4a9.svg"},4385:()=>{!function(e){const t=e.de=e.de||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 von %1","Align center":"Zentriert","Align left":"Linksbündig","Align right":"Rechtsbündig",Aquamarine:"Aquamarinblau",Black:"Schwarz","Block quote":"Blockzitat",Blue:"Blau",Bold:"Fett","Break text":"Bild teilt Text","Bulleted List":"Aufzählungsliste",Cancel:"Abbrechen","Centered image":"Zentriertes Bild","Change image text alternative":"Alternativtext ändern","Choose heading":"Überschrift auswählen","Dim grey":"Dunkelgrau","Document colors":"Dokumentfarben",Downloadable:"Herunterladbar","Dropdown toolbar":"Dropdown-Liste Werkzeugleiste","Edit block":"Absatz bearbeiten","Edit link":"Link bearbeiten","Editor toolbar":"Editor Werkzeugleiste","Font Background Color":"Hintergrundfarbe","Font Color":"Schriftfarbe","Full size image":"Bild in voller Größe",Green:"Grün",Grey:"Grau",Heading:"Überschrift","Heading 1":"Überschrift 1","Heading 2":"Überschrift 2","Heading 3":"Überschrift 3","Heading 4":"Überschrift 4","Heading 5":"Überschrift 5","Heading 6":"Überschrift 6","Image resize list":"Bildgrößen-Liste","Image toolbar":"Bild Werkzeugleiste","image widget":"Bild-Steuerelement","In line":"Text in Zeile","Insert image":"Bild einfügen","Insert paragraph after block":"Absatz nach Block einfügen","Insert paragraph before block":"Absatz vor Block einfügen",Italic:"Kursiv",Justify:"Blocksatz","Left aligned image":"Linksbündiges Bild","Light blue":"Hellblau","Light green":"Hellgrün","Light grey":"Hellgrau",Link:"Link","Link URL":"Link Adresse",Next:"Nächste","Numbered List":"Nummerierte Liste","Open in a new tab":"In neuem Tab öffnen","Open link in new tab":"Link im neuen Tab öffnen",Orange:"Orange",Original:"Original",Paragraph:"Absatz",Previous:"vorherige",Purple:"Violett",Red:"Rot",Redo:"Wiederherstellen","Remove color":"Farbe entfernen","Resize image":"Bildgröße ändern","Resize image to %0":"Bildgröße ändern in %0","Resize image to the original size":"Bild in Originalgröße ändern","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich-Text-Editor, %0","Right aligned image":"Rechtsbündiges Bild",Save:"Speichern","Select all":"Alles auswählen","Show more items":"Mehr anzeigen","Side image":"Seitenbild","Text alignment":"Textausrichtung","Text alignment toolbar":"Text-Ausrichtung Toolbar","Text alternative":"Alternativtext","This link has no URL":"Dieser Link hat keine Adresse",Turquoise:"Türkis",Underline:"Unterstrichen",Undo:"Rückgängig",Unlink:"Link entfernen","Upload failed":"Hochladen fehlgeschlagen","Upload in progress":"Upload läuft",White:"Weiß","Widget toolbar":"Widget Werkzeugleiste","Wrap text":"Text umfließt Bild",Yellow:"Gelb"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},4628:(e,t,n)=>{"use strict";e.exports=n.p+"img/formPositionRanked-376168a7e3c71ed7defd.png"},5376:(e,t,n)=>{"use strict";e.exports=n.p+"svg/sad-cbf74279d944b2baac65.svg"},5488:(e,t,n)=>{var i;e=n.nmd(e),function(e){const t=e.fr=e.fr||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 sur %1","Align center":"Centrer","Align left":"Aligner à gauche","Align right":"Aligner à droite",Aquamarine:"Bleu vert",Black:"Noir","Block quote":"Citation",Blue:"Bleu",Bold:"Gras","Bulleted List":"Liste à puces",Cancel:"Annuler","Change image text alternative":"Changer le texte alternatif à l’image","Choose heading":"Choisir l'en-tête","Dim grey":"Gris pâle","Document colors":"Couleurs du document",Downloadable:"Fichier téléchargeable","Dropdown toolbar":"Barre d'outils dans un menu déroulant","Edit block":"Modifier le bloc","Edit link":"Modifier le lien","Editor toolbar":"Barre d'outils de l'éditeur","Font Background Color":"Couleur d'arrière-plan","Font Color":"Couleur de police",Green:"Vert",Grey:"Gris",Heading:"En-tête","Heading 1":"Titre 1","Heading 2":"Titre 2","Heading 3":"Titre 3","Heading 4":"Titre 4","Heading 5":"Titre 5","Heading 6":"Titre 6","Image resize list":"Liste des tailles d'images","image widget":"Objet image","Insert image":"Insérer une image","Insert paragraph after block":"Insérer du texte après ce bloc","Insert paragraph before block":"Insérer du texte avant ce bloc",Italic:"Italique",Justify:"Justifier","Light blue":"Bleu clair","Light green":"Vert clair","Light grey":"Gris clair",Link:"Lien","Link URL":"URL du lien",Next:"Suivant","Numbered List":"Liste numérotée","Open in a new tab":"Ouvrir dans un nouvel onglet","Open link in new tab":"Ouvrir le lien dans un nouvel onglet",Orange:"Orange",Original:"Taille originale",Paragraph:"Paragraphe",Previous:"Précedent",Purple:"Violet",Red:"Rouge",Redo:"Restaurer","Remove color":"Enlever la couleur","Resize image":"Redimensionner l'image","Resize image to %0":"Redimensionner à %0","Resize image to the original size":"Appliquer les dimensions d'origine","Rich Text Editor":"Éditeur de texte enrichi","Rich Text Editor, %0":"Éditeur de texte enrichi, %0",Save:"Enregistrer","Select all":"Sélectionner tout","Show more items":"Montrer plus d'éléments","Text alignment":"Alignement du texte","Text alignment toolbar":"Barre d'outils d'alignement du texte","Text alternative":"Texte alternatif","This link has no URL":"Ce lien n'a pas d'URL",Turquoise:"Turquoise",Underline:"Souligné",Undo:"Annuler",Unlink:"Supprimer le lien","Upload failed":"Échec de l'envoi","Upload in progress":"Téléchargement en cours",White:"Blanc","Widget toolbar":"Barre d'outils du widget",Yellow:"Jaune"}),t.getPluralForm=function(e){return e>1}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),self,i=()=>(()=>{"use strict";var i={636:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css"],names:[],mappings:"AAKA,uBAWC,0BAAsC,CADtC,iBAAkB,CAFlB,aAAc,CACd,cAAe,CAPf,eAAgB,CAIhB,kBAAmB,CADnB,mBAOD,CAEA,gCACC,aAAc,CACd,2BACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content blockquote {\n\t/* See #12 */\n\toverflow: hidden;\n\n\t/* https://github.com/ckeditor/ckeditor5-block-quote/issues/15 */\n\tpadding-right: 1.5em;\n\tpadding-left: 1.5em;\n\n\tmargin-left: 0;\n\tmargin-right: 0;\n\tfont-style: italic;\n\tborder-left: solid 5px hsl(0, 0%, 80%);\n}\n\n.ck-content[dir="rtl"] blockquote {\n\tborder-left: 0;\n\tborder-right: solid 5px hsl(0, 0%, 80%);\n}\n'],sourceRoot:""}]);const a=r},390:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-clipboard/clipboard.css"],names:[],mappings:"AASC,8DACC,cAAe,CAEf,mBAAoB,CADpB,iBAOD,CAJC,mEACC,iBAAkB,CAClB,OACD,CAWA,qJACC,YACD,CCzBF,MACC,yCAA0C,CAC1C,yCAA0C,CAC1C,6DACD,CAOE,mEAIC,gDAAiD,CADjD,sDAAuD,CAFvD,2DAA8D,CAI9D,gBAAiB,CAHjB,wDAqBD,CAfC,yEAWC,sFAAuF,CAEvF,kBAAmB,CADnB,qKAA0K,CAX1K,UAAW,CAIX,aAAc,CAFd,QAAS,CAIT,QAAS,CADT,iBAAkB,CAElB,wDAA2D,CAE3D,0BAA2B,CAR3B,OAYD,CA2DF,kEACC,gGACD,CAKA,gDACC,OAAS,CACT,sBACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t/*\n\t * Vertical drop target (in text).\n\t */\n\t& .ck.ck-clipboard-drop-target-position {\n\t\tdisplay: inline;\n\t\tposition: relative;\n\t\tpointer-events: none;\n\n\t\t& span {\n\t\t\tposition: absolute;\n\t\t\twidth: 0;\n\t\t}\n\t}\n\n\t/*\n\t * Styles of the widget being dragged (its preview).\n\t */\n\t& .ck-widget:-webkit-drag {\n\t\t& > .ck-widget__selection-handle {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t& > .ck-widget__type-around {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-clipboard-drop-target-dot-width: 12px;\n\t--ck-clipboard-drop-target-dot-height: 8px;\n\t--ck-clipboard-drop-target-color: var(--ck-color-focus-border)\n}\n\n.ck.ck-editor__editable {\n\t/*\n\t * Vertical drop target (in text).\n\t */\n\t& .ck.ck-clipboard-drop-target-position {\n\t\t& span {\n\t\t\tbottom: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\t\t\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\t\t\tborder: 1px solid var(--ck-clipboard-drop-target-color);\n\t\t\tbackground: var(--ck-clipboard-drop-target-color);\n\t\t\tmargin-left: -1px;\n\n\t\t\t/* The triangle above the marker */\n\t\t\t&::after {\n\t\t\t\tcontent: "";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 50%;\n\t\t\t\ttop: calc(var(--ck-clipboard-drop-target-dot-height) * -.5);\n\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\tborder-color: var(--ck-clipboard-drop-target-color) transparent transparent transparent;\n\t\t\t\tborder-width: calc(var(--ck-clipboard-drop-target-dot-height)) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width));\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t// Horizontal drop target (between blocks).\n\t& .ck.ck-clipboard-drop-target-position {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\twidth: 100%;\n\t\theight: 0;\n\t\tmargin: 0;\n\t\ttext-align: initial;\n\n\t\t& .ck-clipboard-drop-target__line {\n\t\t\tposition: absolute;\n\t\t\twidth: 100%;\n\t\t\theight: 0;\n\t\t\tborder: 1px solid var(--ck-clipboard-drop-target-color);\n\t\t\tmargin-top: -1px;\n\n\t\t\t&::before {\n\t\t\t\tcontent: "";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: calc(-1 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\ttop: 0;\n\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t\tborder-color: transparent transparent transparent var(--ck-clipboard-drop-target-color);\n\t\t\t\tborder-width: var(--ck-clipboard-drop-target-dot-size) 0 var(--ck-clipboard-drop-target-dot-size) calc(2 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: "";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tright: calc(-1 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\ttop: 0;\n\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t\tborder-color: transparent var(--ck-clipboard-drop-target-color) transparent transparent;\n\t\t\t\tborder-width: var(--ck-clipboard-drop-target-dot-size) calc(2 * var(--ck-clipboard-drop-target-dot-size)) var(--ck-clipboard-drop-target-dot-size) 0;\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\t\t}\n\t}\n\t*/\n\n\t/*\n\t * Styles of the widget that it a drop target.\n\t */\n\t& .ck-widget.ck-clipboard-drop-target-range {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color) !important;\n\t}\n\n\t/*\n\t * Styles of the widget being dragged (its preview).\n\t */\n\t& .ck-widget:-webkit-drag {\n\t\tzoom: 0.6;\n\t\toutline: none !important;\n\t}\n}\n'],sourceRoot:""}]);const a=r},638:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-editor-classic/classiceditor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAKA,cAIC,iBAMD,CAJC,2DAEC,yBACD,CCLC,gDCED,eDKC,CAPA,uICMA,qCAAsC,CDJpC,2BAA4B,CAC5B,4BAIF,CAPA,gDAMC,qBACD,CAEA,iFACC,uBAAwB,CCR1B,eDaC,CANA,yMCHA,qCAAsC,CDOpC,eAEF,CAKF,yCAEC,0CAA2C,CCpB3C,eD8BD,CAZA,yHCdE,qCAAsC,CDmBtC,wBAAyB,CACzB,yBAMF,CAHC,0DACC,wCACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor {\n\t/* All the elements within `.ck-editor` are positioned relatively to it.\n\t If any element needs to be positioned with respect to the , etc.,\n\t it must land outside of the `.ck-editor` in DOM. */\n\tposition: relative;\n\n\t& .ck-editor__top .ck-sticky-panel .ck-toolbar {\n\t\t/* https://github.com/ckeditor/ckeditor5-editor-classic/issues/62 */\n\t\tz-index: var(--ck-z-modal);\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../mixins/_rounded.css";\n\n.ck.ck-editor__top {\n\t& .ck-sticky-panel {\n\t\t& .ck-toolbar {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\n\t\t\tborder-bottom-width: 0;\n\t\t}\n\n\t\t& .ck-sticky-panel__content_sticky .ck-toolbar {\n\t\t\tborder-bottom-width: 1px;\n\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/* Note: Use ck-editor__main to make sure these styles don\'t apply to other editor types */\n.ck.ck-editor__main > .ck-editor__editable {\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/113 */\n\tbackground: var(--ck-color-base-background);\n\n\t@mixin ck-rounded-corners {\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t&:not(.ck-focused) {\n\t\tborder-color: var(--ck-color-base-border);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},894:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text);cursor:text}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-engine/placeholder.css"],names:[],mappings:"AAMA,uCAEC,iBAWD,CATC,qDAIC,8BAA+B,CAF/B,MAAO,CAKP,mBAAoB,CANpB,iBAAkB,CAElB,OAKD,CAKA,wCACC,YACD,CAQD,iCACC,iBACD,CC5BC,qDAEC,6CAA8C,CAD9C,WAED",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* See ckeditor/ckeditor5#936. */\n.ck.ck-placeholder,\n.ck .ck-placeholder {\n\tposition: relative;\n\n\t&::before {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tcontent: attr(data-placeholder);\n\n\t\t/* See ckeditor/ckeditor5#469. */\n\t\tpointer-events: none;\n\t}\n}\n\n/* See ckeditor/ckeditor5#1987. */\n.ck.ck-read-only .ck-placeholder {\n\t&::before {\n\t\tdisplay: none;\n\t}\n}\n\n/*\n * Rules for the `ck-placeholder` are loaded before the rules for `ck-reset_all` in the base CKEditor 5 DLL build.\n * This fix overwrites the incorrectly set `position: static` from `ck-reset_all`.\n * See https://github.com/ckeditor/ckeditor5/issues/11418.\n */\n.ck.ck-reset_all .ck-placeholder {\n\tposition: relative;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* See ckeditor/ckeditor5#936. */\n.ck.ck-placeholder, .ck .ck-placeholder {\n\t&::before {\n\t\tcursor: text;\n\t\tcolor: var(--ck-color-engine-placeholder-text);\n\t}\n}\n"],sourceRoot:""}]);const a=r},401:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css"],names:[],mappings:"AAMA,qDACC,YACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Elements marked by the Renderer as hidden should be invisible in the editor. */\n.ck.ck-editor__editable span[data-ck-unsafe-element] {\n\tdisplay: none;\n}\n"],sourceRoot:""}]);const a=r},585:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-button.ck-color-table__remove-color{align-items:center;display:flex;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-font/fontcolor.css"],names:[],mappings:"AAKA,4CAEC,kBAAmB,CADnB,YAAa,CAEb,UACD,CAEA,8BACC,iBACD,CCNA,4CAEC,2BAA4B,CAC5B,4BAA6B,CAF7B,qEAiBD,CAbC,wDACC,mDACD,CAEA,kEAEE,uCAMF,CARA,kEAME,sCAEF",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-button.ck-color-table__remove-color {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n}\n\nlabel.ck.ck-color-grid__label {\n\tfont-weight: unset;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck .ck-button.ck-color-table__remove-color {\n\tpadding: calc(var(--ck-spacing-standard) / 2 ) var(--ck-spacing-standard);\n\tborder-bottom-left-radius: 0;\n\tborder-bottom-right-radius: 0;\n\n\t&:not(:focus) {\n\t\tborder-bottom: 1px solid var(--ck-color-base-border);\n\t}\n\n\t& .ck.ck-icon {\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-right: var(--ck-spacing-standard);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n}\n\n'],sourceRoot:""}]);const a=r},230:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-heading/heading.css"],names:[],mappings:"AAKA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,+BACC,eACD,CCZC,2EACC,SACD,CAEA,uEACC,cACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 {\n\tfont-size: 14px;\n}\n\n.ck[class*="ck-heading_heading"] {\n\tfont-weight: bold;\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Resize dropdown's button label. */\n.ck.ck-dropdown.ck-heading-dropdown {\n\t& .ck-dropdown__button .ck-button__label {\n\t\twidth: 8em;\n\t}\n\n\t& .ck-dropdown__panel .ck-list__item {\n\t\tmin-width: 18em;\n\t}\n}\n"],sourceRoot:""}]);const a=r},48:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/image.css"],names:[],mappings:"AAMC,mBAEC,UAAW,CADX,aAAc,CAOd,gBAAkB,CAGlB,cAAe,CARf,iBAuBD,CAbC,uBAEC,aAAc,CAGd,aAAc,CAGd,cAAe,CAGf,cACD,CAGD,0BAYC,sBAAuB,CANvB,mBAAoB,CAGpB,cAoBD,CAdC,kCACC,YACD,CAGA,gEAGC,WAAY,CACZ,aAAc,CAGd,cACD,CAUD,gEASC,eAAgB,CARhB,oBAAqB,CACrB,qBAAsB,CAQtB,sBAAuB,CAFvB,kBAGD,CAWA,2GACC,SAUD,CAHC,qEACC,YACD,CAOA,0FACC,cACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content {\n\t& .image {\n\t\tdisplay: table;\n\t\tclear: both;\n\t\ttext-align: center;\n\n\t\t/* Make sure there is some space between the content and the image. Center image by default. */\n\t\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\t \tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\t\tmargin: 0.9em auto;\n\n\t\t/* Make sure the caption will be displayed properly (See: https://github.com/ckeditor/ckeditor5/issues/1870). */\n\t\tmin-width: 50px;\n\n\t\t& img {\n\t\t\t/* Prevent unnecessary margins caused by line-height (see #44). */\n\t\t\tdisplay: block;\n\n\t\t\t/* Center the image if its width is smaller than the content\'s width. */\n\t\t\tmargin: 0 auto;\n\n\t\t\t/* Make sure the image never exceeds the size of the parent container (ckeditor/ckeditor5-ui#67). */\n\t\t\tmax-width: 100%;\n\n\t\t\t/* Make sure the image is never smaller than the parent container (See: https://github.com/ckeditor/ckeditor5/issues/9300). */\n\t\t\tmin-width: 100%\n\t\t}\n\t}\n\n\t& .image-inline {\n\t\t/*\n\t\t * Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).\n\t\t * Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root.\n\t\t * This strange behavior does not happen with inline-flex.\n\t\t */\n\t\tdisplay: inline-flex;\n\n\t\t/* While being resized, don\'t allow the image to exceed the width of the editing root. */\n\t\tmax-width: 100%;\n\n\t\t/* This is required by Safari to resize images in a sensible way. Without this, the browser breaks the ratio. */\n\t\talign-items: flex-start;\n\n\t\t/* When the picture is present it must act as a flex container to let the img resize properly */\n\t\t& picture {\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t/* When the picture is present, it must act like a resizable img. */\n\t\t& picture,\n\t\t& img {\n\t\t\t/* This is necessary for the img to span the entire .image-inline wrapper and to resize properly. */\n\t\t\tflex-grow: 1;\n\t\t\tflex-shrink: 1;\n\n\t\t\t/* Prevents overflowing the editing root boundaries when an inline image is very wide. */\n\t\t\tmax-width: 100%;\n\t\t}\n\t}\n}\n\n.ck.ck-editor__editable {\n\t/*\n\t * Inhertit the content styles padding of the
in case the integration overrides `text-align: center`\n\t * of `.image` (e.g. to the left/right). This ensures the placeholder stays at the padding just like the native\n\t * caret does, and not at the edge of
.\n\t */\n\t& .image > figcaption.ck-placeholder::before {\n\t\tpadding-left: inherit;\n\t\tpadding-right: inherit;\n\n\t\t/*\n\t\t * Make sure the image caption placeholder doesn\'t overflow the placeholder area.\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\n\t\t */\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\n\t/*\n\t * Make sure the selected inline image always stays on top of its siblings.\n\t * See https://github.com/ckeditor/ckeditor5/issues/9108.\n\t */\n\t& .image.ck-widget_selected {\n\t\tz-index: 1;\n\t}\n\n\t& .image-inline.ck-widget_selected {\n\t\tz-index: 1;\n\n\t\t/*\n\t\t * Make sure the native browser selection style is not displayed.\n\t\t * Inline image widgets have their own styles for the selected state and\n\t\t * leaving this up to the browser is asking for a visual collision.\n\t\t */\n\t\t& ::selection {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t/* The inline image nested in the table should have its original size if not resized.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\n\t& td,\n\t& th {\n\t\t& .image-inline img {\n\t\t\tmax-width: none;\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},43:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css"],names:[],mappings:"AAKA,iCAQC,qBAAsB,CADtB,aAAc,CANd,cAkBD,CATC,qCAEC,UACD,CAEA,4CAEC,aACD,CAQC,sHACC,cACD,CAIF,oFACC,uCACD,CAEA,oFACC,sCACD,CAEA,oEACC,SACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content .image.image_resized {\n\tmax-width: 100%;\n\t/*\n\tThe `
` element for resized images must not use `display:table` as browsers do not support `max-width` for it well.\n\tSee https://stackoverflow.com/questions/4019604/chrome-safari-ignoring-max-width-in-table/14420691#14420691 for more.\n\tFortunately, since we control the width, there is no risk that the image will look bad.\n\t*/\n\tdisplay: block;\n\tbox-sizing: border-box;\n\n\t& img {\n\t\t/* For resized images it is the `
` element that determines the image width. */\n\t\twidth: 100%;\n\t}\n\n\t& > figcaption {\n\t\t/* The `
` element uses `display:block`, so `
` also has to. */\n\t\tdisplay: block;\n\t}\n}\n\n.ck.ck-editor__editable {\n\t/* The resized inline image nested in the table should respect its parent size.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\n\t& td,\n\t& th {\n\t\t& .image-inline.image_resized img {\n\t\t\tmax-width: 100%;\n\t\t}\n\t}\n}\n\n[dir="ltr"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\n\tmargin-right: var(--ck-spacing-standard);\n}\n\n[dir="rtl"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\n\tmargin-left: var(--ck-spacing-standard);\n}\n\n.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label {\n\twidth: 4em;\n}\n'],sourceRoot:""}]);const a=r},899:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css"],names:[],mappings:"AAKA,+BAUC,iBAAkB,CATlB,aAAc,CACd,iBAAkB,CAOlB,sCAAwC,CADxC,oCAAsC,CAGtC,SAMD,CAJC,qCACC,UAAW,CACX,iBACD,CChBD,MACC,iCAA8C,CAC9C,+CAA4D,CAG5D,8BAA+B,CAC/B,gCAAiC,CACjC,4DACD,CAEA,+BAWC,sBAA4B,CAN5B,0BAAgC,CADhC,qCAAuC,CADvC,wEAA0E,CAD1E,uDAAwD,CAMxD,oDAAuD,CAWvD,oFAAuF,CAlBvF,SAAU,CAgBV,eAAgB,CAChB,mFA0BD,CAtBC,qCAgBC,mBAAsB,CADtB,sBAAyB,CAEzB,4BAA6B,CAH7B,4CAA6C,CAF7C,sFAAuF,CADvF,oFAAqF,CASrF,qBAAsB,CAdtB,QAAS,CAJT,QAAS,CAGT,SAAU,CADV,OAAQ,CAKR,mCAAoC,CACpC,yBAA0B,CAH1B,OAcD,CAGD,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,yCACC,GAGC,QAAS,CAFT,SAAU,CACV,OAED,CACA,IAEC,QAAS,CADT,UAED,CACA,GAGC,YAAc,CAFd,SAAU,CACV,UAED,CACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-image-upload-complete-icon {\n\tdisplay: block;\n\tposition: absolute;\n\n\t/*\n\t * Smaller images should have the icon closer to the border.\n\t * Match the icon position with the linked image indicator brought by the link image feature.\n\t */\n\ttop: min(var(--ck-spacing-medium), 6%);\n\tright: min(var(--ck-spacing-medium), 6%);\n\tborder-radius: 50%;\n\tz-index: 1;\n\n\t&::after {\n\t\tcontent: "";\n\t\tposition: absolute;\n\t}\n}\n','/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-image-upload-icon: hsl(0, 0%, 100%);\n\t--ck-color-image-upload-icon-background: hsl(120, 100%, 27%);\n\n\t/* Match the icon size with the linked image indicator brought by the link image feature. */\n\t--ck-image-upload-icon-size: 20;\n\t--ck-image-upload-icon-width: 2px;\n\t--ck-image-upload-icon-is-visible: clamp(0px, 100% - 50px, 1px);\n}\n\n.ck-image-upload-complete-icon {\n\topacity: 0;\n\tbackground: var(--ck-color-image-upload-icon-background);\n\tanimation-name: ck-upload-complete-icon-show, ck-upload-complete-icon-hide;\n\tanimation-fill-mode: forwards, forwards;\n\tanimation-duration: 500ms, 500ms;\n\n\t/* To make animation scalable. */\n\tfont-size: calc(1px * var(--ck-image-upload-icon-size));\n\n\t/* Hide completed upload icon after 3 seconds. */\n\tanimation-delay: 0ms, 3000ms;\n\n\t/*\n\t * Use CSS math to simulate container queries.\n\t * https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\n\t */\n\toverflow: hidden;\n\twidth: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\n\theight: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\n\n\t/* This is check icon element made from border-width mixed with animations. */\n\t&::after {\n\t\t/* Because of border transformation we need to "hard code" left position. */\n\t\tleft: 25%;\n\n\t\ttop: 50%;\n\t\topacity: 0;\n\t\theight: 0;\n\t\twidth: 0;\n\n\t\ttransform: scaleX(-1) rotate(135deg);\n\t\ttransform-origin: left top;\n\t\tborder-top: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\n\t\tborder-right: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\n\n\t\tanimation-name: ck-upload-complete-icon-check;\n\t\tanimation-duration: 500ms;\n\t\tanimation-delay: 500ms;\n\t\tanimation-fill-mode: forwards;\n\n\t\t/* #1095. While reset is not providing proper box-sizing for pseudoelements, we need to handle it. */\n\t\tbox-sizing: border-box;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-show {\n\tfrom {\n\t\topacity: 0;\n\t}\n\n\tto {\n\t\topacity: 1;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-hide {\n\tfrom {\n\t\topacity: 1;\n\t}\n\n\tto {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-check {\n\t0% {\n\t\topacity: 1;\n\t\twidth: 0;\n\t\theight: 0;\n\t}\n\t33% {\n\t\twidth: 0.3em;\n\t\theight: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t\twidth: 0.3em;\n\t\theight: 0.45em;\n\t}\n}\n'],sourceRoot:""}]);const a=r},825:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadloader.css"],names:[],mappings:"AAKA,kCAGC,kBAAmB,CADnB,YAAa,CAEb,sBAAuB,CAEvB,MAAO,CALP,iBAAkB,CAIlB,KAOD,CAJC,yCACC,UAAW,CACX,iBACD,CCXD,MACC,4CAAqD,CACrD,wCAAyC,CACzC,8CACD,CAEA,iCAGC,QAAS,CADT,UAgBD,CAbC,8CACC,sGACD,CAEA,qCAOC,4DACD,CAGD,kCAEC,WAAY,CADZ,UAWD,CARC,yCAMC,yDAA0D,CAH1D,iBAAkB,CAElB,kCAAmC,CADnC,8DAA+D,CAF/D,+CAAgD,CADhD,8CAMD,CAGD,wCACC,GACC,uBACD,CACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-upload-placeholder-loader {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttop: 0;\n\tleft: 0;\n\n\t&::before {\n\t\tcontent: '';\n\t\tposition: relative;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-upload-placeholder-loader: hsl(0, 0%, 70%);\n\t--ck-upload-placeholder-loader-size: 32px;\n\t--ck-upload-placeholder-image-aspect-ratio: 2.8;\n}\n\n.ck .ck-image-upload-placeholder {\n\t/* We need to control the full width of the SVG gray background. */\n\twidth: 100%;\n\tmargin: 0;\n\n\t&.image-inline {\n\t\twidth: calc( 2 * var(--ck-upload-placeholder-loader-size) * var(--ck-upload-placeholder-image-aspect-ratio) );\n\t}\n\n\t& img {\n\t\t/*\n\t\t * This is an arbitrary aspect for a 1x1 px GIF to display to the user. Not too tall, not too short.\n\t\t * There's nothing special about this number except that it should make the image placeholder look like\n\t\t * a real image during this short period after the upload started and before the image was read from the\n\t\t * file system (and a rich preview was loaded).\n\t\t */\n\t\taspect-ratio: var(--ck-upload-placeholder-image-aspect-ratio);\n\t}\n}\n\n.ck .ck-upload-placeholder-loader {\n\twidth: 100%;\n\theight: 100%;\n\n\t&::before {\n\t\twidth: var(--ck-upload-placeholder-loader-size);\n\t\theight: var(--ck-upload-placeholder-loader-size);\n\t\tborder-radius: 50%;\n\t\tborder-top: 3px solid var(--ck-color-upload-placeholder-loader);\n\t\tborder-right: 2px solid transparent;\n\t\tanimation: ck-upload-placeholder-loader 1s linear infinite;\n\t}\n}\n\n@keyframes ck-upload-placeholder-loader {\n\tto {\n\t\ttransform: rotate( 360deg );\n\t}\n}\n"],sourceRoot:""}]);const a=r},870:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadprogress.css"],names:[],mappings:"AAMC,qEAEC,iBACD,CAGA,uGAIC,MAAO,CAFP,iBAAkB,CAClB,KAED,CCRC,yFACC,oBACD,CAID,uGAIC,gDAAiD,CAFjD,UAAW,CAGX,oBAAuB,CAFvB,OAGD,CAGD,kBACC,GAAO,SAAY,CACnB,GAAO,SAAY,CACpB",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t& .image,\n\t& .image-inline {\n\t\tposition: relative;\n\t}\n\n\t/* Upload progress bar. */\n\t& .image .ck-progress-bar,\n\t& .image-inline .ck-progress-bar {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t& .image,\n\t& .image-inline {\n\t\t/* Showing animation. */\n\t\t&.ck-appear {\n\t\t\tanimation: fadeIn 700ms;\n\t\t}\n\t}\n\n\t/* Upload progress bar. */\n\t& .image .ck-progress-bar,\n\t& .image-inline .ck-progress-bar {\n\t\theight: 2px;\n\t\twidth: 0;\n\t\tbackground: var(--ck-color-upload-bar-background);\n\t\ttransition: width 100ms;\n\t}\n}\n\n@keyframes fadeIn {\n\tfrom { opacity: 0; }\n\tto { opacity: 1; }\n}\n"],sourceRoot:""}]);const a=r},831:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css"],names:[],mappings:"AAOA,6BACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,oDACC,oBACD,CAEA,uCACC,YACD,CCZA,oCDCD,6BAcE,cAUF,CARE,oDACC,eACD,CAEA,wCACC,cACD,CCrBD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-text-alternative-form {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-labeled-field-view {\n\t\tdisplay: inline-block;\n\t}\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},399:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/link.css"],names:[],mappings:"AAMA,sBACC,mDAMD,CAHC,wCACC,yFACD,CAOD,4BACC,8CACD,CAGA,sCAEC,gDAAiD,CADjD,WAAY,CAEZ,iBAAkB,CAClB,oCACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Class added to span element surrounding currently selected link. */\n.ck .ck-link_selected {\n\tbackground: var(--ck-color-link-selected-background);\n\n\t/* Give linked inline images some outline to let the user know they are also part of the link. */\n\t& span.image-inline {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background);\n\t}\n}\n\n/*\n * Classes used by the "fake visual selection" displayed in the content when an input\n * in the link UI has focus (the browser does not render the native selection in this state).\n */\n.ck .ck-fake-link-selection {\n\tbackground: var(--ck-color-link-fake-selection);\n}\n\n/* A collapsed fake visual selection. */\n.ck .ck-fake-link-selection_collapsed {\n\theight: 100%;\n\tborder-right: 1px solid var(--ck-color-base-text);\n\tmargin-right: -1px;\n\toutline: solid 1px hsla(0, 0%, 100%, .5);\n}\n'],sourceRoot:""}]);const a=r},465:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkactions.css"],names:[],mappings:"AAOA,oBACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,8CACC,oBAKD,CAHC,gEACC,eACD,CCXD,oCDCD,oBAcE,cAUF,CARE,8CACC,eACD,CAEA,8DACC,cACD,CCrBD,CCKA,wDACC,cAAe,CACf,eAmCD,CAjCC,0EAEC,kCAAmC,CAEnC,cAAe,CAIf,+BAAgC,CAChC,aAAc,CARd,kCAAmC,CASnC,iBAAkB,CAPlB,sBAYD,CAHC,gFACC,yBACD,CAGD,mPAIC,eACD,CAEA,+DACC,eACD,CAGC,gFACC,yBACD,CAWD,qHACC,sCACD,CDvDD,oCC2DC,wDACC,8DAMD,CAJC,0EAEC,cAAe,CADf,WAED,CAGD,gJAME,aAEF,CD1ED",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-actions {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-link-actions__preview {\n\t\tdisplay: inline-block;\n\n\t\t& .ck-button__label {\n\t\t\toverflow: hidden;\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-link-actions__preview {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button:not(.ck-link-actions__preview) {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n@import "../mixins/_focus.css";\n@import "../mixins/_shadow.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-actions {\n\t& .ck-button.ck-link-actions__preview {\n\t\tpadding-left: 0;\n\t\tpadding-right: 0;\n\n\t\t& .ck-button__label {\n\t\t\tpadding: 0 var(--ck-spacing-medium);\n\t\t\tcolor: var(--ck-color-link-default);\n\t\t\ttext-overflow: ellipsis;\n\t\t\tcursor: pointer;\n\n\t\t\t/* Match the box model of the link editor form\'s input so the balloon\n\t\t\tdoes not change width when moving between actions and the form. */\n\t\t\tmax-width: var(--ck-input-width);\n\t\t\tmin-width: 3em;\n\t\t\ttext-align: center;\n\n\t\t\t&:hover {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\n\t\t&,\n\t\t&:hover,\n\t\t&:focus,\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&:focus {\n\t\t\t& .ck-button__label {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& .ck-button:not(:first-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& .ck-button:not(:last-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\t& .ck-button.ck-link-actions__preview {\n\t\t\tmargin: var(--ck-spacing-standard) var(--ck-spacing-standard) 0;\n\n\t\t\t& .ck-button__label {\n\t\t\t\tmin-width: 0;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\n\t\t& .ck-button:not(.ck-link-actions__preview) {\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},827:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{border:0;border-radius:0;border-top:1px solid var(--ck-color-base-border);margin:0;padding:var(--ck-spacing-standard);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkform.css"],names:[],mappings:"AAOA,iBACC,YAiBD,CAfC,2BACC,YACD,CCNA,oCDCD,iBAQE,cAUF,CARE,wCACC,eACD,CAEA,4BACC,cACD,CCfD,CDuBD,iCACC,aAYD,CALE,wHAEC,mCACD,CE/BF,iCAEC,+BAAgC,CADhC,SA+CD,CA5CC,wDACC,8EAMD,CAJC,uEACC,WAAY,CACZ,UACD,CAGD,4CAIC,QAAS,CADT,eAAgB,CAEhB,gDAAiD,CAHjD,QAAS,CADT,kCAAmC,CAKnC,SAaD,CAnBA,4GAaE,aAMF,CAJE,mEACC,kDACD,CAKF,6CACC,yDAWD,CATC,wEACC,QAAS,CACT,SAAU,CACV,UAKD,CAHC,8EACC,eACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-form {\n\tdisplay: flex;\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n\n/*\n * Style link form differently when manual decorators are available.\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\n */\n.ck.ck-link-form_layout-vertical {\n\tdisplay: block;\n\n\t/*\n\t * Whether the form is in the responsive mode or not, if there are decorator buttons\n\t * keep the top margin of action buttons medium.\n\t */\n\t& .ck-button {\n\t\t&.ck-button-save,\n\t\t&.ck-button-cancel {\n\t\t\tmargin-top: var(--ck-spacing-medium);\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n/*\n * Style link form differently when manual decorators are available.\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\n */\n.ck.ck-link-form_layout-vertical {\n\tpadding: 0;\n\tmin-width: var(--ck-input-width);\n\n\t& .ck-labeled-field-view {\n\t\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small);\n\n\t\t& .ck-input-text {\n\t\t\tmin-width: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\n\t& .ck-button {\n\t\tpadding: var(--ck-spacing-standard);\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tborder: 0;\n\t\tborder-top: 1px solid var(--ck-color-base-border);\n\t\twidth: 50%;\n\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-left: 0;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-left: 0;\n\n\t\t\t&:last-of-type {\n\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Using additional `.ck` class for stronger CSS specificity than `.ck.ck-link-form > :not(:first-child)`. */\n\t& .ck.ck-list {\n\t\tmargin: var(--ck-spacing-standard) var(--ck-spacing-large);\n\n\t\t& .ck-button.ck-switchbutton {\n\t\t\tborder: 0;\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\n\t\t\t&:hover {\n\t\t\t\tbackground: none;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},499:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;justify-content:left;position:relative}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{opacity:1;visibility:visible}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{-webkit-appearance:none;border:1px solid transparent;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:var(--ck-spacing-small);margin-right:calc(var(--ck-spacing-small)*-1)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/button.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/mixins/_button.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css"],names:[],mappings:"AAQA,6BCCC,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD6BD,CE/BC,qDACC,aAqBD,CAHC,oBAnBD,qDAoBE,YAEF,CADC,CFvBF,6BAOC,kBAAmB,CADnB,mBAAoB,CAEpB,oBAAqB,CAHrB,iBA4BD,CAvBC,iEACC,YACD,CAGC,yGACC,oBACD,CAID,iFACC,sBACD,CEkBA,iEAEC,SAAU,CADV,kBAED,CAbA,yFACC,YACD,CC7BD,6BCAC,oDD0ID,CCvIE,6EACC,0DACD,CAEA,+EACC,2DAA4C,CAC5C,uEACD,CAID,qDACC,6DACD,CDhBD,6BEDC,eF2ID,CA1IA,wIEGE,qCFuIF,CA1IA,6BA6BC,uBAAwB,CANxB,4BAA6B,CAjB7B,cAAe,CAcf,iBAAkB,CAHlB,aAAc,CAJd,4CAA6C,CAD7C,2CAA4C,CAJ5C,8BAA+B,CAC/B,iBAAkB,CAiBlB,4DAA8D,CAnB9D,qBAAsB,CAFtB,kBAqID,CA3GC,oFGhCA,2BAA2B,CCF3B,2CAA8B,CDC9B,YHqCA,CAIC,kJAEC,aACD,CAGD,iEAIC,aAAc,CACd,cAAe,CAHf,iBAAkB,CAClB,mBAAoB,CAMpB,qBASD,CAlBA,qFAYE,eAMF,CAlBA,qFAgBE,gBAEF,CAEA,yEACC,aAYD,CAbA,6FAIE,mCASF,CAbA,6FAQE,oCAKF,CAbA,yEAWC,eAAiB,CACjB,UACD,CAIC,oIIrFD,oDJyFC,CAEA,uFK3FD,kCL6FC,CAGA,yFKhGD,kCLkGC,CAEA,iGACC,UACD,CAGD,qEACC,yDAcD,CAXC,2HAEE,4CAA+C,CAC/C,oCAOF,CAVA,2HAQE,mCAAoC,CADpC,6CAGF,CAKA,mHACC,WACD,CAID,yCC/HA,+CDiIA,CC9HC,yFACC,qDACD,CAEA,2FACC,sDAA4C,CAC5C,kEACD,CAID,iEACC,wDACD,CDmHA,2DACC,iCACD,CAEA,+DACC,mCACD,CAID,2CC7IC,mDDkJD,CC/IE,2FACC,yDACD,CAEA,6FACC,0DAA4C,CAC5C,sEACD,CAID,mEACC,4DACD,CD6HD,2CAIC,wCACD,CAEA,uCAEC,eACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../mixins/_unselectable.css";\n@import "../tooltip/mixins/_tooltip.css";\n\n.ck.ck-button,\na.ck.ck-button {\n\t@mixin ck-unselectable;\n\t@mixin ck-tooltip_enabled;\n\n\tposition: relative;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: left;\n\n\t& .ck-button__label {\n\t\tdisplay: none;\n\t}\n\n\t&.ck-button_with-text {\n\t\t& .ck-button__label {\n\t\t\tdisplay: inline-block;\n\t\t}\n\t}\n\n\t/* Center the icon horizontally in a button without text. */\n\t&:not(.ck-button_with-text) {\n\t\tjustify-content: center;\n\t}\n\n\t&:hover {\n\t\t@mixin ck-tooltip_visible;\n\t}\n\n\t/* Get rid of the native focus outline around the tooltip when focused (but not :hover). */\n\t&:focus:not(:hover) {\n\t\t@mixin ck-tooltip_disabled;\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_focus.css";\n@import "../../../mixins/_shadow.css";\n@import "../../../mixins/_disabled.css";\n@import "../../../mixins/_rounded.css";\n@import "../../mixins/_button.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck.ck-button,\na.ck.ck-button {\n\t@mixin ck-button-colors --ck-color-button-default;\n\t@mixin ck-rounded-corners;\n\n\twhite-space: nowrap;\n\tcursor: default;\n\tvertical-align: middle;\n\tpadding: var(--ck-spacing-tiny);\n\ttext-align: center;\n\n\t/* A very important piece of styling. Go to variable declaration to learn more. */\n\tmin-width: var(--ck-ui-component-min-height);\n\tmin-height: var(--ck-ui-component-min-height);\n\n\t/* Normalize the height of the line. Removing this will break consistent height\n\tamong text and text-less buttons (with icons). */\n\tline-height: 1;\n\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t/* Avoid flickering when the foucs border shows up. */\n\tborder: 1px solid transparent;\n\n\t/* Apply some smooth transition to the box-shadow and border. */\n\ttransition: box-shadow .2s ease-in-out, border .2s ease-in-out;\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/189 */\n\t-webkit-appearance: none;\n\n\t&:active,\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t}\n\n\t/* Allow icon coloring using the text "color" property. */\n\t& .ck-button__icon {\n\t\t& use,\n\t\t& use * {\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n\n\t& .ck-button__label {\n\t\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t\tcolor: inherit;\n\t\tcursor: inherit;\n\n\t\t/* Must be consistent with .ck-icon\'s vertical align. Otherwise, buttons with and\n\t\twithout labels (but with icons) have different sizes in Chrome */\n\t\tvertical-align: middle;\n\n\t\t@mixin ck-dir ltr {\n\t\t\ttext-align: left;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\ttext-align: right;\n\t\t}\n\t}\n\n\t& .ck-button__keystroke {\n\t\tcolor: inherit;\n\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-left: var(--ck-spacing-large);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-right: var(--ck-spacing-large);\n\t\t}\n\n\t\tfont-weight: bold;\n\t\topacity: .7;\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\n\t&.ck-disabled {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t/* The disabled button should have a slightly less visible shadow when focused. */\n\t\t\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\n\t\t}\n\n\t\t& .ck-button__icon {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\n\t\t& .ck-button__label {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t& .ck-button__keystroke {\n\t\t\topacity: .3;\n\t\t}\n\t}\n\n\t&.ck-button_with-text {\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-standard);\n\n\t\t/* stylelint-disable-next-line no-descending-specificity */\n\t\t& .ck-button__icon {\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: calc(-1 * var(--ck-spacing-small));\n\t\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-right: calc(-1 * var(--ck-spacing-small));\n\t\t\t\tmargin-left: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\t}\n\n\t&.ck-button_with-keystroke {\n\t\t/* stylelint-disable-next-line no-descending-specificity */\n\t\t& .ck-button__label {\n\t\t\tflex-grow: 1;\n\t\t}\n\t}\n\n\t/* A style of the button which is currently on, e.g. its feature is active. */\n\t&.ck-on {\n\t\t@mixin ck-button-colors --ck-color-button-on;\n\t}\n\n\t&.ck-button-save {\n\t\tcolor: var(--ck-color-button-save);\n\t}\n\n\t&.ck-button-cancel {\n\t\tcolor: var(--ck-color-button-cancel);\n\t}\n}\n\n/* A style of the button which handles the primary action. */\n.ck.ck-button-action,\na.ck.ck-button-action {\n\t@mixin ck-button-colors --ck-color-button-action;\n\n\tcolor: var(--ck-color-button-action-text);\n}\n\n.ck.ck-button-bold,\na.ck.ck-button-bold {\n\tfont-weight: bold;\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements a button of given background color.\n *\n * @param {String} $background - Background color of the button.\n * @param {String} $border - Border color of the button.\n */\n@define-mixin ck-button-colors $prefix {\n\tbackground: var($(prefix)-background);\n\n\t&:not(.ck-disabled) {\n\t\t&:hover {\n\t\t\tbackground: var($(prefix)-hover-background);\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: var($(prefix)-active-background);\n\t\t\tbox-shadow: inset 0 2px 2px var($(prefix)-active-shadow);\n\t\t}\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\n\t&.ck-disabled {\n\t\tbackground: var($(prefix)-disabled-background);\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n"],sourceRoot:""}]);const a=r},681:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{background:var(--ck-color-switch-button-off-background);transition:background .4s ease;width:var(--ck-switch-button-toggle-width)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);height:var(--ck-switch-button-toggle-inner-size);margin:var(--ck-switch-button-toggle-spacing);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var( --ck-switch-button-translation ))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var( --ck-switch-button-translation )*-1))}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/switchbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css"],names:[],mappings:"AASE,4HACC,aACD,CCCF,MAEC,8CAA+C,CAE/C,mDAAoD,CACpD,qCAAsC,CACtC,gKAKD,CAGC,0DAGE,4CAOF,CAVA,0DAQE,2CAEF,CAEA,iDC3BA,eDoEA,CAzCA,yICvBC,qCDgED,CAzCA,2DAKE,gBAoCF,CAzCA,2DAUE,iBA+BF,CAzCA,iDAiBC,uDAAwD,CAHxD,8BAAiC,CAEjC,0CAyBD,CAtBC,2EC9CD,eD2DC,CAbA,6LC1CA,qCAAsC,CD4CpC,8CAWF,CAbA,2EASC,yDAA0D,CAD1D,gDAAiD,CAFjD,6CAA8C,CAM9C,uBAA0B,CAL1B,+CAMD,CAEA,uDACC,6DAKD,CAHC,iFACC,+DACD,CAIF,6DExEA,kCF0EA,CAEA,uDACC,sDAkBD,CAhBC,6DACC,4DACD,CAEA,2FAKE,2DAMF,CAXA,2FASE,oEAEF",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-button.ck-switchbutton {\n\t& .ck-button__toggle {\n\t\tdisplay: block;\n\n\t\t& .ck-button__toggle__inner {\n\t\t\tdisplay: block;\n\t\t}\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_disabled.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n/* Note: To avoid rendering issues (aliasing) but to preserve the responsive nature\nof the component, floating–point numbers have been used which, for the default font size\n(see: --ck-font-size-base), will generate simple integers. */\n:root {\n\t/* 34px at 13px font-size */\n\t--ck-switch-button-toggle-width: 2.6153846154em;\n\t/* 14px at 13px font-size */\n\t--ck-switch-button-toggle-inner-size: 1.0769230769em;\n\t--ck-switch-button-toggle-spacing: 1px;\n\t--ck-switch-button-translation: calc(\n\t\tvar(--ck-switch-button-toggle-width) -\n\t\tvar(--ck-switch-button-toggle-inner-size) -\n\t\t2 * var(--ck-switch-button-toggle-spacing)\n\t);\n}\n\n.ck.ck-button.ck-switchbutton {\n\t& .ck-button__label {\n\t\t@mixin ck-dir ltr {\n\t\t\t/* Separate the label from the switch */\n\t\t\tmargin-right: calc(2 * var(--ck-spacing-large));\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t/* Separate the label from the switch */\n\t\t\tmargin-left: calc(2 * var(--ck-spacing-large));\n\t\t}\n\t}\n\n\t& .ck-button__toggle {\n\t\t@mixin ck-rounded-corners;\n\n\t\t@mixin ck-dir ltr {\n\t\t\t/* Make sure the toggle is always to the right as far as possible. */\n\t\t\tmargin-left: auto;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t/* Make sure the toggle is always to the left as far as possible. */\n\t\t\tmargin-right: auto;\n\t\t}\n\n\t\t/* Gently animate the background color of the toggle switch */\n\t\ttransition: background 400ms ease;\n\n\t\twidth: var(--ck-switch-button-toggle-width);\n\t\tbackground: var(--ck-color-switch-button-off-background);\n\n\t\t& .ck-button__toggle__inner {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-radius: calc(.5 * var(--ck-border-radius));\n\t\t\t}\n\n\t\t\t/* Leave some tiny bit of space around the inner part of the switch */\n\t\t\tmargin: var(--ck-switch-button-toggle-spacing);\n\t\t\twidth: var(--ck-switch-button-toggle-inner-size);\n\t\t\theight: var(--ck-switch-button-toggle-inner-size);\n\t\t\tbackground: var(--ck-color-switch-button-inner-background);\n\n\t\t\t/* Gently animate the inner part of the toggle switch */\n\t\t\ttransition: all 300ms ease;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground: var(--ck-color-switch-button-off-hover-background);\n\n\t\t\t& .ck-button__toggle__inner {\n\t\t\t\tbox-shadow: 0 0 0 5px var(--ck-color-switch-button-inner-shadow);\n\t\t\t}\n\t\t}\n\t}\n\n\t&.ck-disabled .ck-button__toggle {\n\t\t@mixin ck-disabled;\n\t}\n\n\t&.ck-on .ck-button__toggle {\n\t\tbackground: var(--ck-color-switch-button-on-background);\n\n\t\t&:hover {\n\t\t\tbackground: var(--ck-color-switch-button-on-hover-background);\n\t\t}\n\n\t\t& .ck-button__toggle__inner {\n\t\t\t/*\n\t\t\t * Move the toggle switch to the right. It will be animated.\n\t\t\t */\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\ttransform: translateX( var( --ck-switch-button-translation ) );\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\ttransform: translateX( calc( -1 * var( --ck-switch-button-translation ) ) );\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n"],sourceRoot:""}]);const a=r},923:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-color-grid-tile-size)}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorgrid/colorgrid.css"],names:[],mappings:"AAKA,kBACC,YACD,CCAA,MACC,8BAA+B,CAK/B,qCACD,CAEA,kBACC,YAAa,CACb,WACD,CAEA,wBAOC,QAAS,CALT,qCAAsC,CAEtC,yCAA0C,CAD1C,wCAAyC,CAEzC,SAAU,CACV,8BAA+B,CAL/B,oCAyCD,CAjCC,oCACC,YAAa,CACb,gBACD,CAEA,4DACC,gDACD,CAEA,oCAEC,2CAA4C,CAD5C,YAED,CAEA,8BACC,8FAKD,CAHC,0CACC,aACD,CAGD,8HAIC,QACD,CAEA,gGAEC,iGACD,CAGD,yBACC,oCACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-color-grid {\n\tdisplay: grid;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n\n:root {\n\t--ck-color-grid-tile-size: 24px;\n\n\t/* Not using global colors here because these may change but some colors in a pallette\n\t * require special treatment. For instance, this ensures no matter what the UI text color is,\n\t * the check icon will look good on the black color tile. */\n\t--ck-color-color-grid-check-icon: hsl(0, 0%, 0%);\n}\n\n.ck.ck-color-grid {\n\tgrid-gap: 5px;\n\tpadding: 8px;\n}\n\n.ck.ck-color-grid__tile {\n\twidth: var(--ck-color-grid-tile-size);\n\theight: var(--ck-color-grid-tile-size);\n\tmin-width: var(--ck-color-grid-tile-size);\n\tmin-height: var(--ck-color-grid-tile-size);\n\tpadding: 0;\n\ttransition: .2s ease box-shadow;\n\tborder: 0;\n\n\t&.ck-disabled {\n\t\tcursor: unset;\n\t\ttransition: unset;\n\t}\n\n\t&.ck-color-table__color-tile_bordered {\n\t\tbox-shadow: 0 0 0 1px var(--ck-color-base-border);\n\t}\n\n\t& .ck.ck-icon {\n\t\tdisplay: none;\n\t\tcolor: var(--ck-color-color-grid-check-icon);\n\t}\n\n\t&.ck-on {\n\t\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-base-text);\n\n\t\t& .ck.ck-icon {\n\t\t\tdisplay: block;\n\t\t}\n\t}\n\n\t&.ck-on,\n\t&:focus:not( .ck-disabled ),\n\t&:hover:not( .ck-disabled ) {\n\t\t/* Disable the default .ck-button\'s border ring. */\n\t\tborder: 0;\n\t}\n\n\t&:focus:not( .ck-disabled ),\n\t&:hover:not( .ck-disabled ) {\n\t\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-focus-border);\n\t}\n}\n\n.ck.ck-color-grid__label {\n\tpadding: 0 var(--ck-spacing-standard);\n}\n'],sourceRoot:""}]);const a=r},488:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-modal)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{overflow:hidden;text-overflow:ellipsis;width:7em}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/dropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,MACC,4BACD,CAEA,gBACC,oBAAqB,CACrB,iBAqFD,CAnFC,oCACC,mBAAoB,CACpB,2BACD,CAGA,+CACC,UAOD,CCUA,iEACC,YACD,CDVA,oCAGC,kCAAmC,CAEnC,YAAa,CAEb,sCAAuC,CAEvC,iBAAkB,CAHlB,yBA4DD,CAvDC,+DACC,oBACD,CAEA,mSAKC,WACD,CAEA,mSAUC,WAAY,CADZ,QAED,CAEA,oHAEC,MACD,CAEA,oHAEC,OACD,CAEA,kHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAQF,mCACC,mCACD,CEhGA,MACC,sDACD,CAEA,gBAEC,iBA2ED,CAzEC,oCACC,mCACD,CAGC,8CAIC,sCAAuC,CAHvC,gCAID,CAIA,8CACC,+BAAgC,CAGhC,oCACD,CAGD,gDC/BA,kCDiCA,CAIE,mFAEC,oCACD,CAIA,mFAEC,qCACD,CAID,iEAEC,eAAgB,CAChB,sBAAuB,CAFvB,SAGD,CAGA,6EC1DD,kCD4DC,CAGA,qDACC,2BAA4B,CAC5B,4BACD,CAEA,sGACC,UACD,CAGA,yHAEC,eAKD,CAHC,qIE7EF,2CF+EE,CAKH,uBGlFC,eH8GD,CA5BA,qFG9EE,qCH0GF,CA5BA,uBAIC,oDAAqD,CACrD,sDAAuD,CACvD,QAAS,CE1FT,oCAA8B,CF6F9B,cAmBD,CAfC,6CACC,wBACD,CAEA,6CACC,yBACD,CAEA,6CACC,2BACD,CAEA,6CACC,4BACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../tooltip/mixins/_tooltip.css\";\n\n:root {\n\t--ck-dropdown-max-width: 75vw;\n}\n\n.ck.ck-dropdown {\n\tdisplay: inline-block;\n\tposition: relative;\n\n\t& .ck-dropdown__arrow {\n\t\tpointer-events: none;\n\t\tz-index: var(--ck-z-default);\n\t}\n\n\t/* Dropdown button should span horizontally, e.g. in vertical toolbars */\n\t& .ck-button.ck-dropdown__button {\n\t\twidth: 100%;\n\n\t\t/* Disable main button's tooltip when the dropdown is open. Otherwise the panel may\n\t\tpartially cover the tooltip */\n\t\t&.ck-on {\n\t\t\t@mixin ck-tooltip_disabled;\n\t\t}\n\t}\n\n\t& .ck-dropdown__panel {\n\t\t/* This is to get rid of flickering when the tooltip is shown under the panel,\n\t\twhich looks like the panel moves vertically a pixel down and up. */\n\t\t-webkit-backface-visibility: hidden;\n\n\t\tdisplay: none;\n\t\tz-index: var(--ck-z-modal);\n\t\tmax-width: var(--ck-dropdown-max-width);\n\n\t\tposition: absolute;\n\n\t\t&.ck-dropdown__panel-visible {\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t&.ck-dropdown__panel_ne,\n\t\t&.ck-dropdown__panel_nw,\n\t\t&.ck-dropdown__panel_n,\n\t\t&.ck-dropdown__panel_nmw,\n\t\t&.ck-dropdown__panel_nme {\n\t\t\tbottom: 100%;\n\t\t}\n\n\t\t&.ck-dropdown__panel_se,\n\t\t&.ck-dropdown__panel_sw,\n\t\t&.ck-dropdown__panel_smw,\n\t\t&.ck-dropdown__panel_sme,\n\t\t&.ck-dropdown__panel_s {\n\t\t\t/*\n\t\t\t * Using transform: translate3d( 0, 100%, 0 ) causes blurry dropdown on Chrome 67-78+ on non-retina displays.\n\t\t\t * See https://github.com/ckeditor/ckeditor5/issues/1053.\n\t\t\t */\n\t\t\ttop: 100%;\n\t\t\tbottom: auto;\n\t\t}\n\n\t\t&.ck-dropdown__panel_ne,\n\t\t&.ck-dropdown__panel_se {\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t&.ck-dropdown__panel_nw,\n\t\t&.ck-dropdown__panel_sw {\n\t\t\tright: 0px;\n\t\t}\n\n\t\t&.ck-dropdown__panel_s,\n\t\t&.ck-dropdown__panel_n {\n\t\t\t/* Positioning panels relative to the center of the button */\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\n\t\t&.ck-dropdown__panel_nmw,\n\t\t&.ck-dropdown__panel_smw {\n\t\t\t/* Positioning panels relative to the middle-west of the button */\n\t\t\tleft: 75%;\n\t\t\ttransform: translateX(-75%);\n\t\t}\n\n\t\t&.ck-dropdown__panel_nme,\n\t\t&.ck-dropdown__panel_sme {\n\t\t\t/* Positioning panels relative to the middle-east of the button */\n\t\t\tleft: 25%;\n\t\t\ttransform: translateX(-25%);\n\t\t}\n\t}\n}\n\n/*\n * Toolbar dropdown panels should be always above the UI (eg. other dropdown panels) from the editor's content.\n * See https://github.com/ckeditor/ckeditor5/issues/7874\n */\n.ck.ck-toolbar .ck-dropdown__panel {\n\tz-index: calc( var(--ck-z-modal) + 1 );\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_disabled.css";\n@import "../../../mixins/_shadow.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n:root {\n\t--ck-dropdown-arrow-size: calc(0.5 * var(--ck-icon-size));\n}\n\n.ck.ck-dropdown {\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t& .ck-dropdown__arrow {\n\t\twidth: var(--ck-dropdown-arrow-size);\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& .ck-dropdown__arrow {\n\t\t\tright: var(--ck-spacing-standard);\n\n\t\t\t/* A space to accommodate the triangle. */\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& .ck-dropdown__arrow {\n\t\t\tleft: var(--ck-spacing-standard);\n\n\t\t\t/* A space to accommodate the triangle. */\n\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t}\n\t}\n\n\t&.ck-disabled .ck-dropdown__arrow {\n\t\t@mixin ck-disabled;\n\t}\n\n\t& .ck-button.ck-dropdown__button {\n\t\t@mixin ck-dir ltr {\n\t\t\t&:not(.ck-button_with-text) {\n\t\t\t\t/* Make sure dropdowns with just an icon have the right inner spacing */\n\t\t\t\tpadding-left: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t&:not(.ck-button_with-text) {\n\t\t\t\t/* Make sure dropdowns with just an icon have the right inner spacing */\n\t\t\t\tpadding-right: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\n\t\t/* #23 */\n\t\t& .ck-button__label {\n\t\t\twidth: 7em;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\n\t\t&.ck-disabled .ck-button__label {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5/issues/816 */\n\t\t&.ck-on {\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t&.ck-dropdown__button_label-width_auto .ck-button__label {\n\t\t\twidth: auto;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5/issues/8699 */\n\t\t&.ck-off:active,\n\t\t&.ck-on:active {\n\t\t\tbox-shadow: none;\n\t\t\t\n\t\t\t&:focus {\n\t\t\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-dropdown__panel {\n\t@mixin ck-rounded-corners;\n\t@mixin ck-drop-shadow;\n\n\tbackground: var(--ck-color-dropdown-panel-background);\n\tborder: 1px solid var(--ck-color-dropdown-panel-border);\n\tbottom: 0;\n\n\t/* Make sure the panel is at least as wide as the drop-down\'s button. */\n\tmin-width: 100%;\n\n\t/* Disabled corner border radius to be consistent with the .dropdown__button\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t&.ck-dropdown__panel_se {\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_sw {\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_ne {\n\t\tborder-bottom-left-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_nw {\n\t\tborder-bottom-right-radius: 0;\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},875:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/listdropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,6CCIC,eDqBD,CAzBA,iICQE,qCAAsC,CDJtC,wBAqBF,CAfE,mFCND,eDYC,CANA,6MCFA,qCAAsC,CDKpC,2BAA4B,CAC5B,4BAA6B,CAF7B,wBAIF,CAEA,kFCdD,eDmBC,CALA,2MCVA,qCAAsC,CDYpC,wBAAyB,CACzB,yBAEF",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n\n.ck.ck-dropdown .ck-dropdown__panel .ck-list {\n\t/* Disabled radius of top-left border to be consistent with .dropdown__button\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t@mixin ck-rounded-corners {\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t/* Make sure the button belonging to the first/last child of the list goes well with the\n\tborder radius of the entire panel. */\n\t& .ck-list__item {\n\t\t&:first-child .ck-button {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-top-left-radius: 0;\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\t\t}\n\n\t\t&:last-child .ck-button {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-top-left-radius: 0;\n\t\t\t\tborder-top-right-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},66:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:"";height:100%;position:absolute;width:1px}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/splitbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,mBAEC,iBAUD,CARC,iDACC,qCACD,CC0BA,8DACC,YACD,CClCD,MACC,gDAAyD,CACzD,4CACD,CAMC,oIAKE,gCAAiC,CADjC,6BASF,CAbA,oIAWE,+BAAgC,CADhC,4BAGF,CAEA,0CAGC,eAiBD,CApBA,oDAQE,+BAAgC,CADhC,4BAaF,CApBA,oDAcE,gCAAiC,CADjC,6BAOF,CAHC,8CACC,mCACD,CASA,0KACC,wDACD,CAIA,8JAKC,0DAA2D,CAJ3D,UAAW,CAGX,WAAY,CAFZ,iBAAkB,CAClB,SAGD,CAGC,kLACC,SACD,CAIA,kLACC,UACD,CAMF,uCC7EA,eDuFA,CAVA,qHCzEC,qCDmFD,CARE,qKACC,2BACD,CAEA,mKACC,4BACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../tooltip/mixins/_tooltip.css";\n\n.ck.ck-splitbutton {\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t& .ck-splitbutton__action:focus {\n\t\tz-index: calc(var(--ck-z-default) + 1);\n\t}\n\n\t/* Disable tooltips for the buttons when the button is "open" */\n\t&.ck-splitbutton_open > .ck-button {\n\t\t@mixin ck-tooltip_disabled;\n\t}\n}\n\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n\n:root {\n\t--ck-color-split-button-hover-background: hsl(0, 0%, 92%);\n\t--ck-color-split-button-hover-border: hsl(0, 0%, 70%);\n}\n\n.ck.ck-splitbutton {\n\t/*\n\t * Note: ck-rounded and ck-dir mixins don\'t go together (because they both use @nest).\n\t */\n\t&:hover > .ck-splitbutton__action,\n\t&.ck-splitbutton_open > .ck-splitbutton__action {\n\t\t@nest [dir="ltr"] & {\n\t\t\t/* Don\'t round the action button on the right side */\n\t\t\tborder-top-right-radius: unset;\n\t\t\tborder-bottom-right-radius: unset;\n\t\t}\n\n\t\t@nest [dir="rtl"] & {\n\t\t\t/* Don\'t round the action button on the left side */\n\t\t\tborder-top-left-radius: unset;\n\t\t\tborder-bottom-left-radius: unset;\n\t\t}\n\t}\n\n\t& > .ck-splitbutton__arrow {\n\t\t/* It\'s a text-less button and since the icon is positioned absolutely in such situation,\n\t\tit must get some arbitrary min-width. */\n\t\tmin-width: unset;\n\n\t\t@nest [dir="ltr"] & {\n\t\t\t/* Don\'t round the arrow button on the left side */\n\t\t\tborder-top-left-radius: unset;\n\t\t\tborder-bottom-left-radius: unset;\n\t\t}\n\n\t\t@nest [dir="rtl"] & {\n\t\t\t/* Don\'t round the arrow button on the right side */\n\t\t\tborder-top-right-radius: unset;\n\t\t\tborder-bottom-right-radius: unset;\n\t\t}\n\n\t\t& svg {\n\t\t\twidth: var(--ck-dropdown-arrow-size);\n\t\t}\n\t}\n\n\t/* When the split button is "open" (the arrow is on) or being hovered, it should get some styling\n\tas a whole. The background of both buttons should stand out and there should be a visual\n\tseparation between both buttons. */\n\t&.ck-splitbutton_open,\n\t&:hover {\n\t\t/* When the split button hovered as a whole, not as individual buttons. */\n\t\t& > .ck-button:not(.ck-on):not(.ck-disabled):not(:hover) {\n\t\t\tbackground: var(--ck-color-split-button-hover-background);\n\t\t}\n\n\t\t/* Splitbutton separator needs to be set with the ::after pseudoselector\n\t\tto display properly the borders on focus */\n\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\tcontent: \'\';\n\t\t\tposition: absolute;\n\t\t\twidth: 1px;\n\t\t\theight: 100%;\n\t\t\tbackground-color: var(--ck-color-split-button-hover-border);\n\t\t}\n\n\t\t@nest [dir="ltr"] & {\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\t\tleft: -1px;\n\t\t\t}\n\t\t}\n\n\t\t@nest [dir="rtl"] & {\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\t\tright: -1px;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Don\'t round the bottom left and right corners of the buttons when "open"\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t&.ck-splitbutton_open {\n\t\t@mixin ck-rounded-corners {\n\t\t\t& > .ck-splitbutton__action {\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t}\n\n\t\t\t& > .ck-splitbutton__arrow {\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},75:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/toolbardropdown.css"],names:[],mappings:"AAKA,MACC,oCACD,CAEA,4CAGC,8CAA+C,CAD/C,iBAQD,CAJE,6DACC,qCACD,CCZF,oCACC,QACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-toolbar-dropdown-max-width: 60vw;\n}\n\n.ck.ck-toolbar-dropdown > .ck-dropdown__panel {\n\t/* https://github.com/ckeditor/ckeditor5/issues/5586 */\n\twidth: max-content;\n\tmax-width: var(--ck-toolbar-dropdown-max-width);\n\n\t& .ck-button {\n\t\t&:focus {\n\t\t\tz-index: calc(var(--ck-z-default) + 1);\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-toolbar-dropdown .ck-toolbar {\n\tborder: 0;\n}\n"],sourceRoot:""}]);const a=r},547:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/editorui/editorui.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAWA,MACC,0CACD,CAEA,yDCJC,eDWD,CAPA,yJCAE,qCDOF,CAJC,oEEPA,2BAA2B,CCF3B,qCAA8B,CDC9B,YFWA,CAGD,+BAGC,4BAA6B,CAF7B,aAAc,CACd,oCA6BD,CA1BC,wCACC,eACD,CAEA,wCACC,gBACD,CAGA,4CACC,kCACD,CAGA,2CAKC,qCACD,CAGA,sDACC,kDACD,CAKA,gEACC,mDACD,CAIA,gEACC,gDACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_disabled.css";\n@import "../../../mixins/_shadow.css";\n@import "../../../mixins/_focus.css";\n@import "../../mixins/_button.css";\n\n:root {\n\t--ck-color-editable-blur-selection: hsl(0, 0%, 85%);\n}\n\n.ck.ck-editor__editable:not(.ck-editor__nested-editable) {\n\t@mixin ck-rounded-corners;\n\n\t&.ck-focused {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-inner-shadow);\n\t}\n}\n\n.ck.ck-editor__editable_inline {\n\toverflow: auto;\n\tpadding: 0 var(--ck-spacing-standard);\n\tborder: 1px solid transparent;\n\n\t&[dir="ltr"] {\n\t\ttext-align: left;\n\t}\n\n\t&[dir="rtl"] {\n\t\ttext-align: right;\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/116 */\n\t& > *:first-child {\n\t\tmargin-top: var(--ck-spacing-large);\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5/issues/847 */\n\t& > *:last-child {\n\t\t/*\n\t\t * This value should match with the default margins of the block elements (like .media or .image)\n\t\t * to avoid a content jumping when the fake selection container shows up (See https://github.com/ckeditor/ckeditor5/issues/9825).\n\t\t */\n\t\tmargin-bottom: var(--ck-spacing-large);\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5/issues/6517 */\n\t&.ck-blurred ::selection {\n\t\tbackground: var(--ck-color-editable-blur-selection);\n\t}\n}\n\n/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/111 */\n.ck.ck-balloon-panel.ck-toolbar-container[class*="arrow_n"] {\n\t&::after {\n\t\tborder-bottom-color: var(--ck-color-base-foreground);\n\t}\n}\n\n.ck.ck-balloon-panel.ck-toolbar-container[class*="arrow_s"] {\n\t&::after {\n\t\tborder-top-color: var(--ck-color-base-foreground);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},523:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-form__header .ck-form__header__label{font-weight:700}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/formheader/formheader.css"],names:[],mappings:"AAKA,oBAIC,kBAAmB,CAHnB,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CAEjB,6BACD,CCNA,MACC,4BACD,CAEA,oBAIC,mDAAoD,CAFpD,mCAAoC,CACpC,wCAAyC,CAFzC,uDAQD,CAHC,4CACC,eACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-form__header {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\talign-items: center;\n\tjustify-content: space-between;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-form-header-height: 38px;\n}\n\n.ck.ck-form__header {\n\tpadding: var(--ck-spacing-small) var(--ck-spacing-large);\n\theight: var(--ck-form-header-height);\n\tline-height: var(--ck-form-header-height);\n\tborder-bottom: 1px solid var(--ck-color-base-border);\n\n\t& .ck-form__header__label {\n\t\tfont-weight: bold;\n\t}\n}\n"],sourceRoot:""}]);const a=r},174:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{font-size:.8333350694em;height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/icon/icon.css"],names:[],mappings:"AAKA,YACC,qBACD,CCFA,MACC,0EACD,CAEA,YAKC,uBAAwB,CAHxB,0BAA2B,CAD3B,yBAA0B,CAY1B,qBAcD,CAZC,0BARA,aAAc,CAGd,cAgBA,CAJC,yBAEC,iBACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-icon {\n\tvertical-align: middle;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-icon-size: calc(var(--ck-line-height-base) * var(--ck-font-size-normal));\n}\n\n.ck.ck-icon {\n\twidth: var(--ck-icon-size);\n\theight: var(--ck-icon-size);\n\n\t/* Multiplied by the height of the line in "px" should give SVG "viewport" dimensions */\n\tfont-size: .8333350694em;\n\n\tcolor: inherit;\n\n\t/* Inherit cursor style (#5). */\n\tcursor: inherit;\n\n\t/* This will prevent blurry icons on Firefox. See #340. */\n\twill-change: transform;\n\n\t& * {\n\t\t/* Inherit cursor style (#5). */\n\t\tcursor: inherit;\n\n\t\t/* Allows dynamic coloring of the icons. */\n\t\tcolor: inherit;\n\n\t\t&:not([fill]) {\n\t\t\t/* Needed by FF. */\n\t\t\tfill: currentColor;\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},985:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{border-radius:0}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/input/input.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AASA,MACC,qBAAsB,CAGtB,2CACD,CAEA,aCLC,eD2CD,CAtCA,iECDE,qCDuCF,CAtCA,aAGC,2CAA4C,CAC5C,6CAA8C,CAK9C,4CAA6C,CAH7C,+BAAgC,CADhC,6DAA8D,CAO9D,4DA0BD,CAxBC,mBEnBA,2BAA2B,CCF3B,2CAA8B,CDC9B,YFuBA,CAEA,uBAEC,oDAAqD,CADrD,sDAAuD,CAEvD,yCAMD,CAJC,6BG/BD,oDHkCC,CAGD,sBAEC,sCAAuC,CADvC,+CAMD,CAHC,4BGzCD,iDH2CC,CAIF,0BACC,IACC,0BACD,CAEA,IACC,yBACD,CAEA,IACC,0BACD,CAEA,IACC,yBACD,CACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_focus.css";\n@import "../../../mixins/_shadow.css";\n\n:root {\n\t--ck-input-width: 18em;\n\n\t/* Backward compatibility. */\n\t--ck-input-text-width: var(--ck-input-width);\n}\n\n.ck.ck-input {\n\t@mixin ck-rounded-corners;\n\n\tbackground: var(--ck-color-input-background);\n\tborder: 1px solid var(--ck-color-input-border);\n\tpadding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);\n\tmin-width: var(--ck-input-width);\n\n\t/* This is important to stay of the same height as surrounding buttons */\n\tmin-height: var(--ck-ui-component-min-height);\n\n\t/* Apply some smooth transition to the box-shadow and border. */\n\ttransition: box-shadow .1s ease-in-out, border .1s ease-in-out;\n\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t}\n\n\t&[readonly] {\n\t\tborder: 1px solid var(--ck-color-input-disabled-border);\n\t\tbackground: var(--ck-color-input-disabled-background);\n\t\tcolor: var(--ck-color-input-disabled-text);\n\n\t\t&:focus {\n\t\t\t/* The read-only input should have a slightly less visible shadow when focused. */\n\t\t\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\n\t\t}\n\t}\n\n\t&.ck-error {\n\t\tborder-color: var(--ck-color-input-error-border);\n\t\tanimation: ck-input-shake .3s ease both;\n\n\t\t&:focus {\n\t\t\t@mixin ck-box-shadow var(--ck-focus-error-outer-shadow);\n\t\t}\n\t}\n}\n\n@keyframes ck-input-shake {\n\t20% {\n\t\ttransform: translateX(-2px);\n\t}\n\n\t40% {\n\t\ttransform: translateX(2px);\n\t}\n\n\t60% {\n\t\ttransform: translateX(-1px);\n\t}\n\n\t80% {\n\t\ttransform: translateX(1px);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},751:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/label/label.css"],names:[],mappings:"AAKA,aACC,aACD,CAEA,mBACC,YACD,CCNA,aACC,eACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-label {\n\tdisplay: block;\n}\n\n.ck.ck-voice-label {\n\tdisplay: none;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-label {\n\tfont-weight: bold;\n}\n"],sourceRoot:""}]);const a=r},111:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/labeledfield/labeledfieldview.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAMC,mEACC,YAAa,CACb,iBACD,CAEA,uCACC,aAAc,CACd,iBACD,CCND,MACC,kEAAsE,CACtE,gFAAiF,CACjF,yEACD,CAEA,0BCHC,eD4GD,CAzGA,2FCCE,qCDwGF,CAtGC,mEACC,UAmCD,CAjCC,gFACC,KA+BD,CAhCA,0FAIE,MA4BF,CAhCA,0FAQE,OAwBF,CAhCA,gFAiBC,yDAA0D,CAG1D,eAAmB,CADnB,kBAAoB,CAOpB,cAAe,CAFf,eAAgB,CANhB,2CAA8C,CAP9C,mBAAoB,CAYpB,sBAAuB,CARvB,6DAA+D,CAH/D,oBAAqB,CAgBrB,+JAID,CAQA,mKACC,gCACD,CAGD,yDACC,mCAAoC,CACpC,kCAAmC,CAInC,kBAKD,CAHC,6FACC,gCACD,CAID,4OAEC,yCACD,CAIA,oUAGE,wFAYF,CAfA,oUAOE,iGAQF,CAfA,gTAaC,sBAAuB,CAFvB,iEAAkE,CAGlE,SACD,CAKA,8FACC,sBACD,CAGA,yIACC,SACD,CAGA,kMACC,8HACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-labeled-field-view {\n\t& > .ck.ck-labeled-field-view__input-wrapper {\n\t\tdisplay: flex;\n\t\tposition: relative;\n\t}\n\n\t& .ck.ck-label {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n@import "../../../mixins/_rounded.css";\n\n:root {\n\t--ck-labeled-field-view-transition: .1s cubic-bezier(0, 0, 0.24, 0.95);\n\t--ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-spacing-medium);\n\t--ck-color-labeled-field-label-background: var(--ck-color-base-background);\n}\n\n.ck.ck-labeled-field-view {\n\t@mixin ck-rounded-corners;\n\n\t& > .ck.ck-labeled-field-view__input-wrapper {\n\t\twidth: 100%;\n\n\t\t& > .ck.ck-label {\n\t\t\ttop: 0px;\n\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tleft: 0px;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tright: 0px;\n\t\t\t}\n\n\t\t\tpointer-events: none;\n\t\t\ttransform-origin: 0 0;\n\n\t\t\t/* By default, display the label scaled down above the field. */\n\t\t\ttransform: translate(var(--ck-spacing-medium), -6px) scale(.75);\n\n\t\t\tbackground: var(--ck-color-labeled-field-label-background);\n\t\t\tpadding: 0 calc(.5 * var(--ck-font-size-tiny));\n\t\t\tline-height: initial;\n\t\t\tfont-weight: normal;\n\n\t\t\t/* Prevent overflow when the label is longer than the input */\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\n\t\t\tmax-width: 100%;\n\n\t\t\ttransition:\n\t\t\t\ttransform var(--ck-labeled-field-view-transition),\n\t\t\t\tpadding var(--ck-labeled-field-view-transition),\n\t\t\t\tbackground var(--ck-labeled-field-view-transition);\n\t\t}\n\t}\n\n\t&.ck-error {\n\t\t& > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\n\t\t& .ck-input:not([readonly]) + .ck.ck-label {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\t}\n\n\t& .ck-labeled-field-view__status {\n\t\tfont-size: var(--ck-font-size-small);\n\t\tmargin-top: var(--ck-spacing-small);\n\n\t\t/* Let the info wrap to the next line to avoid stretching the layout horizontally.\n\t\tThe status could be very long. */\n\t\twhite-space: normal;\n\n\t\t&.ck-labeled-field-view__status_error {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\t}\n\n\t/* Disabled fields and fields that have no focus should fade out. */\n\t&.ck-disabled > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\tcolor: var(--ck-color-input-disabled-text);\n\t}\n\n\t/* Fields that are disabled or not focused and without a placeholder should have full-sized labels. */\n\t/* stylelint-disable-next-line no-descending-specificity */\n\t&.ck-disabled.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\t@mixin ck-dir ltr {\n\t\t\ttransform: translate(var(--ck-spacing-medium), calc(0.6 * var(--ck-font-size-base))) scale(1);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\ttransform: translate(calc(-1 * var(--ck-spacing-medium)), calc(0.6 * var(--ck-font-size-base))) scale(1);\n\t\t}\n\n\t\t/* Compensate for the default translate position. */\n\t\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width));\n\n\t\tbackground: transparent;\n\t\tpadding: 0;\n\t}\n\n\t/*------ DropdownView integration ----------------------------------------------------------------------------------- */\n\n\t/* Make sure dropdown\' background color in any of dropdown\'s state does not collide with labeled field. */\n\t& > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck.ck-button {\n\t\tbackground: transparent;\n\t}\n\n\t/* When the dropdown is "empty", the labeled field label replaces its label. */\n\t&.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck-button > .ck-button__label {\n\t\topacity: 0;\n\t}\n\n\t/* Make sure the label of the empty, unfocused input does not cover the dropdown arrow. */\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown + .ck-label {\n\t\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard));\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},162:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{background:var(--ck-color-list-background);list-style-type:none}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{border-radius:0;min-height:unset;padding:calc(var(--ck-line-height-base)*.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*.4*var(--ck-font-size-base));text-align:left;width:100%}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;width:100%}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/list/list.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,YAGC,YAAa,CACb,qBAAsB,CCFtB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBDaD,CAZC,2DAEC,aACD,CAKA,kCACC,iBAAkB,CAClB,2BACD,CEfD,YCEC,eDGD,CALA,+DCME,qCDDF,CALA,YAIC,0CAA2C,CAD3C,oBAED,CAEA,kBACC,cAAe,CACf,cA2DD,CAzDC,6BAIC,eAAgB,CAHhB,gBAAiB,CAQjB,iIAEiE,CARjE,eAAgB,CADhB,UAwCD,CA7BC,+CAEC,yEACD,CAEA,oCACC,eACD,CAEA,mCACC,oDAAqD,CACrD,yCAaD,CAXC,0CACC,eACD,CAEA,2DACC,0DACD,CAEA,2DACC,4CACD,CAGD,qDACC,uDACD,CAMA,yCACC,0CAA2C,CAC3C,aAMD,CAJC,iEACC,uDAAwD,CACxD,aACD,CAKH,uBAGC,sCAAuC,CAFvC,UAAW,CACX,UAED",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../mixins/_unselectable.css";\n\n.ck.ck-list {\n\t@mixin ck-unselectable;\n\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t& .ck-list__item,\n\t& .ck-list__separator {\n\t\tdisplay: block;\n\t}\n\n\t/* Make sure that whatever child of the list item gets focus, it remains on the\n\ttop. Thanks to that, styles like box-shadow, outline, etc. are not masked by\n\tadjacent list items. */\n\t& .ck-list__item > *:focus {\n\t\tposition: relative;\n\t\tz-index: var(--ck-z-default);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_disabled.css";\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_shadow.css";\n\n.ck.ck-list {\n\t@mixin ck-rounded-corners;\n\n\tlist-style-type: none;\n\tbackground: var(--ck-color-list-background);\n}\n\n.ck.ck-list__item {\n\tcursor: default;\n\tmin-width: 12em;\n\n\t& .ck-button {\n\t\tmin-height: unset;\n\t\twidth: 100%;\n\t\ttext-align: left;\n\t\tborder-radius: 0;\n\n\t\t/* List items should have the same height. Use absolute units to make sure it is so\n\t\t because e.g. different heading styles may have different height\n\t\t https://github.com/ckeditor/ckeditor5-heading/issues/63 */\n\t\tpadding:\n\t\t\tcalc(.2 * var(--ck-line-height-base) * var(--ck-font-size-base))\n\t\t\tcalc(.4 * var(--ck-line-height-base) * var(--ck-font-size-base));\n\n\t\t& .ck-button__label {\n\t\t\t/* https://github.com/ckeditor/ckeditor5-heading/issues/63 */\n\t\t\tline-height: calc(1.2 * var(--ck-line-height-base) * var(--ck-font-size-base));\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&.ck-on {\n\t\t\tbackground: var(--ck-color-list-button-on-background);\n\t\t\tcolor: var(--ck-color-list-button-on-text);\n\n\t\t\t&:active {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\n\t\t\t&:hover:not(.ck-disabled) {\n\t\t\t\tbackground: var(--ck-color-list-button-on-background-focus);\n\t\t\t}\n\n\t\t\t&:focus:not(.ck-disabled) {\n\t\t\t\tborder-color: var(--ck-color-base-background);\n\t\t\t}\n\t\t}\n\n\t\t&:hover:not(.ck-disabled) {\n\t\t\tbackground: var(--ck-color-list-button-hover-background);\n\t\t}\n\t}\n\n\t/* It\'s unnecessary to change the background/text of a switch toggle; it has different ways\n\tof conveying its state (like the switcher) */\n\t& .ck-switchbutton {\n\t\t&.ck-on {\n\t\t\tbackground: var(--ck-color-list-background);\n\t\t\tcolor: inherit;\n\n\t\t\t&:hover:not(.ck-disabled) {\n\t\t\t\tbackground: var(--ck-color-list-button-hover-background);\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-list__separator {\n\theight: 1px;\n\twidth: 100%;\n\tbackground: var(--ck-color-base-border);\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},245:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);box-shadow:var(--ck-drop-shadow),0 0;min-height:15px}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonpanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAKA,MAEC,8DACD,CAEA,qBACC,YAAa,CACb,iBAAkB,CAElB,yBAyCD,CAtCE,+GAEC,UAAW,CACX,iBACD,CAEA,wDACC,6CACD,CAEA,uDACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAGD,8CACC,aACD,CC9CD,MACC,6BAA8B,CAC9B,8BAA+B,CAC/B,iCAAkC,CAClC,oEACD,CAEA,qBCJC,eD4ID,CAxIA,iFCAE,qCDwIF,CAxIA,qBAMC,2CAA4C,CAC5C,6CAA8C,CEb9C,oCAA8B,CFU9B,eAoID,CA9HE,+GAIC,kBAAmB,CADnB,QAAS,CADT,OAGD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EACD,CAEA,2CACC,iFAAkF,CAClF,yCACD,CAIA,uFAEC,mHACD,CAEA,4CACC,iEAAkE,CAClE,uDACD,CAEA,2CACC,iFAAkF,CAClF,4CACD,CAIA,yGAEC,QAAS,CACT,uDAA0D,CAC1D,2CACD,CAIA,2GAEC,+CAAkD,CAClD,2CACD,CAIA,2GAEC,gDAAmD,CACnD,2CACD,CAIA,yGAIC,8CAAiD,CAFjD,QAAS,CACT,uDAED,CAIA,2GAGC,8CAAiD,CADjD,+CAED,CAIA,2GAGC,8CAAiD,CADjD,gDAED,CAIA,6GAIC,8CAAiD,CADjD,uDAA0D,CAD1D,SAGD,CAIA,6GAIC,8CAAiD,CAFjD,QAAS,CACT,sDAED,CAIA,6GAGC,uDAA0D,CAD1D,SAAU,CAEV,2CACD,CAIA,6GAEC,QAAS,CACT,sDAAyD,CACzD,2CACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/* Make sure the balloon arrow does not float over its children. */\n\t--ck-balloon-panel-arrow-z-index: calc(var(--ck-z-default) - 3);\n}\n\n.ck.ck-balloon-panel {\n\tdisplay: none;\n\tposition: absolute;\n\n\tz-index: var(--ck-z-modal);\n\n\t&.ck-balloon-panel_with-arrow {\n\t\t&::before,\n\t\t&::after {\n\t\t\tcontent: "";\n\t\t\tposition: absolute;\n\t\t}\n\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&[class*="arrow_n"] {\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&[class*="arrow_s"] {\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_visible {\n\t\tdisplay: block;\n\t}\n}\n','/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_shadow.css";\n\n:root {\n\t--ck-balloon-arrow-offset: 2px;\n\t--ck-balloon-arrow-height: 10px;\n\t--ck-balloon-arrow-half-width: 8px;\n\t--ck-balloon-arrow-drop-shadow: 0 2px 2px var(--ck-color-shadow-drop);\n}\n\n.ck.ck-balloon-panel {\n\t@mixin ck-rounded-corners;\n\t@mixin ck-drop-shadow;\n\n\tmin-height: 15px;\n\n\tbackground: var(--ck-color-panel-background);\n\tborder: 1px solid var(--ck-color-panel-border);\n\n\t&.ck-balloon-panel_with-arrow {\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder-style: solid;\n\t\t}\n\t}\n\n\t&[class*="arrow_n"] {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-width: 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width);\n\t\t}\n\n\t\t&::before {\n\t\t\tborder-color: transparent transparent var(--ck-color-panel-border) transparent;\n\t\t}\n\n\t\t&::after {\n\t\t\tborder-color: transparent transparent var(--ck-color-panel-background) transparent;\n\t\t\tmargin-top: var(--ck-balloon-arrow-offset);\n\t\t}\n\t}\n\n\t&[class*="arrow_s"] {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-width: var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width);\n\t\t}\n\n\t\t&::before {\n\t\t\tborder-color: var(--ck-color-panel-border) transparent transparent;\n\t\t\tfilter: drop-shadow(var(--ck-balloon-arrow-drop-shadow));\n\t\t}\n\n\t\t&::after {\n\t\t\tborder-color: var(--ck-color-panel-background) transparent transparent transparent;\n\t\t\tmargin-bottom: var(--ck-balloon-arrow-offset);\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_n {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 50%;\n\t\t\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_ne {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_s {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 50%;\n\t\t\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_sw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_se {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_sme {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: 25%;\n\t\t\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_smw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 25%;\n\t\t\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nme {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: 25%;\n\t\t\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nmw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 25%;\n\t\t\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},757:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonrotator.css"],names:[],mappings:"AAKA,oCAEC,kBAAmB,CADnB,YAAa,CAEb,sBACD,CAKA,6CACC,sBACD,CCXA,oCACC,6CAA8C,CAC9C,sDAAuD,CACvD,iCAgBD,CAbC,sCAGC,qCAAsC,CAFtC,oCAAqC,CACrC,kCAED,CAGA,iEAIC,mCAAoC,CAHpC,uCAID,CAMA,2DACC,eACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-balloon-rotator__navigation {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Buttons inside a toolbar should be centered when rotator bar is wider.\n * See: https://github.com/ckeditor/ckeditor5-ui/issues/495\n */\n.ck .ck-balloon-rotator__content .ck-toolbar {\n\tjustify-content: center;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-balloon-rotator__navigation {\n\tbackground: var(--ck-color-toolbar-background);\n\tborder-bottom: 1px solid var(--ck-color-toolbar-border);\n\tpadding: 0 var(--ck-spacing-small);\n\n\t/* Let's keep similar appearance to `ck-toolbar`. */\n\t& > * {\n\t\tmargin-right: var(--ck-spacing-small);\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t/* Gives counter more breath than buttons. */\n\t& .ck-balloon-rotator__counter {\n\t\tmargin-right: var(--ck-spacing-standard);\n\n\t\t/* We need to use smaller margin because of previous button's right margin. */\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n}\n\n.ck .ck-balloon-rotator__content {\n\n\t/* Disable default annotation shadow inside rotator with fake panels. */\n\t& .ck.ck-annotation-wrapper {\n\t\tbox-shadow: none;\n\t}\n}\n"],sourceRoot:""}]);const a=r},553:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/fakepanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAKA,mBACC,iBAAkB,CAGlB,mCACD,CAEA,uBACC,iBACD,CAEA,mCACC,SACD,CAEA,oCACC,SACD,CCfA,MACC,6CAA8C,CAC9C,2CACD,CAGA,uBAKC,2CAA4C,CAC5C,6CAA8C,CAC9C,qCAAsC,CCXtC,oCAA8B,CDc9B,WAAY,CAPZ,eAAgB,CAMhB,UAED,CAEA,mCACC,0DAA2D,CAC3D,uDACD,CAEA,oCACC,kEAAqE,CACrE,+DACD,CACA,oCACC,kEAAqE,CACrE,+DACD,CAGA,yIAGC,4CACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-fake-panel {\n\tposition: absolute;\n\n\t/* Fake panels should be placed under main balloon content. */\n\tz-index: calc(var(--ck-z-modal) - 1);\n}\n\n.ck .ck-fake-panel div {\n\tposition: absolute;\n}\n\n.ck .ck-fake-panel div:nth-child( 1 ) {\n\tz-index: 2;\n}\n\n.ck .ck-fake-panel div:nth-child( 2 ) {\n\tz-index: 1;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_shadow.css";\n\n:root {\n\t--ck-balloon-fake-panel-offset-horizontal: 6px;\n\t--ck-balloon-fake-panel-offset-vertical: 6px;\n}\n\n/* Let\'s use `.ck-balloon-panel` appearance. See: balloonpanel.css. */\n.ck .ck-fake-panel div {\n\t@mixin ck-drop-shadow;\n\n\tmin-height: 15px;\n\n\tbackground: var(--ck-color-panel-background);\n\tborder: 1px solid var(--ck-color-panel-border);\n\tborder-radius: var(--ck-border-radius);\n\n\twidth: 100%;\n\theight: 100%;\n}\n\n.ck .ck-fake-panel div:nth-child( 1 ) {\n\tmargin-left: var(--ck-balloon-fake-panel-offset-horizontal);\n\tmargin-top: var(--ck-balloon-fake-panel-offset-vertical);\n}\n\n.ck .ck-fake-panel div:nth-child( 2 ) {\n\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 2);\n\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 2);\n}\n.ck .ck-fake-panel div:nth-child( 3 ) {\n\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 3);\n\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 3);\n}\n\n/* If balloon is positioned above element, we need to move fake panel to the top. */\n.ck .ck-balloon-panel_arrow_s + .ck-fake-panel,\n.ck .ck-balloon-panel_arrow_se + .ck-fake-panel,\n.ck .ck-balloon-panel_arrow_sw + .ck-fake-panel {\n\t--ck-balloon-fake-panel-offset-vertical: -6px;\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},609:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-modal)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/stickypanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAMC,qDAEC,cAAe,CACf,KAAM,CAFN,yBAGD,CAEA,kEAEC,iBAAkB,CADlB,QAED,CCPA,qDAIC,wBAAyB,CACzB,yBAA0B,CAF1B,sBAAuB,CCFxB,oCDKA",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-sticky-panel {\n\t& .ck-sticky-panel__content_sticky {\n\t\tz-index: var(--ck-z-modal); /* #315 */\n\t\tposition: fixed;\n\t\ttop: 0;\n\t}\n\n\t& .ck-sticky-panel__content_sticky_bottom-limit {\n\t\ttop: auto;\n\t\tposition: absolute;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_shadow.css";\n\n.ck.ck-sticky-panel {\n\t& .ck-sticky-panel__content_sticky {\n\t\t@mixin ck-drop-shadow;\n\n\t\tborder-width: 0 1px 1px;\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},590:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck-vertical-form .ck-button:after{bottom:var(--ck-spacing-small);content:"";position:absolute;right:-1px;top:var(--ck-spacing-small);width:0;z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:var(--ck-spacing-small);content:"";position:absolute;right:-1px;top:var(--ck-spacing-small);width:0;z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border:0;border-radius:0;border-top:1px solid var(--ck-color-base-border);margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/responsive-form/responsiveform.css"],names:[],mappings:"AAOA,mCAMC,8BAA+B,CAL/B,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,2BAA4B,CAH5B,OAAQ,CAKR,SACD,CCTC,oCDaC,wCAMC,8BAA+B,CAL/B,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,2BAA4B,CAH5B,OAAQ,CAKR,SACD,CCnBD,CCAD,qDACC,kDACD,CAEA,uBACC,+BAkED,CAhEC,6BAEC,YACD,CASC,uGACC,sCACD,CDvBD,oCCMD,uBAqBE,SAAU,CACV,oCA6CF,CA3CE,8CACC,wDAWD,CATC,6DACC,WAAY,CACZ,UACD,CAGA,4EACC,kBACD,CAID,iGAMC,QAAS,CADT,eAAgB,CAEhB,gDAAiD,CAJjD,kCAAmC,CADnC,kCAkBD,CApBA,0OAcE,aAMF,CAGC,yMACC,kDACD,CDpEF",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck-vertical-form .ck-button::after {\n\tcontent: "";\n\twidth: 0;\n\tposition: absolute;\n\tright: -1px;\n\ttop: var(--ck-spacing-small);\n\tbottom: var(--ck-spacing-small);\n\tz-index: 1;\n}\n\n.ck.ck-responsive-form {\n\t@mixin ck-media-phone {\n\t\t& .ck-button::after {\n\t\t\tcontent: "";\n\t\t\twidth: 0;\n\t\t\tposition: absolute;\n\t\t\tright: -1px;\n\t\t\ttop: var(--ck-spacing-small);\n\t\t\tbottom: var(--ck-spacing-small);\n\t\t\tz-index: 1;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck-vertical-form > .ck-button:nth-last-child(2)::after {\n\tborder-right: 1px solid var(--ck-color-base-border);\n}\n\n.ck.ck-responsive-form {\n\tpadding: var(--ck-spacing-large);\n\n\t&:focus {\n\t\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\n\t\toutline: none;\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& > :not(:first-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& > :not(:last-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\tpadding: 0;\n\t\twidth: calc(.8 * var(--ck-input-width));\n\n\t\t& .ck-labeled-field-view {\n\t\t\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) 0;\n\n\t\t\t& .ck-input-text {\n\t\t\t\tmin-width: 0;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t/* Let the long error messages wrap in the narrow form. */\n\t\t\t& .ck-labeled-field-view__error {\n\t\t\t\twhite-space: normal;\n\t\t\t}\n\t\t}\n\n\t\t/* Styles for two last buttons in the form (save&cancel, edit&unlink, etc.). */\n\t\t& > .ck-button:nth-last-child(1),\n\t\t& > .ck-button:nth-last-child(2) {\n\t\t\tpadding: var(--ck-spacing-standard);\n\t\t\tmargin-top: var(--ck-spacing-large);\n\n\t\t\tborder-radius: 0;\n\t\t\tborder: 0;\n\t\t\tborder-top: 1px solid var(--ck-color-base-border);\n\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-left: 0;\n\n\t\t\t\t&:last-of-type {\n\t\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& > .ck-button:nth-last-child(2) {\n\t\t\t&::after {\n\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},706:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/blocktoolbar.css"],names:[],mappings:"AAKA,4BACC,iBAAkB,CAClB,2BACD,CCHA,MACC,oDAAqD,CACrD,yDACD,CAEA,4BACC,0CAA2C,CAC3C,sCACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-block-toolbar-button {\n\tposition: absolute;\n\tz-index: var(--ck-z-default);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-block-toolbar-button: var(--ck-color-text);\n\t--ck-block-toolbar-button-size: var(--ck-font-size-normal);\n}\n\n.ck.ck-block-toolbar-button {\n\tcolor: var(--ck-color-block-toolbar-button);\n\tfont-size: var(--ck-block-toolbar-size);\n}\n"],sourceRoot:""}]);const a=r},571:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;background:var(--ck-color-toolbar-border);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border:0;border-radius:0;margin:0;width:100%}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/toolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,eAKC,kBAAmB,CAFnB,YAAa,CACb,oBAAqB,CCFrB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD6CD,CA3CC,kCAGC,kBAAmB,CAFnB,YAAa,CACb,kBAAmB,CAEnB,WAED,CAEA,yCACC,oBAWD,CAJC,yGAEC,YACD,CAGD,uCACC,eACD,CAEA,sDACC,gBACD,CAEA,sDACC,qBACD,CAEA,sDACC,gBACD,CAGC,yFACC,YACD,CE/CF,eCGC,eD0FD,CA7FA,qECOE,qCDsFF,CA7FA,eAGC,6CAA8C,CAE9C,+CAAgD,CADhD,iCAyFD,CAtFC,yCACC,kBAAmB,CAGnB,yCAA0C,CAO1C,qCAAsC,CADtC,kCAAmC,CAPnC,aAAc,CADd,SAUD,CAEA,uCACC,QACD,CAGC,gEAEC,oCACD,CAIA,kEACC,YACD,CAGD,gHAIC,qCAAsC,CADtC,kCAED,CAEA,mCAEC,SAgBD,CAbC,0DAWC,QAAS,CAHT,eAAgB,CAHhB,QAAS,CAHT,UAUD,CAGD,kCAEC,SAWD,CATC,uDAEC,QAMD,CAHC,yFACC,eACD,CASD,kFACC,mCACD,CAvFF,qCA2FE,QAEF,CAYC,+FACC,cACD,CAEA,iJAEC,mCACD,CAEA,qHACC,aACD,CAIC,6JAEC,2BAA4B,CAD5B,wBAED,CAGA,2JAEC,4BAA6B,CAD7B,yBAED,CAID,qGACC,mCACD,CAGA,yLACC,mCACD,CAWA,qHACC,cACD,CAIC,6JAEC,4BAA6B,CAD7B,yBAED,CAGA,2JAEC,2BAA4B,CAD5B,wBAED,CAID,qGACC,oCACD,CAGA,yLACC,oCACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../mixins/_unselectable.css";\n\n.ck.ck-toolbar {\n\t@mixin ck-unselectable;\n\n\tdisplay: flex;\n\tflex-flow: row nowrap;\n\talign-items: center;\n\n\t& > .ck-toolbar__items {\n\t\tdisplay: flex;\n\t\tflex-flow: row wrap;\n\t\talign-items: center;\n\t\tflex-grow: 1;\n\n\t}\n\n\t& .ck.ck-toolbar__separator {\n\t\tdisplay: inline-block;\n\n\t\t/*\n\t\t * A leading or trailing separator makes no sense (separates from nothing on one side).\n\t\t * For instance, it can happen when toolbar items (also separators) are getting grouped one by one and\n\t\t * moved to another toolbar in the dropdown.\n\t\t */\n\t\t&:first-child,\n\t\t&:last-child {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t& .ck-toolbar__line-break {\n\t\tflex-basis: 100%;\n\t}\n\n\t&.ck-toolbar_grouping > .ck-toolbar__items {\n\t\tflex-wrap: nowrap;\n\t}\n\n\t&.ck-toolbar_vertical > .ck-toolbar__items {\n\t\tflex-direction: column;\n\t}\n\n\t&.ck-toolbar_floating > .ck-toolbar__items {\n\t\tflex-wrap: nowrap;\n\t}\n\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t& > .ck-dropdown__button .ck-dropdown__arrow {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck.ck-toolbar {\n\t@mixin ck-rounded-corners;\n\n\tbackground: var(--ck-color-toolbar-background);\n\tpadding: 0 var(--ck-spacing-small);\n\tborder: 1px solid var(--ck-color-toolbar-border);\n\n\t& .ck.ck-toolbar__separator {\n\t\talign-self: stretch;\n\t\twidth: 1px;\n\t\tmin-width: 1px;\n\t\tbackground: var(--ck-color-toolbar-border);\n\n\t\t/*\n\t\t * These margins make the separators look better in balloon toolbars (when aligned with the "tip").\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/7493.\n\t\t */\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t& .ck-toolbar__line-break {\n\t\theight: 0;\n\t}\n\n\t& > .ck-toolbar__items {\n\t\t& > *:not(.ck-toolbar__line-break) {\n\t\t\t/* (#11) Separate toolbar items. */\n\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t}\n\n\t\t/* Don\'t display a separator after an empty items container, for instance,\n\t\twhen all items were grouped */\n\t\t&:empty + .ck.ck-toolbar__separator {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t& > .ck-toolbar__items > *:not(.ck-toolbar__line-break),\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t/* Make sure items wrapped to the next line have v-spacing */\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t&.ck-toolbar_vertical {\n\t\t/* Items in a vertical toolbar span the entire width. */\n\t\tpadding: 0;\n\n\t\t/* Specificity matters here. See https://github.com/ckeditor/ckeditor5-theme-lark/issues/168. */\n\t\t& > .ck-toolbar__items > .ck {\n\t\t\t/* Items in a vertical toolbar should span the horizontal space. */\n\t\t\twidth: 100%;\n\n\t\t\t/* Items in a vertical toolbar should have no margin. */\n\t\t\tmargin: 0;\n\n\t\t\t/* Items in a vertical toolbar span the entire width so rounded corners are pointless. */\n\t\t\tborder-radius: 0;\n\n\t\t\t/* Items in a vertical toolbar span the entire width so any border is pointless. */\n\t\t\tborder: 0;\n\t\t}\n\t}\n\n\t&.ck-toolbar_compact {\n\t\t/* No spacing around items. */\n\t\tpadding: 0;\n\n\t\t& > .ck-toolbar__items > * {\n\t\t\t/* Compact toolbar items have no spacing between them. */\n\t\t\tmargin: 0;\n\n\t\t\t/* "Middle" children should have no rounded corners. */\n\t\t\t&:not(:first-child):not(:last-child) {\n\t\t\t\tborder-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t/*\n\t\t * Dropdown button has asymmetric padding to fit the arrow.\n\t\t * This button has no arrow so let\'s revert that padding back to normal.\n\t\t */\n\t\t& > .ck.ck-button.ck-dropdown__button {\n\t\t\tpadding-left: var(--ck-spacing-tiny);\n\t\t}\n\t}\n\n\t@nest .ck-toolbar-container & {\n\t\tborder: 0;\n\t}\n}\n\n/* stylelint-disable */\n\n/*\n * Styles for RTL toolbars.\n *\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own "dir"\n * because its parent is not controlled by the editor framework.\n */\n[dir="rtl"] .ck.ck-toolbar,\n.ck.ck-toolbar[dir="rtl"] {\n\t& > .ck-toolbar__items > .ck {\n\t\tmargin-right: 0;\n\t}\n\n\t&:not(.ck-toolbar_compact) > .ck-toolbar__items > .ck {\n\t\t/* (#11) Separate toolbar items. */\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n\n\t& > .ck-toolbar__items > .ck:last-child {\n\t\tmargin-left: 0;\n\t}\n\n\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\n\t\t/* No rounded corners on the right side of the first child. */\n\t\t&:first-child {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\n\t\t/* No rounded corners on the left side of the last child. */\n\t\t&:last-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\t}\n\n\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\n\t& > .ck.ck-toolbar__separator {\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n\n\t/* Some spacing between the items and the separator before the grouped items dropdown. */\n\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n}\n\n/*\n * Styles for LTR toolbars.\n *\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own "dir"\n * because its parent is not controlled by the editor framework.\n */\n[dir="ltr"] .ck.ck-toolbar,\n.ck.ck-toolbar[dir="ltr"] {\n\t& > .ck-toolbar__items > .ck:last-child {\n\t\tmargin-right: 0;\n\t}\n\n\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\n\t\t/* No rounded corners on the right side of the first child. */\n\t\t&:first-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t/* No rounded corners on the left side of the last child. */\n\t\t&:last-child {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\t}\n\n\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\n\t& > .ck.ck-toolbar__separator {\n\t\tmargin-right: var(--ck-spacing-small);\n\t}\n\n\t/* Some spacing between the items and the separator before the grouped items dropdown. */\n\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\n\t\tmargin-right: var(--ck-spacing-small);\n\t}\n}\n\n/* stylelint-enable */\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},948:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{-webkit-backface-visibility:hidden;pointer-events:none;position:absolute}.ck.ck-tooltip{display:none;opacity:0;visibility:hidden;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";height:0;width:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{background:var(--ck-color-tooltip-background);color:var(--ck-color-tooltip-text);font-size:.9em;left:-50%;line-height:1.5;padding:var(--ck-spacing-small) var(--ck-spacing-medium);position:relative}.ck.ck-tooltip .ck-tooltip__text:after{border-style:solid;left:50%;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{border-color:transparent transparent var(--ck-color-tooltip-background) transparent;border-width:0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%)}.ck.ck-tooltip.ck-tooltip_sw{left:auto;right:50%}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{left:calc(var(--ck-tooltip-arrow-size)*-2);right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{left:0;right:auto;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{border-color:var(--ck-color-tooltip-background) transparent transparent transparent;border-width:var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size);bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{border-color:transparent var(--ck-color-tooltip-background) transparent transparent;border-width:var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0;left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1)}.ck.ck-tooltip.ck-tooltip_w{left:auto;right:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{border-color:transparent transparent transparent var(--ck-color-tooltip-background);border-width:var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1)}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/tooltip/tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAKA,sDASC,kCAAmC,CAJnC,mBAAoB,CAHpB,iBAQD,CAEA,eAIC,YAAa,CADb,SAAU,CADV,iBAAkB,CAGlB,yBAWD,CATC,iCACC,oBAOD,CALC,uCACC,UAAW,CAEX,QAAS,CADT,OAED,CCxBF,MACC,2BACD,CAEA,eACC,QAAS,CAMT,KAAM,CAON,sCAwKD,CAtKC,iCChBA,eDqCA,CArBA,yGCZC,qCDiCD,CArBA,iCAOC,6CAA8C,CAF9C,kCAAmC,CAFnC,cAAe,CAMf,SAAU,CALV,eAAgB,CAEhB,wDAAyD,CAEzD,iBAaD,CAVC,uCAOC,kBAAmB,CACnB,QAAS,CAFT,sCAGD,CAYD,sFAGC,4CAA+C,CAC/C,0BASD,CAPC,8JAIC,mFAAoF,CACpF,qGAAsG,CAHtG,+CAAkD,CAClD,0BAGD,CAaD,6BAEC,SAAU,CADV,SAYD,CATC,+CACC,SAAU,CACV,2CACD,CAEA,qDACC,SAAU,CACV,OACD,CAYD,6BACC,QAAS,CACT,UAYD,CAVC,+CAEC,0CAA8C,CAD9C,UAED,CAEA,qDAEC,MAAO,CADP,UAAW,CAEX,yBACD,CAYD,4BACC,yCAA4C,CAC5C,2BAQD,CANC,oDAGC,mFAAoF,CACpF,qGAAsG,CAHtG,4CAA+C,CAC/C,0BAGD,CAUD,4BACC,8CAA+C,CAC/C,OAaD,CAXC,8CACC,MAAO,CACP,0BAQD,CANC,oDAGC,mFAAoF,CACpF,qGAAsG,CAHtG,0CAA6C,CAC7C,8CAGD,CAWF,4BAEC,SAAU,CADV,+CAAgD,CAEhD,OAaD,CAXC,8CACC,MAAO,CACP,0BAQD,CANC,oDAGC,mFAAoF,CACpF,qGAAsG,CAHtG,SAAU,CACV,8CAGD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-tooltip,\n.ck.ck-tooltip .ck-tooltip__text::after {\n\tposition: absolute;\n\n\t/* Without this, hovering the tooltip could keep it visible. */\n\tpointer-events: none;\n\n\t/* This is to get rid of flickering when transitioning opacity in Chrome.\n\tIt\'s weird but it works. */\n\t-webkit-backface-visibility: hidden;\n}\n\n.ck.ck-tooltip {\n\t/* Tooltip is hidden by default. */\n\tvisibility: hidden;\n\topacity: 0;\n\tdisplay: none;\n\tz-index: var(--ck-z-modal);\n\n\t& .ck-tooltip__text {\n\t\tdisplay: inline-block;\n\n\t\t&::after {\n\t\t\tcontent: "";\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t}\n\t}\n}\n','/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n\n:root {\n\t--ck-tooltip-arrow-size: 5px;\n}\n\n.ck.ck-tooltip {\n\tleft: 50%;\n\n\t/*\n\t * Prevent blurry tooltips in LoDPI environments.\n\t * See https://github.com/ckeditor/ckeditor5/issues/1802.\n\t */\n\ttop: 0;\n\n\t/*\n\t * For the transition to work, the tooltip must be controlled\n\t * using visibility+opacity. A delay prevents a "tooltip avalanche"\n\t * i.e. when scanning the toolbar with mouse cursor.\n\t */\n\ttransition: opacity .2s ease-in-out .2s;\n\n\t& .ck-tooltip__text {\n\t\t@mixin ck-rounded-corners;\n\n\t\tfont-size: .9em;\n\t\tline-height: 1.5;\n\t\tcolor: var(--ck-color-tooltip-text);\n\t\tpadding: var(--ck-spacing-small) var(--ck-spacing-medium);\n\t\tbackground: var(--ck-color-tooltip-background);\n\t\tposition: relative;\n\t\tleft: -50%;\n\n\t\t&::after {\n\t\t\t/*\n\t\t\t * For the transition to work, the tooltip must be controlled\n\t\t\t * using visibility+opacity. A delay prevents a "tooltip avalanche"\n\t\t\t * i.e. when scanning the toolbar with mouse cursor.\n\t\t\t */\n\t\t\ttransition: opacity .2s ease-in-out .2s;\n\t\t\tborder-style: solid;\n\t\t\tleft: 50%;\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\t&.ck-tooltip_s,\n\t&.ck-tooltip_sw,\n\t&.ck-tooltip_se {\n\t\tbottom: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\ttransform: translateY( 100% );\n\n\t\t& .ck-tooltip__text::after {\n\t\t\t/* 1px addresses gliches in rendering causing gap between the triangle and the text */\n\t\t\ttop: calc(-1 * var(--ck-tooltip-arrow-size) + 1px);\n\t\t\ttransform: translateX( -50% );\n\t\t\tborder-color: transparent transparent var(--ck-color-tooltip-background) transparent;\n\t\t\tborder-width: 0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south-west of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\n\t&.ck-tooltip_sw {\n\t\tright: 50%;\n\t\tleft: auto;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: auto;\n\t\t\tright: calc( -2 * var(--ck-tooltip-arrow-size));\n\t\t}\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tleft: auto;\n\t\t\tright: 0;\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south-east of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\t&.ck-tooltip_se {\n\t\tleft: 50%;\n\t\tright: auto;\n\n\t\t& .ck-tooltip__text {\n\t\t\tright: auto;\n\t\t\tleft: calc( -2 * var(--ck-tooltip-arrow-size));\n\t\t}\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tright: auto;\n\t\t\tleft: 0;\n\t\t\ttransform: translateX( 50% );\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip north of the element.\n\t *\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t * V\n\t * [element]\n\t */\n\t&.ck-tooltip_n {\n\t\ttop: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\ttransform: translateY( -100% );\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tbottom: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\t\ttransform: translateX( -50% );\n\t\t\tborder-color: var(--ck-color-tooltip-background) transparent transparent transparent;\n\t\t\tborder-width: var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size);\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip east of the element.\n\t *\n\t * +----------+\n\t * [element] < | east |\n\t * +----------+\n\t */\n\t&.ck-tooltip_e {\n\t\tleft: calc(100% + var(--ck-tooltip-arrow-size));\n\t\ttop: 50%;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: 0;\n\t\t\ttransform: translateY( -50% );\n\n\t\t\t&::after {\n\t\t\t\tleft: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\t\t\ttop: calc(50% - 1 * var(--ck-tooltip-arrow-size));\n\t\t\t\tborder-color: transparent var(--ck-color-tooltip-background) transparent transparent;\n\t\t\t\tborder-width: var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip west of the element.\n\t *\n\t * +----------+\n\t * | west | > [element]\n\t * +----------+\n\t */\n\t&.ck-tooltip_w {\n\t\tright: calc(100% + var(--ck-tooltip-arrow-size));\n\t\tleft: auto;\n\t\ttop: 50%;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: 0;\n\t\t\ttransform: translateY( -50% );\n\n\t\t\t&::after {\n\t\t\t\tleft: 100%;\n\t\t\t\ttop: calc(50% - 1 * var(--ck-tooltip-arrow-size));\n\t\t\t\tborder-color: transparent transparent transparent var(--ck-color-tooltip-background);\n\t\t\t\tborder-width: var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},150:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck-hidden{display:none!important}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{box-sizing:border-box;height:auto;position:static;width:auto}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{word-wrap:break-word;background:transparent;border:0;margin:0;padding:0;text-decoration:none;transition:none;vertical-align:middle}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_hidden.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_reset.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_zindex.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_transition.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_colors.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_disabled.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_fonts.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_reset.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_spacing.css"],names:[],mappings:"AAQA,WAGC,sBACD,CCPA,2EAGC,qBAAsB,CAEtB,WAAY,CACZ,eAAgB,CAFhB,UAGD,CCPA,MACC,gBAAiB,CACjB,4CACD,CCAA,oDAEC,yBACD,CCNA,MACC,kCAAmD,CACnD,+BAAoD,CACpD,8BAAgD,CAChD,8BAAmD,CACnD,6BAAmD,CACnD,yBAA+C,CAC/C,8BAAmD,CACnD,oCAAuD,CACvD,6BAAkD,CAIlD,+CAAwD,CACxD,qEAA+E,CAC/E,qCAAwD,CACxD,qDAA8D,CAC9D,gDAAyD,CACzD,yCAAqD,CACrD,sCAAsD,CACtD,4CAA0D,CAC1D,sCAAsD,CAItD,gDAAuD,CACvD,kDAA+D,CAC/D,mDAAgE,CAChE,+CAA6D,CAC7D,yDAA8D,CAE9D,uCAAuD,CACvD,6CAA4D,CAC5D,8CAA4D,CAC5D,0CAAyD,CACzD,gDAA8D,CAE9D,+DAAsE,CACtE,iDAAkE,CAClE,kDAAkE,CAClE,8CAA+D,CAC/D,oDAAoE,CACpE,6DAAsE,CAEtE,8BAAoD,CACpD,gCAAqD,CAErD,+CAA4D,CAC5D,qDAAiE,CACjE,+EAAqF,CACrF,oDAAmE,CACnE,yEAA8E,CAC9E,oDAAgE,CAIhE,oEAA2E,CAC3E,4DAAoE,CAIpE,2DAAoE,CACpE,+BAAiD,CACjD,wDAAgE,CAChE,+CAA0D,CAC1D,4CAA2D,CAC3D,wCAAwD,CACxD,sCAAsD,CAItD,0DAAmE,CACnE,uFAA6F,CAC7F,gEAAuE,CACvE,4EAAiF,CACjF,8DAAsE,CAItE,2DAAoE,CACpE,mDAA6D,CAI7D,6DAAsE,CACtE,qDAA+D,CAI/D,uDAAgE,CAChE,uDAAiE,CAIjE,0CAAyD,CAIzD,wCAA2D,CAI3D,+BAAoD,CACpD,uDAAmE,CACnE,kDAAgE,CCpGhE,wBAAyB,CCAzB,0CAA2C,CAK3C,gGAAiG,CAKjG,4GAA6G,CAK7G,sGAAuG,CAKvG,sDAAuD,CCvBvD,wBAAyB,CACzB,6BAA8B,CAC9B,wDAA6D,CAE7D,yBAA0B,CAC1B,2BAA4B,CAC5B,yBAA0B,CAC1B,wBAAyB,CACzB,0BAA2B,CCJ3B,kCJoGD,CI9FA,2EAaC,oBAAqB,CANrB,sBAAuB,CADvB,QAAS,CAFT,QAAS,CACT,SAAU,CAGV,oBAAqB,CAErB,eAAgB,CADhB,qBAKD,CAKA,8DAGC,wBAAyB,CAEzB,0BAA2B,CAG3B,WAAY,CACZ,UAAW,CALX,iGAAkG,CAElG,eAAgB,CAChB,kBAGD,CAGC,qDACC,gBACD,CAEA,mDAEC,sBACD,CAEA,qDACC,oBACD,CAEA,mLAGC,WACD,CAEA,iNAGC,cACD,CAEA,qDAEC,yBAAoC,CADpC,YAED,CAEA,qEAGC,QAAQ,CADR,SAED,CAMD,8BAEC,gBACD,CCnFA,MACC,sBAAuB,CCAvB,gEAAiE,CAKjE,0DAA2D,CAK3D,wEAAyE,CCbzE,uBAA8B,CAC9B,mDAA2D,CAC3D,4CAAkD,CAClD,oDAA4D,CAC5D,mDAA2D,CAC3D,kDAA2D,CAC3D,yDFFD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which hides an element in DOM.\n */\n.ck-hidden {\n\t/* Override selector specificity. Otherwise, all elements with some display\n\tstyle defined will override this one, which is not a desired result. */\n\tdisplay: none !important;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-reset,\n.ck.ck-reset_all,\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\n\tbox-sizing: border-box;\n\twidth: auto;\n\theight: auto;\n\tposition: static;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-z-default: 1;\n\t--ck-z-modal: calc( var(--ck-z-default) + 999 );\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class that disables all transitions of the element and its children.\n */\n.ck-transitions-disabled,\n.ck-transitions-disabled * {\n\ttransition: none !important;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-base-foreground: \t\t\t\t\t\t\t\thsl(0, 0%, 98%);\n\t--ck-color-base-background: \t\t\t\t\t\t\t\thsl(0, 0%, 100%);\n\t--ck-color-base-border: \t\t\t\t\t\t\t\t\thsl(0, 0%, 77%);\n\t--ck-color-base-action: \t\t\t\t\t\t\t\t\thsl(104, 44%, 48%);\n\t--ck-color-base-focus: \t\t\t\t\t\t\t\t\t\thsl(209, 92%, 70%);\n\t--ck-color-base-text: \t\t\t\t\t\t\t\t\t\thsl(0, 0%, 20%);\n\t--ck-color-base-active: \t\t\t\t\t\t\t\t\thsl(208, 88%, 52%);\n\t--ck-color-base-active-focus:\t\t\t\t\t\t\t\thsl(208, 88%, 47%);\n\t--ck-color-base-error:\t\t\t\t\t\t\t\t\t\thsl(15, 100%, 43%);\n\n\t/* -- Generic colors ------------------------------------------------------------------------ */\n\n\t--ck-color-focus-border-coordinates: \t\t\t\t\t\t208, 79%, 51%;\n\t--ck-color-focus-border: \t\t\t\t\t\t\t\t\thsl(var(--ck-color-focus-border-coordinates));\n\t--ck-color-focus-outer-shadow:\t\t\t\t\t\t\t\thsl(207, 89%, 86%);\n\t--ck-color-focus-disabled-shadow:\t\t\t\t\t\t\thsla(209, 90%, 72%,.3);\n\t--ck-color-focus-error-shadow:\t\t\t\t\t\t\t\thsla(9,100%,56%,.3);\n\t--ck-color-text: \t\t\t\t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-shadow-drop: \t\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.15);\n\t--ck-color-shadow-drop-active:\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.2);\n\t--ck-color-shadow-inner: \t\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.1);\n\n\t/* -- Buttons ------------------------------------------------------------------------------- */\n\n\t--ck-color-button-default-background: \t\t\t\t\t\ttransparent;\n\t--ck-color-button-default-hover-background: \t\t\t\thsl(0, 0%, 90%);\n\t--ck-color-button-default-active-background: \t\t\t\thsl(0, 0%, 85%);\n\t--ck-color-button-default-active-shadow: \t\t\t\t\thsl(0, 0%, 75%);\n\t--ck-color-button-default-disabled-background: \t\t\t\ttransparent;\n\n\t--ck-color-button-on-background: \t\t\t\t\t\t\thsl(0, 0%, 87%);\n\t--ck-color-button-on-hover-background: \t\t\t\t\t\thsl(0, 0%, 77%);\n\t--ck-color-button-on-active-background: \t\t\t\t\thsl(0, 0%, 73%);\n\t--ck-color-button-on-active-shadow: \t\t\t\t\t\thsl(0, 0%, 63%);\n\t--ck-color-button-on-disabled-background: \t\t\t\t\thsl(0, 0%, 87%);\n\n\t--ck-color-button-action-background: \t\t\t\t\t\tvar(--ck-color-base-action);\n\t--ck-color-button-action-hover-background: \t\t\t\t\thsl(104, 44%, 43%);\n\t--ck-color-button-action-active-background: \t\t\t\thsl(104, 44%, 41%);\n\t--ck-color-button-action-active-shadow: \t\t\t\t\thsl(104, 44%, 36%);\n\t--ck-color-button-action-disabled-background: \t\t\t\thsl(104, 44%, 58%);\n\t--ck-color-button-action-text: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t--ck-color-button-save: \t\t\t\t\t\t\t\t\thsl(120, 100%, 27%);\n\t--ck-color-button-cancel: \t\t\t\t\t\t\t\t\thsl(15, 100%, 43%);\n\n\t--ck-color-switch-button-off-background:\t\t\t\t\thsl(0, 0%, 69%);\n\t--ck-color-switch-button-off-hover-background:\t\t\t\thsl(0, 0%, 64%);\n\t--ck-color-switch-button-on-background:\t\t\t\t\t\tvar(--ck-color-button-action-background);\n\t--ck-color-switch-button-on-hover-background:\t\t\t\thsl(104, 44%, 43%);\n\t--ck-color-switch-button-inner-background:\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-switch-button-inner-shadow:\t\t\t\t\t\thsla(0, 0%, 0%, 0.1);\n\n\t/* -- Dropdown ------------------------------------------------------------------------------ */\n\n\t--ck-color-dropdown-panel-background: \t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-dropdown-panel-border: \t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Input --------------------------------------------------------------------------------- */\n\n\t--ck-color-input-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-input-border: \t\t\t\t\t\t\t\t\thsl(0, 0%, 78%);\n\t--ck-color-input-error-border:\t\t\t\t\t\t\t\tvar(--ck-color-base-error);\n\t--ck-color-input-text: \t\t\t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-input-disabled-background: \t\t\t\t\t\thsl(0, 0%, 95%);\n\t--ck-color-input-disabled-border: \t\t\t\t\t\t\thsl(0, 0%, 78%);\n\t--ck-color-input-disabled-text: \t\t\t\t\t\t\thsl(0, 0%, 46%);\n\n\t/* -- List ---------------------------------------------------------------------------------- */\n\n\t--ck-color-list-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-list-button-hover-background: \t\t\t\t\tvar(--ck-color-button-default-hover-background);\n\t--ck-color-list-button-on-background: \t\t\t\t\t\tvar(--ck-color-base-active);\n\t--ck-color-list-button-on-background-focus: \t\t\t\tvar(--ck-color-base-active-focus);\n\t--ck-color-list-button-on-text:\t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t/* -- Panel --------------------------------------------------------------------------------- */\n\n\t--ck-color-panel-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-panel-border: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Toolbar ------------------------------------------------------------------------------- */\n\n\t--ck-color-toolbar-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-foreground);\n\t--ck-color-toolbar-border: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Tooltip ------------------------------------------------------------------------------- */\n\n\t--ck-color-tooltip-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-tooltip-text: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t/* -- Engine -------------------------------------------------------------------------------- */\n\n\t--ck-color-engine-placeholder-text: \t\t\t\t\t\thsl(0, 0%, 44%);\n\n\t/* -- Upload -------------------------------------------------------------------------------- */\n\n\t--ck-color-upload-bar-background:\t\t \t\t\t\t\thsl(209, 92%, 70%);\n\n\t/* -- Link -------------------------------------------------------------------------------- */\n\n\t--ck-color-link-default:\t\t\t\t\t\t\t\t\thsl(240, 100%, 47%);\n\t--ck-color-link-selected-background:\t\t\t\t\t\thsla(201, 100%, 56%, 0.1);\n\t--ck-color-link-fake-selection:\t\t\t\t\t\t\t\thsla(201, 100%, 56%, 0.3);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * An opacity value of disabled UI item.\n\t */\n\t--ck-disabled-opacity: .5;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * The geometry of the of focused element's outer shadow.\n\t */\n\t--ck-focus-outer-shadow-geometry: 0 0 0 3px;\n\n\t/**\n\t * A visual style of focused element's outer shadow.\n\t */\n\t--ck-focus-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);\n\n\t/**\n\t * A visual style of focused element's outer shadow (when disabled).\n\t */\n\t--ck-focus-disabled-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);\n\n\t/**\n\t * A visual style of focused element's outer shadow (when has errors).\n\t */\n\t--ck-focus-error-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);\n\n\t/**\n\t * A visual style of focused element's border or outline.\n\t */\n\t--ck-focus-ring: 1px solid var(--ck-color-focus-border);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-font-size-base: 13px;\n\t--ck-line-height-base: 1.84615;\n\t--ck-font-face: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\n\n\t--ck-font-size-tiny: 0.7em;\n\t--ck-font-size-small: 0.75em;\n\t--ck-font-size-normal: 1em;\n\t--ck-font-size-big: 1.4em;\n\t--ck-font-size-large: 1.8em;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/* This is super-important. This is **manually** adjusted so a button without an icon\n\tis never smaller than a button with icon, additionally making sure that text-less buttons\n\tare perfect squares. The value is also shared by other components which should stay "in-line"\n\twith buttons. */\n\t--ck-ui-component-min-height: 2.3em;\n}\n\n/**\n * Resets an element, ignoring its children.\n */\n.ck.ck-reset,\n.ck.ck-reset_all,\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\n\t/* Do not include inheritable rules here. */\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: transparent;\n\ttext-decoration: none;\n\tvertical-align: middle;\n\ttransition: none;\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/105 */\n\tword-wrap: break-word;\n}\n\n/**\n * Resets an element AND its children.\n */\n.ck.ck-reset_all,\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\n\t/* These are rule inherited by all children elements. */\n\tborder-collapse: collapse;\n\tfont: normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);\n\tcolor: var(--ck-color-text);\n\ttext-align: left;\n\twhite-space: nowrap;\n\tcursor: auto;\n\tfloat: none;\n}\n\n.ck-reset_all {\n\t& .ck-rtl *:not(.ck-reset_all-excluded *) {\n\t\ttext-align: right;\n\t}\n\n\t& iframe:not(.ck-reset_all-excluded *) {\n\t\t/* For IE */\n\t\tvertical-align: inherit;\n\t}\n\n\t& textarea:not(.ck-reset_all-excluded *) {\n\t\twhite-space: pre-wrap;\n\t}\n\n\t& textarea:not(.ck-reset_all-excluded *),\n\t& input[type="text"]:not(.ck-reset_all-excluded *),\n\t& input[type="password"]:not(.ck-reset_all-excluded *) {\n\t\tcursor: text;\n\t}\n\n\t& textarea[disabled]:not(.ck-reset_all-excluded *),\n\t& input[type="text"][disabled]:not(.ck-reset_all-excluded *),\n\t& input[type="password"][disabled]:not(.ck-reset_all-excluded *) {\n\t\tcursor: default;\n\t}\n\n\t& fieldset:not(.ck-reset_all-excluded *) {\n\t\tpadding: 10px;\n\t\tborder: 2px groove hsl(255, 7%, 88%);\n\t}\n\n\t& button:not(.ck-reset_all-excluded *)::-moz-focus-inner {\n\t\t/* See http://stackoverflow.com/questions/5517744/remove-extra-button-spacing-padding-in-firefox */\n\t\tpadding: 0;\n\t\tborder: 0\n\t}\n}\n\n/**\n * Default UI rules for RTL languages.\n */\n.ck[dir="rtl"],\n.ck[dir="rtl"] .ck {\n\ttext-align: right;\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Default border-radius value.\n */\n:root{\n\t--ck-border-radius: 2px;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * A visual style of element's inner shadow (i.e. input).\n\t */\n\t--ck-inner-shadow: 2px 2px 3px var(--ck-color-shadow-inner) inset;\n\n\t/**\n\t * A visual style of element's drop shadow (i.e. panel).\n\t */\n\t--ck-drop-shadow: 0 1px 2px 1px var(--ck-color-shadow-drop);\n\n\t/**\n\t * A visual style of element's active shadow (i.e. comment or suggestion).\n\t */\n\t--ck-drop-shadow-active: 0 3px 6px 1px var(--ck-color-shadow-drop-active);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-spacing-unit: \t\t\t\t\t\t0.6em;\n\t--ck-spacing-large: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 1.5);\n\t--ck-spacing-standard: \t\t\t\t\tvar(--ck-spacing-unit);\n\t--ck-spacing-medium: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.8);\n\t--ck-spacing-small: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.5);\n\t--ck-spacing-tiny: \t\t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.3);\n\t--ck-spacing-extra-tiny: \t\t\t\tcalc(var(--ck-spacing-unit) * 0.16);\n}\n"],sourceRoot:""}]);const a=r},507:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background);border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widget.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAKA,MACC,+CAAgD,CAChD,6CAAsD,CACtD,uCAAgD,CAEhD,kDAAmD,CACnD,gCAAiC,CACjC,kEACD,CAOA,8DAEC,iBAqBD,CAnBC,4EACC,iBAOD,CALC,qFAGC,aACD,CASD,iLACC,kBACD,CAGD,kBACC,qDAAsD,CAEtD,qDAAsD,CACtD,6CAA8C,CAF9C,0CAA2C,CAI3C,aAAc,CADd,kCAAmC,CAGnC,uCAAwC,CACxC,4CAA6C,CAF7C,iCAsCD,CAlCC,8NAKC,iBACD,CAEA,0CAEC,qCAAsC,CADtC,oCAED,CAEA,2CAEC,sCAAuC,CADvC,oCAED,CAEA,8CACC,uCAAwC,CACxC,sCACD,CAEA,6CACC,uCAAwC,CACxC,qCACD,CAGA,8CAEC,QAAS,CADT,6CAAgD,CAEhD,yBACD,CCjFD,MACC,iCAAkC,CAClC,kCAAmC,CACnC,4CAA6C,CAC7C,wCAAyC,CAEzC,wCAAiD,CACjD,sCAAkD,CAClD,2EAA4E,CAC5E,yEACD,CAEA,eAGC,yBAA0B,CAD1B,mBAAoB,CADpB,gDAAiD,CAGjD,6GAUD,CARC,0EAEC,6EACD,CAEA,qBACC,iDACD,CAGD,gCACC,4BAWD,CAPC,yGAKC,iEAAkE,CCnCnE,2BAA2B,CCF3B,qCAA8B,CDC9B,YDqCA,CAIA,4EAKC,4BAA6B,CAa7B,iEAAkE,CAhBlE,qBAAsB,CAoBtB,mDAAoD,CAhBpD,SAAU,CALV,WAAY,CAsBZ,KAAM,CAFN,2BAA4B,CAT5B,6SAgCD,CAnBC,qFAIC,oDAAqD,CADrD,yCAA0C,CAD1C,wCAWD,CANC,kHACC,SAAU,CAGV,+DACD,CAID,wHACC,SACD,CAID,kFAEC,oDAAqD,CADrD,SAED,CAKC,oMAEC,6CAA8C,CAD9C,SAOD,CAHC,gRACC,SACD,CAOH,qFACC,SAAU,CACV,oDACD,CAGA,gDAEC,eAkBD,CAhBC,yEAOC,iCACD,CAGC,gOAEC,gDACD,CAOD,wIAEC,mDAQD,CALE,ghBAEC,gDACD,CAKH,yKAOC,yDACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-resizer: var(--ck-color-focus-border);\n\t--ck-color-resizer-tooltip-background: hsl(0, 0%, 15%);\n\t--ck-color-resizer-tooltip-text: hsl(0, 0%, 95%);\n\n\t--ck-resizer-border-radius: var(--ck-border-radius);\n\t--ck-resizer-tooltip-offset: 10px;\n\t--ck-resizer-tooltip-height: calc(var(--ck-spacing-small) * 2 + 10px);\n}\n\n.ck .ck-widget {\n\t/* This is neccessary for type around UI to be positioned properly. */\n\tposition: relative;\n}\n\n.ck .ck-widget.ck-widget_with-selection-handle {\n\t/* Make the widget wrapper a relative positioning container for the drag handle. */\n\tposition: relative;\n\n\t& .ck-widget__selection-handle {\n\t\tposition: absolute;\n\n\t\t& .ck-icon {\n\t\t\t/* Make sure the icon in not a subject to font-size or line-height to avoid\n\t\t\tunnecessary spacing around it. */\n\t\t\tdisplay: block;\n\t\t}\n\t}\n\n\t/* Show the selection handle on mouse hover over the widget, but not for nested widgets. */\n\t&:hover > .ck-widget__selection-handle {\n\t\tvisibility: visible;\n\t}\n\n\t/* Show the selection handle when the widget is selected, but not for nested widgets. */\n\t&.ck-widget_selected > .ck-widget__selection-handle {\n\t\tvisibility: visible;\n\t}\n}\n\n.ck .ck-size-view {\n\tbackground: var(--ck-color-resizer-tooltip-background);\n\tcolor: var(--ck-color-resizer-tooltip-text);\n\tborder: 1px solid var(--ck-color-resizer-tooltip-text);\n\tborder-radius: var(--ck-resizer-border-radius);\n\tfont-size: var(--ck-font-size-tiny);\n\tdisplay: block;\n\tpadding: 0 var(--ck-spacing-small);\n\theight: var(--ck-resizer-tooltip-height);\n\tline-height: var(--ck-resizer-tooltip-height);\n\n\t&.ck-orientation-top-left,\n\t&.ck-orientation-top-right,\n\t&.ck-orientation-bottom-right,\n\t&.ck-orientation-bottom-left,\n\t&.ck-orientation-above-center {\n\t\tposition: absolute;\n\t}\n\n\t&.ck-orientation-top-left {\n\t\ttop: var(--ck-resizer-tooltip-offset);\n\t\tleft: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-top-right {\n\t\ttop: var(--ck-resizer-tooltip-offset);\n\t\tright: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-bottom-right {\n\t\tbottom: var(--ck-resizer-tooltip-offset);\n\t\tright: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-bottom-left {\n\t\tbottom: var(--ck-resizer-tooltip-offset);\n\t\tleft: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t/* Class applied if the widget is too small to contain the size label */\n\t&.ck-orientation-above-center {\n\t\ttop: calc(var(--ck-resizer-tooltip-height) * -1);\n\t\tleft: 50%;\n\t\ttransform: translate(-50%);\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../mixins/_focus.css";\n@import "../mixins/_shadow.css";\n\n:root {\n\t--ck-widget-outline-thickness: 3px;\n\t--ck-widget-handler-icon-size: 16px;\n\t--ck-widget-handler-animation-duration: 200ms;\n\t--ck-widget-handler-animation-curve: ease;\n\n\t--ck-color-widget-blurred-border: hsl(0, 0%, 87%);\n\t--ck-color-widget-hover-border: hsl(43, 100%, 62%);\n\t--ck-color-widget-editable-focus-background: var(--ck-color-base-background);\n\t--ck-color-widget-drag-handler-icon-color: var(--ck-color-base-background);\n}\n\n.ck .ck-widget {\n\toutline-width: var(--ck-widget-outline-thickness);\n\toutline-style: solid;\n\toutline-color: transparent;\n\ttransition: outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border);\n\t}\n\n\t&:hover {\n\t\toutline-color: var(--ck-color-widget-hover-border);\n\t}\n}\n\n.ck .ck-editor__nested-editable {\n\tborder: 1px solid transparent;\n\n\t/* The :focus style is applied before .ck-editor__nested-editable_focused class is rendered in the view.\n\tThese styles show a different border for a blink of an eye, so `:focus` need to have same styles applied. */\n\t&.ck-editor__nested-editable_focused,\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-inner-shadow);\n\n\t\tbackground-color: var(--ck-color-widget-editable-focus-background);\n\t}\n}\n\n.ck .ck-widget.ck-widget_with-selection-handle {\n\t& .ck-widget__selection-handle {\n\t\tpadding: 4px;\n\t\tbox-sizing: border-box;\n\n\t\t/* Background and opacity will be animated as the handler shows up or the widget gets selected. */\n\t\tbackground-color: transparent;\n\t\topacity: 0;\n\n\t\t/* Transition:\n\t\t * background-color for the .ck-widget_selected state change,\n\t\t * visibility for hiding the handler,\n\t\t * opacity for the proper look of the icon when the handler disappears. */\n\t\ttransition:\n\t\t\tbackground-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\n\t\t\tvisibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\n\t\t\topacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t\t/* Make only top corners round. */\n\t\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\n\n\t\t/* Place the drag handler outside the widget wrapper. */\n\t\ttransform: translateY(-100%);\n\t\tleft: calc(0px - var(--ck-widget-outline-thickness));\n\t\ttop: 0;\n\n\t\t& .ck-icon {\n\t\t\t/* Make sure the dimensions of the icon are independent of the fon-size of the content. */\n\t\t\twidth: var(--ck-widget-handler-icon-size);\n\t\t\theight: var(--ck-widget-handler-icon-size);\n\t\t\tcolor: var(--ck-color-widget-drag-handler-icon-color);\n\n\t\t\t/* The "selected" part of the icon is invisible by default */\n\t\t\t& .ck-icon__selected-indicator {\n\t\t\t\topacity: 0;\n\n\t\t\t\t/* Note: The animation is longer on purpose. Simply feels better. */\n\t\t\t\ttransition: opacity 300ms var(--ck-widget-handler-animation-curve);\n\t\t\t}\n\t\t}\n\n\t\t/* Advertise using the look of the icon that once clicked the handler, the widget will be selected. */\n\t\t&:hover .ck-icon .ck-icon__selected-indicator {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t/* Show the selection handler on mouse hover over the widget, but not for nested widgets. */\n\t&:hover > .ck-widget__selection-handle {\n\t\topacity: 1;\n\t\tbackground-color: var(--ck-color-widget-hover-border);\n\t}\n\n\t/* Show the selection handler when the widget is selected, but not for nested widgets. */\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\t& > .ck-widget__selection-handle {\n\t\t\topacity: 1;\n\t\t\tbackground-color: var(--ck-color-focus-border);\n\n\t\t\t/* When the widget is selected, notify the user using the proper look of the icon. */\n\t\t\t& .ck-icon .ck-icon__selected-indicator {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/* In a RTL environment, align the selection handler to the right side of the widget */\n/* stylelint-disable-next-line no-descending-specificity */\n.ck[dir="rtl"] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle {\n\tleft: auto;\n\tright: calc(0px - var(--ck-widget-outline-thickness));\n}\n\n/* https://github.com/ckeditor/ckeditor5/issues/6415 */\n.ck.ck-editor__editable.ck-read-only .ck-widget {\n\t/* Prevent the :hover outline from showing up because of the used outline-color transition. */\n\ttransition: none;\n\n\t&:not(.ck-widget_selected) {\n\t\t/* Disable visual effects of hover/active widget when CKEditor is in readOnly mode.\n\t\t * See: https://github.com/ckeditor/ckeditor5/issues/1261\n\t\t *\n\t\t * Leave the unit because this custom property is used in calc() by other features.\n\t\t * See: https://github.com/ckeditor/ckeditor5/issues/6775\n\t\t */\n\t\t--ck-widget-outline-thickness: 0px;\n\t}\n\n\t&.ck-widget_with-selection-handle {\n\t\t& .ck-widget__selection-handle,\n\t\t& .ck-widget__selection-handle:hover {\n\t\t\tbackground: var(--ck-color-widget-blurred-border);\n\t\t}\n\t}\n}\n\n/* Style the widget when it\'s selected but the editable it belongs to lost focus. */\n/* stylelint-disable-next-line no-descending-specificity */\n.ck.ck-editor__editable.ck-blurred .ck-widget {\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\toutline-color: var(--ck-color-widget-blurred-border);\n\n\t\t&.ck-widget_with-selection-handle {\n\t\t\t& > .ck-widget__selection-handle,\n\t\t\t& > .ck-widget__selection-handle:hover {\n\t\t\t\tbackground: var(--ck-color-widget-blurred-border);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-editor__editable > .ck-widget.ck-widget_with-selection-handle:first-child,\n.ck.ck-editor__editable blockquote > .ck-widget.ck-widget_with-selection-handle:first-child {\n\t/* Do not crop selection handler if a widget is a first-child in the blockquote or in the root editable.\n\tIn fact, anything with overflow: hidden.\n\thttps://github.com/ckeditor/ckeditor5-block-quote/issues/28\n\thttps://github.com/ckeditor/ckeditor5-widget/issues/44\n\thttps://github.com/ckeditor/ckeditor5-widget/issues/66 */\n\tmargin-top: calc(1em + var(--ck-widget-handler-icon-size));\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},263:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgetresize.css"],names:[],mappings:"AAKA,4BAEC,iBACD,CAEA,wBACC,YAAa,CAMb,MAAO,CAFP,mBAAoB,CAHpB,iBAAkB,CAMlB,KACD,CAGC,2EACC,aACD,CAGD,gCAIC,kBAAmB,CAHnB,iBAcD,CATC,4IAEC,kBACD,CAEA,4IAEC,kBACD,CCpCD,MACC,sBAAuB,CAGvB,yDAAiE,CACjE,6BACD,CAEA,wBACC,yCACD,CAEA,gCAGC,uCAAwC,CACxC,gDAA6D,CAC7D,6CAA8C,CAH9C,6BAA8B,CAD9B,4BAyBD,CAnBC,oEAEC,6BAA8B,CAD9B,4BAED,CAEA,qEAEC,8BAA+B,CAD/B,4BAED,CAEA,wEACC,+BAAgC,CAChC,8BACD,CAEA,uEACC,+BAAgC,CAChC,6BACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-widget_with-resizer {\n\t/* Make the widget wrapper a relative positioning container for the drag handle. */\n\tposition: relative;\n}\n\n.ck .ck-widget__resizer {\n\tdisplay: none;\n\tposition: absolute;\n\n\t/* The wrapper itself should not interfere with the pointer device, only the handles should. */\n\tpointer-events: none;\n\n\tleft: 0;\n\ttop: 0;\n}\n\n.ck-focused .ck-widget_with-resizer.ck-widget_selected {\n\t& > .ck-widget__resizer {\n\t\tdisplay: block;\n\t}\n}\n\n.ck .ck-widget__resizer__handle {\n\tposition: absolute;\n\n\t/* Resizers are the only UI elements that should interfere with a pointer device. */\n\tpointer-events: all;\n\n\t&.ck-widget__resizer__handle-top-left,\n\t&.ck-widget__resizer__handle-bottom-right {\n\t\tcursor: nwse-resize;\n\t}\n\n\t&.ck-widget__resizer__handle-top-right,\n\t&.ck-widget__resizer__handle-bottom-left {\n\t\tcursor: nesw-resize;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-resizer-size: 10px;\n\n\t/* Set the resizer with a 50% offset. */\n\t--ck-resizer-offset: calc( ( var(--ck-resizer-size) / -2 ) - 2px);\n\t--ck-resizer-border-width: 1px;\n}\n\n.ck .ck-widget__resizer {\n\toutline: 1px solid var(--ck-color-resizer);\n}\n\n.ck .ck-widget__resizer__handle {\n\twidth: var(--ck-resizer-size);\n\theight: var(--ck-resizer-size);\n\tbackground: var(--ck-color-focus-border);\n\tborder: var(--ck-resizer-border-width) solid hsl(0, 0%, 100%);\n\tborder-radius: var(--ck-resizer-border-radius);\n\n\t&.ck-widget__resizer__handle-top-left {\n\t\ttop: var(--ck-resizer-offset);\n\t\tleft: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-top-right {\n\t\ttop: var(--ck-resizer-offset);\n\t\tright: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-bottom-right {\n\t\tbottom: var(--ck-resizer-offset);\n\t\tright: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-bottom-left {\n\t\tbottom: var(--ck-resizer-offset);\n\t\tleft: var(--ck-resizer-offset);\n\t}\n}\n"],sourceRoot:""}]);const a=r},137:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);width:var(--ck-widget-type-around-button-size)}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgettypearound.css"],names:[],mappings:"AASC,+CACC,aAAc,CAEd,eAAgB,CADhB,iBAAkB,CAElB,2BAwBD,CAtBC,mDAGC,QAAS,CAFT,iBAAkB,CAClB,OAAQ,CAER,qCACD,CAEA,qFAGC,kBAAoB,CADpB,gDAAoD,CAGpD,0BACD,CAEA,oFAEC,mDAAuD,CACvD,mBAAqB,CAErB,yBACD,CAUA,mLACC,UAAW,CACX,aAAc,CAGd,QAAS,CAFT,iBAAkB,CAClB,OAAQ,CAER,qCACD,CAMD,2EACC,YAAa,CAEb,MAAO,CADP,iBAAkB,CAElB,OACD,CAOA,iFACC,gDAAqD,CACrD,iDACD,CAKA,wHAEC,aAAc,CADd,qDAED,CAKA,uHACC,wDAA6D,CAC7D,aACD,CAoBD,mOACC,YACD,CC3GA,MACC,wCAAyC,CACzC,wEAAyE,CACzE,8EAA+E,CAC/E,2FAA4F,CAC5F,wDAAyD,CACzD,uDAAwD,CACxD,yEACD,CAgBC,+CAGC,oDAAqD,CACrD,mBAAoB,CAFpB,+CAAgD,CAVjD,SAAU,CACV,mBAAoB,CAYnB,uMAAyM,CAJzM,8CAkDD,CA1CC,mDAEC,UAAW,CAGX,cAAe,CAFf,8BAA+B,CAC/B,6BAA8B,CAH9B,UAoBD,CAdC,qDACC,mBAAoB,CACpB,mBAAoB,CAEpB,SAAU,CACV,qDAAsD,CACtD,kBAAmB,CACnB,oBAAqB,CACrB,qBACD,CAEA,wDACC,kBACD,CAGD,qDAIC,6DAcD,CARE,kEACC,oDACD,CAEA,8DACC,wDACD,CAUF,uKAvED,SAAU,CACV,mBAwEC,CAOD,gGACC,0DACD,CAOA,uKAEC,2DAQD,CANC,mLAIC,uEAAkF,CADlF,mBAAoB,CADpB,2DAA4D,CAD5D,0DAID,CAOD,8GACC,gBACD,CAKA,mDAGC,mFAAoF,CAOpF,oCAAqC,CARrC,UAAW,CAOX,oCAAwC,CARxC,mBAUD,CAOC,6JAEC,yBACD,CAUA,yKACC,iDACD,CAMA,uOAlJD,SAAU,CACV,mBAmJC,CASE,0jBACC,SACD,CASF,mPACC,SACD,CASF,uHACC,aAAc,CACd,iBACD,CAYG,iRAlMF,SAAU,CACV,mBAmME,CAQH,kIACC,qEAKD,CAHC,wIACC,WACD,CAGD,4CACC,GACC,oBACD,CACA,OACC,mBACD,CACD,CAEA,gDACC,OACC,mBACD,CACA,OACC,mBACD,CACD,CAEA,8CACC,GACC,6HACD,CACA,IACC,6HACD,CACA,GACC,+HACD,CACD,CAEA,kDACC,GACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,GACC,SACD,CACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-widget {\n\t/*\n\t * Styles of the type around buttons\n\t */\n\t& .ck-widget__type-around__button {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\toverflow: hidden;\n\t\tz-index: var(--ck-z-default);\n\n\t\t& svg {\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: 50%;\n\t\t\tz-index: calc(var(--ck-z-default) + 2);\n\t\t}\n\n\t\t&.ck-widget__type-around__button_before {\n\t\t\t/* Place it in the middle of the outline */\n\t\t\ttop: calc(-0.5 * var(--ck-widget-outline-thickness));\n\t\t\tleft: min(10%, 30px);\n\n\t\t\ttransform: translateY(-50%);\n\t\t}\n\n\t\t&.ck-widget__type-around__button_after {\n\t\t\t/* Place it in the middle of the outline */\n\t\t\tbottom: calc(-0.5 * var(--ck-widget-outline-thickness));\n\t\t\tright: min(10%, 30px);\n\n\t\t\ttransform: translateY(50%);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the buttons when:\n\t * - the widget is selected,\n\t * - or the button is being hovered (regardless of the widget state).\n\t */\n\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\n\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\n\t\t&::after {\n\t\t\tcontent: "";\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t\ttop: 1px;\n\t\t\tleft: 1px;\n\t\t\tz-index: calc(var(--ck-z-default) + 1);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the horizontal "fake caret" which is displayed when the user navigates using the keyboard.\n\t */\n\t& > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tdisplay: none;\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t}\n\n\t/*\n\t * When the widget is hovered the "fake caret" would normally be narrower than the\n\t * extra outline displayed around the widget. Let\'s extend the "fake caret" to match\n\t * the full width of the widget.\n\t */\n\t&:hover > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tleft: calc( -1 * var(--ck-widget-outline-thickness) );\n\t\tright: calc( -1 * var(--ck-widget-outline-thickness) );\n\t}\n\n\t/*\n\t * Styles for the horizontal "fake caret" when it should be displayed before the widget (backward keyboard navigation).\n\t */\n\t&.ck-widget_type-around_show-fake-caret_before > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\ttop: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\n\t\tdisplay: block;\n\t}\n\n\t/*\n\t * Styles for the horizontal "fake caret" when it should be displayed after the widget (forward keyboard navigation).\n\t */\n\t&.ck-widget_type-around_show-fake-caret_after > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tbottom: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\n\t\tdisplay: block;\n\t}\n}\n\n/*\n * Integration with the read-only mode of the editor.\n */\n.ck.ck-editor__editable.ck-read-only .ck-widget__type-around {\n\tdisplay: none;\n}\n\n/*\n * Integration with the restricted editing mode (feature) of the editor.\n */\n.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around {\n\tdisplay: none;\n}\n\n/*\n * Integration with the #isEnabled property of the WidgetTypeAround plugin.\n */\n.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around {\n\tdisplay: none;\n}\n','/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-widget-type-around-button-size: 20px;\n\t--ck-color-widget-type-around-button-active: var(--ck-color-focus-border);\n\t--ck-color-widget-type-around-button-hover: var(--ck-color-widget-hover-border);\n\t--ck-color-widget-type-around-button-blurred-editable: var(--ck-color-widget-blurred-border);\n\t--ck-color-widget-type-around-button-radar-start-alpha: 0;\n\t--ck-color-widget-type-around-button-radar-end-alpha: .3;\n\t--ck-color-widget-type-around-button-icon: var(--ck-color-base-background);\n}\n\n@define-mixin ck-widget-type-around-button-visible {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n@define-mixin ck-widget-type-around-button-hidden {\n\topacity: 0;\n\tpointer-events: none;\n}\n\n.ck .ck-widget {\n\t/*\n\t * Styles of the type around buttons\n\t */\n\t& .ck-widget__type-around__button {\n\t\twidth: var(--ck-widget-type-around-button-size);\n\t\theight: var(--ck-widget-type-around-button-size);\n\t\tbackground: var(--ck-color-widget-type-around-button);\n\t\tborder-radius: 100px;\n\t\ttransition: opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve), background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t\t@mixin ck-widget-type-around-button-hidden;\n\n\t\t& svg {\n\t\t\twidth: 10px;\n\t\t\theight: 8px;\n\t\t\ttransform: translate(-50%,-50%);\n\t\t\ttransition: transform .5s ease;\n\t\t\tmargin-top: 1px;\n\n\t\t\t& * {\n\t\t\t\tstroke-dasharray: 10;\n\t\t\t\tstroke-dashoffset: 0;\n\n\t\t\t\tfill: none;\n\t\t\t\tstroke: var(--ck-color-widget-type-around-button-icon);\n\t\t\t\tstroke-width: 1.5px;\n\t\t\t\tstroke-linecap: round;\n\t\t\t\tstroke-linejoin: round;\n\t\t\t}\n\n\t\t\t& line {\n\t\t\t\tstroke-dasharray: 7;\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t/*\n\t\t\t * Display the "sonar" around the button when hovered.\n\t\t\t */\n\t\t\tanimation: ck-widget-type-around-button-sonar 1s ease infinite;\n\n\t\t\t/*\n\t\t\t * Animate active button\'s icon.\n\t\t\t */\n\t\t\t& svg {\n\t\t\t\t& polyline {\n\t\t\t\t\tanimation: ck-widget-type-around-arrow-dash 2s linear;\n\t\t\t\t}\n\n\t\t\t\t& line {\n\t\t\t\t\tanimation: ck-widget-type-around-arrow-tip-dash 2s linear;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Show type around buttons when the widget gets selected or being hovered.\n\t */\n\t&.ck-widget_selected,\n\t&:hover {\n\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t@mixin ck-widget-type-around-button-visible;\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the buttons when the widget is NOT selected (but the buttons are visible\n\t * and still can be hovered).\n\t */\n\t&:not(.ck-widget_selected) > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\tbackground: var(--ck-color-widget-type-around-button-hover);\n\t}\n\n\t/*\n\t * Styles for the buttons when:\n\t * - the widget is selected,\n\t * - or the button is being hovered (regardless of the widget state).\n\t */\n\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\n\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\n\t\tbackground: var(--ck-color-widget-type-around-button-active);\n\n\t\t&::after {\n\t\t\twidth: calc(var(--ck-widget-type-around-button-size) - 2px);\n\t\t\theight: calc(var(--ck-widget-type-around-button-size) - 2px);\n\t\t\tborder-radius: 100px;\n\t\t\tbackground: linear-gradient(135deg, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,.3) 100%);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the "before" button when the widget has a selection handle. Because some space\n\t * is consumed by the handle, the button must be moved slightly to the right to let it breathe.\n\t */\n\t&.ck-widget_with-selection-handle > .ck-widget__type-around > .ck-widget__type-around__button_before {\n\t\tmargin-left: 20px;\n\t}\n\n\t/*\n\t * Styles for the horizontal "fake caret" which is displayed when the user navigates using the keyboard.\n\t */\n\t& .ck-widget__type-around__fake-caret {\n\t\tpointer-events: none;\n\t\theight: 1px;\n\t\tanimation: ck-widget-type-around-fake-caret-pulse linear 1s infinite normal forwards;\n\n\t\t/*\n\t\t * The semi-transparent-outline+background combo improves the contrast\n\t\t * when the background underneath the fake caret is dark.\n\t\t */\n\t\toutline: solid 1px hsla(0, 0%, 100%, .5);\n\t\tbackground: var(--ck-color-base-text);\n\t}\n\n\t/*\n\t * Styles of the widget when the "fake caret" is blinking (e.g. upon keyboard navigation).\n\t * Despite the widget being physically selected in the model, its outline should disappear.\n\t */\n\t&.ck-widget_selected {\n\t\t&.ck-widget_type-around_show-fake-caret_before,\n\t\t&.ck-widget_type-around_show-fake-caret_after {\n\t\t\toutline-color: transparent;\n\t\t}\n\t}\n\n\t&.ck-widget_type-around_show-fake-caret_before,\n\t&.ck-widget_type-around_show-fake-caret_after {\n\t\t/*\n\t\t * When the "fake caret" is visible we simulate that the widget is not selected\n\t\t * (despite being physically selected), so the outline color should be for the\n\t\t * unselected widget.\n\t\t */\n\t\t&.ck-widget_selected:hover {\n\t\t\toutline-color: var(--ck-color-widget-hover-border);\n\t\t}\n\n\t\t/*\n\t\t * Styles of the type around buttons when the "fake caret" is blinking (e.g. upon keyboard navigation).\n\t\t * In this state, the type around buttons would collide with the fake carets so they should disappear.\n\t\t */\n\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t@mixin ck-widget-type-around-button-hidden;\n\t\t}\n\n\t\t/*\n\t\t * Fake horizontal caret integration with the selection handle. When the caret is visible, simply\n\t\t * hide the handle because it intersects with the caret (and does not make much sense anyway).\n\t\t */\n\t\t&.ck-widget_with-selection-handle {\n\t\t\t&.ck-widget_selected,\n\t\t\t&.ck-widget_selected:hover {\n\t\t\t\t& > .ck-widget__selection-handle {\n\t\t\t\t\topacity: 0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Fake horizontal caret integration with the resize UI. When the caret is visible, simply\n\t\t * hide the resize UI because it creates too much noise. It can be visible when the user\n\t\t * hovers the widget, though.\n\t\t */\n\t\t&.ck-widget_selected.ck-widget_with-resizer > .ck-widget__resizer {\n\t\t\topacity: 0\n\t\t}\n\t}\n}\n\n/*\n * Styles for the "before" button when the widget has a selection handle in an RTL environment.\n * The selection handler is aligned to the right side of the widget so there is no need to create\n * additional space for it next to the "before" button.\n */\n.ck[dir="rtl"] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around > .ck-widget__type-around__button_before {\n\tmargin-left: 0;\n\tmargin-right: 20px;\n}\n\n/*\n * Hide type around buttons when the widget is selected as a child of a selected\n * nested editable (e.g. mulit-cell table selection).\n *\n * See https://github.com/ckeditor/ckeditor5/issues/7263.\n */\n.ck-editor__nested-editable.ck-editor__editable_selected {\n\t& .ck-widget {\n\t\t&.ck-widget_selected,\n\t\t&:hover {\n\t\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t\t@mixin ck-widget-type-around-button-hidden;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/*\n * Styles for the buttons when the widget is selected but the user clicked outside of the editor (blurred the editor).\n */\n.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button:not(:hover) {\n\tbackground: var(--ck-color-widget-type-around-button-blurred-editable);\n\n\t& svg * {\n\t\tstroke: hsl(0,0%,60%);\n\t}\n}\n\n@keyframes ck-widget-type-around-arrow-dash {\n\t0% {\n\t\tstroke-dashoffset: 10;\n\t}\n\t20%, 100% {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes ck-widget-type-around-arrow-tip-dash {\n\t0%, 20% {\n\t\tstroke-dashoffset: 7;\n\t}\n\t40%, 100% {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes ck-widget-type-around-button-sonar {\n\t0% {\n\t\tbox-shadow: 0 0 0 0 hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\n\t}\n\t50% {\n\t\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-end-alpha));\n\t}\n\t100% {\n\t\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\n\t}\n}\n\n@keyframes ck-widget-type-around-fake-caret-pulse {\n\t0% {\n\t\topacity: 1;\n\t}\n\t49% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n\t99% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n'],sourceRoot:""}]);const a=r},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n}).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(i)for(var o=0;o{function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var i,s,o=[],r=!0,a=!1;try{for(n=n.call(e);!(r=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);r=!0);}catch(e){a=!0,s=e}finally{try{r||null==n.return||n.return()}finally{if(a)throw s}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n{var i=function(){var e;return function(){return void 0===e&&(e=Boolean(window&&document&&document.all&&!window.atob)),e}}(),s=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function r(e){for(var t=-1,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{o.d(r,{default:()=>kx});class i{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const s=new Array(256).fill().map((e,t)=>("0"+t.toString(16)).slice(-2));function a(){const e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0;return"e"+s[255&e]+s[e>>8&255]+s[e>>16&255]+s[e>>24&255]+s[255&t]+s[t>>8&255]+s[t>>16&255]+s[t>>24&255]+s[255&n]+s[n>>8&255]+s[n>>16&255]+s[n>>24&255]+s[255&i]+s[i>>8&255]+s[i>>16&255]+s[i>>24&255]}const l={get(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},d=l;function c(e,t){const n=d.get(t.priority);for(let i=0;i{if("object"==typeof t&&null!==t){if(n.has(t))return`[object ${t.constructor.name}]`;n.add(t)}return t})}`:"";return e+i+m(e)}(e,n)),this.name="CKEditorError",this.context=t,this.data=n}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const n=new u(e.message,t);throw n.stack=e.stack,n}}function h(e,t){console.warn(...function(e,t){const n=m(e);return t?[e,t,n]:[e,n]}(e,t))}function m(e){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-${e}`}const g="object"==typeof window?window:o.g;if(g.CKEDITOR_VERSION)throw new u("ckeditor-duplicated-modules",null);g.CKEDITOR_VERSION="34.0.0";const p=Symbol("listeningTo"),f=Symbol("emitterId"),x={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){let i=!1;this.listenTo(this,e,function(e,...n){i||(i=!0,e.off(),t.call(this,e,...n))},n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,i={}){let s,o;this[p]||(this[p]={});const r=this[p];v(e)||I(e);const a=v(e);(s=r[a])||(s=r[a]={emitter:e,callbacks:{}}),(o=s.callbacks[t])||(o=s.callbacks[t]=[]),o.push(n),function(e,t,n,i,s){t._addEventListener?t._addEventListener(n,i,s):e._addEventListener.call(t,n,i,s)}(this,e,t,n,i)},stopListening(e,t,n){const i=this[p];let s=e&&v(e);const o=i&&s&&i[s],r=o&&t&&o.callbacks[t];if(!(!i||e&&!o||t&&!r))if(n)A(this,e,t,n),-1!==r.indexOf(n)&&(1===r.length?delete o.callbacks[t]:A(this,e,t,n));else if(r){for(;n=r.pop();)A(this,e,t,n);delete o.callbacks[t]}else if(o){for(t in o.callbacks)this.stopListening(e,t);delete i[s]}else{for(s in i)this.stopListening(i[s].emitter);delete this[p]}},fire(e,...t){try{const n=e instanceof i?e:new i(this,e),s=n.name;let o=y(this,s);if(n.path.push(this),o){const e=[n,...t];o=Array.from(o);for(let t=0;t{this._delegations||(this._delegations=new Map),e.forEach(e=>{const i=this._delegations.get(e);i?i.set(t,n):this._delegations.set(e,new Map([[t,n]]))})}}},stopDelegating(e,t){if(this._delegations)if(e)if(t){const n=this._delegations.get(e);n&&n.delete(t)}else this._delegations.delete(e);else this._delegations.clear()},_addEventListener(e,t,n){!function(e,t){const n=b(e);if(n[t])return;let i=t,s=null;const o=[];for(;""!==i&&!n[i];)n[i]=j(),o.push(n[i]),s&&n[i].childEvents.push(s),s=i,i=i.substr(0,i.lastIndexOf(":"));if(""!==i){for(const e of o)e.callbacks=n[i].callbacks.slice();n[i].childEvents.push(s)}}(this,e);const i=C(this,e),s={callback:t,priority:d.get(n.priority)};for(const e of i)c(e,s)},_removeEventListener(e,t){const n=C(this,e);for(const e of n)for(let n=0;n-1?y(e,t.substr(0,t.lastIndexOf(":"))):null}function k(e,t,n){for(let[s,o]of e){o?"function"==typeof o&&(o=o(t.name)):o=t.name;const e=new i(t.source,o);e.path=[...t.path],s.fire(e,...n)}}function A(e,t,n,i){t._removeEventListener?t._removeEventListener(n,i):e._removeEventListener.call(t,n,i)}const w=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},S="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var E="object"==typeof self&&self&&self.Object===Object&&self;const T=S||E||Function("return this")(),z=T.Symbol;var O=Object.prototype,R=O.hasOwnProperty,$=O.toString,D=z?z.toStringTag:void 0;var P=Object.prototype.toString;var F=z?z.toStringTag:void 0;const M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=R.call(e,D),n=e[D];try{e[D]=void 0;var i=!0}catch(e){}var s=$.call(e);return i&&(t?e[D]=n:delete e[D]),s}(e):function(e){return P.call(e)}(e)},N=function(e){if(!w(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},L=T["__core-js_shared__"];var B=function(){var e=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var V=Function.prototype.toString;const U=function(e){if(null!=e){try{return V.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var W=/^\[object .+?Constructor\]$/,G=Function.prototype,H=Object.prototype,q=G.toString,Y=H.hasOwnProperty,K=RegExp("^"+q.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Z=function(e){return!(!w(e)||function(e){return!!B&&B in e}(e))&&(N(e)?K:W).test(U(e))},X=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Z(n)?n:void 0};var J=function(){try{var e=X(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const Q=J,ee=function(e,t,n){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},te=function(e,t){return e===t||e!=e&&t!=t};var ne=Object.prototype.hasOwnProperty;const ie=function(e,t,n){var i=e[t];ne.call(e,t)&&te(i,n)&&(void 0!==n||t in e)||ee(e,t,n)},se=function(e,t,n,i){var s=!n;n||(n={});for(var o=-1,r=t.length;++o0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(de),he=function(e,t){return ue(function(e,t,n){return t=re(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,o=re(i.length-t,0),r=Array(o);++s-1&&e%1==0&&e<=9007199254740991},ge=function(e){return null!=e&&me(e.length)&&!N(e)};var pe=/^(?:0|[1-9]\d*)$/;const fe=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&pe.test(e))&&e>-1&&e%1==0&&e1?n[s-1]:void 0,r=s>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(s--,o):void 0,r&&function(e,t,n){if(!w(n))return!1;var i=typeof t;return!!("number"==i?ge(n)&&fe(t,n.length):"string"==i&&t in n)&&te(n[t],e)}(n[0],n[1],r)&&(o=s<3?void 0:o,s=1),t=Object(t);++i{this.set(t,e[t])},this);et(this);const n=this[qe];if(e in this&&!n.has(e))throw new u("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>n.get(e),set(t){const i=n.get(e);let s=this.fire("set:"+e,e,t,i);void 0===s&&(s=t),i===s&&n.has(e)||(n.set(e,s),this.fire("change:"+e,e,s,i))}}),this[e]=t},bind(...e){if(!e.length||!it(e))throw new u("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new u("observable-bind-duplicate-properties",this);et(this);const t=this[Ke];e.forEach(e=>{if(t.has(e))throw new u("observable-bind-rebind",this)});const n=new Map;return e.forEach(e=>{const i={property:e,to:[]};t.set(e,i),n.set(e,i)}),{to:tt,toMany:nt,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!this[qe])return;const t=this[Ke],n=this[Ye];if(e.length){if(!it(e))throw new u("observable-unbind-wrong-properties",this);e.forEach(e=>{const i=t.get(e);if(!i)return;let s,o,r,a;i.to.forEach(e=>{s=e[0],o=e[1],r=n.get(s),a=r[o],a.delete(i),a.size||delete r[o],Object.keys(r).length||(n.delete(s),this.stopListening(s,"change"))}),t.delete(e)})}else n.forEach((e,t)=>{this.stopListening(t,"change")}),n.clear(),t.clear()},decorate(e){const t=this[e];if(!t)throw new u("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,(e,n)=>{e.return=t.apply(this,n)}),this[e]=function(...t){return this.fire(e,t)},this[e][Xe]=t,this[Ze]||(this[Ze]=[]),this[Ze].push(e)}};He(Je,_),Je.stopListening=function(e,t,n){if(!e&&this[Ze]){for(const e of this[Ze])this[e]=this[e][Xe];delete this[Ze]}_.stopListening.call(this,e,t,n)};const Qe=Je;function et(e){e[qe]||(Object.defineProperty(e,qe,{value:new Map}),Object.defineProperty(e,Ye,{value:new Map}),Object.defineProperty(e,Ke,{value:new Map}))}function tt(...e){const t=function(...e){if(!e.length)throw new u("observable-bind-to-parse-error",null);const t={to:[]};let n;return"function"==typeof e[e.length-1]&&(t.callback=e.pop()),e.forEach(e=>{if("string"==typeof e)n.properties.push(e);else{if("object"!=typeof e)throw new u("observable-bind-to-parse-error",null);n={observable:e,properties:[]},t.to.push(n)}}),t}(...e),n=Array.from(this._bindings.keys()),i=n.length;if(!t.callback&&t.to.length>1)throw new u("observable-bind-to-no-callback",this);if(i>1&&t.callback)throw new u("observable-bind-to-extra-callback",this);t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==i)throw new u("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),function(e,t){t.forEach(t=>{const n=e[Ye];let i;n.get(t.observable)||e.listenTo(t.observable,"change",(s,o)=>{i=n.get(t.observable)[o],i&&i.forEach(t=>{st(e,t.property)})})})}(this._observable,this._to),function(e){let t;e._bindings.forEach((n,i)=>{e._to.forEach(s=>{t=s.properties[n.callback?0:e._bindProperties.indexOf(i)],n.to.push([s.observable,t]),function(e,t,n,i){const s=e[Ye],o=s.get(n),r=o||{};r[i]||(r[i]=new Set),r[i].add(t),o||s.set(n,r)}(e._observable,n,s.observable,t)})})}(this),this._bindProperties.forEach(e=>{st(this._observable,e)})}function nt(e,t,n){if(this._bindings.size>1)throw new u("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const n=e.map(e=>[e,t]);return Array.prototype.concat.apply([],n)}(e,t),n)}function it(e){return e.every(e=>"string"==typeof e)}function st(e,t){const n=e[Ke].get(t);let i;n.callback?i=n.callback.apply(e,n.to.map(e=>e[0][e[1]])):(i=n.to[0],i=i[0][i[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=i:e.set(t,i)}function ot(e,...t){t.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in e.prototype)return;const i=Object.getOwnPropertyDescriptor(t,n);i.enumerable=!1,Object.defineProperty(e.prototype,n,i)})})}class rt{constructor(e){this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",at,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",at),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function at(e){e.return=!1,e.stop()}ot(rt,Qe);class lt{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this.affectsData=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n&&this.affectsData?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",dt,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",dt),this.refresh())}execute(){}destroy(){this.stopListening()}}function dt(e){e.return=!1,e.stop()}ot(lt,Qe);const ct=function(e,t){return function(n){return e(t(n))}},ut=ct(Object.getPrototypeOf,Object);var ht=Function.prototype,mt=Object.prototype,gt=ht.toString,pt=mt.hasOwnProperty,ft=gt.call(Object);const xt=function(e){if(!_e(e)||"[object Object]"!=M(e))return!1;var t=ut(e);if(null===t)return!0;var n=pt.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&>.call(n)==ft},_t=function(e,t){for(var n=e.length;n--;)if(te(e[n][0],t))return n;return-1};var It=Array.prototype.splice;function vt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},vt.prototype.set=function(e,t){var n=this.__data__,i=_t(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};const bt=vt,jt=X(T,"Map"),Ct=X(Object,"create");var yt=Object.prototype.hasOwnProperty;var kt=Object.prototype.hasOwnProperty;function At(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{this._setToTarget(e,i,t[i],n)})}}function Ln(e){return Fn(e,Bn)}function Bn(e){return Mn(e)?e:void 0}function Vn(e){return!(!e||!e[Symbol.iterator])}class Un{constructor(e={},t={}){const n=Vn(e);if(n||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const t of e)this._items.push(t),this._itemMap.set(this._getItemIdBeforeAdding(t),t)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new u("collection-add-item-invalid-index",this);for(let n=0;n{this._setUpBindToBinding(t=>new e(t))},using:e=>{"function"==typeof e?this._setUpBindToBinding(t=>e(t)):this._setUpBindToBinding(t=>t[e])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(n,i,s)=>{const o=t._bindToCollection==this,r=t._bindToInternalToExternalMap.get(i);if(o&&r)this._bindToExternalToInternalMap.set(i,r),this._bindToInternalToExternalMap.set(r,i);else{const n=e(i);if(!n)return void this._skippedIndexesFromExternal.push(s);let o=s;for(const e of this._skippedIndexesFromExternal)s>e&&o--;for(const e of t._skippedIndexesFromExternal)o>=e&&o++;this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i),this.add(n,o);for(let e=0;e{const i=this._bindToExternalToInternalMap.get(t);i&&this.remove(i),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(nt&&e.push(t),e),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],"string"!=typeof n)throw new u("collection-add-invalid-id",this);if(this.get(n))throw new u("collection-add-item-already-exists",this)}else e[t]=n=a();return n}_remove(e){let t,n,i,s=!1;const o=this._idProperty;if("string"==typeof e?(n=e,i=this._itemMap.get(n),s=!i,i&&(t=this._items.indexOf(i))):"number"==typeof e?(t=e,i=this._items[t],s=!i,i&&(n=i[o])):(i=e,n=i[o],t=this._items.indexOf(i),s=-1==t||!this._itemMap.get(n)),s)throw new u("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const r=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(r),this.fire("remove",i,t),[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ot(Un,_);class Wn{constructor(e,t=[],n=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of n)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new u("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[],n=[]){const i=this,s=this._context;!function e(t,n=new Set){t.forEach(t=>{a(t)&&(n.has(t)||(n.add(t),t.pluginName&&!i._availablePlugins.has(t.pluginName)&&i._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,n)))})}(e),h(e);const o=[...function e(t,n=new Set){return t.map(e=>a(e)?e:i._availablePlugins.get(e)).reduce((t,i)=>n.has(i)?t:(n.add(i),i.requires&&(h(i.requires,i),e(i.requires,n).forEach(e=>t.add(e))),t.add(i)),new Set)}(e.filter(e=>!d(e,t)))];!function(e,t){for(const n of t){if("function"!=typeof n)throw new u("plugincollection-replace-plugin-invalid-type",null,{pluginItem:n});const t=n.pluginName;if(!t)throw new u("plugincollection-replace-plugin-missing-name",null,{pluginItem:n});if(n.requires&&n.requires.length)throw new u("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const s=i._availablePlugins.get(t);if(!s)throw new u("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const o=e.indexOf(s);if(-1===o){if(i._contextPlugins.has(s))return;throw new u("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(s.requires&&s.requires.length)throw new u("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(o,1,n),i._availablePlugins.set(t,n)}}(o,n);const r=function(e){return e.map(e=>{const t=i._contextPlugins.get(e)||new e(s);return i._add(e,t),t})}(o);return g(r,"init").then(()=>g(r,"afterInit")).then(()=>r);function a(e){return"function"==typeof e}function l(e){return a(e)&&e.isContextPlugin}function d(e,t){return t.some(t=>t===e||c(e)===t||c(t)===e)}function c(e){return a(e)?e.pluginName||e.name:e}function h(e,t=null){e.map(e=>a(e)?e:i._availablePlugins.get(e)||e).forEach(e=>{!function(e,t){if(!a(e)){if(t)throw new u("plugincollection-soft-required",s,{missingPlugin:e,requiredBy:c(t)});throw new u("plugincollection-plugin-not-found",s,{plugin:e})}}(e,t),function(e,t){if(l(t)&&!l(e))throw new u("plugincollection-context-required",s,{plugin:c(e),requiredBy:c(t)})}(e,t),m(e,t)})}function m(e,n){if(n&&d(e,t))throw new u("plugincollection-required",s,{plugin:c(e),requiredBy:c(n)})}function g(e,t){return e.reduce((e,n)=>n[t]?i._contextPlugins.has(n)?e:e.then(n[t].bind(n)):e,Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(n){if(this._plugins.has(n))throw new u("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}function Gn(e){return Array.isArray(e)?e:[e]}ot(Wn,_),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Hn=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function qn(e){return Hn.includes(e)?"rtl":"ltr"}class Yn{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=qn(this.uiLanguage),this.contentLanguageDirection=qn(this.contentLanguage),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Gn(t),"string"==typeof e&&(e={string:e});const n=e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,(e,n)=>n1===e?0:1);if("string"==typeof o[s])return o[s];const a=Number(r(n));return o[s][a]}(this.uiLanguage,e,n),t)}}class Kn{constructor(e){this.config=new Nn(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new Wn(this,t);const n=this.config.get("language")||{};this.locale=new Yn({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Un,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const n of e.concat(t)){if("function"!=typeof n)throw new u("context-initplugins-constructor-only",null,{Plugin:n});if(!0!==n.isContextPlugin)throw new u("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new u("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}class Zn{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function Xn(e,t){const n=Math.min(e.length,t.length);for(let i=0;ie.data.length)throw new u("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new u("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;null!==n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}function ni(e){return Vn(e)?new Map(e):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(e)}class ii{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const n=si(t,e);if(n)return{element:t,pattern:e,match:n}}return null}matchAll(...e){const t=[];for(const n of e)for(const e of this._patterns){const i=si(n,e);i&&t.push({element:n,pattern:e,match:i})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function si(e,t){if("function"==typeof t)return t(e);const n={};return t.name&&(n.name=function(e,t){return e instanceof RegExp?!!t.match(e):e===t}(t.name,e.name),!n.name)||t.attributes&&(n.attributes=function(e,t){const n=new Set(t.getAttributeKeys());return xt(e)?(void 0!==e.style&&h("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&h("matcher-pattern-deprecated-attributes-class-key",e)):(n.delete("style"),n.delete("class")),oi(e,n,e=>t.getAttribute(e))}(t.attributes,e),!n.attributes)?null:!(t.classes&&(n.classes=function(e,t){return oi(e,t.getClassNames())}(t.classes,e),!n.classes))&&!(t.styles&&(n.styles=function(e,t){return oi(e,t.getStyleNames(!0),e=>t.getStyle(e))}(t.styles,e),!n.styles))&&n}function oi(e,t,n){const i=function(e){return Array.isArray(e)?e.map(e=>xt(e)?(void 0!==e.key&&void 0!==e.value||h("matcher-pattern-missing-key-or-value",e),[e.key,e.value]):[e,!0]):xt(e)?Object.entries(e):[[e,!0]]}(e),s=Array.from(t),o=[];return i.forEach(([e,t])=>{s.forEach(i=>{(function(e,t){return!0===e||e===t||e instanceof RegExp&&t.match(e)})(e,i)&&function(e,t,n){if(!0===e)return!0;const i=n(t);return e===i||e instanceof RegExp&&!!String(i).match(e)}(t,i,n)&&o.push(i)})}),!i.length||o.lengths?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(s);++it===e);return Array.isArray(t)}set(e,t){if(w(e))for(const[t,n]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,n,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=Fi(e);(function(e,t){null==e||ki(e,t)})(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!w(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([t])=>t===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?this._styleProcessor.getStyleNames(this._styles):this._getStylesEntries().map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const n of t)e.push(...this._styleProcessor.getReducedForm(n,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const n=t.splice(0,t.length-1).join("."),i=Ai(this._styles,n);i&&!Array.from(Object.keys(i)).length&&this.remove(n)}}class Pi{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(w(t))Mi(n,Fi(e),t);else if(this._normalizers.has(e)){const i=this._normalizers.get(e),{path:s,value:o}=i(t);Mi(n,s,o)}else Mi(n,e,t)}getNormalized(e,t){if(!e)return Ri({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const n=this._extractors.get(e);if("string"==typeof n)return Ai(t,n);const i=n(e,t);if(i)return i}return Ai(t,Fi(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);return void 0===n?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter(t=>{const n=this.getNormalized(t,e);return n&&"object"==typeof n?Object.keys(n).length:n}),n=new Set([...t,...Object.keys(e)]);return Array.from(n.values())}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t)this._mapStyleNames(n,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function Fi(e){return e.replace("-",".")}function Mi(e,t,n){let i=n;w(n)&&(i=Ri({},Ai(e,t),n)),$i(e,t,i)}class Ni extends Qn{constructor(e,t,n,i){if(super(e),this.name=t,this._attrs=function(e){e=ni(e);for(const[t,n]of e)null===n?e.delete(t):"string"!=typeof n&&e.set(t,String(n));return e}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");Li(this._classes,e),this._attrs.delete("class")}this._styles=new Di(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._unsafeAttributesToRender=[]}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(e,t=null){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof Ni))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e=!1){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new ii(...e);let n=this.parent;for(;n;){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==n?"":` ${n}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const n of this.getChildren())t.push(n._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(e,t){return"string"==typeof t?[new ei(e,t)]:(Vn(t)||(t=[t]),Array.from(t).map(t=>"string"==typeof t?new ei(e,t):t instanceof ti?new ei(e,t.data):t))}(this.document,t);for(const t of i)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Gn(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Gn(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Gn(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Li(e,t){const n=t.split(/\s+/);e.clear(),n.forEach(t=>e.add(t))}class Bi extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Vi}is(e,t=null){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}}function Vi(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const t of e)if(!t.is("uiElement"))return null;return this.childCount}class Ui extends Bi{constructor(e,t,n,i){super(e,t,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",t=>t&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}destroy(){this.stopListening()}}ot(Ui,Qe);const Wi=Symbol("rootName");class Gi extends Ui{constructor(e,t){super(e,t),this.rootName="main"}is(e,t=null){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}get rootName(){return this.getCustomProperty(Wi)}set rootName(e){this._setCustomProperty(Wi,e)}set _name(e){this.name=e}}class Hi{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new u("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new u("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=qi._createAt(e.startPosition):this.position=qi._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,i;do{i=this.position,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let i;if(n instanceof ei){if(e.isAtEnd)return this.position=qi._createAfter(n),this._next();i=n.data[e.offset]}else i=n.getChild(e.offset);if(i instanceof Ni)return this.shallow?e.offset++:e=new qi(i,0),this.position=e,this._formatReturnValue("elementStart",i,t,e,1);if(i instanceof ei){if(this.singleCharacters)return e=new qi(i,0),this.position=e,this._next();{let n,s=i.data.length;return i==this._boundaryEndParent?(s=this.boundaries.end.offset,n=new ti(i,0,s),e=qi._createAfter(n)):(n=new ti(i,0,i.data.length),e.offset++),this.position=e,this._formatReturnValue("text",n,t,e,s)}}if("string"==typeof i){let i;i=this.singleCharacters?1:(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const s=new ti(n,e.offset,i);return e.offset+=i,this.position=e,this._formatReturnValue("text",s,t,e,i)}return e=qi._createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let i;if(n instanceof ei){if(e.isAtStart)return this.position=qi._createBefore(n),this._previous();i=n.data[e.offset-1]}else i=n.getChild(e.offset-1);if(i instanceof Ni)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",i,t,e,1)):(e=new qi(i,i.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,t,e));if(i instanceof ei){if(this.singleCharacters)return e=new qi(i,i.data.length),this.position=e,this._previous();{let n,s=i.data.length;if(i==this._boundaryStartParent){const t=this.boundaries.start.offset;n=new ti(i,t,i.data.length-t),s=n.data.length,e=qi._createBefore(n)}else n=new ti(i,0,i.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",n,t,e,s)}}if("string"==typeof i){let i;if(this.singleCharacters)i=1;else{const t=n===this._boundaryStartParent?this.boundaries.start.offset:0;i=e.offset-t}e.offset-=i;const s=new ti(n,e.offset,i);return this.position=e,this._formatReturnValue("text",s,t,e,i)}return e=qi._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,i,s){return t instanceof ti&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=qi._createAfter(t.textNode):(i=qi._createAfter(t.textNode),this.position=i)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=qi._createBefore(t.textNode):(i=qi._createBefore(t.textNode),this.position=i))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:s}}}}class qi{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof Ui);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=qi._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Hi(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return 0===i?null:t[i-1]}is(e){return"position"===e||"view:position"===e}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const i=Xn(t,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return t[i]0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(qi._createBefore(e),t)}}function Ki(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function Zi(e){let t=0;for(const n of e)t++;return t}class Xi{constructor(e=null,t,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=Zi(this.getRanges());if(t!=Zi(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let n=!1;for(let i of e.getRanges())if(i=i.getTrimmed(),t.start.isEqual(i.start)&&t.end.isEqual(i.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(e,t,n){if(null===e)this._setRanges([]),this._setFakeOptions(t);else if(e instanceof Xi||e instanceof Ji)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof Yi)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof qi)this._setRanges([new Yi(e)]),this._setFakeOptions(t);else if(e instanceof Qn){const i=!!n&&!!n.backward;let s;if(void 0===t)throw new u("view-selection-setto-required-second-parameter",this);s="in"==t?Yi._createIn(e):"on"==t?Yi._createOn(e):new Yi(qi._createAt(e,t)),this._setRanges([s],i),this._setFakeOptions(n)}else{if(!Vn(e))throw new u("view-selection-setto-not-selectable",this);this._setRanges(e,t&&t.backward),this._setFakeOptions(t)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new u("view-selection-setfocus-no-ranges",this);const n=qi._createAt(e,t);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.pop(),"before"==n.compareWith(i)?this._addRange(new Yi(n,i),!0):this._addRange(new Yi(i,n)),this.fire("change")}is(e){return"selection"===e||"view:selection"===e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Yi))throw new u("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new u("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Yi(e.start,e.end))}}ot(Xi,_);class Ji{constructor(e=null,t,n){this._selection=new Xi,this._selection.delegate("change").to(this),this._selection.setTo(e,t,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}ot(Ji,_);class Qi extends i{constructor(e,t,n){super(e,t),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const es=Symbol("bubbling contexts"),ts={fire(e,...t){try{const n=e instanceof i?e:new i(this,e),s=rs(this);if(!s.size)return;if(is(n,"capturing",this),ss(s,"$capture",n,...t))return n.return;const o=n.startRange||this.selection.getFirstRange(),r=o?o.getContainedElement():null,a=!!r&&Boolean(os(s,r));let l=r||function(e){if(!e)return null;const t=e.start.parent,n=e.end.parent,i=t.getPath(),s=n.getPath();return i.length>s.length?t:n}(o);if(is(n,"atTarget",l),!a){if(ss(s,"$text",n,...t))return n.return;is(n,"bubbling",l)}for(;l;){if(l.is("rootElement")){if(ss(s,"$root",n,...t))return n.return}else if(l.is("element")&&ss(s,l.name,n,...t))return n.return;if(ss(s,l,n,...t))return n.return;l=l.parent,is(n,"bubbling",l)}return is(n,"bubbling",this),ss(s,"$document",n,...t),n.return}catch(e){u.rethrowUnexpectedError(e,this)}},_addEventListener(e,t,n){const i=Gn(n.context||"$document"),s=rs(this);for(const o of i){let i=s.get(o);i||(i=Object.create(_),s.set(o,i)),this.listenTo(i,e,t,n)}},_removeEventListener(e,t){const n=rs(this);for(const i of n.values())this.stopListening(i,e,t)}},ns=ts;function is(e,t,n){e instanceof Qi&&(e._eventPhase=t,e._currentTarget=n)}function ss(e,t,n,...i){const s="string"==typeof t?e.get(t):os(e,t);return!!s&&(s.fire(n,...i),n.stop.called)}function os(e,t){for(const[n,i]of e)if("function"==typeof n&&n(t))return i;return null}function rs(e){return e[es]||(e[es]=new Map),e[es]}class as{constructor(e){this.selection=new Ji,this.roots=new Un({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(t=n(e),t)break}while(t)}}ot(as,ns),ot(as,Qe);class ls extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=ds,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new u("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(e,t=null){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function ds(){if(cs(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(cs(e)>1)return null;e=e.parent}return!e||cs(e)>1?null:this.childCount}function cs(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}ls.DEFAULT_PRIORITY=10;class us extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=hs}is(e,t=null){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Qn||Array.from(t).length>0))throw new u("view-emptyelement-cannot-add",[this,t])}}function hs(){return null}const ms=navigator.userAgent.toLowerCase(),gs={isMac:fs(ms),isWindows:function(e){return e.indexOf("windows")>-1}(ms),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(ms),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(ms),isiOS:function(e){return!!e.match(/iphone|ipad/i)||fs(e)&&navigator.maxTouchPoints>0}(ms),isAndroid:function(e){return e.indexOf("android")>-1}(ms),isBlink:function(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}(ms),features:{isRegExpUnicodePropertySupported:function(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}()}},ps=gs;function fs(e){return e.indexOf("macintosh")>-1}const xs={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},_s={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},Is=function(){const e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++)e[String.fromCharCode(t).toLowerCase()]=t;for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;for(const t of"`-=[];',./\\")e[t]=t.charCodeAt(0);return e}(),vs=Object.fromEntries(Object.entries(Is).map(([e,t])=>[t,e.charAt(0).toUpperCase()+e.slice(1)]));function bs(e){let t;if("string"==typeof e){if(t=Is[e.toLowerCase()],!t)throw new u("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?Is.alt:0)+(e.ctrlKey?Is.ctrl:0)+(e.shiftKey?Is.shift:0)+(e.metaKey?Is.cmd:0);return t}function js(e){return"string"==typeof e&&(e=function(e){return e.split("+").map(e=>e.trim())}(e)),e.map(e=>"string"==typeof e?function(e){if(e.endsWith("!"))return bs(e.slice(0,-1));const t=bs(e);return ps.isMac&&t==Is.ctrl?Is.cmd:t}(e):e).reduce((e,t)=>t+e,0)}function Cs(e){let t=js(e);const n=Object.entries(ps.isMac?xs:_s).reduce((e,[n,i])=>(0!=(t&Is[n])&&(t&=~Is[n],e+=i),e),"");return n+(t?vs[t]:"")}function ys(e,t){const n="ltr"===t;switch(e){case Is.arrowleft:return n?"left":"right";case Is.arrowright:return n?"right":"left";case Is.arrowup:return"up";case Is.arrowdown:return"down"}}class ks extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=As}is(e,t=null){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Qn||Array.from(t).length>0))throw new u("view-uielement-cannot-add",this)}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}}function As(){return null}class ws extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Ss}is(e,t=null){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Qn||Array.from(t).length>0))throw new u("view-rawelement-cannot-add",[this,t])}}function Ss(){return null}class Es{constructor(e,t){this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"view:documentFragment"===e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(e,t){return"string"==typeof t?[new ei(e,t)]:(Vn(t)||(t=[t]),Array.from(t).map(t=>"string"==typeof t?new ei(e,t):t instanceof ti?new ei(e,t.data):t))}(this.document,t);for(const t of i)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n{}),i.renderUnsafeAttributes&&s._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),s}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){xt(e)&&void 0===n&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof qi?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new u("view-writer-break-non-container-element",this.document);if(!t.parent)throw new u("view-writer-break-root",this.document);if(e.isAtStart)return qi._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(qi._createAfter(t),n);const i=new Yi(e,qi._createAt(t,"end")),s=new qi(n,0);this.move(i,s)}return qi._createAfter(t)}mergeAttributes(e){const t=e.offset,n=e.parent;if(n.is("$text"))return e;if(n.is("attributeElement")&&0===n.childCount){const e=n.parent,t=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new qi(e,t))}const i=n.getChild(t-1),s=n.getChild(t);if(!i||!s)return e;if(i.is("$text")&&s.is("$text"))return Ds(i,s);if(i.is("attributeElement")&&s.is("attributeElement")&&i.isSimilar(s)){const e=i.childCount;return i._appendChild(s.getChildren()),s._remove(),this._removeFromClonedElementsGroup(s),this.mergeAttributes(new qi(i,e))}return e}mergeContainers(e){const t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new u("view-writer-merge-containers-invalid-position",this.document);const i=t.getChild(t.childCount-1),s=i instanceof ei?qi._createAt(i,"end"):qi._createAt(t,"end");return this.move(Yi._createIn(n),qi._createAt(t,"end")),this.remove(Yi._createOn(n)),s}insert(e,t){Ps(t=Vn(t)?[...t]:[t],this.document);const n=t.reduce((e,t)=>{const n=e[e.length-1],i=!t.is("uiElement");return n&&n.breakAttributes==i?n.nodes.push(t):e.push({breakAttributes:i,nodes:[t]}),e},[]);let i=null,s=e;for(const{nodes:e,breakAttributes:t}of n){const n=this._insertNodes(s,e,t);i||(i=n.start),s=n.end}return i?new Yi(i,s):new Yi(e)}remove(e){const t=e instanceof Yi?e:Yi._createOn(e);if(Ns(t,this.document),t.isCollapsed)return new Es(this.document);const{start:n,end:i}=this._breakAttributesRange(t,!0),s=n.parent,o=i.offset-n.offset,r=s._removeChildren(n.offset,o);for(const e of r)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(n);return t.start=a,t.end=a.clone(),new Es(this.document,r)}clear(e,t){Ns(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const n=i.item;let s;if(n.is("element")&&t.isSimilar(n))s=Yi._createOn(n);else if(!i.nextPosition.isAfter(e.start)&&n.is("$textProxy")){const e=n.getAncestors().find(e=>e.is("element")&&t.isSimilar(e));e&&(s=Yi._createIn(e))}s&&(s.end.isAfter(e.end)&&(s.end=e.end),s.start.isBefore(e.start)&&(s.start=e.start),this.remove(s))}}move(e,t){let n;if(t.isAfter(e.end)){const i=(t=this._breakAttributes(t,!0)).parent,s=i.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=i.childCount-s}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof ls))throw new u("view-writer-wrap-invalid-attribute",this.document);if(Ns(e,this.document),e.isCollapsed){let n=e.start;n.parent.is("element")&&!function(e){return Array.from(e.getChildren()).some(e=>!e.is("uiElement"))}(n.parent)&&(n=n.getLastMatchingPosition(e=>e.item.is("uiElement"))),n=this._wrapPosition(n,t);const i=this.document.selection;return i.isCollapsed&&i.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new Yi(n)}return this._wrapRange(e,t)}unwrap(e,t){if(!(t instanceof ls))throw new u("view-writer-unwrap-invalid-attribute",this.document);if(Ns(e,this.document),e.isCollapsed)return e;const{start:n,end:i}=this._breakAttributesRange(e,!0),s=n.parent,o=this._unwrapChildren(s,n.offset,i.offset,t),r=this.mergeAttributes(o.start);r.isEqual(o.start)||o.end.offset--;const a=this.mergeAttributes(o.end);return new Yi(r,a)}rename(e,t){const n=new Bi(this.document,e,t.getAttributes());return this.insert(qi._createAfter(t),n),this.move(Yi._createIn(t),qi._createAt(n,0)),this.remove(Yi._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return qi._createAt(e,t)}createPositionAfter(e){return qi._createAfter(e)}createPositionBefore(e){return qi._createBefore(e)}createRange(e,t){return new Yi(e,t)}createRangeOn(e){return Yi._createOn(e)}createRangeIn(e){return Yi._createIn(e)}createSelection(e,t,n){return new Xi(e,t,n)}createSlot(e){if(!this._slotFactory)throw new u("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,n){let i,s;if(i=n?zs(e):e.parent.is("$text")?e.parent.parent:e.parent,!i)throw new u("view-writer-invalid-position-container",this.document);s=n?this._breakAttributes(e,!0):e.parent.is("$text")?$s(e):e;const o=i._insertChild(s.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const r=s.getShiftedBy(o),a=this.mergeAttributes(s);a.isEqual(s)||r.offset--;const l=this.mergeAttributes(r);return new Yi(a,l)}_wrapChildren(e,t,n,i){let s=t;const o=[];for(;s!1,e.parent._insertChild(e.offset,n);const i=new Yi(e,e.getShiftedBy(1));this.wrap(i,t);const s=new qi(n.parent,n.index);n._remove();const o=s.nodeBefore,r=s.nodeAfter;return o instanceof ei&&r instanceof ei?Ds(o,r):Rs(s)}_wrapAttributeElement(e,t){if(!Ls(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!Ls(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,i=e.end;if(Ns(e,this.document),e.isCollapsed){const n=this._breakAttributes(e.start,t);return new Yi(n,n)}const s=this._breakAttributes(i,t),o=s.parent.childCount,r=this._breakAttributes(n,t);return s.offset+=s.parent.childCount-o,new Yi(r,s)}_breakAttributes(e,t=!1){const n=e.offset,i=e.parent;if(e.parent.is("emptyElement"))throw new u("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new u("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new u("view-writer-cannot-break-raw-element",this.document);if(!t&&i.is("$text")&&Ms(i.parent))return e.clone();if(Ms(i))return e.clone();if(i.is("$text"))return this._breakAttributes($s(e),t);if(n==i.childCount){const e=new qi(i.parent,i.index+1);return this._breakAttributes(e,t)}if(0===n){const e=new qi(i.parent,i.index);return this._breakAttributes(e,t)}{const e=i.index+1,s=i._clone();i.parent._insertChild(e,s),this._addToClonedElementsGroup(s);const o=i.childCount-n,r=i._removeChildren(n,o);s._appendChild(r);const a=new qi(i.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function zs(e){let t=e.parent;for(;!Ms(t);){if(!t)return;t=t.parent}return t}function Os(e,t){return e.priorityt.priority)&&e.getIdentity()n instanceof e))throw new u("view-writer-insert-invalid-node-type",t);n.is("$text")||Ps(n.getChildren(),t)}}const Fs=[ei,ls,Bi,us,ws,ks];function Ms(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function Ns(e,t){const n=zs(e.start),i=zs(e.end);if(!n||!i||n!==i)throw new u("view-writer-invalid-range-container",t)}function Ls(e,t){return null===e.id&&null===t.id}function Bs(e){return"[object Text]"==Object.prototype.toString.call(e)}const Vs=e=>e.createTextNode(" "),Us=e=>{const t=e.createElement("span");return t.dataset.ckeFiller=!0,t.innerHTML=" ",t},Ws=e=>{const t=e.createElement("br");return t.dataset.ckeFiller=!0,t},Gs="⁠".repeat(7);function Hs(e){return Bs(e)&&e.data.substr(0,7)===Gs}function qs(e){return 7==e.data.length&&Hs(e)}function Ys(e){return Hs(e)?e.data.slice(7):e.data}function Ks(e,t){if(t.keyCode==Is.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,n=e.getRangeAt(0).startOffset;Hs(t)&&n<=7&&e.collapse(t,0)}}}function Zs(e,t,n,i=!1){n=n||function(e,t){return e===t},Array.isArray(e)||(e=Array.prototype.slice.call(e)),Array.isArray(t)||(t=Array.prototype.slice.call(t));const s=function(e,t,n){const i=Xs(e,t,n);if(-1===i)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=Xs(Js(e,i),Js(t,i),n);return{firstIndex:i,lastIndexOld:e.length-s,lastIndexNew:t.length-s}}(e,t,n);return i?function(e,t){const{firstIndex:n,lastIndexOld:i,lastIndexNew:s}=e;if(-1===n)return Array(t).fill("equal");let o=[];return n>0&&(o=o.concat(Array(n).fill("equal"))),s-n>0&&(o=o.concat(Array(s-n).fill("insert"))),i-n>0&&(o=o.concat(Array(i-n).fill("delete"))),s0&&n.push({index:i,type:"insert",values:e.slice(i,o)}),s-i>0&&n.push({index:i+(o-i),type:"delete",howMany:s-i}),n}(t,s)}function Xs(e,t,n){for(let i=0;i200||s>200||i+s>300)return Qs.fastDiff(e,t,n,!0);let o,r;if(sd?-1:1;c[i+h]&&(c[i]=c[i+h].slice(0)),c[i]||(c[i]=[]),c[i].push(s>d?o:r);let m=Math.max(s,d),g=m-i;for(;gd;m--)u[m]=h(m);u[d]=h(d),g++}while(u[d]!==l);return c[d].slice(1)}function eo(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function to(e){const t=e.parentNode;t&&t.removeChild(e)}function no(e){return e&&e.nodeType===Node.COMMENT_NODE}function io(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}Qs.fastDiff=Zs;var so=o(379),oo=o.n(so),ro=o(401);oo()(ro.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ro.Z.locals;class ao{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),ps.isBlink&&!ps.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()}),this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new u("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){let e;const t=!(ps.isBlink&&!ps.isAndroid&&this.isSelecting);for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),n=t.parent.ownerDocument;Hs(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=lo(n,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(this.domConverter.mapViewToDom(e).childNodes),i=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),s=this._diffNodeLists(n,i),o=this._findReplaceActions(s,n,i);if(-1!==o.indexOf("replace")){const t={equal:0,insert:0,delete:0};for(const s of o)if("replace"===s){const s=t.equal+t.insert,o=t.equal+t.delete,r=e.getChild(s);!r||r.is("uiElement")||r.is("rawElement")||this._updateElementMappings(r,n[o]),to(i[s]),t.equal++}else t[s]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?qi._createBefore(this.selection.getFirstPosition().parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Bs(t.parent)&&Hs(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Hs(e))throw new u("view-renderer-filler-was-lost",this);qs(e)?e.remove():e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;if(n===t.getFillerOffset())return!1;const i=e.nodeBefore,s=e.nodeAfter;return!(i instanceof ei||s instanceof ei)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),i=this.domConverter.viewToDom(e,n.ownerDocument),s=n.data;let o=i.data;const r=t.inlineFillerPosition;if(r&&r.parent==e.parent&&r.offset==e.index&&(o=Gs+o),s!=o){const e=Zs(s,o);for(const t of e)"insert"===t.type?n.insertData(t.index,t.values.join("")):n.deleteData(t.index,t.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(e=>e.name),i=e.getAttributeKeys();for(const n of i)this.domConverter.setDomElementAttribute(t,n,e.getAttribute(n),e);for(const i of n)e.hasAttribute(i)||this.domConverter.removeDomElementAttribute(t,i)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;const i=t.inlineFillerPosition,s=this.domConverter.mapViewToDom(e).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0}));i&&i.parent===e&&lo(n.ownerDocument,o,i.offset);const r=this._diffNodeLists(s,o);let a=0;const l=new Set;for(const e of r)"delete"===e?(l.add(s[a]),to(s[a])):"equal"===e&&a++;a=0;for(const e of r)"insert"===e?(eo(n,a,o[a]),a++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(o[a])),a++);for(const e of l)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return e=function(e,t){const n=Array.from(e);if(0==n.length||!t)return n;return n[n.length-1]==t&&n.pop(),n}(e,this._fakeSelectionContainer),Qs(e,t,uo.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let i=[],s=[],o=[];const r={equal:0,insert:0,delete:0};for(const a of e)"insert"===a?o.push(n[r.equal+r.insert]):"delete"===a?s.push(t[r.equal+r.delete]):(i=i.concat(Qs(s,o,co).map(e=>"equal"===e?"replace":e)),i.push("equal"),s=[],o=[]),r[a]++;return i.concat(Qs(s,o,co).map(e=>"equal"===e?"replace":e))}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(ps.isBlink&&!ps.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=t.getSelection(),s=t.createRange();i.removeAllRanges(),s.selectNodeContents(n),i.addRange(s)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(n.parent,n.offset),t.extend(i.parent,i.offset),ps.isGecko&&function(e,t){const n=e.parent;if(n.nodeType!=Node.ELEMENT_NODE||e.offset!=n.childNodes.length-1)return;const i=n.childNodes[e.offset];i&&"BR"==i.tagName&&t.addRange(t.getRangeAt(0))}(i,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return!(t&&this.selection.isEqual(t)||!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments)if(e.getSelection().rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function lo(e,t,n){const i=t instanceof Array?t:t.childNodes,s=i[n];if(Bs(s))return s.data=Gs+s.data,s;{const s=e.createTextNode(Gs);return Array.isArray(t)?i.splice(n,0,s):eo(t,n,s),s}}function co(e,t){return io(e)&&io(t)&&!Bs(e)&&!Bs(t)&&!no(e)&&!no(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function uo(e,t,n){return t===n||(Bs(t)&&Bs(n)?t.data===n.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(n)))}ot(ao,Qe);const ho={window,document};function mo(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function go(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}const po=Ws(document),fo=Vs(document),xo=Us(document),_o="data-ck-unsafe-attribute-",Io="data-ck-unsafe-element",vo=["script","style"];class bo{constructor(e,t={}){this.document=e,this.renderingMode=t.renderingMode||"editing",this.blockFillerMode=t.blockFillerMode||("editing"===this.renderingMode?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new ii,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Xi(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.childNodes)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,n){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&("srcdoc"!==e||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===n&&("src"===e||"srcset"===e)||"source"===n&&"srcset"===e||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const n=(new DOMParser).parseFromString(t,"text/html"),i=n.createDocumentFragment(),s=n.body.childNodes;for(;s.length>0;)i.appendChild(s[0]);const o=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT),r=[];let a;for(;a=o.nextNode();)r.push(a);for(const e of r){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(yo(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(i)}viewToDom(e,t,n={}){if(e.is("$text")){const n=this._processDataFromViewText(e);return t.createTextNode(n)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let i;if(e.is("documentFragment"))i=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(i,e);else{if(e.is("uiElement"))return i="$comment"===e.name?t.createComment(e.getCustomProperty("$rawContent")):e.render(t,this),n.bind&&this.bindElements(i,e),i;this._shouldRenameElement(e.name)?(yo(e.name),i=this._createReplacementDomElement(e.name)):i=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(i,this),n.bind&&this.bindElements(i,e);for(const t of e.getAttributeKeys())this.setDomElementAttribute(i,t,e.getAttribute(t),e)}if(!1!==n.withChildren)for(const s of this.viewChildrenToDom(e,t,n))i.appendChild(s);return i}}setDomElementAttribute(e,t,n,i=null){const s=this.shouldRenderAttribute(t,n,e.tagName.toLowerCase())||i&&i.shouldRenderUnsafeAttribute(t);s||h("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:n}),e.hasAttribute(t)&&!s?e.removeAttribute(t):e.hasAttribute(_o+t)&&s&&e.removeAttribute(_o+t),e.setAttribute(s?t:_o+t,n)}removeDomElementAttribute(e,t){t!=Io&&(e.removeAttribute(t),e.removeAttribute(_o+t))}*viewChildrenToDom(e,t,n={}){const i=e.getFillerOffset&&e.getFillerOffset();let s=0;for(const o of e.getChildren()){i===s&&(yield this._getBlockFiller(t));const e=o.is("element")&&o.getCustomProperty("dataPipeline:transparentRendering");e&&"data"==this.renderingMode?yield*this.viewChildrenToDom(o,t,n):(e&&h("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:o}),yield this.viewToDom(o,t,n)),s++}i===s&&(yield this._getBlockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),i=document.createRange();return i.setStart(t.parent,t.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let i=e.offset;return Hs(n)&&(i+=7),{parent:n,offset:i}}{let n,i,s;if(0===e.offset){if(n=this.mapViewToDom(t),!n)return null;s=n.childNodes[0]}else{const t=e.nodeBefore;if(i=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore),!i)return null;n=i.parentNode,s=i.nextSibling}return Bs(s)&&Hs(s)?{parent:s,offset:7}:{parent:n,offset:i?mo(i)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const n=this.getHostViewElement(e);if(n)return n;if(no(e)&&t.skipComments)return null;if(Bs(e)){if(qs(e))return null;{const t=this._processDataFromDomText(e);return""===t?null:new ei(this.document,t)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let n;if(this.isDocumentFragment(e))n=new Es(this.document),t.bind&&this.bindDocumentFragments(e,n);else{n=this._createViewElement(e,t),t.bind&&this.bindElements(e,n);const i=e.attributes;if(i)for(let e=i.length-1;e>=0;e--)n._setAttribute(i[e].name,i[e].value);if(this._isViewElementWithRawContent(n,t)||no(e)){const t=no(e)?e.data:e.innerHTML;return n._setCustomProperty("$rawContent",t),this._encounteredRawContentDomNodes.add(e),n}}if(!1!==t.withChildren)for(const i of this.domChildrenToView(e,t))n._appendChild(i);return n}}*domChildrenToView(e,t={}){for(let n=0;n{const{scrollLeft:t,scrollTop:n}=e;i.push([t,n])}),t.focus(),jo(t,e=>{const[t,n]=i.shift();e.scrollLeft=t,e.scrollTop=n}),ho.window.scrollTo(e,n)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(po):!("BR"!==e.tagName||!Co(e,this.blockElements)||1!==e.parentNode.childNodes.length)||e.isEqualNode(xo)||function(e,t){return e.isEqualNode(fo)&&Co(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getHostViewElement(e){const t=go(e);for(t.pop();t.length;){const e=t.pop(),n=this._domToViewMapping.get(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return n}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(e){switch(this.blockFillerMode){case"nbsp":return Vs(e);case"markedNbsp":return Us(e);case"br":return Ws(e)}}_isDomSelectionPositionCorrect(e,t){if(Bs(e)&&Hs(e)&&t<7)return!1;if(this.isElement(e)&&Hs(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return t;if(" "==t.charAt(0)){const n=this._getTouchingInlineViewNode(e,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const n=this._getTouchingInlineViewNode(e,!0),i=n&&n.is("$textProxy")&&" "==n.data.charAt(0);" "!=t.charAt(t.length-2)&&n&&!i||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(function(e,t){return go(e).some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}(e,this.preElements))return Ys(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),i=this._getTouchingInlineDomNode(e,!0),s=this._checkShouldLeftTrimDomText(e,n),o=this._checkShouldRightTrimDomText(e,i);s&&(t=t.replace(/^ /,"")),o&&(t=t.replace(/ $/,"")),t=Ys(new Text(t)),t=t.replace(/ \u00A0/g," ");const r=i&&this.isElement(i)&&"BR"!=i.tagName,a=i&&Bs(i)&&" "==i.data.charAt(0);return(/( |\u00A0)\u00A0$/.test(t)||!i||r||a)&&(t=t.replace(/\u00A0$/," ")),(s||n&&this.isElement(n)&&"BR"!=n.tagName)&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?"BR"===t.tagName:!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!Hs(e)}_getTouchingInlineViewNode(e,t){const n=new Hi({startPosition:t?qi._createAfter(e):qi._createBefore(e),direction:t?"forward":"backward"});for(const e of n){if(e.item.is("element")&&this.inlineObjectElements.includes(e.item.name))return e.item;if(e.item.is("containerElement"))return null;if(e.item.is("element","br"))return null;if(e.item.is("$textProxy"))return e.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"firstChild":"lastChild",i=t?"nextSibling":"previousSibling";let s=!0;do{if(!s&&e[n]?e=e[n]:e[i]?(e=e[i],s=!1):(e=e.parentNode,s=!0),!e||this._isBlockElement(e))return null}while(!Bs(e)&&"BR"!=e.tagName&&!this._isInlineObjectElement(e));return e}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if(no(e))return new ks(this.document,"$comment");const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new Ni(this.document,n)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&vo.includes(t)}_createReplacementDomElement(e,t=null){const n=document.createElement("span");if(n.setAttribute(Io,e),t){for(;t.firstChild;)n.appendChild(t.firstChild);for(const e of t.getAttributeNames())n.setAttribute(e,t.getAttribute(e))}return n}}function jo(e,t){for(;e&&e!=ho.document;)t(e),e=e.parentNode}function Co(e,t){const n=e.parentNode;return n&&n.tagName&&t.includes(n.tagName.toLowerCase())}function yo(e){"script"===e&&h("domconverter-unsafe-script-element-detected"),"style"===e&&h("domconverter-unsafe-style-element-detected")}function ko(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}const Ao=He({},_,{listenTo(e,t,n,i={}){if(io(e)||ko(e)){const s={capture:!!i.useCapture,passive:!!i.usePassive},o=this._getProxyEmitter(e,s)||new So(e,s);this.listenTo(o,t,n,i)}else _.listenTo.call(this,e,t,n,i)},stopListening(e,t,n){if(io(e)||ko(e)){const i=this._getAllProxyEmitters(e);for(const e of i)this.stopListening(e,t,n)}else _.stopListening.call(this,e,t,n)},_getProxyEmitter(e,t){return function(e,t){return e[p]&&e[p][t]?e[p][t].emitter:null}(this,Eo(e,t))},_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(t=>this._getProxyEmitter(e,t)).filter(e=>!!e)}}),wo=Ao;class So{constructor(e,t){I(this,Eo(e,t)),this._domNode=e,this._options=t}}function Eo(e,t){let n=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=a())}(e);for(const e of Object.keys(t).sort())t[e]&&(n+="-"+e);return n}He(So.prototype,_,{attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t},detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_addEventListener(e,t,n){this.attach(e),_._addEventListener.call(this,e,t,n)},_removeEventListener(e,t){_._removeEventListener.call(this,e,t),this.detach(e)},_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}});class To{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}ot(To,wo);function zo(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Tt;++ta))return!1;var d=o.get(e),c=o.get(t);if(d&&c)return d==t&&c==e;var u=-1,h=!0,m=2&n?new Oo:void 0;for(o.set(e,t),o.set(t,e);++u{this.listenTo(e,t,(e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new Ko(this.view,t,n))}}class Xo extends Zo{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return bs(this)}})}}const Jo=function(){return T.Date.now()};var Qo=/\s/;var er=/^\s+/;const tr=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Qo.test(e.charAt(t)););return t}(e)+1).replace(er,""):e};var nr=/^[-+]0x[0-9a-f]+$/i,ir=/^0b[01]+$/i,sr=/^0o[0-7]+$/i,or=parseInt;const rr=function(e){if("number"==typeof e)return e;if(ri(e))return NaN;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tr(e);var n=ir.test(e);return n||sr.test(e)?or(e.slice(2),n?2:8):nr.test(e)?NaN:+e};var ar=Math.max,lr=Math.min;const dr=function(e,t,n){var i,s,o,r,a,l,d=0,c=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=i,o=s;return i=s=void 0,d=t,r=e.apply(o,n)}function g(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-d>=o}function p(){var e=Jo();if(g(e))return f(e);a=setTimeout(p,function(e){var n=t-(e-l);return u?lr(n,o-(e-d)):n}(e))}function f(e){return a=void 0,h&&i?m(e):(i=s=void 0,r)}function x(){var e=Jo(),n=g(e);if(i=arguments,s=this,l=e,n){if(void 0===a)return function(e){return d=e,a=setTimeout(p,t),c?m(e):r}(l);if(u)return clearTimeout(a),a=setTimeout(p,t),m(l)}return void 0===a&&(a=setTimeout(p,t)),r}return t=rr(t)||0,w(n)&&(c=!!n.leading,o=(u="maxWait"in n)?ar(rr(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),x.cancel=function(){void 0!==a&&clearTimeout(a),d=0,i=l=s=a=void 0},x.flush=function(){return void 0===a?r:f(Jo())},x};class cr extends To{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=dr(e=>this.document.fire("selectionChangeDone",e),200)}observe(){const e=this.document;e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&n.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new Xi(t.getRanges(),{backward:t.isBackward,fake:!1});e!=Is.arrowleft&&e!=Is.arrowup||n.setTo(n.getFirstPosition()),e!=Is.arrowright&&e!=Is.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}class ur extends To{constructor(e){super(e),this.mutationObserver=e.getObserver(Yo),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=dr(e=>this.document.fire("selectionChangeDone",e),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=dr(()=>this.document.isSelecting=!1,5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,n=()=>{this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel()};this.listenTo(e,"selectstart",()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},{priority:"highest"}),this.listenTo(e,"keydown",n,{priority:"highest"}),this.listenTo(e,"keyup",n,{priority:"highest"}),this._documents.has(t)||(this.listenTo(t,"mouseup",n,{priority:"highest"}),this.listenTo(t,"selectionchange",(e,n)=>{this._handleSelectionChange(n,t),this._documentIsSelectingInactivityTimeoutDebounced()}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_handleSelectionChange(e,t){if(!this.isEnabled)return;const n=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(0!=i.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(n)||++this._loopbackCounter>60))if(this.selection.isSimilar(i))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class hr extends Zo{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.change(()=>{}),50)}),t.on("blur",(n,i)=>{const s=t.selection.editableElement;null!==s&&s!==i.target||(t.isFocused=!1,e.change(()=>{}))})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class mr extends Zo{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}class gr extends Zo{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}class pr{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}function fr(e){return"[object Range]"==Object.prototype.toString.apply(e)}function xr(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const _r=["top","right","bottom","left","width","height"];class Ir{constructor(e){const t=fr(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),Mn(e)||t)if(t){const t=Ir.getDomRangeRects(e);vr(this,Ir.getBoundingRect(t))}else vr(this,e.getBoundingClientRect());else if(ko(e)){const{innerWidth:t,innerHeight:n}=e;vr(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else vr(this,e)}clone(){return new Ir(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new Ir(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!br(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!br(n);){const e=new Ir(n),i=t.getIntersection(e);if(!i)return null;i.getArea(){for(const t of e){const e=jr._getElementCallbacks(t.target);if(e)for(const n of e)n(t)}})}}jr._observerInstance=null,jr._elementCallbacks=null;class Cr{constructor(e){this._callback=e,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(e){this._elements.add(e),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(e){this._elements.delete(e),this._previousRects.delete(e),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(e,100)};this.listenTo(ho.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(e,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements)this._hasRectChanged(t)&&e.push({target:t,contentRect:this._previousRects.get(t)});e.length&&this._callback(e)}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e))return!1;const t=new Ir(e),n=this._previousRects.get(e),i=!n||!n.isEqual(t);return this._previousRects.set(e,t),i}}function yr({target:e,viewportOffset:t=0}){const n=zr(e);let i=n,s=null;for(;i;){let o;o=Or(i==n?e:s),Ar(o,()=>Rr(e,i));const r=Rr(e,i);if(kr(i,r,t),i.parent!=i){if(s=i.frameElement,i=i.parent,!s)return}else i=null}}function kr(e,t,n){const i=t.clone().moveBy(0,n),s=t.clone().moveBy(0,-n),o=new Ir(e).excludeScrollbarsAndBorders();if(![s,i].every(e=>o.contains(e))){let{scrollX:r,scrollY:a}=e;Sr(s,o)?a-=o.top-t.top+n:wr(i,o)&&(a+=t.bottom-o.bottom+n),Er(t,o)?r-=o.left-t.left+n:Tr(t,o)&&(r+=t.right-o.right+n),e.scrollTo(r,a)}}function Ar(e,t){const n=zr(e);let i,s;for(;e!=n.document.body;)s=t(),i=new Ir(e).excludeScrollbarsAndBorders(),i.contains(s)||(Sr(s,i)?e.scrollTop-=i.top-s.top:wr(s,i)&&(e.scrollTop+=s.bottom-i.bottom),Er(s,i)?e.scrollLeft-=i.left-s.left:Tr(s,i)&&(e.scrollLeft+=s.right-i.right)),e=e.parentNode}function wr(e,t){return e.bottom>t.bottom}function Sr(e,t){return e.topt.right}function zr(e){return fr(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Or(e){if(fr(e)){let t=e.commonAncestorContainer;return Bs(t)&&(t=t.parentNode),t}return e.parentNode}function Rr(e,t){const n=zr(e),i=new Ir(e);if(n===t)return i;{let e=n;for(;e!=t;){const t=e.frameElement,n=new Ir(t).excludeScrollbarsAndBorders();i.moveBy(n.left,n.top),e=e.parent}}return i}function $r(e){const t=e.next();return t.done?null:t.value}ot(Cr,wo),Object.assign({},{scrollViewportToShowTarget:yr,scrollAncestorsToShowTarget:function(e){Ar(Or(e),()=>new Ir(e))}});class Dr{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new u("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}ot(Dr,wo),ot(Dr,Qe);class Pr{constructor(){this._listener=Object.create(wo)}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+bs(t),t)})}set(e,t,n={}){const i=js(e),s=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(e,n)=>{t(n,()=>{n.preventDefault(),n.stopPropagation(),e.stop()}),e.return=!0},{priority:s})}press(e){return!!this._listener.fire("_keydown:"+bs(e),e)}destroy(){this._listener.stopListening()}}class Fr extends To{constructor(e){super(e),this.document.on("keydown",(e,t)=>{if(this.isEnabled&&function(e){return e==Is.arrowright||e==Is.arrowleft||e==Is.arrowup||e==Is.arrowdown}(t.keyCode)){const n=new Qi(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(n,t),n.stop.called&&e.stop()}})}observe(){}}class Mr extends To{constructor(e){super(e);const t=this.document;t.on("keydown",(e,n)=>{if(!this.isEnabled||n.keyCode!=Is.tab||n.ctrlKey)return;const i=new Qi(t,"tab",t.selection.getFirstRange());t.fire(i,n),i.stop.called&&e.stop()})}observe(){}}class Nr{constructor(e){this.document=new as(e),this.domConverter=new bo(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new ao(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Ts(this.document),this.addObserver(Yo),this.addObserver(ur),this.addObserver(hr),this.addObserver(Xo),this.addObserver(cr),this.addObserver(mr),this.addObserver(Fr),this.addObserver(Mr),ps.isAndroid&&this.addObserver(gr),function(e){e.document.on("arrowKey",Ks,{priority:"low"})}(this),function(e){e.document.on("arrowKey",(t,n)=>function(e,t,n){if(t.keyCode==Is.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),i=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(i||t.shiftKey){const t=e.focusNode,s=e.focusOffset,o=n.domPositionToView(t,s);if(null===o)return;let r=!1;const a=o.getLastMatchingPosition(e=>(e.item.is("uiElement")&&(r=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))));if(r){const t=n.viewPositionToDom(a);i?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,n,e.domConverter),{priority:"low"})}(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:t,value:s}of Array.from(e.attributes))i[t]=s,"class"===t?this._writer.addClass(s.split(" "),n):this._writer.setAttribute(t,s,n);this._initialDomRootAttributes.set(e,i);const s=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};s(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(e,t)=>this._renderer.markToSync("children",t)),n.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t)),n.on("change:text",(e,t)=>this._renderer.markToSync("text",t)),n.on("change:isReadOnly",()=>this.change(s)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const n of this._observers.values())n.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const n=this._initialDomRootAttributes.get(t);for(const e in n)t.setAttribute(e,n[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,n]of this.domRoots)t.observe(n,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&yr({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new u("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){u.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return qi._createAt(e,t)}createPositionAfter(e){return qi._createAfter(e)}createPositionBefore(e){return qi._createBefore(e)}createRange(e,t){return new Yi(e,t)}createRangeOn(e){return Yi._createOn(e)}createRangeIn(e){return Yi._createIn(e)}createSelection(e,t,n){return new Xi(e,t,n)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}ot(Nr,Qe);class Lr{constructor(e){this.parent=null,this._attrs=ni(e)}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new u("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new u("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let s=0;for(;n[s]==i[s]&&n[s];)s++;return 0===s?null:n[s-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Xn(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i](e[t[0]]=t[1],e),{})),e}is(e){return"node"===e||"model:node"===e}_clone(){return new Lr(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=ni(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Br extends Lr{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Br(this.data,this.getAttributes())}static fromJSON(e){return new Br(e.data,e.attributes)}}class Vr{constructor(e,t,n){if(this.textNode=e,t<0||t>e.offsetSize)throw new u("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new u("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Ur{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new u("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&ee.toJSON())}}class Wr extends Lr{constructor(e,t,n){super(t),this.name=e,this._children=new Ur,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(e,t=null){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}findAncestor(e,t={includeSelf:!1}){let n=t.includeSelf?this:this.parent;for(;n;){if(n.name===e)return n;n=n.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(e=>e._clone(!0)):null;return new Wr(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){return"string"==typeof e?[new Br(e)]:(Vn(e)||(e=[e]),Array.from(e).map(e=>"string"==typeof e?new Br(e):e instanceof Vr?new Br(e.data,e.getAttributes()):e))}(t);for(const e of n)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n)e.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Wr.fromJSON(n)):t.push(Br.fromJSON(n))}return new Wr(e.name,e.attributes,t)}}class Gr{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new u("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new u("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=qr._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,n,i,s;do{i=this.position,s=this._visitedParent,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=i,this._visitedParent=s)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const i=Yr(t,n),s=i||Kr(t,n,i);if(s instanceof Wr)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=s),this.position=t,Hr("elementStart",s,e,t,1);if(s instanceof Br){let i;if(this.singleCharacters)i=1;else{let e=s.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),i=t.offset-e}const s=t.offset-o.startOffset,r=new Vr(o,s-i,i);return t.offset-=i,this.position=t,Hr("text",r,e,t,i)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,Hr("elementStart",n,e,t,1)}}function Hr(e,t,n,i,s){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:s}}}class qr{constructor(e,t,n="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new u("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new u("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;tn.path.length){if(t.offset!==i.maxOffset)return!1;t.path=t.path.slice(0,-1),i=i.parent,t.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}is(e){return"position"===e||"model:position"===e}hasSameParentAs(e){return this.root===e.root&&"same"==Xn(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=qr._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?qr._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=qr._createAt(this);if(this.root!=e.root)return n;if("same"==Xn(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;n.offset-=t}}else if("prefix"==Xn(e.getParentPath(),this.getParentPath())){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i])return null;n.path[i]-=t}}return n}_getTransformedByInsertion(e,t){const n=qr._createAt(this);if(this.root!=e.root)return n;if("same"==Xn(e.getParentPath(),this.getParentPath()))(e.offsett+1;){const t=i.maxOffset-n.offset;0!==t&&e.push(new Xr(n,n.getShiftedBy(t))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const t=this.end.path[n.path.length-1],i=t-n.offset;0!==i&&e.push(new Xr(n,n.getShiftedBy(i))),n.offset=t,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Gr(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Gr(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Gr(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new Xr(this.start,this.end)]}getTransformedByOperations(e){const t=[new Xr(this.start,this.end)];for(const n of e)for(let e=0;e0?new this(n,i):new this(i,n)}static _createIn(e){return new this(qr._createAt(e,0),qr._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(qr._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new u("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const n=e.indexOf(t),i=new this(t.start,t.end);if(n>0)for(let t=n-1;e[t].end.isEqual(i.start);t++)i.start=qr._createAt(e[t].start);for(let t=n+1;t{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);if(!n)throw new u("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(n),s=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=qr._createAt(i,s)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const n=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e),this._modelToViewMapping.get(n)==e&&this._modelToViewMapping.delete(n))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),0==n.size&&this._markerNameToElements.delete(t));const i=this._elementToMarkerNames.get(e);i&&(i.delete(t),0==i.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Xr(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Yi(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())n.add(t);else n.add(e);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let i=0;for(let n=0;n1?t[0]+":"+t[1]:t[0]}class ta{constructor(e){this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,n){const i=this._createConversionApi(n,e.getRefreshedItems());for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,i);const s=this._reduceChanges(e.getChanges());for(const e of s)"insert"===e.type?this._convertInsert(Xr._createFromPositionAndShift(e.position,e.length),i):"reinsert"===e.type?this._convertReinsert(Xr._createFromPositionAndShift(e.position,e.length),i):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,i):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,i);for(const e of i.mapper.flushUnboundMarkerNames()){const n=t.get(e).getRange();this._convertMarkerRemove(e,n,i),this._convertMarkerAdd(e,n,i)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,i);i.mapper.flushDeferredBindings(),i.consumable.verifyAllConsumed("insert")}convert(e,t,n,i={}){const s=this._createConversionApi(n,void 0,i);this._convertInsert(e,s);for(const[e,n]of t)this._convertMarkerAdd(e,n,s);s.consumable.verifyAllConsumed("insert")}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition())),s=this._createConversionApi(n);if(this._addConsumablesForSelection(s.consumable,e,i),this.fire("selection",{selection:e},s),e.isCollapsed){for(const t of i){const n=t.getRange();if(!na(e.getFirstPosition(),t,s.mapper))continue;const i={item:e,markerName:t.name,markerRange:n};s.consumable.test(e,"addMarker:"+t.name)&&this.fire("addMarker:"+t.name,i,s)}for(const t of e.getAttributeKeys()){const n={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};s.consumable.test(e,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey+":$text",n,s)}}}_convertInsert(e,t,n={}){n.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,Array.from(e));for(const n of Array.from(e.getWalker({shallow:!0})).map(ia))this._testAndFire("insert",n,t)}_convertRemove(e,t,n,i){this.fire("remove:"+n,{position:e,length:t},i)}_convertAttribute(e,t,n,i,s){this._addConsumablesForRange(s.consumable,e,`attribute:${t}`);for(const o of e){const e={item:o.item,range:Xr._createFromPositionAndShift(o.previousPosition,o.length),attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${t}`,e,s)}}_convertReinsert(e,t){const n=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,n);for(const e of n.map(ia))this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,n){if("$graveyard"==t.root.rootName)return;const i="addMarker:"+e;if(n.consumable.add(t,i),this.fire(i,{markerName:e,markerRange:t},n),n.consumable.consume(t,i)){this._addConsumablesForRange(n.consumable,t,i);for(const s of t.getItems()){if(!n.consumable.test(s,i))continue;const o={item:s,range:Xr._createOn(s),markerName:e,markerRange:t};this.fire(i,o,n)}}}_convertMarkerRemove(e,t,n){"$graveyard"!=t.root.rootName&&this.fire("removeMarker:"+e,{markerName:e,markerRange:t},n)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const n of t){const t=n.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const n of t.getAttributeKeys())e.add(t,"attribute:"+n)}}return e}_addConsumablesForRange(e,t,n){for(const i of t.getItems())e.add(i,n);return e}_addConsumablesForSelection(e,t,n){e.add(t,"selection");for(const i of n)e.add(t,"addMarker:"+i.name);for(const n of t.getAttributeKeys())e.add(t,"attribute:"+n);return e}_testAndFire(e,t,n){const i=function(e,t){return`${e}:${t.item.name||"$text"}`}(e,t),s=t.item.is("$textProxy")?n.consumable._getSymbolForTextProxy(t.item):t.item,o=this._firedEventsMap.get(n),r=o.get(s);if(r){if(r.has(i))return;r.add(i)}else o.set(s,new Set([i]));this.fire(i,t,n)}_testAndFireAddAttributes(e,t){const n={item:e,range:Xr._createOn(e)};for(const e of n.item.getAttributeKeys())n.attributeKey=e,n.attributeOldValue=null,n.attributeNewValue=n.item.getAttribute(e),this._testAndFire(`attribute:${e}`,n,t)}_createConversionApi(e,t=new Set,n={}){const i={...this._conversionApi,consumable:new Qr,writer:e,options:n,convertItem:e=>this._convertInsert(Xr._createOn(e),i),convertChildren:e=>this._convertInsert(Xr._createIn(e),i,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,i),canReuseView:e=>!t.has(i.mapper.toModelElement(e))};return this._firedEventsMap.set(i,new Map),i}}function na(e,t,n){const i=t.getRange(),s=Array.from(e.getAncestors());s.shift(),s.reverse();const o=s.some(e=>{if(i.containsItem(e))return!!n.toViewElement(e).getCustomProperty("addHighlight")});return!o}function ia(e){return{item:e.item,range:Xr._createFromPositionAndShift(e.previousPosition,e.length)}}ot(ta,_);class sa{constructor(e,t,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,n)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new Xr(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new Xr(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new Xr(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,n){if(null===e)this._setRanges([]);else if(e instanceof sa)this._setRanges(e.getRanges(),e.isBackward);else if(e&&"function"==typeof e.getRanges)this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof Xr)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof qr)this._setRanges([new Xr(e)]);else if(e instanceof Lr){const i=!!n&&!!n.backward;let s;if("in"==t)s=Xr._createIn(e);else if("on"==t)s=Xr._createOn(e);else{if(void 0===t)throw new u("model-selection-setto-required-second-parameter",[this,e]);s=new Xr(qr._createAt(e,t))}this._setRanges([s],i)}else{if(!Vn(e))throw new u("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,t&&!!t.backward)}}_setRanges(e,t=!1){const n=(e=Array.from(e)).some(t=>{if(!(t instanceof Xr))throw new u("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(e=>!e.isEqual(t))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const t of e)this._pushRange(t);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(null===this.anchor)throw new u("model-selection-setfocus-no-ranges",[this,e]);const n=qr._createAt(e,t);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(i)?(this._pushRange(new Xr(n,i)),this._lastRangeBackward=!0):(this._pushRange(new Xr(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(e){return"selection"===e||"model:selection"===e}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=aa(t.start,e);n&&la(n,t)&&(yield n);for(const n of t.getWalker()){const i=n.item;"elementEnd"==n.type&&ra(i,e,t)&&(yield i)}const i=aa(t.end,e);i&&!t.end.isTouching(qr._createAt(i,0))&&la(i,t)&&(yield i)}}containsEntireContent(e=this.anchor.root){const t=qr._createAt(e,0),n=qr._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new Xr(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function oa(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&e.parent)}function ra(e,t,n){return oa(e,t)&&la(e,n)}function aa(e,t){const n=e.parent.root.document.model.schema,i=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let s=!1;const o=i.find(e=>!s&&(s=n.isLimit(e),!s&&oa(e,t)));return i.forEach(e=>t.add(e)),o}function la(e,t){const n=function(e){const t=e.root.document.model.schema;let n=e.parent;for(;n;){if(t.isBlock(n))return n;n=n.parent}}(e);return!n||!t.containsRange(Xr._createOn(n),!0)}ot(sa,_);class da extends Xr{constructor(e,t){super(e,t),ca.call(this)}detach(){this.stopListening()}is(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e}toRange(){return new Xr(this.start,this.end)}static fromRange(e){return new da(e.start,e.end)}}function ca(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&ua.call(this,n)},{priority:"low"})}function ua(e){const t=this.getTransformedByOperation(e),n=Xr._createFromRanges(t),i=!n.isEqual(this),s=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let o=null;if(i){"$graveyard"==n.root.rootName&&(o="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",t,{deletionPosition:o})}else s&&this.fire("change:content",this.toRange(),{deletionPosition:o})}ot(da,_);const ha="selection:";class ma{constructor(e){this._selection=new ga(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}is(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return ha+e}static _isStoreAttributeKey(e){return e.startsWith(ha)}}ot(ma,_);class ga extends sa{constructor(e){super(),this.markers=new Un({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&"marker"!=n.type&&"rename"!=n.type&&"noop"!=n.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new u("document-selection-wrong-position",this,{range:e})}),this.listenTo(this._model.markers,"update",(e,t,n,i)=>{this._updateMarker(t,i)}),this.listenTo(this._document,"change",(e,t)=>{!function(e,t){const n=e.document.differ;for(const i of n.getChanges()){if("insert"!=i.type)continue;const n=i.position.parent;i.length===n.maxOffset&&e.enqueueChange(t,e=>{const t=Array.from(n.getAttributeKeys()).filter(e=>e.startsWith(ha));for(const i of t)e.removeAttribute(i,n)})}}(this._model,t)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=i.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}}),t}_updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const n=t.name.split(":",1)[0];if(!this._observedMarkers.has(n))continue;const i=t.getRange();for(const n of this.getRanges())i.containsRange(n,!n.isCollapsed)&&e.push(t)}const n=Array.from(this.markers);for(const n of e)this.markers.has(n)||(this.markers.add(n),t=!0);for(const n of Array.from(this.markers))e.includes(n)||(this.markers.remove(n),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(e,t){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const s=Array.from(this.markers),o=this.markers.has(e);if(t){let n=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){n=!0;break}n&&!o?(this.markers.add(e),i=!0):!n&&o&&(this.markers.remove(e),i=!0)}else o&&(this.markers.remove(e),i=!0);i&&this.fire("change:marker",{oldMarkers:s,directChange:!1})}_updateAttributes(e){const t=ni(this._getSurroundingAttributes()),n=ni(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const i=[];for(const[e,t]of this.getAttributes())n.has(e)&&n.get(e)===t||i.push(e);for(const[e]of n)this.hasAttribute(e)||i.push(e);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(e,t,n=!0){const i=n?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return!("low"==n&&"normal"==this._attributePriority.get(e)||(this._attributePriority.set(e,n),!super.hasAttribute(e)||(this._attrs.delete(e),0)))}_setAttributesTo(e){const t=new Set;for(const[t,n]of this.getAttributes())e.get(t)!==n&&this._removeAttribute(t,!1);for(const[n,i]of e)this._setAttribute(n,i,!1)&&t.add(n);return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(ha)){const n=t.substr(10);yield[n,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const i=e.textNode?e.textNode:e.nodeBefore,s=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=pa(i)),n||(n=pa(s)),!this.isGravityOverridden&&!n){let e=i;for(;e&&!t.isInline(e)&&!n;)e=e.previousSibling,n=pa(e)}if(!n){let e=s;for(;e&&!t.isInline(e)&&!n;)e=e.nextSibling,n=pa(e)}n||(n=this._getStoredAttributes())}else{const e=this.getFirstRange();for(const i of e){if(i.item.is("element")&&t.isObject(i.item))break;if("text"==i.type){n=i.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function pa(e){return e instanceof Vr||e instanceof Br?e.getAttributes():null}class fa{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}const xa=function(e){return Pn(e,5)};class _a extends fa{elementToElement(e){return this.add(function(e){return(e=xa(e)).model=ba(e.model),e.view=ja(e.view,"container"),e.model.attributes.length&&(e.model.children=!0),t=>{t.on("insert:"+e.model.name,function(e,t=Ta){return(n,i,s)=>{if(!t(i.item,s.consumable,{preflight:!0}))return;const o=e(i.item,s,i);if(!o)return;t(i.item,s.consumable);const r=s.mapper.toViewPosition(i.range.start);s.mapper.bindElements(i.item,o),s.writer.insert(r,o),s.convertAttributes(i.item),Sa(o,i.item.getChildren(),s,{reconversion:i.reconversion})}}(e.view,wa(e.model)),{priority:e.converterPriority||"normal"}),(e.model.children||e.model.attributes.length)&&t.on("reduceChanges",Aa(e.model),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){return(e=xa(e)).model=ba(e.model),e.view=ja(e.view,"container"),e.model.children=!0,t=>{if(t._conversionApi.schema.checkChild(e.model.name,"$text"))throw new u("conversion-element-to-structure-disallowed-text",t,{elementName:e.model.name});t.on("insert:"+e.model.name,function(e,t){return(n,i,s)=>{if(!t(i.item,s.consumable,{preflight:!0}))return;const o=new Map;s.writer._registerSlotFactory(function(e,t,n){return(i,s="children")=>{const o=i.createContainerElement("$slot");let r=null;if("children"===s)r=Array.from(e.getChildren());else{if("function"!=typeof s)throw new u("conversion-slot-mode-unknown",n.dispatcher,{modeOrFilter:s});r=Array.from(e.getChildren()).filter(e=>s(e))}return t.set(o,r),o}}(i.item,o,s));const r=e(i.item,s,i);if(s.writer._clearSlotFactory(),!r)return;!function(e,t,n){const i=Array.from(t.values()).flat(),s=new Set(i);if(s.size!=i.length)throw new u("conversion-slot-filter-overlap",n.dispatcher,{element:e});if(s.size!=e.childCount)throw new u("conversion-slot-filter-incomplete",n.dispatcher,{element:e})}(i.item,o,s),t(i.item,s.consumable);const a=s.mapper.toViewPosition(i.range.start);s.mapper.bindElements(i.item,r),s.writer.insert(a,r),s.convertAttributes(i.item),function(e,t,n,i){n.mapper.on("modelToViewPosition",r,{priority:"highest"});let s=null,o=null;for([s,o]of t)Sa(e,o,n,i),n.writer.move(n.writer.createRangeIn(s),n.writer.createPositionBefore(s)),n.writer.remove(s);function r(e,t){const n=t.modelPosition.nodeAfter,i=o.indexOf(n);i<0||(t.viewPosition=t.mapper.findPositionIn(s,i))}n.mapper.off("modelToViewPosition",r)}(r,o,s,{reconversion:i.reconversion})}}(e.view,wa(e.model)),{priority:e.converterPriority||"normal"}),t.on("reduceChanges",Aa(e.model),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){let t="attribute:"+((e=xa(e)).model.key?e.model.key:e.model);if(e.model.name&&(t+=":"+e.model.name),e.model.values)for(const t of e.model.values)e.view[t]=ja(e.view[t],"attribute");else e.view=ja(e.view,"attribute");const n=Ca(e);return i=>{i.on(t,function(e){return(t,n,i)=>{if(!i.consumable.test(n.item,t.name))return;const s=e(n.attributeOldValue,i,n),o=e(n.attributeNewValue,i,n);if(!s&&!o)return;i.consumable.consume(n.item,t.name);const r=i.writer,a=r.document.selection;if(n.item instanceof sa||n.item instanceof ma)r.wrap(a.getFirstRange(),o);else{let e=i.mapper.toViewRange(n.range);null!==n.attributeOldValue&&s&&(e=r.unwrap(e,s)),null!==n.attributeNewValue&&o&&r.wrap(e,o)}}}(n),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t="attribute:"+((e=xa(e)).model.key?e.model.key:e.model);if(e.model.name&&(t+=":"+e.model.name),e.model.values)for(const t of e.model.values)e.view[t]=ya(e.view[t]);else e.view=ya(e.view);const n=Ca(e);return i=>{i.on(t,function(e){return(t,n,i)=>{if(!i.consumable.test(n.item,t.name))return;const s=e(n.attributeOldValue,i,n),o=e(n.attributeNewValue,i,n);if(!s&&!o)return;i.consumable.consume(n.item,t.name);const r=i.mapper.toViewElement(n.item),a=i.writer;if(!r)throw new u("conversion-attribute-to-attribute-on-text",i.dispatcher,n);if(null!==n.attributeOldValue&&s)if("class"==s.key){const e=Gn(s.value);for(const t of e)a.removeClass(t,r)}else if("style"==s.key){const e=Object.keys(s.value);for(const t of e)a.removeStyle(t,r)}else a.removeAttribute(s.key,r);if(null!==n.attributeNewValue&&o)if("class"==o.key){const e=Gn(o.value);for(const t of e)a.addClass(t,r)}else if("style"==o.key){const e=Object.keys(o.value);for(const t of e)a.setStyle(t,o.value[t],r)}else a.setAttribute(o.key,o.value,r)}}(n),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){return(e=xa(e)).view=ja(e.view,"ui"),t=>{t.on("addMarker:"+e.model,function(e){return(t,n,i)=>{n.isOpening=!0;const s=e(n,i);n.isOpening=!1;const o=e(n,i);if(!s||!o)return;const r=n.markerRange;if(r.isCollapsed&&!i.consumable.consume(r,t.name))return;for(const e of r)if(!i.consumable.consume(e.item,t.name))return;const a=i.mapper,l=i.writer;l.insert(a.toViewPosition(r.start),s),i.mapper.bindElementToMarker(s,n.markerName),r.isCollapsed||(l.insert(a.toViewPosition(r.end),o),i.mapper.bindElementToMarker(o,n.markerName)),t.stop()}}(e.view),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,(e.view,(e,t,n)=>{const i=n.mapper.markerNameToElements(t.markerName);if(i){for(const e of i)n.mapper.unbindElementFromMarkerName(e,t.markerName),n.writer.clear(n.writer.createRangeOn(e),e);n.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{t.on("addMarker:"+e.model,function(e){return(t,n,i)=>{if(!n.item)return;if(!(n.item instanceof sa||n.item instanceof ma||n.item.is("$textProxy")))return;const s=ka(e,n,i);if(!s)return;if(!i.consumable.consume(n.item,t.name))return;const o=i.writer,r=Ia(o,s),a=o.document.selection;if(n.item instanceof sa||n.item instanceof ma)o.wrap(a.getFirstRange(),r,a);else{const e=i.mapper.toViewRange(n.range),t=o.wrap(e,r);for(const e of t.getItems())if(e.is("attributeElement")&&e.isSimilar(r)){i.mapper.bindElementToMarker(e,n.markerName);break}}}}(e.view),{priority:e.converterPriority||"normal"}),t.on("addMarker:"+e.model,function(e){return(t,n,i)=>{if(!n.item)return;if(!(n.item instanceof Wr))return;const s=ka(e,n,i);if(!s)return;if(!i.consumable.test(n.item,t.name))return;const o=i.mapper.toViewElement(n.item);if(o&&o.getCustomProperty("addHighlight")){i.consumable.consume(n.item,t.name);for(const e of Xr._createIn(n.item))i.consumable.consume(e.item,t.name);o.getCustomProperty("addHighlight")(o,s,i.writer),i.mapper.bindElementToMarker(o,n.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,function(e){return(t,n,i)=>{if(n.markerRange.isCollapsed)return;const s=ka(e,n,i);if(!s)return;const o=Ia(i.writer,s),r=i.mapper.markerNameToElements(n.markerName);if(r){for(const e of r)i.mapper.unbindElementFromMarkerName(e,n.markerName),e.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(e),o):e.getCustomProperty("removeHighlight")(e,s.id,i.writer);i.writer.clearClonedElementsGroup(n.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){const t=(e=xa(e)).model;return e.view||(e.view=n=>({group:t,name:n.substr(e.model.length+1)})),n=>{n.on("addMarker:"+t,function(e){return(t,n,i)=>{const s=e(n.markerName,i);if(!s)return;const o=n.markerRange;i.consumable.consume(o,t.name)&&(va(o,!1,i,n,s),va(o,!0,i,n,s),t.stop())}}(e.view),{priority:e.converterPriority||"normal"}),n.on("removeMarker:"+t,function(e){return(t,n,i)=>{const s=e(n.markerName,i);if(!s)return;const o=i.mapper.markerNameToElements(n.markerName);if(o){for(const e of o)i.mapper.unbindElementFromMarkerName(e,n.markerName),e.is("containerElement")?(r(`data-${s.group}-start-before`,e),r(`data-${s.group}-start-after`,e),r(`data-${s.group}-end-before`,e),r(`data-${s.group}-end-after`,e)):i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(n.markerName),t.stop()}function r(e,t){if(t.hasAttribute(e)){const n=new Set(t.getAttribute(e).split(","));n.delete(s.name),0==n.size?i.writer.removeAttribute(e,t):i.writer.setAttribute(e,Array.from(n).join(","),t)}}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}}function Ia(e,t){const n=e.createAttributeElement("span",t.attributes);return t.classes&&n._addClass(t.classes),"number"==typeof t.priority&&(n._priority=t.priority),n._id=t.id,n}function va(e,t,n,i,s){const o=t?e.start:e.end,r=o.nodeAfter&&o.nodeAfter.is("element")?o.nodeAfter:null,a=o.nodeBefore&&o.nodeBefore.is("element")?o.nodeBefore:null;if(r||a){let e,o;t&&r||!t&&!a?(e=r,o=!0):(e=a,o=!1);const l=n.mapper.toViewElement(e);if(l)return void function(e,t,n,i,s,o){const r=`data-${o.group}-${t?"start":"end"}-${n?"before":"after"}`,a=e.hasAttribute(r)?e.getAttribute(r).split(","):[];a.unshift(o.name),i.writer.setAttribute(r,a.join(","),e),i.mapper.bindElementToMarker(e,s.markerName)}(l,t,o,n,i,s)}!function(e,t,n,i,s){const o=`${s.group}-${t?"start":"end"}`,r=s.name?{name:s.name}:null,a=n.writer.createUIElement(o,r);n.writer.insert(e,a),n.mapper.bindElementToMarker(a,i.markerName)}(n.mapper.toViewPosition(o),t,n,i,s)}function ba(e){return"string"==typeof e&&(e={name:e}),e.attributes?Array.isArray(e.attributes)||(e.attributes=[e.attributes]):e.attributes=[],e.children=!!e.children,e}function ja(e,t){return"function"==typeof e?e:(n,i)=>function(e,t,n){let i;"string"==typeof e&&(e={name:e});const s=t.writer,o=Object.assign({},e.attributes);if("container"==n)i=s.createContainerElement(e.name,o);else if("attribute"==n){const t={priority:e.priority||ls.DEFAULT_PRIORITY};i=s.createAttributeElement(e.name,o,t)}else i=s.createUIElement(e.name,o);if(e.styles){const t=Object.keys(e.styles);for(const n of t)s.setStyle(n,e.styles[n],i)}if(e.classes){const t=e.classes;if("string"==typeof t)s.addClass(t,i);else for(const e of t)s.addClass(e,i)}return i}(e,i,t)}function Ca(e){return e.model.values?(t,n)=>{const i=e.view[t];return i?i(t,n):null}:e.view}function ya(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function ka(e,t,n){const i="function"==typeof e?e(t,n):e;return i?(i.priority||(i.priority=10),i.id||(i.id=t.markerName),i):null}function Aa(e){const t=function(e){return(t,n)=>{if(!t.is("element",e.name))return!1;if("attribute"==n.type){if(e.attributes.includes(n.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,n)=>{const i=[];n.reconvertedElements||(n.reconvertedElements=new Set);for(const e of n.changes){const s=e.position?e.position.parent:e.range.start.nodeAfter;if(s&&t(s,e)){if(!n.reconvertedElements.has(s)){n.reconvertedElements.add(s);const e=qr._createBefore(s);i.push({type:"remove",name:s.name,position:e,length:1},{type:"reinsert",name:s.name,position:e,length:1})}}else i.push(e)}n.changes=i}}function wa(e){return(t,n,i={})=>{const s=["insert"];for(const n of e.attributes)t.hasAttribute(n)&&s.push(`attribute:${n}`);return!!s.every(e=>n.test(t,e))&&(i.preflight||s.forEach(e=>n.consume(t,e)),!0)}}function Sa(e,t,n,i){for(const s of t)Ea(e.root,s,n,i)||n.convertItem(s)}function Ea(e,t,n,i){const{writer:s,mapper:o}=n;if(!i.reconversion)return!1;const r=o.toViewElement(t);return!(!r||r.root==e||!n.canReuseView(r)||(s.move(s.createRangeOn(r),o.toViewPosition(qr._createBefore(t))),0))}function Ta(e,t,{preflight:n}={}){return n?t.test(e,"insert"):t.consume(e,"insert")}function za(e){const{schema:t,document:n}=e.model;for(const i of n.getRootNames()){const s=n.getRoot(i);if(s.isEmpty&&!t.checkChild(s,"$text")&&t.checkChild(s,"paragraph"))return e.insertElement("paragraph",s),!0}return!1}function Oa(e,t,n){const i=n.createContext(e);return!!n.checkChild(i,"paragraph")&&!!n.checkChild(i.push("paragraph"),t)}function Ra(e,t){const n=t.createElement("paragraph");return t.insert(n,e),t.createPositionAt(n,0)}class $a extends fa{elementToElement(e){return this.add(Da(e))}elementToAttribute(e){return this.add(function(e){Ma(e=xa(e));const t=Na(e,!1),n=Pa(e.view),i=n?"element:"+n:"element";return n=>{n.on(i,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t=null;("string"==typeof(e=xa(e)).view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key;let n;if("class"==t||"style"==t){const i="class"==t?"classes":"styles";n={[i]:e.view.value}}else{const i=void 0===e.view.value?/[\s\S]*/:e.view.value;n={attributes:{[t]:i}}}return e.view.name&&(n.name=e.view.name),e.view=n,t}(e)),Ma(e,t);const n=Na(e,!0);return t=>{t.on("element",n,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){return function(e){const t=e.model;e.model=(e,n)=>{const i="string"==typeof t?t:t(e,n);return n.writer.createElement("$marker",{"data-name":i})}}(e=xa(e)),Da(e)}(e))}dataToMarker(e){return this.add(function(e){(e=xa(e)).model||(e.model=t=>t?e.view+":"+t:e.view);const t=Fa(La(e,"start")),n=Fa(La(e,"end"));return i=>{i.on("element:"+e.view+"-start",t,{priority:e.converterPriority||"normal"}),i.on("element:"+e.view+"-end",n,{priority:e.converterPriority||"normal"});const s=d.get("low"),o=d.get("highest"),r=d.get(e.converterPriority)/o;i.on("element",function(e){return(t,n,i)=>{const s=`data-${e.view}`;function o(t,s){for(const o of s){const s=e.model(o,i),r=i.writer.createElement("$marker",{"data-name":s});i.writer.insert(r,t),n.modelCursor.isEqual(t)?n.modelCursor=n.modelCursor.getShiftedBy(1):n.modelCursor=n.modelCursor._getTransformedByInsertion(t,1),n.modelRange=n.modelRange._getTransformedByInsertion(t,1)[0]}}(i.consumable.test(n.viewItem,{attributes:s+"-end-after"})||i.consumable.test(n.viewItem,{attributes:s+"-start-after"})||i.consumable.test(n.viewItem,{attributes:s+"-end-before"})||i.consumable.test(n.viewItem,{attributes:s+"-start-before"}))&&(n.modelRange||Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor)),i.consumable.consume(n.viewItem,{attributes:s+"-end-after"})&&o(n.modelRange.end,n.viewItem.getAttribute(s+"-end-after").split(",")),i.consumable.consume(n.viewItem,{attributes:s+"-start-after"})&&o(n.modelRange.end,n.viewItem.getAttribute(s+"-start-after").split(",")),i.consumable.consume(n.viewItem,{attributes:s+"-end-before"})&&o(n.modelRange.start,n.viewItem.getAttribute(s+"-end-before").split(",")),i.consumable.consume(n.viewItem,{attributes:s+"-start-before"})&&o(n.modelRange.start,n.viewItem.getAttribute(s+"-start-before").split(",")))}}(e),{priority:s+r})}}(e))}}function Da(e){const t=Fa(e=xa(e)),n=Pa(e.view),i=n?"element:"+n:"element";return n=>{n.on(i,t,{priority:e.converterPriority||"normal"})}}function Pa(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function Fa(e){const t=new ii(e.view);return(n,i,s)=>{const o=t.match(i.viewItem);if(!o)return;const r=o.match;if(r.name=!0,!s.consumable.test(i.viewItem,r))return;const a=function(e,t,n){return e instanceof Function?e(t,n):n.writer.createElement(e)}(e.model,i.viewItem,s);a&&s.safeInsert(a,i.modelCursor)&&(s.consumable.consume(i.viewItem,r),s.convertChildren(i.viewItem,a),s.updateConversionResult(a,i))}}function Ma(e,t=null){const n=null===t||(e=>e.getAttribute(t)),i="object"!=typeof e.model?e.model:e.model.key,s="object"!=typeof e.model||void 0===e.model.value?n:e.model.value;e.model={key:i,value:s}}function Na(e,t){const n=new ii(e.view);return(i,s,o)=>{const r=n.match(s.viewItem);if(!r)return;if(function(e,t){const n="function"==typeof e?e(t):e;return!("object"==typeof n&&!Pa(n)||n.classes||n.attributes||n.styles)}(e.view,s.viewItem)?r.match.name=!0:delete r.match.name,!o.consumable.test(s.viewItem,r.match))return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(s.viewItem,o):e.model.value;if(null===l)return;s.modelRange||Object.assign(s,o.convertChildren(s.viewItem,s.modelCursor));const d=function(e,t,n,i){let s=!1;for(const o of Array.from(e.getItems({shallow:n})))i.schema.checkAttribute(o,t.key)&&(s=!0,o.hasAttribute(t.key)||i.writer.setAttribute(t.key,t.value,o));return s}(s.modelRange,{key:a,value:l},t,o);d&&o.consumable.consume(s.viewItem,r.match)}}function La(e,t){const n={};return n.view=e.view+"-"+t,n.model=(t,n)=>{const i=t.getAttribute("name"),s=e.model(i,n);return n.writer.createElement("$marker",{"data-name":s})},n}class Ba{constructor(e,t){this.model=e,this.view=new Nr(t),this.mapper=new Jr,this.downcastDispatcher=new ta({mapper:this.mapper,schema:e.schema});const n=this.model.document,i=n.selection,s=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(n.differ,s,e),this.downcastDispatcher.convertSelection(i,s,e)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(n,i)=>{const s=i.newSelection,o=[];for(const e of s.getRanges())o.push(t.toModelRange(e));const r=e.createSelection(o,{backward:s.isBackward});r.isEqual(e.document.selection)||e.change(e=>{e.setSelection(r)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,s=n.mapper.toViewPosition(t.range.start),o=i.createText(t.item.data);i.insert(s,o)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(e,t,n)=>{n.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||n.convertChildren(t.item)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(e,t,n)=>{const i=n.mapper.toViewPosition(t.position),s=t.position.getShiftedBy(t.length),o=n.mapper.toViewPosition(s,{isPhantom:!0}),r=n.writer.createRange(i,o),a=n.writer.remove(r.getTrimmed());for(const e of n.writer.createRangeIn(a).getItems())n.mapper.unbindViewElement(e,{defer:!0})},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=n.writer,s=i.document.selection;for(const e of s.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&n.writer.mergeAttributes(e.start);i.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=t.selection;if(i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const s=[];for(const e of i.getRanges()){const t=n.mapper.toViewRange(e);s.push(t)}n.writer.setSelection(s,{backward:i.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=t.selection;if(!i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const s=n.writer,o=i.getFirstPosition(),r=n.mapper.toViewPosition(o),a=s.breakAttributes(r);s.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if("$graveyard"==e.rootName)return null;const t=new Gi(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,n=this.model.markers.get(t);if(!n)throw new u("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change(()=>{this.model.markers._refresh(n)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}}ot(Ba,Qe);class Va{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new u("commandcollection-command-not-found",this,{commandName:e});return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class Ua{constructor(){this._consumables=new Map}add(e,t){let n;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new Wa(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return void 0===n?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);void 0!==n&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const e of n)"style"!=e&&"class"!=e&&t.attributes.push(e);const i=e.getClassNames();for(const e of i)t.classes.push(e);const s=e.getStyleNames();for(const e of s)t.styles.push(e);return t}static createFrom(e,t){if(t||(t=new Ua(e)),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,Ua.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=Ua.createFrom(n,t);return t}}class Wa{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t in this._consumables)if(t in e){const n=this._test(t,e[t]);if(!0!==n)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t in this._consumables)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._revert(t,e[t])}_add(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n){if("attributes"===e&&("class"===t||"style"===t))throw new u("viewconsumable-invalid-attribute",this);if(i.set(t,!0),"styles"===e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))i.set(e,!0)}}_test(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){const e=i.get(t);if(void 0===e)return null;if(!e)return!1}else{const e="class"==t?"classes":"styles",n=this._test(e,[...this._consumables[e].keys()]);if(!0!==n)return n}return!0}_consume(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){if(i.set(t,!1),"styles"==e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))i.set(e,!1)}else{const e="class"==t?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t)!1===i.get(t)&&i.set(t,!0);else{const e="class"==t?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class Ga{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Ha(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Ha(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new u("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new u("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:e.is&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!(!t||!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!(!t||!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!(!t||!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof qr){const t=e.nodeBefore,n=e.nodeAfter;if(!(t instanceof Wr))throw new u("schema-check-merge-no-element-before",this);if(!(n instanceof Wr))throw new u("schema-check-merge-no-element-after",this);return this.checkMerge(t,n)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,i])=>{if(!i)return;const s=e(n,i);"boolean"==typeof s&&(t.stop(),t.return=s)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,i])=>{const s=e(n,i);"boolean"==typeof s&&(t.stop(),t.return=s)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;for(t=e instanceof qr?e.parent:(e instanceof Xr?[e]:Array.from(e.getRanges())).reduce((e,t)=>{const n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new Br("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const e of n)for(const n of e)if(this.checkAttribute(n.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new Xr(e);let n,i;const s=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;"both"!=t&&"backward"!=t||(n=new Gr({boundaries:Xr._createIn(s),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(i=new Gr({boundaries:Xr._createIn(s),startPosition:e}));for(const e of function*(e,t){let n=!1;for(;!n;){if(n=!0,e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}}}(n,i)){const t=e.walker==n?"elementEnd":"elementStart",i=e.value;if(i.type==t&&this.isObject(i.item))return Xr._createOn(i.item);if(this.checkChild(i.nextPosition,"$text"))return new Xr(i.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}setAllowedAttributes(e,t,n){const i=n.model;for(const[s,o]of Object.entries(t))i.schema.checkAttribute(e,s)&&n.setAttribute(s,o,e)}removeDisallowedAttributes(e,t){for(const n of e)if(n.is("$text"))ol(this,n,t);else{const e=Xr._createIn(n).getPositions();for(const n of e)ol(this,n.nodeBefore||n.parent,t)}}getAttributesWithProperty(e,t,n){const i={};for(const[s,o]of e.getAttributes()){const e=this.getAttributeProperties(s);void 0!==e[t]&&(void 0!==n&&n!==e[t]||(i[s]=o))}return i}createContext(e){return new Ha(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const i of n)e[i]=qa(t[i],i);for(const t of n)Ya(e,t);for(const t of n)Ka(e,t);for(const t of n)Za(e,t);for(const t of n)Xa(e,t),Ja(e,t);for(const t of n)Qa(e,t),el(e,t),tl(e,t);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(0==n)return!0;{const e=this.getDefinition(i);return this._checkContextMatch(e,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,i=e.start;for(const s of e.getItems({shallow:!0}))s.is("element")&&(yield*this._getValidRangesForRange(Xr._createIn(s),t)),this.checkAttribute(s,t)||(n.isEqual(i)||(yield new Xr(n,i)),n=qr._createAfter(s)),i=qr._createAfter(s);n.isEqual(i)||(yield new Xr(n,i))}}ot(Ga,Qe);class Ha{constructor(e){if(e instanceof Ha)return e;"string"==typeof e?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),this._items=e.map(sl)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Ha([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function qa(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(e,t){for(const n of e){const e=Object.keys(n).filter(e=>e.startsWith("is"));for(const i of e)t[i]=n[i]}}(e,n),nl(e,n,"allowIn"),nl(e,n,"allowContentOf"),nl(e,n,"allowWhere"),nl(e,n,"allowAttributes"),nl(e,n,"allowAttributesOf"),nl(e,n,"allowChildren"),nl(e,n,"inheritTypesFrom"),function(e,t){for(const n of e){const e=n.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}(e,n),n}function Ya(e,t){const n=e[t];for(const i of n.allowChildren){const n=e[i];n&&n.allowIn.push(t)}n.allowChildren.length=0}function Ka(e,t){for(const n of e[t].allowContentOf)e[n]&&il(e,n).forEach(e=>{e.allowIn.push(t)});delete e[t].allowContentOf}function Za(e,t){for(const n of e[t].allowWhere){const i=e[n];if(i){const n=i.allowIn;e[t].allowIn.push(...n)}}delete e[t].allowWhere}function Xa(e,t){for(const n of e[t].allowAttributesOf){const i=e[n];if(i){const n=i.allowAttributes;e[t].allowAttributes.push(...n)}}delete e[t].allowAttributesOf}function Ja(e,t){const n=e[t];for(const t of n.inheritTypesFrom){const i=e[t];if(i){const e=Object.keys(i).filter(e=>e.startsWith("is"));for(const t of e)t in n||(n[t]=i[t])}}delete n.inheritTypesFrom}function Qa(e,t){const n=e[t],i=n.allowIn.filter(t=>e[t]);n.allowIn=Array.from(new Set(i))}function el(e,t){const n=e[t];for(const i of n.allowIn)e[i].allowChildren.push(t)}function tl(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function nl(e,t,n){for(const i of e)"string"==typeof i[n]?t[n].push(i[n]):Array.isArray(i[n])&&t[n].push(...i[n])}function il(e,t){const n=e[t];return function(e){return Object.keys(e).map(t=>e[t])}(e).filter(e=>e.allowIn.includes(n.name))}function sl(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function ol(e,t,n){for(const i of t.getAttributeKeys())e.checkAttribute(t,i)||n.removeAttribute(i,t)}class rl{constructor(e={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this),this.conversionApi.keepEmptyElement=this._keepEmptyElement.bind(this)}convert(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let n;for(const i of new Ha(e)){const e={};for(const t of i.getAttributeKeys())e[t]=i.getAttribute(t);const s=t.createElement(i.name,e);n&&t.append(s,n),n=qr._createAt(s,0)}return n}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Ua.createFrom(e),this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor),s=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,s);s.markers=function(e,t){const n=new Set,i=new Map,s=Xr._createIn(e).getItems();for(const e of s)"$marker"==e.name&&n.add(e);for(const e of n){const n=e.getAttribute("data-name"),s=t.createPositionBefore(e);i.has(n)?i.get(n).end=s.clone():i.set(n,new Xr(s.clone())),t.remove(e)}return i}(s,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,s}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")?this.fire("element:"+e.name,n,this.conversionApi):e.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof Xr))throw new u("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){let n=t.is("position")?t:qr._createAt(t,0);const i=new Xr(n);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,n);e.modelRange instanceof Xr&&(i.end=e.modelRange.end,n=e.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),i=this.conversionApi.writer;t.modelRange||(t.modelRange=i.createRange(i.createPositionBefore(e),i.createPositionAfter(n[n.length-1])));const s=this._cursorParents.get(e);t.modelCursor=s?i.createPositionAt(s,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:i}=this.conversionApi;let s=n.findAllowedParent(t,e);if(s){if(s===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(s)&&(s=null)}if(!s)return Oa(t,e,n)?{position:Ra(t,i)}:null;const o=this.conversionApi.writer.split(t,s),r=[];for(const e of o.range.getWalker())if("elementEnd"==e.type)r.push(e.item);else{const t=r.pop(),n=e.item;this._registerSplitPair(t,n)}const a=o.range.end.parent;return this._cursorParents.set(e,a),{position:o.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&!this._emptyElementsToKeep.has(t)&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}ot(rl,_);class al{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class ll{constructor(e){this.domParser=new DOMParser,this.domConverter=new bo(e,{renderingMode:"data"}),this.htmlWriter=new al}toData(e){const t=this.domConverter.viewToDom(e,document);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t)}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){e.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment(),i=t.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class dl{constructor(e,t){this.model=e,this.mapper=new Jr,this.downcastDispatcher=new ta({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,s=n.mapper.toViewPosition(t.range.start),o=i.createText(t.item.data);i.insert(s,o)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(e,t,n)=>{n.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||n.convertChildren(t.item)},{priority:"lowest"}),this.upcastDispatcher=new rl({schema:e.schema}),this.viewDocument=new as(t),this.stylesProcessor=t,this.htmlProcessor=new ll(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Ts(this.viewDocument),this.upcastDispatcher.on("text",(e,t,{schema:n,consumable:i,writer:s})=>{let o=t.modelCursor;if(!i.test(t.viewItem))return;if(!n.checkChild(o,"$text")){if(!Oa(o,"$text",n))return;o=Ra(o,s)}i.consume(t.viewItem);const r=s.createText(t.viewItem.data);s.insert(r,o),t.modelRange=s.createRange(o,o.getShiftedBy(r.offsetSize)),t.modelCursor=t.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=i}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=i}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.decorate("get"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},za)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new u("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(t);return"empty"!==n||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}stringify(e,t={}){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const s=Xr._createIn(e),o=new Es(n);this.mapper.bindElements(e,o);const r=e.is("documentFragment")?e.markers:function(e){const t=[],n=e.root.document;if(!n)return new Map;const i=Xr._createIn(e);for(const e of n.model.markers){const n=e.getRange(),s=n.isCollapsed,o=n.start.isEqual(i.start)||n.end.isEqual(i.end);if(s&&o)t.push([e.name,n]);else{const s=i.getIntersection(n);s&&t.push([e.name,s])}}return t.sort(([e,t],[n,i])=>{if("after"!==t.end.compareWith(i.start))return 1;if("before"!==t.start.compareWith(i.end))return-1;switch(t.start.compareWith(i.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(i.end)){case"before":return 1;case"after":return-1;default:return n.localeCompare(e)}}}),new Map(t)}(e);return this.downcastDispatcher.convert(s,r,i,t),o}init(e){if(this.model.document.version)throw new u("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new u("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},e=>{for(const n of Object.keys(t)){const i=this.model.document.getRoot(n);e.insert(this.parse(t[n],i),i,0)}}),Promise.resolve()}set(e,t={}){let n={};if("string"==typeof e?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new u("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(n)){const i=this.model.document.getRoot(t);e.remove(e.createRangeIn(i)),e.insert(this.parse(n[t],i),i,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}ot(dl,Qe);class cl{constructor(e,t){this._helpers=new Map,this._downcast=Gn(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Gn(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new u("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new u("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of ul(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of ul(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of ul(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new u("conversion-group-exists",this);const i=n?new _a(t):new $a(t);this._helpers.set(e,i)}}function*ul(e){if(e.model.values)for(const t of e.model.values){const n={key:e.model.key,value:t},i=e.view[t],s=e.upcastAlso?e.upcastAlso[t]:void 0;yield*hl(n,i,s)}else yield*hl(e.model,e.view,e.upcastAlso)}function*hl(e,t,n){if(yield{model:e,view:t},n)for(const t of Gn(n))yield{model:e,view:t}}class ml{constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},h("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:n=!0,isUndo:i=!1,isTyping:s=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=n,this.isUndo=i,this.isTyping=s}get type(){return h("batch-type-deprecated"),"default"}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class gl{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class pl{constructor(e){this.markers=new Map,this._children=new Ur,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"model:documentFragment"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(Wr.fromJSON(n)):t.push(Br.fromJSON(n));return new pl(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){return"string"==typeof e?[new Br(e)]:(Vn(e)||(e=[e]),Array.from(e).map(e=>"string"==typeof e?new Br(e):e instanceof Vr?new Br(e.data,e.getAttributes()):e))}(t);for(const e of n)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n)e.parent=null;return n}}function fl(e,t){const n=(t=Il(t)).reduce((e,t)=>e+t.offsetSize,0),i=e.parent;bl(e);const s=e.index;return i._insertChild(s,t),vl(i,s+t.length),vl(i,s),new Xr(e,e.getShiftedBy(n))}function xl(e){if(!e.isFlat)throw new u("operation-utils-remove-range-not-flat",this);const t=e.start.parent;bl(e.start),bl(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);return vl(t,e.start.index),n}function _l(e,t){if(!e.isFlat)throw new u("operation-utils-move-range-not-flat",this);const n=xl(e);return fl(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),n)}function Il(e){const t=[];e instanceof Array||(e=[e]);for(let n=0;ne.maxOffset)throw new u("move-operation-nodes-do-not-exist",this);if(e===t&&n=n&&this.targetPosition.path[e]e._clone(!0))),t=new wl(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new qr(e,[0]);return new Al(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0))),fl(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const t of e.nodes)t.name?n.push(Wr.fromJSON(t)):n.push(Br.fromJSON(t));const i=new wl(qr.fromJSON(e.position,t),n,e.baseVersion);return i.shouldReceiveAttributes=e.shouldReceiveAttributes,i}}class Sl extends gl{constructor(e,t,n,i,s,o){super(o),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=s,this._markers=i}get type(){return"marker"}clone(){return new Sl(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Sl(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?"_set":"_remove";this._markers[e](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new Sl(e.name,e.oldRange?Xr.fromJSON(e.oldRange,t):null,e.newRange?Xr.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class El extends gl{constructor(e,t,n,i){super(i),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new El(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new El(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Wr))throw new u("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new u("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new El(qr.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Tl extends gl{constructor(e,t,n,i,s){super(s),this.root=e,this.key=t,this.oldValue=n,this.newValue=i}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Tl(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Tl(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new u("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new u("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new u("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new u("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new Tl(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class zl extends gl{constructor(e,t,n,i,s){super(s),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=i.clone()}get type(){return"merge"}get deletionPosition(){return new qr(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Xr(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),n=new qr(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new Ol(e,this.howMany,n,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new u("merge-operation-source-position-invalid",this);if(!t.parent)throw new u("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new u("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;_l(Xr._createIn(e),this.targetPosition),_l(Xr._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const n=qr.fromJSON(e.sourcePosition,t),i=qr.fromJSON(e.targetPosition,t),s=qr.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,i,s,e.baseVersion)}}class Ol extends gl{constructor(e,t,n,i,s){super(s),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new qr(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Xr(this.splitPosition,e)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new qr(e,[0]);return new zl(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof Xr)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof Xr))throw new u("writer-move-invalid-range",this);if(!e.isFlat)throw new u("writer-move-range-not-flat",this);const i=qr._createAt(t,n);if(i.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!Nl(e.root,i.root))throw new u("writer-move-different-document",this);const s=e.root.document?e.root.document.version:null,o=new Al(e.start,e.end.offset-e.start.offset,i,s);this.batch.addOperation(o),this.model.applyOperation(o)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof Xr?e:Xr._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),Ml(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Wr))throw new u("writer-merge-no-element-before",this);if(!(n instanceof Wr))throw new u("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(Xr._createIn(n),qr._createAt(t,"end")),this.remove(n)}_merge(e){const t=qr._createAt(e.nodeBefore,"end"),n=qr._createAt(e.nodeAfter,0),i=e.root.document.graveyard,s=new qr(i,[0]),o=e.root.document.version,r=new zl(n,e.nodeAfter.maxOffset,t,s,o);this.batch.addOperation(r),this.model.applyOperation(r)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Wr))throw new u("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,i=new El(qr._createBefore(e),e.name,t,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n,i,s=e.parent;if(!s.parent)throw new u("writer-split-element-no-parent",this);if(t||(t=s.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new u("writer-split-invalid-limit-element",this);do{const t=s.root.document?s.root.document.version:null,o=s.maxOffset-e.offset,r=Ol.getInsertionPosition(e),a=new Ol(e,o,r,null,t);this.batch.addOperation(a),this.model.applyOperation(a),n||i||(n=s,i=e.parent.nextSibling),s=(e=this.createPositionAfter(e.parent)).parent}while(s!==t);return{position:e,range:new Xr(qr._createAt(n,"end"),qr._createAt(i,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new u("writer-wrap-range-not-flat",this);const n=t instanceof Wr?t:new Wr(t);if(n.childCount>0)throw new u("writer-wrap-element-not-empty",this);if(null!==n.parent)throw new u("writer-wrap-element-attached",this);this.insert(n,e.start);const i=new Xr(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,qr._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new u("writer-unwrap-element-no-parent",this);this.move(Xr._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new u("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,i=t.range,s=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new u("writer-addmarker-marker-exists",this);if(!i)throw new u("writer-addmarker-no-range",this);return n?(Fl(this,e,null,i,s),this.model.markers.get(e)):this.model.markers._set(e,i,n,s)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n="string"==typeof e?e:e.name,i=this.model.markers.get(n);if(!i)throw new u("writer-updatemarker-marker-not-exists",this);if(!t)return h("writer-updatemarker-reconvert-using-editingcontroller",{markerName:n}),void this.model.markers._refresh(i);const s="boolean"==typeof t.usingOperation,o="boolean"==typeof t.affectsData,r=o?t.affectsData:i.affectsData;if(!s&&!t.range&&!o)throw new u("writer-updatemarker-wrong-options",this);const a=i.getRange(),l=t.range?t.range:a;s&&t.usingOperation!==i.managedUsingOperations?t.usingOperation?Fl(this,n,null,l,r):(Fl(this,n,a,null,r),this.model.markers._set(n,l,void 0,r)):i.managedUsingOperations?Fl(this,n,a,l,r):this.model.markers._set(n,l,void 0,r)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new u("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);n.managedUsingOperations?Fl(this,t,n.getRange(),null,n.affectsData):this.model.markers._remove(t)}setSelection(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,n]of ni(e))this._setSelectionAttribute(t,n)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=ma._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=ma._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new u("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let s=!1;if("move"===e)s=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end);else{const e=t.nodeBefore,n=t.nodeAfter,o=i.start.parent==e&&i.start.isAtEnd,r=i.end.parent==n&&0==i.end.offset,a=i.end.nodeAfter==n,l=i.start.nodeAfter==n;s=o||r||a||l}s&&this.updateMarker(n.name,{range:i})}}}function Dl(e,t,n,i){const s=e.model,o=s.document;let r,a,l,d=i.start;for(const e of i.getWalker({shallow:!0}))l=e.item.getAttribute(t),r&&a!=l&&(a!=n&&c(),d=r),r=e.nextPosition,a=l;function c(){const i=new Xr(d,r),l=i.root.document?o.version:null,c=new yl(i,t,a,n,l);e.batch.addOperation(c),s.applyOperation(c)}r instanceof qr&&r!=d&&a!=n&&c()}function Pl(e,t,n,i){const s=e.model,o=s.document,r=i.getAttribute(t);let a,l;if(r!=n){if(i.root===i){const e=i.document?o.version:null;l=new Tl(i,t,r,n,e)}else{a=new Xr(qr._createBefore(i),e.createPositionAfter(i));const s=a.root.document?o.version:null;l=new yl(a,t,r,n,s)}e.batch.addOperation(l),s.applyOperation(l)}}function Fl(e,t,n,i,s){const o=e.model,r=o.document,a=new Sl(t,n,i,o.markers,s,r.version);e.batch.addOperation(a),o.applyOperation(a)}function Ml(e,t,n,i){let s;if(e.root.document){const n=i.document,o=new qr(n.graveyard,[0]);s=new Al(e,t,o,n.version)}else s=new kl(e,t);n.addOperation(s),i.applyOperation(s)}function Nl(e,t){return e===t||e instanceof Rl&&t instanceof Rl}class Ll{constructor(e){this._markerCollection=e,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems({shallow:!0}))this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=Xr._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1);const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const i=e.targetPosition.parent;this._isInInsertedElement(i)||this._markInsert(i,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n){const i=this._changedMarkers.get(e);i?(i.newMarkerData=n,null==i.oldMarkerData.range&&null==n.range&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{newMarkerData:n,oldMarkerData:t})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.oldMarkerData.range&&e.push({name:t,range:n.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.newMarkerData.range&&e.push({name:t,range:n.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}}))}hasDataChanges(){if(this._changesInElement.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const n=e.range&&!t.range,i=!e.range&&t.range,s=e.range&&t.range&&!e.range.isEqual(t.range);if(n||i||s)return!0}}return!1}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const n=this._changesInElement.get(e).sort((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamee);for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(Ul),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e);const t=Xr._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_markInsert(e,t,n){const i={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i)}_markRemove(e,t,n){const i={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let e=0;en.offset){if(i>s){const e={type:"attribute",offset:s,howMany:i-s,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offsets?(e.nodesToHandle=i-s,e.offset=s):e.nodesToHandle=0);if("remove"==n.type&&e.offsetn.offset){const s={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(s,t),t.push(s),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==n.type&&(e.offset>=n.offset&&i<=s?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&i>=s&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:qr._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:qr._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const i=[];n=new Map(n);for(const[s,o]of t){const t=n.has(s)?n.get(s):null;t!==o&&i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:s,attributeOldValue:o,attributeNewValue:t,changeCount:this._changeCount++}),n.delete(s)}for(const[t,s]of n)i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:s,changeCount:this._changeCount++});return i}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),i=e.startOffset;if(n)for(const e of n)if("insert"==e.type&&i>=e.offset&&ii){for(let t=0;t=e&&i.baseVersione.source).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}();function Yl(e,t){const n=String(e).matchAll(ql);return Array.from(n).some(e=>e.index{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new u("model-document-applyoperation-wrong-version",this,{operation:n})},{priority:"highest"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&(this.version++,this.history.addOperation(n))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(e,t,n,i,s)=>{const o={...t.getData(),range:i};this.differ.bufferMarkerChange(t.name,s,o),null===n&&t.on("change",(e,n)=>{const i=t.getData();this.differ.bufferMarkerChange(t.name,{...i,range:n},i)})})}get graveyard(){return this.getRoot(Kl)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new u("model-document-createroot-name-exists",this,{name:t});const n=new Rl(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!=Kl)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Jn(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,i=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(i)||t.createRange(i)}_validateSelectionRange(e){return Xl(e.start)&&Xl(e.end)}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(this.selection.refresh(),t=n(e),t)break}while(t)}}function Xl(e){const t=e.textNode;if(t){const n=t.data,i=e.offset-t.startOffset;return!Gl(n,i)&&!Hl(n,i)}return!0}ot(Zl,_);class Jl{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Ql?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,i=!1){const s=e instanceof Ql?e.name:e;if(s.includes(","))throw new u("markercollection-incorrect-marker-name",this);const o=this._markers.get(s);if(o){const e=o.getData(),r=o.getRange();let a=!1;return r.isEqual(t)||(o._attachLiveRange(da.fromRange(t)),a=!0),n!=o.managedUsingOperations&&(o._managedUsingOperations=n,a=!0),"boolean"==typeof i&&i!=o.affectsData&&(o._affectsData=i,a=!0),a&&this.fire("update:"+s,o,r,t,e),o}const r=da.fromRange(t),a=new Ql(s,r,n,i);return this._markers.set(s,a),this.fire("update:"+s,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof Ql?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null,n.getData()),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof Ql?e.name:e,n=this._markers.get(t);if(!n)throw new u("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire("update:"+t,n,i,i,n.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}ot(Jl,_);class Ql{constructor(e,t,n,i){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._liveRange.toRange()}is(e){return"marker"===e||"model:marker"===e}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}ot(Ql,_);class ed extends gl{get type(){return"noop"}clone(){return new ed(this.baseVersion)}getReversed(){return new ed(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const td={};td[yl.className]=yl,td[wl.className]=wl,td[Sl.className]=Sl,td[Al.className]=Al,td[ed.className]=ed,td[gl.className]=gl,td[El.className]=El,td[Tl.className]=Tl,td[Ol.className]=Ol,td[zl.className]=zl;class nd{static fromJSON(e,t){return td[e.__className].fromJSON(e,t)}}class id extends qr{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new u("model-liveposition-root-not-rootelement",e);sd.call(this)}detach(){this.stopListening()}is(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e}toPosition(){return new qr(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function sd(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&od.call(this,n)},{priority:"low"})}function od(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}ot(id,_);class rd{constructor(e,t,n){this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(e);if(n.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new u("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?Xr._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Xr(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=id.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new u("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=e:this.nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=id.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=id.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Wr))return;if(!this._canMergeLeft(e))return;const t=id._createBefore(e);t.stickiness="toNext";const n=id.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=id._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=id._createAt(t.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof Wr))return;if(!this._canMergeRight(e))return;const t=id._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new u("insertcontent-invalid-insertion-position",this);this.position=qr._createAt(t.nodeBefore,"end");const n=id.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=id._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=id._createAt(t.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof Wr&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Wr&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function ad(e,t,n="auto"){const i=e.getSelectedElement();if(i&&t.schema.isObject(i)&&!t.schema.isInline(i))return["before","after"].includes(n)?t.createRange(t.createPositionAt(i,n)):t.createRangeOn(i);const s=$r(e.getSelectedBlocks());if(!s)return t.createRange(e.focus);if(s.isEmpty)return t.createRange(t.createPositionAt(s,0));const o=t.createPositionAfter(s);return e.focus.isTouching(o)?t.createRange(o):t.createRange(t.createPositionBefore(s))}function ld(e,t,n={}){if(t.isCollapsed)return;const i=t.getFirstRange();if("$graveyard"==i.root.rootName)return;const s=e.schema;e.change(e=>{if(!n.doNotResetEntireContent&&function(e,t){const n=e.getLimitElement(t);if(!t.containsEntireContent(n))return!1;const i=t.getFirstRange();return i.start.parent!=i.end.parent&&e.checkChild(n,"paragraph")}(s,t))return void function(e,t){const n=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(n)),hd(e,e.createPositionAt(n,0),t)}(e,t);const o={};if(!n.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(o,s.getAttributesWithProperty(e,"copyOnReplace",!0))}const[r,a]=function(e){const t=e.root.document.model,n=e.start;let i=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const n=function(e){const t=e.parent,n=t.root.document.model.schema,i=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of i){if(n.isLimit(e))return null;if(n.isBlock(e))return e}}(i);if(n&&i.isTouching(t.createPositionAt(n,0))){const n=t.createSelection(e);t.modifySelection(n,{direction:"backward"});const s=n.getLastPosition(),o=t.createRange(s,i);t.hasContent(o,{ignoreMarkers:!0})||(i=s)}}return[id.fromPosition(n,"toPrevious"),id.fromPosition(i,"toNext")]}(i);r.isTouching(a)||e.remove(e.createRange(r,a)),n.leaveUnmerged||(function(e,t,n){const i=e.model;if(!ud(e.model.schema,t,n))return;const[s,o]=function(e,t){const n=e.getAncestors(),i=t.getAncestors();let s=0;for(;n[s]&&n[s]==i[s];)s++;return[n[s],i[s]]}(t,n);s&&o&&(!i.hasContent(s,{ignoreMarkers:!0})&&i.hasContent(o,{ignoreMarkers:!0})?cd(e,t,n,s.parent):dd(e,t,n,s.parent))}(e,r,a),s.removeDisallowedAttributes(r.parent.getChildren(),e)),md(e,t,r),!n.doNotAutoparagraph&&function(e,t){const n=e.checkChild(t,"$text"),i=e.checkChild(t,"paragraph");return!n&&i}(s,r)&&hd(e,r,t,o),r.detach(),a.detach()})}function dd(e,t,n,i){const s=t.parent,o=n.parent;if(s!=i&&o!=i){for(t=e.createPositionAfter(s),(n=e.createPositionBefore(o)).isEqual(t)||e.insert(o,t),e.merge(t);n.parent.isEmpty;){const t=n.parent;n=e.createPositionBefore(t),e.remove(t)}ud(e.model.schema,t,n)&&dd(e,t,n,i)}}function cd(e,t,n,i){const s=t.parent,o=n.parent;if(s!=i&&o!=i){for(t=e.createPositionAfter(s),(n=e.createPositionBefore(o)).isEqual(t)||e.insert(s,n);t.parent.isEmpty;){const n=t.parent;t=e.createPositionBefore(n),e.remove(n)}n=e.createPositionBefore(o),function(e,t){const n=t.nodeBefore,i=t.nodeAfter;n.name!=i.name&&e.rename(n,i.name),e.clearAttributes(n),e.setAttributes(Object.fromEntries(i.getAttributes()),n),e.merge(t)}(e,n),ud(e.model.schema,t,n)&&cd(e,t,n,i)}}function ud(e,t,n){const i=t.parent,s=n.parent;return i!=s&&!e.isLimit(i)&&!e.isLimit(s)&&function(e,t,n){const i=new Xr(e,t);for(const e of i.getWalker())if(n.isLimit(e.item))return!1;return!0}(t,n,e)}function hd(e,t,n,i={}){const s=e.createElement("paragraph");e.model.schema.setAllowedAttributes(s,i,e),e.insert(s,t),md(e,n,e.createPositionAt(s,0))}function md(e,t,n){t instanceof ma?e.setSelection(n):t.setTo(n)}const gd=' ,.?!:;"-()';function pd(e,t){const{isForward:n,walker:i,unit:s,schema:o,treatEmojiAsSingleUnit:r}=e,{type:a,item:l,nextPosition:d}=t;if("text"==a)return"word"===e.unit?function(e,t){let n=e.position.textNode;if(n){let i=e.position.offset-n.startOffset;for(;!xd(n.data,i,t)&&!_d(n,i,t);){e.next();const s=t?e.position.nodeAfter:e.position.nodeBefore;if(s&&s.is("$text")){const i=s.data.charAt(t?0:s.data.length-1);gd.includes(i)||(e.next(),n=e.position.textNode)}i=e.position.offset-n.startOffset}}return e.position}(i,n):function(e,t,n){const i=e.position.textNode;if(i){const s=i.data;let o=e.position.offset-i.startOffset;for(;Gl(s,o)||"character"==t&&Hl(s,o)||n&&Yl(s,o);)e.next(),o=e.position.offset-i.startOffset}return e.position}(i,s,r);if(a==(n?"elementStart":"elementEnd")){if(o.isSelectable(l))return qr._createAt(l,n?"after":"before");if(o.checkChild(d,"$text"))return d}else{if(o.isLimit(l))return void i.skip(()=>!0);if(o.checkChild(d,"$text"))return d}}function fd(e,t){const n=e.root,i=qr._createAt(n,t?"end":0);return t?new Xr(e,i):new Xr(i,e)}function xd(e,t,n){const i=t+(n?0:-1);return gd.includes(e.charAt(i))}function _d(e,t,n){return t===(n?e.endOffset:0)}function Id(e,t){const n=[];Array.from(e.getItems({direction:"backward"})).map(e=>t.createRangeOn(e)).filter(t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end))).forEach(e=>{n.push(e.start.parent),t.remove(e)}),n.forEach(e=>{let n=e;for(;n.parent&&n.isEmpty;){const e=t.createRangeOn(n);n=n.parent,t.remove(e)}})}function vd(e,t){return e.isCollapsed?function(e,t){const n=e.start,i=t.getNearestSelectionRange(n);if(!i){const e=n.getAncestors().reverse().find(e=>t.isObject(e));return e?Xr._createOn(e):null}if(!i.isCollapsed)return i;const s=i.start;return n.isEqual(s)?null:new Xr(s)}(e,t):function(e,t){const{start:n,end:i}=e,s=t.checkChild(n,"$text"),o=t.checkChild(i,"$text"),r=t.getLimitElement(n),a=t.getLimitElement(i);if(r===a){if(s&&o)return null;if(function(e,t,n){const i=e.nodeAfter&&!n.isLimit(e.nodeAfter)||n.checkChild(e,"$text"),s=t.nodeBefore&&!n.isLimit(t.nodeBefore)||n.checkChild(t,"$text");return i||s}(n,i,t)){const e=n.nodeAfter&&t.isSelectable(n.nodeAfter)?null:t.getNearestSelectionRange(n,"forward"),s=i.nodeBefore&&t.isSelectable(i.nodeBefore)?null:t.getNearestSelectionRange(i,"backward"),o=e?e.start:n,r=s?s.end:i;return new Xr(o,r)}}const l=r&&!r.is("rootElement"),d=a&&!a.is("rootElement");if(l||d){const e=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent,s=l&&(!e||!jd(n.nodeAfter,t)),o=d&&(!e||!jd(i.nodeBefore,t));let c=n,u=i;return s&&(c=qr._createBefore(bd(r,t))),o&&(u=qr._createAfter(bd(a,t))),new Xr(c,u)}return null}(e,t)}function bd(e,t){let n=e,i=n;for(;t.isLimit(i)&&i.parent;)n=i,i=i.parent;return n}function jd(e,t){return e&&t.isSelectable(e)}class Cd{constructor(){this.markers=new Jl,this.document=new Zl(this),this.schema=new Ga,this._pendingChanges=[],this._currentWriter=null,["insertContent","insertObject","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if("$marker"===t.name)return!0}),function(e){e.document.registerPostFixer(t=>function(e,t){const n=t.document.selection,i=t.schema,s=[];let o=!1;for(const e of n.getRanges()){const t=vd(e,i);t&&!t.isEqual(e)?(s.push(t),o=!0):s.push(e)}o&&e.setSelection(function(e){const t=[...e],n=new Set;let i=1;for(;i!n.has(t))}(s),{backward:n.isBackward})}(t,e))}(this),this.document.registerPostFixer(za)}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new ml,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){u.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new ml):e instanceof ml||(e=new ml(e)):e=new ml,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){u.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return function(e,t,n,i){return e.change(s=>{let o;o=n?n instanceof sa||n instanceof ma?n:s.createSelection(n,i):e.document.selection,o.isCollapsed||e.deleteContent(o,{doNotAutoparagraph:!0});const r=new rd(e,s,o.anchor);let a;a=t.is("documentFragment")?t.getChildren():[t],r.handleNodes(a);const l=r.getSelectionRange();l&&(o instanceof ma?s.setSelection(l):o.setTo(l));const d=r.getAffectedRange()||e.createRange(o.anchor);return r.destroy(),d})}(this,e,t,n)}insertObject(e,t,n,i){return function(e,t,n,i,s={}){if(!e.schema.isObject(t))throw new u("insertobject-element-not-an-object",e,{object:t});let o;o=n?n.is("selection")?n:e.createSelection(n,i):e.document.selection;let r=o;s.findOptimalPosition&&e.schema.isBlock(t)&&(r=e.createSelection(ad(o,e,s.findOptimalPosition)));const a=$r(o.getSelectedBlocks()),l={};return a&&Object.assign(l,e.schema.getAttributesWithProperty(a,"copyOnReplace",!0)),e.change(n=>{r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});let i=t;const o=r.anchor.parent;!e.schema.checkChild(o,t)&&e.schema.checkChild(o,"paragraph")&&e.schema.checkChild("paragraph",t)&&(i=n.createElement("paragraph"),n.insert(t,i)),e.schema.setAllowedAttributes(i,l,n);const a=e.insertContent(i,r);return a.isCollapsed||s.setSelection&&function(e,t,n,i){const s=e.model;if("after"==n){let n=t.nextSibling;!(n&&s.schema.checkChild(n,"$text"))&&s.schema.checkChild(t.parent,"paragraph")&&(n=e.createElement("paragraph"),s.schema.setAllowedAttributes(n,i,e),s.insertContent(n,e.createPositionAfter(t))),n&&e.setSelection(n,0)}else{if("on"!=n)throw new u("insertobject-invalid-place-parameter-value",s);e.setSelection(t,"on")}}(n,t,s.setSelection,l),a})}(this,e,t,n,i)}deleteContent(e,t){ld(this,e,t)}modifySelection(e,t){!function(e,t,n={}){const i=e.schema,s="backward"!=n.direction,o=n.unit?n.unit:"character",r=!!n.treatEmojiAsSingleUnit,a=t.focus,l=new Gr({boundaries:fd(a,s),singleCharacters:!0,direction:s?"forward":"backward"}),d={walker:l,schema:i,isForward:s,unit:o,treatEmojiAsSingleUnit:r};let c;for(;c=l.next();){if(c.done)return;const n=pd(d,c.value);if(n)return void(t instanceof ma?e.change(e=>{e.setSelectionFocus(n)}):t.setFocus(n))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change(e=>{const n=e.createDocumentFragment(),i=t.getFirstRange();if(!i||i.isCollapsed)return n;const s=i.start.root,o=i.start.getCommonPath(i.end),r=s.getNodeByPath(o);let a;a=i.start.parent==i.end.parent?i:e.createRange(e.createPositionAt(r,i.start.path[o.length]),e.createPositionAt(r,i.end.path[o.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),n):e.append(e.cloneElement(t,!0),n);if(a!=i){const t=i._getTransformedByMove(a.start,e.createPositionAt(n,0),l)[0],s=e.createRange(e.createPositionAt(n,0),t.start);Id(e.createRange(t.end,e.createPositionAt(n,"end")),e),Id(s,e)}return n})}(this,e)}hasContent(e,t={}){const n=e instanceof Wr?Xr._createIn(e):e;if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:s=!1}=t;if(!s)for(const e of this.markers.getMarkersIntersectingRange(n))if(e.affectsData)return!0;for(const e of n.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!i)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}createPositionFromPath(e,t,n){return new qr(e,t,n)}createPositionAt(e,t){return qr._createAt(e,t)}createPositionAfter(e){return qr._createAfter(e)}createPositionBefore(e){return qr._createBefore(e)}createRange(e,t){return new Xr(e,t)}createRangeIn(e){return Xr._createIn(e)}createRangeOn(e){return Xr._createOn(e)}createSelection(e,t,n){return new sa(e,t,n)}createBatch(e){return new ml(e)}createOperationFromJSON(e){return nd.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new $l(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}ot(Cd,Qe);class yd extends Pr{constructor(e){super(),this.editor=e}set(e,t,n={}){if("string"==typeof t){const e=t;t=(t,n)=>{this.editor.execute(e),n()}}super.set(e,t,n)}}class kd{constructor(e={}){const t=e.language||this.constructor.defaultConfig&&this.constructor.defaultConfig.language;this._context=e.context||new Kn({language:t}),this._context._addEditor(this,!e.context);const n=Array.from(this.constructor.builtinPlugins||[]);this.config=new Nn(e,this.constructor.defaultConfig),this.config.define("plugins",n),this.config.define(this._context._getEditorConfig()),this.plugins=new Wn(this,n,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new Va,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new Cd;const i=new Pi;this.data=new dl(this.model,i),this.editing=new Ba(this.model,i),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new cl([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new yd(this),this.keystrokes.listenTo(this.editing.view.document)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new u("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new u("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new u("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],i=e.get("extraPlugins")||[],s=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(i),n,s)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise(e=>this.once("ready",e))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...e){try{return this.commands.execute(...e)}catch(e){u.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}}ot(kd,Qe);class Ad{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(wd(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new u("componentfactory-item-missing",this,{name:e});return this._components.get(wd(e)).callback(this.editor.locale)}has(e){return this._components.has(wd(e))}}function wd(e){return String(e).toLowerCase()}class Sd{constructor(e){this.editor=e,this.componentFactory=new Ad(e),this.focusTracker=new Dr,this.set("viewportOffset",this._readViewportOffsetFromConfig()),this._editableElementsMap=new Map,this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const n=e.config.get("toolbar.viewportTopOffset");return n?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:n}):{top:0}}}ot(Sd,Qe);const Ed={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}},Td=Ed,zd={updateSourceElement(){if(!this.sourceElement)throw new u("editor-missing-sourceelement",this);!function(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}(this.sourceElement,this.data.get())}},Od=zd;class Rd extends Zn{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Un({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new u("pendingactions-add-invalid-message",this);const t=Object.create(Qe);return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const $d='',Dd='';function Pd({emitter:e,activator:t,callback:n,contextElements:i}){e.listenTo(document,"mousedown",(e,s)=>{if(!t())return;const o="function"==typeof s.composedPath?s.composedPath():[];for(const e of i)if(e.contains(s.target)||o.includes(e))return;n()})}function Fd(e){e.set("_isCssTransitionsDisabled",!1),e.disableCssTransitions=()=>{e._isCssTransitionsDisabled=!0},e.enableCssTransitions=()=>{e._isCssTransitionsDisabled=!1},e.extendTemplate({attributes:{class:[e.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Md({view:e}){e.listenTo(e.element,"submit",(t,n)=>{n.preventDefault(),e.fire("submit")},{useCapture:!0})}class Nd extends Un{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(e,t,n)=>{this._renderViewIntoCollectionParent(t,n)}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...e){if(!e.length||!function(e){return e.every(e=>"string"==typeof e)}(e))throw new u("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const i of e)n.delegate(i).to(t);this.on("add",(n,i)=>{for(const n of e)i.delegate(n).to(t)}),this.on("remove",(n,i)=>{for(const n of e)i.stopDelegating(n,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}var Ld=o(150);oo()(Ld.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ld.Z.locals;class Bd{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Un,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Vd.bind(this,this)}createCollection(e){const t=new Nd(e);return this._viewCollections.add(t),t}registerChild(e){Vn(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Vn(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Vd(e)}extendTemplate(e){Vd.extend(this.template,e)}render(){if(this.isRendered)throw new u("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}ot(Bd,wo),ot(Bd,Qe);class Vd{constructor(e){Object.assign(this,Jd(Xd(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new u("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)sc(n)?yield n:oc(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,i)=>new Wd({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i}),if:(n,i,s)=>new Gd({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:s})}}static extend(e,t){if(e._isRendered)throw new u("template-extend-render",[this,e]);nc(e,Jd(Xd(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new u("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),Hd(this.text)?this._bindToObservable({schema:this.text,updater:Yd(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,i,s;if(!this.attributes)return;const o=e.node,r=e.revertData;for(t in this.attributes)if(i=o.getAttribute(t),n=this.attributes[t],r&&(r.attributes[t]=i),s=w(n[0])&&n[0].ns?n[0].ns:null,Hd(n)){const a=s?n[0].value:n;r&&lc(t)&&a.unshift(i),this._bindToObservable({schema:a,updater:Kd(o,t,s),data:e})}else"style"==t&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],e):(r&&i&&lc(t)&&n.unshift(i),n=n.map(e=>e&&e.value||e).reduce((e,t)=>e.concat(t),[]).reduce(ec,""),ic(n)||o.setAttributeNS(s,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const s=e[i];Hd(s)?this._bindToObservable({schema:[s],updater:Zd(n,i),data:t}):n.style[i]=s}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,i=e.isApplying;let s=0;for(const o of this.children)if(rc(o)){if(!i){o.setParent(t);for(const e of o)n.appendChild(e.element)}}else if(sc(o))i||(o.isRendered||o.render(),n.appendChild(o.element));else if(io(o))n.appendChild(o);else if(i){const t=e.revertData,i=ac();t.children.push(i),o._renderNode({node:n.childNodes[s++],isApplying:!0,revertData:i})}else n.appendChild(o.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(n=>{const[i,s]=t.split("@");return n.activateDomEventListener(i,s,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;qd(e,t,n);const s=e.filter(e=>!ic(e)).filter(e=>e.observable).map(i=>i.activateAttributeListener(e,t,n));i&&i.bindings.push(s)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const i=t.attributes[n];null===i?e.removeAttribute(n):e.setAttribute(n,i)}for(let n=0;nqd(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,i),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,i)}}}class Wd extends Ud{activateDomEventListener(e,t,n){const i=(e,n)=>{t&&!n.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,e,i),()=>{this.emitter.stopListening(n.node,e,i)}}}class Gd extends Ud{getValue(e){return!ic(super.getValue(e))&&(this.valueIfTrue||!0)}}function Hd(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(Hd):e instanceof Ud)}function qd(e,t,{node:n}){let i=function(e,t){return e.map(e=>e instanceof Ud?e.getValue(t):e)}(e,n);i=1==e.length&&e[0]instanceof Gd?i[0]:i.reduce(ec,""),ic(i)?t.remove():t.set(i)}function Yd(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function Kd(e,t,n){return{set(i){e.setAttributeNS(n,t,i)},remove(){e.removeAttributeNS(n,t)}}}function Zd(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function Xd(e){const t=Fn(e,e=>{if(e&&(e instanceof Ud||oc(e)||sc(e)||rc(e)))return e});return t}function Jd(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=Gn(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)Qd(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Gn(e[t].value)),Qd(e,t)}(e.attributes);const t=[];if(e.children)if(rc(e.children))t.push(e.children);else for(const n of e.children)oc(n)||sc(n)||io(n)?t.push(n):t.push(new Vd(n));e.children=t}return e}function Qd(e,t){e[t]=Gn(e[t])}function ec(e,t){return ic(t)?e:ic(e)?t:`${e} ${t}`}function tc(e,t){for(const n in t)e[n]?e[n].push(...t[n]):e[n]=t[n]}function nc(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),tc(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),tc(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new u("ui-template-extend-children-mismatch",e);let n=0;for(const i of t.children)nc(e.children[n++],i)}}function ic(e){return!e&&0!==e}function sc(e){return e instanceof Bd}function oc(e){return e instanceof Vd}function rc(e){return e instanceof Nd}function ac(){return{children:[],bindings:[],attributes:{}}}function lc(e){return"class"==e||"style"==e}const dc=function(e){return"string"==typeof e||!ke(e)&&_e(e)&&"[object String]"==M(e)};class cc extends Nd{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new Vd({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=function(e,t,n={},i=[]){const s=n&&n.xmlns,o=s?e.createElementNS(s,t):e.createElement(t);for(const e in n)o.setAttribute(e,n[e]);!dc(i)&&Vn(i)||(i=[i]);for(let t of i)dc(t)&&(t=e.createTextNode(t)),o.appendChild(t);return o}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}var uc=o(174);oo()(uc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),uc.Z.locals;class hc extends Bd{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}var mc=o(948);oo()(mc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),mc.Z.locals;class gc extends Bd{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",e=>"ck-tooltip_"+e),t.if("text","ck-hidden",e=>!e.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}var pc=o(499);oo()(pc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pc.Z.locals;class fc extends Bd{constructor(e){super(e);const t=this.bindTemplate,n=a();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new hc,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("isVisible","ck-hidden",e=>!e),t.to("isOn",e=>e?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",e=>e||"button"),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":t.if("isEnabled",!0,e=>!e),"aria-pressed":t.to("isOn",e=>!!this.isToggleable&&String(e))},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const e=new gc;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new Bd,n=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new Bd;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Cs(e))}]}),e}_getTooltipString(e,t,n){return e?"string"==typeof e?e:(n&&(n=Cs(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}var xc=o(681);oo()(xc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),xc.Z.locals;class _c extends fc{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Bd;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}function Ic(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class vc extends fc{constructor(e){super(e);const t=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color")},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}function bc(e){return!!(e&&e.getClientRects&&e.getClientRects().length)}class jc{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];"string"==typeof n&&(n=[n]);for(const i of n)e.keystrokeHandler.set(i,(e,n)=>{this[t](),n()})}}get first(){return this.focusables.find(Cc)||null}get last(){return this.focusables.filter(Cc).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;return i&&(e=n),i}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(null===t)return this[1===e?"first":"last"];let i=(t+n+e)%n;do{const t=this.focusables.get(i);if(Cc(t))return t;i=(i+n+e)%n}while(i!==t);return null}}function Cc(e){return!(!e.focus||!bc(e.element))}var yc=o(923);oo()(yc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),yc.Z.locals;class kc extends Bd{constructor(e,t){super(e);const n=t&&t.colorDefinitions||[],i={};t&&t.columns&&(i.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new Dr,this.keystrokes=new Pr,this._focusCycler=new jc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.items.on("add",(e,t)=>{t.isOn=t.color===this.selectedColor}),n.forEach(e=>{const t=new vc;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})}),this.items.add(t)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:i}}),this.on("change:selectedColor",(e,t,n)=>{for(const e of this.items)e.isOn=e.color===n})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}class Ac extends fc{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new hc;return e.content='',e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}var wc=o(66);oo()(wc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wc.Z.locals;class Sc extends Bd{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",e=>`ck-dropdown__panel_${e}`),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(e=>e.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}var Ec=o(488);function Tc({element:e,target:t,positions:n,limiter:i,fitInViewport:s,viewportOffsetConfig:o}){N(t)&&(t=t()),N(i)&&(i=i());const r=function(e){return e&&e.parentNode?e.offsetParent===ho.document.body?null:e.offsetParent:null}(e),a=new Ir(e);let l;const d={targetRect:new Ir(t),elementRect:a,positionedElementAncestor:r};if(i||s){const e=i&&new Ir(i).getVisible(),t=s&&function(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new Ir(ho.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t}(o);Object.assign(d,{limiterRect:e,viewportRect:t}),l=function(e,t){const{elementRect:n}=t,i=n.getArea(),s=e.map(e=>new Oc(e,t)).filter(e=>!!e.name);let o=0,r=null;for(const e of s){const{_limiterIntersectionArea:t,_viewportIntersectionArea:n}=e;if(t===i)return e;const s=n**2+t**2;s>o&&(o=s,r=e)}return r}(n,d)||new Oc(n[0],d)}else l=new Oc(n[0],d);return l}function zc(e){const{scrollX:t,scrollY:n}=ho.window;return e.clone().moveBy(t,n)}oo()(Ec.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ec.Z.locals;class Oc{constructor(e,t){const n=e(t.targetRect,t.elementRect,t.viewportRect);if(!n)return;const{left:i,top:s,name:o,config:r}=n;Object.assign(this,{name:o,config:r}),this._positioningFunctionCorrdinates={left:i,top:s},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get _limiterIntersectionArea(){const e=this._options.limiterRect;if(e){const t=this._options.viewportRect;if(!t)return e.getIntersectionArea(this._rect);{const n=e.getIntersection(t);if(n)return n.getIntersectionArea(this._rect)}}return 0}get _viewportIntersectionArea(){const e=this._options.viewportRect;return e?e.getIntersectionArea(this._rect):0}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=zc(this._rect),this._options.positionedElementAncestor&&function(e,t){const n=zc(new Ir(t)),i=xr(t);let s=0,o=0;s-=n.left,o-=n.top,s+=t.scrollLeft,o+=t.scrollTop,s-=i.left,o-=i.top,e.moveBy(s,o)}(this._cachedAbsoluteRect,this._options.positionedElementAncestor)),this._cachedAbsoluteRect}}class Rc extends Bd{constructor(e,t,n){super(e);const i=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new Pr,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",i.to("class"),i.if("isEnabled","ck-disabled",e=>!e)],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[t,n]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=Rc._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:n,southWest:i,northEast:s,northWest:o,southMiddleEast:r,southMiddleWest:a,northMiddleEast:l,northMiddleWest:d}=Rc.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[n,i,r,a,e,s,o,l,d,t]:[i,n,a,r,e,o,s,d,l,t]}}Rc.defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})},Rc._getOptimalPosition=Tc;class $c extends Bd{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Dc extends Bd{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Pc(e){return e.bindTemplate.to(t=>{t.target===e.element&&t.preventDefault()})}function Fc(e){return Array.isArray(e)?{items:e,removeItems:[]}:e?Object.assign({items:[],removeItems:[]},e):{items:[],removeItems:[]}}var Mc=o(571);oo()(Mc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mc.Z.locals;class Nc extends Bd{constructor(e,t){super(e);const n=this.bindTemplate,i=this.t;this.options=t||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Dr,this.keystrokes=new Pr,this.set("class"),this.set("isCompact",!1),this.itemsView=new Lc(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const s="rtl"===e.uiLanguageDirection;this._focusCycler=new jc({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[s?"arrowright":"arrowleft","arrowup"],focusNext:[s?"arrowleft":"arrowright","arrowdown"]}});const o=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];this.options.shouldGroupWhenFull&&this.options.isFloating&&o.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:o,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")}},children:this.children,on:{mousedown:Pc(this)}}),this._behavior=this.options.shouldGroupWhenFull?new Vc(this):new Bc(this)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){const n=Fc(e),i=n.items.filter((e,i,s)=>"|"===e||-1===n.removeItems.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||(h("toolbarview-line-break-ignored-when-grouping-items",s),!1):!!t.has(e)||(h("toolbarview-item-unavailable",{name:e}),!1))),s=this._cleanSeparators(i).map(e=>"|"===e?new $c:"-"===e?new Dc:t.create(e));this.items.addMany(s)}_cleanSeparators(e){const t=e=>"-"!==e&&"|"!==e,n=e.length,i=e.findIndex(t),s=n-e.slice().reverse().findIndex(t);return e.slice(i,s).filter((e,n,i)=>!!t(e)||!(n>0&&i[n-1]===e))}}class Lc extends Bd{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Bc{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(e=>e),e.focusables.bindTo(e.items).using(e=>e),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Vc{constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),e.children.on("add",this._updateFocusCycleableItems.bind(this)),e.children.on("remove",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(e,t)=>{const n=t.index;for(const e of t.removed)n>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=n;ethis.ungroupedItems.length?this.groupedItems.add(i,e-this.ungroupedItems.length):this.ungroupedItems.add(i,e)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!bc(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new Ir(e.lastChild),i=new Ir(e);if(!this.cachedPadding){const n=ho.window.getComputedStyle(e),i="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[i])}return"ltr"===t?n.right>i.right-this.cachedPadding:n.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new $c),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,n=Kc(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",Zc(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:''}),n.toolbarView.items.bindTo(this.groupedItems).using(e=>e),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var Uc=o(162);oo()(Uc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Uc.Z.locals;class Wc extends Bd{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Dr,this.keystrokes=new Pr,this._focusCycler=new jc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Gc extends Bd{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Hc extends Bd{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var qc=o(75);oo()(qc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qc.Z.locals;var Yc=o(875);function Kc(e,t=Ac){const n=new t(e),i=new Sc(e),s=new Rc(e,n,i);return n.bind("isEnabled").to(s),n instanceof Ac?n.bind("isOn").to(s,"isOpen"):n.arrowView.bind("isOn").to(s,"isOpen"),function(e){(function(e){e.on("render",()=>{Pd({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})})(e),function(e){e.on("execute",t=>{t.source instanceof _c||(e.isOpen=!1)})}(e),function(e){e.keystrokes.set("arrowdown",(t,n)=>{e.isOpen&&(e.panelView.focus(),n())}),e.keystrokes.set("arrowup",(t,n)=>{e.isOpen&&(e.panelView.focusLast(),n())})}(e)}(s),s}function Zc(e,t){const n=e.locale,i=n.t,s=e.toolbarView=new Nc(n);s.set("ariaLabel",i("Dropdown toolbar")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map(e=>s.items.add(e)),e.panelView.children.add(s),s.items.delegate("execute").to(e)}function Xc(e,t){const n=e.locale,i=e.listView=new Wc(n);i.items.bindTo(t).using(({type:e,model:t})=>{if("separator"===e)return new Hc(n);if("button"===e||"switchbutton"===e){const i=new Gc(n);let s;return s="button"===e?new fc(n):new _c(n),s.bind(...Object.keys(t)).to(t),s.delegate("execute").to(i),i.children.add(s),i}}),e.panelView.children.add(i),i.items.delegate("execute").to(e)}oo()(Yc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Yc.Z.locals;var Jc=o(547);oo()(Jc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Jc.Z.locals;class Qc extends Bd{constructor(e){super(e),this.body=new cc(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}var eu=o(751);oo()(eu.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),eu.Z.locals;class tu extends Bd{constructor(e){super(e),this.set("text"),this.set("for"),this.id=`ck-editor__label_${a()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class nu extends Qc{constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,t=new tu;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class iu extends Bd{constructor(e,t,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change(n=>{const i=e.document.getRoot(t.name);n.addClass(t.isFocused?"ck-focused":"ck-blurred",i),n.removeClass(t.isFocused?"ck-blurred":"ck-focused",i)})}e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",(e,s,o)=>{o?n(i):t(i)})}(this):t(this)}}class su extends iu{constructor(e,t,n){super(e,t,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView,t=this.t;e.change(n=>{const i=e.document.getRoot(this.name);n.setAttribute("aria-label",t("Rich Text Editor, %0",this.name),i)})}}var ou=o(523);oo()(ou.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ou.Z.locals;var ru=o(985);oo()(ru.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ru.Z.locals;class au extends Bd{constructor(e){super(e),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new Dr,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0),this.set("inputMode","text");const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),inputmode:t.to("inputMode"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to((...e)=>{this.fire("input",...e),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=function(e){return!e.value}(this.element)}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class lu extends au{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}var du=o(111);oo()(du.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),du.Z.locals;class cu extends Bd{constructor(e,t){super(e);const n=`ck-labeled-field-view-${a()}`,i=`ck-labeled-field-view-status-${a()}`;this.fieldView=t(this,n,i),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const s=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",s.to("class"),s.if("isEnabled","ck-disabled",e=>!e),s.if("isEmpty","ck-labeled-field-view_empty"),s.if("isFocused","ck-labeled-field-view_focused"),s.if("placeholder","ck-labeled-field-view_placeholder"),s.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(e){const t=new tu(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Bd(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",e=>!e)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function uu(e,t,n){const i=new lu(e.locale);return i.set({id:t,ariaDescribedById:n}),i.bind("isReadOnly").to(e,"isEnabled",e=>!e),i.bind("hasError").to(e,"errorText",e=>!!e),i.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(i),i}class hu extends Zn{static get pluginName(){return"Notification"}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=`show:${e.type}`+(e.namespace?`:${e.namespace}`:"");this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class mu{constructor(e,t){t&&He(this,t),e&&this.set(e)}}function gu(e){return t=>t+e}ot(mu,Qe);var pu=o(245);oo()(pu.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pu.Z.locals;const fu=gu("px"),xu=ho.document.body;class _u extends Bd{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",fu),left:t.to("left",fu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=_u.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast,t.viewportStickyNorth],limiter:xu,fitInViewport:!0},e),i=_u._getOptimalPosition(n),s=parseInt(i.left),o=parseInt(i.top),{name:r,config:a={}}=i,{withArrow:l=!0}=a;Object.assign(this,{top:o,left:s,position:r,withArrow:l})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=Iu(e.target),n=e.limiter?Iu(e.limiter):xu;this.listenTo(ho.document,"scroll",(i,s)=>{const o=s.target,r=t&&o.contains(t),a=n&&o.contains(n);!r&&!a&&t&&n||this.attachTo(e)},{useCapture:!0}),this.listenTo(ho.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(ho.document,"scroll"),this.stopListening(ho.window,"resize")}}function Iu(e){return Mn(e)?e:fr(e)?e.commonAncestorContainer:"function"==typeof e?Iu(e()):null}_u.arrowHorizontalOffset=25,_u.arrowVerticalOffset=10,_u.stickyVerticalOffset=20,_u._getOptimalPosition=Tc,_u.defaultPositions=function({horizontalOffset:e=_u.arrowHorizontalOffset,verticalOffset:t=_u.arrowVerticalOffset,stickyVerticalOffset:n=_u.stickyVerticalOffset,config:i}={}){return{northWestArrowSouthWest:(t,n)=>({top:s(t,n),left:t.left-e,name:"arrow_sw",...i&&{config:i}}),northWestArrowSouthMiddleWest:(t,n)=>({top:s(t,n),left:t.left-.25*n.width-e,name:"arrow_smw",...i&&{config:i}}),northWestArrowSouth:(e,t)=>({top:s(e,t),left:e.left-t.width/2,name:"arrow_s",...i&&{config:i}}),northWestArrowSouthMiddleEast:(t,n)=>({top:s(t,n),left:t.left-.75*n.width+e,name:"arrow_sme",...i&&{config:i}}),northWestArrowSouthEast:(t,n)=>({top:s(t,n),left:t.left-n.width+e,name:"arrow_se",...i&&{config:i}}),northArrowSouthWest:(t,n)=>({top:s(t,n),left:t.left+t.width/2-e,name:"arrow_sw",...i&&{config:i}}),northArrowSouthMiddleWest:(t,n)=>({top:s(t,n),left:t.left+t.width/2-.25*n.width-e,name:"arrow_smw",...i&&{config:i}}),northArrowSouth:(e,t)=>({top:s(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...i&&{config:i}}),northArrowSouthMiddleEast:(t,n)=>({top:s(t,n),left:t.left+t.width/2-.75*n.width+e,name:"arrow_sme",...i&&{config:i}}),northArrowSouthEast:(t,n)=>({top:s(t,n),left:t.left+t.width/2-n.width+e,name:"arrow_se",...i&&{config:i}}),northEastArrowSouthWest:(t,n)=>({top:s(t,n),left:t.right-e,name:"arrow_sw",...i&&{config:i}}),northEastArrowSouthMiddleWest:(t,n)=>({top:s(t,n),left:t.right-.25*n.width-e,name:"arrow_smw",...i&&{config:i}}),northEastArrowSouth:(e,t)=>({top:s(e,t),left:e.right-t.width/2,name:"arrow_s",...i&&{config:i}}),northEastArrowSouthMiddleEast:(t,n)=>({top:s(t,n),left:t.right-.75*n.width+e,name:"arrow_sme",...i&&{config:i}}),northEastArrowSouthEast:(t,n)=>({top:s(t,n),left:t.right-n.width+e,name:"arrow_se",...i&&{config:i}}),southWestArrowNorthWest:(t,n)=>({top:o(t),left:t.left-e,name:"arrow_nw",...i&&{config:i}}),southWestArrowNorthMiddleWest:(t,n)=>({top:o(t),left:t.left-.25*n.width-e,name:"arrow_nmw",...i&&{config:i}}),southWestArrowNorth:(e,t)=>({top:o(e),left:e.left-t.width/2,name:"arrow_n",...i&&{config:i}}),southWestArrowNorthMiddleEast:(t,n)=>({top:o(t),left:t.left-.75*n.width+e,name:"arrow_nme",...i&&{config:i}}),southWestArrowNorthEast:(t,n)=>({top:o(t),left:t.left-n.width+e,name:"arrow_ne",...i&&{config:i}}),southArrowNorthWest:(t,n)=>({top:o(t),left:t.left+t.width/2-e,name:"arrow_nw",...i&&{config:i}}),southArrowNorthMiddleWest:(t,n)=>({top:o(t),left:t.left+t.width/2-.25*n.width-e,name:"arrow_nmw",...i&&{config:i}}),southArrowNorth:(e,t)=>({top:o(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...i&&{config:i}}),southArrowNorthMiddleEast:(t,n)=>({top:o(t),left:t.left+t.width/2-.75*n.width+e,name:"arrow_nme",...i&&{config:i}}),southArrowNorthEast:(t,n)=>({top:o(t),left:t.left+t.width/2-n.width+e,name:"arrow_ne",...i&&{config:i}}),southEastArrowNorthWest:(t,n)=>({top:o(t),left:t.right-e,name:"arrow_nw",...i&&{config:i}}),southEastArrowNorthMiddleWest:(t,n)=>({top:o(t),left:t.right-.25*n.width-e,name:"arrow_nmw",...i&&{config:i}}),southEastArrowNorth:(e,t)=>({top:o(e),left:e.right-t.width/2,name:"arrow_n",...i&&{config:i}}),southEastArrowNorthMiddleEast:(t,n)=>({top:o(t),left:t.right-.75*n.width+e,name:"arrow_nme",...i&&{config:i}}),southEastArrowNorthEast:(t,n)=>({top:o(t),left:t.right-n.width+e,name:"arrow_ne",...i&&{config:i}}),viewportStickyNorth:(e,t,s)=>e.getIntersection(s)?{top:s.top+n,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...i}}:null};function s(e,n){return e.top-n.height-t}function o(e){return e.bottom+t}}();var vu=o(757);oo()(vu.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),vu.Z.locals;var bu=o(553);oo()(bu.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),bu.Z.locals;const ju=gu("px");class Cu extends rt{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.set("visibleView",null),this.view=new _u(e.locale),e.ui.view.body.add(this.view),e.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}destroy(){super.destroy(),this.view.destroy(),this._rotatorView.destroy(),this._fakePanelsView.destroy()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view))throw new u("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new u("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new u("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new yu(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(e,n)=>{if(n<2)return"";const i=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[i,n])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new ku(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>=2?Math.min(e-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:n=!0,singleViewMode:i=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}}class yu extends Bd{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Dr,this.buttonPrevView=this._createButtonView(t("Previous"),''),this.buttonNextView=this._createButtonView(t("Next"),''),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new fc(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class ku extends Bd{constructor(e,t){super(e);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:n.to("top",ju),left:n.to("left",ju),width:n.to("width",ju),height:n.to("height",ju)}},children:this.content}),this.on("change:numberOfPanels",(e,t,n,i)=>{n>i?this._addPanels(n-i):this._removePanels(i-n),this.updatePosition()})}_addPanels(e){for(;e--;){const e=new Bd;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:n,height:i}=new Ir(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}var Au=o(609);oo()(Au.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Au.Z.locals;const wu=gu("px");class Su extends Bd{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new Vd({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?wu(this._panelRect.height):null)}}}).render(),this._contentPanel=new Vd({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",e=>e?wu(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",e=>e?wu(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",e=>e?wu(this.limiterBottomOffset):null),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(ho.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top!e.is("uiElement"));if(n)return!1;if(t)return!0;const i=e.document;if(!i.isFocused)return!0;const s=i.selection.anchor;return s&&s.parent!==e}(o,n.keepOnFocus)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,o)&&(r=!0):function(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}(e,o)&&(r=!0),r}function $u(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}const Du=new Map;function Pu(e,t,n){let i=Du.get(e);i||(i=new Map,Du.set(e,i)),i.set(t,n)}function Fu(e){return[e]}function Mu(e,t,n={}){const i=function(e,t){const n=Du.get(e);return n&&n.has(t)?n.get(t):Fu}(e.constructor,t.constructor);try{return i(e=e.clone(),t,n)}catch(e){throw e}}function Nu(e,t,n){e=e.slice(),t=t.slice();const i=new Lu(n.document,n.useRelations,n.forceWeakRemove);i.setOriginalOperations(e),i.setOriginalOperations(t);const s=i.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:s};const o=new WeakMap;for(const t of e)o.set(t,0);const r={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;for(;a{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const i=e.range.getDifference(t.range).map(t=>new yl(t,e.key,e.oldValue,e.newValue,0)),s=e.range.getIntersection(t.range);return s&&n.aIsStrong&&i.push(new yl(s,t.key,t.newValue,e.newValue,0)),0==i.length?[new ed(0)]:i}return[e]}),Pu(yl,wl,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const n=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(t=>new yl(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const i=Uu(t,e.key,e.oldValue);i&&n.unshift(i)}return n}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]}),Pu(yl,zl,(e,t)=>{const n=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&n.push(Xr._createFromPositionAndShift(t.graveyardPosition,1));const i=e.range._getTransformedByMergeOperation(t);return i.isCollapsed||n.push(i),n.map(t=>new yl(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),Pu(yl,Al,(e,t)=>{const n=function(e,t){const n=Xr._createFromPositionAndShift(t.sourcePosition,t.howMany);let i=null,s=[];n.containsRange(e,!0)?i=e:e.start.hasSameParentAs(n.start)?(s=e.getDifference(n),i=e.getIntersection(n)):s=[e];const o=[];for(let e of s){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const n=t.getMovedRangeStart(),i=e.start.hasSameParentAs(n);e=e._getTransformedByInsertion(n,t.howMany,i),o.push(...e)}return i&&o.push(i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]),o}(e.range,t);return n.map(t=>new yl(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),Pu(yl,Ol,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const n=e.clone();return n.range=new Xr(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,n]}return e.range=e.range._getTransformedBySplitOperation(t),[e]}),Pu(wl,yl,(e,t)=>{const n=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const i=Uu(e,t.key,t.newValue);i&&n.push(i)}return n}),Pu(wl,wl,(e,t,n)=>(e.position.isEqual(t.position)&&n.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e])),Pu(wl,Al,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),Pu(wl,Ol,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e])),Pu(wl,zl,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e])),Pu(Sl,wl,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e])),Pu(Sl,Sl,(e,t,n)=>{if(e.name==t.name){if(!n.aIsStrong)return[new ed(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]}),Pu(Sl,zl,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e])),Pu(Sl,Al,(e,t,n)=>{if(e.oldRange&&(e.oldRange=Xr._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(n.abRelation){const i=Xr._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.start.path=n.abRelation.path,e.newRange.end=i.end,[e];if("right"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=i.start,e.newRange.end.path=n.abRelation.path,[e]}e.newRange=Xr._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]}),Pu(Sl,Ol,(e,t,n)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(n.abRelation){const i=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&n.abRelation.wasStartBeforeMergedElement?e.newRange.start=qr._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!n.abRelation.wasInLeftElement&&(e.newRange.start=qr._createAt(t.moveTargetPosition)),e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasInRightElement?e.newRange.end=qr._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?e.newRange.end=qr._createAt(t.insertionPosition):e.newRange.end=i.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]}),Pu(zl,wl,(e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e])),Pu(zl,zl,(e,t,n)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(n.bWasUndone){const n=t.graveyardPosition.path.slice();return n.push(0),e.sourcePosition=new qr(t.graveyardPosition.root,n),e.howMany=0,[e]}return[new ed(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!n.bWasUndone&&"splitAtSource"!=n.abRelation){const i="$graveyard"==e.targetPosition.root.rootName,s="$graveyard"==t.targetPosition.root.rootName;if(s&&!i||(!i||s)&&n.aIsStrong){const n=t.targetPosition._getTransformedByMergeOperation(t),i=e.targetPosition._getTransformedByMergeOperation(t);return[new Al(n,e.howMany,i,0)]}return[new ed(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&n.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),Pu(zl,Al,(e,t,n)=>{const i=Xr._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!n.bWasUndone&&!n.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition)?[new ed(0)]:(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])}),Pu(zl,Ol,(e,t,n)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){const i=0!=t.howMany,s=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(i||s||"mergeTargetNotMoved"==n.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==n.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==n.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}),Pu(Al,wl,(e,t)=>{const n=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]}),Pu(Al,Al,(e,t,n)=>{const i=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany),s=Xr._createFromPositionAndShift(t.sourcePosition,t.howMany);let o,r=n.aIsStrong,a=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?a=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(a=!1),o=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Wu(e,t)&&Wu(t,e))return[t.getReversed()];if(i.containsPosition(t.targetPosition)&&i.containsRange(s,!0))return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Gu([i],o);if(s.containsPosition(e.targetPosition)&&s.containsRange(i,!0))return i.start=i.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),i.end=i.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Gu([i],o);const l=Xn(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Gu([i],o);"remove"!=e.type||"remove"==t.type||n.aWasUndone||n.forceWeakRemove?"remove"==e.type||"remove"!=t.type||n.bWasUndone||n.forceWeakRemove||(r=!1):r=!0;const d=[],c=i.getDifference(s);for(const e of c){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const n="same"==Xn(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),i=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,n);d.push(...i)}const u=i.getIntersection(s);return null!==u&&r&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===d.length?d.push(u):1==d.length?s.start.isBefore(i.start)||s.start.isEqual(i.start)?d.unshift(u):d.push(u):d.splice(1,0,u)),0===d.length?[new ed(e.baseVersion)]:Gu(d,o)}),Pu(Al,Ol,(e,t,n)=>{let i=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(i=e.targetPosition._getTransformedBySplitOperation(t));const s=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany);if(s.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=i,[e];if(s.start.hasSameParentAs(t.splitPosition)&&s.containsPosition(t.splitPosition)){let e=new Xr(t.splitPosition,s.end);return e=e._getTransformedBySplitOperation(t),Gu([new Xr(s.start,t.splitPosition),e],i)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==n.abRelation&&(i=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==n.abRelation&&(i=e.targetPosition);const o=[s._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const i=s.start.isEqual(t.graveyardPosition)||s.containsPosition(t.graveyardPosition);e.howMany>1&&i&&!n.aWasUndone&&o.push(Xr._createFromPositionAndShift(t.insertionPosition,1))}return Gu(o,i)}),Pu(Al,zl,(e,t,n)=>{const i=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition))if("remove"!=e.type||n.forceWeakRemove){if(1==e.howMany)return n.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new ed(0)]}else if(!n.aWasUndone){const n=[];let i=t.graveyardPosition.clone(),s=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(n.push(new Al(e.sourcePosition,e.howMany-1,e.targetPosition,0)),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),s=s._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));const o=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),r=new Al(i,1,o,0),a=r.getMovedRangeStart().path.slice();a.push(0);const l=new qr(r.targetPosition.root,a);s=s._getTransformedByMove(i,o,1);const d=new Al(s,t.howMany,l,0);return n.push(r),n.push(d),n}const s=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=s.start,e.howMany=s.end.offset-s.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]}),Pu(El,wl,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e])),Pu(El,zl,(e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])),Pu(El,Al,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),Pu(El,El,(e,t,n)=>{if(e.position.isEqual(t.position)){if(!n.aIsStrong)return[new ed(0)];e.oldName=t.newName}return[e]}),Pu(El,Ol,(e,t)=>{if("same"==Xn(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new El(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]}),Pu(Tl,Tl,(e,t,n)=>{if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue)return[new ed(0)];e.oldValue=t.newValue}return[e]}),Pu(Ol,wl,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!n.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const i=new qr(t.graveyardPosition.root,n),s=Ol.getInsertionPosition(new qr(t.graveyardPosition.root,n)),o=new Ol(i,0,s,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Ol.getInsertionPosition(e.splitPosition),e.graveyardPosition=o.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[o,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Ol.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),Pu(Ol,Al,(e,t,n)=>{const i=Xr._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const s=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);if(!n.bWasUndone&&s){const n=e.splitPosition._getTransformedByMoveOperation(t),i=e.graveyardPosition._getTransformedByMoveOperation(t),s=i.path.slice();s.push(0);const o=new qr(i.root,s);return[new Al(n,e.howMany,o,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const s=e.splitPosition.isEqual(t.targetPosition);if(s&&("insertAtSource"==n.baRelation||"splitBefore"==n.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=Ol.getInsertionPosition(e.splitPosition),[e];if(s&&n.abRelation&&n.abRelation.howMany){const{howMany:t,offset:i}=n.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(i),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){const n=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=n,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new ed(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new ed(0)];if("splitBefore"==n.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const i="$graveyard"==e.splitPosition.root.rootName,s="$graveyard"==t.splitPosition.root.rootName;if(s&&!i||(!i||s)&&n.aIsStrong){const n=[];return t.howMany&&n.push(new Al(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&n.push(new Al(e.splitPosition,e.howMany,e.moveTargetPosition,0)),n}return[new ed(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.baRelation){const n=t.insertionPosition.path.slice();n.push(0);const i=new qr(t.insertionPosition.root,n);return[e,new Al(e.insertionPosition,1,i,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset({path:"background.color",value:e})),e.setReducer("background",e=>{const t=[];return t.push(["background-color",e.color]),t}),e.setStyleRelation("background",["background-color"])}function uh(e){const t={},n=function(e){return e.replace(/, /g,",").split(" ").map(e=>e.replace(/,/g,", "))}(e);for(const e of n)ih(e)?(t.repeat=t.repeat||[],t.repeat.push(e)):oh(e)?(t.position=t.position||[],t.position.push(e)):ah(e)?t.attachment=e:th(e)?t.color=e:dh(e)&&(t.image=e);return{path:"background",value:t}}class hh extends Sd{constructor(e,t){super(e),this.view=t,this._toolbarConfig=Fc(e.config.get("toolbar")),this._elementReplacer=new pr}get element(){return this.view.element}init(e){const t=this.editor,n=this.view,i=t.editing.view,s=n.editable,o=i.document.getRoot();s.name=o.rootName,n.render();const r=s.element;this.setEditableElement(s.name,r),this.focusTracker.add(r),n.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(r),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){const e=this.editor,t=this.view,n=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({top:e})=>e),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),function({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:i,beforeFocus:s,afterBlur:o}){n.add(i.element),t.set("Alt+F10",(e,t)=>{n.isFocused&&!i.focusTracker.isFocused&&(s&&s(),i.focus(),t())}),i.keystrokes.set("Esc",(t,n)=>{i.focusTracker.isFocused&&(e.focus(),o&&o(),n())})}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),i=e.sourceElement,s=e.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");s&&function(e){const{view:t,element:n,text:i,isDirectHost:s=!0,keepOnFocus:o=!1}=e,r=t.document;zu.has(r)||(zu.set(r,new Map),r.registerPostFixer(e=>Ou(r,e))),zu.get(r).set(n,{text:i,isDirectHost:s,keepOnFocus:o,hostElement:s?n:null}),t.change(e=>Ou(r,e))}({view:t,element:n,text:s,isDirectHost:!1,keepOnFocus:!0})}}var mh=o(638);oo()(mh.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),mh.Z.locals;class gh extends nu{constructor(e,t,n={}){super(e),this.stickyPanel=new Su(e),this.toolbar=new Nc(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new su(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class ph extends kd{constructor(e,t={}){if(!Mn(e)&&void 0!==t.initialData)throw new u("editor-create-initial-data",null);super(t),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return Mn(e)?function(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}(e):e}(e)),Mn(e)&&(this.sourceElement=e),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new gh(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new hh(this,i),function(e){if(!N(e.updateSourceElement))throw new u("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(t&&"textarea"===t.tagName.toLowerCase()&&t.form){let n;const i=t.form,s=()=>e.updateSourceElement();N(i.submit)&&(n=i.submit,i.submit=()=>{s(),n.apply(i)}),i.addEventListener("submit",s),e.on("destroy",()=>{i.removeEventListener("submit",s),n&&(i.submit=n)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const i=new this(e,t);n(i.initPlugins().then(()=>i.ui.init(Mn(e)?e:null)).then(()=>i.data.init(i.config.get("initialData"))).then(()=>i.fire("ready")).then(()=>i))})}}ot(ph,Td),ot(ph,Od);const fh=["left","right","center","justify"];function xh(e){return fh.includes(e)}function _h(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}function Ih(e){const t=e.map(e=>{let t;return t="string"==typeof e?{name:e}:e,t}).filter(e=>{const t=!!fh.includes(e.name);return t||h("alignment-config-name-not-recognized",{option:e}),t}),n=t.filter(e=>!!e.className).length;if(n&&n{const s=i.slice(n+1),o=s.some(e=>e.name==t.name);if(o)throw new u("alignment-config-name-already-defined",{option:t,configuredOptions:e});if(t.className){const n=s.some(e=>e.className==t.className);if(n)throw new u("alignment-config-classname-already-defined",{option:t,configuredOptions:e})}}),t}const vh="alignment";class bh extends lt{refresh(){const e=this.editor.locale,t=$r(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,n=t.locale,i=t.model,s=i.document,o=e.value;i.change(e=>{const t=Array.from(s.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e)),i=t[0].getAttribute("alignment");_h(o,n)||i===o||!o?function(e,t){for(const n of e)t.removeAttribute(vh,n)}(t,e):function(e,t,n){for(const i of e)t.setAttribute(vh,n,i)}(t,e,o)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,vh)}}class jh extends rt{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e),e.config.define("alignment",{options:[...fh.map(e=>({name:e}))]})}init(){const e=this.editor,t=e.locale,n=e.model.schema,i=Ih(e.config.get("alignment.options")).filter(e=>xh(e.name)&&!_h(e.name,t)),s=i.some(e=>!!e.className);n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),s?e.conversion.attributeToAttribute(function(e){const t={model:{key:"alignment",values:e.map(e=>e.name)},view:{}};for(const n of e)t.view[n.name]={key:"class",value:n.className};return t}(i)):e.conversion.for("downcast").attributeToAttribute(function(e){const t={model:{key:"alignment",values:e.map(e=>e.name)},view:{}};for(const{name:n}of e)t.view[n]={key:"style",value:{"text-align":n}};return t}(i));const o=function(e){const t=[];for(const{name:n}of e)t.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return t}(i);for(const t of o)e.conversion.for("upcast").attributeToAttribute(t);const r=function(e){const t=[];for(const{name:n}of e)t.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return t}(i);for(const t of r)e.conversion.for("upcast").attributeToAttribute(t);e.commands.add("alignment",new bh(e))}}const Ch=new Map([["left",''],["right",''],["center",''],["justify",'']]);class yh extends rt{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t,i=Ih(e.config.get("alignment.options"));i.map(e=>e.name).filter(xh).forEach(e=>this._addButton(e)),t.add("alignment",e=>{const s=Kc(e),o=i.map(e=>t.create(`alignment:${e.name}`));Zc(s,o),s.buttonView.set({label:n("Text alignment"),tooltip:!0}),s.toolbarView.isVertical=!0,s.toolbarView.ariaLabel=n("Text alignment toolbar"),s.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const r="rtl"===e.contentLanguageDirection?Ch.get("right"):Ch.get("left");return s.buttonView.bind("icon").toMany(o,"isOn",(...e)=>{const t=e.findIndex(e=>e);return t<0?r:o[t].icon}),s.bind("isEnabled").toMany(o,"isEnabled",(...e)=>e.some(e=>e)),s})}_addButton(e){const t=this.editor;t.ui.componentFactory.add(`alignment:${e}`,n=>{const i=t.commands.get("alignment"),s=new fc(n);return s.set({label:this.localizedOptionTitles[e],icon:Ch.get(e),tooltip:!0,isToggleable:!0}),s.bind("isEnabled").to(i),s.bind("isOn").to(i,"value",t=>t===e),this.listenTo(s,"execute",()=>{t.execute("alignment",{value:e}),t.editing.view.focus()}),s})}}function*kh(e,t){for(const n of t)n&&e.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}class Ah extends lt{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n,i){const s=n.isCollapsed,o=n.getFirstRange(),r=o.start.parent,a=o.end.parent;if(i.isLimit(r)||i.isLimit(a))s||r!=a||e.deleteContent(n);else if(s){const e=kh(t.model.schema,n.getAttributes());wh(t,o.start),t.setSelectionAttribute(e)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd),s=r==a;e.deleteContent(n,{leaveUnmerged:i}),i&&(s?wh(t,n.focus):t.setSelection(a,0))}}(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function wh(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}class Sh extends To{constructor(e){super(e);const t=this.document;t.on("keydown",(e,n)=>{if(this.isEnabled&&n.keyCode==Is.enter){const i=new Qi(t,"enter",t.selection.getFirstRange());t.fire(i,new Ko(t,n.domEvent,{isSoft:n.shiftKey})),i.stop.called&&e.stop()}})}observe(){}}class Eh extends rt{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Sh),e.commands.add("enter",new Ah(e)),this.listenTo(n,"enter",(n,i)=>{i.preventDefault(),i.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class Th extends lt{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n){const i=n.isCollapsed,s=n.getFirstRange(),o=s.start.parent,r=s.end.parent,a=o==r;if(i){const i=kh(e.schema,n.getAttributes());zh(e,t,s.end),t.removeSelectionAttribute(n.getAttributeKeys()),t.setSelectionAttribute(i)}else{const i=!(s.start.isAtStart&&s.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:i}),a?zh(e,t,n.focus):i&&t.setSelection(r,0)}}(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const n=t.anchor;if(!n||!e.checkChild(n,"softBreak"))return!1;const i=t.getFirstRange(),s=i.start.parent,o=i.end.parent;return!Oh(s,e)&&!Oh(o,e)||s===o}(e.schema,t.selection)}}function zh(e,t,n){const i=t.createElement("softBreak");e.insertContent(i,n),t.setSelection(i,"after")}function Oh(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Oh(e.parent,t))}class Rh extends rt{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,s=i.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),i.addObserver(Sh),e.commands.add("shiftEnter",new Th(e)),this.listenTo(s,"enter",(t,n)=>{n.preventDefault(),n.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class $h{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class Dh extends lt{constructor(e,t){super(e),this._buffer=new $h(e.model,t)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",s=i.length,o=e.range?t.createSelection(e.range):n.selection,r=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock(),t.deleteContent(o),i&&t.insertContent(e.createText(i,n.selection.getAttributes()),o),r?e.setSelection(r):o.is("documentSelection")||e.setSelection(o),this._buffer.unlock(),this._buffer.input(s)})}}function Ph(e){if(e.newChildren.length-e.oldChildren.length!=1)return;const t=function(e,t){const n=[];let i,s=0;return e.forEach(e=>{"equal"==e?(o(),s++):"insert"==e?(r("insert")?i.values.push(t[s]):(o(),i={type:"insert",index:s,values:[t[s]]}),s++):r("delete")?i.howMany++:(o(),i={type:"delete",index:s,howMany:1})}),o(),n;function o(){i&&(n.push(i),i=null)}function r(e){return i&&i.type==e}}(Qs(e.oldChildren,e.newChildren,Fh),e.newChildren);if(t.length>1)return;const n=t[0];return n.values[0]&&n.values[0].is("$text")?n:void 0}function Fh(e,t){return e&&e.is("$text")&&t&&t.is("$text")?e.data===t.data:e===t}function Mh(e,t){const n=t.selection,i=e.shiftKey&&e.keyCode===Is.delete,s=!n.isCollapsed;return i&&s}const Nh=[bs("arrowUp"),bs("arrowRight"),bs("arrowDown"),bs("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let e=112;e<=135;e++)Nh.push(e);function Lh(e){return!(!e.ctrlKey&&!e.metaKey)||Nh.includes(e.keyCode)}class Bh{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(e){if(0==e.length)return!1;for(const t of e)if("children"===t.type&&!Ph(t))return!0;return!1}(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=function(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:!0}));if(t)return t.getAncestors({includeSelf:!0,parentFirst:!0}).find(e=>e.is("containerElement")||e.is("rootElement"))}(e);if(!n)return;const i=this.editor.editing.view.domConverter.mapViewToDom(n),s=new bo(this.editor.editing.view.document),o=this.editor.data.toModel(s.domToView(i)).getChild(0),r=this.editor.editing.mapper.toModelElement(n);if(!r)return;const a=Array.from(o.getChildren()),l=Array.from(r.getChildren()),d=a[a.length-1],c=l[l.length-1],u=d&&d.is("element","softBreak"),h=c&&!c.is("element","softBreak");u&&h&&a.pop();const m=this.editor.model.schema;if(!Vh(a,m)||!Vh(l,m))return;const g=a.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," "),p=l.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");if(p===g)return;const f=Qs(p,g),{firstChangeAt:x,insertions:_,deletions:I}=Uh(f);let v=null;t&&(v=this.editing.mapper.toModelRange(t.getFirstRange()));const b=g.substr(x,_),j=this.editor.model.createRange(this.editor.model.createPositionAt(r,x),this.editor.model.createPositionAt(r,x+I));this.editor.execute("input",{text:b,range:j,resultRange:v})}_handleTextMutation(e,t){if("text"!=e.type)return;const n=e.newText.replace(/\u00A0/g," "),i=e.oldText.replace(/\u00A0/g," ");if(i===n)return;const s=Qs(i,n),{firstChangeAt:o,insertions:r,deletions:a}=Uh(s);let l=null;t&&(l=this.editing.mapper.toModelRange(t.getFirstRange()));const d=this.editing.view.createPositionAt(e.node,o),c=this.editing.mapper.toModelPosition(d),u=this.editor.model.createRange(c,c.getShiftedBy(a)),h=n.substr(o,r);this.editor.execute("input",{text:h,range:u,resultRange:l})}_handleTextNodeInsertion(e){if("children"!=e.type)return;const t=Ph(e),n=this.editing.view.createPositionAt(e.node,t.index),i=this.editing.mapper.toModelPosition(n),s=t.values[0].data;this.editor.execute("input",{text:s.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function Vh(e,t){return e.every(e=>t.isInline(e))}function Uh(e){let t=null,n=null;for(let i=0;i{n.deleteContent(n.document.selection)}),e.unlock()}ps.isAndroid?i.document.on("beforeinput",(e,t)=>o(t),{priority:"lowest"}):i.document.on("keydown",(e,t)=>o(t),{priority:"lowest"}),i.document.on("compositionstart",function(){const e=n.document,t=1!==e.selection.rangeCount||e.selection.getFirstRange().isFlat;e.selection.isCollapsed||t||r()},{priority:"lowest"}),i.document.on("compositionend",()=>{t=n.createSelection(n.document.selection)},{priority:"lowest"})}(e),function(e){e.editing.view.document.on("mutations",(t,n,i)=>{new Bh(e).handle(n,i)})}(e)}}class Gh extends lt{constructor(e,t){super(e),this.direction=t,this._buffer=new $h(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const s=i.createSelection(e.selection||n.selection),o=e.sequence||1,r=s.isCollapsed;if(s.isCollapsed&&t.modifySelection(s,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(o))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(s,o))return void this.editor.execute("paragraph",{selection:s});if(s.isCollapsed)return;let a=0;s.getFirstRange().getMinimalFlatRanges().forEach(e=>{a+=Zi(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(s,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(a),i.setSelection(s),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n);if(!n.isCollapsed||!n.containsEntireContent(i))return!1;if(!t.schema.checkChild(i,"paragraph"))return!1;const s=i.getChild(0);return!s||"paragraph"!==s.name}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n),s=e.createElement("paragraph");e.remove(e.createRangeIn(i)),e.insert(s,i),e.setSelection(s,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const i=e.getFirstPosition(),s=n.schema.getLimitElement(i),o=s.getChild(0);return i.parent==o&&!!e.containsEntireContent(o)&&!!n.schema.checkChild(s,"paragraph")&&"paragraph"!=o.name}}class Hh extends To{constructor(e){super(e);const t=e.document;let n=0;function i(e,n,i){const s=new Qi(t,"delete",t.selection.getFirstRange());t.fire(s,new Ko(t,n,i)),s.stop.called&&e.stop()}t.on("keyup",(e,t)=>{t.keyCode!=Is.delete&&t.keyCode!=Is.backspace||(n=0)}),t.on("keydown",(e,s)=>{if(ps.isWindows&&Mh(s,t))return;const o={};if(s.keyCode==Is.delete)o.direction="forward",o.unit="character";else{if(s.keyCode!=Is.backspace)return;o.direction="backward",o.unit="codePoint"}const r=ps.isMac?s.altKey:s.ctrlKey;o.unit=r?"word":o.unit,o.sequence=++n,i(e,s.domEvent,o)}),ps.isAndroid&&t.on("beforeinput",(t,n)=>{if("deleteContentBackward"!=n.domEvent.inputType)return;const s={unit:"codepoint",direction:"backward",sequence:1},o=n.domTarget.ownerDocument.defaultView.getSelection();o.anchorNode==o.focusNode&&o.anchorOffset+1!=o.focusOffset&&(s.selectionToRemove=e.domConverter.domSelectionToView(o)),i(t,n.domEvent,s)})}observe(){}}class qh extends rt{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document,i=e.model.document;t.addObserver(Hh),this._undoOnBackspace=!1;const s=new Gh(e,"forward");if(e.commands.add("deleteForward",s),e.commands.add("forwardDelete",s),e.commands.add("delete",new Gh(e,"backward")),this.listenTo(n,"delete",(n,i)=>{const s={unit:i.unit,sequence:i.sequence};if(i.selectionToRemove){const t=e.model.createSelection(),n=[];for(const t of i.selectionToRemove.getRanges())n.push(e.editing.mapper.toModelRange(t));t.setTo(n),s.selection=t}e.execute("forward"==i.direction?"deleteForward":"delete",s),i.preventDefault(),t.scrollToTheSelection()},{priority:"low"}),ps.isAndroid){let e=null;this.listenTo(n,"delete",(t,n)=>{const i=n.domTarget.ownerDocument.defaultView.getSelection();e={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(t,n)=>{if(e){const t=n.domTarget.ownerDocument.defaultView.getSelection();t.collapse(e.anchorNode,e.anchorOffset),t.extend(e.focusNode,e.focusOffset),e=null}})}this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(t,n)=>{this._undoOnBackspace&&"backward"==n.direction&&1==n.sequence&&"codePoint"==n.unit&&(this._undoOnBackspace=!1,e.execute("undo"),n.preventDefault(),t.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class Yh extends rt{static get requires(){return[Wh,qh]}static get pluginName(){return"Typing"}}function Kh(e,t){let n=e.start;return{text:Array.from(e.getItems()).reduce((e,i)=>i.is("$text")||i.is("$textProxy")?e+i.data:(n=t.createPositionAfter(i),""),""),range:t.createRange(n,e.end)}}class Zh{constructor(e,t){this.model=e,this.testCallback=t,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(e,"change:data",(e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,i=n.document.selection,s=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:o,range:r}=Kh(s,n),a=this.testCallback(o);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const n=Object.assign(t,{text:o,range:r});"object"==typeof a&&Object.assign(n,a),this.fire(`matched:${e}`,n)}}}ot(Zh,Qe);class Xh extends rt{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,n=e.editing.view,i=e.locale,s=t.document.selection;this.listenTo(n.document,"arrowKey",(e,t)=>{if(!s.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const n=t.keyCode==Is.arrowright,o=t.keyCode==Is.arrowleft;if(!n&&!o)return;const r=i.contentLanguageDirection;let a=!1;a="ltr"===r&&n||"rtl"===r&&o?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(s,"change:range",(e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&tm(s.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&(!i.isAtStart||!Jh(n,t))&&(tm(i,t)?(em(e),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,s=i.getFirstPosition();return this._isGravityOverridden?(em(e),this._restoreGravity(),Qh(n,t,s),!0):s.isAtStart?!!Jh(i,t)&&(em(e),Qh(n,t,s),!0):function(e,t){return tm(e.getShiftedBy(-1),t)}(s,t)?s.isAtEnd&&!Jh(i,t)&&tm(s,t)?(em(e),Qh(n,t,s),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Jh(e,t){for(const n of t)if(e.hasAttribute(n))return!0;return!1}function Qh(e,t,n){const i=n.nodeBefore;e.change(e=>{i?e.setSelectionAttribute(i.getAttributes()):e.removeSelectionAttribute(t)})}function em(e){e.preventDefault()}function tm(e,t){const{nodeBefore:n,nodeAfter:i}=e;for(const e of t){const t=n?n.getAttribute(e):void 0;if((i?i.getAttribute(e):void 0)!==t)return!0}return!1}function nm(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function im(e,t,n,i){return i.createRange(sm(e,t,n,!0,i),sm(e,t,n,!1,i))}function sm(e,t,n,i,s){let o=e.textNode||(i?e.nodeBefore:e.nodeAfter),r=null;for(;o&&o.getAttribute(t)==n;)r=o,o=i?o.previousSibling:o.nextSibling;return r?s.createPositionAt(r,i?"before":"after"):e}nm('"'),nm("'"),nm("'"),nm('"'),nm('"'),nm("'");class om extends lt{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,i=t.document.selection,s=Array.from(i.getSelectedBlocks()),o=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(o){const t=s.filter(e=>rm(e)||lm(n,e));this._applyQuote(e,t)}else this._removeQuote(e,s.filter(rm))})}_getValue(){const e=$r(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!rm(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=$r(e.getSelectedBlocks());return!!n&&lm(t,n)}_removeQuote(e,t){am(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const n=e.createPositionBefore(t.start.parent);return void e.move(t,n)}t.end.isAtEnd||e.split(t.end);const n=e.createPositionAfter(t.end.parent);e.move(t,n)})}_applyQuote(e,t){const n=[];am(e,t).reverse().forEach(t=>{let i=rm(t.start);i||(i=e.createElement("blockQuote"),e.wrap(t,i)),n.push(i)}),n.reverse().reduce((t,n)=>t.nextSibling==n?(e.merge(e.createPositionAfter(t)),t):n)}}function rm(e){return"blockQuote"==e.parent.name?e.parent:null}function am(e,t){let n,i=0;const s=[];for(;i{const i=e.model.document.differ.getChanges();for(const e of i)if("insert"==e.type){const i=e.position.nodeAfter;if(!i)continue;if(i.is("element","blockQuote")&&i.isEmpty)return n.remove(i),!0;if(i.is("element","blockQuote")&&!t.checkChild(e.position,i))return n.unwrap(i),!0;if(i.is("element")){const e=n.createRangeIn(i);for(const i of e.getItems())if(i.is("element","blockQuote")&&!t.checkChild(n.createPositionBefore(i),i))return n.unwrap(i),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return n.remove(t),!0}return!1});const n=this.editor.editing.view.document,i=e.model.document.selection,s=e.commands.get("blockQuote");this.listenTo(n,"enter",(t,n)=>{i.isCollapsed&&s.value&&i.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),n.preventDefault(),t.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(t,n)=>{if("backward"!=n.direction||!i.isCollapsed||!s.value)return;const o=i.getLastPosition().parent;o.isEmpty&&!o.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),n.preventDefault(),t.stop())},{context:"blockquote"})}}var cm=o(636);oo()(cm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),cm.Z.locals;class um extends rt{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const i=e.commands.get("blockQuote"),s=new fc(n);return s.set({label:t("Block quote"),icon:'',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),s})}}class hm extends lt{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of s)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const e of n.getRanges())for(const n of e.getItems())if(t.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}const mm="bold";class gm extends rt{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:mm}),e.model.schema.setAttributeProperties(mm,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:mm,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t?"bold"==t||Number(t)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add(mm,new hm(e,mm)),e.keystrokes.set("CTRL+B",mm)}}const pm="bold";class fm extends rt{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(pm,n=>{const i=e.commands.get(pm),s=new fc(n);return s.set({label:t("Bold"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute(pm),e.editing.view.focus()}),s})}}class xm{constructor(e){this.files=function(e){const t=Array.from(e.files||[]),n=Array.from(e.items||[]);return t.length?t:n.filter(e=>"file"===e.kind).map(e=>e.getAsFile())}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}class _m extends Zo{constructor(e){super(e);const t=this.document;function n(e){return(n,s)=>{s.preventDefault();const o=s.dropRange?[s.dropRange]:null,r=new i(t,e);t.fire(r,{dataTransfer:s.dataTransfer,method:n.name,targetRanges:o,target:s.target}),r.stop.called&&s.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(t,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",n("dragging"),{priority:"low"})}onDomEvent(e){const t={dataTransfer:new xm(e.clipboardData?e.clipboardData:e.dataTransfer)};"drop"!=e.type&&"dragover"!=e.type||(t.dropRange=function(e,t){const n=t.target.ownerDocument,i=t.clientX,s=t.clientY;let o;return n.caretRangeFromPoint&&n.caretRangeFromPoint(i,s)?o=n.caretRangeFromPoint(i,s):t.rangeParent&&(o=n.createRange(),o.setStart(t.rangeParent,t.rangeOffset),o.collapse(!0)),o?e.domConverter.domRangeToView(o):null}(this.view,e)),this.fire(e.type,e,t)}}const Im=["figcaption","li"];function vm(e){let t="";if(e.is("$text")||e.is("$textProxy"))t=e.data;else if(e.is("element","img")&&e.hasAttribute("alt"))t=e.getAttribute("alt");else if(e.is("element","br"))t="\n";else{let n=null;for(const i of e.getChildren()){const e=vm(i);n&&(n.is("containerElement")||i.is("containerElement"))&&(Im.includes(n.name)||Im.includes(i.name)?t+="\n":t+="\n\n"),t+=e,n=i}}return t}class bm extends rt{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(_m),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,s=n.document;this.listenTo(s,"clipboardInput",t=>{e.isReadOnly&&t.stop()},{priority:"highest"}),this.listenTo(s,"clipboardInput",(e,t)=>{const s=t.dataTransfer;let o=t.content||"";o||(s.getData("text/html")?o=function(e){return e.replace(/(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t).replace(//g,"")}(s.getData("text/html")):s.getData("text/plain")&&(o=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}(s.getData("text/plain"))),o=this.editor.data.htmlProcessor.toView(o));const r=new i(this,"inputTransformation");this.fire(r,{content:o,dataTransfer:s,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,s){const o=s.dataTransfer;s.preventDefault();const r=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:o,content:r,method:i.name})}this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(t,n)=>{e.isReadOnly?n.preventDefault():i(t,n)},{priority:"low"}),this.listenTo(n,"clipboardOutput",(n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",vm(i.content))),"cut"==i.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class jm{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const s=n[0];i===s||Cm(i,s)||this.fire("change:top",{oldDescriptor:i,newDescriptor:s,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const s=n[0];i===s||Cm(i,s)||this.fire("change:top",{oldDescriptor:i,newDescriptor:s,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e.id);if(Cm(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&ym(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e);n>-1&&t.splice(n,1)}}function Cm(e,t){return e&&t&&e.priority==t.priority&&km(e.classes)==km(t.classes)}function ym(e,t){return e.priority>t.priority||!(e.prioritykm(t.classes)}function km(e){return Array.isArray(e)?e.sort().join(","):e}ot(jm,_);const Am="ck-widget_selected";function wm(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Sm(e,t,n={}){if(!e.is("containerElement"))throw new u("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Om,n.label&&function(e,t,n){n.setCustomProperty("widgetLabel",t,e)}(e,n.label,t),n.hasSelectionHandle&&function(e,t){const n=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(e){const t=this.toDomElement(e),n=new hc;return n.set("content",''),n.render(),t.appendChild(n.element),t});t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),function(e,t,n=Em,i=Tm){const s=new jm;s.on("change:top",(t,s)=>{s.oldDescriptor&&i(e,s.oldDescriptor,s.writer),s.newDescriptor&&n(e,s.newDescriptor,s.writer)}),t.setCustomProperty("addHighlight",(e,t,n)=>s.add(t,n),e),t.setCustomProperty("removeHighlight",(e,t,n)=>s.remove(t,n),e)}(e,t),e}function Em(e,t,n){if(t.classes&&n.addClass(Gn(t.classes),e),t.attributes)for(const i in t.attributes)n.setAttribute(i,t.attributes[i],e)}function Tm(e,t,n){if(t.classes&&n.removeClass(Gn(t.classes),e),t.attributes)for(const i in t.attributes)n.removeAttribute(i,e)}function zm(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function Om(){return null}const Rm="widget-type-around";function $m(e,t,n){return e&&wm(e)&&!n.isInline(t)}function Dm(e){return e.getAttribute(Rm)}var Pm=o(137);oo()(Pm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Pm.Z.locals;const Fm=["before","after"],Mm=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,Nm="ck-widget__type-around_disabled";class Lm extends rt{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Eh,qh]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,s)=>{t.change(e=>{for(const n of t.document.roots)s?e.removeClass(Nm,n):e.addClass(Nm,n)}),s||e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),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,s=n.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(e,t),attributes:s}),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=Dm(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,s)=>{const o=s.mapper.toViewElement(n.item);$m(o,n.item,t)&&function(e,t,n){const i=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(e){const n=this.toDomElement(e);return function(e,t){for(const n of Fm){const i=new Vd({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:t[n]},children:[e.ownerDocument.importNode(Mm,!0)]});e.appendChild(i.render())}}(n,t),function(e){const t=new Vd({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(n),n});e.insert(e.createPositionAt(n,"end"),i)}(s.writer,i,o)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,s=e.editing.view;function o(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(s.document,"arrowKey",(e,t)=>{this._handleArrowKeyPress(e,t)},{context:[wm,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(t,n)=>{n.directChange&&e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const t=n.getSelectedElement();t&&$m(e.editing.mapper.toViewElement(t),t,i)||e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,n)=>{const s=n.writer;if(this._currentFakeCaretModelElement){const e=n.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(s.removeClass(Fm.map(o),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=n.mapper.toViewElement(r);if(!$m(a,r,i))return;const l=Dm(t.selection);l&&(s.addClass(o(l),a),this._currentFakeCaretModelElement=r)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,n,i)=>{i||e.model.change(e=>{e.removeSelectionAttribute(Rm)})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,s=i.document.selection,o=i.schema,r=n.editing.view,a=function(e,t){const n=ys(e,t);return"down"===n||"right"===n}(t.keyCode,n.locale.contentLanguageDirection),l=r.document.selection.getSelectedElement();let d;$m(l,n.editing.mapper.toModelElement(l),o)?d=this._handleArrowKeyPressOnSelectedWidget(a):s.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Dm(t.document.selection);return t.change(t=>n?n!==(e?"after":"before")&&(t.removeSelectionAttribute(Rm),!0):(t.setSelectionAttribute(Rm,e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,s=t.plugins.get("Widget"),o=s._getObjectElementNextToSelection(e);return!!$m(t.editing.mapper.toViewElement(o),o,i)&&(n.change(t=>{s._setSelectionOverElement(o),t.setSelectionAttribute(Rm,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,n=t.model,i=n.schema,s=t.editing.mapper,o=n.document.selection,r=e?o.getLastPosition().nodeBefore:o.getFirstPosition().nodeAfter;return!!$m(s.toViewElement(r),r,i)&&(n.change(t=>{t.setSelection(r,"on"),t.setSelectionAttribute(Rm,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const s=function(e){return e.closest(".ck-widget__type-around__button")}(i.domTarget);if(!s)return;const o=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(s),r=function(e,t){const n=e.closest(".ck-widget");return t.mapDomToView(n)}(s,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,o),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 s=t.getSelectedElement(),o=e.editing.mapper.toViewElement(s),r=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:$m(o,s,r)&&(this._insertParagraph(s,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())},{context:wm})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[Is.enter,Is.delete,Is.backspace];this._listenToIfEnabled(e.document,"keydown",(e,n)=>{t.includes(n.keyCode)||Lh(n)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(t,s)=>{if("atTarget"!=t.eventPhase)return;const o=Dm(n.document.selection);if(!o)return;const r=s.direction,a=n.document.selection.getSelectedElement(),l="forward"==r;if("before"===o===l)e.execute("delete",{selection:n.createSelection(a,"on")});else{const t=i.getNearestSelectionRange(n.createPositionAt(a,o),r);if(t)if(t.isCollapsed){const s=n.createSelection(t.start);if(n.modifySelection(s,{direction:r}),s.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")})}s.preventDefault(),t.stop()},{context:wm})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[i,s])=>{if(s&&!s.is("documentSelection"))return;const o=Dm(n);return o?(e.stop(),t.change(e=>{const s=n.getSelectedElement(),r=t.createPositionAt(s,o),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,,s={}]=n;if(i&&!i.is("documentSelection"))return;const o=Dm(t);o&&(s.findOptimalPosition=o,n[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(e,[n])=>{n&&!n.is("documentSelection")||Dm(t)&&e.stop()},{priority:"high"})}}function Bm(e,t,n){const i=e.schema,s=e.createRangeIn(t.root),o="forward"==n?"elementStart":"elementEnd";for(const{previousPosition:e,item:r,type:a}of s.getWalker({startPosition:t,direction:n})){if(i.isLimit(r)&&!i.isInline(r))return e;if(a==o&&i.isBlock(r))return null}return null}function Vm(e,t,n){const i="backward"==n?t.end:t.start;if(e.checkChild(i,"$text"))return i;for(const{nextPosition:i}of t.getWalker({direction:n}))if(e.checkChild(i,"$text"))return i;return null}var Um=o(507);oo()(Um.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Um.Z.locals;class Wm extends rt{static get pluginName(){return"Widget"}static get requires(){return[Lm,qh]}init(){const e=this.editor,t=e.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,n,i)=>{const s=i.writer,o=n.selection;if(o.isCollapsed)return;const r=o.getSelectedElement();if(!r)return;const a=e.editing.mapper.toViewElement(r);wm(a)&&i.consumable.consume(o,"selection")&&s.setSelection(s.createRangeOn(a),{fake:!0,label:zm(a)})}),this.editor.editing.downcastDispatcher.on("selection",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer,s=i.document.selection;let o=null;for(const e of s.getRanges())for(const t of e){const e=t.item;wm(e)&&!Gm(e,o)&&(i.addClass(Am,e),this._previouslySelected.add(e),o=e)}},{priority:"low"}),t.addObserver(qu),this.listenTo(n,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(n,"arrowKey",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{context:[wm,"$text"]}),this.listenTo(n,"arrowKey",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{context:"$root"}),this.listenTo(n,"arrowKey",function(e){const t=e.model;return(n,i)=>{const s=i.keyCode==Is.arrowup,o=i.keyCode==Is.arrowdown,r=i.shiftKey,a=t.document.selection;if(!s&&!o)return;const l=o;if(r&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(a,l))return;const d=function(e,t,n){const i=e.model;if(n){const e=t.isCollapsed?t.focus:t.getLastPosition(),n=Bm(i,e,"forward");if(!n)return null;const s=i.createRange(e,n),o=Vm(i.schema,s,"backward");return o?i.createRange(e,o):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),n=Bm(i,e,"backward");if(!n)return null;const s=i.createRange(n,e),o=Vm(i.schema,s,"forward");return o?i.createRange(o,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,s=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 o=e.mapper.toViewRange(t),r=s.viewRangeToDom(o),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,s=i.document;let o=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(wm(e))return!1;e=e.parent}return!1}(o)){if((ps.isSafari||ps.isGecko)&&t.domEvent.detail>=3){const e=n.editing.mapper,i=o.is("attributeElement")?o.findAncestor(e=>!e.is("attributeElement")):o,s=e.toModelElement(i);t.preventDefault(),this.editor.model.change(e=>{e.setSelection(s,"in")})}return}if(!wm(o)&&(o=o.findAncestor(wm),!o))return;ps.isAndroid&&t.preventDefault(),s.isFocused||i.focus();const r=n.editing.mapper.toModelElement(o);this._setSelectionOverElement(r)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,i=this.editor.model,s=i.schema,o=i.document.selection,r=o.getSelectedElement(),a=ys(n,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,d="up"==a||"down"==a;if(r&&s.isObject(r)){const n=l?o.getLastPosition():o.getFirstPosition(),r=s.getNearestSelectionRange(n,l?"forward":"backward");return void(r&&(i.change(e=>{e.setSelection(r)}),t.preventDefault(),e.stop()))}if(!o.isCollapsed&&!t.shiftKey){const n=o.getFirstPosition(),r=o.getLastPosition(),a=n.nodeAfter,d=r.nodeBefore;return void((a&&s.isObject(a)||d&&s.isObject(d))&&(i.change(e=>{e.setSelection(l?r:n)}),t.preventDefault(),e.stop()))}if(!o.isCollapsed)return;const c=this._getObjectElementNextToSelection(l);if(c&&s.isObject(c)){if(s.isInline(c)&&d)return;this._setSelectionOverElement(c),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,i=n.schema,s=n.document.selection.getSelectedElement();s&&i.isObject(s)&&(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,s=t.createSelection(i);if(t.modifySelection(s,{direction:e?"forward":"backward"}),s.isEqual(i))return null;const o=e?s.focus.nodeBefore:s.focus.nodeAfter;return o&&n.isObject(o)?o:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Am,t);this._previouslySelected.clear()}}function Gm(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}const Hm=function(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return w(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),dr(e,t,{leading:i,maxWait:t,trailing:s})};var qm=o(390);oo()(qm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qm.Z.locals;class Ym extends rt{static get pluginName(){return"DragDrop"}static get requires(){return[bm,Wm]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Hm(e=>this._updateDropMarker(e),40),this._removeDropMarkerDelayed=Xm(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=Xm(()=>this._clearDraggableAttributes(),40),t.addObserver(_m),t.addObserver(qu),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(e,t,n)=>{n||this._finalizeDragging(!1)}),ps.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,s=i.document;this.listenTo(s,"dragstart",(i,o)=>{const r=n.selection;if(o.target&&o.target.is("editableElement"))return void o.preventDefault();const l=o.target?Jm(o.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(!s.selection.isCollapsed){const e=s.selection.getSelectedElement();e&&wm(e)||(this._draggedRange=da.fromRange(r.getFirstRange()))}if(!this._draggedRange)return void o.preventDefault();this._draggingUid=a(),o.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",o.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const d=t.createSelection(this._draggedRange.toRange()),c=e.data.toView(t.getSelectedContent(d));s.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:c,method:i.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(s,"dragend",(e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)},{priority:"low"}),this.listenTo(s,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(s,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(s,"dragging",(t,n)=>{if(!this.isEnabled)return void(n.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const i=Km(e,n.targetRanges,n.target);this._draggedRange||(n.dataTransfer.dropEffect="copy"),ps.isGecko||("copy"==n.dataTransfer.effectAllowed?n.dataTransfer.dropEffect="copy":["all","copyMove"].includes(n.dataTransfer.effectAllowed)&&(n.dataTransfer.dropEffect="move")),i&&this._updateDropMarkerThrottled(i)},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(t,n)=>{if("drop"!=n.method)return;const i=Km(e,n.targetRanges,n.target);return this._removeDropMarker(),i?(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),"move"==Zm(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(i,!0)?(this._finalizeDragging(!1),void t.stop()):void(n.targetRanges=[e.editing.mapper.toViewRange(i)])):(this._finalizeDragging(!1),void t.stop())},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(bm);e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const n=t.targetRanges.map(e=>this.editor.editing.mapper.toModelRange(e));this.editor.model.change(e=>e.setSelection(n))},{priority:"high"}),e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const n="move"==Zm(t.dataTransfer),i=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(i&&n)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(i,s)=>{if(ps.isAndroid||!s)return;this._clearDraggableAttributesDelayed.cancel();let o=Jm(s.target);if(ps.isBlink&&!e.isReadOnly&&!o&&!n.selection.isCollapsed){const e=n.selection.getSelectedElement();e&&wm(e)||(o=n.selection.editableElement)}o&&(t.change(e=>{e.setAttribute("draggable","true",o)}),this._draggableElement=e.editing.mapper.toModelElement(o))}),this.listenTo(n,"mouseup",()=>{ps.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const t=this.toDomElement(e);return t.innerHTML="⁠⁠",t})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(t=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(e=>{e.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function Km(e,t,n){const i=e.model,s=e.editing.mapper;let o=null;const r=t?t[0].start:null;if(n.is("uiElement")&&(n=n.parent),o=function(e,t){const n=e.model,i=e.editing.mapper;if(wm(t))return n.createRangeOn(i.toModelElement(t));if(!t.is("editableElement")){const e=t.findAncestor(e=>wm(e)||e.is("editableElement"));if(wm(e))return n.createRangeOn(i.toModelElement(e))}return null}(e,n),o)return o;const a=function(e,t){const n=e.editing.mapper,i=e.editing.view,s=n.toModelElement(t);if(s)return s;const o=i.createPositionBefore(t),r=n.findMappedViewAncestor(o);return n.toModelElement(r)}(e,n),l=r?s.toModelPosition(r):null;return l?(o=function(e,t,n){const i=e.model;if(!i.schema.checkChild(n,"$block"))return null;const s=i.createPositionAt(n,0),o=t.path.slice(0,s.path.length),r=i.createPositionFromPath(t.root,o).nodeAfter;return r&&i.schema.isObject(r)?i.createRangeOn(r):null}(e,l,a),o||(o=i.schema.getNearestSelectionRange(l,ps.isGecko?"forward":"backward"),o||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,s=n.createPositionAt(t,0);return i.getNearestSelectionRange(s,"forward")}(e,a)}function Zm(e){return ps.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Xm(e,t){let n;function i(...s){i.cancel(),n=setTimeout(()=>e(...s),t)}return i.cancel=()=>{clearTimeout(n)},i}function Jm(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(wm);if(wm(e))return e;const t=e.findAncestor(e=>wm(e)||e.is("editableElement"));return wm(t)?t:null}class Qm extends rt{static get pluginName(){return"PastePlainText"}static get requires(){return[bm]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,s=t.document.selection;let o=!1;n.addObserver(_m),this.listenTo(i,"keydown",(e,t)=>{o=t.shiftKey}),e.plugins.get(bm).on("contentInsertion",(e,n)=>{(o||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(s.getAttributes()).filter(([e])=>t.schema.getAttributeProperties(e).isFormatting);s.isCollapsed||t.deleteContent(s,{doNotAutoparagraph:!0}),i.push(...s.getAttributes());const o=e.createRangeIn(n.content);for(const t of o.getItems())t.is("$textProxy")&&e.setAttributes(i,t)})})}}class eg extends rt{static get pluginName(){return"Clipboard"}static get requires(){return[bm,Ym,Qm]}}class tg extends lt{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!ng(e.schema,n))do{if(n=n.parent,!n)return}while(!ng(e.schema,n));e.change(e=>{e.setSelection(n,"in")})}}function ng(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const ig=js("Ctrl+A");class sg 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)=>{bs(n)===ig&&(e.execute("selectAll"),n.preventDefault())})}}class og 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),s=t.t;return i.set({label:s("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[sg,og]}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,s=i.document,o=[],r=e.map(e=>e.getTransformedByOperations(n)),a=r.flat();for(const e of r){const t=e.filter(e=>e.root!=s.graveyard).filter(e=>!dg(e,a));t.length&&(lg(t),o.push(t[0]))}o.length&&i.change(e=>{e.setSelection(o,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const s=e.operations.slice().filter(e=>e.isDocumentOperation);s.reverse();for(const e of s){const s=e.baseVersion+1,o=Array.from(i.history.getOperations(s)),r=Nu([e.getReversed()],o,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const s of r)t.addOperation(s),n.applyOperation(s),i.history.setOperationAsUndone(e,s)}}}function lg(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,!0))}class cg extends ag{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e),this.fire("revert",n.batch,i)}),this.refresh()}}class ug extends ag{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class hg extends rt{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new cg(e),this._redoCommand=new ug(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(e,t)=>{const n=t[0];if(!n.isDocumentOperation)return;const i=n.batch,s=this._redoCommand._createdBatches.has(i),o=this._undoCommand._createdBatches.has(i);this._batchRegistry.has(i)||(this._batchRegistry.add(i),i.isUndoable&&(s?this._undoCommand.addBatch(i):o||(this._undoCommand.addBatch(i),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}const mg='',gg='';class pg extends rt{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,i="ltr"==t.uiLanguageDirection?mg:gg,s="ltr"==t.uiLanguageDirection?gg:mg;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",s)}_addButton(e,t,n,i){const s=this.editor;s.ui.componentFactory.add(e,o=>{const r=s.commands.get(e),a=new fc(o);return a.set({label:t,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",()=>{s.execute(e),s.editing.view.focus()}),a})}}class fg extends rt{static get requires(){return[hg,pg]}static get pluginName(){return"Undo"}}class xg extends lt{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.value;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,i):e.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of s)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}}class _g extends Un{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(e,t){this.find(t=>t.color===e.color)||super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}ot(_g,Qe);var Ig=o(585);oo()(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:s,documentColorsCount:o}){super(e),this.items=this.createCollection(),this.colorDefinitions=t,this.focusTracker=new Dr,this.keystrokes=new Pr,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new _g,this.documentColorsCount=o,this._focusCycler=new jc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=s,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 s of n.getRootNames()){const o=n.getRoot(s),r=e.createRangeIn(o);for(const e of r.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=i))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,n=this.selectedColor;t.selectedColor=n,e&&(e.selectedColor=n)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const e=Vd.bind(this.documentColors,this.documentColors),t=new tu(this.locale);t.text=this._documentColorsLabel,t.extendTemplate({attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]}}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const e=new fc;return e.set({withText:!0,icon:'',tooltip:!0,label:this.removeButtonLabel}),e.class="ck-color-table__remove-color",e.on("execute",()=>{this.fire("execute",{value:null})}),e}_createStaticColorsGrid(){const e=new kc(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.delegate("execute").to(this),e}_createDocumentColorsGrid(){const e=Vd.bind(this.documentColors,this.documentColors),t=new kc(this.locale,{columns:this.columns});return t.delegate("execute").to(this),t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(e=>{const t=new vc;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color})}),t}),this.documentColors.on("change:isEmpty",(e,n,i)=>{i&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}const bg="fontColor",jg="fontBackgroundColor";function Cg(e){return t=>function(e){return e.replace(/\s/g,"")}(t.getStyle(e))}function yg(e){return(t,{writer:n})=>n.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class kg extends xg{constructor(e){super(e,jg)}}class Ag extends rt{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define(jg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(ch),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:jg,value:Cg("background-color")}}),e.conversion.for("downcast").attributeToElement({model:jg,view:yg("background-color")}),e.commands.add(jg,new kg(e)),e.model.schema.extend("$text",{allowAttributes:jg}),e.model.schema.setAttributeProperties(jg,{isFormatting:!0,copyOnEnter:!0})}}class wg extends rt{constructor(e,{commandName:t,icon:n,componentName:i,dropdownLabel:s}){super(e),this.commandName=t,this.componentName=i,this.icon=n,this.dropdownLabel=s,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),s=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)),o=e.config.get(`${this.componentName}.documentColors`);e.ui.componentFactory.add(this.componentName,t=>{const r=Kc(t);return this.colorTableView=function({dropdownView:e,colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:s,documentColorsCount:o}){const r=e.locale,a=new vg(r,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:s,documentColorsCount:o});return e.colorTableView=a,e.panelView.children.add(a),a.delegate("execute").to(e,"execute"),a}({dropdownView:r,colors:s.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),documentColorsLabel:0!==o?n("Document colors"):void 0,documentColorsCount:void 0===o?this.columns:o}),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!==o&&this.colorTableView.updateDocumentColors(e.model,this.componentName),this.colorTableView.updateSelectedColors())}),r})}}class Sg extends wg{constructor(e){const t=e.locale.t;super(e,{commandName:jg,componentName:jg,icon:'',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Eg extends xg{constructor(e){super(e,bg)}}class Tg extends rt{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define(bg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:bg,value:Cg("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:bg,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:bg,view:yg("color")}),e.commands.add(bg,new Eg(e)),e.model.schema.extend("$text",{allowAttributes:bg}),e.model.schema.setAttributeProperties(bg,{isFormatting:!0,copyOnEnter:!0})}}class zg extends wg{constructor(e){const t=e.locale.t;super(e,{commandName:bg,componentName:bg,icon:'',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class Og extends lt{refresh(){const e=this.editor.model,t=$r(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Rg(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(i=>{const s=(e.selection||n.selection).getSelectedBlocks();for(const e of s)!e.is("element","paragraph")&&Rg(e,t.schema)&&i.rename(e,"paragraph")})}}function Rg(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class $g extends lt{execute(e){const t=this.editor.model,n=e.attributes;let i=e.position;t.change(e=>{const s=e.createElement("paragraph");if(n&&t.schema.setAllowedAttributes(s,n,e),!t.schema.checkChild(i.parent,s)){const n=t.schema.findAllowedParent(i,s);if(!n)return;i=e.split(i,n).position}t.insertContent(s,i),e.setSelection(s,"in")})}}class Dg 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 $g(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>Dg.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Dg.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=$r(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Fg(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(e=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(e=>Fg(e,i,t.schema));for(const t of s)t.is("element",i)||e.rename(t,i)})}}function Fg(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const Mg="paragraph";class Ng extends rt{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Dg]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!==Mg&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new 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 s=e.model.document.selection.getFirstPosition().parent,o=n.some(e=>s.is("element",e.model));o&&!s.is("element",Mg)&&0===s.childCount&&i.writer.rename(s,Mg)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:d.get("low")+1})}}var Lg=o(230);oo()(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"),s=t("Heading");e.ui.componentFactory.add("heading",t=>{const o={},r=new Un,a=e.commands.get("heading"),l=e.commands.get("paragraph"),d=[a];for(const e of n){const t={type:"button",model:new mu({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),d.push(l)):(t.model.bind("isOn").to(a,"value",t=>t===e.model),t.model.set({commandName:"heading",commandValue:e.model})),r.add(t),o[e.model]=e.title}const c=Kc(t);return Xc(c,r),c.buttonView.set({isOn:!1,withText:!0,tooltip:s}),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 o[n]?o[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("-"),s={x:"right"==i[1]?n.right:n.left,y:"bottom"==i[0]?n.bottom:n.top};return s.x+=e.ownerDocument.defaultView.scrollX,s.y+=e.ownerDocument.defaultView.scrollY,s}(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 s=n.style.width;s&&s.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(s):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}`}ot(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 s=new Ir(n);t.width=Math.round(s.width),t.height=Math.round(s.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(),s=this._viewResizerWrapper,o=[s.getStyle("width"),s.getStyle("height"),s.getStyle("left"),s.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(o,r)&&this._options.editor.editing.view.change(e=>{e.setStyle({width:r[0],height:r[1],left:r[2],top:r[3]},s)})}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),s={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};i&&t.activeHandlePosition.endsWith("-right")&&(s.x=n.x-(t._referenceCoordinates.x+t.originalWidth)),i&&(s.x*=2);const o={width:Math.abs(t.originalWidth+s.x),height:Math.abs(t.originalHeight+s.y)};o.dominant=o.width/t.aspectRatio>o.height?"width":"height",o.max=o[o.dominant];const r={width:o.width,height:o.height};return"width"==o.dominant?r.height=r.width/t.aspectRatio:r.width=r.height*t.aspectRatio,{width:Math.round(r.width),height:Math.round(r.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)e.appendChild(new Vd({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Hg(n)}`}}).render())}_appendSizeUI(e){this._sizeView=new Wg,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function Hg(e){return`ck-widget__resizer__handle-${e}`}ot(Gg,Qe);var qg=o(263);oo()(qg.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qg.Z.locals;class Yg extends rt{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing,t=ho.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(qu),this._observer=Object.create(wo),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));const n=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=Hm(n,200),this.on("change:visibleResizer",n),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())},{priority:"lowest"}),this._observer.listenTo(ho.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)}}ot(Yg,Qe);class Kg extends lt{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),i=t.model,s=n.getClosestSelectedImageElement(i.document.selection);i.change(t=>{t.setAttribute("alt",e.newValue,s)})}}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=$r(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,s=i.model,o=s.document.selection;n=ep(i,t||o,n),e={...Object.fromEntries(o.getAttributes()),...e};for(const t in e)s.schema.checkAttribute(n,t)||delete e[t];return s.change(i=>{const o=i.createElement(n,e);return s.insertObject(o,t,null,{setSelection:"on",findOptimalPosition:!t&&"imageInline"!=n}),o.parent?o: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=Dm(e);if(i)return t.createRange(t.createPositionAt(n,i))}return ad(e,t)}(e,t),i=n.start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}(t,e.model);if(e.model.schema.checkChild(n,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),Sm(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&wm(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}}function ep(e,t,n){const i=e.model.schema,s=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?n||("inline"===s?"imageInline":"block"===s?"imageBlock":t.is("selection")?Jg(i,t):i.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class tp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Kg(this.editor))}}var np=o(831);oo()(np.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),np.Z.locals;var ip=o(590);oo()(ip.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ip.Z.locals;class sp extends Bd{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Dr,this.keystrokes=new Pr,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Dd,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),$d,"ck-button-cancel","cancel"),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Fd(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Md({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,i){const s=new fc(this.locale);return s.set({label:e,icon:t,tooltip:!0}),s.extendTemplate({attributes:{class:n}}),i&&s.delegate("execute").to(this,i),s}_createLabeledInputView(){const e=this.locale.t,t=new cu(this.locale,uu);return t.label=e("Text alternative"),t}}function op(e){const t=e.editing.view,n=_u.defaultPositions,i=e.plugins.get("ImageUtils");return{target:t.domConverter.viewToDom(i.getClosestSelectedImageWidget(t.document.selection)),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class rp extends rt{static get requires(){return[Cu]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),s=new fc(n);return s.set({label:t("Change image text alternative"),icon:'',tooltip:!0}),s.bind("isEnabled").to(i,"isEnabled"),this.listenTo(s,"execute",()=>{this._showForm()}),s})}_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 sp(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=op(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:op(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 s=i.writer,o=i.mapper.toViewElement(n.item),r=e.findViewImgElement(o);if(null===n.attributeNewValue){const e=n.attributeOldValue;e.data&&(s.removeAttribute("srcset",r),s.removeAttribute("sizes",r),e.width&&s.removeAttribute("width",r))}else{const e=n.attributeNewValue;e.data&&(s.setAttribute("srcset",e.data,r),s.setAttribute("sizes","100vw",r),e.width&&s.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 s=i.writer,o=i.mapper.toViewElement(n.item),r=e.findViewImgElement(o);s.setAttribute(n.attributeKey,n.attributeNewValue||"",r)}}class cp extends To{observe(e){this.listenTo(e,"load",(e,t)=>{const n=t.target;this.checkShouldIgnoreEventFromTarget(n)||"IMG"==n.tagName&&this._fireEvents(t)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class up extends lt{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&h("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&h("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=Gn(e.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),s=Object.fromEntries(n.getAttributes());t.forEach((e,t)=>{const o=n.getSelectedElement();if("string"==typeof e&&(e={src:e}),t&&o&&i.isImage(o)){const t=this.editor.model.createPositionAfter(o);i.insertImage({...e,...s},t)}else i.insertImage({...e,...s})})}}class hp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(cp),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}});const n=new up(e);e.commands.add("insertImage",n),e.commands.add("imageInsert",n)}}class mp extends lt{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(t.document.selection),s=Object.fromEntries(i.getAttributes());return s.src||s.uploadId?t.change(e=>{const o=Array.from(t.markers).filter(e=>e.getRange().containsItem(i)),r=n.insertImage(s,t.createSelection(i,"on"),this._modelElementName);if(!r)return null;const a=e.createRangeOn(r);for(const t of o){const n=t.getRange(),i="$graveyard"!=n.root.rootName?n.getJoined(a,!0):a;e.updateMarker(t,{range:i})}return{oldElement:i,newElement:r}}):null}}class gp extends rt{static get requires(){return[hp,Qg,bm]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new mp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>Zg(t)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:n})=>i.toImageWidget(Zg(n),n,t("image widget"))}),n.for("downcast").add(dp(i,"imageBlock","src")).add(dp(i,"imageBlock","alt")).add(lp(i,"imageBlock")),n.for("upcast").elementToElement({view:Xg(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)}).add(function(e){return e=>{e.on("element:figure",t)};function t(t,n,i){if(!i.consumable.test(n.viewItem,{name:!0,classes:"image"}))return;const s=e.findViewImgElement(n.viewItem);if(!s||!i.consumable.test(s,{name:!0}))return;i.consumable.consume(n.viewItem,{name:!0,classes:"image"});const o=$r(i.convertItem(s,n.modelCursor).modelRange.getItems());o?(i.convertChildren(n.viewItem,o),i.updateConversionResult(o,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",(s,o)=>{const r=Array.from(o.content.getChildren());let a;if(!r.every(i.isInlineImageView))return;a=o.targetRanges?e.editing.mapper.toModelRange(o.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===Jg(t.schema,l)){const e=new Yu(n.document),t=r.map(t=>e.createElement("figure",{class:"image"},t));o.content=e.createDocumentFragment(t)}})}}var pp=o(48);oo()(pp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pp.Z.locals;class fp extends rt{static get requires(){return[gp,Wm,ap]}static get pluginName(){return"ImageBlock"}}class xp extends rt{static get requires(){return[hp,Qg,bm]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((e,t)=>{if(e.endsWith("caption")&&"imageInline"===t.name)return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new mp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:n})=>i.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(n),n,t("image widget"))}),n.for("downcast").add(dp(i,"imageInline","src")).add(dp(i,"imageInline","alt")).add(lp(i,"imageInline")),n.for("upcast").elementToElement({view:Xg(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(s,o)=>{const r=Array.from(o.content.getChildren());let a;if(!r.every(i.isBlockImageView))return;a=o.targetRanges?e.editing.mapper.toModelRange(o.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===Jg(t.schema,l)){const e=new Yu(n.document),t=r.map(t=>1===t.childCount?(Array.from(t.getAttributes()).forEach(n=>e.setAttribute(...n,i.findViewImgElement(t))),t.getChild(0)):t);o.content=e.createDocumentFragment(t)}})}}class _p extends rt{static get requires(){return[xp,Wm,ap]}static get pluginName(){return"ImageInline"}}class Ip extends lt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils").getClosestSelectedImageElement(n.document.selection);this.value={width:e.width,height:null},i&&n.change(t=>{t.setAttribute("width",e.width,i)})}}class vp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Ip(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(e){const t=this.editor;t.conversion.for("downcast").add(t=>t.on(`attribute:width:${e}`,(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,s=n.mapper.toViewElement(t.item);null!==t.attributeNewValue?(i.setStyle("width",t.attributeNewValue,s),i.addClass("image_resized",s)):(i.removeStyle("width",s),i.removeClass("image_resized",s))})),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:s}=e,o=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[s])throw new u("imageresizebuttons-missing-icon",t,e);return i.set({label:a,icon:bp[s],tooltip:a,isToggleable:!0}),i.bind("isEnabled").to(this),i.bind("isOn").to(r,"value",Cp(o)),this.listenTo(i,"execute",()=>{t.execute("resizeImage",{width:o})}),i})}_registerImageResizeDropdown(e){const t=this.editor,n=t.t,i=e.find(e=>!e.value),s=s=>{const o=t.commands.get("resizeImage"),r=Kc(s,Ac),a=r.buttonView;return a.set({tooltip:n("Resize image"),commandValue:i.value,icon:bp.medium,isToggleable:!0,label:this._getOptionLabelValue(i),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(o,"value",e=>e&&e.width?e.width:this._getOptionLabelValue(i)),r.bind("isOn").to(o),r.bind("isEnabled").to(this),Xc(r,this._getResizeDropdownListItemDefinitions(e,o)),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",s),t.ui.componentFactory.add("imageResize",s)}_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,s={type:"button",model:new mu({commandName:"resizeImage",commandValue:i,label:this._getOptionLabelValue(e),withText:!0,icon:null})};s.model.bind("isOn").to(t,"value",Cp(i)),n.add(s)}),n}}function Cp(e){return t=>null===e&&t===e||t&&t.width===e}const yp=/(image|image-inline)/,kp="image_resized";class Ap extends rt{static get requires(){return[Yg]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view;t.addObserver(cp),this.listenTo(t.document,"imageLoaded",(n,i)=>{if(!i.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const s=e.editing.view.domConverter,o=s.domToView(i.target).findAncestor({classes:yp});let r=this.editor.plugins.get(Yg).getResizerByViewElement(o);if(r)return void r.redraw();const a=e.editing.mapper,l=a.toModelElement(o);r=e.plugins.get(Yg).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:l,viewElement:o,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>s.viewToDom(a.toViewElement(l.parent)),isCentered(){const e=l.getAttribute("imageStyle");return!e||"block"==e||"alignCenter"==e},onCommit(n){t.change(e=>{e.removeClass(kp,o)}),e.execute("resizeImage",{width:n})}}),r.on("updateSize",()=>{o.hasClass(kp)||t.change(e=>{e.addClass(kp,o)})}),r.bind("isEnabled").to(this)})}}var wp=o(43);oo()(wp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wp.Z.locals;class Sp{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const e=t.result;this._data=e,n(e)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ot(Sp,Qe);class Ep extends rt{static get pluginName(){return"FileRepository"}static get requires(){return[Rd]}init(){this.loaders=new Un,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return h("filerepository-no-upload-adapter"),null;const t=new Tp(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on("change:uploadTotal",()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof Tp?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((e,n)=>{e===t&&this._loadersMap.delete(n)})}_updatePendingAction(){const e=this.editor.plugins.get(Rd);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}}ot(Ep,Qe);class Tp{constructor(e,t){this.id=a(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Sp,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new u("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e}).catch(e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e})}upload(){if("idle"!=this.status)throw new u("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(e=>{t.isFulfilled=!0,n(e)}).catch(e=>{t.isFulfilled=!0,i(e)})}),t}}ot(Tp,Qe);class zp 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 Rp{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,s=this.loader,o=`Couldn't upload file: ${n.name}.`;i.addEventListener("error",()=>t(o)),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:o);const s=n.url?{default:n.url}:n.urls;e({...n,urls:s})}),i.upload&&i.upload.addEventListener("progress",e=>{e.lengthComputable&&(s.uploadTotal=e.total,s.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 $p(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function Dp(e){return new Promise((t,n)=>{const i=e.getAttribute("src");fetch(i).then(e=>e.blob()).then(e=>{const n=Pp(e,i),s=n.replace("image/",""),o=new File([e],`image.${s}`,{type:n});t(o)}).catch(e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise((t,n)=>{const i=ho.document.createElement("img");i.addEventListener("load",()=>{const e=ho.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 Fp extends rt{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=n=>{const i=new zp(n),s=e.commands.get("uploadImage"),o=e.config.get("image.upload.types"),r=$p(o);return i.set({acceptedType:o.map(e=>`image/${e}`).join(","),allowMultipleFiles:!0}),i.buttonView.set({label:t("Insert image"),icon:'',tooltip:!0}),i.buttonView.bind("isEnabled").to(s),i.on("done",(t,n)=>{const i=Array.from(n).filter(e=>r.test(e.type));i.length&&e.execute("uploadImage",{file:i})}),i};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}var Mp=o(870);oo()(Mp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mp.Z.locals;var Np=o(899);oo()(Np.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Np.Z.locals;var Lp=o(825);oo()(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,s=t.item,o=s.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const r=i.plugins.get("ImageUtils"),a=i.plugins.get(Ep),l=o?t.attributeNewValue:null,d=this.placeholder,c=i.editing.mapper.toViewElement(s),u=n.writer;if("reading"==l)return Vp(c,u),void Up(r,d,c,u);if("uploading"==l){const e=a.loaders.get(o);return Vp(c,u),void(e?(Wp(c,u),function(e,t,n,i){const s=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"),s),n.on("change:uploadedPercent",(e,t,n)=>{i.change(e=>{e.setStyle("width",n+"%",s)})})}(c,u,e,i.editing.view),function(e,t,n,i){if(i.data){const s=e.findViewImgElement(t);n.setAttribute("src",i.data,s)}}(r,c,u,e)):Up(r,d,c,u))}"complete"==l&&a.loaders.get(o)&&function(e,t,n){const i=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),i),setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(i)))},3e3)}(c,u,i.editing.view),function(e,t){Hp(e,t,"progressBar")}(c,u),Wp(c,u),function(e,t){t.removeClass("ck-appear",e)}(c,u)}}function Vp(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function Up(e,t,n,i){n.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",n);const s=e.findViewImgElement(n);s.getAttribute("src")!==t&&i.setAttribute("src",t,s),Gp(n,"placeholder")||i.insert(i.createPositionAfter(s),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(i))}function Wp(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Hp(e,t,"placeholder")}function Gp(e,t){for(const n of e.getChildren())if(n.getCustomProperty(t))return n}function Hp(e,t,n){const i=Gp(e,n);i&&t.remove(t.createRangeOn(i))}class qp extends lt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Gn(e.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),s=Object.fromEntries(n.getAttributes());t.forEach((e,t)=>{const o=n.getSelectedElement();if(t&&o&&i.isImage(o)){const t=this.editor.model.createPositionAfter(o);this._uploadImage(e,s,t)}else this._uploadImage(e,s)})}_uploadImage(e,t,n){const i=this.editor,s=i.plugins.get(Ep).createLoader(e),o=i.plugins.get("ImageUtils");s&&o.insertImage({...t,uploadId:s.id},n)}}class Yp extends rt{static get requires(){return[Ep,hu,bm,Qg]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,n=e.conversion,i=e.plugins.get(Ep),s=e.plugins.get("ImageUtils"),o=$p(e.config.get("image.upload.types")),r=new qp(e);e.commands.add("uploadImage",r),e.commands.add("imageUpload",r),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,n)=>{if(function(e){return Array.from(e.types).includes("text/html")&&""!==e.getData("text/html")}(n.dataTransfer))return;const i=Array.from(n.dataTransfer.files).filter(e=>!!e&&o.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 o=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))}(s,e.item)&&!e.item.getAttribute("uploadProcessed")).map(e=>({promise:Dp(e.item),imageElement:e.item}));if(!o.length)return;const r=new Yu(e.editing.view.document);for(const e of o){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(),s=new Set;for(const t of n)if("insert"==t.type&&"$text"!=t.name){const n=t.position.nodeAfter,o="$graveyard"==t.position.root.rootName;for(const t of Kp(e,n)){const e=t.getAttribute("uploadId");if(!e)continue;const n=i.loaders.get(e);n&&(o?s.has(e)||n.abort():(s.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,s=t.plugins.get(Ep),o=t.plugins.get(hu),r=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},t=>{t.setAttribute("uploadStatus","reading",a.get(e.id))}),e.read().then(()=>{const i=e.upload(),s=a.get(e.id);if(ps.isSafari){const e=t.editing.mapper.toViewElement(s),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",s)}),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&&o.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)}),s.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const s=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(", ");""!=s&&n.setAttribute("srcset",{data:s,width:i},t)}}function Kp(e,t){const n=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter(e=>n.isImage(e.item)).map(e=>e.item)}const Zp="italic";class Xp extends rt{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Zp}),e.model.schema.setAttributeProperties(Zp,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Zp,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Zp,new hm(e,Zp)),e.keystrokes.set("CTRL+I",Zp)}}const Jp="italic";class Qp extends rt{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Jp,n=>{const i=e.commands.get(Jp),s=new fc(n);return s.set({label:t("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute(Jp),e.editing.view.focus()}),s})}}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,s=i.document.selection;for(const e of this._definitions){const o=i.createAttributeElement("a",e.attributes,{priority:5});e.classes&&i.addClass(e.classes,o);for(const t in e.styles)i.setStyle(t,e.styles[t],o);i.setCustomProperty("link",!0,o),e.callback(t.attributeNewValue)?t.item.is("selection")?i.wrap(s.getFirstRange(),o):i.wrap(n.mapper.toViewRange(t.range),o):i.unwrap(n.mapper.toViewRange(t.range),o)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(e,t,{writer:n,mapper:i})=>{const s=i.toViewElement(t.item),o=Array.from(s.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,o):n.setAttribute(e,t,o);e.classes&&n.addClass(e.classes,o);for(const t in e.styles)n.setStyle(t,e.styles[t],o)}else{for(const[e,t]of i)"class"===e?n.removeClass(t,o):n.removeAttribute(e,o);e.classes&&n.removeClass(e.classes,o);for(const t in e.styles)n.removeStyle(t,o)}}})}}}var tf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const nf=function(e){return tf.test(e)};var sf="\\ud800-\\udfff",of="["+sf+"]",rf="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",af="\\ud83c[\\udffb-\\udfff]",lf="[^"+sf+"]",df="(?:\\ud83c[\\udde6-\\uddff]){2}",cf="[\\ud800-\\udbff][\\udc00-\\udfff]",uf="(?:"+rf+"|"+af+")?",hf="[\\ufe0e\\ufe0f]?",mf=hf+uf+"(?:\\u200d(?:"+[lf,df,cf].join("|")+")"+hf+uf+")*",gf="(?:"+[lf+rf+"?",rf,df,cf,of].join("|")+")",pf=RegExp(af+"(?="+af+")|"+gf+mf,"g");const ff=function(e){return nf(e)?function(e){return e.match(pf)||[]}(e):function(e){return e.split("")}(e)},xf=function(e){return function(t){t=Ii(t);var n=nf(t)?ff(t):void 0,i=n?n[0]:t.charAt(0),s=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]()+s}}("toUpperCase"),_f=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,If=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,vf=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,bf=/^((\w+:(\/{2,})?)|(\W))/i,jf="Ctrl+K";function Cf(e,{writer:t}){const n=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,n),n}function yf(e){return function(e){return e.replace(_f,"").match(If)}(e=String(e))?e:"#"}function kf(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function Af(e,t){const n=function(e){return vf.test(e)}(e)?"mailto:":t,i=!!n&&!bf.test(e);return e&&i?n+e:e}function wf(e){window.open(e,"_blank","noopener")}class Sf extends lt{constructor(e){super(e),this.manualDecorators=new Un,this.automaticDecorators=new ef}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||$r(t.getSelectedBlocks());kf(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,s=[],o=[];for(const e in t)t[e]?s.push(e):o.push(e);n.change(t=>{if(i.isCollapsed){const r=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=im(r,"linkHref",i.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,a),s.forEach(e=>{t.setAttribute(e,!0,a)}),o.forEach(e=>{t.removeAttribute(e,a)}),t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(""!==e){const o=ni(i.getAttributes());o.set("linkHref",e),s.forEach(e=>{o.set(e,!0)});const{end:a}=n.insertContent(t.createText(e,o),r);t.setSelection(a)}["linkHref",...s,...o].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),s.forEach(e=>{t.setAttribute(e,!0,n)}),o.forEach(e=>{t.removeAttribute(e,n)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return kf(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class Ef extends lt{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();kf(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(e=>{const s=n.isCollapsed?[im(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const t of s)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:s,defaultValue:o}){this.id=e,this.set("value"),this.defaultValue=o,this.label=t,this.attributes=n,this.classes=i,this.styles=s}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}ot(Tf,Qe);var zf=o(399);oo()(zf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),zf.Z.locals;const Of="automatic",Rf=/^(https?:)?\/\//;class $f extends rt{static get pluginName(){return"LinkEditing"}static get requires(){return[Xh,Wh,bm]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Cf}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>Cf(yf(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new Sf(e)),e.commands.add("unlink",new Ef(e));const t=function(e,t){const n={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(e=>(e.label&&n[e.label]&&(e.label=n[e.label]),e)),t}(e.t,function(e){const t=[];if(e)for(const[n,i]of Object.entries(e)){const e=Object.assign({},i,{id:`link${xf(n)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>e.mode===Of)),this._enableManualDecorators(t.filter(e=>"manual"===e.mode)),e.plugins.get(Xh).registerAttribute("linkHref"),function(e,t,n,i){const s=e.editing.view,o=new Set;s.document.registerPostFixer(n=>{const s=e.model.document.selection;let r=!1;if(s.hasAttribute(t)){const a=im(s.getFirstPosition(),t,s.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),o.add(e),r=!0)}return r}),e.conversion.for("editingDowncast").add(e=>{function t(){s.change(e=>{for(const t of o.values())e.removeClass(i,t),o.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=>Rf.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:s})=>{if(i.isInline(s)&&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(!(ps.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let n=t.domTarget;if("a"!=n.tagName.toLowerCase()&&(n=n.closest("a")),!n)return;const i=n.getAttribute("href");i&&(e.stop(),t.preventDefault(),wf(i))},{context:"$capture"}),this.listenTo(t,"enter",(e,t)=>{const i=n.selection,s=i.getSelectedElement(),o=s?s.getAttribute("linkHref"):i.getAttribute("linkHref");o&&t.domEvent.altKey&&(e.stop(),wf(o))},{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=>{Df(t,Ff(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(qu);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const e=t.document.selection;if(!e.isCollapsed)return;if(!e.hasAttribute("linkHref"))return;const i=e.getFirstPosition(),s=im(i,"linkHref",e.getAttribute("linkHref"),t);(i.isTouching(s.start)||i.isTouching(s.end))&&t.change(e=>{Df(e,Ff(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,i;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const t=e.model.document.selection;t.isCollapsed||(i?i=!1:Pf(e)&&function(e){const t=e.document.selection,n=t.getFirstPosition(),i=t.getLastPosition(),s=n.nodeAfter;if(!s)return!1;if(!s.is("$text"))return!1;if(!s.hasAttribute("linkHref"))return!1;if(s===(i.textNode||i.nodeBefore))return!0;return im(n,"linkHref",s.getAttribute("linkHref"),e).containsRange(e.createRange(n,i),!0)}(e.model)&&(n=t.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(t,[s])=>{i=!1,Pf(e)&&n&&(e.model.change(e=>{for(const[t,i]of n)e.setAttribute(t,i,s)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let s=!1,o=!1;this.listenTo(i.document,"delete",(e,t)=>{o=t.domEvent.keyCode===Is.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s=!1;const e=n.getFirstPosition(),i=n.getAttribute("linkHref");if(!i)return;const o=im(e,"linkHref",i,t);s=o.containsPosition(e)||o.end.isEqual(e)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{o&&(o=!1,s||e.model.enqueueChange(e=>{Df(e,Ff(t.schema))}))},{priority:"low"})}}function Df(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 Ff(e){return e.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}var Mf=o(827);oo()(Mf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mf.Z.locals;class Nf extends Bd{constructor(e,t){super(e);const n=e.t;this.focusTracker=new Dr,this.keystrokes=new Pr,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Dd,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),$d,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),Fd(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),Md({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new cu(this.locale,uu);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const s=new fc(this.locale);return s.set({label:e,icon:t,tooltip:!0}),s.extendTemplate({attributes:{class:n}}),i&&s.delegate("execute").to(this,i),s}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new _c(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(e,t)=>void 0===t&&void 0===e?n.defaultValue:e),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new Bd;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(e)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}var Lf=o(465);oo()(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 Dr,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(Hu),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(Cu),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:Vf,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Vf,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new Bf(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(e,t)=>{this._hideUI(),t()}),t.keystrokes.set(jf,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new Nf(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isReadOnly").to(t,"isEnabled",e=>!e),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:t}=i.urlInputView.fieldView.element,s=Af(t,n);e.execute("link",s,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=o();const s=()=>{const e=this._getSelectedLinkElement(),t=o();n&&!e||!n&&t!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=e,i=t};function o(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",s),this.listenTo(this._balloon,"change:visibleView",s)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i=null;if(t.markers.has(Vf)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(Vf)),n=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));i=e.domConverter.viewRangeToDom(n)}else i=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&wm(n))return Wf(t.getFirstPosition());{const n=t.getFirstRange().getTrimmed(),i=Wf(n.start),s=Wf(n.end);return i&&i==s&&e.createRangeIn(i).getTrimmed().isEqual(n)?i:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(Vf))t.updateMarker(Vf,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:t})=>!e.schema.isContent(t),{boundaries:n});t.addMarker(Vf,{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker(Vf,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Vf)&&e.change(e=>{e.removeMarker(Vf)})}}function Wf(e){return e.getAncestors().find(e=>function(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}(e))}const Gf=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Hf extends rt{static get requires(){return[qh]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new Zh(e.model,e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=qf(e.substr(0,e.length-1));return t?{url:t}:void 0});t.on("matched:data",(t,n)=>{const{batch:i,range:s,url:o}=n;if(!i.isTyping)return;const r=s.end.getShiftedBy(-1),a=r.getShiftedBy(-o.length),l=e.model.createRange(a,r);this._applyAutoLink(o,l)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const n=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition(),n=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=Kh(e,t),s=qf(n);if(s){const e=t.createRange(i.end.getShiftedBy(-s.length),i.end);this._applyAutoLink(s,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(s=>{const o=this.editor.config.get("link.defaultProtocol"),r=Af(e,o);s.setAttribute("linkHref",r,t),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function qf(e){const t=Gf.exec(e);return t?t[2]:null}class Yf extends lt{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,i=Array.from(n.selection.getSelectedBlocks()).filter(e=>Zf(e,t.schema)),s=void 0!==e.forceValue?!e.forceValue:this.value;t.change(e=>{if(s){let t=i[i.length-1].nextSibling,n=Number.POSITIVE_INFINITY,s=[];for(;t&&"listItem"==t.name&&0!==t.getAttribute("listIndent");){const e=t.getAttribute("listIndent");e=n;)o>s.getAttribute("listIndent")&&(o=s.getAttribute("listIndent")),s.getAttribute("listIndent")==o&&e[t?"unshift":"push"](s),s=s[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=$r(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 s=t.parent,o=n.mapper,r=n.writer;let a=o.toViewPosition(i.createPositionBefore(e));const l=tx(e.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:e.getAttribute("listIndent")}),d=e.previousSibling;if(l&&l.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=o.toViewElement(l);a=r.breakContainer(r.createPositionAfter(e))}else if(d&&"listItem"==d.name){a=o.toViewPosition(i.createPositionAt(d,"end"));const e=o.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=o.toViewPosition(i.createPositionBefore(e));if(a=ex(a),r.insert(a,s),d&&"listItem"==d.name){const e=o.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)),s=e.item.parent,o=r.createPositionAt(t,"end");Qf(r,o.nodeBefore,o.nodeAfter),r.move(r.createRangeOn(s),o),n.position=i}}else{const n=s.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const t of n.getChildren()){const n=o.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,s,s.nextSibling),Qf(r,s.previousSibling,s)}function Qf(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name||t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function ex(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function tx(e,t){const n=!!t.sameIndent,i=!!t.smallerIndent,s=t.listIndent;let o=e;for(;o&&"listItem"==o.name;){const e=o.getAttribute("listIndent");if(n&&s==e||i&&s>e)return o;o="forward"===t.direction?o.nextSibling:o.previousSibling}return null}function nx(e,t,n,i){e.ui.componentFactory.add(t,s=>{const o=e.commands.get(t),r=new fc(s);return r.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),r.on("execute",()=>{e.execute(t),e.editing.view.focus()}),r})}function ix(){const e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:Vi.call(this)}function sx(e){return(t,n,i)=>{const s=i.consumable;if(!s.test(n.item,"insert")||!s.test(n.item,"attribute:listType")||!s.test(n.item,"attribute:listIndent"))return;s.consume(n.item,"insert"),s.consume(n.item,"attribute:listType"),s.consume(n.item,"attribute:listIndent");const o=n.item;Jf(o,function(e,t){const n=t.mapper,i=t.writer,s="numbered"==e.getAttribute("listType")?"ol":"ul",o=function(e){const t=e.createContainerElement("li");return t.getFillerOffset=ix,t}(i),r=i.createContainerElement(s,null);return i.insert(i.createPositionAt(r,0),o),n.bindElements(e,o),o}(o,i),i,e)}}function ox(e,t,n){if(!n.consumable.test(t.item,e.name))return;const i=n.mapper.toViewElement(t.item),s=n.writer;s.breakContainer(s.createPositionBefore(i)),s.breakContainer(s.createPositionAfter(i));const o=i.parent,r="numbered"==t.attributeNewValue?"ol":"ul";s.rename(r,o)}function rx(e,t,n){n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(t.item).parent,s=n.writer;Qf(s,i,i.nextSibling),Qf(s,i.previousSibling,i)}function ax(e,t,n){if(n.consumable.test(t.item,e.name)&&"listItem"!=t.item.name){let e=n.mapper.toViewPosition(t.range.start);const i=n.writer,s=[];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));s.push(e)}e=i.createPositionAfter(e.parent)}if(s.length>0){for(let t=0;t0){const t=Qf(i,n,n.nextSibling);t&&t.parent==n&&e.offset--}}Qf(i,e.nodeBefore,e.nodeAfter)}}}function lx(e,t,n){const i=n.mapper.toViewPosition(t.position),s=i.nodeBefore,o=i.nodeAfter;Qf(n.writer,s,o)}function dx(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){const e=n.writer,i=e.createElement("listItem"),s=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",s,i);const o=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";if(e.setAttribute("listType",o,i),!n.safeInsert(i,t.modelCursor))return;const r=function(e,t,n){const{writer:i,schema:s}=n;let o=i.createPositionAfter(e);for(const r of t)if("ul"==r.name||"ol"==r.name)o=n.convertItem(r,o).modelCursor;else{const t=n.convertItem(r,i.createPositionAt(e,"end")),a=t.modelRange.start.nodeAfter;a&&a.is("element")&&!s.checkChild(e,a.name)&&(e=t.modelCursor.parent.is("element","listItem")?t.modelCursor.parent:gx(t.modelCursor),o=i.createPositionAfter(e))}return o}(i,t.viewItem.getChildren(),n);t.modelRange=e.createRange(t.modelCursor,r),n.updateConversionResult(i,t)}}function cx(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){const e=Array.from(t.viewItem.getChildren());for(const t of e)!t.is("element","li")&&!fx(t)&&t._remove()}}function ux(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){if(0===t.viewItem.childCount)return;const e=[...t.viewItem.getChildren()];let n=!1;for(const t of e)n&&!fx(t)&&t._remove(),fx(t)&&(n=!0)}}function hx(e){return(t,n)=>{if(n.isPhantom)return;const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const t=n.mapper.toViewElement(i),s=t.getAncestors().find(fx),o=e.createPositionAt(t,0).getWalker();for(const e of o){if("elementStart"==e.type&&e.item.is("element","li")){n.viewPosition=e.previousPosition;break}if("elementEnd"==e.type&&e.item==s){n.viewPosition=e.nextPosition;break}}}}}function mx(e,[t,n]){let i,s=t.is("documentFragment")?t.getChild(0):t;if(i=n?this.createSelection(n):this.document.selection,s&&s.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(;s&&s.is("element","listItem");)s._setAttribute("listIndent",s.getAttribute("listIndent")+e),s=s.nextSibling}}}function gx(e){const t=new Gr({startPosition:e});let n;do{n=t.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function px(e,t,n,i,s,o){const r=tx(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),a=s.mapper,l=s.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=o.createPositionAt(r,"end");c=a.toViewPosition(e)}else c=n;c=ex(c);for(const e of[...i.getChildren()])fx(e)&&(c=l.move(l.createRangeOn(e),c).end,Qf(l,e,e.nextSibling),Qf(l,e.previousSibling,e))}function fx(e){return e.is("element","ol")||e.is("element","ul")}class xx extends rt{static get pluginName(){return"ListEditing"}static get requires(){return[Eh,qh]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;e.model.document.registerPostFixer(t=>function(e,t){const n=e.document.differ.getChanges(),i=new Map;let s=!1;for(const i of n)if("insert"==i.type&&"listItem"==i.name)o(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),s=!0),n.hasAttribute("listType")&&(t.removeAttribute("listType",n),s=!0),n.hasAttribute("listStyle")&&(t.removeAttribute("listStyle",n),s=!0),n.hasAttribute("listReversed")&&(t.removeAttribute("listReversed",n),s=!0),n.hasAttribute("listStart")&&(t.removeAttribute("listStart",n),s=!0);for(const t of Array.from(e.createRangeIn(n)).filter(e=>e.item.is("element","listItem")))o(t.previousPosition)}o(i.position.getShiftedBy(i.length))}else"remove"==i.type&&"listItem"==i.name?o(i.position):("attribute"==i.type&&"listIndent"==i.attributeKey||"attribute"==i.type&&"listType"==i.attributeKey)&&o(i.range.start);for(const e of i.values())r(e),a(e);return s;function o(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 o=e.getAttribute("listIndent");if(o>n){let r;null===i?(i=o-n,r=n):(i>o&&(i=o),r=o-i),t.setAttribute("listIndent",r,e),s=!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 o=e.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>o&&(n=n.slice(0,o+1)),0!=o)if(n[o]){const i=n[o];e.getAttribute("listType")!=i&&(t.setAttribute("listType",i,e),s=!0)}else n[o]=e.getAttribute("listType");i=e,e=e.nextSibling}}}(e.model,t)),n.mapper.registerViewToModelLength("li",_x),t.mapper.registerViewToModelLength("li",_x),n.mapper.on("modelToViewPosition",hx(n.view)),n.mapper.on("viewToModelPosition",function(e){return(t,n)=>{const i=n.viewPosition,s=i.parent,o=n.mapper;if("ul"==s.name||"ol"==s.name){if(i.isAtEnd){const t=o.toModelElement(i.nodeBefore),s=o.getModelLength(i.nodeBefore);n.modelPosition=e.createPositionBefore(t).getShiftedBy(s)}else{const t=o.toModelElement(i.nodeAfter);n.modelPosition=e.createPositionBefore(t)}t.stop()}else if("li"==s.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const r=o.toModelElement(s);let a=1,l=i.nodeBefore;for(;l&&fx(l);)a+=o.getModelLength(l),l=l.previousSibling;n.modelPosition=e.createPositionBefore(r).getShiftedBy(a),t.stop()}}}(e.model)),t.mapper.on("modelToViewPosition",hx(n.view)),e.conversion.for("editingDowncast").add(t=>{t.on("insert",ax,{priority:"high"}),t.on("insert:listItem",sx(e.model)),t.on("attribute:listType:listItem",ox,{priority:"high"}),t.on("attribute:listType:listItem",rx,{priority:"low"}),t.on("attribute:listIndent:listItem",function(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent"))return;const s=i.mapper.toViewElement(n.item),o=i.writer;o.breakContainer(o.createPositionBefore(s)),o.breakContainer(o.createPositionAfter(s));const r=s.parent,a=r.previousSibling,l=o.createRangeOn(r);o.remove(l),a&&a.nextSibling&&Qf(o,a,a.nextSibling),px(n.attributeOldValue+1,n.range.start,l.start,s,i,e),Jf(n.item,s,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 s=i.mapper.toViewPosition(n.position).getLastMatchingPosition(e=>!e.item.is("element","li")),o=s.nodeAfter,r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const a=o.parent,l=a.previousSibling,d=r.createRangeOn(a),c=r.remove(d);l&&l.nextSibling&&Qf(r,l,l.nextSibling),px(i.mapper.toModelElement(o).getAttribute("listIndent")+1,n.position,d.start,o,i,e);for(const e of r.createRangeIn(c).getItems())i.mapper.unbindViewElement(e);t.stop()}}(e.model)),t.on("remove",lx,{priority:"low"})}),e.conversion.for("dataDowncast").add(t=>{t.on("insert",ax,{priority:"high"}),t.on("insert:listItem",sx(e.model))}),e.conversion.for("upcast").add(e=>{e.on("element:ul",cx,{priority:"high"}),e.on("element:ol",cx,{priority:"high"}),e.on("element:li",ux,{priority:"high"}),e.on("element:li",dx)}),e.model.on("insertContent",mx,{priority:"high"}),e.commands.add("numberedList",new Yf(e,"numbered")),e.commands.add("bulletedList",new Yf(e,"bulleted")),e.commands.add("indentList",new Xf(e,"forward")),e.commands.add("outdentList",new Xf(e,"backward"));const i=n.view.document;this.listenTo(i,"enter",(e,t)=>{const n=this.editor.model.document,i=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==i.name&&i.isEmpty&&(this.editor.execute("outdentList"),t.preventDefault(),e.stop())},{context:"li"}),this.listenTo(i,"delete",(e,t)=>{if("backward"!==t.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const i=n.getFirstPosition();if(!i.isAtStart)return;const s=i.parent;"listItem"===s.name&&(s.previousSibling&&"listItem"===s.previousSibling.name||(this.editor.execute("outdentList"),t.preventDefault(),e.stop()))},{context:"li"}),this.listenTo(e.editing.view.document,"tab",(t,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(e.execute(i),n.stopPropagation(),n.preventDefault(),t.stop())},{context:"li"})}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function _x(e){let t=1;for(const n of e.getChildren())if("ul"==n.name||"ol"==n.name)for(const e of n.getChildren())t+=_x(e);return t}class Ix extends rt{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;nx(this.editor,"numberedList",e("Numbered List"),''),nx(this.editor,"bulletedList",e("Bulleted List"),'')}}const vx="underline";class bx extends rt{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:vx}),e.model.schema.setAttributeProperties(vx,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:vx,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(vx,new hm(e,vx)),e.keystrokes.set("CTRL+U","underline")}}const jx="underline";class Cx extends rt{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(jx,n=>{const i=e.commands.get(jx),s=new fc(n);return s.set({label:t("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute(jx),e.editing.view.focus()}),s})}}class yx extends ph{}yx.builtinPlugins=[class extends rt{static get requires(){return[jh,yh]}static get pluginName(){return"Alignment"}},class extends rt{static get requires(){return[dm,um]}static get pluginName(){return"BlockQuote"}},class extends rt{static get requires(){return[gm,fm]}static get pluginName(){return"Bold"}},class extends rt{static get requires(){return[eg,Eh,rg,Rh,Yh,fg]}static get pluginName(){return"Essentials"}},class extends rt{static get requires(){return[Ag,Sg]}static get pluginName(){return"FontBackgroundColor"}},class extends rt{static get requires(){return[Tg,zg]}static get pluginName(){return"FontColor"}},class extends rt{static get requires(){return[Ng,Bg]}static get pluginName(){return"Heading"}},class extends rt{static get requires(){return[fp,_p]}static get pluginName(){return"Image"}},class extends rt{static get requires(){return[vp,Ap,jp]}static get pluginName(){return"ImageResize"}},class extends rt{static get pluginName(){return"ImageUpload"}static get requires(){return[Yp,Fp,Bp]}},class extends rt{static get requires(){return[Xp,Qp]}static get pluginName(){return"Italic"}},class extends rt{static get requires(){return[$f,Uf,Hf]}static get pluginName(){return"Link"}},class extends rt{static get requires(){return[xx,Ix]}static get pluginName(){return"List"}},Dg,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 Rp(t,e):h("simple-upload-adapter-missing-uploadurl"))}},class extends rt{static get requires(){return[bx,Cx]}static get pluginName(){return"Underline"}}],yx.defaultConfig={toolbar:{items:["bold","italic","underline","|","heading","fontColor","fontBackgroundColor","alignment","|","blockQuote","bulletedList","numberedList","|","link","imageUpload","|","undo","redo"]},language:"fr"};const kx=yx})(),r.default})(),e.exports=i()},5594:(e,t,n)=>{"use strict";e.exports=n.p+"img/member-7b0dc9a7cc229b5ba65b.png"},5682:()=>{},5833:()=>{!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading","Dim grey":"Dim grey","Document colors":"Document colors",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Font Background Color":"Font Background Color","Font Color":"Font Color","Full size image":"Full size image",Green:"Green",Grey:"Grey",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Insert image":"Insert image","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block",Italic:"Italic",Justify:"Justify","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Paragraph:"Paragraph",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Save:"Save","Select all":"Select all","Show more items":"Show more items","Side image":"Side image","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","This link has no URL":"This link has no URL",Turquoise:"Turquoise",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar","Wrap text":"Wrap text",Yellow:"Yellow"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},6041:(e,t,n)=>{"use strict";e.exports=n.p+"img/logoWeezeventSquare-9184b02c60dbc8695435.png"},6400:(e,t,n)=>{"use strict";e.exports=n.p+"img/weezConstruction-fb73dc7a26ba038c44b3.png"},6473:(e,t,n)=>{"use strict";var i=n(4848),s=(n(8630),n(9191));function o(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(2664);function c(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function u(e){return(e||"").trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function h(e,t={}){const n=t.replacer??l.Dash,i=c(e).trim().toLowerCase().replace(/['"]+/gi,"");let s;return s=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?s.replace(/^(\d)/,"_$1"):s}function m(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 g(e){return!m(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 p=e=>m(e)?e[0].toUpperCase()+e.slice(1):"";function f(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").split(" ").map(e=>p(e)).join(" ").split("-").map(e=>p(e.trim())).join("-")}function x(e,t){const n=(e,t,n,i,s)=>en?n+1:e+1:i===s?t:t+1;if(e===t)return 0;if(e.length>t.length){const n=e;e=t,t=n}let i=e.length,s=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(s-1);)i--,s--;let o=0;for(;o{if("object"==typeof window&&void 0!==window[e])return window[e];if(void 0!==v?.[e])return v[e];throw new Error(`Missing env. var. ${e}`)},j=e=>"object"==typeof window&&void 0!==window[e]?window[e]:void 0!==v?.[e]?v[e]:void 0,C=e=>{const t=b(e);return"boolean"==typeof t?t:"true"===t},y=b("HEAVENT_APPLICATION_DOMAIN"),k=j("HEAVENT_RESOURCES_DOMAIN")??y,A=j("HEAVENT_ASSETS_DOMAIN")??k,w=j("HEAVENT_APP_SUBDOMAIN")??"app",S=j("HEAVENT_API_SUBDOMAIN")??"api",E=j("HEAVENT_PUBLIC_SUBDOMAIN")??"event",T=j("HEAVENT_INVOICES_SUBDOMAIN")??"invoices",z=j("HEAVENT_ASSETS_SUBDOMAIN")??"assets",O=j("HEAVENT_UPLOADS_SUBDOMAIN")??"uploads",R=j("HEAVENT_APPLICATION_BASENAME")??"",$=j("HEAVENT_RESOURCES_BASENAME")??"",D={ADMINS:b("HEAVENT_ADMINS"),EMAIL_FROM:b("HEAVENT_EMAIL_FROM"),EMAIL_FROM_NAME:b("HEAVENT_EMAIL_FROM_NAME"),HEAVENT_APPLICATION_DOMAIN:y,HEAVENT_RESOURCES_DOMAIN:k,HEAVENT_ASSETS_DOMAIN:A,HEAVENT_APPLICATION_BASENAME:R,HEAVENT_APP_URL:new _(j("HEAVENT_APP_DOMAIN")??y,void 0,w,j("HEAVENT_APP_BASENAME")??R),HEAVENT_API_URL:new _(j("HEAVENT_API_DOMAIN")??y,void 0,S,j("HEAVENT_API_BASENAME")??R),HEAVENT_PUBLIC_URL:new _(j("HEAVENT_PUBLIC_DOMAIN")??y,void 0,E,j("HEAVENT_PUBLIC_BASENAME")??R),HEAVENT_ASSETS_URL:new _(A,void 0,z,j("HEAVENT_ASSETS_BASENAME")??$),HEAVENT_INVOICES_URL:new _(j("HEAVENT_INVOICES_DOMAIN")??k,void 0,T,j("HEAVENT_INVOICES_BASENAME")??$),HEAVENT_UPLOADS_URL:new _(j("HEAVENT_UPLOADS_DOMAIN")??k,void 0,O,j("HEAVENT_UPLOADS_BASENAME")??$),USE_HUBSPOT:b("HEAVENT_USE_HUBSPOT"),COGNITO_USER_POOL_ID:b("HEAVENT_COGNITO_USER_POOL_ID"),COGNITO_USER_POOL_CLIENT_ID:b("HEAVENT_COGNITO_USER_POOL_CLIENT_ID"),COGNITO_DOMAIN_URL:b("HEAVENT_COGNITO_DOMAIN_URL"),COGNITO_CLIENT_CALLBACK_URL:b("HEAVENT_COGNITO_CLIENT_CALLBACK_URL")[0],USE_MIXPANEL:C("HEAVENT_USE_MIXPANEL"),MIXPANEL_TOKEN:C("HEAVENT_MIXPANEL_TOKEN"),HEAVENT_AWS_UPLOADS_BUCKET:b("HEAVENT_AWS_UPLOADS_BUCKET"),LOG_TOKEN:b("HEAVENT_LOG_TOKEN"),WEEZEVENT_DOMAIN:b("HEAVENT_WEEZEVENT_DOMAIN")},P="x-heavent-commit-sha",F="x-user-token";var M=n(6540),N=n(5002);function L(){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 B="heavent-user-session-key",V="heavent-user-email",U="UserNotFoundException";let W=null;const G=()=>(null===W&&(W=new N.NE({UserPoolId:D.COGNITO_USER_POOL_ID,ClientId:D.COGNITO_USER_POOL_CLIENT_ID})),W);function H(){return new Promise((e,t)=>{const n=G().getCurrentUser();null!==n?n.getSession((i,s)=>{i||!1===s?.isValid()?t(new Error("Could not get current user")):e({user:n,token:s.getIdToken().getJwtToken()})}):t(new Error("Could not get current user"))})}async function q(){try{const e=localStorage.getItem("heavent-test-token");return m(e)?e:(await H()).token}catch{return}}function Y(e,t){const n=e.trim().toLowerCase();return new Promise((e,i)=>{const s=[new N.HB({Name:"email",Value:n})];G().signUp(n,t,s,[],(t,n)=>{t?i(t):e(n.user)})})}function K(){H().then(({user:e})=>{e.signOut(),location.reload()}).catch(()=>{alert("Something wrong happened ")})}function Z(e,t,n){return new Promise((i,s)=>{const o=new N.TU({Username:e,Pool:G()}),r=new N.By({Username:e}),a={onSuccess(e){t(e.getIdToken().getJwtToken())},onFailure(e){e.code===U?s(U):n(e)},customChallenge(){localStorage.setItem(V,e),localStorage.setItem(B,o.Session),i({user:o,callbacks:a})}};o.setAuthenticationFlowType("CUSTOM_AUTH"),o.initiateAuth(r,a)})}function X(e,t){return new Promise((n,i)=>{new N.TU({Username:e,Pool:G()}).authenticateUser(new N.By({Username:e,Password:t}),{onSuccess(e){n(e.getIdToken().getJwtToken())},onFailure(e){i(e)}})})}function J(e){return new Promise((t,n)=>{new N.TU({Username:e,Pool:G()}).forgotPassword({onSuccess(){t(!0)},async onFailure(i){if(i.code===U)try{await Y(e,L()),await J(e),t(!0)}catch(e){n(e)}else n(i)}})})}function Q(e,t,n){return new Promise((i,s)=>{new N.TU({Username:e,Pool:G()}).confirmPassword(t,n,{async onSuccess(){i(await X(e,n))},onFailure(e){s(e)}})})}var ee,te,ne,ie,se,oe,re,ae,le,de,ce,ue,he,me,ge,pe,fe,xe,_e,Ie,ve,be,je,Ce,ye,ke,Ae,we,Se,Ee,Te,ze,Oe,Re,$e,De,Pe,Fe,Me,Ne,Le,Be,Ve,Ue,We,Ge,He,qe,Ye,Ke,Ze,Xe,Je,Qe,et,tt,nt,it,st,ot,rt,at,lt,dt,ct,ut,ht,mt,gt,pt,ft,xt,_t,It,vt,bt,jt,Ct,yt,kt,At,wt,St,Et,Tt,zt,Ot,Rt,$t,Dt,Pt,Ft,Mt,Nt,Lt,Bt,Vt,Ut,Wt=n(961),Gt=n(1519);!function(e){e.Delegation="Delegation",e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position",e.PositionCategory="PositionCategory"}(ee||(ee={})),function(e){e.Calendar="Calendar",e.List="List",e.Radio="Radio"}(te||(te={})),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"}(ne||(ne={})),function(e){e.Accredited="Accredited",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(ie||(ie={})),function(e){e.Accreditation="Accreditation",e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Date="Date",e.Id="Id",e.Name="Name"}(se||(se={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Index="Index",e.Name="Name"}(oe||(oe={})),function(e){e.Accredited="Accredited",e.AutoAccredited="AutoAccredited",e.NotApplicable="NotApplicable",e.Refused="Refused",e.WaitingAccreditation="WaitingAccreditation"}(re||(re={})),function(e){e.Assigned="Assigned",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(ae||(ae={})),function(e){e.InsertedAt="InsertedAt",e.Name="Name",e.State="State",e.Type="Type"}(le||(le={})),function(e){e.Done="Done",e.Draft="Draft",e.InProgress="InProgress",e.Scheduled="Scheduled",e.Template="Template"}(de||(de={})),function(e){e.Email="Email",e.Sms="Sms"}(ce||(ce={})),function(e){e.Waiting="Waiting",e.CheckedIn="CheckedIn",e.CheckedOut="CheckedOut"}(ue||(ue={})),function(e){e.CheckIn="CheckIn",e.CheckInOut="CheckInOut",e.CheckOut="CheckOut",e.Reset="Reset"}(he||(he={})),function(e){e.And="And",e.Or="Or"}(me||(me={})),function(e){e.Animajeconvention="Animajeconvention",e.Asoassignment="Asoassignment",e.Cerclelivraison="Cerclelivraison",e.Cercleopcom="Cercleopcom",e.Cerclepressandpartenaire="Cerclepressandpartenaire",e.Cerclestaff="Cerclestaff",e.Delta="Delta",e.Dfcoa4="Dfcoa4",e.Dfcosmall="Dfcosmall",e.Eurockeennes="Eurockeennes",e.Fcg="Fcg",e.Garorockplanning="Garorockplanning",e.Goldencoast="Goldencoast",e.Hbcldc="Hbcldc",e.Hbclnh="Hbclnh",e.Lnh="Lnh",e.Moorea="Moorea",e.Nuitssecretes="Nuitssecretes",e.Openbrest="Openbrest",e.P2nassignment="P2nassignment",e.P2nassignmentmontagedemontage="P2nassignmentmontagedemontage",e.P2nbadge="P2nbadge",e.Paris20km="Paris20km",e.Paris20kmassignment="Paris20kmassignment",e.Paris20kmcontremarque="Paris20kmcontremarque",e.Pastourelle="Pastourelle",e.Pastourelleexposant="Pastourelleexposant",e.Pec="Pec",e.Playground="Playground",e.Roiarthur="Roiarthur",e.Rose="Rose",e.Roseparking="Roseparking",e.Salamandre="Salamandre",e.T24assignment="T24assignment",e.Triathlonlarochellebadge="Triathlonlarochellebadge",e.Utopialesa4="Utopialesa4",e.Utopialesimprimeur="Utopialesimprimeur",e.Vandbcontremarque="Vandbcontremarque",e.Vannes="Vannes",e.Vannesassignment="Vannesassignment",e.Vendanges="Vendanges",e.Vendeeglobebadge="Vendeeglobebadge",e.Vendeeglobecontremarque="Vendeeglobecontremarque"}(ge||(ge={})),function(e){e.All="All",e.Public="Public",e.Private="Private"}(pe||(pe={})),function(e){e.Category="Category",e.Label="Label",e.Name="Name",e.Privacy="Privacy"}(fe||(fe={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Label="Label",e.Name="Name",e.Status="Status",e.Type="Type"}(xe||(xe={})),function(e){e.Accreditation="Accreditation",e.Delegation="Delegation",e.Event="Event",e.Position="Position",e.UserInfo="UserInfo"}(_e||(_e={})),function(e){e.Campaigns="Campaigns",e.CanLeadersAddMembers="CanLeadersAddMembers",e.CanLeadersDeleteMembers="CanLeadersDeleteMembers",e.CanLeadersEditColumns="CanLeadersEditColumns",e.CanLeadersEditCustomFields="CanLeadersEditCustomFields",e.CanLeadersEditMembers="CanLeadersEditMembers",e.CanLeadersImportMembers="CanLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="CanLeadersSeeHiddenAccreditationsSlots",e.Category="Category",e.Columns="Columns",e.DeadlineDate="DeadlineDate",e.Description="Description",e.Documents="Documents",e.Form="Form",e.IsLocked="IsLocked",e.MaxResources="MaxResources",e.Name="Name",e.ShowFormLinkInDelegationSpace="ShowFormLinkInDelegationSpace",e.ShowInDelegationSpace="ShowInDelegationSpace",e.Tag="Tag"}(Ie||(Ie={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(ve||(ve={})),function(e){e.Done="Done",e.Waiting="Waiting"}(be||(be={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(je||(je={})),function(e){e.Expired="Expired",e.Full="Full",e.Locked="Locked",e.Ongoing="Ongoing"}(Ce||(Ce={})),function(e){e.Failed="FAILED",e.Pending="PENDING",e.Success="SUCCESS"}(ye||(ye={})),function(e){e.OnePerPage="OnePerPage",e.GroupedA4="GroupedA4"}(ke||(ke={})),function(e){e.Name="Name"}(Ae||(Ae={})),function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.CustomBadge="CustomBadge",e.Planning="Planning",e.Position="Position",e.PositionPlanning="PositionPlanning",e.PositionsVolunteersPlanning="PositionsVolunteersPlanning",e.UserCustomDocument="UserCustomDocument",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList",e.UsersPictures="UsersPictures",e.VolunteersListing="VolunteersListing"}(we||(we={})),function(e){e.Bounced="Bounced",e.Delivered="Delivered",e.Opened="Opened",e.Queued="Queued",e.Sent="Sent",e.Waiting="Waiting"}(Se||(Se={})),function(e){e.DoesNotExist="DoesNotExist",e.NotVerified="NotVerified",e.Verified="Verified"}(Ee||(Ee={})),function(e){e.Accreditations="Accreditations",e.AccreditationsRefused="AccreditationsRefused",e.Assignments="Assignments",e.Campaign="Campaign",e.Code="Code",e.DelegationCategoryLeaderAssign="DelegationCategoryLeaderAssign",e.DelegationFormInvite="DelegationFormInvite",e.DelegationLeaderAssign="DelegationLeaderAssign",e.DelegationsImport="DelegationsImport",e.Documents="Documents",e.EventInvite="EventInvite",e.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"}(Te||(Te={})),function(e){e.EndAt="EndAt",e.Name="Name",e.StartAt="StartAt",e.Tag="Tag"}(ze||(ze={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Oe||(Oe={})),function(e){e.EndAt="EndAt",e.Id="Id",e.Name="Name",e.StartAt="StartAt"}(Re||(Re={})),(Ut=$e||($e={})).Archived="Archived",Ut.Done="Done",Ut.Ongoing="Ongoing",Ut.Upcoming="Upcoming",function(e){e.Excel="Excel",e.Csv="CSV"}(De||(De={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Pe||(Pe={})),function(e){e.Accreditation="Accreditation",e.Api="Api",e.Beta="Beta",e.Community="Community",e.CustomDocument="CustomDocument",e.Delegation="Delegation",e.Documents="Documents",e.Eid="Eid",e.KmlImport="KmlImport",e.Languages="Languages",e.Multiform="Multiform",e.Skidata="Skidata",e.Sms="Sms",e.Weezevent="Weezevent",e.Zapier="Zapier"}(Fe||(Fe={})),function(e){e.City="city",e.Country="country",e.Custom="custom",e.DateOfBirth="dateOfBirth",e.Eid="eid",e.FirstName="firstName",e.Language="language",e.LastName="lastName",e.Nationality="nationality",e.Phone="phone",e.Picture="picture",e.Population="population",e.PostalCode="postalCode",e.Sex="sex",e.Street="street"}(Me||(Me={})),function(e){e.Freeform="Freeform",e.Iban="Iban",e.Avs="Avs",e.Eid="Eid"}(Ne||(Ne={})),(Vt=Le||(Le={})).Address="Address",Vt.Checkbox="Checkbox",Vt.Country="Country",Vt.Date="Date",Vt.Datetime="Datetime",Vt.File="File",Vt.Language="Language",Vt.Nationality="Nationality",Vt.Number="Number",Vt.Phone="Phone",Vt.Select="Select",Vt.Sex="Sex",Vt.Text="Text",Vt.Textarea="Textarea",Vt.Time="Time",Vt.Validation="Validation",function(e){e.Done="Done",e.Waiting="Waiting"}(Be||(Be={})),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"}(Ve||(Ve={})),function(e){e.Field="Field",e.Section="Section",e.Text="Text"}(Ue||(Ue={})),function(e){e.Ranked="Ranked",e.Unranked="Unranked"}(We||(We={})),function(e){e.Admin="Admin",e.DelegationsSpace="DelegationsSpace",e.Form="Form"}(Ge||(Ge={})),function(e){e.CloseWhenEventDone="CloseWhenEventDone",e.Closed="Closed",e.ClosedAt="ClosedAt",e.Open="Open"}(He||(He={})),function(e){e.Backpack="Backpack",e.BadgeCheck="BadgeCheck",e.BagShopping="BagShopping",e.Bed="Bed",e.BriefcaseMedical="BriefcaseMedical",e.BurgerSoda="BurgerSoda",e.CakeCandles="CakeCandles",e.Camera="Camera",e.Car="Car",e.CircleParking="CircleParking",e.CircleQuestion="CircleQuestion",e.Droplet="Droplet",e.ForkKnife="ForkKnife",e.HatCowboy="HatCowboy",e.House="House",e.LocationDot="LocationDot",e.MartiniGlass="MartiniGlass",e.Megaphone="Megaphone",e.PersonBiking="PersonBiking",e.PersonHiking="PersonHiking",e.ScrewdriverWrench="ScrewdriverWrench",e.Shirt="Shirt",e.SignsPost="SignsPost",e.Star="Star",e.Ticket="Ticket",e.UserPolice="UserPolice"}(qe||(qe={})),function(e){e.Create="Create",e.CreateUpdate="CreateUpdate",e.Update="Update"}(Ye||(Ye={})),function(e){e.Overdue="Overdue",e.Paid="Paid",e.Refunded="Refunded",e.Waiting="Waiting"}(Ke||(Ke={})),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"}(Ze||(Ze={})),function(e){e.App="App",e.DelegationsSpace="DelegationsSpace",e.MembersSpace="MembersSpace",e.VolunteerAssignments="VolunteerAssignments",e.VolunteerRegister="VolunteerRegister"}(Xe||(Xe={})),function(e){e.Google="Google",e.GoogleSatellite="GoogleSatellite",e.IgnPlan="IgnPlan"}(Je||(Je={})),function(e){e.Add="Add",e.Delete="Delete",e.Replace="Replace"}(Qe||(Qe={})),function(e){e.Categories="Categories",e.Positions="Positions"}(et||(et={})),function(e){e.Both="Both",e.Event="Event",e.Organization="Organization"}(tt||(tt={})),function(e){e.Id="Id",e.InsertedAt="InsertedAt",e.PeriodEndAt="PeriodEndAt",e.WeezeventOrganizationId="WeezeventOrganizationId"}(nt||(nt={})),function(e){e.A4Portrait="A4Portrait",e.A4Landscape="A4Landscape",e.A5Portrait="A5Portrait",e.A6Portrait="A6Portrait"}(it||(it={})),function(e){e.Acronym="Acronym",e.Address="Address",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Latitude="Latitude",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.Traces="Traces"}(st||(st={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(ot||(ot={})),function(e){e.Done="Done",e.Waiting="Waiting"}(rt||(rt={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Position="Position",e.Range="Range"}(at||(at={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Slot="Slot"}(lt||(lt={})),function(e){e.Empty="Empty",e.Partial="Partial",e.Full="Full"}(dt||(dt={})),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"}(ct||(ct={})),function(e){e.Accreditation="Accreditation",e.None="None"}(ut||(ut={})),function(e){e.AllDays="AllDays",e.DaysWithSlots="DaysWithSlots"}(ht||(ht={})),function(e){e.Category="Category",e.Position="Position",e.Slot="Slot",e.None="None"}(mt||(mt={})),function(e){e.FilterWithSlots="FilterWithSlots",e.None="None"}(gt||(gt={})),(Bt=pt||(pt={})).Calendar="Calendar",Bt.Custom="Custom",Bt.Display="Display",Bt.DisplayDays="DisplayDays",Bt.Hide="Hide",function(e){e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position"}(ft||(ft={})),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"}(xt||(xt={})),function(e){e.Accreditations="Accreditations",e.Campaigns="Campaigns",e.CustomFields="CustomFields",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.Volunteers="Volunteers"}(_t||(_t={})),function(e){e.Female="Female",e.Male="Male",e.Nonbinary="Nonbinary",e.Notsay="Notsay",e.Other="Other"}(It||(It={})),function(e){e.Asc="Asc",e.Desc="Desc"}(vt||(vt={})),function(e){e.DelegationSpace="DelegationSpace",e.EventsShowcase="EventsShowcase",e.MembersSpace="MembersSpace"}(bt||(bt={})),function(e){e.De="De",e.En="En",e.Es="Es",e.Fr="Fr",e.Keys="Keys",e.Nl="Nl"}(jt||(jt={})),function(e){e.Accreditations="Accreditations",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.UsersInfos="UsersInfos"}(Ct||(Ct={})),function(e){e.WithReplies="WithReplies",e.WithUnreadReplies="WithUnreadReplies",e.WithoutReplies="WithoutReplies"}(yt||(yt={})),function(e){e.Delivered="Delivered",e.InvalidNumber="InvalidNumber",e.Other="Other",e.Refused="Refused",e.Sent="Sent",e.Undelivered="Undelivered",e.Waiting="Waiting"}(kt||(kt={})),function(e){e.None="None",e.Backward="Backward",e.Forward="Forward"}(At||(At={})),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"}(wt||(wt={})),function(e){e.NotTranslated="NotTranslated",e.Translated="Translated",e.TranslatedAndNotTranslated="TranslatedAndNotTranslated"}(St||(St={})),function(e){e.String="String",e.StringArray="StringArray",e.RichText="RichText"}(Et||(Et={})),function(e){e.Admin="Admin",e.Leader="Leader"}(Tt||(Tt={})),function(e){e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.Name="Name",e.UpdatedAt="UpdatedAt"}(zt||(zt={})),function(e){e.Assigned="Assigned",e.NotApplicable="NotApplicable",e.PreAssigned="PreAssigned",e.Refused="Refused",e.WaitingAssignment="WaitingAssignment"}(Ot||(Ot={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Rt||(Rt={})),function(e){e.AccreditationState="AccreditationState",e.Delegation="Delegation",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LocalId="LocalId",e.Name="Name",e.State="State",e.TeamCode="TeamCode",e.UpdatedAt="UpdatedAt"}($t||($t={})),function(e){e.AddAccreditations="AddAccreditations",e.AddEvent="AddEvent",e.CreateDelegation="CreateDelegation",e.DeleteAccreditations="DeleteAccreditations",e.SendCampaign="SendCampaign",e.SetCustomField="SetCustomField",e.DuplicateMember="DuplicateMember"}(Dt||(Dt={})),function(e){e.EveryMinute="EveryMinute",e.Every2Minutes="Every2Minutes",e.Every5Minutes="Every5Minutes",e.Every10Minutes="Every10Minutes"}(Pt||(Pt={})),function(e){e.DelegationsLeaders="DelegationsLeaders",e.PositionsLeaders="PositionsLeaders",e.UsersInfosIds="UsersInfosIds",e.View="View"}(Ft||(Ft={})),function(e){e.CreatedAt="CreatedAt",e.ExecutedAt="ExecutedAt",e.Id="Id",e.Name="Name",e.VolunteersSegment="VolunteersSegment"}(Mt||(Mt={})),function(e){e.Active="Active",e.Error="Error",e.Paused="Paused"}(Nt||(Nt={})),function(e){e.Assigned="Assigned",e.FormSubmit="FormSubmit",e.VolunteersSegment="VolunteersSegment"}(Lt||(Lt={})),Object.keys(ee);const Ht=Object.keys(te),qt=Object.keys(ne),Yt=(Object.keys(ie),Object.keys(se),Object.keys(oe),Object.keys(re)),Kt=(Object.keys(ae),Object.keys(le),Object.keys(de)),Zt=Object.keys(ce),Xt=Object.keys(ue),Jt=(Object.keys(he),Object.keys(me),Object.keys(ge)),Qt=(Object.keys(pe),Object.keys(fe)),en=(Object.keys(xe),Object.keys(_e)),tn=Object.keys(Ie),nn=(Object.keys(ve),Object.keys(be),Object.keys(je),Object.keys(Ce)),sn=(Object.keys(ye),Object.keys(ke)),on=(Object.keys(Ae),Object.keys(we),Object.keys(Se)),rn=(Object.keys(Ee),Object.keys(Te)),an=(Object.keys(ze),Object.keys(Oe),Object.keys(Re),Object.keys($e)),ln=(Object.keys(De),Object.keys(Pe),Object.keys(Fe)),dn=(Object.keys(Me),Object.keys(Ne)),cn=Object.keys(Le),un=(Object.keys(Be),Object.keys(Ve),Object.keys(Ue),Object.keys(We)),hn=(Object.keys(Ge),Object.keys(He)),mn=Object.keys(qe),gn=Object.keys(Ye),pn=Object.keys(Ke),fn=Object.keys(Ze),xn=(Object.keys(Xe),Object.keys(Je)),_n=Object.keys(Qe),In=Object.keys(et),vn=(Object.keys(tt),Object.keys(nt),Object.keys(it),Object.keys(st)),bn=(Object.keys(ot),Object.keys(rt),Object.keys(at),Object.keys(lt),Object.keys(dt)),jn=(Object.keys(ct),Object.keys(ut)),Cn=Object.keys(ht),yn=Object.keys(mt),kn=Object.keys(gt),An=Object.keys(pt),wn=Object.keys(ft),Sn=(Object.keys(xt),Object.keys(_t),Object.keys(It)),En=(Object.keys(vt),Object.keys(bt),Object.keys(jt),Object.keys(Ct),Object.keys(yt)),Tn=Object.keys(kt),zn=(Object.keys(At),Object.keys(wt)),On=Object.keys(St),Rn=(Object.keys(Et),Object.keys(Tt),Object.keys(zt),Object.keys(Ot)),$n=(Object.keys(Rt),Object.keys($t),Object.keys(Dt)),Dn=(Object.keys(Pt),Object.keys(Ft)),Pn=(Object.keys(Mt),Object.keys(Nt)),Fn=Object.keys(Lt),Mn=["insertedAt","updatedAt","checkInAt","date","sentAt","scheduledAt","deletedAt","lockedAt","bouncedAt","complaintAt","deliveredAt","rejectedAt","openedAt","clickedAt","queuedAt","closedAt","periodEndAt","checkOutAt","validatedAt","receptionDate","termsAcceptedAt","lastSeenAt","registrationDate","weezeventPairedAt","executedAt"],Nn=["date","calendarInviteStartDate","calendarInviteEndDate","startDate","endDate","deadlineDate","minAccreditationSlotDate","startAt","endAt","paidAt"],Ln=["range","ranges"],Bn=["assignedDuration","duration"];let Vn=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[s,o]of e.split(/{\d+}/).entries())n>0&&(yield(0,i.jsx)(M.Fragment,{children:t[s-1]},n)),n++,yield o}formatListValues(e,t="disjunction"){return new Intl.ListFormat(this.language.toLowerCase(),{style:"long",type:t}).format(e)}};Vn=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[String,Object])],Vn);const Un=(0,M.createContext)({}),Wn=Un.Consumer;function Gn(e){return(0,M.useContext)(Un).container.get(e)}function Hn(){const e=(0,M.useContext)(Un).container.get(Vn);return e.translate.bind(e)}function qn(){const e=(0,M.useContext)(Un).container.get(Vn);return e.interpolateWithComponents.bind(e)}function Yn(e,t,n=[]){const i="production"!==a.Test?e:e.loc.source.body;return(0,M.useContext)(Un).useQuery(i,t,n)}function Kn(e,t={}){return(0,M.useContext)(Un).useMutation(e,t)}function Zn(){return(0,M.useContext)(Un).useParams()}function Xn(){return(0,M.useContext)(Un).useHistory()}function Jn(){return(0,M.useContext)(Un).useLocation()}function Qn(){return(0,M.useContext)(Un).useLocalStorage()}const ei=e=>{const t=Zn(),n=Xn();return(0,M.useEffect)(()=>{m(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",{})},ti=(0,M.createContext)({user:null});function ni(){return(0,M.useContext)(ti)}const ii=e=>{const t=Zn(),{user:n}=ni();return n&&e.shouldHaveUser||!n&&!e.shouldHaveUser?(0,i.jsx)(i.Fragment,{children:e.children}):(0,i.jsx)(ei,{path:e.getRedirectPath(t),replace:!0})};function si(...e){console.log(...e)}const oi=e=>e.join("/"),ri=D.HEAVENT_APPLICATION_BASENAME,ai={FIELDS:{PLURAL:"fields",SINGLE:"field"}},li={AUTH:"auth",EDIT:"edit",CREATE:"create",EXPORT:"export",EXPORT_BASIC:"export/basic",EXPORT_API:"export/api",IMPORT:"import",INVITE:"invite"},di={INFORMATION:"information",DASHBOARD:"dashboard",REGISTRATION:"registration",DOCUMENTS:"documents",PROFILE:"profile",REPORTING:"reporting",FORMS:"forms",FORM:"form",MEMBER:"member",MEMBERS:"members",PREVIEW:"preview"},ci=e=>oi([e,li.AUTH]),ui=e=>oi([e,li.CREATE]),hi=e=>oi([e,li.EDIT]),mi={PLURAL:"/organizations",SINGLE:"/organization"},gi="delegations",pi={_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"}},fi="blocked",xi="expired",_i={ORGANIZATIONS:mi.PLURAL,ORGANIZATION:e=>oi([mi.SINGLE,e])},Ii={ORGANIZATIONS:_i.ORGANIZATIONS,ORGANIZATION:({organizationId:e})=>_i.ORGANIZATION(e),ORGANIZATION_SETTINGS:e=>oi([Ii.ORGANIZATION(e),pi._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE:e=>oi([Ii.ORGANIZATION_SETTINGS(e),pi.EVENTS_SHOWCASE._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN:e=>oi([Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),pi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION:e=>oi([Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),pi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS:e=>oi([Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),pi.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_MEMBERS_SPACE:e=>oi([Ii.ORGANIZATION_SETTINGS(e),pi.MEMBERS_SPACE._BASE]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN:e=>oi([Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),pi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION:e=>oi([Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),pi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES:e=>oi([Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),pi.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS:e=>oi([Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),pi.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_DELEGATION_SPACE:e=>oi([Ii.ORGANIZATION_SETTINGS(e),pi.DELEGATION_SPACE._BASE]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN:e=>oi([Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),pi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION:e=>oi([Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),pi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES:e=>oi([Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),pi.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS:e=>oi([Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),pi.COMMON.SETTINGS]),ORGANIZATION_DELEGATIONS:e=>oi([Ii.ORGANIZATION(e),gi]),IS_BLOCKED:e=>oi([e,fi]),IS_EXPIRED:e=>oi([e,xi]),ORGANIZATION_FORM:e=>Fi.FORM(e)},vi="dashboard",bi="users",ji={COMMUNITY:e=>oi([Ii.ORGANIZATION(e),"community"]),COMMUNITY_DASHBOARD:e=>oi([ji.COMMUNITY(e),vi]),COMMUNITY_USERS:e=>oi([ji.COMMUNITY(e),bi])},Ci={PLURAL:"forms",SINGLE:"form"},yi="elements",ki="emails",Ai="integration",wi="parameters",Si="preview",Ei="general",Ti="design",zi="availabilities",Oi="missions",Ri="accreditations",$i="broadcast",Di="state",Pi={FORMS:Ci.PLURAL,FORM:e=>oi([Ci.SINGLE,e])},Fi={FORMS:({eventId:e,...t})=>oi([e?Bi.EVENT({...t,eventId:e}):ji.COMMUNITY(t),Pi.FORMS]),FORM:({formId:e,...t})=>oi(["eventId"in t&&t.eventId?Bi.EVENT(t):ji.COMMUNITY(t),Pi.FORM(e)]),CREATE:e=>ui(Fi.FORMS(e)),FORM_ELEMENTS:e=>oi([Fi.FORM(e),yi]),FORM_INTEGRATION:e=>oi([Fi.FORM(e),Ai]),FORM_EMAILS:e=>oi([Fi.FORM(e),ki]),FORM_PREVIEW:e=>oi([Fi.FORM(e),Si]),FORM_PARAMETERS:e=>oi([Fi.FORM(e),wi]),FORM_PARAMETERS_GENERAL:e=>oi([Fi.FORM_PARAMETERS(e),Ei]),FORM_PARAMETERS_DESIGN:e=>oi([Fi.FORM_PARAMETERS(e),Ti]),FORM_PARAMETERS_AVAILABILITIES:e=>oi([Fi.FORM_PARAMETERS(e),zi]),FORM_PARAMETERS_MISSIONS:e=>oi([Fi.FORM_PARAMETERS(e),Oi]),FORM_PARAMETERS_ACCREDITATIONS:e=>oi([Fi.FORM_PARAMETERS(e),Ri]),FORM_PARAMETERS_BROADCAST:e=>oi([Fi.FORM_PARAMETERS(e),$i]),FORM_PARAMETERS_STATE:e=>oi([Fi.FORM_PARAMETERS(e),Di])},Mi={PLURAL:"events",SINGLE:"event"},Ni={PLURAL:"teams",SINGLE:"team"},Li={EVENTS:Mi.PLURAL,EVENT:e=>oi([Mi.SINGLE,e]),TEAM:e=>oi([Ni.SINGLE,e])},Bi={EVENTS_IMPORT:e=>oi([Ii.ORGANIZATION(e),Li.EVENTS,li.IMPORT]),EVENTS:e=>oi([Ii.ORGANIZATION(e),Li.EVENTS]),EVENT:({eventId:e,...t})=>oi([Ii.ORGANIZATION(t),Li.EVENT(e)]),EVENT_FORM:e=>oi([Fi.FORM(e)]),EVENT_TEAM_FORM:({teamCode:e,...t})=>oi([Bi.EVENT_FORM(t),Li.TEAM(e)])},Vi={PLURAL:"accreditation-categories",SINGLE:"accreditation-category"},Ui={PLURAL:"accreditations",SINGLE:"accreditation"},Wi={PLURAL:"slots",SINGLE:"slot"},Gi="dashboard",Hi="member",qi="members",Yi={ACCREDITATION_CATEGORIES:Vi.PLURAL,ACCREDITATION_CATEGORY:e=>oi([Vi.SINGLE,e]),ACCREDITATIONS:Ui.PLURAL,ACCREDITATION:e=>oi([Ui.SINGLE,e]),ACCREDITATION_SLOTS:Wi.PLURAL,ACCREDITATION_SLOT:e=>oi([Wi.SINGLE,e])},Ki={ACCREDITATION_CATEGORY:({accreditationCategoryId:e,...t})=>oi([Bi.EVENT(t),Yi.ACCREDITATION_CATEGORY(e)]),ACCREDITATION_CATEGORY_DASHBOARD:e=>oi([Ki.ACCREDITATION_CATEGORY(e),Gi]),ACCREDITATION_CATEGORY_MEMBERS:e=>oi([Ki.ACCREDITATION_CATEGORY(e),qi])},Zi={ACCREDITATIONS:e=>oi([Bi.EVENT(e),Yi.ACCREDITATIONS]),ACCREDITATION:({accreditationId:e,...t})=>oi([Bi.EVENT(t),Yi.ACCREDITATION(e)]),ACCREDITATION_DASHBOARD:e=>oi([Zi.ACCREDITATION(e),Gi]),ACCREDITATION_MEMBERS:e=>oi([Zi.ACCREDITATION(e),qi]),ACCREDITATION_MEMBER:({userInfoId:e,...t})=>oi([Zi.ACCREDITATION_MEMBERS(t),Hi,e]),ACCREDITATION_MEMBER_INFORMATION:e=>oi([Zi.ACCREDITATION_MEMBER(e),di.INFORMATION])},Xi={ACCREDITATION_SLOT:({accreditationSlotId:e,...t})=>oi([Ji.ACCREDITATION(t),Yi.ACCREDITATION_SLOT(e)]),ACCREDITATION_SLOT_DASHBOARD:e=>oi([Xi.ACCREDITATION_SLOT(e),Gi]),ACCREDITATION_SLOT_MEMBERS:e=>oi([Xi.ACCREDITATION_SLOT(e),qi])},Ji={...Ki,...Zi,...Xi},Qi={PLURAL:"delegations-categories",SINGLE:"delegation-category"},es={PLURAL:"delegations",SINGLE:"delegation"},ts="accreditations",ns="availabilities",is="positions",ss={DELEGATIONS_CATEGORIES:Qi.PLURAL,DELEGATION_CATEGORY:e=>oi([Qi.SINGLE,e]),DELEGATIONS:es.PLURAL,DELEGATION:e=>oi([es.SINGLE,e])},os={DELEGATION_CATEGORY:({delegationCategoryId:e,...t})=>oi(["eventId"in t&&t.eventId?Bi.EVENT(t):ji.COMMUNITY(t),ss.DELEGATION_CATEGORY(e)]),DELEGATION_CATEGORY_DASHBOARD:e=>oi([os.DELEGATION_CATEGORY(e),di.DASHBOARD]),DELEGATION_CATEGORY_MEMBERS:e=>oi([os.DELEGATION_CATEGORY(e),di.MEMBERS])},rs={DELEGATIONS:e=>oi(["eventId"in e&&e.eventId?Bi.EVENT(e):ji.COMMUNITY(e),ss.DELEGATIONS]),DELEGATION:({delegationId:e,...t})=>oi(["eventId"in t&&t.eventId?Bi.EVENT(t):ji.COMMUNITY(t),ss.DELEGATION(e)]),DELEGATION_DASHBOARD:e=>oi([rs.DELEGATION(e),di.DASHBOARD]),DELEGATION_MEMBERS:e=>oi([rs.DELEGATION(e),di.MEMBERS]),DELEGATION_ACCREDITATIONS:e=>oi([rs.DELEGATION(e),ts]),DELEGATION_REPORTING:e=>oi([rs.DELEGATION(e),di.REPORTING]),DELEGATION_DOCUMENTS:e=>oi([rs.DELEGATION(e),di.DOCUMENTS]),DELEGATION_MEMBERS_IMPORT:e=>oi([rs.DELEGATION(e),li.IMPORT]),DELEGATION_MEMBER:({userInfoId:e,...t})=>oi([rs.DELEGATION_MEMBERS(t),di.MEMBER,e]),DELEGATION_MEMBER_INFORMATION:e=>oi([rs.DELEGATION_MEMBER(e),di.INFORMATION]),DELEGATION_MEMBER_ACCREDITATIONS:e=>oi([rs.DELEGATION_MEMBER(e),ts]),DELEGATION_MEMBER_AVAILABILITIES:e=>oi([rs.DELEGATION_MEMBER(e),ns]),DELEGATION_MEMBER_POSITIONS:e=>oi([rs.DELEGATION_MEMBER(e),is]),MEMBERS_INVITE:e=>oi([rs.DELEGATION(e),di.MEMBERS,li.INVITE]),MEMBER_CREATE:({formId:e,...t})=>ui(oi([rs.DELEGATION(t),di.MEMBER,di.FORM,e])),MEMBER_EDIT:({formId:e,...t})=>hi(oi([rs.DELEGATION_MEMBER(t),di.FORM,e])),DELEGATION_PROFILE:e=>oi([rs.DELEGATION(e),di.PROFILE]),FIELDS_EDIT:e=>hi(oi([rs.DELEGATION(e),ai.FIELDS.PLURAL])),DELEGATION_FORM:({delegationId:e,...t})=>oi([Fi.FORM(t),ss.DELEGATION(e)])},as={...os,...rs},ls={ITEMS:{POSITIONS_CATEGORIES:{PLURAL:"position-categories",SINGLE:"position-category"},POSITIONS:{PLURAL:"positions",SINGLE:"position"},POSITION_SLOTS:{PLURAL:"slots",SINGLE:"slot"}},ACTIONS:{IMPORT:{CSV:`${li.IMPORT}/csv`}},SECTIONS:{PREASSIGNED_MEMBERS:"preassigned-members"}},ds={POSITION_CATEGORIES:ls.ITEMS.POSITIONS_CATEGORIES.PLURAL,POSITION_CATEGORY:e=>oi([ls.ITEMS.POSITIONS_CATEGORIES.SINGLE,e]),POSITIONS:ls.ITEMS.POSITIONS.PLURAL,POSITION:e=>oi([ls.ITEMS.POSITIONS.SINGLE,e]),POSITION_SLOTS:ls.ITEMS.POSITION_SLOTS.PLURAL,POSITION_SLOT:e=>oi([ls.ITEMS.POSITION_SLOTS.SINGLE,e])},cs={POSITION_CATEGORY:({positionCategoryId:e,...t})=>oi([Bi.EVENT(t),ds.POSITION_CATEGORY(e)]),POSITION_CATEGORY_DASHBOARD:e=>oi([cs.POSITION_CATEGORY(e),di.DASHBOARD]),POSITION_CATEGORY_MEMBERS:e=>oi([cs.POSITION_CATEGORY(e),di.MEMBERS]),POSITION_CATEGORY_PREASSIGNED_MEMBERS:e=>oi([cs.POSITION_CATEGORY(e),ls.SECTIONS.PREASSIGNED_MEMBERS])},us={POSITIONS:e=>oi([Bi.EVENT(e),ds.POSITIONS]),POSITION:({positionId:e,positionCategoryId:t,...n})=>oi(t?[cs.POSITION_CATEGORY({positionCategoryId:t,...n}),ds.POSITION(e)]:[Bi.EVENT(n),ds.POSITION(e)]),POSITION_DASHBOARD:e=>oi([us.POSITION(e),di.DASHBOARD]),POSITION_MEMBERS:e=>oi([us.POSITION(e),di.MEMBERS]),POSITION_PREASSIGNED_MEMBERS:e=>oi([us.POSITION(e),ls.SECTIONS.PREASSIGNED_MEMBERS]),POSITION_MEMBER:({userInfoId:e,...t})=>oi([us.POSITION_MEMBERS(t),di.MEMBER,e]),POSITION_MEMBER_INFORMATION:e=>oi([us.POSITION_MEMBER(e),di.INFORMATION]),POSITION_IMPORT_CSV:e=>oi([Bi.EVENT(e),ls.ACTIONS.IMPORT.CSV])},hs={POSITION_SLOTS:e=>oi([us.POSITION(e),ds.POSITION_SLOTS]),POSITION_SLOT:({positionSlotId:e,...t})=>oi([us.POSITION(t),ds.POSITION_SLOT(e)])},ms={...cs,...us,...hs},gs="/auth",ps=`${gs}/sign-in`,fs=`${gs}/sign-up`,xs="/backoffice",_s=e=>`${Ii.ORGANIZATION({organizationId:e})}/parameters`,Is=(e,t,n,i)=>`${ms.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/check-members`,vs=(e,t,n,i)=>`${ms.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/members`,bs=(e,t,n,i,s)=>`${ms.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/assign-volunteers/${s}`,js=(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/volunteers`,Cs=(e,t)=>`${js(e,t)}/search`,ys=(e,t,n)=>`${Cs(e,t)}/volunteer/${n}`,ks=(e,t,n)=>`${js(e,t)}/${n}`,As=(e,t,n,i)=>`${ks(e,t,n)}/volunteer/${i}`,ws=(e,t,n,i)=>`${ks(e,t,n)}/volunteer-panel/${i}`,Ss=(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/emails`,Es=(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/documents`,Ts=(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/options`,zs=(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/dashboard`,Os={HOME:`/${ri}`,UNSUBSCRIBE_EMAIL:"/unsubscribe-email",USER_UPDATE_BY_TICKET_ID:(e,t)=>`/organization/${e}/update-by-ticket-id/field/${t}`,USER_FIELD_UPDATE:(e,t,n,i)=>`/organization/${e}/user/${t}/field/${n}/update/${i}`,AUTH:gs,AUTH_FORGOT_PASSWORD:`${gs}/forgot-password`,AUTH_SIGN_IN:ps,AUTH_SIGN_UP:fs,AUTH_SIGN_IN_EMAIL:`${ps}/email`,AUTH_SIGN_IN_CODE:`${ps}/code`,AUTH_SIGN_UP_CREDENTIALS:`${fs}/credentials`,AUTH_SIGN_UP_CODE:`${fs}/code`,COGNITO_CALLBACK:"/cognito-callback",MAGIC_LINK:(e,t)=>`/magic-link/${e}/${t}`,ACCEPT_TERMS_AND_CONDITIONS:e=>`${Ii.ORGANIZATION({organizationId:e})}/accept-terms-and-conditions`,BACKOFFICE:xs,BACKOFFICE_ORGANIZATIONS:`${xs}/organizations`,EDIT_BACKOFFICE_ORGANIZATION:e=>`${xs}/organization/${e}/edit`,BACKOFFICE_INVOICES:`${xs}/invoices`,ORGANIZATION_PARAMETERS:_s,ORGANIZATION_PARAMETERS_PROFILE:e=>`${_s(e)}/profile`,ORGANIZATION_PARAMETERS_INFOS:e=>`${_s(e)}/general`,ORGANIZATION_PARAMETERS_TEAM:e=>`${_s(e)}/team`,ORGANIZATION_PARAMETERS_ROLES:e=>`${_s(e)}/roles`,CREATE_ORGANIZATION_PARAMETERS_ROLE:e=>`${_s(e)}/roles/create`,EDIT_ORGANIZATION_PARAMETERS_ROLE:(e,t)=>`${_s(e)}/roles/role/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS:e=>`${_s(e)}/emails`,CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${_s(e)}/emails/senders/create`,EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:(e,t)=>`${_s(e)}/emails/senders/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${_s(e)}/emails/senders`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW:(e,t)=>`${_s(e)}/emails/senders/${t}/preview`,ORGANIZATION_PARAMETERS_EMAILS_DNS:e=>`${_s(e)}/emails/dns`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE:e=>`${_s(e)}/delegations-space`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_DESIGN:e=>`${_s(e)}/delegations-space/design`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_INTEGRATION:e=>`${_s(e)}/delegations-space/integration`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_EMAILS:e=>`${_s(e)}/delegations-space/emails`,ORGANIZATION_PARAMETERS_CATEGORIES:e=>`${_s(e)}/categories`,ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS:e=>`${_s(e)}/categories/custom-fields`,ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS:e=>`${_s(e)}/categories/positions`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS:e=>`${_s(e)}/categories/accreditations`,ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS:e=>`${_s(e)}/categories/delegations`,ORGANIZATION_PARAMETERS_TAGS:e=>`${_s(e)}/tags`,ORGANIZATION_PARAMETERS_TRANSLATIONS:e=>`${_s(e)}/translations`,ORGANIZATION_PARAMETERS_INVOICES:e=>`${_s(e)}/invoices`,ORGANIZATION_PARAMETERS_ACTIVITY:e=>`${_s(e)}/activity`,ORGANIZATION_PARAMETERS_SKIDATA:e=>`${_s(e)}/skidata`,ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH:e=>`${_s(e)}/organization-switch`,ORGANIZATION_PARAMETERS_DELETE_ACCOUNT:e=>`${_s(e)}/delete-account`,CUSTOM_FIELDS:e=>`${Ii.ORGANIZATION({organizationId:e})}/custom-fields`,CUSTOM_FIELDS_SEGMENT:(e,t)=>`${Ii.ORGANIZATION({organizationId:e})}/custom-fields/${t}`,CUSTOM_FIELD_USAGE:(e,t,n)=>`${Ii.ORGANIZATION({organizationId:e})}/custom-fields/${t}/usage/${n}`,CREATE_CUSTOM_FIELD:(e,t)=>`${Ii.ORGANIZATION({organizationId:e})}/custom-fields/${t}/create`,EDIT_CUSTOM_FIELD:(e,t,n)=>`${Ii.ORGANIZATION({organizationId:e})}/custom-fields/${t}/edit/${n}`,COMMUNITY_USERS_SEGMENT:(e,t)=>`${Ii.ORGANIZATION({organizationId:e})}/community/users/${t}`,COMMUNITY_USERS_USER:(e,t,n)=>`${Ii.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}`,COMMUNITY_USERS_USER_INFORMATIONS:(e,t,n)=>`${Ii.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}/${di.INFORMATION}`,COMMUNITY_USERS_DUPLICATES:e=>`${Ii.ORGANIZATION({organizationId:e})}/community/users-duplicates`,COMMUNITY_EDIT_USER:(e,t)=>`${Ii.ORGANIZATION({organizationId:e})}/community/user/${t}/edit`,COMMUNITY_EDIT_USER_FORM:(e,t,n)=>`${Ii.ORGANIZATION({organizationId:e})}/community/user/${t}/edit/form/${n}`,COMMUNITY_VOLUNTEERS_IMPORT:e=>`${Ii.ORGANIZATION({organizationId:e})}/community/import`,COMMUNITY_FILES_IMPORT:e=>`${Ii.ORGANIZATION({organizationId:e})}/community/documents-import`,COMMUNITY_DELEGATIONS:e=>`${Ii.ORGANIZATION({organizationId:e})}/community/delegations`,COMMUNITY_DELEGATIONS_SEGMENT:(e,t)=>`${Ii.ORGANIZATION({organizationId:e})}/community/delegations/${t}`,COMMUNITY_DELEGATION:(e,t)=>`${Ii.ORGANIZATION({organizationId:e})}/community/delegation/${t}`,COMMUNITY_CREATE_DELEGATION(e,t){let n=`${Ii.ORGANIZATION({organizationId:e})}/community/create-delegation`;return t&&(n=`${n}/${t}`),n},COMMUNITY_EDIT_DELEGATION:(e,t)=>`${Ii.ORGANIZATION({organizationId:e})}/community/delegation/${t}/edit`,COMMUNITY_EDIT_USER_DELEGATION:(e,t,n)=>`${Ii.ORGANIZATION({organizationId:e})}/community/delegation/${t}user/${n}/edit`,COMMUNITY_EDIT_USER_DELEGATION_FORM:(e,t,n,i)=>`${Ii.ORGANIZATION({organizationId:e})}/community/delegation/${t}/user/${n}/edit/form/${i}`,CREATE_EVENT_WITH_ORGANIZATION(e){let t="/create-event";return e&&(t=`${t}/${e}`),t},CREATE_EVENT:e=>`${Ii.ORGANIZATION({organizationId:e})}/create-event`,EVENTS_SEGMENT:(e,t)=>`${Ii.ORGANIZATION({organizationId:e})}/events/${t}`,EVENT_DELEGATIONS_IMPORT:(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/delegations-import`,EVENT_VOLUNTEERS_IMPORT:(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/members-import`,EVENT_FILES_IMPORT:(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/documents-import`,EDIT_EVENT:(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/edit`,DASHBOARD:zs,DASHBOARD_EVENT_SWITCH:(e,t)=>`${zs(e,t)}/event-switch`,POSITION_MEMBERS_USER:(e,t,n,i,s)=>`${ms.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${s}`,POSITION_MEMBERS_USER_INFORMATIONS:(e,t,n,i,s)=>`${ms.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${s}/${di.INFORMATION}`,EXPORT_POSITIONS_MAP:(e,t)=>`/export/event/${e}/positions/${t}/map`,POSITIONS_SEARCH:(e,t)=>`${ms.POSITIONS({organizationId:e,eventId:t})}/search`,POSITIONS_SEGMENT:(e,t,n)=>`${ms.POSITIONS({organizationId:e,eventId:t})}/${n}`,CREATE_POSITION(e,t,n){let i=`${Bi.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)=>`${ms.POSITION({organizationId:e,eventId:t,positionId:n})}/settings`,EDIT_POSITION:(e,t,n)=>`${ms.POSITION({organizationId:e,eventId:t,positionId:n})}/edit`,POSITION_SLOT_ASSIGN_VOLUNTEERS:(e,t,n,i)=>`${ms.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/assign-volunteers`,POSITION_SLOT_ASSIGN_VOLUNTEERS_USER:bs,POSITION_SLOT_ASSIGN_VOLUNTEERS_USER_INFORMATIONS:(e,t,n,i,s)=>`${bs(e,t,n,i,s)}/${di.INFORMATION}`,POSITION_SLOT_MEMBERS:vs,POSITION_SLOT_MEMBERS_USER:(e,t,n,i,s)=>`${vs(e,t,n,i)}/${s}`,POSITION_SLOT_MEMBERS_USER_INFORMATIONS:(e,t,n,i,s)=>`${vs(e,t,n,i)}/${s}/${di.INFORMATION}`,POSITION_SLOT_MEMBERS_CHECK_OPTIONS:(e,t,n,i)=>`${vs(e,t,n,i)}/check-options`,POSITION_SLOT_CHECK_MEMBERS_CHECK_IN:(e,t,n,i)=>`${Is(e,t,n,i)}/check-in`,POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT:(e,t,n,i)=>`${Is(e,t,n,i)}/check-out`,POSITION_SLOT_CHECK_MEMBERS_RESET:(e,t,n,i)=>`${Is(e,t,n,i)}/reset`,VOLUNTEERS:js,VOLUNTEERS_SEARCH:Cs,VOLUNTEERS_SEARCH_USER:ys,VOLUNTEERS_SEARCH_USER_INFORMATIONS:(e,t,n)=>`${ys(e,t,n)}/${di.INFORMATION}`,VOLUNTEERS_SEGMENT:(e,t,n)=>`${js(e,t)}/${n}`,VOLUNTEERS_LIST_USER:As,VOLUNTEERS_LIST_USER_INFORMATIONS:(e,t,n,i)=>`${As(e,t,n,i)}/${di.INFORMATION}`,VOLUNTEERS_LIST_USER_PANEL:ws,VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS:(e,t,n,i)=>`${ws(e,t,n,i)}/accreditations`,VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES:(e,t,n,i)=>`${ws(e,t,n,i)}/availabilities`,VOLUNTEERS_LIST_USER_PANEL_POSITIONS:(e,t,n,i)=>`${ws(e,t,n,i)}/positions`,VOLUNTEERS_LIST_USER_PANEL_TEAM:(e,t,n,i,s)=>`${ws(e,t,n,i)}/team/${s}`,EDIT_USER:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit`,EDIT_USER_FORM:(e,t,n,i)=>`${Bi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit/form/${i}`,EDIT_USER_MISSIONS:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions`,EDIT_USER_MISSIONS_FORM:(e,t,n,i)=>`${Bi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions/form/${i}`,EDIT_USER_SLOTS:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots`,EDIT_USER_SLOTS_FORM:(e,t,n,i)=>`${Bi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots/form/${i}`,EDIT_USER_ACCREDITATIONS:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations`,EDIT_USER_ACCREDITATIONS_FORM:(e,t,n,i)=>`${Bi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations/form/${i}`,ASSIGNMENTS:(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/assignments`,ASSIGNMENT:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/assignment/${n}`,EDIT_ASSIGNMENT:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/edit-assignment/${n}`,TEAM_ASSIGNMENT:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/team-assignment/${n}`,PRE_ASSIGNMENT:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/pre-assignment/${n}`,ACCREDITATIONS_ASSIGNMENTS:(e,t)=>`${Bi.EVENT({organizationId:e,eventId:t})}/accreditations-assignments`,ACCREDIT:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/accredit/${n}`,EDIT_ACCREDIT:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/edit-accredit/${n}`,EVENT_EMAILS:Ss,EVENT_EMAILS_PARAMETERS:(e,t)=>`${Ss(e,t)}/parameters`,EDIT_CUSTOM_DOCUMENT:(e,t,n)=>`${Bi.EVENT({organizationId:e,eventId:t})}/custom-document/${n}/edit`,DOCUMENTS:Es,DOCUMENTS_USER_PLANNING:(e,t,n)=>`${Es(e,t)}/user-planning/${n}`,DOCUMENTS_USER_PLANNING_LIST:(e,t,n)=>`${Es(e,t)}/user-planning-list/${n}`,DOCUMENTS_USER_PLANNING_DAYS:(e,t,n)=>`${Es(e,t)}/user-planning-days/${n}`,DOCUMENTS_ASSIGNMENTS:(e,t,n)=>`${Es(e,t)}/assignments/${n}`,DOCUMENTS_VOLUNTEERS_LISTING:(e,t,n)=>`${Es(e,t)}/volunteers-listing/${n}`,DOCUMENTS_BADGE:(e,t,n,i)=>`${Es(e,t)}/user/${n}/badge/${i}`,DOCUMENTS_CERTIFICATE:(e,t,n)=>`${Es(e,t)}/user/${n}/certificate`,DOCUMENTS_HOURS:(e,t,n)=>`${Es(e,t)}/user/${n}/hours`,DOCUMENTS_POSITION_PLANNING:(e,t,n)=>`${Es(e,t)}/position-planning/${n}`,DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING:(e,t,n)=>`${Es(e,t)}/positions-volunteers-planning/${n}`,DOCUMENTS_POSITION:(e,t,n)=>`${Es(e,t)}/position/${n}`,DOCUMENTS_PLANNING:(e,t,n)=>`${Es(e,t)}/planning/${n}`,DOCUMENTS_USER_CUSTOM_DOCUMENT:(e,t,n,i)=>`${Es(e,t)}/user/${n}/custom-document/${i}`,DOCUMENTS_USERS_PICTURES:(e,t,n)=>`${Es(e,t)}/users-pictures/${n}`,OPTIONS:Ts,OPTIONS_API:(e,t)=>`${Ts(e,t)}/api`,OPTIONS_WEEZEVENT_V2:(e,t)=>`${Ts(e,t)}/weezevent-v2`,ACCREDITATIONS_SEGMENT:(e,t,n)=>`${Ji.ACCREDITATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_ACCREDITATION(e,t,n){let i=`${Bi.EVENT({organizationId:e,eventId:t})}/create-accreditation`;return n&&(i=`${i}/${n}`),i},EDIT_ACCREDITATION:(e,t,n)=>`${Ji.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n})}/edit`,ACCREDITATION_MAP:(e,t)=>`/accreditation/${e}-${t}/map`,DELEGATIONS_SEGMENT:(e,t,n)=>`${as.DELEGATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_DELEGATION(e,t,n){let i=`${Bi.EVENT({organizationId:e,eventId:t})}/create-delegation`;return n&&(i=`${i}/${n}`),i},EDIT_DELEGATION:(e,t,n)=>`${as.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/edit`,EDIT_USER_DELEGATION:(e,t,n,i)=>`${as.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/user/${i}/edit`,EDIT_USER_DELEGATION_FORM:(e,t,n,i,s)=>`${as.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/user/${i}/edit/form/${s}`},Rs=(e,t)=>`/volunteers/${e}-${t}`,$s=(e,t)=>`${Rs(e,t)}/assignments`,Ds=(e,t)=>`${Rs(e,t)}/register`,Ps=$s;var Fs=n(1343);const Ms={AccreditationChartFragment:{code:"fragment AccreditationChart on Accreditation {\n id\n name\n hasSlots\n willAutoAccredit\n\n slots(includeHidden: true) {\n date\n name\n assignedResources\n delegationsTotalResources\n maxResources\n scannedResources\n wishedResources\n }\n}\n",fragments:[]},AccreditationEmailFragment:{code:"fragment AccreditationEmail on AccreditationsUsersInfo {\n accreditationCategory {\n name\n }\n\n accreditation {\n id\n eventId\n name\n description\n address\n latitude\n longitude\n }\n\n accreditationSlot {\n name\n date\n }\n}\n",fragments:[]},AccreditationImportFragment:{code:"fragment AccreditationImport on Accreditation {\n id\n name\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n}\n",fragments:[]},AccreditationSlotMatrixFragment:{code:"fragment AccreditationSlotMatrix on AccreditationsSlot {\n id\n name\n date\n\n accreditation {\n id\n acronym\n color\n name\n index\n }\n\n accreditationCategory {\n name\n }\n}\n",fragments:[]},AccreditationSlotVolunteerRegistrationFragment:{code:"fragment AccreditationSlotVolunteerRegistration on AccreditationsSlot {\n id\n accreditationId\n name\n date\n isBlocked\n\n accreditation {\n id\n accreditationCategoryId\n acronym\n name\n color\n icon\n hiddenSlotId\n hasSlots\n index\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationsAccreditationFragment:{code:"fragment AccreditationsAccreditation on Accreditation {\n id\n name\n address\n latitude\n longitude\n acronym\n icon\n color\n fillingRate\n maxResources\n assignedResources\n willAutoAccredit\n weezeventIsSynchronized\n fields\n index\n insertedAt\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields @include(if: $includeConditions) {\n ...AccreditationsAccreditationCustomField\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsAccreditationCustomFieldFragment:{code:"fragment AccreditationsAccreditationCustomField on AccreditationsCustomField {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n}\n",fragments:[]},AccreditationsAccreditationSlotFragment:{code:"fragment AccreditationsAccreditationSlot on AccreditationsSlot {\n id\n name\n date\n maxResources\n assignedResources\n fillingRate\n isHidden\n insertedAt\n weezeventChecklistId\n\n accreditation {\n id\n name\n address\n latitude\n longitude\n acronym\n icon\n color\n fields\n\n accreditationsCustomFields @include(if: $includeConditions) {\n ...AccreditationsAccreditationCustomField\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsSlotFragment:{code:"fragment AccreditationsSlot on AccreditationsSlot {\n id\n accreditationCategoryId\n accreditationId\n eventId\n name\n date\n assignedResources\n wishedResources\n maxResources\n isBlocked\n\n accreditation {\n id\n accreditationCategoryId\n eventId\n acronym\n name\n color\n icon\n hasSlots\n accreditationDisplay\n hiddenSlotId\n index\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AssigmentEmailFragment:{code:"fragment AssigmentEmail on PositionsSlotsUsersInfo {\n id\n\n position {\n id\n eventId\n name\n description\n acronym\n color\n address\n latitude\n longitude\n zoom\n range\n layer\n fields\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n id\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n\n tags {\n name\n }\n }\n\n positionSlot {\n id\n name\n range\n }\n}\n",fragments:["LeaderAssignmentFragment"]},AttachCustomFieldFragment:{code:"fragment AttachCustomField on CustomField {\n ...CustomFieldWithCondition\n\n category {\n id\n name\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},CampaignEditFragment:{code:"fragment CampaignEdit on Campaign {\n name\n state\n campaignType\n sender\n text\n subject\n html\n replyTo\n sendToEveryone\n states\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n tagsIds\n accreditationsCategoriesIds\n accreditationsIds\n accreditationsSlotsIds\n usersInfosIds\n segmentsIds\n scheduledAt\n emailSenderId\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n\n documents {\n acl\n key\n name\n size\n }\n}\n",fragments:[]},CampaignEmailRendererFragment:{code:"fragment CampaignEmailRenderer on Campaign {\n subject\n text\n html\n replyTo\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n\n documents {\n name\n key\n }\n}\n",fragments:[]},CampaignListFragment:{code:"fragment CampaignList on Campaign {\n id\n name\n campaignType\n state\n numberOfRecipients\n cost\n sentAt\n scheduledAt\n\n createdBy {\n nameOrEmail\n }\n}\n",fragments:[]},CampaignUserInfoFragment:{code:'fragment CampaignUserInfo on UsersInfo {\n id\n name\n email\n picture {\n url\n }\n phone: fieldValue(slug: "phone")\n}\n',fragments:[]},CommentFragment:{code:"fragment Comment on Comment {\n id\n content\n insertedAt\n\n event {\n name\n }\n\n writtenBy {\n 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\n values {\n id\n value\n }\n}\n",fragments:[]},ConditionsCustomFieldsFragment:{code:"fragment ConditionsCustomFields on Organization {\n conditionsCustomFields: customFields(\n variety: UserInfo\n privacy: All\n fieldTypes: [Checkbox, Select]\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...ConditionCustomField\n }\n }\n}\n",fragments:["ConditionCustomFieldFragment"]},CreateAccreditationEventFragment:{code:"fragment CreateAccreditationEvent on Event {\n startAt\n endAt\n layer\n isWeezeventConnected\n\n accreditationsCategories {\n id\n name\n }\n}\n",fragments:[]},CreateCampaignEmailSenderFragment:{code:"fragment CreateCampaignEmailSender on EmailsSender {\n id\n name\n isValidToSendEmail\n}\n",fragments:[]},CreateCustomFieldInfosFragment:{code:"fragment CreateCustomFieldInfos on Organization {\n customFields(\n variety: UserInfo\n privacy: All\n fieldTypes: [Checkbox, Country, Language, Nationality, Select]\n ) {\n nodes {\n id\n name\n label\n fieldProperty\n fieldType\n\n values {\n id\n value\n }\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateDelegationEventFragment:{code:"fragment CreateDelegationEvent on Event {\n startAt\n endAt\n\n campaigns(states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n forms {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n ...EventAccreditations\n}\n",fragments:["CreateDelegationFormFragment","EventAccreditationsFragment"]},CreateDelegationFormFragment:{code:"fragment CreateDelegationForm on Form {\n id\n name\n}\n",fragments:[]},CreatePositionEventFragment:{code:"fragment CreatePositionEvent on Event {\n startAt\n endAt\n layer\n latitude\n longitude\n\n positionsCategories(scoped: true) {\n id\n name\n }\n\n traces {\n ...Trace\n }\n}\n",fragments:["TraceFragment"]},CreatePositionTagsFragment:{code:"fragment CreatePositionTags on Organization {\n tags {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateUpdateEventInfosFragment:{code:"fragment CreateUpdateEventInfos on Organization {\n name\n weezeventOrganizationId\n\n eventCustomFields: customFields(variety: Event) {\n nodes {\n ...AttachCustomField\n }\n }\n\n emailsSenders {\n id\n name\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n}\n",fragments:["AttachCustomFieldFragment"]},CreateUpdateMemberFormFragment:{code:"fragment CreateUpdateMemberForm on Form {\n id\n name\n description\n daysDisplay\n positionTitle\n positionSubtitle\n slotTitle\n slotSubtitle\n accreditationTitle\n accreditationSubtitle\n informationTitle\n registerButtonText\n\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n elements {\n ...FormElementDisplay\n }\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormElementDisplayFragment","FormRegisterCustomSlotPeriodFragment"]},CreatedByFragment:{code:"fragment CreatedBy on UsersInfo {\n ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},CustomBadgeVolunteerRegistrationFragment:{code:'fragment CustomBadgeVolunteerRegistration on VolunteersRegistration {\n localId\n state\n isLeader\n utid\n ticketId\n weezevent\n\n userInfo {\n id\n email\n name\n fields(expand: true)\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n formsUsersInfos(eventId: $eventId, level: Event) {\n formId\n\n slots {\n range\n }\n }\n }\n\n delegation {\n name\n\n leaders {\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n\n accreditationsUsersInfos {\n accreditation {\n id\n name\n acronym\n color\n icon\n }\n\n accreditationSlot {\n id\n name\n date\n }\n\n accreditationCategory {\n id\n name\n }\n }\n\n positionsSlotsUsersInfos {\n ...AssigmentEmail\n }\n}\n',fragments:["UserInfoLinksFragment","AssigmentEmailFragment"]},CustomDocumentPopulationFragment:{code:"fragment CustomDocumentPopulation on CustomDocument {\n slug\n name\n populationsIds\n}\n",fragments:[]},CustomFieldFragment:{code:"fragment CustomField on CustomField {\n id\n slug\n name\n label\n variety\n fieldProperty\n fieldType\n isPrivate\n 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 value\n }\n}\n",fragments:["CreatedByFragment"]},CustomFieldImportFragment:{code:"fragment CustomFieldImport on CustomField {\n id\n name\n slug\n customFieldCategoryId\n customFieldCategoryName\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},CustomFieldWithConditionFragment:{code:"fragment CustomFieldWithCondition on CustomField {\n id\n name\n label\n description\n fieldType\n fieldSubtype\n fieldProperty\n isPrivate\n isEncrypted\n hasCondition\n conditionValue\n canSelectMultiple\n slug\n isSelectV2\n\n conditionCustomField {\n id\n name\n fieldType\n fieldProperty\n canSelectMultiple\n slug\n }\n\n document {\n url\n name\n }\n\n values {\n id\n value\n }\n}\n",fragments:[]},DelegationAccreditationSlotFragment:{code:"fragment DelegationAccreditationSlot on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n isFull\n isVisible\n\n accreditationSlot {\n date\n isBlocked\n isFull\n }\n}\n",fragments:[]},DelegationAccreditationSlotStatsFragment:{code:"fragment DelegationAccreditationSlotStats on DelegationAccreditationSlot {\n accreditationSlotId\n accreditationId\n assignedResources\n maxResources\n scannedResources\n wishedResources\n}\n",fragments:[]},DelegationAccreditationsSlotsFragment:{code:"fragment DelegationAccreditationsSlots on Delegation {\n accreditationsSlots {\n accreditationId\n accreditationSlotId\n maxResources\n assignedResources\n isDefault\n isVisible\n\n accreditationSlot {\n id\n name\n date\n isHidden\n accreditation {\n id\n name\n }\n accreditationCategoryId\n }\n }\n}\n",fragments:[]},DelegationUserProfileFragment:{code:"fragment DelegationUserProfile on Delegation {\n id\n name\n event {\n id\n name\n }\n}\n",fragments:[]},DelegationsDelegationFragment:{code:"fragment DelegationsDelegation on Delegation {\n id\n organizationId\n eventId\n name\n state\n deadlineDate\n numberOfResources @include(if: $includeResources)\n maxResources\n fillingRate @include(if: $includeResources)\n showInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersEditMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n showFormLinkInDelegationSpace\n lockedAt\n usedCustomFieldsFilled @include(if: $includeUsedCustomFieldsFilled)\n insertedAt\n\n campaigns @include(if: $includeCampaigns) {\n id\n name\n }\n\n children @include(if: $includeChildren) {\n event {\n id\n name\n }\n }\n\n customDocuments @include(if: $includeDocuments) {\n slug\n name\n }\n\n delegationCategory {\n id\n name\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n form {\n id\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n\n leaders @include(if: $includeLeaders) {\n id\n email\n name\n nameOrEmail\n }\n\n accreditationsSlots @include(if: $includeAccreditationsSlots) {\n ...DelegationAccreditationSlotStats\n }\n}\n",fragments:["DelegationAccreditationSlotStatsFragment"]},DocumentEmailPreviewFragment:{code:"fragment DocumentEmailPreview on Document {\n id\n acl\n key\n name\n size\n url\n}\n",fragments:[]},DocumentPositionPlanningFragment:{code:'fragment DocumentPositionPlanning on Event {\n position(id: $positionId) {\n name\n range\n\n slots {\n id\n range\n }\n }\n\n volunteersRegistrations(positionId: $positionId, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n\n userInfo {\n ...UserInfoContactInformation\n }\n\n slots {\n range\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n positionSlot {\n range\n }\n }\n }\n }\n}\n',fragments:["UserInfoContactInformationFragment"]},DocumentPositionSheetFragment:{code:"fragment DocumentPositionSheet on Query {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: Position) {\n id\n options\n }\n\n position(id: $positionId) {\n ...PositionPdfInfos\n\n slots {\n id\n name\n range\n }\n }\n\n volunteersRegistrations(states: [Assigned], positionId: $positionId) {\n nodes {\n ...VolunteerPdf\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","PositionPdfInfosFragment","VolunteerPdfFragment"]},DocumentPositionsPlanningFragment:{code:"fragment DocumentPositionsPlanning on Event {\n name\n\n positionsSlots(segmentId: $segmentId, date: $date) {\n nodes {\n id\n positionId\n name\n range\n\n position {\n id\n name\n color\n }\n }\n }\n\n segment(id: $segmentId) {\n name\n }\n}\n",fragments:[]},DocumentPositionsVolunteersPlanningFragment:{code:"fragment DocumentPositionsVolunteersPlanning on Event {\n name\n\n positionsSlots(segmentId: $segmentId) {\n nodes {\n id\n range\n\n position {\n id\n name\n acronym\n }\n }\n }\n\n segment(id: $segmentId) {\n name\n }\n\n volunteersRegistrations(states: [Assigned]) {\n nodes {\n id\n\n userInfo {\n ...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(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\n tags {\n name\n }\n\n document(documentType: CustomBadge, customBadge: $customBadge) {\n id\n options\n }\n\n volunteersRegistrations(segmentId: $segmentId) {\n nodes {\n ...CustomBadgeVolunteerRegistration\n }\n }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserPlanningFragment:{code:"fragment DocumentUserPlanning on Event {\n startAt\n endAt\n dayStartTime\n\n document(documentType: UserPlanning) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n localId\n ticketId\n weezevent\n\n userInfo {\n ...UserInfoDocument\n }\n\n positionsSlotsUsersInfos {\n ...PsuiUserPlanning\n }\n }\n}\n",fragments:["UserInfoDocumentFragment","PsuiUserPlanningFragment"]},DocumentUserPlanningDaysFragment:{code:'fragment DocumentUserPlanningDays on Event {\n document(documentType: UserPlanningDays) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userPlanningDaysLink\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n range\n }\n\n position {\n id\n organizationId\n name\n address\n }\n }\n }\n}\n',fragments:[]},DocumentUserPlanningListFragment:{code:'fragment DocumentUserPlanningList on Event {\n document(documentType: UserPlanningList) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userPlanningListLink\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n name\n range\n }\n\n position {\n name\n }\n }\n }\n}\n',fragments:[]},DocumentUsersHoursFragment:{code:"fragment DocumentUsersHours on Event {\n timeZone\n\n document(documentType: UserHours) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n positionsSlotsUsersInfos {\n ...PsuiUserHours\n }\n\n userInfo {\n ...UserInfoDocument\n }\n }\n}\n",fragments:["PsuiUserHoursFragment","UserInfoDocumentFragment"]},DocumentUsersListingFragment:{code:"fragment DocumentUsersListing on Query {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: VolunteersListing) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n segment(id: $segmentId) {\n name\n\n links {\n usersListingLink\n }\n }\n\n volunteersRegistrations(segmentId: $segmentId) {\n nodes {\n ...VolunteerPdf\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","VolunteerPdfFragment"]},DocumentUsersPicturesFragment:{code:'fragment DocumentUsersPictures on Query {\n organization(id: $organizationId) {\n customFields(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 {\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"]},EditVolunteerRegistrationSlotFragment:{code:"fragment EditVolunteerRegistrationSlot on ISlot {\n startDate\n startTime\n endDate\n endTime\n}\n",fragments:[]},EmailRecipientFragment:{code:"fragment EmailRecipient on Email {\n id\n state\n sentAt\n infos\n\n userInfo {\n ...CampaignUserInfo\n }\n}\n",fragments:["CampaignUserInfoFragment"]},EmailSenderEmailRendererFragment:{code:"fragment EmailSenderEmailRenderer on EmailsSender {\n fromName\n fromEmail\n replyTo\n signature\n\n header {\n key\n }\n\n picture {\n key\n }\n\n footer {\n key\n }\n}\n",fragments:[]},EmailTemplateEmailRendererFragment:{code:"fragment EmailTemplateEmailRenderer on EmailsTemplate {\n useDefault\n subject\n content\n attachments\n}\n",fragments:[]},EventAccreditationsFragment:{code:"fragment EventAccreditations on Event {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n accreditationCategoryId\n name\n color\n icon\n accreditationCategoryName\n accreditationDisplay\n hasSlots\n hiddenSlotId\n index\n\n slots(includeHidden: true) {\n id\n accreditationId\n name\n date\n }\n }\n }\n}\n",fragments:[]},EventEmailRendererFragment:{code:"fragment EventEmailRenderer on Event {\n id\n organizationId\n name\n languages\n timeZone\n startAt\n endAt\n\n customDocuments {\n slug\n }\n}\n",fragments:[]},EventPositionsExportFragment:{code:"fragment EventPositionsExport on Event {\n languages\n\n segmentsFolders(segmentType: Positions) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventVolunteersExportFragment:{code:"fragment EventVolunteersExport on Event {\n languages\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventsEventFragment:{code:"fragment EventsEvent on Event {\n id\n name\n state\n startAt\n endAt\n fields\n numberOfMembers @include(if: $includeNumberOfMembers)\n numberOfMembersAccredited @include(if: $includeNumberOfMembers)\n numberOfMembersAssigned @include(if: $includeNumberOfMembers)\n\n tags {\n id\n name\n }\n}\n",fragments:[]},ExistingVolunteerFragment:{code:"fragment ExistingVolunteer on UsersInfo {\n id\n ...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 name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n}\n",fragments:[]},FormCustomFieldsFragment:{code:"fragment FormCustomFields on Organization {\n formCustomFields: customFields(\n variety: UserInfo\n privacy: Public\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...FormCustomField\n }\n }\n}\n",fragments:["FormCustomFieldFragment"]},FormElementDisplayFragment:{code:"fragment FormElementDisplay on FormsElement {\n id\n elementType\n isMandatory\n section\n text\n hasCondition\n conditionValue\n\n conditionCustomField {\n ...CustomFieldWithCondition\n }\n\n customField {\n ...CustomFieldWithCondition\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormElementsElementFragment:{code:"fragment FormElementsElement on FormsElement {\n id\n elementType\n customFieldId\n section\n text\n isMandatory\n hasCondition\n conditionCustomFieldId\n conditionValue\n}\n",fragments:[]},FormEmailFragment:{code:"fragment FormEmail on FormsUsersInfo {\n teamCode\n\n form {\n id\n areTeamsAllowed\n }\n\n ...WishesEmail\n}\n",fragments:["WishesEmailFragment"]},FormListFragment:{code:"fragment FormList on Form {\n id\n name\n numberOfCustomFields\n}\n",fragments:[]},FormMemberRegistrationFragment:{code:"fragment FormMemberRegistration on Form {\n id\n name\n isEditableInMemberSpace\n\n elements {\n id\n ...FormElementDisplay\n }\n\n ...FormSlotsOptions\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormElementDisplayFragment","FormSlotsOptionsFragment","FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormRegisterCustomSlotPeriodFragment"]},FormMissionsOptionsFragment:{code:"fragment FormMissionsOptions on Form {\n positionDisplay\n positionFilter\n positionRanking\n positionLimit\n showFullPosition\n hiddenPositionsCategoriesIds\n hiddenPositionsIds\n hiddenPositionsSlotsIds\n 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 name\n description\n color\n icon\n hiddenSlotId\n hasSlots\n accreditationDisplay\n conditionsOperator\n index\n\n slots {\n ...FormRegisterAccreditationSlot\n }\n\n conditionsCustomFields: accreditationsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n\n formCustomFields {\n isMandatory\n\n customField {\n ...CustomFieldWithCondition\n }\n }\n}\n",fragments:["FormRegisterAccreditationSlotFragment","CustomFieldWithConditionFragment"]},FormRegisterAccreditationCategoryFragment:{code:"fragment FormRegisterAccreditationCategory on IAccreditationsCategory {\n id\n name\n\n accreditations {\n ...FormRegisterAccreditation\n }\n}\n",fragments:["FormRegisterAccreditationFragment"]},FormRegisterAccreditationSlotFragment:{code:"fragment FormRegisterAccreditationSlot on IAccreditationsSlot {\n id\n name\n date\n isBlocked\n isFull\n}\n",fragments:[]},FormRegisterCategoryFragment:{code:"fragment FormRegisterCategory on IPositionsCategory {\n id\n name\n description\n\n positions {\n ...FormRegisterPosition\n }\n}\n",fragments:["FormRegisterPositionFragment"]},FormRegisterCustomSlotFragment:{code:"fragment FormRegisterCustomSlot on CustomSlot {\n name\n startTime\n endTime\n}\n",fragments:[]},FormRegisterCustomSlotPeriodFragment:{code:"fragment FormRegisterCustomSlotPeriod on CustomSlotsPeriod {\n name\n startDate\n endDate\n hideNameDates\n displayAsCalendar\n\n customSlots {\n ...FormRegisterCustomSlot\n }\n}\n",fragments:["FormRegisterCustomSlotFragment"]},FormRegisterPositionFragment:{code:"fragment FormRegisterPosition on IPosition {\n id\n name\n description\n isVisible\n conditionsOperator\n 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 name\n range\n nameOrRange\n isFull\n}\n",fragments:[]},FormSlotsOptionsFragment:{code:"fragment FormSlotsOptions on Form {\n slotDisplay\n daysDisplay\n slotTitle\n slotSubtitle\n}\n",fragments:[]},FormUserInfoUserProfileFragment:{code:"fragment FormUserInfoUserProfile on FormsUsersInfo {\n organizationId\n eventId\n formId\n insertedAt\n teamCode\n\n teamMembers {\n ...UserInfoTeamMember\n }\n}\n",fragments:["UserInfoTeamMemberFragment"]},FormUserInfoWishedFragment:{code:"fragment FormUserInfoWished on UsersInfo {\n formUserInfo(formId: $formId) {\n insertedAt\n formId\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationsSlotsIds\n\n form {\n ...FormMemberRegistration\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n slots {\n startDate\n startTime\n endDate\n endTime\n }\n }\n}\n",fragments:["FormMemberRegistrationFragment"]},FormUserOverlayFragment:{code:"fragment FormUserOverlay on Form {\n id\n name\n\n elements {\n ...FormElementDisplay\n }\n}\n",fragments:["FormElementDisplayFragment"]},FormsUsersInfosWishedFragment:{code:"fragment FormsUsersInfosWished on UsersInfo {\n formsUsersInfos(eventId: $eventId, level: Both) {\n insertedAt\n formId\n eventId\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationsSlotsIds\n\n form {\n ...FormMemberRegistration\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n index\n }\n\n accreditationCategory {\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n slots {\n startDate\n startTime\n endDate\n endTime\n range\n }\n }\n}\n",fragments:["FormMemberRegistrationFragment"]},FullPageInfoFragment:{code:"fragment FullPageInfo on PageInfo {\n hasNextPage\n hasPreviousPage\n}\n",fragments:[]},LeaderAssignmentFragment:{code:'fragment LeaderAssignment on Leader {\n userInfo {\n id\n name\n email\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n}\n',fragments:[]},LeaderInfosFragment:{code:"fragment LeaderInfos on Leader {\n role {\n id\n name\n }\n\n userInfo {\n ...LeaderUserInfo\n }\n}\n",fragments:["LeaderUserInfoFragment"]},LeaderUserInfoFragment:{code:"fragment LeaderUserInfo on UsersInfo {\n id\n userId\n ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},MassEditCustomFieldFragment:{code:"fragment MassEditCustomField on CustomField {\n id\n name\n label\n slug\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},MemberAccreditationFragment:{code:"fragment MemberAccreditation on AccreditationsUsersInfo {\n accreditationSlot {\n name\n date\n }\n\n accreditation {\n name\n description\n acronym\n hasSlots\n }\n\n accreditationCategory {\n name\n }\n}\n",fragments:[]},MemberAssignmentFragment:{code:"fragment MemberAssignment on PositionsSlotsUsersInfo {\n position {\n name\n description\n address\n latitude\n longitude\n zoom\n layer\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n\n traces {\n ...Trace\n }\n }\n\n positionSlot {\n range\n }\n}\n",fragments:["LeaderAssignmentFragment","TraceFragment"]},MemberRegistrationUserInfoFragment:{code:"fragment MemberRegistrationUserInfo on UsersInfo {\n id\n userId\n ...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 {\n id\n name\n }\n}\n",fragments:[]},OrganizationBackofficeFragment:{code:"fragment OrganizationBackoffice on Organization {\n customBadges\n features\n id\n insertedAt\n isBlocked\n name\n numberOfEvents\n periodEndAt\n weezeventOrganizationId\n useOldBilling\n membersLimit\n pricePerMember\n billingComment\n\n membersStats {\n numberOfMembers\n }\n\n membersStats2024: membersStats(year: 2024) {\n numberOfMembers\n }\n\n users {\n id\n email\n }\n}\n",fragments:[]},OrganizationCertificateDefaultFragment:{code:"fragment OrganizationCertificateDefault on Organization {\n name\n adminName\n street\n city\n postalCode\n country\n}\n",fragments:[]},OrganizationCustomFieldsFragment:{code:"fragment OrganizationCustomFields on Organization {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n}\n",fragments:["SegmentCustomFieldFragment"]},OrganizationDelegationsSpaceFragment:{code:"fragment OrganizationDelegationsSpace on IOrganization {\n name\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n delegationsSpaceDesign: spaceDesign(spaceType: DelegationSpace) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:[]},OrganizationEmailRendererFragment:{code:"fragment OrganizationEmailRenderer on Organization {\n id\n name\n datetimeFormat\n timeZone\n}\n",fragments:[]},OrganizationEventsShowcaseFragment:{code:"fragment OrganizationEventsShowcase on OrganizationPublic {\n eventsShowcaseDesign: spaceDesign(spaceType: EventsShowcase) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:[]},OrganizationMembersSpaceFragment:{code:"fragment OrganizationMembersSpace on Organization {\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n name\n\n membersSpaceDesign: spaceDesign(spaceType: MembersSpace) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:[]},PositionCategoryPositionFragment:{code:"fragment PositionCategoryPosition on Position {\n id\n assignedResources\n name\n range\n resources\n numberOfSlots\n}\n",fragments:[]},PositionPdfInfosFragment:{code:"fragment PositionPdfInfos on Position {\n id\n eventId\n name\n description\n range\n address\n latitude\n longitude\n zoom\n layer\n numberOfSlots\n assignedResources\n acronym\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n}\n",fragments:["LeaderAssignmentFragment"]},PositionPlanningFragment:{code:"fragment PositionPlanning on Position {\n id\n name\n color\n icon\n\n category {\n name\n }\n\n slots {\n id\n name\n range\n fillingRate\n assignedResources\n resources\n }\n}\n",fragments:[]},PositionPositionSlotFragment:{code:"fragment PositionPositionSlot on PositionsSlot {\n id\n positionCategoryId\n positionId\n assignedResources\n name\n range\n nameOrRange\n resources\n startDate\n startTime\n endDate\n endTime\n}\n",fragments:[]},PositionPositionsCustomFieldsFragment:{code:"fragment PositionPositionsCustomFields on Position {\n conditionsOperator\n\n conditionsCustomFields: positionsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n}\n",fragments:[]},PositionPositionsMapFragment:{code:"fragment PositionPositionsMap on Position {\n acronym\n color\n icon\n latitude\n longitude\n}\n",fragments:[]},PositionsPositionFragment:{code:"fragment PositionsPosition on Position {\n id\n name\n range\n resources\n assignedResources\n address\n latitude\n longitude\n acronym\n color\n icon\n isVisible\n state\n fillingRate\n numberOfSlots\n fields\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n\n category {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n nameOrEmail\n }\n }\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n nameOrEmail\n }\n }\n\n positionsCustomFields @include(if: $includeConditions) {\n ...PositionsPositionCustomField\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PositionsPositionCustomFieldFragment:{code:"fragment PositionsPositionCustomField on PositionsCustomField {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n}\n",fragments:[]},PositionsPositionSlotFragment:{code:"fragment PositionsPositionSlot on PositionsSlot {\n id\n name\n startDate\n startTime\n endDate\n endTime\n range\n assignedResources\n resources\n fillingRate\n state\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n\n position {\n id\n name\n fields\n acronym\n color\n icon\n address\n latitude\n longitude\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n positionsCustomFields @include(if: $includeConditions) {\n ...PositionsPositionCustomField\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PsuiUserHoursFragment:{code:"fragment PsuiUserHours on PositionsSlotsUsersInfo {\n breakTime\n checkInAt\n checkOutAt\n timeDifferenceMinutes\n\n positionSlot {\n range\n }\n\n position {\n name\n }\n}\n",fragments:[]},PsuiUserPlanningFragment:{code:"fragment PsuiUserPlanning on PositionsSlotsUsersInfo {\n id\n\n positionSlot {\n name\n range\n }\n\n position {\n name\n color\n }\n}\n",fragments:[]},SegmentCampaignFragment:{code:"fragment SegmentCampaign on Campaign {\n id\n name\n campaignType\n}\n",fragments:[]},SegmentCustomFieldFragment:{code:"fragment SegmentCustomField on CustomField {\n id\n slug\n name\n label\n fieldType\n fieldProperty\n canSelectMultiple\n customFieldCategoryId\n customFieldCategoryName\n isSelectV2\n isEncrypted\n\n values {\n id\n value\n }\n}\n",fragments:[]},SegmentEventFragment:{code:"fragment SegmentEvent on Event {\n id\n name\n}\n",fragments:[]},SegmentFormFragment:{code:"fragment SegmentForm on Form {\n id\n name\n}\n",fragments:[]},SegmentsFoldersSegmentsFragment:{code:"fragment SegmentsFoldersSegments on SegmentsFolder {\n id\n name\n\n segments {\n id\n segmentFolderId\n name\n predicates\n columns\n columnsExport\n columnsSearch\n sort\n count\n rendering\n description\n isUsedInWorkflow\n infos\n }\n}\n",fragments:[]},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 colors\n}\n",fragments:[]},TraceFragment:{code:"fragment Trace on Trace {\n id\n name\n color\n points\n direction\n}\n",fragments:[]},TracePositionsMapFragment:{code:"fragment TracePositionsMap on Trace {\n id\n color\n points\n direction\n}\n",fragments:[]},TranslationFragment:{code:"fragment Translation on Translation {\n id\n translationType\n module\n fr\n en\n es\n de\n nl\n isFrTranslated\n isEnTranslated\n isEsTranslated\n isDeTranslated\n isNlTranslated\n frString\n enString\n esString\n deString\n nlString\n}\n",fragments:[]},UpdateUserFormFragment:{code:"fragment UpdateUserForm on Form {\n id\n name\n areTeamsAllowed\n delegationsIds\n\n elements {\n ...FormElementDisplay\n }\n}\n",fragments:["FormElementDisplayFragment"]},UserAllPermissionsFragment:{code:"fragment UserAllPermissions on UsersInfo {\n usersOrganizations {\n id\n sendNotifications\n\n role {\n id\n name\n type\n }\n }\n\n usersEvents(eventId: $eventId) {\n id\n\n event {\n id\n name\n }\n\n role {\n id\n name\n type\n }\n }\n\n usersDelegations(eventId: $eventId) {\n id\n eventId\n userInfoId\n\n delegation {\n name\n }\n }\n\n usersDelegationsCategories(eventId: $eventId) {\n id\n eventId\n\n delegationCategory {\n name\n }\n\n role {\n id\n name\n }\n }\n\n usersPositionsCategories(eventId: $eventId) {\n id\n eventId\n\n positionCategory {\n name\n }\n\n role {\n id\n name\n }\n }\n\n usersPositions(eventId: $eventId) {\n id\n eventId\n\n position {\n name\n }\n\n role {\n id\n name\n }\n }\n}\n",fragments:[]},UserInfoCommunityFragment:{code:'fragment UserInfoCommunity on UsersInfo {\n id\n name\n email\n nameOrEmail\n fields\n insertedAt\n phone: fieldValue(slug: "phone")\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n picture {\n url\n }\n\n events @include(if: $includeEvents) {\n id\n name\n }\n\n delegations(level: Organization) @include(if: $includeDelegations) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n formsUsersInfos(level: Organization) @include(if: $includeForms) {\n id\n insertedAt\n\n form {\n id\n name\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n',fragments:["UserAllPermissionsFragment"]},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 ...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 email\n fields\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n user {\n id\n language\n }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoFormFragment:{code:"fragment UserInfoForm on UsersInfo {\n id\n email\n nameOrEmail\n fields\n registrationDate(eventId: $eventId)\n canAccess(formId: $formId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoLinksFragment:{code:"fragment UserInfoLinks on UserInfoDocumentLink {\n userAssignmentsLink\n userBadgeLink\n userCertificateLink\n userCustomBadgeLinks\n userCustomDocumentLinks\n userHoursLink\n userPlanningLink\n userPlanningDaysLink\n userPlanningListLink\n}\n",fragments:[]},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 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"]},UserPanelAccreditationSlotUserInfoFragment:{code:"fragment UserPanelAccreditationSlotUserInfo on AccreditationsUsersInfo {\n id\n eventId\n isAutoAccredit\n isWorkflow\n checkInAt\n insertedAt\n checkInAt\n state\n\n accreditationCategory {\n name\n }\n\n accreditation {\n id\n name\n color\n icon\n index\n }\n\n accreditationSlot {\n id\n name\n date\n }\n\n createdBy {\n email\n name\n }\n}\n",fragments:[]},UserPermissionsFragment:{code:"fragment UserPermissions on User {\n roles(organizationId: $organizationId, eventId: $eventId) {\n id\n 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 state\n timeDifferenceMinutes\n userInfoId\n\n createdBy {\n email\n name\n }\n\n position {\n id\n acronym\n color\n icon\n name\n }\n\n positionSlot {\n id\n name\n range\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:[]},VolunteerInfosFragment:{code:'fragment VolunteerInfos on VolunteersRegistration {\n delegation {\n id\n name\n }\n\n userInfo {\n id\n name\n email\n phone: fieldValue(slug: "phone")\n picture {\n url\n }\n }\n}\n',fragments:[]},VolunteerPdfFragment:{code:"fragment VolunteerPdf on VolunteersRegistration {\n teams {\n teamCode\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n fields\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationFragment:{code:"fragment VolunteerRegistration on VolunteersRegistration {\n id\n localId\n ticketId\n state\n accreditationState\n insertedAt\n canDelete\n canRegistrationStateUpdate @include(if: $includeCanRegistrationStateUpdate)\n numberOfAccreditations @include(if: $includeNumberOfAccreditations)\n numberOfAssignments @include(if: $includeNumberOfAssignments)\n numberOfAssignmentsDays @include(if: $includeNumberOfAssignmentsDays)\n numberOfAvailableDays @include(if: $includeNumberOfAvailableDays)\n shortTag\n volunteerMinutes @include(if: $includeVolunteerMinutes)\n weezeventPairedAt @include(if: $includeWeezevent)\n weezeventPayUrl @include(if: $includeWeezeventUrls)\n weezeventTicketUrl @include(if: $includeWeezeventUrls)\n\n delegation @include(if: $includeDelegation) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n userInfo {\n id\n userId\n organizationId\n ...UserInfoContactInformation\n nameOrEmail\n fields\n isEditable @include(if: $includeIsEditable)\n insertedAt\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n comments @include(if: $includeComments) {\n content\n }\n\n emails(emailTypes: [Campaign], delegationId: $delegationId) @include(if: $includeEmails) {\n id\n state\n\n campaign {\n name\n }\n }\n\n formsUsersInfos(level: Event, eventId: $eventId) @include(if: $includeFormsUsersInfos) {\n id\n insertedAt\n\n form @include(if: $includeForms) {\n id\n name\n slotDisplay\n }\n\n slots @include(if: $includeAvailability) {\n id\n range\n }\n\n teamMembers @include(if: $includeTeam) {\n ...UserInfoTeamMember\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n accreditationsUsersInfos(\n delegationId: $delegationId\n onlyVisible: $onlyVisibleAccreditationsSlots\n ) @include(if: $includeAccreditations) {\n checkInAt\n\n accreditationSlot {\n ...AccreditationSlotVolunteerRegistration\n }\n }\n\n matrixAuis: accreditationsUsersInfos(\n delegationId: $delegationId\n onlyVisible: $onlyVisibleAccreditationsSlots\n ) @include(if: $includeAccreditationsMatrix) {\n accreditationSlotId\n isAutoAccredit\n }\n\n accreditationsSlots(delegationId: $delegationId, onlyVisible: $onlyVisibleAccreditationsSlots)\n @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n matrixWishedSlots: accreditationsSlots @include(if: $includeAccreditationsMatrix) {\n id\n }\n\n 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:["UserInfoContactInformationFragment","UserAllPermissionsFragment","UserInfoLinksFragment","UserInfoTeamMemberFragment","AccreditationSlotVolunteerRegistrationFragment","UserPositionSlotUserInfoFragment"]},VolunteerRegistrationDelegationAccreditationSlotFragment:{code:"fragment VolunteerRegistrationDelegationAccreditationSlot on VolunteersRegistration {\n id\n\n accreditationsSlots {\n id\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationEmailRendererFragment:{code:'fragment VolunteerRegistrationEmailRenderer on VolunteersRegistration {\n localId\n ticketId\n weezevent\n\n delegation {\n name\n\n leaders {\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n}\n',fragments:[]},VolunteerRegistrationWaitingAssignmentFragment:{code:"fragment VolunteerRegistrationWaitingAssignment on VolunteersRegistration {\n insertedAt\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationWeezeventFragment:{code:"fragment VolunteerRegistrationWeezevent on VolunteersRegistration {\n id\n state\n accreditationState\n ticketId\n weezevent\n\n accreditationsUsersInfos {\n accreditationSlotId\n accreditationCategoryId\n\n accreditation {\n id\n name\n fields\n }\n }\n\n positionsSlotsUsersInfos {\n positionCategory {\n id\n name\n }\n\n position {\n id\n name\n }\n }\n\n delegation {\n name\n\n delegationCategory {\n name\n }\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n fieldsExpanded: fields(expand: true)\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},WishesEmailFragment:{code:"fragment WishesEmail on FormsUsersInfo {\n positionsCategories {\n name\n }\n\n positions {\n name\n }\n\n slots {\n range\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n name\n }\n }\n}\n",fragments:[]},WorkflowsWorkflowFragment:{code:"fragment WorkflowsWorkflow on Workflow {\n id\n name\n state\n trigger\n action\n executedAt\n insertedAt\n\n createdBy {\n email\n name\n }\n\n data {\n errorMessage\n }\n\n accreditationsSlots @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n campaign @include(if: $includeCampaign) {\n id\n name\n }\n\n customField @include(if: $includeCustomField) {\n id\n name\n }\n\n volunteersSegment {\n id\n name\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment"]},ZapierMemberFragment:{code:"fragment ZapierMember on UsersInfo {\n id\n fields(expand: true)\n email\n insertedAt\n updatedAt\n deletedAt\n}\n",fragments:[]}};function Ns(e){return e.flatMap(e=>[e.code].concat(Ns(e.fragments.map(e=>Ms[e]))))}function Ls(e){return(0,Fs.A)(Ns(e)).join(" ")}var Bs=n(8097);const Vs="yyyy-MM-dd",Us="yyyy-MM-dd'T'HH:mm",Ws="yyyy-MM-dd'T'HH:mm:ss";function Gs(e){const[t,n]=JSON.parse(e);return Bs.IX.fromDateTimes(Bs.c9.fromISO(t,{zone:"UTC"}),Bs.c9.fromISO(n,{zone:"UTC"}))}function Hs({startDate:e,startTime:t,endDate:n,endTime:i}){try{const[s,o]=t.split(":"),[r,a]=i.split(":");return Bs.IX.fromDateTimes(e.set({hour:parseInt(s,10),minute:parseInt(o,10)}),n.set({hour:parseInt(r,10),minute:parseInt(a,10)}))}catch{return Bs.IX.invalid("Invalid")}}function qs(e){return Bs.IX.isInterval(e)?e:Hs(e)}function Ys(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 Ks=(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 Xs(){return Bs.c9.utc().toLocal().zoneName}function Js(e){if(!0===Array.isArray(e))return e.map(e=>null!=e&&"object"==typeof e?Js(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];Nn.includes(n)||Mn.includes(n)?t[n]=i&&Bs.c9.fromISO(i,{zone:"UTC"}):Ln.includes(n)?Array.isArray(i)?t[n]=i.map(Gs):t[n]=i&&Gs(i):Bn.includes(n)?t[n]=i&&Bs.dw.fromISO(i):t[n]=null!=i&&"object"==typeof i?Js(i):i}),t}}function Qs(e){return null==e?[]:Array.isArray(e)?e:[e]}function eo(e){return Array.isArray(e)&&e.length>0}function to(e){return!eo(e)}function no(e,t,n){const i=new Set(e);return n?i.add(t):i.delete(t),Array.from(i)}function io(e,t){const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),Array.from(n)}function so(e,t,n){const i=[...e],[s]=i.splice(t,1);return i.splice(n,0,s),i}function oo(e,t){return e.filter((e,n)=>n!==t)}const ro="40eaf1d49cf16a74997a075dc05349dcfa003043\n".trim();var ao=n(7405);const lo="h-new-version";async function co(e,t={}){let n=D.HEAVENT_API_URL.href;const i=new URL(location.href).searchParams,s=`${e} ${eo(t.fragments)?Ls(t.fragments):""}`,o={"Content-Type":"application/json",[P]:ro};i.has("lang")&&(n=`${n}?lang=${i.get("lang")}`),t.token&&(o[F]=t.token);const r=await fetch(n,{method:"post",headers:o,body:JSON.stringify({query:s,variables:t.variables||{},uuid:L()})});if(r.ok){t.reloadOnNewVersion&&"true"===r.headers.get("x-heavent-new-version")&&document.body.dispatchEvent(new CustomEvent(lo,{bubbles:!0}));const e=await r.json();if(e.errors){const t=e.errors[0]?.message??"";if("You need to be logged-in"===t)return localStorage.clear(),location.href="/crew",{};if(t.startsWith("You do not have access to this"))return location.href="/crew",{};throw e.errors}{const t=(0,ao.A)(e.data),n={};return t.forEach(t=>{n[t]=Js(e.data[t])}),n}}throw new Error(r.statusText)}function uo(e,t,n){const i=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");return(0,M.useMemo)(()=>q().then(i=>co(e,{variables:t,token:i||void 0,fragments:n})),[e,i])}const ho="query CustomFieldsMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n }\n}\n",mo="query DelegationsMassEditInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n campaigns(level: $level, eventId: $eventId, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customFields(variety: Delegation, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n delegationsCategories(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n }\n}\n",go='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',po="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",fo="query Users(\n $organizationId: OrganizationId!\n $eventId: EventId\n $predicates: [Predicate!]!\n $name: String\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: UsersInfosSort\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $includeDelegations: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: usersInfos(\n predicates: $predicates\n name: $name\n columnsSearch: $columnsSearch\n delegationCategoryId: $delegationCategoryId\n delegationId: $delegationId\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...UserInfoCommunity\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",xo="query Volunteers(\n $eventId: EventId!\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n $sort: VolunteersRegistrationsSort\n $name: String\n $columnsSearch: [String!]\n $positionCategoryId: PositionsCategoryId\n $positionId: PositionId\n $preassignedPositionCategoryId: PositionsCategoryId\n $preassignedPositionId: PositionId\n $accreditationCategoryId: AccreditationsCategoryId\n $accreditationId: AccreditationId\n $accreditationSlotId: AccreditationsSlotId\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeDelegation: Boolean!\n $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 $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezevent: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n rows: volunteersRegistrations(\n predicates: $predicates\n name: $name\n columnsSearch: $columnsSearch\n positionCategoryId: $positionCategoryId\n positionId: $positionId\n preassignedPositionCategoryId: $preassignedPositionCategoryId\n preassignedPositionId: $preassignedPositionId\n accreditationCategoryId: $accreditationCategoryId\n accreditationId: $accreditationId\n accreditationSlotId: $accreditationSlotId\n delegationCategoryId: $delegationCategoryId\n delegationId: $delegationId\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...VolunteerRegistration\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",_o="mutation UserCreate {\n userCreate {\n id\n email\n }\n}\n";function Io(e){return Yn('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,[Ms.VolunteerRegistrationWaitingAssignmentFragment])}function vo(e={}){return Kn("mutation VolunteersRegistrationsMassAccredit(\n $eventId: EventId!\n $massAccredit: MassAccreditInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccredit(\n eventId: $eventId\n massAccredit: $massAccredit\n )\n}\n",e)}function bo(e={}){return Kn("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 jo(e={}){return Kn("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 Co(e){return Yn("query CreateCampaignInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId\n) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n emailsSenders {\n ...CreateCampaignEmailSender\n }\n\n event: eventMaybe(id: $eventId) {\n timeZone\n\n customDocuments {\n slug\n name\n }\n\n emailSender {\n ... on EmailsSender {\n id\n }\n }\n }\n\n userInfo: userInfoMaybe(id: $userInfoId) {\n name\n }\n }\n}\n",e,[Ms.CreateCampaignEmailSenderFragment])}function yo(e={}){return Kn("mutation AccreditationsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function ko(e={}){return Kn("mutation CustomFieldsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n numberOfEdited: customFieldsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function Ao(e,t){return co(ho,{variables:e,token:t||void 0,fragments:[]})}function wo(e={}){return Kn("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 So(e,t){return co(mo,{variables:e,token:t||void 0,fragments:[Ms.MassEditCustomFieldFragment]})}function Eo(e={}){return Kn("mutation EventsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n eventsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function To(e={}){return Kn("mutation PositionsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: positionsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function zo(e={}){return Kn("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 Oo(e,t){return co("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:[Ms.DelegationAccreditationSlotStatsFragment]})}function Ro(e={}){return Kn("mutation EventDocumentsExport(\n $eventId: EventId!\n $delegationId: DelegationId\n $documentsExport: DocumentsExportInput!\n) {\n eventDocumentsExport(\n eventId: $eventId\n delegationId: $delegationId\n documentsExport: $documentsExport\n )\n}\n",e)}function $o(e={}){return Kn("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 Do(e){return Yn("query OrganizationParametersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...OrganizationAdminInfos\n }\n}\n",e,[Ms.OrganizationAdminInfosFragment])}function Po(e={}){return Kn("mutation PositionsSlotsUsersInfosCheckIn($eventId: EventId!, $checkIn: PositionSlotCheckInInput!) {\n positionsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}function Fo(e){return Yn("query UserPositions(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n name\n startAt\n endAt\n dayStartTime\n hasFormWithPositionDisplay\n hasFormWithSlotDisplay\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n volunteerMinutes\n\n positionsSlotsUsersInfos {\n ...UserPositionSlotUserInfo\n }\n\n preassignPositions {\n id\n name\n range\n }\n\n preassignPositionsCategories {\n id\n name\n range\n }\n }\n }\n}\n",e,[Ms.FormsUsersInfosWishedFragment,Ms.UserPositionSlotUserInfoFragment])}function Mo(e,t){return co(po,{variables:e,token:t||void 0,fragments:[]})}function No(e={}){return Kn("mutation VolunteersRegistrationsMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Lo(e,t){return co("query User(\n $organizationId: OrganizationId!\n $eventId: EventId\n $id: UsersInfoId!\n $includeDelegations: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: userInfo(id: $id) {\n ...UserInfoCommunity\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ms.UserInfoCommunityFragment]})}function Bo(e,t){return co(fo,{variables:e,token:t||void 0,fragments:[Ms.UserInfoCommunityFragment]})}function Vo(e){return Yn("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 Uo(e={}){return Kn("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 Wo(e={}){return Kn("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 Go(e){return Yn("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,[Ms.FormsUsersInfosWishedFragment])}function Ho(e={}){return Kn("mutation VolunteersRegistrationsAccreditationsValidate(\n $eventId: EventId!\n $delegationId: DelegationId!\n $usersInfosIds: [UsersInfoId!]\n) {\n volunteersRegistrationsAccreditationsValidate(\n eventId: $eventId\n delegationId: $delegationId\n usersInfosIds: $usersInfosIds\n )\n}\n",e)}function qo(e={}){return Kn("mutation VolunteersRegistrationsMassAccreditationStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassAccreditationStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function Yo(e={}){return Kn("mutation VolunteersRegistrationsMassAssign($eventId: EventId!, $massAssign: MassAssignInput!) {\n numberOfMembers: volunteersRegistrationsMassAssign(eventId: $eventId, massAssign: $massAssign)\n}\n",e)}function Ko(e={}){return Kn("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 Zo(e={}){return Kn("mutation VolunteersRegistrationsMassStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function Xo(e){return Yn("query VolunteersSegments(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $privacy: CustomFieldPrivacy!\n $loadForms: Boolean!\n $loadSegments: Boolean!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n isWeezeventConnected\n\n forms @include(if: $loadForms) {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) @include(if: $loadSegments) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[Ms.SegmentCustomFieldFragment,Ms.SegmentsFoldersSegmentsFragment])}function Jo(e,t){return co("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 Qo(e={}){return Kn("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 er(e,t){return co("query Volunteer(\n $eventId: EventId!\n $id: VolunteersRegistrationId!\n $delegationId: DelegationId\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeDelegation: Boolean!\n $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 $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezevent: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n row: volunteerRegistration(id: $id) {\n ...VolunteerRegistration\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ms.VolunteerRegistrationFragment]})}function tr(e){return Yn(xo,e,[Ms.VolunteerRegistrationFragment])}function nr(e,t){return co(xo,{variables:e,token:t||void 0,fragments:[Ms.VolunteerRegistrationFragment]})}function ir(e={}){return Kn("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 sr(e={}){return Kn("mutation VolunteersRegistrationsMassWishedAccreditationsUpdate(\n $eventId: EventId!\n $delegationId: DelegationId!\n $massAccredit: MassAccreditInput!\n) {\n volunteersRegistrationsMassWishedAccreditationsUpdate(\n eventId: $eventId\n delegationId: $delegationId\n massAccredit: $massAccredit\n )\n}\n",e)}const or=()=>{const{code:e,source:t,organizationId:n,eventId:i}=Zn();return(0,M.useEffect)(()=>{const s=localStorage.getItem(V),o=localStorage.getItem(B);if(m(s)&&m(o)&&m(e)&&m(t)){localStorage.removeItem(V),localStorage.removeItem(B);const r=new N.TU({Username:s,Pool:G()});r.Session=o,r.setAuthenticationFlowType("CUSTOM_AUTH"),r.sendCustomChallengeAnswer(e,{async onSuccess(e){const s=e.getIdToken().getJwtToken();await co(_o,{token:s}),n&&i&&t===Xe.VolunteerRegister?location.href=Ds(n,i):n&&i&&t===Xe.VolunteerAssignments?location.href=Ps(n,i):t===Xe.App?location.href=Os.HOME:location.href="/"},onFailure(e){si("Could not sendCustomChallengeAnswer",e),location.href="/"}})}else location.href="/"},[]),null};var rr=n(5126);function ar(e){if(e){const[t,n,i]=e.split(" ");return{color:t,fontSize:n,fontWeight:i}}return{}}function lr(e){return"string"==typeof e?e:"number"==typeof e?e<=1?100*e+"%":`${e}px`:void 0}var dr=n(3345);const cr={mobile:"screen and (max-width: 743px)",tablet:"screen and (min-width: 744px)",desktop:"screen and (min-width: 1280px)"},ur="-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",{styled:hr,theme:mr,config:gr,getCssText:pr,createTheme:fr,keyframes:xr,reset:_r}=(0,dr.GC)({theme:{colors:{gray25:"#fcfcfd",gray50:"#f9fafb",gray100:"#f2f4f7",gray200:"#e4e7ec",gray300:"#d0d5dd",gray400:"#98a2b3",gray500:"#667085",gray600:"#475467",gray700:"#344054",gray800:"#1d2939",gray900:"#101828",grayDark50:"#f0f3f4",grayDark100:"#dfe4e7",grayDark500:"#667c8a",grayDark700:"#3d4a52",primary25:"#fcfaff",primary50:"#f8fbff",primary100:"#f0f8ff",primary200:"#eef7ff",primary300:"#dceeff",primary400:"#b3daff",primary500:"#359dfe",primary600:"#4ba7fe",primary700:"#0284fe",primary800:"#026dd6",primary900:"#01408f",error25:"#fffbfa",error50:"#fef3f2",error100:"#fee4e2",error200:"#fecdca",error300:"#fda29b",error400:"#f97066",error500:"#f04438",error600:"#d92d20",error700:"#b42318",error800:"#912018",error900:"#7a271a",warning25:"#fffcf5",warning50:"#fffaeb",warning100:"#fef0c7",warning200:"#fedf89",warning300:"#fec84b",warning400:"#fdb022",warning500:"#f79009",warning600:"#dc6803",warning700:"#b54708",warning800:"#93370d",warning900:"#7a2e0e",success25:"#f6fef9",success50:"#ecfdf3",success100:"#d1fadf",success200:"#a6f4c5",success300:"#6ce9a6",success400:"#32d583",success500:"#12b76a",success600:"#039855",success700:"#027a48",success800:"#05603a",success900:"#054f31",blue25:"#f5faff",blue50:"#edf4fd",blue100:"#dae9fb",blue200:"#b2ddff",blue300:"#84caff",blue400:"#53b1fd",blue500:"#4995ec",blue600:"#1570ef",blue700:"#1157a6",blue800:"#1849a9",blue900:"#194185",blueGray50:"#edeef8",blueGray100:"#daddf1",blueGray500:"#4352af",blueGray600:"#3e4784",blueGray700:"#29326b",blueGray900:"#272e3c",blueLight50:"#eff9fb",blueLight100:"#dff2f6",blueLight500:"#54bad1",blueLight600:"#0086C9",blueLight700:"#267a8d",purple25:"#fafaff",purple50:"#f4e7f8",purple100:"#ecd4f2",purple200:"#d9d6fe",purple300:"#bdb4fe",purple400:"#9b8afb",purple500:"#9033aa",purple600:"#6938ef",purple700:"#571f66",purple800:"#4a1fb8",purple900:"#3e1c96",purpleLight50:"#f9e7f8",purpleLight100:"#f2cef1",purpleLight500:"#9d2999",purpleLight700:"#5d185b",purpleDark50:"#f0ecf8",purpleDark100:"#ded5f0",purpleDark500:"#613eb1",purpleDark700:"#3a256a",pink25:"#fef6fb",pink50:"#fdf2fa",pink100:"#fce7f6",pink200:"#fcceee",pink300:"#faa7e0",pink400:"#f670c7",pink500:"#ee46bc",pink600:"#dd2590",pink700:"#c01574",pink800:"#9e165f",pink900:"#851651",orange50:"#fcefed",orange100:"#f9dbd7",orange500:"#e15241",orange700:"#962418",redLight50:"#fff1f3",redLight100:"#ffe4e8",redLight500:"#f63d68",redLight700:"#c01048",redDark50:"#fbeaef",redDark100:"#f7d9e2",redDark500:"#d63865",redDark700:"#871c3a",green50:"#eff6ee",green100:"#dfeedd",green500:"#67ad5c",green700:"#3c6935",greenDark50:"#eaf6f4",greenDark100:"#d5ece9",greenDark500:"#429488",greenDark700:"#275851",brown50:"#f3eeec",brown100:"#e5dbd7",brown500:"#74574a",brown700:"#44342c",white:"white"},space:{1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"32px",8:"40px",9:"48px",10:"64px",11:"80px",12:"96px",13:"128px"},fonts:{default:`'Open Sans', ${ur}`,grafik:`Graphik, ${ur}`,montserrat:`Montserrat, ${ur}`,madurai:`'Hind Madurai', ${ur}`,gravur:`'Gravur Condensed', ${ur}`,anton:`Anton, ${ur}`,brito:`'Brito Tri', ${ur}`,orbitron:`Orbitron, ${ur}`,dharma:`'Dharma Punk', ${ur}`,roboto:`Roboto, ${ur}`,poppins:`Poppins, ${ur}`,inter:`Inter, ${ur}`,paytone:`'Paytone One', ${ur}`,gothamBlack:`'Gotham Black', ${ur}`,gothamBold:`'Gotham Bold', ${ur}`,gothamBook:`'Gotham Book', ${ur}`,gothamMedium:`'Gotham Medium', ${ur}`,now:`'Now Medium', ${ur}`,franklinGothic:`'Franklin Gothic', ${ur}`,kobe:`Kobe, ${ur}`,nowMedium:`"Now Medium", ${ur}`,nowSemiBold:`"Now SemiBold", ${ur}`,badTyp:`BadTyp, ${ur}`,lemonMilk:`LemonMilk, ${ur}`,futura:`Futura, ${ur}`,urbanist:`Urbanist, ${ur}`,unbounded:`Unbounded, ${ur}`,magallanes:`Magallanes, ${ur}`,parisine:`ParisineBold, ${ur}`,bricolage:`Bricolage, ${ur}`,paris2024:`Paris2024, ${ur}`,dinCondensed:`DinCondensed, ${ur}`,gothamRoundedBook:`"Gotham Rounded Book", ${ur}`,gothamRoundedBold:`"Gotham Rounded Bold", ${ur}`,gothamRoundedMedium:`"Gotham Rounded Medium", ${ur}`,albert:`"Albert Sans", ${ur}`,bebasNeue:`BebasNeue, ${ur}`,encode:`"Encode Sans", ${ur}`,gilroy:`Gilroy, ${ur}`,tuskerGrotesk:`TuskerGrotesk, ${ur}`,rubik:`Rubik, ${ur}`,bnCartaNoirBold:`"BN Carta Noir Bold", ${ur}`,firaSans:`"Fira Sans", ${ur}`,arimo:`Arimo, ${ur}`,neueMontreal:`NeueMontreal, ${ur}`,helveticaBlackCondensed:`HelveticaBlackCondensed, ${ur}`,zuumeMedium:`"Zuume Medium", ${ur}`,zuumeBold:`"Zuume Bold", ${ur}`,formulaCondensedBold:`FormulaCondensedBold, ${ur}`,raleway:`Raleway, ${ur}`,avenir:`Avenir, ${ur}`,work:`"Work Sans", ${ur}`,movement:`Movement, ${ur}`,atrament:`Atrament, ${ur}`,sharpGrotesk:`SharpGrotesk, ${ur}`,utopiales:`Utopiales, ${ur}`,lato:`Lato, ${ur}`,helveticaNeue97BlackCondensed:`HelveticaNeue97BlackCondensed, ${ur}`,graphie:`Graphie, ${ur}`,archerBoldPro:`ArcherBoldPro, ${ur}`,acumin:`Acumin, ${ur}`,kabel:`Kabel, ${ur}`,moonstruck:`Moonstruck, ${ur}`,chillax:`Chillax, ${ur}`,neufileGrotesk:`NeufileGrotesk, ${ur}`,tungsten:`Tungsten, ${ur}`,benguiat:`benguiat, ${ur}`},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:cr,utils:{bd:e=>{let t="$gray200",n="$2",i="$xs";if(m(e)){const s=function(e){if(e){const[t,n,i]=e.split(" ");return{borderColor:t,borderRadius:n,boxShadow:i}}return{}}(e);s.borderColor&&(t=`$${s.borderColor}`),s.borderRadius&&(n=`$${s.borderRadius}`),i=s.boxShadow?`$${s.boxShadow}`:void 0}return{borderColor:t,borderRadius:n,borderStyle:"solid",borderWidth:"1px",boxShadow:i}},clamp:e=>({display:"-webkit-box",overflow:"hidden","-webkit-line-clamp":e,"-webkit-box-orient":"vertical"}),ellipsis:()=>({overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingBottom:e,paddingTop:e})}}),Ir=fr("weezcrew-theme",{}),vr=hr("div",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},gray800:{color:"$gray800"},gray900:{color:"$gray900"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primary600:{color:"$primary600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight600:{color:"$blueLight600"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}},textAlign:{start:{textAlign:"start"},end:{textAlign:"end"},center:{textAlign:"center"},justify:{textAlign:"justify"}},ellipsis:{true:{ellipsis:""}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start"}}),br=M.forwardRef((e,t)=>{const n={};return e.height&&(n.height=lr(e.height)),e.width&&(n.width=lr(e.width)),(0,i.jsx)(vr,{...(0,rr.A)(e,"font"),...ar(e.font),ref:t,css:{...n,...e.css}})});br.displayName="Box";var jr=n(4625),Cr=n(6347),yr=n(8542);function kr(e){return"number"==typeof e&&!isNaN(e)}function Ar(e,t=96){return Math.round(25.4*e/t)}function wr(e){return e?{lat:e.latitude,lng:e.longitude}:null}const Sr=wr({latitude:43.6087733,longitude:3.87963579999996}),Er=13;function Tr(e){return kr(e.latitude)&&kr(e.longitude)?(0,yr.A)(e,["latitude","longitude"]):void 0}function zr(e){return e===Je.GoogleSatellite?"satellite":e===Je.Google?"roadmap":e??Je.Google}var Or=n(6996),Rr=n(2096);function $r(){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:Je.IgnPlan,maxZoom:18})}const Dr=(0,M.memo)(e=>{const t=(0,M.useCallback)(t=>{t&&(n.current&&(s.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{zoom:e.coordinatesFieldsProps?.zoomProps.input.value??e.initialZoom??Er,center:wr(e.center)||Sr,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,mapTypeId:zr(e.layer),...e.mapOptions||{}}),n.current.mapTypes.set(Je.IgnPlan,$r()),n.current.addListener("zoom_changed",()=>{e.coordinatesFieldsProps&&e.coordinatesFieldsProps.zoomProps.input.onChange(n.current.getZoom())}),n.current.addListener("tilesloaded",()=>{e.onTilesloaded?.()}),r())},[]),n=(0,M.useRef)(null),s=(0,M.useRef)(null),o=(0,M.useRef)([]),r=()=>{o.current.forEach(e=>e.setMap(null)),eo(e.traces)?o.current=e.traces.map(e=>{const t=e.points.map(([e,t])=>({lat:e,lng:t})),i=e.direction===At.None?[]:[{icon:{path:e.direction===At.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:t,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,icons:i});return s.setMap(n.current),s}):o.current=[]};return(0,M.useEffect)(()=>{(()=>{if(s.current&&s.current.setMap(null),e.point&&n.current){const t=wr(e.point);n.current.setCenter(t),s.current=new google.maps.Marker({position:t,map:n.current,draggable:"object"==typeof e.coordinatesFieldsProps&&null!==e.coordinatesFieldsProps}),e.coordinatesFieldsProps&&s.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,M.useEffect)(()=>{n.current?.setMapTypeId(zr(e.layer))},[e.layer]),(0,M.useEffect)(()=>{r()},[JSON.stringify(e.traces||[])]),(0,i.jsx)(br,{ref:t,height:1,width:1,children:e.coordinatesFieldsProps?.zoomProps&&(0,i.jsx)(Rr.Yr,{name:e.coordinatesFieldsProps.zoomProps.input.name,children:e=>{n.current?.setZoom(e)}})})},Or.A);Dr.displayName="Map";const Pr=()=>(0,Wt.createPortal)((0,i.jsx)(br,{className:"h-map-loaded",css:{background:"transparent",height:"1px",left:"-100px",position:"absolute",top:"-100px",width:"1px"}}),document.body),Fr="query BackofficeOrganization($organizationId: OrganizationId!) {\n data: backoffice {\n row: organization(id: $organizationId) {\n ...OrganizationBackoffice\n }\n }\n}\n";function Mr(e,t){return co("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 Nr(e={}){return Kn("mutation AccreditationsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfAccreditations: accreditationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Lr(e={}){return Kn("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 Br(e){return Yn('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 Vr(e,t){return co(Fr,{variables:e,token:t||void 0,fragments:[Ms.OrganizationBackofficeFragment]})}function Ur(e,t){return co("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:[Ms.OrganizationBackofficeFragment]})}function Wr(e){return Yn("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,[Ms.DocumentEmailPreviewFragment])}function Gr(e){return Yn("query OrganizationImportInfos($organizationId: OrganizationId!, $variety: CustomFieldVariety) {\n organization(id: $organizationId) {\n customFields(\n variety: $variety\n fieldTypes: [\n Address\n Checkbox\n Country\n Date\n Datetime\n Language\n Nationality\n Number\n Phone\n Select\n Sex\n Text\n Textarea\n Time\n Validation\n ]\n ) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n}\n",e,[Ms.CustomFieldImportFragment])}function Hr(e={}){return Kn("mutation UsersInfosMerge(\n $organizationId: OrganizationId!\n $mainUserInfoId: UsersInfoId!\n $toMergeUsersInfosIds: [UsersInfoId!]!\n) {\n usersInfosMerge(\n organizationId: $organizationId\n mainUserInfoId: $mainUserInfoId\n toMergeUsersInfosIds: $toMergeUsersInfosIds\n ) {\n id\n }\n}\n",e)}function qr(e={}){return Kn("mutation CustomFieldsMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfCustomFields: customFieldsMassDelete(\n organizationId: $organizationId\n selecteds: $selecteds\n )\n}\n",e)}function Yr(e={}){return Kn("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 Kr(e={}){return Kn("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 Zr(e={}){return Kn("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 Xr(e){return Yn("query Delegations(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: DelegationsSort\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDocuments: Boolean!\n $includeLeaders: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $includeUsedCustomFieldsFilled: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: delegations(\n level: $level\n eventId: $eventId\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...DelegationsDelegation\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",e,[Ms.DelegationsDelegationFragment])}function Jr(e={}){return Kn("mutation DelegationsMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfDelegations: delegationsMassDelete(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function Qr(e){return Yn("query AllEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",e,[])}function ea(e){return Yn("query Events(\n $organizationId: OrganizationId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: EventsSort\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: events(\n name: $name\n predicates: $predicates\n offset: $offset\n limit: $limit\n sort: $sort\n ) {\n nodes {\n ...EventsEvent\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",e,[Ms.EventsEventFragment])}function ta(e={}){return Kn("mutation FormDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $newEventId: EventId\n) {\n formDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n newEventId: $newEventId\n ) {\n id\n }\n}\n",e)}function na(e){return Yn("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,[Ms.FormListFragment])}function ia(e){return Yn("query Form($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n }\n }\n}\n",e,[])}function sa(e={}){return Kn("mutation PositionsMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n numberOfPositions: positionsMassLeadersEdit(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}function oa(e){return Yn("query Organizations {\n organizations {\n id\n name\n }\n\n user {\n roles {\n organizationId\n type\n }\n }\n}\n",e,[])}function ra(e={}){return Kn("mutation UserDelete {\n userDelete {\n id\n }\n}\n",e)}function aa(e={}){return Kn("mutation UserAccessDelete($organizationId: OrganizationId!, $scope: AccessScope!, $id: Int!) {\n userAccessDelete(organizationId: $organizationId, scope: $scope, id: $id)\n}\n",e)}function la(e={}){return Kn("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 da(e,t){return co("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 ca(e={}){return Kn("mutation PositionsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfPositions: positionsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function ua(e){return Yn("query Positions(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $hasCoordinates: Boolean\n $limit: Int\n $offset: Int\n $sort: PositionsSort\n $columnsSearch: [String!]\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n $includeTraces: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: positions(\n name: $name\n predicates: $predicates\n hasCoordinates: $hasCoordinates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionsPosition\n }\n\n numberOfPages\n totalCount\n }\n\n traces @include(if: $includeTraces) {\n ...Trace\n }\n }\n}\n",e,[Ms.PositionsPositionFragment,Ms.TraceFragment])}function ha(e,t){return co('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:[Ms.LeaderInfosFragment,Ms.FullPageInfoFragment]})}function ma(e,t){return co('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:[Ms.FullPageInfoFragment]})}function ga(e,t){return co("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:[Ms.PositionPositionSlotFragment,Ms.FullPageInfoFragment]})}function pa(e){return Yn("query PositionDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Position) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n position(id: $positionId) {\n id\n positionCategoryId\n positionCategoryName\n name\n description\n privateNote\n color\n icon\n resources\n assignedResources\n preassignedResources\n address\n latitude\n longitude\n zoom\n layer\n isVisible\n range\n fields\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n\n traces {\n ...Trace\n }\n\n customFields: positionsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n leaders {\n ...LeaderInfos\n }\n\n tags {\n id\n name\n }\n }\n }\n}\n",e,[Ms.CustomFieldWithConditionFragment,Ms.TraceFragment,Ms.LeaderInfosFragment])}function fa(e={}){return Kn("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 xa(e){return Yn("query UserFieldUpdate($organizationId: OrganizationId!, $slug: CustomFieldSlug!) {\n organization: organizationPublic(id: $organizationId) {\n customField: customFieldBySlug(slug: $slug) {\n name\n description\n }\n }\n}\n",e,[])}function _a(e,t){return co("query CreateUserDelegationForm(\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $eventId: EventId\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n country\n\n delegation: delegationMaybe(id: $delegationId) {\n id\n\n accreditationsSlots(onlyVisible: true) {\n ...DelegationAccreditationSlot\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId, delegationId: $delegationId)\n country\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n\n positionsCategories {\n ...FormRegisterCategory\n }\n }\n\n form(id: $formId) {\n ...CreateUpdateMemberForm\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ms.DelegationAccreditationSlotFragment,Ms.FormRegisterAccreditationCategoryFragment,Ms.FormRegisterCategoryFragment,Ms.CreateUpdateMemberFormFragment]})}function Ia(e={}){return Kn("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 va(e){return Yn("query Comments($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n comments {\n ...Comment\n }\n }\n }\n}\n",e,[Ms.CommentFragment])}function ba(e){return Yn("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,[Ms.ExistingVolunteerFragment])}function ja(e={}){return Kn("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 Ca(e={}){return Kn("mutation VolunteersRegistrationsMassPreAssign(\n $eventId: EventId!\n $massPreAssign: MassPreAssignInput!\n) {\n numberOfMembers: volunteersRegistrationsMassPreAssign(\n eventId: $eventId\n massPreAssign: $massPreAssign\n )\n}\n",e)}function ya(e={}){return Kn("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 ka(e,t){return co("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:[Ms.FullPageInfoFragment]})}function Aa(e){return Yn("query WorkflowCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",e,[Ms.MassEditCustomFieldFragment])}function wa(e,t){return co("query Workflows(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: WorkflowsSort\n $includeAccreditations: Boolean!\n $includeCampaign: Boolean!\n $includeCustomField: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: workflows(\n level: $level\n eventId: $eventId\n name: $name\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...WorkflowsWorkflow\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ms.WorkflowsWorkflowFragment]})}function Sa(e,t){return co("query WorkflowsWorkflow(\n $organizationId: OrganizationId!\n $id: WorkflowId!\n $includeAccreditations: Boolean!\n $includeCampaign: Boolean!\n $includeCustomField: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: workflow(id: $id) {\n ...WorkflowsWorkflow\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ms.WorkflowsWorkflowFragment]})}const Ea=()=>{const{eventId:e,accreditationId:t}=Zn(),{data:n,loader:s}=Yn("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},[]),[o,r]=(0,M.useState)(!1);if(s)return s;{const e=n.eventPublic.accreditation;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Dr,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:Tr(e),onTilesloaded:()=>{r(!0)}})}),o&&(0,i.jsx)(Pr,{})]})}};var Ta;function za(e){return(0,yr.A)(e,["direction","align","justify","wrap","gap","css","height","width"])}!function(e){e.Nav="nav",e.Header="header",e.Main="main"}(Ta||(Ta={}));const Oa=hr("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"}}),Ra=M.forwardRef(({onClick:e,...t},n)=>{const s={};return t.height&&(s.height=lr(t.height)),t.width&&(s.width=lr(t.width)),(0,i.jsx)(Oa,{...t,ref:n,css:{...s,...t.css},onClick:e})});Ra.displayName="Flex";var $a=n(7356);let Da=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,$a.Oe)(e,t.path,t.message),{})}}}errorToObject(e){return e.inner.reduce((e,t)=>({...e,[t.path]:t.message}),{})}};Da=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)()],Da);var Pa=n(924),Fa=n(952),Ma=n(5664);function Na(){const[e]=(0,M.useState)(()=>(0,Ma.A)("forminput-")),[t]=(0,M.useState)(()=>(0,Ma.A)("forminputlabel-")),[n]=(0,M.useState)(()=>(0,Ma.A)("forminputdesc-")),[i]=(0,M.useState)(()=>(0,Ma.A)("forminputerror-"));return{inputId:e,labelId:t,descId:n,errorId:i}}const La=(0,M.createContext)({}),Ba=hr("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 Va=n(9241),Ua=n(2695),Wa=n(2326);const Ga=["access","ticket","pay"],Ha=({children:e,height:t,replace:n,style:s,to:o,width:r,...a})=>{const l=new URL(o.toString(),location.origin),d={};t&&(d.height=lr(t)),r&&(d.width=lr(r));const c={alignItems:"inherit",color:"inherit",cursor:"pointer",display:"inherit",flexDirection:"inherit",flexWrap:"inherit",gap:"inherit",justifyContent:"inherit",textDecoration:"none",...d,...s};return l.origin!==location.origin||Ga.includes(l.pathname.split("/")[1])?(0,i.jsx)("a",{href:l.href,rel:"noreferrer",style:c,target:"_blank",...a,children:e}):(0,i.jsx)(jr.N_,{replace:n,style:c,to:{pathname:m(D.HEAVENT_APPLICATION_BASENAME)?l.pathname.replace(new RegExp(`^/${D.HEAVENT_APPLICATION_BASENAME}`,"gm"),""):l.pathname,hash:l.hash,search:l.search},...a,children:e})};function qa(e){return(0,Wa.A)(e)}Ha.displayName="LinkWrapper";const Ya=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 s=()=>(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)(Ha,{target:e.target,to:e.to,onClick:e.onClick,children:s()}):s()};function Ka(e,t){"production"!==a.Production&&console.warn(`Component ${e} is deprecated, use ${t} instead.`)}const Za=hr("div",{alignItems:"center",display:"grid",gap:"6px 8px",gridTemplateColumns:"min-content auto"}),Xa=hr(Ra,{alignItems:"center",borderRadius:"$2",fontWeight:"$medium",gap:"$3",padding:"$3 $4","& i":{fontSize:"$textMd"},variants:{color:{primary:{background:"$primary50",border:"1px solid $primary400",color:"$primary700",[`${Za}`]:{color:"$primary500"}},gray:{background:"$gray50",border:"1px solid $gray400",color:"$gray700",[`${Za}`]:{color:"$gray500"}},error:{background:"$error50",border:"1px solid $error400",color:"$error700",[`${Za}`]:{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning400",color:"$warning700",[`${Za}`]:{color:"$warning500"}},success:{background:"$success50",border:"1px solid $success400",color:"$success700",[`${Za}`]:{color:"$success500"}}}},defaultVariants:{color:"primary"}}),Ja=e=>(Ka("common-front/src/designSystem/components/alerts/__deprecated/alert.tsx","common-front/src/designSystem/components/alerts/alert.tsx"),(0,i.jsxs)(Xa,{"aria-live":e["aria-live"]??"polite",color:e.color,role:"alert",width:e.width,children:[e.leftIcon&&(0,i.jsx)(Ra,{align:"center",children:(0,i.jsx)(Ya,{icon:e.leftIcon})}),(0,i.jsx)(br,{css:{flex:"1"},children:e.children}),e.rightIcon&&(0,i.jsx)(Ra,{align:"center",css:{cursor:e.rightIconClick?"pointer":"default"},onClick:()=>{e.rightIconClick?.()},children:(0,i.jsx)(Ya,{icon:e.rightIcon})})]})),Qa={Root:Ja,Titled:Za,Title:({children:e,icon:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{icon:t,iconStyle:"solid"}),(0,i.jsx)(br,{color:"gray800",children:e})]}),Text:({children:e})=>(0,i.jsx)(br,{color:"gray800",css:{gridColumn:"2 / 3"},fontWeight:"regular",children:e})},el=hr("p",{fontStyle:"normal",padding:"unset",margin:"unset",lineHeight:"1.42857143","& > *:not(ul)":{display:"inline"},variants:{textStyle:{inherit:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit"},heading:{color:"$gray900",fontSize:"$textLg",fontWeight:"$medium",lineHeight:"1.55556"},subheading:{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium",lineHeight:"1.5"},subtitle:{color:"$gray500",fontSize:"$textSm",fontWeight:"$regular",lineHeight:"1.42857"},bodyText:{color:"$gray800",fontSize:"$textSm"},abbreviation:{color:"$gray500",fontVariant:"small-caps",fontSize:"$textSm"}}},defaultVariants:{textStyle:"bodyText"}}),tl=M.forwardRef(({children:e,...t},n)=>(0,i.jsx)(el,{ref:n,...t,children:e}));function nl(e){throw new Error("Didn't expect to get here")}tl.displayName="Text";const il=e=>{if("error"===e.iconStyle)return(0,i.jsx)(Ya,{icon:"circle-exclamation",iconStyle:"solid"});nl(e.iconStyle)},sl=hr(Ra,{borderRadius:"$1",alignItems:"flex-start",gap:"$2",flex:"1 0 0",padding:"$4","& i":{fontSize:"$textMd"},variants:{alertStyle:{error:{background:"$error50",border:"1px solid $error500",color:"$gray800","& i":{color:"$error500"}}}},defaultVariants:{alertStyle:"error"}}),ol=({min:e=2,max:t=6,textStyle:n="heading",children:s,...o})=>{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 M.useEffect(()=>l(`h${d(r.current?.parentElement,e)}`),[e,t]),(0,i.jsx)(tl,{ref:r,as:a,...o,textStyle:n,children:s})},rl=e=>(0,i.jsxs)(sl,{"aria-live":e["aria-live"]??"polite",role:"alert",width:e.width,children:[(0,i.jsx)(Ra,{align:"start",children:(0,i.jsx)(br,{height:"20px",width:"20px",children:(0,i.jsx)(il,{iconStyle:"error"})})}),(0,i.jsx)(Ra,{align:"start",css:{gap:"2px"},direction:"column",children:e.children})]}),al=({children:e})=>(0,i.jsx)(ol,{css:{color:"$gray900",fontWeight:"$medium",fontSize:"$textSm",lineHeight:"1.42857"},children:e}),ll=({children:e})=>(0,i.jsx)(tl,{children:e}),dl=e=>(0,i.jsxs)(rl,{alertStyle:"error","aria-live":"assertive",id:e.id,children:[(0,i.jsx)(al,{children:e.title}),(0,i.jsx)(ll,{children:e.children})]});function cl(){return{history:Xn(),params:Zn(),translate:Hn()}}function ul(e){return e?(0,Fs.A)(Object.values(e).map(e=>"string"==typeof e?e:Array.isArray(e)?(0,Va.A)(e).map(e=>ul(e)).flat():ul(e)).flat()):[]}const hl=e=>{const{translate:t}=cl(),n=Na(),{errors:s,submitErrors:o,showErrors:r}=(0,M.useContext)(La),a=ul((0,Ua.A)({},s,o));return r&&eo(a)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(({children:s})=>e.featureFlags?.isV4?(0,i.jsx)(dl,{id:e.errorId??n.errorId,title:t("form_has_errors_14074"),children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:s})}):(0,i.jsx)(Ja,{"aria-live":"assertive",color:"error",id:e.errorId,leftIcon:"circle-exclamation",children:(0,i.jsx)(br,{width:1,children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-6)"},children:s})})}),{children:a.map((e,t)=>(0,i.jsx)("li",{children:e},t))}),!0!==e.hideSpacer&&(0,i.jsx)(Ba,{height:"6"})]}):null};function ml(e,t){Object.values(t.fields).forEach(e=>{e.data={...e.data,forceDisplayError:!0}})}const gl=hr("input",{left:"-9999px",position:"absolute",top:"-9999px",visibility:"hidden"}),pl=e=>{const t=M.useRef(null),n=Na(),{setShowErrors:s}=M.useContext(La),o=n=>(n?.preventDefault?.(),e.formRenderProps.invalid?(s(!0),e.formRenderProps.form.mutators.forceErrors(),setTimeout(()=>{e.customErrorRef&&e.customErrorRef.current?(e.customErrorRef.current.scrollIntoView(),e.customErrorRef.current.scrollTop=0):!e.hideDefaultErrors&&t.current&&(t.current.scrollIntoView(),t.current.scrollTop=0)},100),!e.formRenderProps.hasValidationErrors&&e.formRenderProps.hasSubmitErrors?e.formRenderProps.handleSubmit():void 0):e.formRenderProps.handleSubmit());return(0,i.jsxs)(Ra,{ref:t,as:"form",onSubmit:o,...za(e),children:[!e.hideDefaultErrors&&!e.customErrorRef&&(0,i.jsx)(hl,{errorId:n.errorId}),(0,i.jsx)(gl,{type:"submit",value:"Submit"}),e.render({dirty:e.formRenderProps.dirty,errors:e.formRenderProps.errors,form:e.formRenderProps.form,handleSubmit:o,invalid:e.formRenderProps.invalid,submitErrors:e.formRenderProps.submitErrors,submitting:e.formRenderProps.submitting,values:e.formRenderProps.values})]})},fl=e=>{const t=Gn(Da),[n,s]=M.useState(!1);return(0,i.jsx)(Fa.lV,{initialValues:e.initialValues,initialValuesEqual:e.initialValuesEqual??Or.A,mutators:{...e.mutators,...Pa.A,forceErrors:ml},render:t=>(0,i.jsx)(La.Provider,{value:{errors:t.errors,showErrors:n,submitErrors:t.submitErrors,setShowErrors:s},children:(0,i.jsx)(pl,{...(0,yr.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 o=await e.onSubmit(t,n,i);return Object.keys(o||{}).length>0&&s(!0),o}})},xl=e=>(0,M.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,M.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,M.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))),_l=(0,M.memo)(function(){return(0,i.jsx)(Ra,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(xl,{color:"#162131",height:"200px",strokeWidth:"2",width:"200px"})})}),Il={alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",gap:"$2",padding:"$1 $4",userSelect:"none","& .loader":{borderRadius:"$1"},variants:{color:{primary:{background:"$primary700",border:"1px solid $primary700",color:"white","&:hover":{background:"$primary800",border:"1px solid $primary800"},"& .loader":{background:"$primary700",border:"1px solid $primary700"},"& .loader:hover":{background:"$primary800",border:"1px solid $primary800"}},gray:{background:"$gray100",border:"1px solid $gray100",color:"$gray800","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}},white:{background:"white",border:"1px solid $gray300",color:"$gray700","&:hover":{background:"$gray50",color:"$gray800"},"& .loader":{background:"white",border:"1px solid $gray300"},"& .loader:hover":{background:"$gray50",color:"$gray800"}},error:{background:"$error600",border:"1px solid $error600",color:"white","&:hover":{background:"$error700",border:"1px solid $error600"},"& .loader":{background:"$error600",border:"1px solid $error600"},"& .loader:hover":{background:"$error700",border:"1px solid $error600"}},invisible:{background:"none",border:"none",color:"$primary700",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$primary900"},"& .h-button-content:has( + .loader)":{color:"transparent"}},"invisible-gray":{background:"none",border:"none",color:"$gray700",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$gray900"},"& .h-button-content:has( + .loader)":{color:"transparent"}}},disabled:{true:{cursor:"not-allowed"}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}},iconOnly:{true:{justifyContent:"center",px:"0"}}},compoundVariants:[{color:"primary",disabled:!0,css:{color:"$gray400",background:"$gray100",border:"1px solid $gray100","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}}},{color:"gray",disabled:!0,css:{background:"$primary25",border:"1px solid $primary25",color:"$primary300","&:hover":{background:"$primary25",border:"1px solid $primary25"},"& .loader":{background:"$primary25",border:"1px solid $primary25"},"& .loader:hover":{background:"$primary25",border:"1px solid $primary25"}}},{color:"transparent",disabled:!0,css:{color:"$gray400",background:"$primary100",border:"1px solid $primary100","&:hover":{color:"$gray400",background:"$primary100",border:"1px solid $primary100"},"& .loader":{background:"$primary100",border:"1px solid $primary100"},"& .loader:hover":{background:"$primary100",border:"1px solid $primary100"}}},{color:"invisible",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"invisible-gray",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"error",disabled:!0,css:{background:"$error200",border:"1px solid $error200","&:hover":{background:"$error200",border:"1px solid $error200"},"& .loader":{background:"$error200",border:"1px solid $error200"},"& .loader:hover":{background:"$error200",border:"1px solid $error200"}}},{size:"sm",iconOnly:!0,css:{width:"32px"}},{size:"md",iconOnly:!0,css:{width:"40px"}},{size:"lg",iconOnly:!0,css:{width:"44px"}},{size:"xl",iconOnly:!0,css:{width:"48px"}},{size:"2xl",iconOnly:!0,css:{width:"56px"}}],defaultVariants:{color:"primary",size:"md"}},vl=hr("button",Il),bl=hr("div",Il),jl=M.forwardRef(({children:e,className:t,color:n,css:s,disabled:o,featureFlags:r,isLoading:a,leftIcon:l,onClick:d,to:c,rightIcon:u,size:h,textAlign:m=(r?.isV4?"center":void 0),title:g,...p},f)=>{const x=!!l&&!e&&!u||!l&&!e&&!!u,_={className:`button ${t||""}`,color:n,css:{width:r?.isV4?"100%":void 0,...s,position:"relative"},disabled:o,iconOnly:x,size:h,title:g},I={children:e,color:n,leftIcon:l,isLoading:a,rightIcon:u,textAlign:m};return c&&!o?(0,i.jsx)(Ha,{style:r?.isV4?{flex:"1"}:void 0,title:g,to:c,onClick:e=>{o||a||d&&d(e)},...p,children:(0,i.jsx)(bl,{..._,ref:f,children:(0,i.jsx)(Cl,{...I})})}):(0,i.jsx)(vl,{..._,ref:f,type:"button",onClick:e=>{o||a||d&&d(e)},...p,children:(0,i.jsx)(Cl,{...I})})});jl.displayName="Button",jl.toString=()=>".button";const Cl=({children:e,color:t,isLoading:n,leftIcon:s,rightIcon:o,textAlign:r})=>(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsx)(Ra,{children:(0,i.jsx)(Ya,{icon:s})}),e&&(0,i.jsx)(br,{className:"h-button-content",css:{flex:"1"},textAlign:r,children:e}),o&&(0,i.jsx)(Ra,{children:(0,i.jsx)(Ya,{icon:o})}),n&&(0,i.jsx)(Ra,{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)(xl,{color:t&&"primary"!==t&&"error"!==t?mr.colors.gray800.value:"white",height:"40px",strokeWidth:"3",width:"40px"})})]});var yl=n(9008);function kl(e){return e.data?.forceDisplayError&&e.invalid||e.touched&&!e.pristine&&e.invalid||!1}const Al=(e,t=!0)=>{t&&e?.preventDefault(),e?.nativeEvent?.stopImmediatePropagation(),e?.stopPropagation()},wl=({children:e,id:t})=>e?(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",id:t,children:e}):null,Sl=e=>e.children?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"error"===e.state?"error500":"gray500",fontSize:"textXs",id:e.id,role:"error"===e.state?"alert":void 0,children:e.children})]}):null,El=({id:e,children:t,htmlFor:n,isClickable:s=!0})=>t?(0,i.jsx)("label",{htmlFor:n,id:e,style:{display:"block",cursor:"inherit",fontWeight:"$medium",marginBlockEnd:0},onClick:e=>{s||e.preventDefault()},children:(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:t})}):null,Tl=hr("div",{alignItems:"center",borderRadius:"$1",display:"flex",gap:"$space$2",padding:"0 $space$3",position:"relative",width:"100%","& input::placeholder":{color:"$gray500"},"&:focus-within":{border:"2px solid $primary700"},variants:{state:{active:{backgroundColor:"white",border:"1px solid $gray300",color:"$gray900"},disabled:{background:"$gray50",border:"1px solid $gray300",color:"$gray500"},error:{backgroundColor:"white",border:"1px solid $error500"},search:{backgroundColor:"$gray100",border:"1px solid $gray300",color:"$gray500"}},cursor:{default:{cursor:"default"},text:{cursor:"text"},pointer:{cursor:"pointer"}},height:{fixed:{height:"40px"},fluid:{minHeight:"40px"}}},defaultVariants:{state:"active",height:"fixed"}}),zl=M.forwardRef(({height:e,cursor:t,css:n,icon:s,children:o,state:r,onClick:a,rightIcon:l,rightText:d,onRightIconClick:c,...u},h)=>(0,i.jsxs)(Tl,{ref:h,className:"h-styled-input-container",css:n,cursor:t,height:e,role:"listbox",state:r,onClick:e=>{a?.(e)},...u,children:[s&&(0,i.jsx)(Ra,{css:{color:"$gray500"},role:"presentation",children:(0,i.jsx)(Ya,{icon:s})}),o,"error"===r&&(0,i.jsx)(Ra,{className:"styled-input-container-circle-exclamation",css:{color:"$error500"},children:(0,i.jsx)(Ya,{icon:"circle-exclamation"})}),l&&(0,i.jsx)(Ra,{css:{color:"$gray500",cursor:"function"==typeof c?"pointer":"inherit"},role:"presentation",onClick:e=>{c?.(e)},children:(0,i.jsx)(Ya,{icon:l})}),m(d)&&(0,i.jsx)(br,{css:{userSelect:"none"},font:"gray500 textSm regular",children:d})]}));zl.displayName="StyledInputContainer";const Ol=M.forwardRef(({autoComplete:e,isEmail:t,shouldParseAsInt:n,css:s,label:o,description:r,hint:a,onRightIconClick:l,state:d,type:c,onChange:u,rightIcon:h,rightText:g,icon:p,...f},x)=>{const _=M.useRef(),I=M.useRef(),v=x??I,{inputId:b,descId:j,errorId:C}=Na();return(0,i.jsxs)(Ra,{ref:_,css:s,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:b,children:o}),(0,i.jsx)(wl,{id:j,children:r}),(o||r)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(zl,{cursor:"text",icon:p,rightIcon:h,rightText:g,state:d,onClick:()=>v.current?.focus(),onRightIconClick:e=>{Al(e),l?.(e)},children:(0,i.jsx)(br,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"search"===d?"$gray400":"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"search"===d?"$gray400":"$gray500",opacity:1}},children:(0,i.jsx)("input",{ref:v,"aria-describedby":r?j:void 0,"aria-errormessage":"error"===d?C:void 0,"aria-invalid":"error"===d,autoComplete:e??"off",disabled:"disabled"===d,id:b,type:c??(t?"email":n?"number":"text"),onChange:e=>{if(t&&m(e.target.value))u(e.target.value.toLowerCase());else if(!0===n){const t=parseInt(e.target.value,10);isNaN(t)?u(0):u(t)}else u(e.target.value)},...f})})}),(0,i.jsx)(Sl,{id:C,state:d,children:a})]})});Ol.displayName="TextInput";const Rl=({autoComplete:e,hint:t,shouldParseAsInt:n,name:s,state:o,...r})=>{const a=(0,M.useCallback)(e=>{switch(e){case Me.City:return"address-level1";case Me.DateOfBirth:return"bday";case Me.FirstName:return"given-name";case Me.LastName:return"family-name";case Me.PostalCode:return"postal-code";case Me.Street:return"street-address";case Me.Country:case Me.Language:case Me.Nationality:case Me.Phone:case Me.Picture:case Me.Sex:default:return}},[]),l=(0,M.useMemo)(()=>s.startsWith("formRegister.userInfo.fields.")?a(s.split(".").pop())??e:e,[s,e,a]),d=(0,M.useCallback)(e=>{const s=kl(e.meta);return(0,i.jsx)(Ol,{autoComplete:l,hint:s?e.meta.error||e.meta.submitError:t,shouldParseAsInt:n||!1,state:s?"error":o,value:e.input.value,onBlur:e.input.onBlur,onChange:t=>{e.input.onChange(t)},onFocus:e.input.onFocus,...r})},[t,n,o,l,r]);return(0,i.jsx)(Fa.D0,{name:s,parse:yl.A,render:d})},$l={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",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 Dl=class{translationService;constructor(e){this.translationService=e}t(e,...t){return this.translationService.translate(e,...t)}};Dl=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Dl);let Pl=class extends Dl{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))))}};Pl=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Pl);function Fl(e){return"string"==typeof e&&e.length>=16}function Ml(e){return"string"==typeof e&&null!==e.match(/\d/)}function Nl(e){return"string"==typeof e&&null!==e.match(/[A-Z]/)&&null!==e.match(/[a-z]/)}function Ll(e){return"string"==typeof e&&null!==e.match(/[^A-Za-z0-9]/)}let Bl=class extends Pl{constructor(e){super(e)}signInSchema(){return d.Ik().shape({email:this.email()})}signInPasswordSchema(){return d.Ik().shape({email:this.email(),password:this.password()})}codeSchema(){return d.Ik().shape({code:this.code()})}emailSchema(){return d.Ik().shape({email:this.email()})}emailConfirmSchema(){return d.Ik().shape({email:this.email(),emailConfirm:this.emailConfirm()})}emailCodeSchema(){return d.Ik().shape({email:this.email(),code:this.code()})}email(){return d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856"))}emailConfirm(){return d.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 d.Yj().required(this.t("le_code_est_req_77618")).length(6,this.t("le_code_doit_co_37160"))}password(){return d.Yj().required(this.t("le_mot_de_passe_14773"))}passwordRules(){return d.Yj().required(this.t("le_mot_de_passe_24842")).test("valid-password",this.t("le_mot_de_passe_24842"),function(){return Fl(this.parent.password)&&Ml(this.parent.password)&&Nl(this.parent.password)&&Ll(this.parent.password)})}};Bl=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Bl);let Vl=class extends Bl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code()})}};Vl=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Vl);var Ul,Wl,Gl,Hl=n(2302);function ql(){return ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(Ra,{align:"center",css:{background:"#232935",overflowX:"hidden",overflowY:"auto"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{css:{marginBottom:"40px","@desktop":{marginBottom:"80px"},"& svg":{height:"100%"}},height:32,children:(0,i.jsx)(Yl,{})}),(0,i.jsxs)(Ra,{css:{width:"100%","@mobile":{px:"$4"},"@desktop":{width:"540px"}},direction:"column",children:[(0,i.jsx)(Ra,{css:{background:"white",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$7"},width:1,children:e.children}),(0,i.jsx)(Ra,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$7"},direction:"column",gap:"2",width:1,children:e.link})]}),(0,i.jsx)(Ba,{height:"7"})]}),Xl=e=>(0,i.jsx)(Ra,{align:"center",direction:{"@initial":"column","@desktop":"row"},gap:"1",justify:"center",width:1,children:e.children}),Jl=e=>{const t=Hn(),n=Xn(),s=Qn(),o=Gn(Da),r=Gn(Vl),{mutate:a}=function(e={}){return Kn("mutation LoginCodeEmailCreate($loginCodeEmail: LoginCodesEmailInput!) {\n loginCodeEmailCreate(loginCodeEmail: $loginCodeEmail) {\n insertedAt\n }\n}\n",e)}(),[l,d]=(0,M.useState)(null),[c,u]=(0,M.useState)(0),[h,m]=(0,M.useState)(0),[g,p]=(0,M.useState)(!1),[f,x]=(0,M.useState)(Date.now());return(0,i.jsx)(Zl,{link:(0,i.jsxs)(Xl,{children:[(0,i.jsx)(br,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push(Os.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(fl,{direction:"column",initialValues:{email:s.getItem($l.AUTH_EMAIL)||"",code:""},render:({handleSubmit:n,submitting:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("se_connecter_av_59438")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("saisissez_votre_01613")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Rl,{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)(Ba,{height:"4"}),(0,i.jsx)(Rl,{autoComplete:"one-time-code",label:t("code_20843"),name:"code",placeholder:t("code_20843"),state:g?"disabled":void 0,type:"number"})]}),(0,i.jsx)(Ba,{height:"6"}),g?(0,i.jsx)(jl,{textAlign:"center",onClick:e.onFailure,children:t("recommencer_14712")}):(0,i.jsx)(jl,{isLoading:s,textAlign:"center",onClick:n,children:t(0===c?"recevoir_le_cod_88633":"se_connecter_63820")})]}),validate:e=>0===c?o.validateForForm(r.step1Schema())(e):o.validateForForm(r.step2Schema())(e),width:1,onSubmit:async n=>{if(0!==c){const{user:i,callbacks:s}=l;return function({code:e,user:t,callbacks:n}){return new Promise((i,s)=>{t.sendCustomChallengeAnswer(e,{...n,onSuccess:(...e)=>{n.onSuccess(...e),i(e)},onFailure:e=>{n.onFailure(e),s({type:"FAILED",error:e})},customChallenge:(...e)=>{n.customChallenge&&n.customChallenge(...e),s({type:"RETRY"})}})}).then(([e])=>e.getIdToken().getJwtToken())}({code:n.code,user:i,callbacks:s}).then(e.onSuccess,e=>{if("RETRY"===e.type)return m(h+1),{code:t("le_code_n_est_p_95065",3-(h+1))};{let i;return function(e,t,n){!async function(e){await fetch(`${D.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=Bs.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:Xe.App}}),x(Date.now());const e=await async function(e,t,n){try{return await Z(e,t,n)}catch(i){if(i!==U)throw i;try{return await Y(e,L()),await Z(e,t,n)}catch{throw new Error("Auth failure")}}}(n.email,Hl.A,Hl.A);d(e),u(1)}}})})},Ql=M.forwardRef(({css:e,hint:t,description:n,icon:s,state:o,onChange:r,label:a,onForgotPasswordClick:l,...d},c)=>{const u=Hn(),h=M.useRef(),[m,g]=M.useState("password"),{inputId:p,descId:f,errorId:x}=Na();return(0,i.jsxs)(Ra,{ref:h,css:e,direction:"column",width:1,onClick:e=>{e.preventDefault(),h.current?.querySelector("input")?.focus()},children:[(0,i.jsxs)(Ra,{gap:"3",width:1,children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(El,{htmlFor:p,children:a})}),"function"==typeof l&&(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{l?.()},children:u("mot_de_passe_ou_17690")})]}),(0,i.jsx)(wl,{id:f,children:n}),(a||n)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(zl,{cursor:"text",icon:s,rightIcon:"password"===m?"eye":"eye-slash",state:o,onRightIconClick:e=>{Al(e),g("password"===m?"text":"password")},children:(0,i.jsx)(br,{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"===o?x:void 0,"aria-invalid":"error"===o,disabled:"disabled"===o,id:p,type:m,onChange:e=>{r(e.target.value)},...d})})}),(0,i.jsx)(Sl,{id:x,state:o,children:t})]})});Ql.displayName="PasswordInput";const ed=({name:e,autoComplete:t,hint:n,state:s,...o})=>(0,i.jsx)(Fa.D0,{name:e,render:r=>{const a=kl(r.meta);return(0,i.jsx)(Ql,{autoComplete:t??"current-password",hint:a?r.meta.error:n,name:e,state:a?"error":s,value:r.input.value,onBlur:r.input.onBlur,onChange:e=>{r.input.onChange(e)},onFocus:r.input.onFocus,...o})}});let td=class extends Bl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};td=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],td);const nd=hr("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"}}}}),id=M.forwardRef((e,t)=>{const n={gridTemplate:e.gridtemplate,gridTemplateColumns:e.gridtemplatecolumns,gridTemplateRows:e.gridtemplaterows};return e.height&&(n.height=lr(e.height)),e.width&&(n.width=lr(e.width)),(0,i.jsx)(nd,{role:"grid",...e,ref:t,css:{...n,...e.css}})});id.displayName="Grid";const sd=e=>(0,i.jsxs)(Ra,{align:"center",gap:{"@initial":"2","@desktop":"1"},children:[(0,i.jsx)(Ra,{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)(Ya,{icon:"check"})}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:e.children})]}),od=e=>{const t=Hn();return(0,i.jsxs)(id,{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)(sd,{isValid:Fl(e.password),children:t("16_caract_res_m_52434")}),(0,i.jsx)(sd,{isValid:Ml(e.password),children:t("au_moins_un_chi_73862")}),(0,i.jsx)(sd,{isValid:Nl(e.password),children:t("au_moins_une_ma_58302")}),(0,i.jsx)(sd,{isValid:Ll(e.password),children:t("au_moins_un_car_54396")})]})},rd=e=>{const t=Hn(),n=Xn(),s=Qn(),o=Gn(Da),r=Gn(td),[a,l]=(0,M.useState)(0);return(0,i.jsx)(Zl,{link:(0,i.jsxs)(Xl,{children:[(0,i.jsx)(br,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push(Os.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(fl,{direction:"column",initialValues:{email:s.getItem($l.AUTH_EMAIL)||"",code:"",password:""},render:({handleSubmit:e,submitting:n,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("mot_de_passe_ou_17690")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("saisissez_votre_47959")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Rl,{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)(Ba,{height:"4"}),(0,i.jsx)(Rl,{autoComplete:"one-time-code",label:t("code_re_u_par_e_75150"),name:"code",placeholder:t("code_20843")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(ed,{autoComplete:"new-password",label:t("nouveau_mot_de_46347"),name:"password",placeholder:t("entrez_votre_mo_51874")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(od,{password:s.password})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(jl,{isLoading:n,textAlign:"center",onClick:e,children:t(0===a?"recevoir_le_cod_88633":"r_initialiser_l_12900")})]}),validate:e=>0===a?o.validateForForm(r.step1Schema())(e):o.validateForForm(r.step2Schema())(e),width:1,onSubmit:async t=>{0===a?(await J(t.email),l(1)):e.onSuccess(await Q(t.email,t.code,t.password))}})})},ad=hr("input",{left:"-9999px",position:"absolute",top:"-9999px",visibility:"hidden"}),ld=()=>(0,i.jsx)(ad,{tabIndex:-1,type:"submit",value:"Submit"}),dd={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),UserProfile:n(8264),WeezConstruction:n(6400)},cd={Alert:n(2630),Check:n(3780),DnsBlank:n(1037),DnsWrongDomain:n(8184),Done:n(8652),Done2:n(3574),RecrewteerMarker:n(8798),Sad:n(5376),WeezeventBlankHandGlobe:n(2599),WeezeventBlankMessages:n(6687),WeezeventBlankPerson:n(7648),WeezeventBlankSwissArmyKnife:n(4362)};var ud=n(7480);const hd=[jt.De,jt.En,jt.Es,jt.Fr,jt.Nl];function md(e){if(m(e)){const t=(0,ud.A)(e.trim().substring(0,2));return hd.includes(t)?t:null}return null}function gd(e,t){return t.has("lang")?md(t.get("lang"))||jt.En:e||md(navigator.language)||jt.En}const pd=D.EMAIL_FROM_NAME,fd=D.EMAIL_FROM;function xd(e){return e===jt.Fr?"https://weezevent.com/fr/cgus/":e===jt.Nl?"https://weezevent.com/nl/gebruiksvoorwaarden-diensten/":e===jt.Es?"https://weezevent.com/es/cgus/":"https://weezevent.com/en-gb/terms-of-use/"}const _d=e=>{const{translate:t,history:n}=cl(),s=Gn(Bl),o=Gn(Da),r=Qn(),a=xd(gd(null,new URL(location.href).searchParams));return(0,i.jsx)(Zl,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{children:[(0,i.jsx)(br,{color:"gray500",children:t("pas_encore_sur_13386")}),(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push(Os.AUTH_SIGN_UP_CREDENTIALS)},children:t("ouvrez_un_compt_91337")})]}),(0,i.jsx)(Xl,{children:(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{window.open(a,"_blank")},children:t("conditions_g_n_34786")})})]}),children:(0,i.jsx)(fl,{direction:"column",initialValues:{email:"",password:""},render:({handleSubmit:e,submitting:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("ravi_de_vous_re_24368")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("identifiez_vous_57743")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Rl,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(ed,{label:t("mot_de_passe_41738"),name:"password",placeholder:t("entrez_votre_mo_51874"),onForgotPasswordClick:()=>{r.setItem($l.AUTH_EMAIL,o.email),n.push(Os.AUTH_FORGOT_PASSWORD)}}),(0,i.jsx)(ld,{}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(jl,{isLoading:s,textAlign:"center",onClick:e,children:t("se_connecter_63820")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",children:t("ou_67404")}),(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{r.setItem($l.AUTH_EMAIL,o.email),n.push(Os.AUTH_SIGN_IN_CODE)},children:[(0,i.jsx)(br,{color:"gray500",fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"envelope"})}),(0,i.jsx)(br,{color:"gray700",children:t("se_connecter_av_59438")})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=Kl("Google")},children:[(0,i.jsx)(br,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:dd.Google})}),(0,i.jsx)(br,{color:"gray700",children:t("se_connecter_av_86208")})]})]}),validate:e=>o.validateForForm(s.signInPasswordSchema())(e),width:1,onSubmit:async n=>{try{return e.onSuccess(await X(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 Id=class extends Bl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email(),password:this.passwordRules()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};Id=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Id);const vd=e=>{const{history:t,translate:n}=cl(),s=Gn(Da),o=Gn(Id),[r,a]=(0,M.useState)(0),l=xd(gd(null,new URL(location.href).searchParams));return(0,i.jsx)(Zl,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{children:[(0,i.jsx)(br,{color:"gray500",children:n("vous_avez_d_j_26391")}),(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{t.push(Os.AUTH_SIGN_IN_EMAIL)},children:n("connectez_vous_14760")})]}),(0,i.jsx)(Xl,{children:(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{window.open(l,"_blank")},children:n("conditions_g_n_34786")})})]}),children:(0,i.jsx)(Fa.lV,{initialValues:{email:"",code:"",password:""},render:({handleSubmit:e,submitting:t,values:s})=>(0,i.jsxs)("form",{style:{width:"100%"},onSubmit:e,children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("cr_er_un_compte_71423")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:n("utilisez_recrew_64841")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Rl,{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)(Ba,{height:"4"}),(0,i.jsx)(ed,{label:n("nouveau_mot_de_46347"),name:"password",placeholder:n("entrez_votre_mo_51874"),state:r>0?"disabled":"active"}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(od,{password:s.password}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{autoComplete:"one-time-code",label:n("code_re_u_par_e_75150"),name:"code",placeholder:n("code_20843"),type:"number"})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(jl,{isLoading:t,textAlign:"center",onClick:e,children:n(0===r?"recevoir_le_cod_04513":"cr_er_mon_compt_84515")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",children:n("ou_67404")}),(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=Kl("Google")},children:[(0,i.jsx)(br,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:dd.Google})}),(0,i.jsx)(br,{color:"gray700",children:n("s_inscrire_avec_54027")})]})]}),validate:e=>0===r?s.validateForForm(o.step1Schema())(e):s.validateForForm(o.step2Schema())(e),onSubmit:async t=>{0===r?(await J(t.email),a(1)):e.onSuccess(await Q(t.email,t.code,t.password))}})})},bd=async e=>{await co(_o,{token:e}),window.location.href=Os.HOME},jd=e=>{e&&si("Auth failure",e),window.location.href=Os.AUTH_SIGN_IN},Cd=()=>(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:Os.AUTH_FORGOT_PASSWORD,children:(0,i.jsx)(rd,{onSuccess:bd})}),(0,i.jsx)(Cr.qh,{exact:!0,path:Os.AUTH_SIGN_IN_EMAIL,children:(0,i.jsx)(_d,{onSuccess:bd})}),(0,i.jsx)(Cr.qh,{exact:!0,path:Os.AUTH_SIGN_IN_CODE,children:(0,i.jsx)(Jl,{onFailure:jd,onSuccess:bd})}),(0,i.jsx)(Cr.qh,{exact:!0,path:Os.AUTH_SIGN_UP_CREDENTIALS,children:(0,i.jsx)(vd,{onSuccess:bd})}),(0,i.jsx)(Cr.qh,{exact:!0,path:Os.AUTH_SIGN_UP_CODE,children:(0,i.jsx)(ei,{path:Os.AUTH_SIGN_IN_EMAIL})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.AUTH_SIGN_IN_EMAIL})})]}),yd=e=>(M.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",{})})),kd=()=>{const[,e]=location.search.substr(1).split("="),{data:t,loader:n}=Yn("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)(yd,{loader:n,onLoad:()=>{!function(e){const t=new N.p4({IdToken:new N.Yw({IdToken:e.idToken}),RefreshToken:new N.c9({RefreshToken:e.refreshToken}),AccessToken:new N.pD({AccessToken:e.accessToken})}),n=e.email.trim().toLowerCase();new N.TU({Username:n,Pool:G()}).setSignInUserSession(t)}(t.userTokens),window.location.href=Os.HOME}})},Ad="www.partagetapassion.com",wd="registering.aso.fr",Sd="billets.strangerthings-laderniereaventure.com",Ed=new Map([[1792,"evenements.handicap-international.fr"],[858,Ad],[1773,"communaute.rncb.fr"],[3306,"mariage.ravey.fr"],[3136,wd],[3469,Sd]]);function Td(e){(0,M.useEffect)(()=>{const t=document.title;return document.title=(n=location.host,`${m(i=e)?`${i} | `:""}${function(e){return e===Ad?"Partage Ta Passion":e===Sd?"L'Upside Down s'empare de Paris":e===wd?"A.S.O.":pd}(n)}`),()=>{document.title=t};var n,i},[e])}function zd(e,t){const n=M.useCallback(e,t||[]);M.useEffect(()=>(document.addEventListener("click",n,!1),()=>{document.removeEventListener("click",n,!1)}),t||[])}function Od(e){const t=(0,M.useCallback)(t=>{"Esc"!==t.key&&"Escape"!==t.key||e()},[]);(0,M.useEffect)(()=>(document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}),[])}const Rd="h-dropdown-open";function $d(e,t){e.dispatchEvent(new CustomEvent(Rd,{bubbles:!0,detail:{uuid:t??""}}))}const Dd=M.createContext({}),Pd=e=>{const t=M.useRef(L()),[n,s]=M.useState(e.isOpen??!1),[o,r]=M.useState(null),[a,l]=M.useState(null),d=M.useCallback(n=>{e.disabled||(s(n),e.onStateChange&&e.onStateChange(n),!0===n&&o&&$d(o,t.current))},[e.disabled,o,s,e.onStateChange]),c=M.useCallback(n=>{n.detail.uuid!==t.current&&!0!==e.doNotCloseOnOtherOpen&&d(!1)},[d]);return M.useEffect(()=>{e.isOpen!==n&&s(e.isOpen??!1)},[e.isOpen]),M.useEffect(()=>(document.addEventListener(Rd,c),()=>{document.removeEventListener(Rd,c)}),[c]),Od(()=>{d(!1)}),zd(()=>{d(!1)}),(0,i.jsx)(Dd.Provider,{value:{isOpen:n,referenceElement:o,popperElement:a,setIsOpen:d,setReferenceElement:r,setPopperElement:l},children:e.children})};function Fd(){return M.useContext(Dd)}const Md=hr("div",{alignItems:"center",display:"flex",fontSize:"$textSm",fontWeight:"$regular",minHeight:"40px",px:"$4",py:"$2",userSelect:"none",width:"100%",ellipsis:"",variants:{color:{default:{cursor:"pointer",color:"$gray700","&:hover":{background:"$primary50",color:"$primary700"}},disabled:{color:"$gray400",cursor:"not-allowed"},heading:{color:"$gray500",fontSize:"$textXs",fontWeight:"$semiBold",cursor:"default"},red:{cursor:"pointer",color:"$error700","&:hover":{background:"$error50"}}}},defaultVariants:{color:"default"}}),Nd=({children:e,color:t,css:n,download:s,to:o,onClick:r,target:a,role:l})=>"disabled"!==t&&o?(0,i.jsx)(Ha,{download:s,target:a,to:o,onClick:e=>r?.(e),children:(0,i.jsx)(Md,{color:t||"default",css:n,children:e})}):(0,i.jsx)(Md,{color:t||"default",css:n,role:l??"menuitem",tabIndex:o?void 0:"presentation"!==l?0:void 0,onClick:e=>r?.(e),children:e}),Ld=({css:e,children:t,color:n,download:s,icon:o,isDisabled:r=!1,onClick:a,to:l,target:d})=>(0,i.jsx)(Nd,{color:n,css:{cursor:r?"not-allowed":"pointer",opacity:r?"0.6":"inherit",...e},download:s,target:d,to:l,onClick:e=>{r||($d(e.target),a?.(e))},children:(0,i.jsxs)(Ra,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Ra,{align:"center",height:1,justify:"start",width:16,children:(0,i.jsx)(Ya,{icon:o})}),(0,i.jsx)(br,{css:{flex:"1",ellipsis:""},children:t})]})});var Bd=n(832);const Vd=e=>{const{isOpen:t,referenceElement:n,popperElement:s,setPopperElement:o}=Fd(),{styles:r,attributes:a,update:l}=(0,Bd.E)(n,s,{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";M.useEffect(()=>{l?.()},[l,t,n]),M.useEffect(()=>{if(n){const e=new ResizeObserver(()=>{l?.()});return e.observe(n),()=>{e.disconnect()}}return Hl.A},[l,n]);const c=(0,i.jsx)(Ra,{ref:o,"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=>Al(e,!1),...a.popper,tabIndex:-1,children:e.children});return t?e.renderOnPortal?(0,Wt.createPortal)(c,document.body):c:null},Ud=e=>{const{isOpen:t,setIsOpen:n,setReferenceElement:s}=Fd(),o=e.children,r=e=>{Al(e),n(!t),o.props.onClick?.(e)},a=M.cloneElement(M.Children.only(o),{ref(e){s(e)},onClick(e){e.preventDefault(),r(e)},onKeyPress(e){r(e)},tabIndex:0});return(0,i.jsx)(i.Fragment,{children:a})};var Wd=n(5315);function Gd(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 Hd(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 qd=[0,50,100,200,300,400,500,600,700,800,900,950,1e3],Yd=Object.fromEntries(Object.keys(mr.colors).filter(e=>e.includes("700")).flatMap(e=>{const t=e.substring(0,e.length-3),n={50:mr.colors[`${t}50`].value,100:mr.colors[`${t}100`].value,500:mr.colors[`${t}500`].value,700:mr.colors[`${t}700`].value};return[[t,n],[n[700],n]]}));function Kd(e,t=700){const n=Yd[e.toLowerCase()];if(n)return n;{const n=(0,Wd.KI)(e),i=((e,t=700)=>qd.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),s=n[e,n.copy({l:t/100}).formatHex()]))}}function Zd(e){return m(e)&&e.startsWith("#")&&7===e.length}const Xd=hr("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"}}),Jd=M.forwardRef((e,t)=>{const n=M.useMemo(()=>{const t=e.color||"gray",n=Kd(t);return"gray"===t?{background:"$gray100",color:"$gray700","& > .h-badge-left-icon":{color:"$gray500"},"& > .h-badge-count":{background:"$gray200"}}:"white"===t?{background:"white",border:"1px solid $gray300","& > .h-badge-count":{background:"$gray100"}}:"white-with-green-icon"===t?{background:"white",border:"1px solid $gray300","& > .h-badge-left-icon":{color:"$success500"}}:{background:n[50],color:n[700],"& > .h-badge-left-icon":{color:n[500]},"& > .h-badge-count":{background:n[100]}}},[e.color]);return(0,i.jsxs)(Xd,{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)(Ra,{className:"h-badge-left-icon",css:{cursor:e.onLeftIconClick?"pointer":"inherit"},onClick:t=>{e.onLeftIconClick?.(t)},children:(0,i.jsx)(Ya,{icon:e.leftIcon,iconStyle:e.leftIconStyle})}),e.children&&(0,i.jsx)(br,{className:"h-badge-content",css:{flex:"1",overflow:"hidden"},title:e.title,onClick:t=>{e.onContentClick?.(t)},children:(0,i.jsx)(br,{css:{ellipsis:!0},title:"string"==typeof e.children?e.children:"",children:e.children})}),e.rightIcon&&(0,i.jsx)(Ra,{css:{cursor:e.onRightIconClick?"pointer":"inherit"},onClick:t=>{e.onRightIconClick?.(t)},children:(0,i.jsx)(Ya,{icon:e.rightIcon})}),("number"==typeof e.count||m(e.count))&&(0,i.jsx)(Ra,{align:"center",className:"h-badge-count",children:e.count})]})});Jd.displayName="Badge";const Qd=xr({"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}),ec=M.memo(function(e){const t="circular"===e.variant?e.size:e.height,n="circular"===e.variant?e.size:e.width;return(0,i.jsx)(br,{css:{animation:`${Qd} 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 tc=n(9116),nc=n(6618),ic=n(2499),sc=n(7456),oc=n(4757);const rc=({children:e,index:t,...n})=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{"aria-label":e?.toString(),font:"gray600 textXs semiBold",role:"group",width:1,...n,children:e}),(0,i.jsx)(Ba,{height:"2"})]}),ac=hr("div",{alignItems:"center",border:"1px solid $gray300",cursor:"pointer",display:"flex",fontSize:"10px",fontWeight:"$semiBold",justifyContent:"center","& > i":{fontSize:"10px",fontWeight:"$semiBold"},variants:{size:{sm:{borderRadius:"4px",height:"16px",width:"16px"},md:{borderRadius:"6px",height:"20px",width:"20px"}},state:{unchecked:{background:"white","&:hover":{border:"1px solid $primary600"}},checked:{background:"$primary600",border:"none",color:"white"},indeterminate:{background:"$primary600",border:"none",color:"white",padding:"$1","& > div":{borderTop:"2px solid white",width:"100%"}}},disabled:{true:{}}},compoundVariants:[{state:"unchecked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","&:hover":{borderColor:"$gray200"}}},{state:"checked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300"}},{state:"indeterminate",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300","& > div":{borderTopColor:"$gray300"}}}],defaultVariants:{size:"sm",state:"unchecked"}}),lc=({shouldPreventDefault:e=!0,...t})=>{const n=n=>{e&&Al(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked",n):t.onClick("checked",n))};return(0,i.jsxs)(ac,{"aria-describedby":t.descId,"aria-labelledby":t.labelId,disabled:t.disabled,id:t.inputId,role:"checkbox",size:t.size,state:t.state,tabIndex:t.tabIndex??0,onClick:e=>n(e),onKeyDown:e=>{"Space"===e.code&&n(e)},children:["checked"===t.state&&(0,i.jsx)("i",{className:"far fa-check"}),"indeterminate"===t.state&&(0,i.jsx)("div",{})]})},dc=({shouldPreventDefault:e=!0,...t})=>{const{descId:n,inputId:s,labelId:o}=Na(),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)(Ra,{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)(Ra,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(lc,{descId:n,disabled:t.disabled,inputId:s,labelId:o,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:Hl.A})}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsxs)(Ra,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2"},children:[(0,i.jsx)(El,{htmlFor:s,id:o,children:(0,i.jsx)(br,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),r&&(0,i.jsx)(br,{color:"gray500",id:n,children:t.subtext})]})]})},cc=hr("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"}}),uc=({shouldPreventDefault:e=!0,...t})=>{const n=n=>{e&&Al(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsx)(cc,{"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",{})})},hc=({shouldPreventDefault:e=!0,...t})=>{const{inputId:n,descId:s,labelId:o}=Na(),r="string"==typeof t.subtext&&t.subtext.length>0,a=n=>{e&&Al(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsxs)(Ra,{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)(Ra,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(uc,{descId:s,disabled:t.disabled,inputId:n,labelId:o,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:Hl.A})}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsxs)(Ra,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2","& div":{cursor:"pointer !important"}},children:[(0,i.jsx)(El,{htmlFor:n,id:o,children:(0,i.jsx)(br,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),t.subtext&&(0,i.jsx)(br,{color:"gray500",id:s,children:t.subtext})]})]})},mc=({children:e,css:t,disabled:n,isCheckbox:s,isRadio:o,isSelected:r,onClick:a,subtext:l,value:d,...c})=>{const u=M.useCallback(()=>{n||a?.()},[n,a]),h=M.useCallback(e=>{"Enter"===e.key&&u?.()},[u]);return(0,i.jsxs)(Ra,{align:"center","aria-checked":s?r:void 0,"aria-label":e,"aria-selected":r,css:{cursor:n?"default":"pointer",minHeight:"40px",padding:"$2 $3",userSelect:"none","&:hover":{background:"$gray100",borderRadius:"$1"},...t},gap:"3",role:"option",tabIndex:0,width:1,onClick:u,onKeyDown:h,...c,children:[s&&(0,i.jsx)(lc,{disabled:n,shouldPreventDefault:!1,state:r?"checked":"unchecked",onClick:Hl.A}),o&&(0,i.jsx)(uc,{shouldPreventDefault:!1,state:r?"checked":"unchecked",onClick:Hl.A}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray800",css:{ellipsis:!0},title:e,width:1,children:e}),m(l)&&(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},title:l,width:1,children:l})]}),!s&&!o&&r&&(0,i.jsx)(br,{color:"primary700",children:(0,i.jsx)(Ya,{icon:"check"})})]})};function gc(e){return M.Children.toArray(e).map(t=>{if("optgroup"===t.type)return[{id:(0,Ma.A)(),type:"group",text:t.props.label}].concat(gc(t.props.children));if("option"===t.type)return{id:(0,Ma.A)(),type:"option",text:t.props.children,value:t.props.value,disabled:t.props.disabled,selected:t.props.selected,radio:t.props["data-radio"],style:t.props.style,subtext:t.props["data-subtext"]};if(t.type===Symbol.for("react.fragment"))return gc(t.props.children);throw si("Unexpected child type",t,e),new Error("Unexpected child type")}).flat()}function pc(e){return Object.fromEntries(e.filter(e=>"option"===e.type).map(e=>[e.value,e.text]))}const fc=({children:e,createText:t,css:n,description:s,hint:o,icon:r,isCreateVisible:a,isSearchLoading:l,isSearchVisible:d,isSelectAllVisible:c,label:u,menuWidth:h,multiple:p,onChange:f,onClick:x,onCreateClick:_,placeholder:I,renderOnPortal:v,renderValue:b,searchElement:j,searchPlaceholder:C,state:y,triggerElem:k,values:A})=>{const w=Hn(),S=M.useCallback(e=>e?.focus({preventScroll:!0}),[]),[E,T]=M.useState(!1),[z,O]=M.useState(""),{inputId:R,descId:$}=Na(),D=M.useMemo(()=>gc(e),[e]),P=M.useMemo(()=>D.flatMap(e=>"option"===e.type?[e.value]:[]),[D]),F=M.useMemo(()=>{const e=(z||"").trim().toLowerCase();return D.filter(t=>""===e||"group"===t.type||t.text.toLowerCase().includes(e)).filter((e,t,n)=>{const i=n[t+1];return"option"===e.type||"option"===i?.type})},[D,z]),N=M.useMemo(()=>(0,tc.A)((0,nc.A)(F.filter(e=>"option"===e.type&&m(e.radio)),e=>e.radio),e=>e.map(e=>e.value)),[F]),L=M.useMemo(()=>pc(D),[D]),B=M.useMemo(()=>(0,Or.A)((0,ic.A)(A),(0,ic.A)(P)),[A,P]),V=M.useCallback(()=>{f(B?[]:P)},[f,P,B]),U=M.useMemo(()=>b?b(A[0],L[A[0]]):L[A[0]],[b,A,L]);return M.useEffect(()=>{E||O("")},[E]),(0,i.jsxs)(Ra,{css:n,direction:"column",width:1,children:[u&&(0,i.jsx)(El,{htmlFor:R,children:u}),s&&(0,i.jsx)(wl,{id:$,children:s}),(u||s)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Pd,{disabled:"disabled"===y,isOpen:E,onStateChange:e=>T(e),children:[(0,i.jsx)(Ud,{children:k||(0,i.jsx)(zl,{"aria-describedby":$,"aria-label":(u??I)+(L[A[0]]?` (currently: ${L[A[0]]})`:""),"aria-multiselectable":p,"aria-owns":F.map(e=>e.id).join(" "),"aria-placeholder":I,css:{maxHeight:"200px",overflowY:"auto",padding:"$2 $3",userSelect:"none"},cursor:"disabled"===y?"default":"pointer",height:"fluid",icon:r,id:R,rightIcon:E?"chevron-up":"chevron-down",state:y,children:eo(A)?p?(0,i.jsx)(Ra,{css:{flex:"1",overflowY:"auto"},gap:"2",height:1,role:"presentation",wrap:"wrap",children:A.map((e,t)=>(0,i.jsx)(Jd,{ellipsis:!0,rightIcon:"xmark",onRightIconClick:t=>{Al(t),f((0,sc.A)(A,e))},children:L[e]},t))}):(0,i.jsx)(br,{color:"gray800",css:{flex:"1",overflow:"hidden"},role:"presentation",children:(0,i.jsx)(br,{css:{ellipsis:!0},title:U,children:U})}):(0,i.jsx)(br,{color:"gray500",css:{flex:"1"},role:"presentation",children:I})})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:v,width:h??"match",children:(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsxs)(Ra,{css:{padding:"$3"},direction:"column",width:1,children:[d&&(0,i.jsxs)(i.Fragment,{children:[j||(0,i.jsx)(Ol,{ref:S,icon:"magnifying-glass",placeholder:C||w("rechercher_50038"),state:"search",value:z,onChange:O}),(0,i.jsx)(Ba,{height:"3"})]}),(0,i.jsx)(br,{css:{maxHeight:"250px",overflowY:"auto"},children:l?(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(ec,{borderRadius:"$1",height:40}),(0,i.jsx)(ec,{borderRadius:"$1",height:40}),(0,i.jsx)(ec,{borderRadius:"$1",height:40})]}):F.map((e,t)=>{if("group"===e.type)return(0,i.jsx)(rc,{id:e.id,index:t,children:e.text},e.id);{const n=e.value,s=e.selected??A.includes(n),o=e.radio,r=!0===p&&g(o),a=!0===p&&m(o);return(0,i.jsx)(mc,{css:e.style,disabled:e.disabled,id:e.id,isCheckbox:r,isRadio:a,isSelected:s,subtext:e.subtext,value:e.value,onClick:()=>{if(x)x(n,s);else if(p&&r)f(s?(0,sc.A)(A,n):A.concat(n));else if(p&&a){const e=(0,oc.A)(A,N[o]).concat(s?[]:[n]);f(e)}else f(s?[]:[n]),T(!1)},children:e.text},t)}})})]}),a&&(0,i.jsxs)(Ra,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary700",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:()=>{_?.(),T(!1)},children:["+ ",t||w("cr_er_82895")]}),c&&(0,i.jsx)(Ra,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary700",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:V,children:w(B?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})})]}),(0,i.jsx)(Sl,{state:y,children:o})]})},xc=e=>(0,i.jsx)(Ra,{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}),_c=M.createContext({}),Ic=e=>{const[t,n]=M.useState(null);return(0,i.jsx)(_c.Provider,{value:{clickedRowIndex:t,setClickedRowIndex:n},children:e.children})},vc=({children:e,css:t,hideBorder:n,...s})=>(0,i.jsx)(Ic,{children:(0,i.jsx)(Ra,{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",...s,children:e})});function bc(e){const t=window.matchMedia(e),[n,i]=(0,M.useState)(t.matches);return(0,M.useEffect)(()=>{const e=()=>i(t.matches);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[n,e]),n}function jc(){return bc(cr.mobile)}function Cc(e,t){return{flex:t?"1 1 0":e?"0 0 0":"1",minWidth:t?`${t}px`:e?`${e}px`:void 0}}const yc=M.forwardRef((e,t)=>(0,i.jsx)(Ra,{ref:t,align:"center",className:"table-cell",css:{...Cc(e.width,e.minWidth),color:"$gray800",overflow:"hidden",px:"$3",...e.css},height:1,role:"gridcell",onClick:t=>{e.onClick&&e.onClick(t)},...(0,yr.A)(e,["direction","align","justify","wrap","gap"]),children:e.children}));yc.displayName="Cell";const kc=25,Ac=[25,50,100];var wc=n(7773);const Sc=e=>(0,i.jsx)(jl,{color:"white",css:{background:e.active?"$gray100":"white",border:0,borderInlineStart:"1px solid $gray300",color:e.disabled?"$gray400":"$gray700",cursor:e.cursor,fontWeight:"$medium",inlineSize:"40px",blockSize:"32px",alignItems:"center",justifyContent:"center",borderRadius:"unset"},disabled:e.disabled,textAlign:"center",onClick:()=>{e.onClick()},children:e.children}),Ec=e=>{const t=Hn(),n=jc(),s=e.limit??kc,o=qn(),r=e.offset/s,a=(0,wc.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)*s);return(0,i.jsxs)(yc,{css:{gap:"$6","@tablet":{justifyContent:"space-between"}},children:[(0,i.jsx)(br,{css:{order:1,display:n?"none":void 0},width:150,children:!n&&e.showLimits&&(0,i.jsx)(Ra,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:Ac.map((t,n)=>(0,i.jsx)(Sc,{active:s===t,cursor:"pointer",disabled:!1,onClick:()=>{e.setLimit?.(t)},children:t},n))})}),!n&&(e.totalCount>s?(0,i.jsxs)(Ra,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:3,"& > button:first-child":{borderLeft:"none"}},children:[(0,i.jsx)(Sc,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(Ya,{icon:"arrow-left"})}),e.numberOfPages<=7?(0,wc.A)(0,e.numberOfPages).map(t=>(0,i.jsx)(Sc,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*s),children:t+1},t)):(0,i.jsxs)(i.Fragment,{children:[!a.includes(0)&&(0,i.jsx)(Sc,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(0),children:"1"}),!a.includes(1)&&(0,i.jsx)(Sc,{active:!1,cursor:"default",disabled:!1,onClick:Hl.A,children:(0,i.jsx)(Ya,{icon:"ellipsis"})}),a.map(t=>(0,i.jsx)(Sc,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*s),children:t+1},t)),!a.includes(e.numberOfPages-2)&&(0,i.jsx)(Sc,{active:!1,cursor:"default",disabled:!1,onClick:Hl.A,children:(0,i.jsx)(Ya,{icon:"ellipsis"})}),!a.includes(e.numberOfPages-1)&&(0,i.jsx)(Sc,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset((e.numberOfPages-1)*s),children:e.numberOfPages})]}),(0,i.jsx)(Sc,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(Ya,{icon:"arrow-right"})})]}):(0,i.jsx)(br,{css:{order:3}})),n&&(0,i.jsx)(Ra,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:1,width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:(0,i.jsx)(Sc,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(Ya,{icon:"arrow-left"})})}),(0,i.jsx)(br,{css:{order:2,flex:"1","@tablet":{order:3,flex:"unset"}},textAlign:n?"center":"end",width:150,children:n?[...o(t("page_1_of_2_92409"),(0,i.jsx)("b",{children:r+1}),(0,i.jsx)("b",{children:e.numberOfPages}))]:t("_1_2_sur_3_79592",r*s+1,c,e.totalCount)}),n&&(0,i.jsx)(Ra,{css:{border:"1px solid $gray300",order:3,borderRadius:"$1",overflow:"hidden",width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:(0,i.jsx)(Sc,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(Ya,{icon:"arrow-right"})})})]})},Tc=e=>{const{setClickedRowIndex:t}=M.useContext(_c);return(0,i.jsx)(Ra,{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})},zc=e=>(0,i.jsx)(Tc,{css:{borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",height:"56px",...e.css},children:e.children}),Oc=({css:e,filters:t,headerCells:n,limit:s,numberOfPages:o,offset:r,rows:a,setLimit:l,setOffset:d,showLimits:c=!1,showPagination:u=!0,title:h,totalCount:m})=>{const g=(c||u)&&"number"==typeof o&&"number"==typeof r&&"function"==typeof d&&(m??0)>0;return(0,i.jsxs)(br,{css:{...e},children:[(0,i.jsxs)(Ra,{align:"center",css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $6"},gap:"3",children:[h&&(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"textLg",fontWeight:"medium",children:h}),t]}),(0,i.jsxs)(vc,{role:"grid",children:[(0,i.jsx)(xc,{css:{borderRadius:"0 !important",borderTop:"1px solid $gray200"},children:n}),a,g&&(0,i.jsx)(zc,{children:(0,i.jsx)(Ec,{limit:s,numberOfPages:o,offset:r,setLimit:l,setOffset:d,showLimits:c,totalCount:m??0})})]})]})};function Rc(){const e=Hn();return t=>(0,ic.A)(t.map(t=>({value:t,translation:e(t)})),({translation:e})=>u(e)).map(({value:e,translation:t},n)=>(0,i.jsx)("option",{value:e,children:t},n))}var $c=n(4741);function Dc(e,t=500){return(0,M.useCallback)((0,$c.A)(e,t),[])}function Pc(e,t=500){const[n,i]=(0,M.useState)(e),[s,o]=(0,M.useState)(e),r=Dc(e=>{o(e)},t);return[n,s,e=>{i(e),r(e)}]}const Fc=e=>(0,i.jsx)(Ra,{align:"center",className:"table-header-cell",css:{...Cc(e.width,e.minWidth),color:"$gray500",overflow:"hidden",px:"$3",...e.css},height:1,role:"columnheader",tabIndex:0,onClick:()=>{e.onClick?.()},...(0,yr.A)(e,["aria-label","direction","align","justify","wrap","gap"]),children:e.children}),Mc=e=>(0,i.jsx)(Ra,{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)(ec,{borderRadius:"$1",height:1,width:1})});function Nc(e){return e.endsWith("@weezevent.com")||e.endsWith("@weeztix.com")||e.endsWith("@kaboodle.com")}function Lc(e){return["benjamin.vuitton@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(e)}const Bc=e=>(0,i.jsxs)(Pd,{isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Ud,{children:e.triggerElem||(0,i.jsx)(Ra,{align:"center",css:{cursor:"pointer"},height:20,justify:"center",width:20,children:(0,i.jsx)(Ya,{icon:"ellipsis-vertical"})})}),(0,i.jsx)(Vd,{placement:"bottom-end",children:e.children})]}),Vc=({css:e,children:t,hideIcon:n,to:s,...o})=>{const r=new URL(s.toString(),D.HEAVENT_APP_URL),a=n?void 0:["http:","https:"].includes(r.protocol)&&r.origin!==location.origin?"arrow-up-right-from-square":o.download?"arrow-down-to-bracket":void 0;return(0,i.jsx)(Ra,{align:"center",css:{cursor:"pointer",fontWeight:"$medium","&:hover":{textDecoration:"underline"},...e},gap:"2",children:(0,i.jsxs)(Ha,{to:r,...o,children:[t,a&&(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:a})})]})})};Vc.displayName="LinkText";const Uc=({children:e,css:t,gap:n,justify:s,width:o})=>(0,i.jsx)(yc,{width:o??100,children:(0,i.jsx)(Ra,{align:"center",className:"h-controls",css:{cursor:"pointer",display:"none",...t},gap:n??"6",height:1,justify:s,width:1,onClick:Al,children:e})});let Wc=class{translationService;constructor(e){this.translationService=e}now(){return Bs.c9.utc()}invalid(){return Bs.c9.invalid("Invalid")}toLocaleString(e,t){return e.toLocaleString(t,{locale:this.translationService.language.toString().toLowerCase()})}};function Gc(e){return e.infos?.billingAddress?.company||""}function Hc(e){return e.infos?.vatExonerated?e.amountCents:1.2*e.amountCents}function qc(e){switch(e){case Ke.Refunded:return{color:"warning",leftIcon:"rotate-left"};case Ke.Paid:return{color:"success",leftIcon:"check"};case Ke.Overdue:return{color:"error",leftIcon:"alarm-clock"};case Ke.Waiting:return{color:"error",leftIcon:"xmark"};default:return nl()}}var Yc;Wc=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Wc),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"}(Yc||(Yc={}));const Kc=e=>{const t=Hn(),n=Gn(Wc),{user:s}=ni(),o=new Intl.NumberFormat("fr-fr",{style:"currency",currency:"EUR"}),r=(a=e.invoice).isRefunded?Ke.Refunded:a.paidAt?Ke.Paid:a.insertedAte.markAsPaid?.(),children:t("marqu_e_comme_p_72620")}),!e.invoice.isRefunded&&(0,i.jsx)(Ld,{icon:"rotate-left",onClick:()=>e.markAsRefunded?.(),children:t("marqu_e_comme_r_27551")})]})})]})},Zc=hr("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}}),Xc=hr("div",{display:"flex",flexDirection:"column",overflow:"auto",width:"100%",variants:{mobile:{true:{flex:"1",px:"$4"},false:{px:"$8"}}}}),Jc=hr("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"}}}}),Qc=({buttons:e,children:t,onClose:n,role:s,size:o})=>{const r=jc();return Od(n),Ka("common-front/src/components/modals/__deprecated/modal/modal.tsx","common-front/src/components/modals/base/modal.tsx"),(0,Wt.createPortal)((0,i.jsx)(Ra,{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)(Zc,{mobile:r,open:!0,role:s,size:o,onClick:e=>Al(e,!1),onMouseDown:e=>Al(e,!1),children:[(0,i.jsx)(Xc,{mobile:r,children:t}),e&&(0,i.jsx)(Jc,{mobile:r,children:e})]})}),document.body)};var eu=n(6666);const tu=e=>{const t=Hn(),{mutate:n,isLoading:s}=function(e={}){return Kn("mutation BackofficeInvoiceMarkAsPaid($invoiceId: InvoiceId!, $transactionId: String!) {\n backofficeInvoiceMarkAsPaid(invoiceId: $invoiceId, transactionId: $transactionId)\n}\n",e)}(),{data:o}=Yn("query QontoTransactions {\n backoffice {\n qontoTransactions {\n id\n label\n amount\n }\n }\n}\n",{},[]),[r,a]=(0,M.useState)(null);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(br,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Ya,{icon:"file-invoice"})}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("marqu_e_une_fac_47139")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(fc,{isSearchVisible:!0,label:t("s_lectionner_un_46296"),values:r?[r]:[],onChange:e=>{a((0,eu.A)(e)||null)},children:(o.backoffice?.qontoTransactions??[]).map(e=>(0,i.jsxs)("option",{value:e.id,children:[e.label," (",e.amount,"€)"]},e.id))}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{disabled:!r,isLoading:s,onClick:async()=>{await n({invoiceId:e.invoiceId,transactionId:r}),e.reload()},children:t("marqu_e_comme_p_72620")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},nu=e=>{const{mutate:t}=function(e={}){return Kn("mutation BackofficeInvoiceMarkAsRefunded($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsRefunded(invoiceId: $invoiceId)\n}\n",e)}(),[n,s]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kc,{invoice:e.invoice,isBackoffice:!0,markAsPaid:()=>s(!0),markAsRefunded:async()=>{await t({invoiceId:e.invoice.id}),e.reload()},showColumn:e.showColumn}),n&&(0,i.jsx)(tu,{invoiceId:e.invoice.id,reload:e.reload,onClose:()=>{s(!1)}})]})},iu=()=>{const{history:e,translate:t}=cl(),n=Qn(),s=Rc(),{user:o}=ni(),[r,a,l]=Pc(""),[d,c]=(0,M.useState)([]),[u,h]=(0,M.useState)(0),{data:g,isLoading:p,reload:f}=Yn("query BackofficeInvoices($name: String, $states: [InvoiceState!], $offset: Int) {\n backoffice {\n invoices(name: $name, states: $states, limit: 25, offset: $offset) {\n nodes {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n paidAt\n url\n organizationsNames\n dealId\n isRefunded\n insertedAt\n infos\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{name:m(a)?a:void 0,states:eo(d)?d:void 0,offset:u},[]);const[x,_]=(0,M.useState)(()=>{const e=n.getItem($l.BACKOFFICE_INVOICES_COLUMNS);return e?JSON.parse(e):[]}),I=(0,M.useCallback)(e=>{_(e),n.setItem($l.BACKOFFICE_INVOICES_COLUMNS,JSON.stringify(e))},[_]),v=(0,M.useCallback)(async e=>{try{const t=new URLSearchParams;e?t.set("date",e):eo(d)&&t.set("states",d.join(","));const n=await fetch(`${D.HEAVENT_API_URL}/invoice/all?${t}`,{method:"post",headers:{[F]:await q()||""}}),{link:i}=await n.json();window.open(i,"_blank")}catch{window.alert(t("impossible_d_ex_55872"))}},[d]),b=e=>x.includes(e);return(0,i.jsx)(br,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("factures_03552")}),(0,i.jsx)(br,{children:(0,i.jsxs)(fc,{isSelectAllVisible:!0,multiple:!0,placeholder:"Colonnes visibles",values:x,onChange:I,children:[(0,i.jsx)("option",{value:"organization",children:t("organisation_71863")}),(0,i.jsx)("option",{value:"customerName",children:t("nom_du_client_28343")}),(0,i.jsx)("option",{value:"date",children:t("Date")}),(0,i.jsx)("option",{value:"paidAt",children:t("pay_e_le_92377")}),(0,i.jsx)("option",{value:"amount",children:t("montant_55595")}),(0,i.jsx)("option",{value:"amountTTC",children:t("montant_ttc_86677")}),(0,i.jsx)("option",{value:"state",children:t("status_06428")}),(0,i.jsx)("option",{value:"transactionId",children:t("id_de_la_transa_98869")})]})}),(0,i.jsx)(jl,{onClick:()=>{e.push(Os.HOME)},children:"Home"}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"eye",onClick:()=>{e.push(Os.BACKOFFICE_ORGANIZATIONS)},children:t("voir_les_organi_78756")}),(0,i.jsx)(Ld,{icon:"file-export",onClick:()=>v(null),children:"Exporter les factures sélectionnées"}),(0,i.jsx)(Ld,{icon:"file-export",onClick:()=>v("this-month"),children:t("exporter_les_fa_11017")}),(0,i.jsx)(Ld,{icon:"file-export",onClick:()=>v("last-month"),children:t("exporter_les_fa_01571")}),(0,i.jsx)(Ld,{icon:"file-export",onClick:()=>v("all"),children:t("exporter_toutes_46318")})]})]})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Oc,{filters:(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("id_ou_nom_25064"),value:r,onChange:e=>{l(e),h(0)}})}),(0,i.jsx)(br,{width:200,children:(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,values:d,onChange:c,children:s(pn)})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:t("num_ro_de_factu_68150")}),b(Yc.Organization)&&(0,i.jsx)(Fc,{children:t("organisation_71863")}),b(Yc.CustomerName)&&(0,i.jsx)(Fc,{children:t("nom_du_client_28343")}),b(Yc.Date)&&(0,i.jsx)(Fc,{children:t("Date")}),b(Yc.PaidAt)&&(0,i.jsx)(Fc,{children:t("pay_e_le_92377")}),b(Yc.Amount)&&(0,i.jsx)(Fc,{children:t("montant_55595")}),b(Yc.AmountTTC)&&(0,i.jsx)(Fc,{children:t("montant_ttc_86677")}),b(Yc.State)&&(0,i.jsx)(Fc,{children:t("status_06428")}),b(Yc.TransactionId)&&(0,i.jsx)(Fc,{children:t("id_de_la_transa_98869")}),Lc(o?.email||"")&&(0,i.jsx)(Fc,{width:100})]}),numberOfPages:g.backoffice?.invoices.numberOfPages??0,offset:u,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.backoffice.invoices.nodes.map(e=>(0,i.jsx)(nu,{invoice:e,reload:f,showColumn:b},e.id))}),setOffset:h,title:t("liste_des_factu_86735"),totalCount:g.backoffice?.invoices.totalCount??0})]})})};let su=class{countries;countriesCodes;phoneCodes;constructor(e){const t=e.translate.bind(e);this.countries=(0,ic.A)([{phoneCode:"+93",code:"AF",name:t("afghanistan_59344"),nationality:t("afghan_10143"),emoji:"🇦🇫",language:["ps","ps-AR"],smsPrice:.27},{phoneCode:"+35818",code:"AX",name:t("_land_islands_92853"),nationality:t("_land_island_62794"),emoji:"🇦🇽"},{phoneCode:"+355",code:"AL",name:t("albania_07621"),nationality:t("albanian_82021"),emoji:"🇦🇱",language:["sq","sq-AL"],smsPrice:.12},{phoneCode:"+213",code:"DZ",name:t("algeria_37723"),nationality:t("algerian_97855"),emoji:"🇩🇿",language:"ar-DZ",smsPrice:.285},{phoneCode:"+1684",code:"AS",name:t("american_samoa_95023"),nationality:t("american_samoan_76272"),emoji:"🇦🇸"},{phoneCode:"+376",code:"AD",name:t("andorra_45150"),nationality:t("andorran_97838"),emoji:"🇦🇩",smsPrice:.52},{phoneCode:"+244",code:"AO",name:t("angola_15815"),nationality:t("angolan_91942"),emoji:"🇦🇴",smsPrice:.17},{phoneCode:"+1264",code:"AI",name:t("anguilla_53408"),nationality:t("anguillan_92612"),emoji:"🇦🇮"},{phoneCode:"+1268",code:"AG",name:t("antigua_and_bar_05164"),nationality:t("antiguan_or_bar_26833"),emoji:"🇦🇬"},{phoneCode:"+54",code:"AR",name:t("argentina_92219"),nationality:t("argentine_14780"),emoji:"🇦🇷",language:"es-AR",smsPrice:.11},{phoneCode:"+374",code:"AM",name:t("armenia_90330"),nationality:t("armenian_87788"),language:["hy","hy-AM"],emoji:"🇦🇲"},{phoneCode:"+297",code:"AW",name:t("aruba_62942"),nationality:t("aruban_18515"),emoji:"🇦🇼",smsPrice:.33},{phoneCode:"+61",code:"AU",name:t("australia_84647"),nationality:t("australian_83553"),emoji:"🇦🇺",language:"en-AU",smsPrice:.093},{phoneCode:"+43",code:"AT",name:t("austria_67457"),nationality:t("austrian_39761"),emoji:"🇦🇹",language:"de-AT",smsPrice:.066},{phoneCode:"+994",code:"AZ",name:t("azerbaijan_14476"),nationality:t("azerbaijani_az_92428"),emoji:"🇦🇿",language:"az-AZ",smsPrice:.39},{phoneCode:"+1242",code:"BS",name:t("bahamas_33701"),nationality:t("bahamian_86817"),emoji:"🇧🇸"},{phoneCode:"+973",code:"BH",name:t("bahrain_43417"),nationality:t("bahraini_76209"),emoji:"🇧🇭",language:"ar-BH",smsPrice:.12},{phoneCode:"+880",code:"BD",name:t("bangladesh_48531"),nationality:t("bangladeshi_66399"),emoji:"🇧🇩",smsPrice:.425},{phoneCode:"+1246",code:"BB",name:t("barbados_57235"),nationality:t("barbadian_02319"),emoji:"🇧🇧"},{phoneCode:"+375",code:"BY",name:t("belarus_97102"),nationality:t("belarusian_60742"),emoji:"🇧🇾",language:["be","be-BY"],smsPrice:.31},{phoneCode:"+32",code:"BE",name:t("belgium_21048"),nationality:t("belgian_00407"),emoji:"🇧🇪",language:["fr-BE","nl-BE"],smsPrice:.094},{phoneCode:"+501",code:"BZ",name:t("belize_94460"),nationality:t("belizean_90827"),emoji:"🇧🇿",language:"en-BZ",smsPrice:0},{phoneCode:"+229",code:"BJ",name:t("benin_88614"),nationality:t("beninese_benin_55987"),emoji:"🇧🇯",smsPrice:.04},{phoneCode:"+1441",code:"BM",name:t("bermuda_84448"),nationality:t("bermudian_berm_58878"),emoji:"🇧🇲"},{phoneCode:"+975",code:"BT",name:t("bhutan_12608"),nationality:t("bhutanese_34101"),emoji:"🇧🇹",smsPrice:.39},{phoneCode:"+591",code:"BO",name:t("bolivia_plurin_43912"),nationality:t("bolivian_98429"),emoji:"🇧🇴",language:["es-BO","qu-BO"],smsPrice:.38},{phoneCode:"+5997",code:"BQ",name:t("bonaire_sint_e_69605"),nationality:t("bonaire_07340"),emoji:"🇧🇶"},{phoneCode:"+387",code:"BA",name:t("bosnia_and_herz_91990"),nationality:t("bosnian_or_herz_88694"),emoji:"🇧🇦",language:["bs-BA","hr-BA","sr-BA"],smsPrice:.46},{phoneCode:"+267",code:"BW",name:t("botswana_49258"),nationality:t("motswana_botsw_32461"),emoji:"🇧🇼",smsPrice:.13},{phoneCode:"+55",code:"BR",name:t("brazil_03275"),nationality:t("brazilian_74116"),emoji:"🇧🇷",language:"pt-BR",smsPrice:.051},{phoneCode:"+246",code:"IO",name:t("british_indian_92949"),nationality:t("british_43680"),emoji:"🇮🇴"},{phoneCode:"+673",code:"BN",name:t("brunei_darussal_84695"),nationality:t("bruneian_06218"),emoji:"🇧🇳",language:"ms-BN",smsPrice:.05},{phoneCode:"+359",code:"BG",name:t("bulgaria_97045"),nationality:t("bulgarian_79288"),emoji:"🇧🇬",language:["bg","bg-BG"],smsPrice:.16},{phoneCode:"+226",code:"BF",name:t("burkina_faso_55299"),nationality:t("burkinab_02690"),emoji:"🇧🇫",smsPrice:.032},{phoneCode:"+257",code:"BI",name:t("burundi_85561"),nationality:t("burundian_35605"),emoji:"🇧🇮",smsPrice:.05},{phoneCode:"+238",code:"CV",name:t("cabo_verde_28261"),nationality:t("cabo_verdean_88842"),emoji:"🇨🇻",smsPrice:.2},{phoneCode:"+855",code:"KH",name:t("cambodia_77971"),nationality:t("cambodian_19577"),emoji:"🇰🇭",smsPrice:.52},{phoneCode:"+237",code:"CM",name:t("cameroon_44200"),nationality:t("cameroonian_12953"),emoji:"🇨🇲",smsPrice:.024},{phoneCode:"+1",code:"CA",name:t("canada_52584"),nationality:t("canadian_90836"),emoji:"🇨🇦",language:["en-CA","fr-CA"],smsPrice:.03},{phoneCode:"+1345",code:"KY",name:t("cayman_islands_80923"),nationality:t("caymanian_07521"),emoji:"🇰🇾"},{phoneCode:"+236",code:"CF",name:t("central_african_74182"),nationality:t("central_african_89873"),emoji:"🇨🇫",smsPrice:.053},{phoneCode:"+235",code:"TD",name:t("chad_58721"),nationality:t("chadian_55061"),emoji:"🇹🇩",smsPrice:.035},{phoneCode:"+56",code:"CL",name:t("chile_06923"),nationality:t("chilean_69498"),emoji:"🇨🇱",language:"es-CL",smsPrice:.13},{phoneCode:"+86",code:"CN",name:t("china_40708"),nationality:t("chinese_12117"),emoji:"🇨🇳",language:["zh","zh-CN"],smsPrice:.055},{phoneCode:"+6189164",code:"CX",name:t("christmas_islan_46649"),nationality:t("christmas_islan_46649"),emoji:"🇨🇽"},{phoneCode:"+6189162",code:"CC",name:t("cocos_keeling_98180"),nationality:t("cocos_island_82627"),emoji:"🇨🇨"},{phoneCode:"+57",code:"CO",name:t("colombia_37632"),nationality:t("colombian_28222"),emoji:"🇨🇴",language:"es-CO",smsPrice:.033},{phoneCode:"+269",code:"KM",name:t("comoros_35439"),nationality:t("comoran_comori_49754"),emoji:"🇰🇲",smsPrice:.42},{phoneCode:"+242",code:"CG",name:t("congo_republic_97304"),nationality:t("congolese_04965"),emoji:"🇨🇬",smsPrice:.045},{phoneCode:"+243",code:"CD",name:t("congo_democrat_80102"),nationality:t("congolese_04965"),emoji:"🇨🇩",smsPrice:.2},{phoneCode:"+682",code:"CK",name:t("cook_islands_51542"),nationality:t("cook_island_99158"),emoji:"🇨🇰",smsPrice:.12},{phoneCode:"+506",code:"CR",name:t("costa_rica_57058"),nationality:t("costa_rican_17127"),emoji:"🇨🇷",language:"es-CR",smsPrice:.061},{phoneCode:"+225",code:"CI",name:t("c_te_d_ivoire_55380"),nationality:t("ivorian_01729"),emoji:"🇨🇮",smsPrice:.055},{phoneCode:"+385",code:"HR",name:t("croatia_52101"),nationality:t("croatian_62900"),emoji:"🇭🇷",language:["hr","hr-HR"],smsPrice:.13},{phoneCode:"+53",code:"CU",name:t("cuba_11922"),nationality:t("cuban_00956"),emoji:"🇨🇺",smsPrice:.08},{phoneCode:"+5999",code:"CW",name:t("cura_ao_46587"),nationality:t("cura_aoan_65055"),emoji:"🇨🇼"},{phoneCode:"+357",code:"CY",name:t("cyprus_86967"),nationality:t("cypriot_85282"),emoji:"🇨🇾",smsPrice:.083},{phoneCode:"+420",code:"CZ",name:t("czech_republic_57570"),nationality:t("czech_42120"),emoji:"🇨🇿",language:["cs","cs-CZ"],smsPrice:.08},{phoneCode:"+45",code:"DK",name:t("denmark_28356"),nationality:t("danish_44544"),emoji:"🇩🇰",language:["da","da-DK"],smsPrice:.06},{phoneCode:"+253",code:"DJ",name:t("djibouti_38156"),nationality:t("djiboutian_72034"),emoji:"🇩🇯",smsPrice:.12},{phoneCode:"+1767",code:"DM",name:t("dominica_13395"),nationality:t("dominican_54004"),emoji:"🇩🇲"},{phoneCode:["+1809","+1829","+1849"],code:"DO",name:t("dominican_repub_08891"),nationality:t("dominican_54004"),emoji:"🇩🇴",language:"es-DO"},{phoneCode:"+593",code:"EC",name:t("ecuador_25933"),nationality:t("ecuadorian_50591"),emoji:"🇪🇨",language:["es-EC","qu-EC"],smsPrice:.48},{phoneCode:"+20",code:"EG",name:t("egypt_61058"),nationality:t("egyptian_75798"),emoji:"🇪🇬",language:"ar-EG",smsPrice:.45},{phoneCode:"+503",code:"SV",name:t("el_salvador_37036"),nationality:t("salvadoran_02475"),emoji:"🇸🇻",language:"es-SV",smsPrice:.34},{phoneCode:"+240",code:"GQ",name:t("equatorial_guin_39570"),nationality:t("equatorial_guin_44537"),emoji:"🇬🇶",smsPrice:.21},{phoneCode:"+291",code:"ER",name:t("eritrea_67366"),nationality:t("eritrean_20355"),emoji:"🇪🇷",smsPrice:.045},{phoneCode:"+372",code:"EE",name:t("estonia_58256"),nationality:t("estonian_46354"),emoji:"🇪🇪",language:["et","et-EE"],smsPrice:.08},{phoneCode:"+251",code:"ET",name:t("ethiopia_72971"),nationality:t("ethiopian_03019"),emoji:"🇪🇹",smsPrice:.08},{phoneCode:"+500",code:"FK",name:t("falkland_island_59316"),nationality:t("falkland_island_15848"),emoji:"🇫🇰"},{phoneCode:"+298",code:"FO",name:t("faroe_islands_71549"),nationality:t("faroese_32806"),emoji:"🇫🇴",language:["fo","fo-FO"],smsPrice:.046},{phoneCode:"+679",code:"FJ",name:t("fiji_36369"),nationality:t("fijian_39649"),emoji:"🇫🇯",smsPrice:.21},{phoneCode:"+358",code:"FI",name:t("finland_07531"),nationality:t("finnish_24918"),emoji:"🇫🇮",language:["fi","fi-FI","se-FI","sv-FI"],smsPrice:.083},{phoneCode:"+33",code:"FR",name:t("france_26614"),nationality:t("french_86034"),emoji:"🇫🇷",language:["fr","fr-FR"],smsPrice:.045},{phoneCode:"+594",code:"GF",name:t("french_guiana_80598"),nationality:t("french_guianese_02041"),emoji:"🇬🇫",smsPrice:.17},{phoneCode:"+689",code:"PF",name:t("french_polynesi_50842"),nationality:t("french_polynesi_47751"),emoji:"🇵🇫",smsPrice:.18},{phoneCode:"+241",code:"GA",name:t("gabon_58286"),nationality:t("gabonese_62984"),emoji:"🇬🇦",smsPrice:.045},{phoneCode:"+220",code:"GM",name:t("gambia_93575"),nationality:t("gambian_30767"),emoji:"🇬🇲",smsPrice:.19},{phoneCode:"+995",code:"GE",name:t("georgia_93003"),nationality:t("georgian_79366"),emoji:"🇬🇪",language:["ka","ka-GE"]},{phoneCode:"+49",code:"DE",name:t("germany_31193"),nationality:t("german_36386"),emoji:"🇩🇪",language:["de","de-DE"],smsPrice:.089},{phoneCode:"+233",code:"GH",name:t("ghana_32464"),nationality:t("ghanaian_99745"),emoji:"🇬🇭",smsPrice:.033},{phoneCode:"+350",code:"GI",name:t("gibraltar_24360"),nationality:t("gibraltar_24360"),emoji:"🇬🇮",smsPrice:.076},{phoneCode:"+30",code:"GR",name:t("greece_28837"),nationality:t("greek_hellenic_39006"),emoji:"🇬🇷",language:["el","el-GR"],smsPrice:.061},{phoneCode:"+299",code:"GL",name:t("greenland_80916"),nationality:t("greenlandic_67508"),emoji:"🇬🇱",smsPrice:.036},{phoneCode:"+1473",code:"GD",name:t("grenada_04221"),nationality:t("grenadian_25686"),emoji:"🇬🇩"},{phoneCode:"+590",code:"GP",name:t("guadeloupe_95839"),nationality:t("guadeloupe_95839"),emoji:"🇬🇵"},{phoneCode:"+1671",code:"GU",name:t("guam_76384"),nationality:t("guamanian_guam_01132"),emoji:"🇬🇺"},{phoneCode:"+502",code:"GT",name:t("guatemala_49597"),nationality:t("guatemalan_60946"),emoji:"🇬🇹",language:"es-GT",smsPrice:.3},{phoneCode:["+441481","+447781","+447839","+447911"],code:"GG",name:t("guernsey_87507"),nationality:t("channel_island_53762"),emoji:"🇬🇬"},{phoneCode:"+224",code:"GN",name:t("guinea_20770"),nationality:t("guinean_42564"),emoji:"🇬🇳",smsPrice:.056},{phoneCode:"+245",code:"GW",name:t("guinea_bissau_80728"),nationality:t("bissau_guinean_66742"),emoji:"🇬🇼",smsPrice:.09},{phoneCode:"+592",code:"GY",name:t("guyana_92443"),nationality:t("guyanese_56902"),emoji:"🇬🇾",smsPrice:.3},{phoneCode:"+509",code:"HT",name:t("haiti_99471"),nationality:t("haitian_50142"),emoji:"🇭🇹",smsPrice:.3},{phoneCode:"+379",code:"VA",name:t("vatican_city_st_63732"),nationality:t("vatican_36370"),emoji:"🇻🇦"},{phoneCode:"+504",code:"HN",name:t("honduras_79402"),nationality:t("honduran_35392"),emoji:"🇭🇳",language:"es-HN",smsPrice:.267},{phoneCode:"+852",code:"HK",name:t("hong_kong_96239"),nationality:t("hong_kong_hong_64846"),emoji:"🇭🇰",language:"zh-HK",smsPrice:.079},{phoneCode:"+36",code:"HU",name:t("hungary_57981"),nationality:t("hungarian_magy_62212"),emoji:"🇭🇺",language:["hu","hu-HU"],smsPrice:.106},{phoneCode:"+354",code:"IS",name:t("iceland_79438"),nationality:t("icelandic_17689"),emoji:"🇮🇸",language:["is","is-IS"],smsPrice:.085},{phoneCode:"+91",code:"IN",name:t("india_39466"),nationality:t("indian_25592"),emoji:"🇮🇳",language:["gu","gu-IN","hi","hi-IN","kn","kn-IN","kok","kok-IN","mr","mr-IN","pa","pa-IN","sa","sa-IN","ta","ta-IN","te","te-IN"],smsPrice:.078},{phoneCode:"+62",code:"ID",name:t("indonesia_65003"),nationality:t("indonesian_29723"),emoji:"🇮🇩",language:["id","id-ID"],smsPrice:.464},{phoneCode:"+98",code:"IR",name:t("iran_76293"),nationality:t("iranian_persia_76791"),emoji:"🇮🇷",language:["fa","fa-IR"],smsPrice:.38},{phoneCode:"+964",code:"IQ",name:t("iraq_82027"),nationality:t("iraqi_31025"),emoji:"🇮🇶",language:"ar-IQ",smsPrice:.33},{phoneCode:"+353",code:"IE",name:t("ireland_62034"),nationality:t("irish_35774"),emoji:"🇮🇪",language:"en-IE",smsPrice:.065},{phoneCode:["+441624","+447524","+447624","+447924"],code:"IM",name:t("isle_of_man_64982"),nationality:t("manx_86314"),emoji:"🇮🇲"},{phoneCode:"+972",code:"IL",name:t("israel_20033"),nationality:t("israeli_69936"),emoji:"🇮🇱",language:["he","he-IL"],smsPrice:.3},{phoneCode:"+39",code:"IT",name:t("italy_14828"),nationality:t("italian_56623"),emoji:"🇮🇹",language:["it","it-IT"],smsPrice:.038},{phoneCode:"+1876",code:"JM",name:t("jamaica_55090"),nationality:t("jamaican_58881"),emoji:"🇯🇲",language:"en-JM"},{phoneCode:"+81",code:"JP",name:t("japan_61810"),nationality:t("japanese_82636"),emoji:"🇯🇵",language:["ja","ja-JP"],smsPrice:.08},{phoneCode:"+441534",code:"JE",name:t("jersey_78898"),nationality:t("channel_island_53762"),emoji:"🇯🇪"},{phoneCode:"+962",code:"JO",name:t("jordan_36280"),nationality:t("jordanian_41310"),emoji:"🇯🇴",language:"ar-JO",smsPrice:.39},{phoneCode:["+76","+77"],code:"KZ",name:t("kazakhstan_30541"),nationality:t("kazakhstani_ka_27277"),emoji:"🇰🇿",language:["kk","kk-KZ"]},{phoneCode:"+254",code:"KE",name:t("kenya_67944"),nationality:t("kenyan_92311"),emoji:"🇰🇪",language:["sw","sw-KE"],smsPrice:.3},{phoneCode:"+686",code:"KI",name:t("kiribati_25369"),nationality:t("i_kiribati_66745"),emoji:"🇰🇮",smsPrice:.036},{phoneCode:"+850",code:"KP",name:t("korea_democrat_48584"),nationality:t("north_korean_16553"),emoji:"🇰🇵",smsPrice:.045},{phoneCode:"+82",code:"KR",name:t("korea_republic_72269"),nationality:t("south_korean_89943"),emoji:"🇰🇷",language:["ko","ko-KR"],smsPrice:.029},{phoneCode:"+965",code:"KW",name:t("kuwait_22026"),nationality:t("kuwaiti_76148"),emoji:"🇰🇼",language:"ar-KW",smsPrice:.327},{phoneCode:"+996",code:"KG",name:t("kyrgyzstan_84406"),nationality:t("kyrgyzstani_ky_19120"),emoji:"🇰🇬",language:["ky","ky-KG"],smsPrice:.34},{phoneCode:"+856",code:"LA",name:t("lao_people_s_de_31069"),nationality:t("lao_laotian_28318"),emoji:"🇱🇦",smsPrice:.273},{phoneCode:"+371",code:"LV",name:t("latvia_73526"),nationality:t("latvian_53651"),emoji:"🇱🇻",language:["lv","lv-LV"],smsPrice:.057},{phoneCode:"+961",code:"LB",name:t("lebanon_49493"),nationality:t("lebanese_43182"),emoji:"🇱🇧",language:"ar-LB",smsPrice:.32},{phoneCode:"+266",code:"LS",name:t("lesotho_91086"),nationality:t("basotho_52532"),emoji:"🇱🇸",smsPrice:.35},{phoneCode:"+231",code:"LR",name:t("liberia_12077"),nationality:t("liberian_64388"),emoji:"🇱🇷",smsPrice:.3},{phoneCode:"+218",code:"LY",name:t("libya_26741"),nationality:t("libyan_35337"),emoji:"🇱🇾",language:"ar-LY",smsPrice:.38},{phoneCode:"+424",code:"LI",name:t("liechtenstein_56974"),nationality:t("liechtenstein_56974"),emoji:"🇱🇮",language:"de-LI"},{phoneCode:"+370",code:"LT",name:t("lithuania_95793"),nationality:t("lithuanian_94145"),emoji:"🇱🇹",language:["lt","lt-LT"],smsPrice:.06},{phoneCode:"+352",code:"LU",name:t("luxembourg_15613"),nationality:t("luxembourg_lux_47318"),emoji:"🇱🇺",language:["de-LU","fr-LU"],smsPrice:.1},{phoneCode:"+853",code:"MO",name:t("macao_74812"),nationality:t("macanese_chine_74224"),emoji:"🇲🇴",language:"zh-MO",smsPrice:.038},{phoneCode:"+389",code:"MK",name:t("macedonia_the_19021"),nationality:t("macedonian_20446"),emoji:"🇲🇰",language:["mk","mk-MK"],smsPrice:.095},{phoneCode:"+261",code:"MG",name:t("madagascar_57052"),nationality:t("malagasy_02353"),emoji:"🇲🇬",smsPrice:.029},{phoneCode:"+265",code:"MW",name:t("malawi_27143"),nationality:t("malawian_10093"),emoji:"🇲🇼",smsPrice:.3},{phoneCode:"+60",code:"MY",name:t("malaysia_54920"),nationality:t("malaysian_81474"),emoji:"🇲🇾",language:["ms","ms-MY"],smsPrice:.29},{phoneCode:"+960",code:"MV",name:t("maldives_67432"),nationality:t("maldivian_67878"),emoji:"🇲🇻",language:["dv","dv-MV"],smsPrice:.34},{phoneCode:"+223",code:"ML",name:t("mali_95091"),nationality:t("malian_malines_66005"),emoji:"🇲🇱",smsPrice:.055},{phoneCode:"+356",code:"MT",name:t("malta_73993"),nationality:t("maltese_52729"),emoji:"🇲🇹",language:["mt","mt-MT"],smsPrice:.08},{phoneCode:"+692",code:"MH",name:t("marshall_island_92726"),nationality:t("marshallese_30337"),emoji:"🇲🇭",smsPrice:.045},{phoneCode:"+586",code:"MQ",name:t("martinique_79541"),nationality:t("martiniquais_m_01923"),emoji:"🇲🇶"},{phoneCode:"+222",code:"MR",name:t("mauritania_77906"),nationality:t("mauritanian_68205"),emoji:"🇲🇷",smsPrice:.055},{phoneCode:"+230",code:"MU",name:t("mauritius_10801"),nationality:t("mauritian_09142"),emoji:"🇲🇺",smsPrice:.184},{phoneCode:["+262269","+262639"],code:"YT",name:t("mayotte_91167"),nationality:t("mahoran_45424"),emoji:"🇾🇹"},{phoneCode:"+52",code:"MX",name:t("mexico_21962"),nationality:t("mexican_80494"),emoji:"🇲🇽",language:"es-MX",smsPrice:.92},{phoneCode:"+691",code:"FM",name:t("micronesia_fed_39555"),nationality:t("micronesian_97912"),emoji:"🇫🇲",smsPrice:.045},{phoneCode:"+373",code:"MD",name:t("moldova_republ_08796"),nationality:t("moldovan_76486"),emoji:"🇲🇩"},{phoneCode:"+377",code:"MC",name:t("monaco_72117"),nationality:t("mon_gasque_mon_17281"),emoji:"🇲🇨",language:"fr-MC",smsPrice:.1},{phoneCode:"+976",code:"MN",name:t("mongolia_36757"),nationality:t("mongolian_33711"),emoji:"🇲🇳",language:["mn","mn-MN"],smsPrice:.33},{phoneCode:"+382",code:"ME",name:t("montenegro_78236"),nationality:t("montenegrin_68334"),emoji:"🇲🇪",smsPrice:.15},{phoneCode:"+1664",code:"MS",name:t("montserrat_38432"),nationality:t("montserratian_13585"),emoji:"🇲🇸"},{phoneCode:"+212",code:"MA",name:t("morocco_52420"),nationality:t("moroccan_14305"),emoji:"🇲🇦",language:"ar-MA"},{phoneCode:"+258",code:"MZ",name:t("mozambique_60988"),nationality:t("mozambican_68300"),emoji:"🇲🇿",smsPrice:.32},{phoneCode:"+95",code:"MM",name:t("myanmar_78678"),nationality:t("burmese_66869"),emoji:"🇲🇲",smsPrice:1.1},{phoneCode:"+264",code:"NA",name:t("namibia_19026"),nationality:t("namibian_01490"),emoji:"🇳🇦",smsPrice:.048},{phoneCode:"+674",code:"NR",name:t("nauru_16303"),nationality:t("nauruan_52578"),emoji:"🇳🇷",smsPrice:.21},{phoneCode:"+977",code:"NP",name:t("nepal_49088"),nationality:t("nepali_nepales_64761"),emoji:"🇳🇵",smsPrice:.35},{phoneCode:"+31",code:"NL",name:t("netherlands_38005"),nationality:t("dutch_netherla_42451"),emoji:"🇳🇱",language:["nl","nl-NL"],smsPrice:.095},{phoneCode:"+687",code:"NC",name:t("new_caledonia_14574"),nationality:t("new_caledonian_12113"),emoji:"🇳🇨",smsPrice:.1},{phoneCode:"+64",code:"NZ",name:t("new_zealand_61929"),nationality:t("new_zealander_71823"),emoji:"🇳🇿",language:["en-NZ","mi","mi-NZ"],smsPrice:.14},{phoneCode:"+505",code:"NI",name:t("nicaragua_14531"),nationality:t("nicaraguan_06649"),emoji:"🇳🇮",language:"es-NI",smsPrice:.17},{phoneCode:"+227",code:"NE",name:t("niger_59137"),nationality:t("nigerien_06144"),emoji:"🇳🇪",smsPrice:.067},{phoneCode:"+234",code:"NG",name:t("nigeria_77810"),nationality:t("nigerian_43407"),emoji:"🇳🇬",smsPrice:.47},{phoneCode:"+683",code:"NU",name:t("niue_97570"),nationality:t("niuean_70518"),emoji:"🇳🇺",smsPrice:.045},{phoneCode:"+6723",code:"NF",name:t("norfolk_island_62377"),nationality:t("norfolk_island_62377"),emoji:"🇳🇫"},{phoneCode:"+1670",code:"MP",name:t("northern_marian_94262"),nationality:t("northern_marian_82360"),emoji:"🇲🇵"},{phoneCode:"+47",code:"NO",name:t("norway_14236"),nationality:t("norwegian_50751"),emoji:"🇳🇴",language:["nb","nb-NO","nn-NO","se-NO"],smsPrice:.064},{phoneCode:"+968",code:"OM",name:t("oman_20900"),nationality:t("omani_15042"),emoji:"🇴🇲",language:"ar-OM",smsPrice:.21},{phoneCode:"+92",code:"PK",name:t("pakistan_59697"),nationality:t("pakistani_12622"),emoji:"🇵🇰",language:["ur","ur-PK"],smsPrice:.5},{phoneCode:"+680",code:"PW",name:t("palau_46088"),nationality:t("palauan_73033"),emoji:"🇵🇼",smsPrice:.1},{phoneCode:"+970",code:"PS",name:t("palestine_stat_33253"),nationality:t("palestinian_06829"),emoji:"🇵🇸",smsPrice:.35},{phoneCode:"+507",code:"PA",name:t("panama_16821"),nationality:t("panamanian_07882"),emoji:"🇵🇦",language:"es-PA",smsPrice:.17},{phoneCode:"+675",code:"PG",name:t("papua_new_guine_56959"),nationality:t("papua_new_guine_50302"),emoji:"🇵🇬",smsPrice:.2},{phoneCode:"+595",code:"PY",name:t("paraguay_66859"),nationality:t("paraguayan_50310"),emoji:"🇵🇾",language:"es-PY",smsPrice:.124},{phoneCode:"+51",code:"PE",name:t("peru_23048"),nationality:t("peruvian_85045"),emoji:"🇵🇪",language:["es-PE","qu-PE"],smsPrice:.31},{phoneCode:"+63",code:"PH",name:t("philippines_65361"),nationality:t("philippine_fil_40400"),emoji:"🇵🇭",language:["en-PH","tl","tl-PH"],smsPrice:.243},{phoneCode:"+64",code:"PN",name:t("pitcairn_59104"),nationality:t("pitcairn_island_58961"),emoji:"🇵🇳"},{phoneCode:"+48",code:"PL",name:t("poland_13527"),nationality:t("polish_26779"),emoji:"🇵🇱",language:["pl","pl-PL"],smsPrice:.036},{phoneCode:"+351",code:"PT",name:t("portugal_19698"),nationality:t("portuguese_08463"),emoji:"🇵🇹",language:["pt","pt-PT"],smsPrice:.025},{phoneCode:["+1787","+1939"],code:"PR",name:t("puerto_rico_88176"),nationality:t("puerto_rican_10401"),emoji:"🇵🇷",language:"es-PR"},{phoneCode:"+974",code:"QA",name:t("qatar_70548"),nationality:t("qatari_58016"),emoji:"🇶🇦",language:"ar-QA",smsPrice:.3},{phoneCode:"+262",code:"RE",name:t("r_union_34094"),nationality:t("r_unionese_r_u_86871"),emoji:"🇷🇪",smsPrice:.055},{phoneCode:"+40",code:"RO",name:t("romania_41618"),nationality:t("romanian_49647"),emoji:"🇷🇴",language:["ro","ro-RO"],smsPrice:.09},{phoneCode:"+7",code:"RU",name:t("russian_federat_68392"),nationality:t("russian_12506"),emoji:"🇷🇺",language:["ru","ru-RU","tt","tt-RU"],smsPrice:2.63},{phoneCode:"+250",code:"RW",name:t("rwanda_84901"),nationality:t("rwandan_47719"),emoji:"🇷🇼",smsPrice:.1},{phoneCode:"+590",code:"BL",name:t("saint_barth_lem_80830"),nationality:t("barth_lemois_35003"),emoji:"🇧🇱",smsPrice:.09},{phoneCode:"+290",code:"SH",name:t("saint_helena_a_39384"),nationality:t("saint_helenian_19012"),emoji:"🇸🇭",smsPrice:.1},{phoneCode:"+1869",code:"KN",name:t("saint_kitts_and_74455"),nationality:t("kittitian_or_ne_99867"),emoji:"🇰🇳"},{phoneCode:"+1758",code:"LC",name:t("saint_lucia_60679"),nationality:t("saint_lucian_97267"),emoji:"🇱🇨"},{phoneCode:"+590",code:"MF",name:t("saint_martin_f_87295"),nationality:t("saint_martinois_75974"),emoji:"🇸🇽"},{phoneCode:"+508",code:"PM",name:t("saint_pierre_an_55649"),nationality:t("saint_pierrais_60177"),emoji:"🇵🇲",smsPrice:.13},{phoneCode:"+1784",code:"VC",name:t("saint_vincent_a_23833"),nationality:t("saint_vincentia_81882"),emoji:"🇻🇨"},{phoneCode:"+685",code:"WS",name:t("samoa_25648"),nationality:t("samoan_97653"),emoji:"🇼🇸",smsPrice:.21},{phoneCode:"+378",code:"SM",name:t("san_marino_47437"),nationality:t("sammarinese_71553"),emoji:"🇸🇲",smsPrice:.045},{phoneCode:"+239",code:"ST",name:t("sao_tome_and_pr_10491"),nationality:t("s_o_tom_an_21489"),emoji:"🇸🇹",smsPrice:.045},{phoneCode:"+966",code:"SA",name:t("saudi_arabia_06433"),nationality:t("saudi_saudi_ar_22967"),emoji:"🇸🇦",language:"ar-SA",smsPrice:.215},{phoneCode:"+221",code:"SN",name:t("senegal_38099"),nationality:t("senegalese_64680"),emoji:"🇸🇳",smsPrice:.034},{phoneCode:"+381",code:"RS",name:t("serbia_45061"),nationality:t("serbian_68735"),emoji:"🇷🇸",smsPrice:.46},{phoneCode:"+248",code:"SC",name:t("seychelles_67712"),nationality:t("seychellois_69858"),emoji:"🇸🇨",smsPrice:.3},{phoneCode:"+232",code:"SL",name:t("sierra_leone_02995"),nationality:t("sierra_leonean_86179"),emoji:"🇸🇱",smsPrice:.4},{phoneCode:"+65",code:"SG",name:t("singapore_37928"),nationality:t("singaporean_41916"),emoji:"🇸🇬",language:"zh-SG",smsPrice:.064},{phoneCode:"+1721",code:"SX",name:t("sint_maarten_d_57391"),nationality:t("sint_maarten_82241"),emoji:"🇸🇽"},{phoneCode:"+421",code:"SK",name:t("slovakia_10924"),nationality:t("slovak_69840"),emoji:"🇸🇰",language:["sk","sk-SK"],smsPrice:.068},{phoneCode:"+386",code:"SI",name:t("slovenia_75447"),nationality:t("slovenian_slov_38562"),emoji:"🇸🇮",language:["sl","sl-SI"],smsPrice:.18},{phoneCode:"+677",code:"SB",name:t("solomon_islands_05259"),nationality:t("solomon_island_59052"),emoji:"🇸🇧",smsPrice:.155},{phoneCode:"+252",code:"SO",name:t("somalia_56358"),nationality:t("somali_somalia_97997"),emoji:"🇸🇴",smsPrice:.35},{phoneCode:"+27",code:"ZA",name:t("south_africa_61184"),nationality:t("south_african_82152"),emoji:"🇿🇦",language:["af-ZA","en-ZA","ns","ns-ZA","tn","tn-ZA","xh","xh-ZA","zu","zu-ZA"],smsPrice:.13},{phoneCode:"+500",code:"GS",name:t("south_georgia_a_39555"),nationality:t("south_georgia_o_65055"),emoji:"🇬🇸",smsPrice:.12},{phoneCode:"+211",code:"SS",name:t("south_sudan_88232"),nationality:t("south_sudanese_69140"),emoji:"🇸🇸"},{phoneCode:"+34",code:"ES",name:t("spain_40048"),nationality:t("spanish_74199"),emoji:"🇪🇸",language:["ca","ca-ES","es","es-ES","eu-ES","gl-ES"],smsPrice:.044},{phoneCode:"+94",code:"LK",name:t("sri_lanka_51563"),nationality:t("sri_lankan_09436"),emoji:"🇱🇰",smsPrice:.4},{phoneCode:"+249",code:"SD",name:t("sudan_18427"),nationality:t("sudanese_42330"),emoji:"🇸🇩",smsPrice:.322},{phoneCode:"+597",code:"SR",name:t("suriname_78561"),nationality:t("surinamese_38193"),emoji:"🇸🇷",smsPrice:.3},{phoneCode:"+4779",code:"SJ",name:t("svalbard_and_ja_38511"),nationality:t("svalbard_26353"),emoji:"🇸🇯"},{phoneCode:"+268",code:"SZ",name:t("swaziland_91614"),nationality:t("swazi_88825"),emoji:"🇸🇿",smsPrice:.3},{phoneCode:"+46",code:"SE",name:t("sweden_85663"),nationality:t("swedish_90836"),emoji:"🇸🇪",language:["se-SE","sv","sv-SE"],smsPrice:.098},{phoneCode:"+41",code:"CH",name:t("switzerland_07889"),nationality:t("swiss_23240"),emoji:"🇨🇭",language:["de-CH","fr-CH","it-CH"],smsPrice:.098},{phoneCode:"+963",code:"SY",name:t("syrian_arab_rep_72539"),nationality:t("syrian_06992"),emoji:"🇸🇾",language:["ar-SY","syr","syr-SY"],smsPrice:.37},{phoneCode:"+886",code:"TW",name:t("taiwan_provinc_87264"),nationality:t("chinese_taiwan_24003"),emoji:"🇹🇼",language:"zh-TW",smsPrice:.105},{phoneCode:"+992",code:"TJ",name:t("tajikistan_97104"),nationality:t("tajikistani_21375"),emoji:"🇹🇯",smsPrice:.38},{phoneCode:"+255",code:"TZ",name:t("tanzania_unite_52757"),nationality:t("tanzanian_71935"),emoji:"🇹🇿",smsPrice:.38},{phoneCode:"+66",code:"TH",name:t("thailand_97396"),nationality:t("thai_51972"),emoji:"🇹🇭",language:["th","th-TH"],smsPrice:.066},{phoneCode:"+670",code:"TL",name:t("timor_leste_95604"),nationality:t("timorese_87542"),emoji:"🇹🇱",smsPrice:.22},{phoneCode:"+228",code:"TG",name:t("togo_60267"),nationality:t("togolese_55079"),emoji:"🇹🇬",smsPrice:.03},{phoneCode:"+690",code:"TK",name:t("tokelau_79536"),nationality:t("tokelauan_89444"),emoji:"🇹🇰",smsPrice:.045},{phoneCode:"+676",code:"TO",name:t("tonga_96982"),nationality:t("tongan_52630"),emoji:"🇹🇴",smsPrice:.2},{phoneCode:"+1868",code:"TT",name:t("trinidad_and_to_31939"),nationality:t("trinidadian_or_65515"),emoji:"🇹🇹",language:"en-TT"},{phoneCode:"+216",code:"TN",name:t("tunisia_36732"),nationality:t("tunisian_19451"),emoji:"🇹🇳",language:"ar-TN",smsPrice:.35},{phoneCode:"+90",code:"TR",name:t("turkey_65699"),nationality:t("turkish_85889"),emoji:"🇹🇷",language:["tr","tr-TR"],smsPrice:.033},{phoneCode:"+993",code:"TM",name:t("turkmenistan_86069"),nationality:t("turkmen_63945"),emoji:"🇹🇲"},{phoneCode:"+1649",code:"TC",name:t("turks_and_caico_34033"),nationality:t("turks_and_caico_41685"),emoji:"🇹🇨"},{phoneCode:"+688",code:"TV",name:t("tuvalu_52410"),nationality:t("tuvaluan_49403"),emoji:"🇹🇻",smsPrice:.12},{phoneCode:"+256",code:"UG",name:t("uganda_42928"),nationality:t("ugandan_07085"),emoji:"🇺🇬",smsPrice:.3},{phoneCode:"+380",code:"UA",name:t("ukraine_86632"),nationality:t("ukrainian_77624"),emoji:"🇺🇦",language:["uk","uk-UA"],smsPrice:.26},{phoneCode:"+971",code:"AE",name:t("united_arab_emi_58689"),nationality:t("emirati_emiria_12413"),emoji:"🇦🇪",language:"ar-AE",smsPrice:.12},{phoneCode:"+44",code:"GB",name:t("united_kingdom_16783"),nationality:t("british_43680"),emoji:"🇬🇧",language:["cy","cy-GB","en","en-GB"],smsPrice:.078},{phoneCode:"+1",code:"US",name:t("united_states_o_43878"),nationality:t("american_36800"),emoji:"🇺🇸",language:"en-US",smsPrice:.03},{phoneCode:"+598",code:"UY",name:t("uruguay_21979"),nationality:t("uruguayan_28212"),emoji:"🇺🇾",language:"es-UY",smsPrice:.1},{phoneCode:"+998",code:"UZ",name:t("uzbekistan_27729"),nationality:t("uzbekistani_uz_10593"),emoji:"🇺🇿",language:["uz","uz-UZ"],smsPrice:.39},{phoneCode:"+678",code:"VU",name:t("vanuatu_82756"),nationality:t("ni_vanuatu_van_02924"),emoji:"🇻🇺",smsPrice:.21},{phoneCode:"+58",code:"VE",name:t("venezuela_boli_00470"),nationality:t("venezuelan_52634"),emoji:"🇻🇪",language:"es-VE",smsPrice:.31},{phoneCode:"+84",code:"VN",name:t("vietnam_82968"),nationality:t("vietnamese_55360"),emoji:"🇻🇳",language:["vi","vi-VN"],smsPrice:.27},{phoneCode:"+1284",code:"VG",name:t("virgin_islands_14222"),nationality:t("british_43680"),emoji:"🇻🇬"},{phoneCode:"+1340",code:"VI",name:t("virgin_islands_12516"),nationality:t("american_36800"),emoji:"🇻🇮"},{phoneCode:"+681",code:"WF",name:t("wallis_and_futu_93206"),nationality:t("wallisian_or_fu_60327"),emoji:"🇼🇫",smsPrice:.09},{phoneCode:"+212",code:"EH",name:t("western_sahara_02173"),nationality:t("sahrawi_sahraw_96671"),emoji:"🇪🇭",smsPrice:.053},{phoneCode:"+967",code:"YE",name:t("yemen_76340"),nationality:t("yemeni_26632"),emoji:"🇾🇪",language:"ar-YE",smsPrice:.23},{phoneCode:"+260",code:"ZM",name:t("zambia_50513"),nationality:t("zambian_85114"),emoji:"🇿🇲",smsPrice:.324},{phoneCode:"+263",code:"ZW",name:t("zimbabwe_70209"),nationality:t("zimbabwean_42291"),emoji:"🇿🇼",language:"en-ZW",smsPrice:.35}],({name:e})=>c(e)),this.countriesCodes=this.countries.map(({code:e})=>e),this.phoneCodes=this.countries.flatMap(({phoneCode:e})=>Qs(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,ic.A)(this.countries.map(({code:e,name:t})=>({id:e,name:t})),({id:e})=>e===t?1:2)}getNationalitiesIdName(e){const t=this.getDefaultCountryValues(e).user.nationality;return(0,ic.A)(this.countries.map(({code:e,nationality:t})=>({id:e,name:t})),({id:e})=>e===t?1:2)}getNationality(e){return this.countries.find(t=>t.code===e)?.nationality}getName(e){return this.countries.find(t=>t.code===e)?.name}getDefaultCountryValues(e){let t=this.countries.find(({code:t})=>t===e);if(!t){try{t=this.countries.find(e=>Qs(e.language||[]).map(e=>e.toLowerCase()).includes(navigator.language.toLowerCase()))}catch{}t||(t=this.countries.find(({code:e})=>"FR"===e))}const n=Qs(t.language||[]);return{user:{language:n.some(e=>e.toLowerCase().startsWith("fr"))?jt.Fr:n.some(e=>e.toLowerCase().startsWith("es"))?jt.Es:n.some(e=>e.toLowerCase().startsWith("de"))?jt.De:n.some(e=>e.toLowerCase().startsWith("nl"))?jt.Nl:jt.En,country:t.code,nationality:t.code},phone:{country:t.code,code:Qs(t.phoneCode)[0]}}}getSmsPriceByPhone(e){return this.countries.find(t=>Qs(t.phoneCode).some(t=>e.startsWith(t)))?.smsPrice}};su=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],su);const ou=[Le.Date,Le.Number,Le.Text,Le.Textarea],ru=[Le.Phone,Le.Select,Le.Text,Le.Textarea];function au(e,t,n){const i=[],s=[];for(const o of t)if(!m(n)||o.name.trim().toLowerCase().includes(n.trim().toLowerCase())||m(o.label)&&o.label.trim().toLowerCase().includes(n.trim().toLowerCase())){const t=e.find(({slug:e})=>e===o.slug);t?i.push({filter:o,predicate:t}):s.push({filter:o,predicate:t})}return[i,s]}function lu(e,t){return eo(e.values)?e.values.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:t(n)},e)):eo(e.valuesGroups)?e.valuesGroups.map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n)):[]}let du=class extends Dl{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=Bs.c9.isDateTime(n.value)?n.value:Bs.c9.fromISO(n.value,{zone:"utc"}),s=!i.isValid||t.fieldType!==Ve.DateTimeRange&&t.fieldType!==Ve.Datetime?i.isValid&&t.fieldType===Ve.Date?this.dateTimeService.toLocaleString(i,Zs.DateOnly.MonthLong):n.value:this.dateTimeService.toLocaleString(i,Zs.DateTime),o=Bs.c9.isDateTime(n.value2)?n.value2:Bs.c9.fromISO(n.value2,{zone:"utc"}),r=!o.isValid||t.fieldType!==Ve.DateTimeRange&&t.fieldType!==Ve.Datetime?o.isValid&&t.fieldType===Ve.Date?this.dateTimeService.toLocaleString(o,Zs.DateOnly.MonthLong):n.value2:this.dateTimeService.toLocaleString(o,Zs.DateTime);switch(n.operator){case ct.Contains:return"condition"===t.slug?this.conditionFilterToString(e):"wishedPositions"===t.slug?this.t("mission_souhait_38008",r,this.valueToString(t,s)):"wishedPositionsCategories"===t.slug?this.t("cat_gorie_souha_24744",r,this.valueToString(t,s)):"isDelegationLeader"===t.slug?this.t("est_responsable_13012",this.valueToString(t,s)):this.t("_1_contient_2_40552",t.name,s);case ct.NotContains:return this.t("_1_ne_contient_14612",t.name,s);case ct.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===Ve.Date)return this.t("_1_est_gal_43375",t.name,this.valueDateToString(n.valueDate));if(t.fieldType===Ve.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,s));case ct.IsNot:return"isLeader"===t.slug?this.t("n_est_pas_respo_55625"):"isPositionLeader"===t.slug?this.t("n_est_pas_respo_35508"):"isPositionCategoryLeader"===t.slug?this.t("n_est_pas_respo_07811"):"isDelegationLeader"===t.slug?this.t("n_est_pas_respo_91275"):"privacy"===t.slug?this.t("visibilit_est_55411"):"condition"===t.slug?this.t("champ_d_pendant_33676"):"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_61197",t.name,this.dateTimeService.toLocaleString(i,Zs.DateOnly.MonthLong),r):t.fieldType===Ve.Date?this.t("_1_n_est_pas_38478",t.name,this.valueDateToString(n.valueDate)):this.t("_1_n_est_pas_38478",t.name,this.valueToString(t,s));case ct.IsEmpty:return this.t("_1_est_vide_08225",t.name);case ct.IsNotEmpty:return this.t("_1_n_est_pas_v_31530",t.name);case ct.IsValid:return this.t("_1_est_valide_45209",t.name);case ct.IsNotValid:return this.t("_1_n_est_pas_v_05077",t.name);case ct.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 ct.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 ct.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 ct.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 ct.Overlaps:return this.t("_1_chevauche_45834",t.name,s,r);case ct.NotOverlaps:return this.t("_1_ne_chevauch_01846",t.name,s,r);case ct.Engulfs:return this.t("_1_engloutis_32228",t.name,s,r);case ct.NotEngulfs:return this.t("_1_n_engloutis_52951",t.name,s,r);case ct.EngulfedBy:return this.t("_1_est_englout_36064",t.name,s,r);case ct.NotEngulfedBy:return this.t("_1_n_est_pas_e_89161",t.name,s,r);case ct.IsBefore:return"formsInsertedAt"===t.slug?this.t("_1_est_avant_l_83271",t.name,r):this.t("_1_est_avant_l_83271",t.name,s);case ct.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,s);case ct.Between:return this.t("_1_est_entre_39871",t.name,s,r);case ct.StartsWith:return this.t("_1_commence_pa_47720",t.name,s);case ct.EndsWith:return this.t("_1_finit_par_65840",t.name,s);case ct.ThisDayMonth:return this.t("_1_est_aujourd_09227",t.name);case ct.Today:return this.t("_1_est_aujourd_42954",t.name);default:return nl(n.operator)}}}getValues(e){return e.fieldType===Le.Sex?Sn.map(e=>({id:e,name:this.t(e)})):e.fieldType===Le.Language?e.fieldProperty===Me.Language?hd.map(e=>({id:e,name:this.t(e)})):fn.map(e=>({id:e,name:this.t(e)})):e.fieldType===Le.Nationality?this.countriesService.getNationalitiesIdName():e.fieldType===Le.Country?this.countriesService.getCountriesIdName():e.fieldType===Le.Select&&eo(e.values)?e.values.map(({id:e,value:t})=>({id:e,name:t})):[]}valueToString(e,t){const n=function(e){return eo(e.values)?e.values:eo(e.valuesGroups)?e.valuesGroups.flatMap(e=>e.values):[]}(e);return eo(n)?Qs(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(Bs.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})=>[Ve.Address,Ve.Checkbox,Ve.Country,Ve.Date,Ve.Datetime,Ve.File,Ve.Language,Ve.Nationality,Ve.Number,Ve.Phone,Ve.Select,Ve.Sex,Ve.Text,Ve.Textarea,Ve.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:ru.includes(e.fieldType),isSortable:!!ou.includes(e.fieldType)||e.fieldType===Le.Select&&e.isSelectV2&&!e.canSelectMultiple,sortAttribute:e.slug,width:"picture"===e.slug?80:void 0,minWidth:"picture"===e.slug?void 0:180}))}};du=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],du);var cu=n(1932),uu=n(6360);const hu=({children:e,css:t,onClose:n,returnToFallback:s,size:o})=>{const r=Xn(),a=()=>{n?n():r.goBack(s??Os.HOME)};return Od(a),Ka("common-front/src/designSystem/components/rightPanels/__deprecated/rightPanel.tsx","common-front/src/designSystem/components/rightPanels/base/rightPanel.tsx"),(0,Wt.createPortal)((0,i.jsx)(Ra,{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)(Ra,{css:{background:"white",height:"100%",position:"absolute",right:"0",top:"0",width:"sm"===o?"480px":"650px"},"data-testid":"right-panel-body",direction:"column",onClick:e=>Al(e,!1),children:[(0,i.jsx)(br,{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)},mu=M.forwardRef((e,t)=>(0,i.jsx)(Ra,{ref:t,css:{flex:"1",overflowY:"auto",px:"$6",...e.css},direction:"column",children:e.children}));mu.displayName="RightPanelBody";const gu=e=>(0,i.jsx)(br,{color:"gray800",css:{borderTop:"1px solid $gray200",px:"$6",py:"$4"},children:e.children}),pu=hr("div",{alignItems:"center",borderRadius:"12px",cursor:"pointer",display:"flex",position:"relative","& > div":{background:"white",boxShadow:"$sm",position:"absolute",transition:"left 200ms ease-in"},variants:{disabled:{true:{cursor:"auto"}},size:{sm:{height:"16px",width:"30px","& > div":{borderRadius:"12px",height:"12px",width:"12px"}},md:{height:"24px",width:"44px","& > div":{borderRadius:"20px",height:"20px",width:"20px"}}},state:{unchecked:{background:"$gray200","& > div":{left:"2px"}},checked:{background:"$primary600"}}},compoundVariants:[{size:"sm",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 12px)"}}},{size:"md",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 20px)"}}},{disabled:!0,state:"checked",css:{background:"$gray100"}}],defaultVariants:{size:"sm"}}),fu=e=>(0,i.jsx)(pu,{"aria-checked":e.value,"aria-describedby":e.descId,"aria-label":e.label,"aria-labelledby":e.labelId,disabled:e.disabled,id:e.inputId,role:"checkbox",size:e.size,state:e.value?"checked":"unchecked",tabIndex:e.tabIndex??0,onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:(0,i.jsx)("div",{})}),xu=e=>{const{inputId:t,descId:n,labelId:s}=Na(),o=m(e.subtext);return(0,i.jsxs)(Ra,{align:"center",css:{cursor:e.disabled?"auto":"pointer",userSelect:"none",...e.css},tabIndex:0,onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(fu,{descId:n,disabled:e.disabled,inputId:t,labelId:s,size:e.size,tabIndex:-1,value:e.value,onChange:Hl.A}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsxs)(Ra,{css:{flex:"1",fontSize:"md"===e.size?"$3":"$2"},direction:"column",children:[(0,i.jsx)(El,{htmlFor:t,id:s,children:(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:e.children})}),o&&(0,i.jsx)(br,{color:"gray500",id:n,children:e.subtext})]})]})},_u=e=>{const t=Hn(),[n,s]=(0,M.useState)(""),[o,r]=(0,M.useState)((0,ic.A)(e.columns.map(t=>({...t,isSelected:e.initialSelectedColumns.includes(t.slug)})),[({slug:t})=>{const n=e.initialSelectedColumns.indexOf(t);return-1===n?e.columns.length:n},({name:e})=>e]));return(0,i.jsxs)(hu,{css:e.css,size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(mu,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textXl",children:e.title}),(0,i.jsx)(br,{color:"gray500",children:e.subtitle}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:n,onChange:s}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_champ_00325")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(uu.JY,{onDragEnd:({reason:e,source:t,destination:n})=>{"DROP"===e&&n&&t.index!==n.index&&r(so(o,t.index,n.index))},children:(0,i.jsx)(uu.gL,{droppableId:"1",children:e=>(0,i.jsxs)(Ra,{direction:"column",gap:"2",...e.droppableProps,ref:e.innerRef,children:[o.map((e,t)=>(e=>{if(m(n)){const t=n.trim().toLowerCase();return e.name.trim().toLowerCase().includes(t)||m(e.label)&&e.label.trim().toLowerCase().includes(t)}return!0})(e)?(0,i.jsx)(uu.sx,{draggableId:e.slug,index:t,children:n=>(0,i.jsxs)(Ra,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(br,{color:"gray300",css:{cursor:"grab"},...n.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray800",css:{ellipsis:!0},title:e.name,width:1,children:e.name}),m(e.label)&&(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},title:e.label,width:1,children:e.label})]}),(0,i.jsx)(fu,{value:e.isSelected,onChange:()=>{var n,i;n=e,i=t,r((0,cu.jM)(e=>{e[i].isSelected=!n.isSelected}))}})]})},e.slug):null),e.placeholder]})})}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(gu,{children:(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{onClick:()=>{e.onSave(o.filter(e=>e.isSelected).map(e=>e.slug)),e.onClose()},children:e.saveButtonText}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})};function Iu(e){const[t,n]=(0,M.useState)(e),[i,s]=(0,M.useState)(!1),o=(0,M.useMemo)(()=>{const e=Object.values(t).filter(e=>!0!==e.disabled),n=e.filter(e=>"checked"===e.state),i=n.map(e=>e.id),s=(0,Fs.A)(e.map(({state:e})=>e)),o=2===s.length?"indeterminate":"checked"===s[0]?"checked":"unchecked";return{numberOfSelected:n.length,selectAllState:o,selecteds:n,selectedsIds:i}},[t]),r=(0,M.useCallback)((e,t)=>{n(n=>({...n,[e]:{...n[e],state:t}})),"unchecked"===t&&s(!1)},[t,n,s]),a=(0,M.useCallback)(e=>{n(Object.fromEntries(Object.entries(t).filter(([e,t])=>!0!==t.disabled).map(([t,n])=>[t,{...n,state:e}]))),"unchecked"===e&&s(!1)},[t,n,s]);return{getSelectedsInput:(0,M.useCallback)((e,t)=>i?e?{ids:null,predicates:e,segmentId:null}:{ids:null,predicates:null,segmentId:t}:{ids:o.selectedsIds,predicates:null,segmentId:null},[i,o]),isAllSelected:i,numberOfSelected:o.numberOfSelected,selectAllState:o.selectAllState,selecteds:o.selecteds,selectedsIds:o.selectedsIds,setIsAllSelected:s,setStates:n,states:t,toggleRow:r,toggleSelectAll:a}}function vu(e){return{numberOfPages:(0,M.useMemo)(()=>e?.numberOfPages??1,[e]),totalCount:(0,M.useMemo)(()=>e?.totalCount??0,[e])}}var bu=n(903);const ju=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.value??[]),[o,r]=(0,M.useState)(e.filterPredicate.predicate?.value2??[]),a=e.filterPredicate.filter.campaigns??[],l=(0,Fs.A)(a.filter(({id:e})=>n.includes(e)).map(({campaignType:e})=>e)),d=(0,Fs.A)(["NotSent",...l.includes(ce.Email)?on.filter(e=>e!==Se.Queued):[],...l.includes(ce.Sms)?Tn:[]]),c=eo(n)&&eo(o);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_28439"),values:n,onChange:s,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)(Ba,{height:"2"}),(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_62901"),values:o,onChange:r,children:d.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!c,onClick:()=>{e.onAdd({operator:ct.Is,value:n,value2:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Cu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.value??[]),[o,r]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Contains),[a,l]=(0,M.useState)(e.filterPredicate.predicate?.value2??[]),d=e.filterPredicate.filter.campaigns??[],c=eo(n)&&(o===ct.Contains&&m(a)||o===ct.IsEmpty||o===ct.IsNotEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_28439"),values:n,onChange:s,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)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"contains"===o?"checked":"unchecked",onClick:()=>{r(ct.Contains)},children:t("contient_34012")}),"contains"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isEmpty"===o?"checked":"unchecked",onClick:()=>{r(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===o?"checked":"unchecked",onClick:()=>{r(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!c,onClick:()=>{e.onAdd({operator:o,value:n,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},yu=hr("select",{backgroundColor:"$white",height:"100%",left:0,opacity:0,position:"absolute",top:0,width:"100%"}),ku=hr("div",{ellipsis:""}),Au=({autoComplete:e,children:t,css:n,label:s,description:o,shouldParseAsInt:r,shouldParseAsBoolean:a,onChange:l,hint:d,icon:c,state:u,value:h="",...m})=>{const g=M.useMemo(()=>pc(gc(t)),[t]),{inputId:p,descId:f,errorId:x}=Na();return(0,i.jsxs)(Ra,{css:n,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:p,children:s}),(0,i.jsx)(wl,{id:f,children:o}),(s||o)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(zl,{cursor:"default",icon:c,state:u,children:[(0,i.jsx)(Ra,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,width:1,children:(0,i.jsx)(ku,{children:g[h.toString()]})}),(0,i.jsx)(Ra,{css:{color:"$gray500"},children:(0,i.jsx)(Ya,{icon:"chevron-down"})}),(0,i.jsx)(yu,{"aria-describedby":o?f:void 0,"aria-errormessage":"error"===u?x:void 0,"aria-invalid":"error"===u,autoComplete:e??"off",css:{cursor:"disabled"===u?"not-allowed":"pointer"},disabled:"disabled"===u,id:p,value:h.toString(),onChange:e=>{l(r?parseInt(e.target.value,10):a?"true"===e.target.value:e.target.value)},...m,children:t})]}),(0,i.jsx)(Sl,{id:x,state:u,children:d})]})},wu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),[o,r]=(0,M.useState)(e.filterPredicate.predicate?.value??!0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsxs)(Au,{shouldParseAsBoolean:!0,value:o,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsxs)(Au,{shouldParseAsBoolean:!0,value:o,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]}),(0,i.jsx)(Ba,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:()=>{e.onAdd({operator:n,value:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Su=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),o=e.filterPredicate.filter.values??[],[r,a]=(0,M.useState)(eo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"===n||"isNot"===n||eo(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("champ_dont_un_a_44854")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("champ_d_pendant_33676")}),o.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ct.Contains)},children:t("d_pends_du_cham_39787")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),(0,i.jsx)(Ba,{height:"1"})]})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};function Eu(e){return m(e)?Bs.c9.fromISO(e):e}const Tu=({value:e,css:t,label:n,description:s,hint:o,icon:r,min:a,onChange:l,max:d,state:c,rightIcon:u,onRightIconClick:h,zone:g,...p})=>{const f=e?Eu(e):null,x=f?.isValid?f.toFormat(Vs):"",{inputId:_,descId:I,errorId:v}=Na();return(0,i.jsxs)(Ra,{css:t,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:_,children:n}),(0,i.jsx)(wl,{id:I,children:s}),(n||s)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(zl,{cursor:"default",icon:r,rightIcon:u,state:c,onRightIconClick:h,children:(0,i.jsx)(br,{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":s?I:void 0,"aria-errormessage":"error"===c?v:void 0,"aria-invalid":"error"===c,disabled:"disabled"===c,id:_,max:d?.toFormat(Vs),min:a?.toFormat(Vs),type:"date",value:x,onChange:e=>{m(e.target.value)?l(Bs.c9.fromFormat(e.target.value,Vs,{zone:g||"UTC"})):l(Bs.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Sl,{id:v,state:c,children:o})]})};var zu=n(3551);const Ou=e=>{const t=Hn(),n=Gn(Wc),s=(0,M.useMemo)(()=>Bs.c9.now().startOf("year"),[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsxs)(Au,{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,wc.A)(1,32).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsxs)(Au,{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,wc.A)(1,13).map(e=>{const t=n.toLocaleString(s.set({month:e}),{month:"long"});return(0,i.jsx)("option",{value:e,children:t},e)})]})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsxs)(Au,{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,zu.A)(1900,s.year+2).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(Ba,{height:"1"})]})},Ru=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),[o,r]=(0,M.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,M.useState)(e.filterPredicate.predicate?.value2??""),[d,c]=(0,M.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)?Bs.c9.isDateTime(o)&&o.isValid:"between"!==n||Bs.c9.isDateTime(o)&&o.isValid&&Bs.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsx)(Ou,{setValue:c,value:d}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsx)(Ou,{setValue:c,value:d}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isBefore"===n?"checked":"unchecked",onClick:()=>{s(ct.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isAfter"===n?"checked":"unchecked",onClick:()=>{s(ct.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"between"===n?"checked":"unchecked",onClick:()=>{s(ct.Between)},children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"today"===n?"checked":"unchecked",onClick:()=>{s(ct.Today)},children:t("est_aujourd_hui_82571")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"thisDayMonth"===n?"checked":"unchecked",onClick:()=>{s(ct.ThisDayMonth)},children:t("est_aujourd_hui_70881")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!u,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,valueDate:d,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},$u=({value:e,css:t,label:n,description:s,hint:o,icon:r,min:a,onChange:l,max:d,rightIcon:c,onRightIconClick:u,state:h,zone:g,...p})=>{const f=e?m(e)?Bs.c9.fromISO(e,{zone:"utc"}):e:null,x=f?.isValid?f.toFormat(Us):"",{inputId:_,descId:I,errorId:v}=Na();return(0,i.jsxs)(Ra,{css:t,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:_,children:n}),(0,i.jsx)(wl,{id:I,children:s}),(n||s)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(zl,{cursor:"default",icon:r,rightIcon:c,state:h,onRightIconClick:u,children:(0,i.jsx)(br,{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":s?I:void 0,"aria-errormessage":"error"===h?v:void 0,"aria-invalid":"error"===h,disabled:"disabled"===h,id:_,max:d?.toFormat(Us),min:a?.toFormat(Us),type:"datetime-local",value:x,onChange:e=>{m(e.target.value)?l(Bs.c9.fromFormat(e.target.value,Us,{zone:g||"UTC"})):l(Bs.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Sl,{id:v,state:h,children:o})]})},Du=e=>{const t=Hn(),n=(0,M.useMemo)(()=>e.filterPredicate.filter.useLocalZone?Xs():void 0,[e.filterPredicate]),[s,o]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),[r,a]=(0,M.useState)(e.filterPredicate.predicate?.value??""),[l,d]=(0,M.useState)(e.filterPredicate.predicate?.value2??""),c=["isBefore","isAfter"].includes(s)?Bs.c9.isDateTime(r)&&r.isValid:"between"!==s||Bs.c9.isDateTime(r)&&r.isValid&&Bs.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"isBefore"===s?"checked":"unchecked",onClick:()=>{o(ct.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isAfter"===s?"checked":"unchecked",onClick:()=>{o(ct.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"between"===s?"checked":"unchecked",onClick:()=>{o(ct.Between)},children:t("est_entre_born_59665")}),"between"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{value:l,zone:n,onChange:d})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"today"===s?"checked":"unchecked",onClick:()=>{o(ct.Today)},children:t("est_aujourd_hui_82571")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isEmpty"===s?"checked":"unchecked",onClick:()=>{o(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===s?"checked":"unchecked",onClick:()=>{o(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!c,onClick:()=>{e.onAdd({operator:s,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Pu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Contains),[o,r]=(0,M.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,M.useState)(e.filterPredicate.predicate?.value2??""),d=!!(Bs.c9.isDateTime(o)&&o.isValid&&["contains","notContains","is"].includes(n))||Bs.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ct.Contains)},children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("contient_date_89885")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"notContains"===n?"checked":"unchecked",onClick:()=>{s(ct.NotContains)},children:t("ne_contient_pas_85399")}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"overlaps"===n?"checked":"unchecked",onClick:()=>{s(ct.Overlaps)},children:t("chevauche_49445")}),"overlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"notOverlaps"===n?"checked":"unchecked",onClick:()=>{s(ct.NotOverlaps)},children:t("ne_chevauche_pa_17307")}),"notOverlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"engulfs"===n?"checked":"unchecked",onClick:()=>{s(ct.Engulfs)},children:t("engloutis_42346")}),"engulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"notEngulfs"===n?"checked":"unchecked",onClick:()=>{s(ct.NotEngulfs)},children:t("n_engloutis_pas_42363")}),"notEngulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"engulfedBy"===n?"checked":"unchecked",onClick:()=>{s(ct.EngulfedBy)},children:t("est_englouti_pa_47852")}),"engulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"notEngulfedBy"===n?"checked":"unchecked",onClick:()=>{s(ct.NotEngulfedBy)},children:t("n_est_pas_englo_08733")}),"notEngulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)($u,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Fu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.IsEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Mu=e=>{const t=Hn(),n=(0,M.useMemo)(()=>(e.filterPredicate.filter.values||[]).map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)),[e.filterPredicate.filter]),[s,o]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),[r,a]=(0,M.useState)(e.filterPredicate.predicate?.value??[]),[l,d]=(0,M.useState)(e.filterPredicate.predicate?.value2??""),[c,u]=(0,M.useState)(e.filterPredicate.predicate?.valueDate??{day:-1,month:-1,year:-1}),h=eo(r)&&["is","isNot"].includes(s)?"number"==typeof c.day&&-1!==c.day||"number"==typeof c.month&&-1!==c.month||"number"==typeof c.year&&-1!==c.year:!!["isBefore","isAfter"].includes(s)&&Bs.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fc,{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)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"is"===s?"checked":"unchecked",onClick:()=>{o(ct.Is)},children:t("est_25967")}),"is"===s&&(0,i.jsx)(Ou,{setValue:u,value:c}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===s?"checked":"unchecked",onClick:()=>{o(ct.IsNot)},children:t("n_est_pas_97826")}),"isNot"===s&&(0,i.jsx)(Ou,{setValue:u,value:c}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isBefore"===s?"checked":"unchecked",onClick:()=>{o(ct.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isAfter"===s?"checked":"unchecked",onClick:()=>{o(ct.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(Ba,{height:"1"})]})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!h,onClick:()=>{e.onAdd({operator:s,value:r,value2:l,valueDate:c,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Nu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_administrat_15766")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_admin_58612")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Lu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),o=(0,M.useMemo)(()=>lu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,M.useState)(eo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="contains"!==n||eo(r),d=(0,M.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_responsable_47377")}),(0,i.jsx)(Ba,{height:"3"}),"isDelegationLeader"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ct.Contains)},children:t("est_responsable_00281")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{paddingLeft:"$6"},children:(0,i.jsx)(fc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"})]}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_respo_55625")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Bu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_inscrit_en_86193")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_inscr_25311")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Vu=hr("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"}}),Uu=e=>(0,i.jsx)(Vu,{"aria-orientation":e.direction,color:e.color,css:e.css,direction:e.direction,role:"separator"}),Wu=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:e.height}),(0,i.jsx)(Vu,{color:e.color,direction:"horizontal",role:"separator"}),(0,i.jsx)(Ba,{height:e.height})]}),Gu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),[o,r]=(0,M.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,M.useState)(e.filterPredicate.predicate?.value2??""),[d,c]=(0,M.useState)(Eu(e.filterPredicate.predicate?.value3??"")),[u,h]=(0,M.useState)(Eu(e.filterPredicate.predicate?.value4??"")),[m,g]=(0,M.useState)(Bs.c9.isDateTime(d)&&d.isValid&&Bs.c9.isDateTime(u)&&u.isValid?"checked":"unchecked"),p=("checked"!==m||Bs.c9.isDateTime(d)&&d.isValid&&Bs.c9.isDateTime(u)&&u.isValid)&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n)?"number"==typeof o:"between"!==n||"number"==typeof o&&"number"==typeof a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>{s(ct.GreaterThan)},children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>{s(ct.GreaterThanEqual)},children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>{s(ct.LessThan)},children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>{s(ct.LessThanEqual)},children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"between"===n?"checked":"unchecked",onClick:()=>{s(ct.Between)},children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:o,onChange:r}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),"numberOfAssignmentsDays"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"3"}),(0,i.jsx)(dc,{state:m,onClick:g,children:t("filtrer_sur_une_06420")}),"checked"===m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:d,onChange:c}),(0,i.jsx)(Tu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:u,onChange:h})]})]})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!p,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,value3:d,value4:u,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Hu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),[o,r]=(0,M.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,M.useState)(e.filterPredicate.predicate?.value2??""),d=!!(Bs.c9.isDateTime(o)&&o?.isValid&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n))&&"number"==typeof a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tu,{label:t("jour_d_affectat_27334"),max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(El,{children:e.filterPredicate.filter.name}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>{s(ct.GreaterThan)},children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>{s(ct.GreaterThanEqual)},children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>{s(ct.LessThan)},children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>{s(ct.LessThanEqual)},children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},qu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("Public")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("Private")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Yu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),o=(0,M.useMemo)(()=>lu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,M.useState)(eo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"!==n&&"isNot"!==n||eo(r),d=(0,M.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{paddingLeft:"$6"},children:(0,i.jsx)(fc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{paddingLeft:"$6"},children:(0,i.jsx)(fc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(Ba,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ku=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??(e.filterPredicate.filter.isEncrypted?ct.IsEmpty:ct.Contains)),[o,r]=(0,M.useState)(e.filterPredicate.predicate?.value??""),a="contains"!==n&&"notContains"!==n||m(o);return(0,i.jsxs)(i.Fragment,{children:[!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsx)(hc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ct.Contains)},children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"notContains"===n?"checked":"unchecked",onClick:()=>{s(ct.NotContains)},children:t("ne_contient_pas_85399")})]}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"startsWith"===n?"checked":"unchecked",onClick:()=>{s(ct.StartsWith)},children:t("commence_par_11056")})]}),"startsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"endsWith"===n?"checked":"unchecked",onClick:()=>{s(ct.EndsWith)},children:t("finit_par_79657")})]}),"endsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{value:o,onChange:r})]}),(0,i.jsx)(Ba,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),e.showIsValid&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isValid"===n?"checked":"unchecked",onClick:()=>{s(ct.IsValid)},children:t("est_valide_72630")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotValid"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNotValid)},children:t("n_est_pas_valid_75405")})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!a,onClick:()=>{e.onAdd({operator:n,value:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Zu=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.filterPredicate.predicate?.operator??ct.Is),o=(0,M.useMemo)(()=>lu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,M.useState)(eo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),[l,d]=(0,M.useState)(e.filterPredicate.predicate?.value2??1),c=eo(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ct.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ct.Contains)},children:t("est_le_choix_07450")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:l,onChange:d})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ct.IsNotEmpty)},children:t("n_est_pas_vide_45804")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{disabled:!c,onClick:()=>{e.onAdd({operator:n,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};var Xu=n(9669),Ju=n(8389),Qu=n(8047);const eh=({children:e,dateTime:t,...n})=>{const s=m(t)?t:t.toISO();return(0,i.jsx)(tl,{as:"time",dateTime:s,textStyle:"inherit",...n,children:e})};function th(e,t){const n=t.formats?.localeFormat||Zs.DateOnly.MonthLong,i=Zs.TimeOnly,s=t.language?{locale:t.language.toString().toLowerCase()}:{};t.formats?.displayWeekday&&(n.weekday="long");const o=e.start,r=e.end;return{startDateString:m(t.formats?.dateFormat)?o.toFormat(t.formats.dateFormat):o.toLocaleString(n,s),startTimeString:m(t.formats?.timeFormat)?o.toFormat(t.formats.timeFormat):o.toLocaleString(i,s),endDateString:m(t.formats?.dateFormat)?r.toFormat(t.formats.dateFormat):r.toLocaleString(n,s),endTimeString:m(t.formats?.timeFormat)?r.toFormat(t.formats.timeFormat):r.toLocaleString(i,s)}}function nh(e){return Math.ceil(e.end.endOf("day").diff(e.start.startOf("day"),"days").days)}function ih(e){return e.flatMap(e=>{const t=e.range,n=nh(t);return n>1?(0,wc.A)(0,n).map(n=>{const i=t.start.plus({days:n}),s=i.startOf("day").equals(t.start.startOf("day"))?t.start:i.startOf("day"),o=i.endOf("day").equals(t.end.endOf("day"))?t.end:i.endOf("day");return{...e,range:Bs.IX.fromDateTimes(s,o)}}):[e]})}function sh(e,t,n,i){const s=Math.ceil(n.endOf("day").diff(t.startOf("day"),"days").days),o=(0,wc.A)(0,s).map(e=>t.startOf("day").set({hour:i}).plus({day:e})),[r,a]=(0,Xu.A)(e,e=>e.range.start.hour===i&&0===e.range.start.minute);return a.flatMap(e=>e.range.splitAt(...o).map(t=>({...e,range:t}))).concat(r)}function oh(e){const t=e.filter(e=>e.isValid);if(eo(t)){const e=(0,ic.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),s=i%2==0?i:i-1,o=e.map(e=>e.end),r=o.reduce((e,t)=>Math.max(e,t.hour),t.maxHour??20),a=r%2==0?r:r+1,l=(a-s)/2,d=(0,Ju.A)(n,e=>e.toMillis()).startOf("day"),c=(0,Qu.A)(o,e=>e.toMillis()).endOf("day"),u=Math.ceil(c.diff(d,"days").days);return{starts:n,ends:o,startHour:s,endHour:a,numberOfSlots:l,startDate:d,endDate:c,numberOfDays:u}}let ah=class{translationService;constructor(e){this.translationService=e}toDisplayString(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:i,endDateString:s,endTimeString:o}=th(e,t);return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?`${n}–${s}`:t.hideDate?`${i}–${o}`:`${n} ${i}–${s} ${o}`:t.hideTime?`${n}`:t.hideDate?`${i}–${o}`:`${n} ${i}–${o}`}(e,{...t,language:this.translationService.language})}toComponents(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:s,endDateString:o,endTimeString:r}=th(e,t);return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eh,{dateTime:e.start,children:n}),"–",(0,i.jsx)(eh,{dateTime:e.end,children:o})]}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eh,{dateTime:e.start,children:s}),"–",(0,i.jsx)(eh,{dateTime:e.end,children:s})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eh,{dateTime:e.start,children:[n," ",s]}),"–",(0,i.jsxs)(eh,{dateTime:e.end,children:[o," ",r]})]}):t.hideTime?(0,i.jsx)(eh,{dateTime:e.start,children:n}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eh,{dateTime:e.start,children:s}),"–",(0,i.jsx)(eh,{dateTime:e.end,children:r})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eh,{dateTime:e.start,children:[n," ",s]}),"–",(0,i.jsx)(eh,{dateTime:e.end,children:r})]})}(e,{...t,language:this.translationService.language})}toLocaleString(e,t,n){return e.toLocaleString(n,t)}};ah=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],ah);var lh=n(7231),dh=n(6452),ch=n(5582);const uh=/^\d{2}:\d{2}$/,hh=/^\d{2}:\d{2}:\d{2}$/;function mh(e){return m(e)&&(null!==e.match(uh)||null!==e.match(hh))}function gh(e){if(mh(e)){const[t,n]=e.split(":");return[parseInt(t,10),parseInt(n,10)]}return null}function ph(e,t,n,i={}){const s=m(t.name)?t.name:"",o=e.toDisplayString(t.range,i.interval?.options),r=(0,Va.A)([i.position?.includeName?n:"",s,i.slot?.includeRange||g(s)?o:"",i.position?.includeNameAtEnd?n:""]).join(" - ");return m(r)?r:n}function fh(e,t){return t.some(({id:t,range:n})=>e.id!==t&&n.overlaps(e.range))}function xh(e,t){const n=e.toISODate();return t.filter(e=>e.range.start.toISODate()===n)}function _h(e,t,n){return!n.hiddenPositionsSlotsIds.includes(e.id)&&(0===n.displayedPositionsSlotsIds.length||n.displayedPositionsSlotsIds.includes(e.id))&&(n.showFullPosition||!e.isFull)&&(n.slotDisplay===pt.Hide||n.positionFilter===gt.None||oh(t.map(qs)).some(t=>t.engulfs(e.range)))}function Ih(e,t,n,i,s,o){const r=[],a=[],l=[],d=e=>bh(e.position,o),c=(e,t)=>t.some(t=>t.engulfs(e.range)),u=eo(s),h=eo(i)||eo(n)||eo(t),m=u&&h?"both":u?"ranges":h?"positions":"none";e.forEach(e=>{const o=i.includes(e.id)||n.includes(e.position.id)||t.includes(e.positionCategory.id);"both"===m&&c(e,s)&&d(e)&&o||"ranges"===m&&c(e,s)&&d(e)||"positions"===m&&d(e)&&o?r.push(e):d(e)&&(0===s.length||c(e,s))?a.push(e):l.push(e)});const g=e=>e.range.start.toMillis();return{wishedPositionsSlots:(0,ic.A)(r,g),possiblePositionsSlots:(0,ic.A)(a,g),otherPositionsSlots:(0,ic.A)(l,g)}}function vh(e,t){const n=t[e.customField.slug];return"boolean"==typeof n&&e.customField.fieldType===Le.Checkbox?n===e.conditionValue:e.customField.fieldType===Le.Select&&e.customField.canSelectMultiple&&eo(n)?(0,lh.A)(e.conditionValue,n??[]).length>0:e.customField.fieldType===Le.Select&&"number"==typeof n&&e.conditionValue.includes(n)}function bh(e,t){if(!eo(e?.conditionsCustomFields))return!0;switch(e.conditionsOperator){case me.Or:return e.conditionsCustomFields.some(e=>vh(e,t));case me.And:return e.conditionsCustomFields.every(e=>vh(e,t));default:return nl(e.conditionsOperator)}}function jh(e,t,n,i){return!i.hiddenPositionsIds.includes(e.id)&&(0===i.displayedPositionsIds.length||i.displayedPositionsIds.includes(e.id))&&(0===i.hiddenPositionsTagsIds.length||to((0,lh.A)(i.hiddenPositionsTagsIds,e.tagsIds)))&&(0===i.displayedPositionsTagsIds.length||eo((0,lh.A)(i.displayedPositionsTagsIds,e.tagsIds)))&&bh(e,t)&&e.slots.some(e=>_h(e,n,i))}function Ch(e){return m(e.address)}function yh(e){return kr(e.latitude)&&kr(e.longitude)}function kh(e){return Ch(e)||yh(e)}function Ah(e){return(0,ic.A)(Object.values((0,nc.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:m(n.acronym)?n.acronym:n.name,minDate:(0,dh.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,text:t,minDate:n})=>[e.toLowerCase(),t.toLowerCase(),n])}function wh(e,t,n,i={}){const s=m(t.name)?t.name:"",o=t.date?m(i?.date?.format)?t.date.toFormat(i?.date?.format??""):e.toLocaleString(t.date,i?.date?.localeFormat||Zs.DateOnly.Numeric):"",r=(0,Va.A)([i?.accreditation?.includeName?n:"",s,o,i?.accreditation?.includeNameAtEnd?n:""]).join(" - ");return m(r)?r:m(i?.defaultName)?i?.defaultName:n}function Sh(e,t,n,i){return!e.isBlocked&&n.accreditationDisplay!==ut.None&&!n.hiddenAccreditationsSlotsIds.includes(e.id)&&(0===n.displayedAccreditationsSlotsIds.length||n.displayedAccreditationsSlotsIds.includes(e.id))&&(n.showFullAccreditation||!e.isFull)&&(n.slotDisplay===pt.Hide||n.accreditationFilter===gt.None||!e.date||oh(t.map(qs)).some(t=>Ks(t,e.date)))||i.some(i=>i.accreditationSlotId===e.id&&!i.accreditationSlot.isBlocked&&(n.showFullAccreditation||!i.isFull&&!i.accreditationSlot.isFull)&&(n.slotDisplay===pt.Hide||n.accreditationFilter===gt.None||!i.accreditationSlot?.date||oh(t.map(qs)).some(e=>Ks(e,i.accreditationSlot.date))))}function Eh(e){const t=e.filter(e=>e.date?.isValid),n=(0,Ju.A)(t.map(e=>e.date),e=>e.toMillis()),i=(0,Qu.A)(t.map(e=>e.date),e=>e.toMillis()),s=Math.ceil(i.endOf("month").diff(n.startOf("month"),"months").months),o=Math.ceil(i.diff(n,"days").days);return{minDate:n,maxDate:i,numberOfMonths:s,totalDaysDiff:o}}function Th(e,t,n,i){const s=(0,oc.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(s)}function zh(e){return(0,ic.A)(e,e=>[e.date?.toMillis()??1,e.name.toLowerCase()])}var Oh,Rh,$h,Dh,Ph;function Fh(e){switch(e){case Rh.AccreditationsMatrix:case Ph.AccreditationsMatrix:return"table-cells";case Dh.Calendar:case Ph.Calendar:return"calendar";case $h.Card:return"rectangle-list";case Oh.List:case Rh.List:case $h.List:case Dh.List:case Ph.List:return"table";case Dh.Map:return"map-location";case Oh.SlotsList:case Dh.SlotsList:return"table";default:return nl()}}function Mh(e,t){switch(t){case Rh.AccreditationsMatrix:case Ph.AccreditationsMatrix:return e("matrice_des_acc_84939");case Dh.Calendar:case Ph.Calendar:return e("vue_planning_91663");case $h.Card:return e("vue_grille_37962");case Oh.List:case Rh.List:case $h.List:case Dh.List:case Ph.List:return e("vue_liste_56882");case Dh.Map:return e("vue_carte_79064");case Oh.SlotsList:case Dh.SlotsList:return e("vue_liste_cr_n_47406");default:return nl()}}!function(e){e.List="List",e.SlotsList="SlotsList"}(Oh||(Oh={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.List="List"}(Rh||(Rh={})),function(e){e.Card="Card",e.List="List"}($h||($h={})),function(e){e.Calendar="Calendar",e.List="List",e.Map="Map",e.SlotsList="SlotsList"}(Dh||(Dh={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.Calendar="Calendar",e.List="List"}(Ph||(Ph={}));var Nh;function Lh(e,t,n){return t===Ph.AccreditationsMatrix?{includeAccreditations:!1,includeAccreditationsMatrix:!0,includeAvailability:!1,includeComments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeVolunteerMinutes:!1,includeWeezevent:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:{includeAccreditations:e.includes(Nh.Accreditations)||e.includes(Nh.AccreditationsCategories)||e.includes(Nh.AccreditationsSlots)||e.includes(Nh.WishedAccreditationSlots)||e.includes(Nh.ScannedAccreditations),includeAccreditationsMatrix:!1,includeAvailability:e.includes(Nh.Availability),includeComments:e.includes(Nh.Comments),includeDelegation:e.includes(Nh.Delegations)||e.includes(Nh.DelegationCategory),includeDuplicatedFrom:e.includes(Nh.DuplicatedFrom),includeEmails:e.includes(Nh.CampaignsStates),includeFormsUsersInfos:e.includes(Nh.CompletedForms)||e.includes(Nh.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at"))||e.includes(Nh.Availability)||e.includes(Nh.TeamCode)||e.includes(Nh.TeamMembers),includeForms:e.includes(Nh.CompletedForms)||e.includes(Nh.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at"))||e.includes(Nh.Availability),includeNumberOfAccreditations:e.includes(Nh.NumberOfAccreditations),includeNumberOfAssignments:e.includes(Nh.NumberOfAssignments),includeNumberOfAssignmentsDays:e.includes(Nh.NumberOfAssignmentsDays),includeNumberOfAvailableDays:e.includes(Nh.NumberOfAvailableDays),includePositions:e.includes(Nh.Positions)||e.includes(Nh.PositionsCategories)||e.includes(Nh.WishedPositions)||e.includes(Nh.CheckedInPositions),includeRoles:e.includes(Nh.Roles),includeTags:e.includes(Nh.Tags),includeTeam:e.includes(Nh.TeamCode)||e.includes(Nh.TeamMembers),includeVolunteerMinutes:e.includes(Nh.VolunteerMinutes),includeWishedPositions:e.includes(Nh.WishedPositions),includePreassignedPositions:e.includes(Nh.PreassignedPositionsCategories)||e.includes(Nh.PreassignedPositions),includeWeezeventChecklists:e.includes(Nh.WeezaccessChecklists),includeWeezevent:e.includes(Nh.WeezeventBarcodeId)||e.includes(Nh.WeezeventPairedAt),includeWeezeventUrls:!0===n?.includeWeezeventUrls&&(e.includes(Nh.WeezeventBarcodeId)||e.includes(Nh.WeezeventShortTag))}}!function(e){e.AccreditationState="accreditation_state",e.Accreditations="accreditations",e.AccreditationsCategories="accreditations_categories",e.AccreditationsSlots="accreditations_slots",e.Availability="availability",e.CampaignsStates="campaigns_states",e.CheckedInPositions="checed_in_positions",e.Comments="comments",e.CompletedForms="forms",e.DelegationCategory="delegation_category",e.Delegations="delegations",e.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.WeezeventPairedAt="weezevent_paired_at",e.WeezeventShortTag="weezevent_short_tag",e.WishedAccreditationSlots="wished_accreditation_slots",e.WishedPositions="wished_positions"}(Nh||(Nh={}));let Bh=class extends du{constructor(e,t,n){super(e,t,n)}getVolunteersFilters(e,t,n,i,s,{hasAccreditations:o,hasCampaigns:r,hasDelegations:a,hasForms:l,hasPositions:d,isWeezeventConnected:c}){return[...this.getBaseFilters(i),...this.getAvailabilitiesFilters(t,s),...d?this.getPositionsFilters(e,t,s):[],...o?this.getAccreditationsFilters(e,t,s):[],...a?this.getDelegationsFilters(e,t):[],...this.getSegmentsFilters(e,t,n,s),...l?this.getFormsFilters(t):[],...l?this.getTeamsFilters():[],...c?this.getWeezeventFilters(t):[],...this.getEmailsFilters(t,r),...this.getCommentsFilter(e,t),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:Ve.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:Ct.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:Ve.Number,hideEmpty:!0},{slug:"possibleDuplicates",name:this.t("potentiel_doubl_87672"),category:this.t("autres_99130"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:"isLeader",name:this.t("est_responsable_19679"),category:this.t("autres_99130"),fieldType:Ve.Checkbox},{slug:"isPositionLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:Ve.Checkbox},{slug:"isPositionCategoryLeader",name:this.t("est_responsable_91796"),category:this.t("autres_99130"),fieldType:Ve.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:s}){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s?this.getDelegationsFilters(e,t):[]]}getDelegationCategoryMembersFilters(e,t,n,i,s){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s?this.getWeezeventFilters(t):[]]}getDelegationMembersFilters(e,t,n,i,s,o){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s.positionDisplay===mt.None?[]:this.getPositionMembersFilters(e,t,n,i),...o?this.getWeezeventFilters(t):[]]}getVolunteersPossibleColumns(e,t,{hasAccreditations:n,hasCampaigns:i,hasDelegations:s,hasForms:o,hasPositions:r,isWeezeventConnected:a}){return[...this.getBaseColumns(e),...o?this.getFormsColumns(t):[],...r?this.getPositionsColumns():[],...a?this.getWeezeventColumns():[],...n?this.getAccreditationsColumns():[],...this.getAvailabilitiesColumns(),...s?this.getDelegationsColumns():[],...i?[{slug:Nh.CampaignsStates,name:this.t("statut_des_camp_25280"),minWidth:320}]:[],{slug:Nh.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:Nh.Comments,name:this.t("commentaires_96492"),isSearchable:!0,minWidth:320},{slug:Nh.Roles,name:this.t("r_les_61679"),minWidth:320}]}getPositionMembersPossibleColumns(e){return[...this.getBaseColumns(e),...this.getPositionsColumns()]}getAccreditationMembersPossibleColumns(e){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...this.getDelegationsColumns()]}getDelegationCategoryMembersPossibleColumns(e,t){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...t?this.getWeezeventColumns():[],{slug:Nh.CampaignsStates,name:this.t("statut_des_camp_25280")},{slug:Nh.Delegations,name:this.t("Delegation"),isSearchable:!0}]}getDelegationMembersPossibleColumns(e,{isWeezeventConnected:t,positionDisplay:n,slotDisplay:i}){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...n===mt.None?[]:this.getPositionsColumns(),...i===pt.Hide?[]:this.getAvailabilitiesColumns(),...t?this.getWeezeventColumns():[],{slug:Nh.CampaignsStates,name:this.t("statut_des_camp_25280")}]}getBaseColumns(e){return[{slug:Nh.Email,name:this.t("e_mail_du_membr_69509"),isSearchable:!0,minWidth:180},{slug:Nh.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:$t.Id,width:100},{slug:Nh.LocalId,name:this.t("id_sur_l_v_nem_01171"),isSearchable:!0,isSortable:!0,sortAttribute:$t.LocalId,width:100},{slug:Nh.Name,name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:$t.Name,minWidth:240},{slug:Nh.InsertedAt,name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:$t.InsertedAt,width:240},{slug:Nh.DuplicatedFrom,name:this.t("dupliqu_de_28582"),minWidth:240},...this.customFieldsToPossibleColumns(e)]}getAvailabilitiesColumns(){return[{slug:Nh.Availability,name:this.t("disponibilit_s_49923"),minWidth:320}]}getFormsColumns(e){return[{slug:Nh.CompletedForms,name:this.t("formulaires_rem_62495"),minWidth:320},{slug:Nh.FormsInsertedAt,name:this.t("dates_de_rempli_65075"),minWidth:320},...(0,ic.A)(e,e=>e.name).map(e=>({slug:`form_inserted_at_${e.id}`,name:this.t("date_de_remplis_00881",e.name),isSortable:!0,sortAttribute:`form_inserted_at_${e.id}`,minWidth:240})),{slug:Nh.TeamCode,name:this.t("code_quipe_14296"),isSearchable:!0,isSortable:!0,sortAttribute:$t.TeamCode,minWidth:180},{slug:Nh.TeamMembers,name:this.t("membres_de_l_q_00891"),minWidth:240}]}getPositionsColumns(){return[{slug:Nh.NumberOfAssignments,name:this.t("nombre_d_affect_31455"),width:240},{slug:Nh.NumberOfAssignmentsDays,name:this.t("nombre_de_jours_86280"),width:240},{slug:Nh.NumberOfAvailableDays,name:this.t("nombre_de_jours_07962"),width:240},{slug:Nh.Positions,name:this.t("missions_affect_97811"),minWidth:320},{slug:Nh.PositionsCategories,name:this.t("cat_gories_de_m_93035"),minWidth:320},{slug:Nh.VolunteerMinutes,name:this.t("nombre_de_minut_50497"),width:240},{slug:Nh.VolunteerRegistrationState,name:this.t("status_d_affect_75769"),isSortable:!0,sortAttribute:$t.State,width:240},{slug:Nh.WishedPositions,name:this.t("missions_souhai_23225"),minWidth:320},{slug:Nh.PreassignedPositions,name:this.t("missions_pr_af_02950"),minWidth:320},{slug:Nh.PreassignedPositionsCategories,name:this.t("cat_gories_pr_83825"),minWidth:320},{slug:Nh.CheckedInPositions,name:this.t("missions_point_05292"),minWidth:320}]}getAccreditationsColumns(){return(0,Va.A)([{slug:Nh.Accreditations,name:this.t("accr_ditations_33155"),minWidth:320},{slug:Nh.AccreditationsCategories,name:this.t("cat_gories_d_ac_37678"),minWidth:320},{slug:Nh.AccreditationState,name:this.t("statut_d_accr_d_75527"),isSortable:!0,sortAttribute:$t.AccreditationState,width:240},{slug:Nh.NumberOfAccreditations,name:this.t("nombre_d_accr_d_02452"),width:240},{slug:Nh.WishedAccreditationSlots,name:this.t("accr_ditations_74375"),minWidth:320},{slug:Nh.ScannedAccreditations,name:this.t("accr_ditations_52153"),minWidth:320}])}getWeezeventColumns(){return[{slug:Nh.WeezeventBarcodeId,name:this.t("TicketId"),isSearchable:!0,minWidth:240},{slug:Nh.WeezeventShortTag,name:this.t("puce_50504"),isSearchable:!0,minWidth:180},{slug:Nh.WeezeventPairedAt,name:this.t("appair_le_70213"),minWidth:180},{slug:Nh.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),minWidth:320}]}getDelegationsColumns(){return[{slug:Nh.Delegations,name:this.t("Delegation"),isSearchable:!0,isSortable:!0,sortAttribute:$t.Delegation,minWidth:240},{slug:Nh.DelegationCategory,name:this.t("cat_gorie_de_d_18027"),minWidth:240}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Text,hideEmpty:!0},{slug:"insertedAt",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Date,hideEmpty:!0},{slug:Nh.LocalId,name:this.t("id_sur_l_v_nem_01171"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Number,hideEmpty:!0},{slug:Nh.DuplicatedFrom,name:this.t("est_dupliqu_62764"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(e)]}getAvailabilitiesFilters(e,t){return[{slug:"numberOfAvailableDays",name:this.t("nombre_de_jours_07962"),category:this.t("disponibilit_s_49923"),fieldType:Ve.Number,hideEmpty:!0},{slug:"wishedSlots",name:this.t("disponibilit_s_49923"),category:this.t("disponibilit_s_49923"),fieldType:Ve.DateTimeRange,startAt:t.startAt,endAt:t.endAt},{slug:"wishedSlotsCustom",name:this.t("disponibilit_s_26280"),category:this.t("disponibilit_s_49923"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:e},{slug:"numberOfWishedSlots",name:this.t("nombre_de_dispo_26405"),category:this.t("disponibilit_s_49923"),fieldType:Ve.Number,hideEmpty:!0}]}getPositionsFilters(e,t,n){return[{slug:"volunteerRegistrationState",name:this.t("statut_d_affect_57444"),category:this.t("missions_63972"),fieldType:Ve.Select,values:Rn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"position",name:this.t("missions_affect_97811"),category:this.t("missions_63972"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventPosition",name:this.t("has_shift_on_ot_92375"),category:this.t("missions_63972"),fieldType:Ve.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:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"positionSlot",name:this.t("date_d_affectat_98566"),category:this.t("missions_63972"),fieldType:Ve.DateTimeRange,startAt:n.startAt,endAt:n.endAt},{slug:"positionCategory",name:this.t("cat_gories_de_m_93035"),category:this.t("missions_63972"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:"numberOfAssignmentsPerDay",name:this.t("nombre_d_affect_22087"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"numberOfAssignmentsDays",name:this.t("nombre_de_jours_86280"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"preassignedPosition",name:this.t("missions_pr_af_02950"),category:this.t("missions_63972"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"preassignedPositionCategory",name:this.t("cat_gories_pr_83825"),category:this.t("missions_63972"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedPositionsCategories",name:this.t("cat_gories_souh_80851"),category:this.t("missions_63972"),fieldType:Ve.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsCategories",name:this.t("nombre_de_cat_g_05961"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:"wishedPositions",name:this.t("missions_souhai_23225"),category:this.t("missions_63972"),fieldType:Ve.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositions",name:this.t("nombre_de_missi_52579"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:"wishedPositionsSlots",name:this.t("cr_neaux_souhai_90108"),category:this.t("missions_63972"),fieldType:Ve.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsSlots",name:this.t("nombre_de_cr_ne_28370"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:"volunteersMinutes",name:this.t("nombre_de_minut_50497"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:"volunteersMinutesDays",name:this.t("nombre_de_minut_89574"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"checkInAt",name:this.t("point_le_93167"),category:this.t("missions_63972"),fieldType:Ve.Date},{slug:"checkOutAt",name:this.t("d_point_le_29289"),category:this.t("missions_63972"),fieldType:Ve.Date},{slug:"checkInState",name:this.t("statut_de_point_44328"),category:this.t("missions_63972"),fieldType:Ve.Select,values:Xt.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:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"checkOutAtPositionSlot",name:this.t("cr_neaux_d_poin_45477"),category:this.t("missions_63972"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"overlappingAssignments",name:this.t("affectations_se_49339"),category:this.t("missions_63972"),fieldType:Ve.Checkbox,hideEmpty:!0}]}getAccreditationsFilters(e,t,n){return(0,Va.A)([{slug:"accreditationState",name:this.t("statut_d_accr_d_75527"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,values:Yt.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:Ve.Number,hideEmpty:!0},{slug:"accreditation",name:this.t("accr_ditations_39450"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventAccreditation",name:this.t("has_accreditati_31831"),category:this.t("accr_ditations_39450"),fieldType:Ve.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:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedAccreditationsSlots",name:this.t("accr_ditations_74375"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedAccreditationsSlots",name:this.t("nombre_d_accr_d_92021"),category:this.t("accr_ditations_39450"),fieldType:Ve.Number,hideEmpty:!0},{slug:"accreditationSlotId",name:this.t("cr_neaux_accr_d_70934"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationSlot",name:this.t("date_d_accr_dit_26214"),category:this.t("accr_ditations_39450"),fieldType:Ve.Date,startAt:n.startAt,endAt:n.endAt},{slug:"scannedAccreditationsSlots",name:this.t("accr_ditations_52153"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t}])}getDelegationsFilters(e,t){return[{slug:"delegation",name:this.t("inscrit_via_la_86398"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,needLoading:!0,eventId:t},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"isDelegationCategoryLeader",name:this.t("est_responsable_36610"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,needLoading:!0,eventId:t}]}getSegmentsFilters(e,t,n,i){return[{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("vues_personnali_80652"),fieldType:Ve.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:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"positionsSegments",name:this.t("affecter_une_10657"),category:this.t("vues_personnali_80652"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationsSegments",name:this.t("affecter_une_91431"),category:this.t("vues_personnali_80652"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"delegationsSegments",name:this.t("affecter_une_45240"),category:this.t("vues_personnali_80652"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:t}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:Ve.Select,needLoading:!0,eventId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:Ve.Date,hideEmpty:!0,needLoading:!0,eventId:e}]}getTeamsFilters(){return[{slug:"isTeam",name:this.t("est_inscrit_en_86193"),category:this.t("_quipes_18817"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:"teamCode",name:this.t("code_quipe_14296"),category:this.t("_quipes_18817"),fieldType:Ve.Text},{slug:"numberOfTeamMembers",name:this.t("nombre_de_membr_82302"),category:this.t("_quipes_18817"),fieldType:Ve.Number},{slug:"isTeamLeader",name:this.t("est_chef_d_qui_73792"),category:this.t("_quipes_18817"),fieldType:Ve.Checkbox,hideEmpty:!0}]}getWeezeventFilters(e){return[{slug:Nh.WeezeventBarcodeId,name:this.t("TicketId"),category:"Weezevent",fieldType:Ve.Text,hideEmpty:!0},{slug:Nh.WeezeventShortTag,name:this.t("puce_50504"),category:"Weezevent",fieldType:Ve.Text},{slug:Nh.WeezeventPairedAt,name:this.t("appair_le_70213"),category:"Weezevent",fieldType:Ve.Datetime,useLocalZone:!0},{slug:Nh.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),category:"Weezevent",fieldType:Ve.Select,needLoading:!0,eventId:e}]}getEmailsFilters(e,t){return(0,Va.A)([t?{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:Ve.Campaign,needLoading:!0,eventId:e}:null,{slug:"assignmentEmailSentAt",name:this.t("date_d_envoi_de_01614"),category:this.t("e_mails_09850"),fieldType:Ve.Date},{slug:"assignmentEmailState",name:this.t("statut_de_de_l_36346"),category:this.t("e_mails_09850"),fieldType:Ve.Select,values:on.filter(e=>e!==Se.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:Ve.Select,values:on.filter(e=>e!==Se.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:Ve.Checkbox,hideEmpty:!0},t?{slug:"campaignReply",name:this.t("r_ponse_une_c_32448"),category:this.t("e_mails_09850"),fieldType:Ve.Text,needLoading:!0,eventId:e}:null])}getCommentsFilter(e,t){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:Ve.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:Ve.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t}]}};function Vh(e,t,n,i,s){const o=t.diff(e,"days").days;return(0,wc.A)(0,o+1).map(t=>e.plus({days:t}).set({hour:s})).filter(e=>i===ht.AllDays||n.some(t=>t.contains(e)||t.start.startOf("day").equals(e)||t.end.startOf("day").equals(e)))}function Uh(e,t,n,i,s){const o=t.diff(e,"days").days;return(0,wc.A)(0,o+1).flatMap(t=>{const i=e.plus({days:t});return n.map(e=>{const[t,n]=e.startTime.split(":").map(e=>parseInt(e,10)),[s,o]=e.endTime.split(":").map(e=>parseInt(e,10)),r=i.set({hour:t,minute:n});let a=i.set({hour:s,minute:o});return(ss===ht.AllDays||i.some(t=>t.overlaps(e.interval)))}function Wh(e,t){return m(e)?`${e} (${t.toFormat("HH:mm")})`:t.toFormat("HH:mm")}function Gh(e,t,n){const i=e.filter(e=>!t.equals(Hs(e)));return i.length===e.length&&n?[...e,Ys(t)]:i.length===e.length||n?e:i}Bh=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],Bh);const Hh=(e,t)=>(0,ic.A)(Object.values((0,nc.A)(t,e=>e.position.name)).map(t=>({name:t[0].position.name,values:(0,ic.A)(t.map(t=>({id:t.id,name:ph(e,t,t.position.name,{position:{includeNameAtEnd:!0}}),startTime:t.range.start.toMillis()})),({startTime:e})=>e)})),({name:e})=>e),qh=(e,t)=>(0,ic.A)(Object.values((0,nc.A)(t,e=>e.accreditation.name)).map(t=>({name:t[0].accreditation.name,values:(0,ic.A)(t.map(t=>({id:t.id,name:wh(e,t,t.accreditation.name,{accreditation:{includeNameAtEnd:!0}})})),e=>e.name)})),({name:e})=>e),Yh=async(e,t,n)=>{const i=await q();if("createdBy"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return co("query Admins($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(eventId: $eventId, roleTypes: [OrganizationAdmin, EventAdmin]) {\n nodes {\n userId\n email\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes.map(({userId:e,email:t,name:n})=>({id:e,name:`${m(n)?n:"-"} - ${t}`})),n.needLoading=!1}else if("leaders"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return co('query DelegationsSegmentsLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n isDelegationLeader: true\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes,n.needLoading=!1}else if("delegationCategory"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return co("query VolunteersSegmentsDelegationsCategories(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n delegationsCategories(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,level:n.eventId?tt.Event:tt.Organization,eventId:n.eventId},i);n.values=(0,ic.A)(e.delegationsCategories.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("tag"===n.slug&&n.organizationId){const{organization:e}=await Mo({organizationId:n.organizationId,eventId:n.eventId,context:n.tagContext},i);n.values=(0,ic.A)(e.tags.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if(n.eventId){if(["preassignedPosition","position","wishedPositions"].includes(n.slug)){const{event:e}=await function(e,t){return co("query VolunteersSegmentsPositions($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n positionCategoryName\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,ic.A)(Object.entries((0,nc.A)(e.positions.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:t[0].positionCategoryName,values:(0,ic.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("hasOtherEventPosition"===n.slug&&n.organizationId){const{organization:{positions:e}}=await function(e,t){return co("query VolunteersSegmentsOtherPositions($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n positions(excludedEventId: $eventId) {\n nodes {\n id\n name\n positionCategoryName\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.valuesGroups=(0,ic.A)(Object.entries((0,nc.A)(e.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].positionCategoryName}`,values:(0,ic.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if(["positionSlotId","wishedPositionsSlots","checkInAtPositionSlot","checkOutAtPositionSlot"].includes(n.slug)){const{event:e}=await function(e,t){return co("query VolunteersSegmentsPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=Hh(t,e.positionsSlots.nodes),n.needLoading=!1}else if(["positionCategory","preassignedPositionCategory","wishedPositionsCategories"].includes(n.slug)){const{event:e}=await function(e,t){return co("query VolunteersSegmentsPositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,ic.A)(e.positionsCategories,e=>e.name.toLowerCase()),n.needLoading=!1}else if("wishedSlotsCustom"===n.slug){const{event:t}=await function(e,t){return co("query VolunteeersSegmentsCustomSlotsPeriods($eventId: EventId!) {\n event(id: $eventId) {\n startAt\n endAt\n ranges\n\n customSlotsPeriods {\n name\n startDate\n endDate\n\n customSlots {\n name\n startTime\n endTime\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=((e,t)=>{const n=t.customSlotsPeriods.flatMap(e=>Uh(e.startDate??t.startAt,e.endDate??t.endAt,e.customSlots,t.ranges,ht.AllDays));return(0,ic.A)(Object.values((0,nc.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:Wh(e,t)}))}})})(e,t),n.needLoading=!1}else if("accreditation"===n.slug){const{event:e}=await function(e,t){return co("query VolunteersSegmentsAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n accreditationCategoryName\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,ic.A)(Object.entries((0,nc.A)(e.accreditations.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:t[0].accreditationCategoryName,values:(0,ic.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("hasOtherEventAccreditation"===n.slug&&n.organizationId){const{organization:{accreditations:e}}=await function(e,t){return co("query VolunteersSegmentsOtherAccreditations($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n accreditations(excludedEventId: $eventId) {\n nodes {\n id\n name\n accreditationCategoryName\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.valuesGroups=(0,ic.A)(Object.entries((0,nc.A)(e.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].accreditationCategoryName}`,values:(0,ic.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("accreditationCategory"===n.slug){const{event:e}=await function(e,t){return co("query VolunteersSegmentsAccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,ic.A)(e.accreditationsCategories,e=>e.name.toLowerCase()),n.needLoading=!1}else if("positionsSegments"===n.slug){const{event:e}=await function(e,t){return co("query VolunteersSegmentsPositionsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,ic.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,ic.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("accreditationsSegments"===n.slug){const{event:e}=await function(e,t){return co("query VolunteersSegmentsAccreditationsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Accreditations) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,ic.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,ic.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("delegationsSegments"===n.slug||"isDelegationLeader"===n.slug){const{event:e}=await function(e,t){return co("query VolunteersSegmentsDelegationsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Delegations) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,ic.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,ic.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("forms"===n.slug||"form"===n.slug||"formsInsertedAt"===n.slug){const{event:e}=await function(e,t){return co("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:[Ms.SegmentFormFragment]})}({eventId:n.eventId},i);n.values=(0,ic.A)(e.forms.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("campaign"===n.slug||"campaignReply"===n.slug){const{event:e}=await function(e,t){return co("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:[Ms.SegmentCampaignFragment]})}({eventId:n.eventId},i);n.campaigns=(0,ic.A)(e.campaigns.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("delegation"===n.slug){const{event:e}=await function(e,t){return co("query VolunteersSegmentsDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,ic.A)(e.delegations.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if(["accreditationSlotId","scannedAccreditationsSlots","wishedAccreditationsSlots"].includes(n.slug)){const{event:t}=await function(e,t){return co("query VolunteersSegmentsAccreditationsSlots($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n id\n name\n date\n\n accreditation {\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=qh(e,t.accreditationsSlots.nodes),n.needLoading=!1}else if(n.slug===Nh.WeezaccessChecklists){const{event:e}=await function(e,t){return co("query VolunteersWeezaccessChecklists($eventId: EventId!) {\n event(id: $eventId) {\n weezaccessChecklists {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,ic.A)(e.weezaccessChecklists,e=>e.name.toLowerCase()),n.needLoading=!1}else if("commentWrittenBy"===n.slug){const{organization:e}=await function(e,t){return co("query VolunteersSegmentsLoaders($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n admins: usersInfos(roleTypes: [OrganizationAdmin, EventAdmin]) {\n nodes {\n id\n nameOrEmail\n }\n }\n\n usersInfos(eventId: $eventId, hasRole: true) {\n nodes {\n id\n nameOrEmail\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=(0,ic.A)((0,ch.A)(e.admins.nodes.concat(e.usersInfos.nodes),e=>e.id),e=>e.nameOrEmail.toLowerCase()).map(({id:e,nameOrEmail:t})=>({id:e,name:t})),n.needLoading=!1}}else if(n.organizationId)if("event"===n.slug){const{organization:e}=await function(e,t){return co("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:[Ms.SegmentEventFragment]})}({organizationId:n.organizationId},i);n.values=(0,ic.A)(e.events.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("forms"===n.slug||"formsInsertedAt"===n.slug){const{organization:e}=await function(e,t){return co("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:[Ms.SegmentFormFragment]})}({organizationId:n.organizationId},i);n.values=(0,ic.A)(e.forms.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("campaign"===n.slug){const{organization:e}=await function(e,t){return co("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:[Ms.SegmentCampaignFragment]})}({organizationId:n.organizationId},i);n.campaigns=(0,ic.A)(e.campaigns.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("positionCustomField"===n.slug||"accreditationCustomField"===n.slug){const{organization:e}=await function(e,t){return co("query ConditionsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All, fieldTypes: [Checkbox, Select]) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.values=(0,ic.A)(e.customFields.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("delegation"===n.slug){const{organization:e}=await function(e,t){return co("query UsersSegmentsDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n name\n\n delegations(level: Both) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.valuesGroups=(0,ic.A)(Object.entries((0,nc.A)(e.delegations.nodes,e=>e.event?.id||-1)).map(([t,n])=>({name:n[0].event?.name??e.name,values:(0,ic.A)(n,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("usersSegments"===n.slug){const{organization:e}=await function(e,t){return co("query VolunteersSegmentsUsersSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n segmentsFolders(level: Organization, segmentType: Volunteers) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.valuesGroups=(0,ic.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,ic.A)(e.segments,e=>e.index)})),n.needLoading=!1}};function Kh(e){const t=Gn(Wc),n=Gn(ah),[i,s]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{const i=e.filter(({filter:e})=>e.needLoading);eo(i)&&(s(!0),Promise.all(i.map(({filter:e})=>Yh(t,n,e))).then(()=>{s(!1)}))},[e]),i}const Zh=e=>{const t=Hn(),n=e.filterPredicate.filter.slug,s=e.filterPredicate.filter.fieldType,o=function(e){const t=Gn(Wc),n=Gn(ah),[i,s]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{e.needLoading&&(s(!0),Yh(t,n,e).then(()=>{s(!1)}))},[e.needLoading]),i}(e.filterPredicate.filter);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{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)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:e.filterPredicate.filter.name}),(0,i.jsx)(Ba,{height:"3"}),o?(0,i.jsx)(_l,{}):"condition"===n?(0,i.jsx)(Su,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isLeader"===n||"isPositionLeader"===n||"isPositionCategoryLeader"===n||"isDelegationLeader"===n?(0,i.jsx)(Lu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isAdmin"===n?(0,i.jsx)(Nu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"privacy"===n?(0,i.jsx)(qu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isTeam"===n?(0,i.jsx)(Bu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"wishedPositions"===n||"wishedPositionsCategories"===n?(0,i.jsx)(Zu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"formsInsertedAt"===n?(0,i.jsx)(Mu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"numberOfAssignmentsPerDay"===n||"volunteersMinutesDays"===n?(0,i.jsx)(Hu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"campaignReply"===n?(0,i.jsx)(Cu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[Ve.Address,Ve.Text,Ve.Textarea].includes(s)?(0,i.jsx)(Ku,{filterPredicate:e.filterPredicate,showIsValid:!1,onAdd:e.onAdd}):[Ve.Country,Ve.Language,Ve.Nationality,Ve.Select,Ve.Sex].includes(s)?(0,i.jsx)(Yu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[Ve.Checkbox,Ve.Validation].includes(s)?(0,i.jsx)(wu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===Ve.Phone?(0,i.jsx)(Ku,{filterPredicate:e.filterPredicate,showIsValid:!0,onAdd:e.onAdd}):s===Ve.Number?(0,i.jsx)(Gu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===Ve.DateTimeRange?(0,i.jsx)(Pu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===Ve.Date?(0,i.jsx)(Ru,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===Ve.Datetime?(0,i.jsx)(Du,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===Ve.File?(0,i.jsx)(Fu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===Ve.Campaign?(0,i.jsx)(ju,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):(0,i.jsx)("div",{children:"TODO"})]})};function Xh(e){switch(e){case Ve.Address:return"map-location";case Ve.Text:case Ve.Textarea:return"text";case Ve.Checkbox:return"square-check";case Ve.Validation:return"check";case Ve.Select:return"list-ul";case Ve.Date:return"calendar";case Ve.Datetime:return"calendar-day";case Ve.Time:return"clock";case Ve.File:return"file";case Ve.Phone:return"phone";case Ve.Language:return"language";case Ve.Number:return"00";case Ve.Sex:return"venus-mars";case Ve.Nationality:case Ve.Country:return"flag";case Ve.DateTimeRange:return"calendar-range";case Ve.Campaign:return"paper-plane";default:return nl()}}const Jh=e=>{const t=(0,M.useMemo)(()=>(0,Fs.A)(e.filtersPredicates.map(({filter:e})=>e.category)),[e.filtersPredicates]),n=(0,M.useMemo)(()=>(0,nc.A)(e.filtersPredicates,({filter:e})=>e.category),[e.filtersPredicates]);return(0,i.jsx)(Ra,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",px:"$4"},direction:"column",children:t.map((t,s)=>{const o=n[t];return(0,i.jsxs)(M.Fragment,{children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[0!==s&&(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{css:{paddingBottom:"$2",paddingTop:"$3"},font:"gray500 textXs semiBold",children:t})]}),o.map(t=>{const{filter:n}=t;return(0,i.jsxs)(Ra,{align:"center",css:{py:"$2"},gap:"3",children:[(0,i.jsx)(Ra,{align:"center",css:{borderRadius:"$1",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Ya,{icon:Xh(n.fieldType)})}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray900",css:{ellipsis:!0},fontWeight:"medium",title:n.name,width:1,children:n.name}),m(n.label)&&(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},title:n.label,width:1,children:n.label})]}),e.isEdit?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{e.onEdit(t)}}),(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(n.slug)}})]}):(0,i.jsx)(jl,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(t)}})]},n.slug)})]},s)})})},Qh=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.selectedFilterPredicate),[o,r]=(0,M.useState)((0,bu.A)(e.predicates)),a=(0,M.useCallback)(e=>{r((0,cu.jM)(t=>{const n=t.findIndex(t=>t.slug===e.slug);-1===n?t.push(e):t[n]=e})),s(null)},[r,s]),l=(0,M.useCallback)(e=>{r((0,cu.jM)(t=>{const n=t.findIndex(t=>t.slug===e);t.splice(n,1)}))},[r]),[d,c]=(0,M.useState)(""),[u,h]=au(o,e.possibleFilters,d);return(0,i.jsxs)(hu,{size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(mu,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textXl",children:t("filtres_64574")}),m(e.subtitle)&&(0,i.jsx)(br,{color:"gray500",children:e.subtitle}),(0,i.jsx)(Ba,{height:"6"}),n?(0,i.jsx)(Zh,{filterPredicate:n,onAdd:a,onBack:()=>{s(null)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ol,{placeholder:t("rechercher_un_f_22061"),value:d,onChange:c}),(0,i.jsx)(Ba,{height:"6"}),o.length>0&&u.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_29511")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Jh,{filtersPredicates:u,isEdit:!0,onDelete:l,onEdit:e=>{s(e)}}),(0,i.jsx)(Ba,{height:"8"})]}),(0,i.jsx)(br,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_37728")}),h.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Jh,{filtersPredicates:h,isEdit:!1,onAdd:e=>{s(e)}})]})]}),(0,i.jsx)(Ba,{height:"6"})]}),null===n&&(0,i.jsx)(gu,{children:(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{onClick:()=>{e.onFilter(o),e.onClose()},children:e.buttonText||t("filtrer_78031")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})},em=M.createContext({});function tm(){return M.useContext(em)}const nm=()=>{const e=Hn(),t=Gn(du),{filtersPredicates:n,clearNameCursors:s,setPredicates:o,setIsFilterOpen:r,setSelectedFilterPredicate:a,predicates:l}=tm(),d=(0,M.useCallback)(()=>{s(),o([])},[s,o]),c=(0,M.useCallback)(e=>{a(e),r(!0)},[r,a]),u=(0,M.useCallback)(e=>{s(),o((0,sc.A)(l,e.predicate))},[l,s,o]);return Kh(n),eo(n)?(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(Jd,{leftIcon:"loader"},n):(0,i.jsx)(Jd,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>{c(e)},onRightIconClick:()=>{u(e)},children:t.filterPredicateToText(e)},n)),(0,i.jsx)(br,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:e("r_initialiser_l_66835")})]}):null};function im(){return(0,M.useMemo)(()=>navigator.platform.toLowerCase().startsWith("mac"),[])}function sm(e,t){const n=im(),i=(0,M.useCallback)(i=>{i.key===e&&(n&&i.metaKey||!n&&i.ctrlKey)&&t(i)},[e,t]);(0,M.useEffect)(()=>(document.addEventListener("keydown",i,!1),()=>{document.removeEventListener("keydown",i,!1)}),[e,t,i])}const om=e=>{const{translate:t}=cl(),{columnsSearch:n,setColumnsSearch:s}=tm(),[o,r]=(0,M.useState)(""),a=(0,M.useMemo)(()=>m(o)?e.searchableColumns.filter(e=>e.name.toLowerCase().trim().includes(o.toLowerCase().trim())):e.searchableColumns,[e.searchableColumns,o]);return(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(Vd,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Ra,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:o,onChange:r}),(0,i.jsx)(Ra,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(dc,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{s(no(n,e,"checked"===t))},children:t},e))})]})})]})},rm=()=>{const e=Hn(),{isEditMode:t,massActions:n,name:s,possibleColumns:o,possibleRenderings:r,reload:a,renderActions:l,rendering:d,setAreColumnsOpen:c,setIsEditMode:u,setIsFilterOpen:h,setName:m,setNameDebounced:g,setRendering:p,showEditColumns:f,showEditMode:x,showFilters:_,showMassActions:I,showSearchColumns:v,totalCount:b}=tm(),j=I&&n.numberOfSelected>0,C=(0,M.useMemo)(()=>(0,ic.A)(o.filter(e=>e.isSearchable),e=>e.name),[o]),y=(0,M.useMemo)(()=>v?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[v]);return sm("e",(0,M.useCallback)(()=>{x&&u(!t)},[t,x,u])),(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsxs)(Ra,{width:320,children:[(0,i.jsx)(Ol,{css:y,icon:"magnifying-glass",placeholder:e("rechercher_50038"),value:s,onChange:e=>{m(e),g(e)}}),v&&(0,i.jsx)(om,{searchableColumns:C})]}),j?(0,i.jsx)(Ra,{css:{flex:"1"},gap:"4",children:"function"==typeof l?l(n,b,a):null}):(0,i.jsxs)(Ra,{css:{flex:"1"},gap:"4",children:[_&&(0,i.jsx)(jl,{color:"gray",leftIcon:"bars-filter",onClick:()=>{h(!0)},children:e("filtres_64574")}),(0,i.jsx)(br,{css:{flex:"1"}}),eo(r)&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:Fh(d),children:Mh(e,d)})}),(0,i.jsx)(Vd,{placement:"bottom-end",children:r.map(t=>(0,i.jsx)(Ld,{icon:Fh(t),onClick:()=>p(t),children:Mh(e,t)},t))})]}),f&&(0,i.jsx)(jl,{color:"white",leftIcon:"gear",onClick:()=>{c(!0)},children:e("_diter_les_colo_39630")}),x&&(0,i.jsx)(xu,{value:t,onChange:u,children:e("mode_dition_93778")})]})]})},am=()=>(0,i.jsxs)(Ra,{css:{border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$1",borderTopRightRadius:"$1",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(rm,{}),(0,i.jsx)(nm,{})]}),lm=e=>{const{translate:t}=cl(),[n,s]=M.useState(e.predicates),[o,r]=M.useState(e.columns),[a,l]=M.useState(e.columnsSearch),[d,c]=M.useState(e.rendering),[u,h]=M.useState(e.name||""),[g,p]=M.useState(e.name||""),[f,x]=M.useState(e.limit),[_,I]=M.useState(e.sort),[v,b]=M.useState(0),j=Dc(e=>{p(e),C()}),C=M.useCallback(()=>{b(0)},[b]),y=M.useCallback(t=>{e.setName?.(t),h(t)},[e.setName,h]),k=M.useCallback(()=>{y(""),p(""),C()},[y,p,C]),A=M.useCallback(t=>{e.setPredicates?.(t),s(t)},[e.setPredicates,s]),w=M.useCallback(t=>{e.setColumns?.(t),r(t)},[e.setColumns,r]),S=M.useCallback(t=>{e.setColumnsSearch?.(t),l(t)},[e.setColumnsSearch,l]),E=M.useCallback(t=>{e.setRendering?.(t),c(t)},[e.setRendering,c]),T=M.useCallback(t=>{e.setLimit?.(t),x(t)},[e.setLimit,x]),z=M.useCallback(t=>{e.setSort?.(t),I(t),b(0)},[e.setSort,I,b]),O=M.useMemo(()=>JSON.stringify(e.predicates),[e.predicates]),R=M.useMemo(()=>JSON.stringify(e.columns),[e.columns]),$=M.useMemo(()=>JSON.stringify(e.columnsSearch),[e.columnsSearch]),D=M.useMemo(()=>JSON.stringify(e.rendering),[e.rendering]),P=M.useMemo(()=>JSON.stringify(e.sort),[e.sort]),F=M.useMemo(()=>JSON.stringify(n)!==O||JSON.stringify(o)!==R||JSON.stringify(a)!==$||JSON.stringify(d)!==D||JSON.stringify(_)!==P,[O,n,R,o,$,a,D,d,P,_]),N=M.useMemo(()=>e.columnsToIncludes?.(o,d)??{},[o,d,e.columnsToIncludes]),[L,B]=M.useState(null),[V,U]=M.useState(!1),W=M.useCallback(async()=>{U(!0);const t=await e.loadDataList({...N,...e.loadDataListParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,name:m(g)?g:null,columnsSearch:eo(a)?a:null,predicates:n,limit:f,offset:v,sort:_},await q());B(t.data),U(!1)},[a,N,f,g,v,n,U,B,_,e.organizationId,e.eventId,e.loadDataList,e.loadDataListParams]),[G,H]=M.useState([]),{numberOfPages:Y,totalCount:K}=vu(L?.rows),[Z,X]=M.useState({}),J=M.useCallback(async t=>{X(e=>({...e,[t]:!0}));const n=(await e.loadRow({...N,...e.loadRowParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,id:t},await q())).data.row;H(e=>e.map(e=>e.id===t?n:e)),X(e=>({...e,[t]:!1}))},[N,X,e.organizationId,e.eventId,e.loadRow,e.loadRowParams]),Q=M.useCallback(t=>e.getMassActionId?.(t)??t.id,[e.getMassActionId]),ee=Iu({}),[te]=M.useMemo(()=>au(n,e.filters),[n,e.filters]),[ne,ie]=M.useState(!1),[se,oe]=M.useState(!1),[re,ae]=M.useState(!1),[le,de]=M.useState(null);return M.useEffect(()=>{"string"==typeof e.name&&(y(e.name),j(e.name))},[e.name,y,j]),M.useEffect(()=>{W()},[a,N,f,g,v,n,_,e.organizationId,e.eventId,e.loadDataList]),M.useEffect(()=>{H(L?.rows?.nodes??[])},[L]),M.useEffect(()=>{ee.setStates(Object.fromEntries(G.map(e=>[`r${Q(e)}`,{id:Q(e),state:"unchecked"}])))},[G,ee.setStates]),(0,i.jsxs)(em.Provider,{value:{areColumnsOpen:re,clearNameCursors:k,columns:o,columnsSearch:a,data:G,filtersPredicates:te,getMassActionId:Q,idToLoading:Z,isEditMode:ne,isFilterOpen:se,isLoading:V,isSaveVisible:F,limit:f,loadDataResult:L,massActions:ee,name:u,nameDebounced:g,numberOfPages:Y,offset:v,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:n,reload:W,reloadRow:J,renderActions:e.renderActions,rendering:d,selectedFilterPredicate:le,setAreColumnsOpen:ae,setColumns:w,setColumnsSearch:S,setIsEditMode:ie,setIsFilterOpen:oe,setLimit:T,setName:y,setNameDebounced:j,setOffset:b,setPredicates:A,setRendering:E,setSelectedFilterPredicate:de,setSort:z,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:e.showFilters,showMassActions:e.showMassActions,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:e.showSearchColumns,sort:_,totalCount:K},children:[(0,i.jsxs)(Ra,{css:{background:"white"},direction:"column",height:1,width:1,children:[(0,i.jsx)(am,{}),e.children]}),se&&(0,i.jsx)(Qh,{possibleFilters:e.filters,predicates:n,selectedFilterPredicate:le,onClose:()=>{oe(!1)},onFilter:e=>{k(),A(e)}}),re&&(0,i.jsx)(_u,{columns:e.possibleColumns,initialSelectedColumns:o,saveButtonText:t("_diter_les_colo_39630"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_03763"),title:t("_dition_des_col_70300"),onClose:()=>{ae(!1)},onSave:w})]})},dm={deserialize(e){const t=parseInt(e||"",10);return isNaN(t)?null:t},serialize:e=>e.toString(10)},cm={deserialize(e){try{return JSON.parse(e||"")}catch{return null}},serialize:e=>JSON.stringify(e)},um={deserialize:e=>m(e)&&Bs.c9.fromISO(e)?.isValid?Bs.c9.fromISO(e):null,serialize:e=>e.toISO()};function hm(e,t,n={}){const i=Qn(),[s,o]=M.useState("function"==typeof n.deserialize?n.deserialize(i.getItem(e))||t:i.getItem(e)??t);return[s,M.useCallback(t=>{o(t),i.setItem(e,"function"==typeof n.serialize?n.serialize(t):t)},[e,o,i])]}const mm=e=>{return(0,i.jsxs)(Fc,{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:vt.Asc}:t.direction===vt.Asc?{attribute:n,direction:vt.Desc}:null))},children:[e.children,(0,i.jsx)(Ba,{width:"2"}),(0,i.jsx)(Ya,{icon:(t=e.sort,n=e.attribute,null===t||t.attribute!==n?"arrow-down-arrow-up":t.direction===vt.Asc?"arrow-up":"arrow-down")})]});var t,n},gm=e=>{const t=!!e.paginationRow;return(0,i.jsx)(Ic,{children:(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsxs)(id,{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)(br,{css:{overflow:"auto"},children:e.children})]}),e.paginationRow]})})},pm=M.createContext({}),fm=e=>{const[t,n]=M.useState(!1),[s,o]=M.useState(null),[r,a]=M.useState(null),l=(0,Ma.A)("tooltip-");return(0,i.jsx)(pm.Provider,{value:{isVisible:t,referenceElement:s,popperElement:r,tooltipId:l,setIsVisible:n,setReferenceElement:o,setPopperElement:a},children:e.children})};function xm(){return M.useContext(pm)}const _m=e=>{const{isVisible:t,popperElement:n,referenceElement:s,setPopperElement:o,tooltipId:r}=xm(),{styles:a,attributes:l,update:d}=(0,Bd.E)(s,n,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,4]}}]});M.useEffect(()=>{d?.()},[t,s]);const c=(0,i.jsx)(Ra,{ref:o,align:"center",css:{background:"$gray900",borderRadius:"$1",color:"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,Wt.createPortal)(c,document.body):c},Im=e=>{const{setIsVisible:t,setReferenceElement:n,tooltipId:s}=xm(),o=M.cloneElement(M.Children.only(e.children),{ref(e){n(e)},"aria-labelledby":s,"aria-describedby":s,onMouseEnter(){t(!0)},onMouseLeave(){t(!1)},onFocus(){t(!0)},onBlur(){t(!1)}});return(0,i.jsx)(i.Fragment,{children:o})},vm=e=>{const{translate:t}=cl(),{showRowEdit:n,getMassActionId:s,massActions:o,reload:r,reloadRow:a,showMassActions:l,showRowDropdown:d}=tm(),c=o.states[`r${s(e.row)}`]?.state??"unchecked",u=M.useCallback(()=>{a(e.row.id)},[e.row.id,a]),h=d||n;return(0,i.jsxs)(Tc,{css:{background:"checked"===c?"$primary100":"white","&:hover":{background:"checked"===c?"$primary100":"$gray100"}},onMouseLeave:e=>{$d(e.target)},children:[l&&(0,i.jsx)(yc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:c,onClick:t=>{o.toggleRow(`r${s(e.row)}`,t)}})}),e.selectedColumns.map(t=>(0,i.jsx)(M.Fragment,{children:e.renderCell(t,e.row,u)},t.slug)),h&&(0,i.jsxs)(Uc,{justify:"center",children:[n&&e.getEditPath&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",to:e.getEditPath(e.row)})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]}),d&&e.renderRowDropdown?.(e.row,r)]}),e.renderRowPanels?.(e.row,u)]})},bm=e=>{const{columns:t,data:n,idToLoading:s,isLoading:o,limit:r,massActions:a,numberOfPages:l,offset:d,possibleColumns:c,setLimit:u,setOffset:h,setSort:m,showMassActions:g,showRowDropdown:p,showRowEdit:f,sort:x,totalCount:_}=tm(),I=M.useMemo(()=>t.flatMap(e=>(0,Va.A)([c.find(t=>t.slug===e)])),[t,c]);return(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":o,headerRow:(0,i.jsxs)(xc,{children:[g&&(0,i.jsx)(Fc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:a.selectAllState,onClick:a.toggleSelectAll})}),I.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute,minWidth:e.minWidth,setSort:m,sort:x,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(p||f)&&(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{children:(0,i.jsx)(Ec,{limit:r,numberOfPages:l,offset:d,setLimit:u,setOffset:h,showLimits:!0,totalCount:_})}),children:o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):n.map(t=>s[t.id]?(0,i.jsx)(Mc,{},t.id):(0,i.jsx)(vm,{getEditPath:e.getEditPath,renderCell:e.renderCell,renderRowDropdown:e.renderRowDropdown,renderRowPanels:e.renderRowPanels,row:t,selectedColumns:I},t.id))})})};var jm;!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"}(jm||(jm={}));let Cm=class extends du{constructor(e,t,n){super(e,t,n)}getFilters(){return[{slug:"features",name:this.t("fonctionnalit_s_47714"),category:this.t("organisation_71863"),fieldType:Ve.Select,values:ln.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_admin_98471"),category:this.t("organisation_71863"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:"isActive",name:this.t("est_active_05309"),category:this.t("organisation_71863"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:"useOldBilling",name:this.t("utilise_l_ancie_27299"),category:this.t("organisation_71863"),fieldType:Ve.Checkbox},{slug:"isOverLimit",name:this.t("d_passe_la_limi_27046"),category:this.t("organisation_71863"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:jm.MembersLimit,name:this.t("nombre_de_membr_16400"),category:this.t("organisation_71863"),fieldType:Ve.Number},{slug:jm.PricePerMember,name:this.t("prix_par_membre_20633"),category:this.t("organisation_71863"),fieldType:Ve.Number}]}getPossibleColumns(){return[{slug:jm.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:nt.Id,width:100},{slug:jm.Name,name:this.t("nom_de_l_organi_49583"),minWidth:240},{slug:jm.InsertedAt,name:this.t("date_de_cr_atio_00749"),isSortable:!0,sortAttribute:nt.InsertedAt,width:200},{slug:jm.PeriodEndAt,name:this.t("date_de_fin_de_17750"),isSortable:!0,sortAttribute:nt.PeriodEndAt,width:200},{slug:jm.Features,name:this.t("fonctionnalit_s_47714"),minWidth:320},{slug:jm.NumberOfEvents,name:this.t("nombre_d_v_nem_14214"),minWidth:180},{slug:jm.NumberOfMembers,name:this.t("nombre_de_membr_49522"),minWidth:180},{slug:jm.MembersLimit,name:this.t("nombre_de_membr_16400"),minWidth:180},{slug:jm.PricePerMember,name:this.t("prix_par_membre_20633"),minWidth:180},{slug:jm.WeezeventOrganizationId,name:this.t("id_de_l_organis_67465"),isSortable:!0,sortAttribute:nt.WeezeventOrganizationId,width:100}]}};function ym(e){switch(e){case Fe.Accreditation:return"badge-check";case Fe.Api:return"code-branch";case Fe.Beta:return"flask";case Fe.Community:return"people-group";case Fe.CustomDocument:return"file";case Fe.Delegation:return"users";case Fe.Documents:return"file";case Fe.Eid:return"id-card";case Fe.KmlImport:return"cloud-arrow-up";case Fe.Languages:return"language";case Fe.Multiform:return"file-lines";case Fe.Skidata:return"person-skiing";case Fe.Sms:return"message";case Fe.Weezevent:return"ticket";case Fe.Zapier:return"bolt";default:return nl()}}Cm=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],Cm);const km=e=>{const t=Gn(Wc);return e.column.slug===jm.Id?(0,i.jsx)(yc,{width:e.column.width,children:e.row.id}):e.column.slug===jm.WeezeventOrganizationId?(0,i.jsx)(yc,{width:e.column.width,children:e.row.weezeventOrganizationId?(0,i.jsxs)(Vc,{to:`/ticket/O${e.row.weezeventOrganizationId}`,children:["O",e.row.weezeventOrganizationId]}):""}):e.column.slug===jm.Name?(0,i.jsx)(yc,{css:{"& a":{color:"$primary700 !important"}},children:(0,i.jsx)(Ha,{to:Ii.ORGANIZATION({organizationId:e.row.id}),children:e.row.name})}):e.column.slug===jm.InsertedAt?(0,i.jsx)(yc,{width:e.column.width,children:t.toLocaleString(e.row.insertedAt,Zs.DateOnly.MonthLong)}):e.column.slug===jm.PeriodEndAt?(0,i.jsx)(yc,{width:e.column.width,children:t.toLocaleString(e.row.periodEndAt,Zs.DateOnly.MonthLong)}):e.column.slug===jm.Features?(0,i.jsx)(yc,{children:(0,i.jsx)(Ra,{align:"center",css:{overflow:"auto",py:"$2"},gap:"2",height:1,width:1,wrap:"wrap",children:e.row.features.map(e=>(0,i.jsx)(Jd,{leftIcon:ym(e),children:e},e))})}):e.column.slug===jm.NumberOfEvents?(0,i.jsx)(yc,{children:e.row.numberOfEvents}):e.column.slug===jm.NumberOfMembers?(0,i.jsx)(yc,{children:e.row.membersStats.numberOfMembers}):e.column.slug===jm.MembersLimit?(0,i.jsx)(yc,{children:e.row.membersLimit}):e.column.slug===jm.PricePerMember?(0,i.jsx)(yc,{children:e.row.pricePerMember}):(0,i.jsx)(yc,{})},Am=e=>{const t=Hn(),{user:n}=ni(),{mutate:s,isLoading:o}=function(e={}){return Kn("mutation BackofficeOrganizationUserAdd($organizationId: OrganizationId!) {\n backofficeOrganizationUserAdd(organizationId: $organizationId)\n}\n",e)}(),{mutate:r,isLoading:a}=function(e={}){return Kn("mutation BackofficeOrganizationUserRemove($organizationId: OrganizationId!) {\n backofficeOrganizationUserRemove(organizationId: $organizationId)\n}\n",e)}(),l=e.organization.users.map(({id:e})=>e);return(0,i.jsxs)(Bc,{children:[l.includes(n.id)?(0,i.jsx)(Ld,{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)(Ld,{color:o?"disabled":"default",icon:"plus",onClick:async()=>{await s({organizationId:e.organization.id}),window.open(`${D.HEAVENT_APP_URL}${Ii.ORGANIZATION({organizationId:e.organization.id})}`,"_blank"),e.reload()},children:t("s_ajouter_comme_70404")}),(0,i.jsx)(Ld,{icon:"pen",to:Os.EDIT_BACKOFFICE_ORGANIZATION(e.organization.id),children:t("_diter_62574")})]})},wm=()=>{const{history:e,translate:t}=cl(),n=Gn(Cm),[s,o]=hm($l.BACKOFFICE_SEARCH,""),[r,a]=hm($l.BACKOFFICE_COLUMNS,[jm.Id,jm.Name,jm.InsertedAt,jm.PeriodEndAt],cm),[l,d]=hm($l.BACKOFFICE_LIMIT,kc,dm),[c,u]=hm($l.BACKOFFICE_PREDICATES,[],cm),[h,g]=hm($l.BACKOFFICE_SORT,null,cm);return(0,M.useEffect)(()=>{const e=new URL(location.href).searchParams.get("q");m(e)&&o(e)},[o]),(0,i.jsx)(br,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",gap:"7",width:1,children:[(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("organisations_26509")}),(0,i.jsx)(jl,{color:"white",leftIcon:"plus",to:ui(Ii.ORGANIZATIONS),children:t("cr_er_une_organ_06669")}),(0,i.jsx)(jl,{leftIcon:"house",onClick:()=>{e.push(Os.HOME)},children:"WeezCrew"}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Vd,{placement:"bottom-end",children:(0,i.jsx)(Ld,{icon:"eye",onClick:()=>{e.push(Os.BACKOFFICE_INVOICES)},children:t("voir_les_factur_82290")})})]})]}),(0,i.jsx)(lm,{columns:r,columnsSearch:[],eventId:null,filters:n.getFilters(),limit:l,loadDataList:Ur,loadRow:Vr,name:s,organizationId:null,possibleColumns:n.getPossibleColumns(),predicates:c,rendering:Ph.List,setColumns:a,setLimit:d,setName:o,setPredicates:u,setSort:g,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showRowDropdown:!0,showRowEdit:!0,showSearchColumns:!1,sort:h,children:(0,i.jsx)(bm,{getEditPath:e=>Os.EDIT_BACKOFFICE_ORGANIZATION(e.id),renderCell:(e,t)=>(0,i.jsx)(km,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(Am,{organization:e,reload:t})})})]})})},Sm=hr("div",{margin:"auto",width:"$containerTablet","@desktop":{width:"$container"}}),Em=M.forwardRef((e,t)=>(0,i.jsx)(br,{ref:t,css:{background:"$gray50",overflowX:"hidden",overflowY:"auto",py:"$10",...e.css},height:1,width:1,children:(0,i.jsx)(Sm,{children:e.children})}));Em.displayName="CenteredContainer";const Tm=hr("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"}}),zm=e=>{const t=Xn();return(0,i.jsxs)(Tm,{color:e.color,children:[(0,i.jsxs)(Ra,{align:"center",className:"fsp-header",gap:"4",height:65,width:1,children:[(0,i.jsx)(br,{css:{flexShrink:3},width:300}),(0,i.jsxs)(Ra,{align:"center",css:{flex:"1"},direction:"column",children:[e.category&&(0,i.jsx)(br,{className:"fsp-category",children:e.category}),(0,i.jsx)(br,{className:"fsp-title",css:{maxWidth:"100%"},ellipsis:!0,children:e.title})]}),(0,i.jsxs)(Ra,{gap:"4",justify:"end",width:300,children:[e.button,(0,i.jsx)(jl,{color:"dark"===e.color?"gray":"white",css:{flexShrink:0},leftIcon:"xmark",onClick:()=>{"function"==typeof e.onClose?e.onClose():t.goBack(e.fallbackClosePath||Os.HOME)}})]})]}),(0,i.jsx)(br,{css:{height:"calc(100% - 65px)"},width:1,children:e.children})]})},Om=e=>(0,i.jsx)(Ra,{css:{background:"white",borderRadius:"$2",boxShadow:"$sm",padding:"$6 $7",...e.css},direction:"column",children:e.children}),Rm=M.memo(function(e){const t=Hn(),{descId:n,labelId:s}=Na(),[o,r]=M.useState(e.initialIsOpen),a=M.useCallback(t=>{r(t),e.onToggle?.(t)},[e.onToggle,r]),l=e.descId??n,d=e.labelId??s;return(0,i.jsxs)(Ra,{as:"fieldset",css:{background:"white",borderRadius:"$2",boxShadow:"$sm",border:"inherit",margin:"inherit",padding:"$6 $7",...e.css},direction:"column",children:[(0,i.jsxs)(Ra,{align:"center","aria-describedby":l,"aria-labelledby":d,as:"legend",css:{float:"left",width:"100%",border:"none",padding:"none",...o&&!e.centerTitleAndSubtitle?{borderBottom:"1px solid $gray200",paddingBottom:"$5"}:{}},gap:"4",children:[(0,i.jsxs)(Ra,{css:e.centerTitleAndSubtitle?{flex:"1",alignItems:"center",marginBottom:"var(--space32)"}:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",id:d,children:e.title}),m(e.subtitle)&&(0,i.jsx)(br,{color:"gray500",dangerouslySetInnerHTML:{__html:e.subtitle},id:l})]}),!e.hideToggle&&(0,i.jsx)(br,{children:(0,i.jsx)(fu,{label:t("toggle_section_92160"),size:"md",value:o,onChange:a})})]}),o&&(0,i.jsxs)(i.Fragment,{children:[!e.centerTitleAndSubtitle&&(0,i.jsx)(Ba,{height:"5"}),e.children]})]})}),$m=({name:e,children:t,...n})=>(0,i.jsx)(Fa.D0,{name:e,render:e=>{const s=!0===e.input.checked?"checked":"unchecked";return(0,i.jsx)(dc,{...n,state:s,onClick:()=>{e.input.onChange(!e.input.checked)},children:t})},type:"checkbox"}),Dm=(0,M.memo)(function({name:e,hint:t,state:n,...s}){return(0,i.jsx)(Fa.D0,{name:e,render:({input:o,meta:r})=>{const a=r.data?.forceDisplayError&&r.invalid||r.touched&&r.invalid;return(0,i.jsx)(Tu,{hint:a?r.error:t,name:e,state:a?"error":n,value:o.value,onBlur:o.onBlur,onChange:o.onChange,onFocus:o.onFocus,...s})}})}),Pm=({value:e,onChange:t,...n})=>{const[s,o]=(0,M.useState)(e?.toString()??""),[r,a]=(0,M.useState)(e);return r!==e&&(o(e?.toString()??""),a(e)),(0,i.jsx)(Ol,{value:s,onChange:e=>{const n=parseFloat(e);o(e),a(isNaN(n)?null:n),t(isNaN(n)?null:n)},...n})},Fm=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Fa.D0,{name:e,render:o=>{const r=kl(o.meta);return(0,i.jsx)(Pm,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),Mm=({name:e,hint:t,state:n,multiple:s,...o})=>(0,i.jsx)(Fa.D0,{name:e,render:r=>{const a=kl(r.meta);return(0,i.jsx)(fc,{hint:a?r.meta.error:t,multiple:s,name:e,state:a?"error":n,values:s?Array.isArray(r.input.value)?r.input.value:[]:"number"==typeof r.input.value||m(r.input.value)?[r.input.value]:[],onChange:e=>{s?r.input.onChange(e):eo(e)?r.input.onChange(e[0]):r.input.onChange(null)},...o})}}),Nm=({css:e,label:t,description:n,state:s,icon:o,hint:r,rightIcon:a,rightText:l,onChange:d,value:c,...u})=>{const{inputId:h,descId:m,errorId:g}=Na();return(0,i.jsxs)(Ra,{css:e,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:h,children:t}),(0,i.jsx)(wl,{id:m,children:n}),(t||n)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(zl,{cursor:"text",height:"fluid",icon:o,rightIcon:a,rightText:l,state:s,children:(0,i.jsxs)(id,{css:{flex:"1",minHeight:"100px",py:"$3","& .replicated-text":{whiteSpace:"pre-wrap",visibility:"hidden"},"& textarea":{outline:"none",overflow:"hidden",resize:"none"},"& .replicated-text, & textarea":{background:"transparent",border:"none",gridArea:"1 / 1 / 2 / 2",width:"100%"},"& textarea::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder":{color:"$gray500",opacity:1}},children:[(0,i.jsx)("textarea",{"aria-describedby":n?m:void 0,"aria-errormessage":"error"===s?g:void 0,"aria-invalid":"error"===s,disabled:"disabled"===s,id:h,value:c,onChange:e=>{d(e.target.value)},...u}),(0,i.jsxs)(br,{className:"replicated-text",children:[c," "]})]})}),(0,i.jsx)(Sl,{id:g,state:s,children:r})]})},Lm=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Fa.D0,{name:e,render:o=>{const r=kl(o.meta);return(0,i.jsx)(Nm,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),Bm=e=>(0,i.jsx)(Fa.D0,{name:e.name,render:t=>(0,i.jsx)(xu,{disabled:e.disabled,size:e.size,subtext:e.subtext,value:t.input.value,onChange:t.input.onChange,children:e.children})}),Vm=d.gl(e=>e&&Bs.c9.fromISO(e).isValid);let Um=class extends Pl{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 d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),periodEndAt:Vm.required(this.t("la_date_de_fin_04076")).typeError(this.t("la_date_de_fin_04076")),features:d.YO().of(d.Yj().oneOf(ln,this.t("les_fonctionnal_36778"))),usersIds:d.YO().of(d.ai()),isBlocked:d.zM().required()})}updateOrganizationSchema(){return d.Ik().shape({organization:this.organizationInputSchema()})}};Um=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Um);const Wm=hr("span",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},gray800:{color:"$gray800"},gray900:{color:"$gray900"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primary600:{color:"$primary600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight600:{color:"$blueLight600"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit"}}),Gm=M.forwardRef((e,t)=>(0,i.jsx)(Wm,{...(0,rr.A)(e,"font"),...ar(e.font),ref:t,css:e.css}));Gm.displayName="Span";const Hm=1123,qm=794,Ym=561,Km=397,Zm=397,Xm=280,Jm=325,Qm=204,eg={A4:{height:"297mm",width:"210mm"},A5:{height:"210mm",width:"148mm"},A6:{height:"148mm",width:"105mm"}},tg=(e,t)=>{t?.startsWith("/")||(console.warn(`Path '${t}' missing leading slash`),t="/"+t);const n=new _(D.HEAVENT_PUBLIC_URL);return Ed.has(e)&&(n.host=Ed.get(e)),n.pathname+=t,n.href},ng=({organizationId:e,eventId:t,delegationId:n,formId:i,teamCode:s,query:o})=>{const r=new _(D.HEAVENT_PUBLIC_URL);return Ed.has(e)&&(r.host=Ed.get(e)),r.pathname+=`${(()=>{if(n)return"number"==typeof t?as.DELEGATION_FORM({organizationId:e,delegationId:n,eventId:t,formId:i}):as.DELEGATION_FORM({organizationId:e,delegationId:n,formId:i});{const n="number"==typeof t?Bi.EVENT_FORM({organizationId:e,eventId:t,formId:i}):Ii.ORGANIZATION_FORM({organizationId:e,formId:i});return m(s)?`${n}/team/${s}`:n}})()}`,o?.preview&&r.searchParams.set("preview",o?.preview?.toString()),o?.previewState&&r.searchParams.set("state",o?.previewState?.toString()),r.href};var ig;!function(e){e.QR="qr",e.Code39="code39"}(ig||(ig={}));const sg=(e,t)=>{const n=new _(D.HEAVENT_API_URL);return n.pathname+=`/barcode/${t?.barcodeType??ig.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},og=({organizationId:e,eventId:t,lang:n,pathComponent:i,key:s})=>{const o=new _(D.HEAVENT_API_URL);return o.pathname+=t?`/export/organization/${e}/event/${t}/${i}`:`/export/organization/${e}/${i}`,o.searchParams.set("key",s),m(n)&&o.searchParams.set("lang",n),o.href};function rg(e,t,n={}){const i=new _(D.HEAVENT_API_URL);i.pathname+=`/documents/${e}.${t}`;const s=new URLSearchParams(Object.entries(n).filter(([e,t])=>m(t)));for(const[e,t]of s)i.searchParams.set(e,t);return i.href}function ag(e,t){return new _(`https://admin.${D.WEEZEVENT_DOMAIN}`,void 0,void 0,`access/O${e}/checkpoints/edit/${t}`).href}const lg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=(0,ic.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/animaje/convention-page1.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:Hm,width:qm,children:[(0,i.jsxs)(br,{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)(br,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"364px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(br,{css:{left:"650px",position:"absolute",top:"322px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Ra,{css:{left:"72px",position:"absolute",top:"558px"},direction:"column",gap:"1",children:s.map((e,t)=>(0,i.jsxs)(br,{css:{fontSize:"12px",fontWeight:"500"},children:[(0,i.jsxs)(Gm,{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)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/animaje/convention-page2.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:Hm,width:qm,children:[(0,i.jsxs)(br,{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)(br,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"252px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(br,{css:{left:"650px",position:"absolute",top:"210px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsxs)(br,{css:{fontSize:"12px",fontWeight:"700",left:"178px",position:"absolute",top:"455px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(br,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"537px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(br,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"617px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]})]})]})};function dg(e,t,n){return e.filter(e=>{if(t?.isValid&&n?.isValid){const i=Bs.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 cg(e,t){const n=Object.fromEntries(Object.values((0,nc.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())).map(e=>[`positions.${e[0].positionSlot.range.start.toFormat("yyyyMMdd")}`,(0,ic.A)((0,Fs.A)(e.map(e=>e.position.name))).join("
")]));return{assignmentsDays:(0,ch.A)((t||[]).map(({positionSlot:e})=>e.range.start),e=>e.startOf("day").toMillis()).map(t=>e.toLocaleString(t,Zs.DateOnly.WeekdayLongMonthLong)).join(", "),positionsCategories:(0,ic.A)((0,Fs.A)((t||[]).map(e=>e.position.category.name))).join(", "),positions:(0,ic.A)((0,Fs.A)((t||[]).map(e=>e.position.name))).join(", "),...n}}function ug(e){return{[`${e} p.h-small`]:{fontSize:"12px"},[`${e} h2`]:{fontSize:"20px",fontWeight:"$semiBold"},[`${e} h3`]:{fontSize:"18px",fontWeight:"$semiBold"},[`${e} h4`]:{fontSize:"16px",fontWeight:"$semiBold"},[`${e} a`]:{color:"$primary700"},[`${e} blockquote`]:{borderLeft:"3px solid $gray200",fontStyle:"italic",marginLeft:0,marginRight:0,px:"$4","& p":{margin:0,paddingBottom:"$2",paddingTop:"$2"}}}}const hg=e=>(0,i.jsx)(br,{className:"h-rich-text",css:{...ug("&"),"& > 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 mg(e,t){return`https://www.google.com/maps/place/${e},${t}`}const gg=4427,pg=4848,fg=e=>e===gg?{color:"#ff5501"}:e===pg?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},xg=e=>e===gg?{color:"white"}:e===pg?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},_g=e=>{const t=e.psuis[0].position,n=(0,ic.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=t.leaders[0];return(0,i.jsxs)(Ra,{css:{background:`url(${o=e.eventId,o===gg?`${D.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/semi.jpg`:o===pg?`${D.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/marathon.jpg`:-1===o?`${D.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/10k.jpg`:""}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{fontSize:"24px",left:"298px",position:"absolute",top:"101px",...xg(e.eventId)},textAlign:"center",width:409,children:e.userInfo.name}),(0,i.jsx)(br,{css:{fontSize:"12px",left:"46px",position:"absolute",top:"374px"},children:m(e.options.habits)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{css:{...xg(e.eventId),"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(hg,{text:e.options.habits})})})}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{color:"#005a41",left:"46px",position:"absolute",top:"581px",...xg(e.eventId)},textAlign:"center",width:150,children:s.userInfo.name}),(0,i.jsx)(br,{css:{left:"46px",position:"absolute",top:"602px",...xg(e.eventId)},textAlign:"center",width:150,children:s.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Ra,{css:{left:"228px",position:"absolute",padding:"32px",top:"167px"},direction:"column",width:550,children:[(0,i.jsx)(br,{css:{fontSize:"28px",fontWeight:"700",...fg(e.eventId)},textAlign:"center",children:t.name}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{css:{fontWeight:"700",textTransform:"uppercase",...fg(e.eventId)},children:"Date et heure de la mission"}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{fontSize:"12px"},direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start;return(0,i.jsxs)(br,{children:[n.toFormat("cccc dd MMMM yyyy",{locale:"fr"})," à"," ",n.toFormat("H'h'mm",{locale:"fr"})]},t)})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:{fontWeight:"700",textTransform:"uppercase",...fg(e.eventId)},children:"Détail de la mission"}),(0,i.jsx)(Ba,{height:"1"}),m(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{css:{color:"black",fontSize:"12px","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(hg,{text:t.description})})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:{fontWeight:"700",textTransform:"uppercase",...fg(e.eventId)},children:"Lieu de rendez-vous"}),(0,i.jsx)(Ba,{height:"1"}),Ch(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{fontSize:"12px"},children:t.address}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsxs)(Ra,{gap:"3",width:1,children:[(0,i.jsx)(br,{height:180,width:1,children:(0,i.jsx)("a",{href:mg(t.latitude,t.longitude),style:{background:`url(${D.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),m(t.fields?.cf45815?.url)&&(0,i.jsx)(br,{css:{background:`url(${t.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]}),m(t.fields.cf44423)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:{fontWeight:"700",textTransform:"uppercase",...fg(e.eventId)},children:"Ton kit bénévole"}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{fontSize:"12px"},dangerouslySetInnerHTML:{__html:t.fields.cf44423.replace(/\n/g,"
")}})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:{fontWeight:"700",textTransform:"uppercase",...fg(e.eventId)},children:"Un imprévu ?"}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{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 o},Ig=[120785,134101],vg=e=>{const t=dg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>!Ig.includes(e.id)),n=(0,ic.A)(Object.entries((0,nc.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],s)=>(0,i.jsx)(_g,{eventId:e.event.id,options:e.options,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},s))})};function bg(e={}){const t=f(e.firstName||"").trim();return`${f(e.lastName||"").trim().toUpperCase()} ${t}`.trim()}function jg(e,t,n=null){return e?.[t]?.value||n}const Cg=(e,t)=>e.split(t).map(e=>e.trim().length>0?e.trim()[0]:"").join("").substring(0,3);function yg(e,t){if(m(e))return Cg(e," ");if(m(t)){const[e]=t.split("@");return Cg(e,".")}return""}const kg=[mr.colors.success600.value,mr.colors.blueGray600.value,mr.colors.blueLight600.value,mr.colors.purple600.value,mr.colors.pink600.value,mr.colors.warning600.value];function Ag(e){const t=e.charCodeAt(0);return kg[t%kg.length]}const wg=({children:e})=>(0,i.jsx)(Ra,{align:"center",css:{background:"#14243f",borderRadius:"5px 5px 0px 0px",color:"white",flex:"1",fontWeight:"600",padding:"10px"},justify:"center",children:e}),Sg=({children:e})=>(0,i.jsx)(Ra,{align:"center",css:{background:"white",border:"1px solid $gray200",color:"#142440",flex:"1",fontWeight:"600",padding:"10px"},justify:"center",children:e}),Eg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.positionsSlotsUsersInfos.flatMap(e=>e.position.leaders)?.[0],o=(0,ic.A)(t.positionsSlotsUsersInfos.filter(e=>23066===e.position.category.id),e=>e.positionSlot.range.start.toMillis()),r=(0,ic.A)(t.positionsSlotsUsersInfos.filter(e=>23113===e.position.category.id),e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/fiche_livraison_masque.png) no-repeat`,backgroundSize:"cover",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{fontSize:"20px",fontWeight:"700",left:"32px",position:"absolute",textTransform:"uppercase",top:"193px"},children:jg(n.fields,"cf42835","salut")}),(0,i.jsxs)(br,{css:{color:"#000dbd",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"225px"},children:[n.name," - ",n.fields?.phone?.internationalFormat]}),(0,i.jsxs)(br,{css:{color:"#000dbd",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"251px"},children:[s?.userInfo.name," - ",s?.userInfo.phone?.internationalFormat]}),(0,i.jsx)(br,{css:{position:"absolute",right:"32px",top:"188px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsxs)(Ra,{css:{position:"absolute",px:"32px",top:"411px"},direction:"column",width:1,children:[(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Ra,{gap:"1",width:1,children:[(0,i.jsx)(wg,{children:"DATE"}),(0,i.jsx)(wg,{children:"HORAIRE"}),(0,i.jsx)(wg,{children:"TYPE"}),(0,i.jsx)(wg,{children:"N° IMMAT"})]}),o.map((e,t)=>(0,i.jsxs)(Ra,{gap:"1",width:1,children:[(0,i.jsx)(Sg,{children:e.positionSlot.range.start.toFormat("dd/MM/yyyy")}),(0,i.jsx)(Sg,{children:e.positionSlot.range.start.toFormat("HH:mm")}),(0,i.jsx)(Sg,{children:jg(n.fields,"cf42931","")}),(0,i.jsx)(Sg,{children:jg(n.fields,"cf42974","")})]},t))]}),eo(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{css:{fontSize:"22px",fontWeight:"700"},children:"Reprise"}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Ra,{gap:"1",width:1,children:[(0,i.jsx)(wg,{children:"DATE"}),(0,i.jsx)(wg,{children:"HORAIRE"}),(0,i.jsx)(wg,{children:"TYPE"}),(0,i.jsx)(wg,{children:"N° IMMAT"})]}),r.map((e,t)=>(0,i.jsxs)(Ra,{gap:"1",width:1,children:[(0,i.jsx)(Sg,{children:e.positionSlot.range.start.toFormat("dd/MM/yyyy")}),(0,i.jsx)(Sg,{children:e.positionSlot.range.start.toFormat("HH:mm")}),(0,i.jsx)(Sg,{children:jg(n.fields,"cf42931","")}),(0,i.jsx)(Sg,{children:jg(n.fields,"cf42974","")})]},t))]})]})]})]}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/fiche_livraison_masque_1.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm})]})},Tg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.delegation,o=(0,ic.A)((0,ch.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/op_com_1.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{fontFamily:"$kabel",fontSize:"20px",fontWeight:"700",left:"46px",position:"absolute",textTransform:"uppercase",top:"306px",width:"582px"},children:n.name}),(0,i.jsxs)(br,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"46px",position:"absolute",top:"338px",width:"582px"},children:["Nom du responsable : ",s?.leaders?.[0]?.name," ",s?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(br,{css:{left:"658px",position:"absolute",top:"288px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ra,{css:{gap:"6px",left:"46px",position:"absolute",top:"641px"},children:o.map((e,t)=>(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(br,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/op_com_2.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/op_com_3.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm})]})},zg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.delegation,o=(0,ic.A)((0,ch.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_1.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{fontFamily:"$kabel",fontSize:"20px",fontWeight:"700",left:"46px",position:"absolute",textTransform:"uppercase",top:"306px",width:"582px"},children:n.name}),(0,i.jsxs)(br,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"46px",position:"absolute",top:"338px",width:"582px"},children:["Nom du responsable : ",s?.leaders?.[0]?.name," ",s?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(br,{css:{left:"658px",position:"absolute",top:"288px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ra,{css:{gap:"6px",left:"46px",position:"absolute",top:"641px"},children:o.map((e,t)=>(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(br,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_2.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_3.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm})]})},Og=e=>"Staff"===e?`${D.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff.png`:`${D.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Visiteur.png`,Rg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=jg(n.fields,"population",""),o=t.delegation,r=(0,ic.A)((0,ch.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis()),a=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>2826===e.accreditationCategory.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot.date]:[]),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${Og(s)}) no-repeat`,backgroundSize:"cover",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{fontSize:"20px",fontWeight:"700",left:"32px",position:"absolute",textTransform:"uppercase",top:"206px"},children:n.name}),(0,i.jsxs)(br,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"238px"},children:["Nom du responsable : ",o?.leaders?.[0]?.name," ",o?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(br,{css:{position:"absolute",right:"32px",top:"188px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ra,{css:{gap:"6px",left:"32px",position:"absolute",top:"Staff"===s?"461px":"452px"},children:r.map((e,t)=>(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(br,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))}),eo(a)&&(0,i.jsx)(br,{css:{fontSize:"22px",fontWeight:"800",left:"32px",position:"absolute",textTransform:"uppercase",top:"Staff"===s?"530px":"521px"},children:"Catering"}),(0,i.jsx)(Ra,{css:{gap:"6px",left:"32px",position:"absolute",top:"Staff"===s?"562px":"553px"},children:a.map((e,t)=>(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(br,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),"Staff"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff-01.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff-02.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm})]}),"Visiteur"===s&&(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Visiteur_2.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm})]})},$g=e=>e.includes("Régisseur")||e.includes("Team Delta")||e.includes("Warrior Chauffeur")?`${D.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_tech_verso.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_qr_verso.jpg`,Dg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Gn(Wc),o=(0,M.useMemo)(()=>{const t=e.event.volunteerRegistration.positionsSlotsUsersInfos;return(0,ic.A)(Object.entries((0,nc.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e])=>e).map(([e,t])=>[s.toLocaleString(t[0].positionSlot.range.start,Zs.DateOnly.WeekdayLongMonthLong),t])},[e.event]),r=n.fields?.cf1666?.value;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${a=r,a.includes("Régisseur")||a.includes("Team Delta")||a.includes("Warrior Chauffeur")?`${D.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_tech_recto.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_qg_recto.jpg`}) no-repeat`,backgroundSize:"contain",color:"black",pageBreakBefore:"always",position:"relative"},direction:"column",height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{borderRadius:"100px",left:"60px",overflow:"hidden",position:"absolute",top:"286px"},height:100,width:100,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(br,{css:{fontSize:"24px",fontWeight:"700",left:"177px",position:"absolute",top:"289px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"24px",fontWeight:"700",left:"177px",position:"absolute",top:"322px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"18px",left:"177px",position:"absolute",top:"359px"},children:r}),(0,i.jsxs)(Ra,{align:"center",css:{position:"absolute",right:"71px",top:"282px"},direction:"column",gap:"2",children:[(0,i.jsx)(br,{height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(br,{css:{fontSize:"10px"},children:t.ticketId})]})]}),(0,i.jsx)(Ra,{css:{background:`url(${$g(r)}) no-repeat`,backgroundSize:"contain",color:"black",pageBreakBefore:"always",position:"relative"},direction:"column",height:Hm,width:qm,children:(0,i.jsx)(Ra,{css:{left:"76px",position:"absolute",top:"328px"},direction:"column",gap:"6",children:o.map(([e,t],n)=>(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{css:{fontSize:"18px",fontWeight:"700",textTransform:"uppercase"},children:e}),(0,i.jsx)(Ra,{direction:"column",children:t.map((e,t)=>(0,i.jsxs)(br,{css:{fontSize:"16px"},children:[e.position.name," /"," ",e.positionSlot.range.toFormat("HH:mm",{separator:"-"})]},t))})]},n))})})]});var a},Pg=({css:e,children:t})=>(0,i.jsx)(Ra,{css:{alignItems:"center",border:"1px solid",flexDirection:"column",fontSize:"24px",fontWeight:700,height:"42px",justifyContent:"center",lineHeight:"24px",padding:"2px 0px",position:"absolute",width:"110px",...e},children:t}),Fg=({css:e,children:t})=>(0,i.jsx)(br,{css:{fontSize:"14px",fontWeight:600,lineHeight:"14px",...e},children:t}),Mg=["P0","P1","P1 Aire Régie","P2","P3","P4","ZONE 1 - PELOUSE","ZONE 2 - VESTIAIRES","ZONE 3 - TRIBUNES","ZONE 4 - MEDIAS","ZONE 5 - AIRE REGIE TV","ZONE 6 - HOSPITALITES","ZONE 7 - SERVICES","ZONE 8 - BORD TERRAIN","ZONE 9 - PRESIDENTIELLE","H-30","PC"],Ng=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=`${n.fields?.firstName?.value||""} ${(n.fields?.lastName?.value||"").toUpperCase()}`,o=t.accreditationsUsersInfos.reduce((e,t)=>Mg.includes(t.accreditation.name)?{...e,[t.accreditation.name]:t.accreditation.color}:e,{}),r=t.ticketId;return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/dfco/accred-a4.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$default",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{left:"423px",position:"absolute",top:"145px"},height:91,width:91,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(br,{css:{left:"530px",fontWeight:600,lineHeight:"normal",position:"absolute",top:"151px"},children:s}),(0,i.jsx)(br,{css:{left:"530px",fontWeight:700,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"176px"},children:n.fields.cf36682?.value||""}),o.P0&&(0,i.jsx)(Pg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(br,{children:"P0"})}),o.P1&&(0,i.jsx)(Pg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(br,{children:"P1"})}),o["P1 Aire Régie"]&&(0,i.jsx)(Pg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(br,{children:"P1 A-R"})}),o.P2&&(0,i.jsx)(Pg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(br,{children:"P2"})}),o.P3&&(0,i.jsx)(Pg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(br,{children:"P3"})}),o.P4&&(0,i.jsx)(Pg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(br,{children:"P4"})}),o["H-30"]&&(0,i.jsx)(br,{css:{backgroundColor:o["H-30"],color:"#FFF",fontWeight:600,left:"698px",lineHeight:"14px",padding:"2px 4px",position:"absolute",textAlign:"center",top:"307px"},children:"H-30"}),o.PC&&(0,i.jsx)(br,{css:{backgroundColor:o.PC,color:"#FFF",fontWeight:600,left:"746px",lineHeight:"14px",padding:"2px 4px",position:"absolute",textAlign:"center",top:"307px"},children:"PC"}),o["ZONE 1 - PELOUSE"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 1 - PELOUSE"],left:"421px",top:"337px"},children:[(0,i.jsx)(br,{children:"1"}),(0,i.jsx)(Fg,{children:"PELOUSE"})]}),o["ZONE 2 - VESTIAIRES"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 2 - VESTIAIRES"],left:"541px",top:"337px"},children:[(0,i.jsx)(br,{children:"2"}),(0,i.jsx)(Fg,{children:"VESTIAIRE"})]}),o["ZONE 3 - TRIBUNES"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 3 - TRIBUNES"],left:"661px",top:"337px"},children:[(0,i.jsx)(br,{children:"3"}),(0,i.jsx)(Fg,{children:"TRIBUNES"})]}),o["ZONE 4 - MEDIAS"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 4 - MEDIAS"],left:"421px",top:"387px"},children:[(0,i.jsx)(br,{children:"4"}),(0,i.jsx)(Fg,{children:"MEDIAS"})]}),o["ZONE 5 - AIRE REGIE TV"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 5 - AIRE REGIE TV"],left:"541px",top:"387px"},children:[(0,i.jsx)(br,{children:"5"}),(0,i.jsx)(Fg,{children:"AIRE REGIE TV"})]}),o["ZONE 6 - HOSPITALITES"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 6 - HOSPITALITES"],left:"661px",top:"387px"},children:[(0,i.jsx)(br,{children:"6"}),(0,i.jsx)(Fg,{children:"HOSPITALITÉS"})]}),o["ZONE 7 - SERVICES"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 7 - SERVICES"],left:"421px",top:"437px"},children:[(0,i.jsx)(br,{children:"7"}),(0,i.jsx)(Fg,{children:"SERVICES"})]}),o["ZONE 8 - BORD TERRAIN"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 8 - BORD TERRAIN"],left:"541px",top:"437px"},children:[(0,i.jsx)(br,{children:"8"}),(0,i.jsx)(Fg,{children:"BORD TERRAIN"})]}),o["ZONE 9 - PRESIDENTIELLE"]&&(0,i.jsxs)(Pg,{css:{backgroundColor:o["ZONE 9 - PRESIDENTIELLE"],left:"661px",top:"437px"},children:[(0,i.jsx)(br,{children:"9"}),(0,i.jsx)(Fg,{children:"PRESIDENTIELLE"})]}),(0,i.jsxs)(Ra,{css:{alignItems:"center",flexDirection:"column",gap:"4px",left:"478px",position:"absolute",top:"489px",width:"234px"},children:[(0,i.jsx)(br,{height:28,width:1,children:(0,i.jsx)("img",{height:"100%",src:sg(r,{barcodeType:ig.Code39,height:28,width:234}),width:"100%"})}),(0,i.jsx)(br,{css:{fontSize:"10px"},children:r})]})]})},Lg=({css:e,children:t})=>(0,i.jsx)(Ra,{css:{alignItems:"center",border:"1px solid",flexDirection:"column",fontSize:"14px",fontWeight:700,height:"18px",justifyContent:"center",lineHeight:"14px",padding:"2px 0px",position:"absolute",width:"22px",...e},children:t}),Bg=["ZONE 1 - PELOUSE","ZONE 2 - VESTIAIRES","ZONE 3 - TRIBUNES","ZONE 4 - MEDIAS","ZONE 5 - AIRE REGIE TV","ZONE 6 - HOSPITALITES","ZONE 7 - SERVICES","ZONE 8 - BORD TERRAIN","ZONE 9 - PRESIDENTIELLE"],Vg=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.reduce((e,t)=>Bg.includes(t.accreditation.name)?{...e,[t.accreditation.name]:t.accreditation.color}:e,{}),o=t.ticketId;return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/dfco/accred-badge.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$default",position:"relative"},height:204,width:643,children:[(0,i.jsx)(br,{css:{left:"400px",position:"absolute",top:"39px"},height:87,width:87,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(br,{css:{left:"497px",fontSize:"10px",fontWeight:600,lineHeight:"normal",position:"absolute",top:"59px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{left:"497px",fontSize:"10px",fontWeight:600,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"73px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{left:"497px",fontSize:"10px",fontWeight:700,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"88px"},children:n.fields.cf36682?.value||""}),s["ZONE 1 - PELOUSE"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 1 - PELOUSE"],left:"363px",top:"174px"},children:(0,i.jsx)(br,{children:"1"})}),s["ZONE 2 - VESTIAIRES"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 2 - VESTIAIRES"],left:"391px",top:"174px"},children:(0,i.jsx)(br,{children:"2"})}),s["ZONE 3 - TRIBUNES"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 3 - TRIBUNES"],left:"419px",top:"174px"},children:(0,i.jsx)(br,{children:"3"})}),s["ZONE 4 - MEDIAS"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 4 - MEDIAS"],left:"447px",top:"174px"},children:(0,i.jsx)(br,{children:"4"})}),s["ZONE 5 - AIRE REGIE TV"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 5 - AIRE REGIE TV"],left:"475px",top:"174px"},children:(0,i.jsx)(br,{children:"5"})}),s["ZONE 6 - HOSPITALITES"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 6 - HOSPITALITES"],left:"503px",top:"174px"},children:(0,i.jsx)(br,{children:"6"})}),s["ZONE 7 - SERVICES"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 7 - SERVICES"],left:"531px",top:"174px"},children:(0,i.jsx)(br,{children:"7"})}),s["ZONE 8 - BORD TERRAIN"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 8 - BORD TERRAIN"],left:"559px",top:"174px"},children:(0,i.jsx)(br,{children:"8"})}),s["ZONE 9 - PRESIDENTIELLE"]&&(0,i.jsx)(Lg,{css:{backgroundColor:s["ZONE 9 - PRESIDENTIELLE"],left:"587px",top:"174px"},children:(0,i.jsx)(br,{children:"9"})}),(0,i.jsxs)(Ra,{css:{alignItems:"center",flexDirection:"column",gap:"4px",left:"93px",position:"absolute",top:"166px",width:"136px"},children:[(0,i.jsx)(br,{height:20,width:1,children:(0,i.jsx)("img",{height:"100%",src:sg(o,{barcodeType:ig.Code39,height:20,width:166}),width:"100%"})}),(0,i.jsx)(br,{css:{fontSize:"8px"},children:o})]})]})};var Ug=n(7957);function Wg(e){return(0,ic.A)(Object.entries((0,nc.A)(e,e=>`${e.position.name}-${e.positionSlot.range.start.startOf("day").toMillis()}`)).map(([e,t])=>{const n=(0,ic.A)(t,e=>e.positionSlot.range.start.toMillis());return{name:t[0].position.name,ranges:n.map(e=>e.positionSlot.range),slotsNames:(0,Va.A)((0,Fs.A)(n.map(({positionSlot:e})=>e.name)))}}),({ranges:e})=>e[0].start.toMillis())}var Gg=n(791);const Hg=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}},qg=e=>{const[t,n]=(0,M.useState)(m(e.image)?e.image:void 0);if((0,M.useEffect)(()=>{m(e.image)&&n(e.image)},[e.image]),m(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=yg(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:Ag(t),color:"white",display:"flex",fontSize:`${Hg(e.size)}px`,height:"100%",justifyContent:"center",textTransform:"uppercase",width:"100%"},children:t})})}},Yg=e=>{const t=e.event.volunteerRegistration.userInfo,n=(0,Fs.A)(e.assignments.map(({name:e})=>e)).length,s=e.assignments.flatMap(e=>e.ranges),o=(0,Fs.A)(s.map(e=>e.start.startOf("day").toMillis())).length,r=(0,Gg.A)(s.map(e=>e.length("hours")));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{css:{paddingTop:"$6"},justify:"center",width:1,children:(0,i.jsx)("img",{height:"56px",src:`${D.HEAVENT_ASSETS_URL}/badges/eurockeennes/eurockeennesLogo.png`,width:"103px"})}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(qg,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textMd semiBold",children:t.name}),(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsxs)(br,{color:"gray500",children:["Nb. de missions : ",n]}),(0,i.jsxs)(br,{color:"gray500",children:["Nb. de jours : ",o]}),(0,i.jsxs)(br,{color:"gray500",children:["Temps total affecté : ",r,"h"]})]})]})]})]})};let Kg=class{translationService;constructor(e){this.translationService=e}minutesToHoursMinutesString(e){const t=Bs.dw.fromObject({minutes:e},{locale:this.translationService.language.toString().toLowerCase()}).shiftTo("hours","minutes");return 0===t.minutes?t.shiftTo("hours").toHuman({unitDisplay:"narrow"}):0===t.hours?t.shiftTo("minutes").toHuman({unitDisplay:"narrow"}):t.toHuman({unitDisplay:"narrow"})}};Kg=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Kg);const Zg=e=>{const t=Gn(Wc),n=Gn(Kg);return(0,i.jsxs)(Ra,{css:{background:"white",pageBreakBefore:0!==e.index?"always":void 0,px:"$8"},direction:"column",width:1,children:[e.header,(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(br,{font:"gray800 textMd semiBold",children:"Planning des missions Eurockéennes 2023"}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(vc,{children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:"Nom de la mission"}),(0,i.jsx)(Fc,{width:410,children:"Date"}),(0,i.jsx)(Fc,{width:120,children:"Total"})]}),e.assignments.map((e,s)=>{const o=eo(e.slotsNames),r=(0,Gg.A)(e.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Tc,{css:{height:o?"54px":"44px"},children:[(0,i.jsx)(yc,{css:{color:"$gray900",fontWeight:"$medium"},children:e.name}),(0,i.jsxs)(yc,{direction:"column",gap:"1",justify:"center",width:410,children:[o&&(0,i.jsx)(br,{color:"gray900",width:1,children:e.slotsNames.join(", ")}),(0,i.jsxs)(br,{width:1,children:[(0,ud.A)(t.toLocaleString(e.ranges[0].start,Zs.DateOnly.WeekdayLongMonthLong))," ",e.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),(0,i.jsx)(yc,{width:120,children:n.minutesToHoursMinutesString(r)})]},s)})]})]})},Xg=e=>{const t=(0,M.useMemo)(()=>Wg(e.event.volunteerRegistration.positionsSlotsUsersInfos),[e.event]),n=(0,M.useMemo)(()=>(0,i.jsx)(Yg,{assignments:t,event:e.event}),[t,e.event]);return(0,i.jsx)(i.Fragment,{children:(0,Ug.A)(t,17).map((e,t)=>(0,i.jsx)(Zg,{assignments:e,header:n,index:t},t))})},Jg=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteersRegistrations.nodes.map((t,n)=>(0,i.jsx)(Ra,{css:{background:"white",pageBreakBefore:0!==n?"always":void 0},direction:"column",width:1,children:(0,i.jsx)(Xg,{event:{...e.event,volunteerRegistration:t}})},t.utid))}),Qg=e=>(0,i.jsxs)(Ra,{align:"center",width:1,children:[(0,i.jsx)(Ra,{align:"center",css:{background:e.backgroundColor,color:"white",fontWeight:700},height:24,justify:"center",width:30,children:e.zoneNumber}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsx)(br,{css:{fontSize:"13px",fontWeight:700},children:e.zoneText})]}),ep=()=>(0,i.jsx)(br,{height:24,width:1}),tp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=4444===e.event.id,o=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),r=o.includes("CAT 1"),a=o.includes("CAT 2"),l=o.includes("CAT 3"),d=o.includes("CAT 4"),c=o.includes("CAT 5"),u=o.includes("CAT 6"),h=s?`${D.HEAVENT_ASSETS_URL}/badges/fcg/2425/bg_badge_saison.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/fcg/2425/bg_badge_match.jpg`;return(0,i.jsxs)(Ra,{css:{background:`url(${h}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:563,width:397,children:[(0,i.jsx)(br,{css:{border:"2px solid #004994",left:"38px",position:"absolute",top:"38px"},height:80,width:80,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsxs)(Ra,{css:{color:"#00384f",fontSize:"12px",fontWeight:"900",left:"128px",lineHeight:"18px",position:"absolute",textTransform:"uppercase",top:"52px"},direction:"column",children:[(0,i.jsx)(br,{children:n.fields.cf10106?.value||""}),(0,i.jsx)(br,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{children:n.fields?.lastName?.value||""})]}),(0,i.jsx)(br,{css:{border:"2px solid #004994",left:"273px",padding:"$1",position:"absolute",top:"38px"},height:80,width:80,children:m(t.utid)&&(0,i.jsx)("img",{height:"100%",src:sg(t.utid,{color:"5d9dcb"}),width:"100%"})}),!s&&(0,i.jsx)(Ra,{align:"center",css:{color:"#00384f",fontSize:"30px",fontWeight:"900",height:"54px",left:"129px",lineHeight:"24px",position:"absolute",textTransform:"uppercase",top:"183px",width:"230px"},justify:"center",wrap:"wrap",children:e.event.name}),(0,i.jsxs)(Ra,{css:{gap:"7px",left:"38px",position:"absolute",top:"293px"},children:[(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[r?(0,i.jsx)(Qg,{backgroundColor:"#8ec89a",zoneNumber:1,zoneText:"Terrain"}):(0,i.jsx)(ep,{}),a?(0,i.jsx)(Qg,{backgroundColor:"#ddca00",zoneNumber:2,zoneText:"Zone mixte"}):(0,i.jsx)(ep,{}),l?(0,i.jsx)(Qg,{backgroundColor:"#cd1719",zoneNumber:3,zoneText:"Espaces Media"}):(0,i.jsx)(ep,{})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[d?(0,i.jsx)(Qg,{backgroundColor:"#009fe3",zoneNumber:4,zoneText:"Tribunes"}):(0,i.jsx)(ep,{}),c?(0,i.jsx)(Qg,{backgroundColor:"#d89fc7",zoneNumber:5,zoneText:"Espaces et Salon VIP"}):(0,i.jsx)(ep,{}),u?(0,i.jsx)(Qg,{backgroundColor:"#010000",zoneNumber:6,zoneText:"PC Sécurité"}):(0,i.jsx)(ep,{})]})]})]})},np=e=>(0,i.jsx)(i.Fragment,{children:(0,Ug.A)(e.event.volunteersRegistrations.nodes,4).map((t,n)=>(0,i.jsx)(Ra,{css:{pageBreakBefore:0!==n?"always":void 0},justify:"between",width:qm,wrap:"wrap",children:t.map(t=>(0,i.jsx)(tp,{event:{...e.event,volunteerRegistration:t}},t.userInfo.id))},`page-${n}`))}),ip=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=(0,ic.A)(Object.values((0,nc.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),e=>e[0].positionSlot.range.start.startOf("day")),o="MRP"===n.fields?.cf32955?.value,r=(0,ic.A)(t.accreditationsUsersInfos.flatMap(e=>2927===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),a=(0,ic.A)(t.accreditationsUsersInfos.flatMap(e=>2938===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),l=(0,ic.A)(t.accreditationsUsersInfos.flatMap(e=>2928===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),d=t.accreditationsUsersInfos.some(e=>2931===e.accreditation.id||2932===e.accreditation.id),c=(0,ic.A)(t.accreditationsUsersInfos.flatMap(e=>2929===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),u=(0,ic.A)(t.accreditationsUsersInfos.flatMap(e=>2930===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),h=t.accreditationsUsersInfos.some(e=>2933===e.accreditation.id);return(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/garorock/planning.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$inter",position:"relative"},height:Hm,width:qm,children:(0,i.jsxs)(Ra,{css:{position:"absolute",px:"96px",top:"240px"},direction:"column",gap:"5",children:[o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{direction:"column",gap:"4",children:s.map((e,t)=>{const n=e[0],s=(0,ic.A)(Object.values((0,nc.A)(e,e=>e.position.id)),e=>(0,Ju.A)(e,e=>e.positionSlot.range.start.toMillis()).positionSlot.range.start.toMillis());return(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{color:"#faf5dc",fontSize:"16px",fontWeight:"700",textTransform:"capitalize"},children:n.positionSlot.range.start.toFormat("cccc dd MMMM",{locale:"fr"})}),s.map((e,t)=>{const n=e[0];return(0,i.jsxs)(br,{css:{color:"#faf5dc",fontSize:"16px"},children:[n.position.name," :"," ",(s=e.map(({positionSlot:e})=>e.range),(0,ic.A)(s,e=>e.start.toMillis()).map(e=>`${e.start.toFormat("H:mm")}-${e.end.toFormat("H:mm")}`).join(" | "))]},t);var s})]},t)})}),(0,i.jsx)(Ra,{justify:"center",width:602,children:(0,i.jsx)(br,{height:4,width:332,children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/garorock/dot.png`,width:"100%"})})})]}),(0,i.jsxs)(Ra,{css:{color:"#faf5dc",fontSize:"16px"},direction:"column",gap:"5",children:[m(r)&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{children:"Un petit déjeuner au catering bénévole est prévu pour toi le(s) :"}),(0,i.jsx)(br,{fontWeight:"medium",children:r})]}),m(a)&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{children:"Un petit déjeuner au Garotri est prévu pour toi le(s) :"}),(0,i.jsx)(br,{fontWeight:"medium",children:a})]}),m(l)&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{children:"Un panier repas est prévu pour toi le(s) :"}),(0,i.jsx)(br,{fontWeight:"medium",children:l})]}),d&&(0,i.jsx)(br,{children:"Une somme d’argent te sera crédité sur ta carte pour tes jours de présence"}),m(c)&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{children:"Un repas au catering technique est prévu pour toi le(s) :"}),(0,i.jsx)(br,{fontWeight:"medium",children:c})]}),m(u)&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{children:"Un repas au Garo snack d’une valeur de 6€ est prévu pour toi le(s) :"}),(0,i.jsx)(br,{fontWeight:"medium",children:u})]}),h&&(0,i.jsx)(br,{children:"Des tickets repas te seront fournis pour les utiliser sur tous les stands du festival"})]})]})})},sp=e=>"All Access Pass"===e||"All Access Pass + A"===e?`${D.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_back.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/goldenCoast/classique_back.jpg`,op=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields?.cf37556?.value??"",s="All Access Pass"===n||"All Access Pass + A"===n?"#faed4f":"#294999";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${o=n,"All Access Pass"===o?`${D.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_front.jpg`:"All Access Pass + A"===o?`${D.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_plus_front.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/goldenCoast/classique_front.jpg`}) no-repeat`,backgroundSize:"212px 317px",fontFamily:"$neueMontreal",position:"relative"},height:317,width:212,children:[(0,i.jsx)(br,{css:{borderRadius:"4px",left:"55px",overflow:"hidden",position:"absolute",top:"105px"},height:102,width:102,children:m(t.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:t.fields.picture.url,width:"100%"})}),(0,i.jsx)(br,{css:{color:s,fontSize:"24px",fontWeight:"700",position:"absolute",textTransform:"uppercase",top:"218px"},textAlign:"center",width:1,children:t.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{color:s,fontSize:"24px",fontWeight:"700",position:"absolute",top:"248px"},textAlign:"center",width:1,children:t.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{color:s,fontWeight:"700",position:"absolute",top:"286px"},textAlign:"center",width:1,children:t.fields.cf33258?.value})]}),(0,i.jsx)(Ra,{css:{background:`url(${sp(n)}) no-repeat`,backgroundSize:"212px 317px",pageBreakBefore:"always"},height:317,width:212})]});var o},rp=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],ap={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"},lp=({css:e,name:t})=>(0,i.jsx)(br,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${ap[t]}) no-repeat`,backgroundSize:"cover",height:"30px",position:"absolute",width:"30px",...e}}),dp=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf38222?.value,o=t.accreditationsUsersInfos.reduce((e,t)=>rp.includes(t.accreditation.name)?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2025/bg_badge_recto.jpg) no-repeat",backgroundSize:"cover",color:"#FFF",fontFamily:"$formulaCondensedBold",position:"relative"},height:476,width:363,children:[(0,i.jsx)(br,{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)(br,{css:{fontSize:"13px",fontWeight:"700",left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",top:"172px"},children:n.fields.cf38077?.value}),(0,i.jsx)(br,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"301px"},children:(s||"").toUpperCase()}),o.TERRAIN&&(0,i.jsx)(lp,{css:{left:"251px",top:"314px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(lp,{css:{left:"299px",top:"314px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(lp,{css:{left:"251px",top:"363px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(lp,{css:{left:"299px",top:"363px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(lp,{css:{left:"251px",top:"412px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(lp,{css:{left:"299px",top:"412px"},name:"SALON PRESTIGE"})]}),(0,i.jsx)(Ra,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2025/bg_badge_verso.jpg) no-repeat",backgroundSize:"cover",position:"relative"},height:476,width:363})]})},cp=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],up={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"},hp=({css:e,name:t})=>(0,i.jsx)(br,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${up[t]}) no-repeat`,backgroundSize:"cover",height:"47px",position:"absolute",top:"463px",width:"47px",...e}}),mp=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf38222?.value,o=t.accreditationsUsersInfos.reduce((e,t)=>cp.includes((t.accreditation?.name||"").toUpperCase())?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(Ra,{css:{fontFamily:"$zuumeMedium",position:"relative"},height:Ym,width:Km,children:[(0,i.jsx)(br,{css:{left:"52px",position:"absolute",top:"205px"},height:111,width:111,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(br,{css:{left:"69px",position:"absolute",top:"317px"},textAlign:"center",width:77,children:n.id}),(0,i.jsx)(br,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"205px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"229px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{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)(br,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",textDecoration:"uppercase",top:"298px"},children:s}),o.TERRAIN&&(0,i.jsx)(hp,{css:{left:"45px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(hp,{css:{left:"96px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(hp,{css:{left:"149px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(hp,{css:{left:"201px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(hp,{css:{left:"253px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(hp,{css:{left:"306px"},name:"SALON PRESTIGE"})]})},gp=e=>{switch(e){case"ORGA":return`${D.HEAVENT_ASSETS_URL}/badges/lnh/Orga_Recto_v2.jpg`;case"Bénévoles":return`${D.HEAVENT_ASSETS_URL}/badges/lnh/Benevole_Recto.jpg`;case"MEDIA PRESSE":return`${D.HEAVENT_ASSETS_URL}/badges/lnh/Media_presse_Recto.jpg`;case"MEDIA PHOTOGRAPHE":return`${D.HEAVENT_ASSETS_URL}/badges/lnh/Media_Photo_Recto.jpg`;case"EQUIPES":return`${D.HEAVENT_ASSETS_URL}/badges/lnh/Equipe_Recto.jpg`;case"VIP":return`${D.HEAVENT_ASSETS_URL}/badges/lnh/VIP_recto.jpg`;default:return""}},pp=e=>{switch(e){case"ORGA":return"#6f2c91";case"Bénévoles":return"#72BF44";case"MEDIA PRESSE":return"#294EA2";case"MEDIA PHOTOGRAPHE":return"#ED1C24";case"EQUIPES":return"#EBCB00";case"VIP":return"#F7941D";default:return""}},fp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=jg(n.fields,"population",""),o=t.positionsSlotsUsersInfos[0]?.position?.name||"",r=(0,Fs.A)((0,Va.A)(t.accreditationsUsersInfos.map(e=>e.accreditation.acronym))),a="Bénévoles"===s?o:"ORGA"===s?n.fields.cf36081?.value:"EQUIPES"===s?n.fields?.cf36079?.value:"MEDIA PRESSE"===s||"MEDIA PHOTOGRAPHE"===s?n.fields?.cf36082?.value:"VIP"===s?n.fields?.cf36085?.value:"";return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ra,{css:{background:`url(${gp(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$tuskerGrotesk",fontWeight:"500",position:"relative"},height:321,width:212,children:[(0,i.jsx)(br,{css:{left:"125px",position:"absolute",top:"30px"},height:58,width:58,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(br,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"127px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"156px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"186px"},children:a}),(0,i.jsx)(Ra,{css:{gap:"2px",left:"31px",position:"absolute",top:"241px"},children:(0,wc.A)(1,9).map(e=>(0,i.jsx)(Ra,{align:"center",css:{background:"white",borderRadius:"17px",color:pp(s),fontFamily:"$gilroy",fontSize:"7px",fontWeight:"700",visibility:r.includes(e.toString(10))?"visible":"hidden"},height:17,justify:"center",width:17,children:e},e))})]})})},xp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Object.values((0,nc.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis()));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/moorea/contremarque.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$unbounded",position:"relative"},height:Hm,width:qm,children:[(0,i.jsxs)(Ra,{css:{color:"$gray800",fontSize:"22px",fontWeight:"700",left:"96px",position:"absolute",top:"239px"},direction:"column",children:[(0,i.jsx)(br,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{children:n.fields?.lastName?.value||""})]}),(0,i.jsx)(br,{css:{position:"absolute",right:"96px",top:"222px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsxs)(br,{color:"gray800",css:{fontSize:"12px",left:"96px",position:"absolute",top:"548px"},children:["Chèr.e ",n.fields?.firstName?.value||"",","]})]}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/moorea/Planning.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$unbounded",pageBreakBefore:"always",position:"relative"},height:Hm,width:qm,children:(0,i.jsx)(Ra,{css:{left:"92px",position:"absolute",top:"372px"},direction:"column",gap:"6",children:s.map((e,t)=>{const n=e[0];return(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{css:{color:"#a26fd2",fontSize:"16px",fontWeight:"700",textTransform:"uppercase"},children:n.positionSlot.range.start.toFormat("cccc dd MMMM yyyy",{locale:"fr"})}),e.map(({position:e,positionSlot:{range:t}},n)=>(0,i.jsxs)(br,{children:[e.name," / ",t.start.toFormat("HH:mm"),"-",t.end.toFormat("HH:mm")]},n))]},t)})})})]})},_p=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/nuitssecretes/background.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$poppins",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{fontSize:"28px",fontWeight:"700",position:"absolute",textAlign:"center",top:"545px"},width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"28px",fontWeight:"700",position:"absolute",textAlign:"center",top:"584px"},width:1,children:n.fields?.lastName?.value||""}),(0,i.jsxs)(Ra,{align:"center",css:{position:"absolute",top:"654px"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(br,{height:94,width:94,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:94,width:94}),width:"100%"})}),(0,i.jsx)(br,{css:{fontSize:"10px"},children:t.ticketId})]})]})},Ip=e=>{switch(e){case"PARTENAIRE":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/VIP@3x.jpg`;case"PARTENAIRE - Fast Pass":default:return"";case"VIP LOGES":case"VIP LOGES Fast Pass":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/vip_loges.png`;case"ADMINISTRATEUR":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ADMIN@3x.png`;case"MÉDIAS - JOURNALISTE":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/MEDIAS_JOURNALISTE@3x.png`;case"MÉDIAS - PHOTOGRAPHE":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/MEDIAS_PHOTOGRAPHE@3x.png`;case"BÉNÉVOLES":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/STAFF@3x.png`;case"CHAUFFEUR":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/CHAUFFEUR@3x.png`;case"RAMASSEUR DE BALLES":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ramasseurs.png`;case"JUGE DE LIGNE":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/juge_lignes.png`;case"OFFICIEL ATP":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/OFFICIEL@3x.png`;case"ORGANISATION":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ORGANISATION@3x.png`;case"PRESTATAIRE":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/PRESTATAIRE@3x.png`;case"JOUEUR":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/PLAYER@3x.png`;case"COACH":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/COACH@3x.png`;case"GUEST":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/GUEST@3x.png`;case"SUPERVISEUR":return`${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/supervisor_atp.png`}},vp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf31279?.value??"",o="OFFICIEL ATP"===s||"ORGANISATION"===s||"ADMINISTRATEUR"===s||"PRESTATAIRE"===s||"MÉDIAS - PHOTOGRAPHE"===s||"MÉDIAS - JOURNALISTE"===s||"VIP LOGES"===s||"VIP LOGES Fast Pass"===s||"PARTENAIRE"===s?`${n.fields?.firstName?.value||""} ${n.fields?.lastName?.value||""}`:n.fields?.firstName?.value||"",r="OFFICIEL ATP"===s||"ORGANISATION"===s?n.fields?.cf36132?.value:"ADMINISTRATEUR"===s||"PRESTATAIRE"===s||"MÉDIAS - PHOTOGRAPHE"===s||"MÉDIAS - JOURNALISTE"===s||"VIP LOGES"===s||"VIP LOGES Fast Pass"===s||"PARTENAIRE"===s?n.fields?.cf31319?.value:(n.fields?.lastName?.value||"").toUpperCase();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${Ip(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$sharpGrotesk",position:"relative"},height:331,width:208,children:[(0,i.jsx)(br,{css:{borderRadius:"$1",left:"61px",overflow:"hidden",position:"absolute",top:"169px"},height:80,width:80,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(br,{css:{color:"white",fontWeight:"600",position:"absolute",top:"285px"},textAlign:"center",width:1,children:o}),(0,i.jsx)(br,{css:{color:"white",fontWeight:"600",position:"absolute",top:"301px"},textAlign:"center",width:1,children:r})]}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/openbrest/v2/VERSO@3x.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:331,width:208,children:(0,i.jsx)(br,{css:{left:"59px",position:"absolute",top:"115px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})})})]})},bp=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields.phone?.internationalFormat||"";return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/p2n/planning_masque.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},direction:"column",height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{left:"48px",position:"absolute",top:"47px"},children:(0,i.jsx)(qg,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40})}),(0,i.jsxs)(Ra,{css:{left:"104px",position:"absolute",top:"45px"},direction:"column",children:[(0,i.jsx)(br,{css:{color:"$gray800",fontSize:"16px",fontWeight:"600"},children:t.name}),(0,i.jsx)(br,{color:"gray800",children:n})]}),(0,i.jsx)(br,{css:{color:"black",fontSize:"24px",fontWeight:"700",position:"absolute",top:"112px"},textAlign:"center",width:1,children:e.title}),(0,i.jsx)(Ra,{css:{gap:"28px",flex:"1",left:"48px",position:"absolute",top:"172px",width:"calc(100% - 96px)"},direction:"column",children:e.children})]})},jp=Bs.IX.fromDateTimes(Bs.c9.fromObject({year:2025,month:6,day:6}).startOf("day"),Bs.c9.fromObject({year:2025,month:6,day:8}).endOf("day"));var Cp;function yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Gn(Wc),n=e.psui.position,s=n.category,o=e.psui.positionSlot,r=(0,ic.A)((0,ch.A)(n.leaders.concat(s.leaders),e=>e.userInfo.id),e=>e.userInfo.name).map(e=>e.userInfo.name).join(", ");return(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:t.toLocaleString(o.range.start,Zs.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(Ra,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(kp,{})}),(0,i.jsxs)(br,{color:"gray800",children:[(0,i.jsx)(Gm,{css:{fontWeight:"600"},children:n.name})," | De"," ",o.range.start.toFormat("H:mm")," à ",o.range.end.toFormat("H:mm")]})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsx)(Ra,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(Sp,{})}),(0,i.jsxs)(br,{color:"gray800",children:[(0,i.jsx)(Gm,{css:{fontWeight:"600"},children:"Responsable : "}),r]})]}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{color:"black"},children:(0,i.jsx)(hg,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:n.description})})]})},Tp=e=>{const t=e.event.volunteerRegistration,[n,s]=(0,Xu.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(jp));return(0,i.jsx)(i.Fragment,{children:eo(n)&&(0,i.jsx)(bp,{event:e.event,title:"Planning P2N 2025",children:(0,ic.A)(n,({positionSlot:e})=>e.range.start.toMillis()).map(e=>(0,i.jsx)(Ep,{psui:e},e.id))})})},zp=e=>{const t=Gn(Wc);return(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:e.psuis[0].position.name}),(0,ic.A)(e.psuis,e=>e.positionSlot.range.start.toMillis()).map(e=>{const n=e.positionSlot;return(0,i.jsxs)(br,{color:"gray800",css:{fontSize:"16px"},children:[(0,i.jsx)(Gm,{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)})]})},Op=e=>{const t=e.event.volunteerRegistration,[n,s]=(0,Xu.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(jp)),o=(0,ic.A)(Object.entries((0,nc.A)(s,e=>e.position.name)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:eo(s)&&(0,i.jsx)(bp,{event:e.event,title:"Planning Montage/ Démontage P2N 2025",children:o.map(([e,t],n)=>(0,i.jsx)(zp,{psuis:t},n))})})},Rp=e=>{switch(e){case"BACKSTAGE":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Backstage.png`;case"ALL ACCES":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Orga_All_access.png`;case"BÉNÉVOLE":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Benevole.png`;case"GENDARME":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Gendarme.png`;case"MÉDIA":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Media.png`;case"PARTENAIRE":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Partenaire.png`;case"POMPIER":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Pompier.png`;case"PRESTATAIRE":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Prestataire.png`;case"PRÉVENTION":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Prevention.png`;case"SÉCURITÉ":return`${D.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Securite.png`;default:return""}},$p=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=3613===e.event.id?2434:2081,o=(0,ic.A)(t.accreditationsUsersInfos.filter(({accreditation:e})=>e.id===s),e=>e.accreditationSlot.date?.toMillis()??0).map(({accreditationSlot:e})=>e.name).join(""),r=n.fields?.cf26723?.value??"";return(0,i.jsxs)(Ra,{css:{background:`url(${Rp(r)}) no-repeat`,backgroundSize:"cover",fontFamily:"$now",position:"relative"},height:325,width:208,children:[(0,i.jsx)(br,{css:{color:"black",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"111px",width:"100%"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{color:"black",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"139px",width:"100%"},children:n.fields?.lastName?.value||""}),(0,i.jsxs)(Ra,{align:"center",css:{position:"absolute",top:"170px",width:"100%"},children:[(0,i.jsx)(br,{css:{color:"black",flex:"1",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",textAlign:"center"},children:o}),(0,i.jsx)(Ra,{css:{paddingRight:"5px"},width:169,children:(0,i.jsx)(br,{height:26,width:1,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{barcodeType:ig.Code39,height:26,width:164}),width:"100%"})})})]}),["PRESTATAIRE","PRÉVENTION","SÉCURITÉ"].some(e=>e===r)&&(0,i.jsx)(Ra,{align:"center",css:{position:"absolute",top:"249px",width:"100%"},children:(0,i.jsx)(br,{css:{color:"white",flex:"1",fontFamily:"$kobe",fontSize:"12px",fontWeight:"900",lineHeight:"12.78px",margin:"0 53px",textAlign:"center"},children:e.event.volunteerRegistration.delegation?.name.toUpperCase()})})]})},Dp=e=>e.includes("BLEU_CLAIR")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_clair_verso.jpg`:e.includes("BLEU_FONCE")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_fonce_verso.jpg`:e.includes("JAUNE")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/jaune_verso.jpg`:e.includes("ORANGE")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/orange_verso.jpg`:e.includes("VERT")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/vert_verso.jpg`:e.includes("VIOLET")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/violet_verso.jpg`:"",Pp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=n.fields?.cf1019?.value;return(0,i.jsx)(Ra,{css:{background:`url(${Dp(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:(0,i.jsx)(Ra,{align:"center",css:{color:"black",fontSize:"16px",fontWeight:"700",height:"39px",left:"29px",position:"absolute",top:"31px",width:"40px"},justify:"center",children:o})})},Fp=e=>e.includes("BLEU_CLAIR")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_clair/bleu_clair_recto.jpg`:e.includes("BLEU_FONCE")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_fonce/bleu_fonce_recto.jpg`:e.includes("JAUNE")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/jaune/jaune_recto.jpg`:e.includes("ORANGE")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/orange/orange_recto.jpg`:e.includes("VERT")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/vert/vert_recto.jpg`:e.includes("VIOLET")?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/violet/violet_recto.jpg`:"",Mp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=(0,Fs.A)(t.positionsSlotsUsersInfos.map(e=>e.position.name)),r=s.includes("JAUNE")||s.includes("BLEU_CLAIR")?"black":"white",a=n.fields?.cf20600?.value??"",l=n.fields?.cf21104?.value??"",d=n.fields?.cf21129?.value??[];return(0,i.jsxs)(Ra,{css:{background:`url(${Fp(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:[(0,i.jsx)(br,{css:{position:"absolute",right:"40px",top:"43px"},height:65,width:65,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:65,width:65}),width:"100%"})}),(0,i.jsx)(br,{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)(br,{css:{color:r,fontSize:"18px",fontWeight:"700",position:"absolute",textAlign:"center",top:"242px",width:"100%"},children:n.name}),(0,i.jsx)(Ra,{css:{color:r,fontSize:"12px",gap:"2px",position:"absolute",top:"271px",width:"100%"},direction:"column",children:t.state===Ot.NotApplicable||"Intervenant"===a?(0,i.jsx)(br,{textAlign:"center",width:1,children:l}):"Direction"===a?eo(d)?d.map((e,t)=>(0,i.jsx)(br,{textAlign:"center",width:1,children:e},t)):null:o.map((e,t)=>(0,i.jsx)(br,{textAlign:"center",width:1,children:e},t))}),(0,i.jsx)(br,{css:{color:r,fontSize:"32px",fontWeight:"700",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"364px",width:"100%"},children:a})]})},Np=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mp,{event:e.event}),(0,i.jsx)(Pp,{event:e.event})]}),Lp=e=>{const t=e.psuis[0].position,n=(0,ic.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=e.userInfo,o=t.leaders[0],r=t.leaders[1];return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/assignment_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",fontWeight:"500",pageBreakBefore:"always",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{borderRadius:"5px",left:"67px",overflow:"hidden",position:"absolute",top:"212px"},height:74,width:74,children:m(s.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:s.fields.picture.url,width:"100%"})}),(0,i.jsx)(br,{css:{color:"white",fontSize:"15px",fontWeight:"900",left:"27px",position:"absolute",textTransform:"uppercase",top:"295px"},textAlign:"center",width:155,children:s.fields?.firstName?.value||""}),o&&(0,i.jsxs)(Ra,{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)(br,{children:o.userInfo.firstName}),(0,i.jsx)(br,{children:o.userInfo.lastName}),(0,i.jsx)(br,{children:o.userInfo.phone?.internationalFormat})]}),r&&(0,i.jsxs)(Ra,{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)(br,{children:r.userInfo.firstName}),(0,i.jsx)(br,{children:r.userInfo.lastName}),(0,i.jsx)(br,{children:r.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Ra,{css:{left:"210px",padding:"24px 40px 0 40px",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Ra,{align:"center",css:{color:"#d7531e",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"},height:38,justify:"center",width:1,children:t.name}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"900"},children:"Date de ta mission :"}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Ra,{direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start,s=e.range.end,o=n.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(br,{css:{color:"#333333"},children:[n.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})," -"," ",o?s.toFormat("HH:mm"):s.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})]},t)})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"900"},children:"Détails de ta mission :"}),(0,i.jsx)(Ba,{height:"2"}),m(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{css:{color:"black","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(hg,{text:t.description})})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"900"},children:"Lieu de rendez-vous :"}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{children:t.address}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{height:180,width:1,children:(0,i.jsx)("a",{href:mg(t.latitude,t.longitude),style:{background:`url(${D.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),m(t.fields.cf38416)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{children:t.fields.cf38416})]})]})]})},Bp=e=>{const t=dg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>e.tags.some(e=>"Fiche personnalisée"===e.name)),n=(0,ic.A)(Object.entries((0,nc.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],s)=>(0,i.jsx)(Lp,{eventId:e.event.id,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},s))})},Vp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ra,{css:{background:`url(${s=e.event.id,4183===s?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/accreditation_vip.jpg`:3694===s?`${D.HEAVENT_ASSETS_URL}/badges/paris20km/2024/intervenant.jpg`:""}) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",position:"relative"},height:Hm,width:qm,children:[(0,i.jsxs)(Ra,{css:{fontSize:"24px",fontWeight:"900",left:"80px",lineHeight:"28px",position:"absolute",top:"261px"},direction:"column",children:[(0,i.jsx)(br,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{children:n.fields?.lastName?.value||""})]}),(0,i.jsxs)(br,{css:{color:"#d8541d",fontSize:"20px",fontWeight:"800",left:"80px",position:"absolute",top:"325px"},children:[(0,i.jsxs)(Gm,{css:{color:"black",fontWeight:"400"},children:[4183===e.event.id?"VIP":"Intervenant"," |"]})," ",n.fields.cf21104?.value]}),(0,i.jsx)(br,{css:{position:"absolute",right:"80px",top:"261px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})})]});var s},Up=()=>(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_verso.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",pageBreakBefore:"always",position:"relative"},direction:"column",height:597,width:435,children:(0,i.jsx)(br,{css:{height:"518px",left:"25px",position:"absolute",top:"15px",width:"385px"},children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/pastourelle2024/contact.png`,width:"100%"})})});var Wp;function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsx)(Ra,{css:{position:"absolute",px:"34px",top:"516px"},justify:"between",width:1,children:e.event.volunteerRegistration.accreditationsUsersInfos.map((e,t)=>{const n=px(e.accreditation.icon),s=Gd(e.accreditation.color);return(0,i.jsxs)(Ra,{align:"center",direction:"column",gap:"1",justify:"center",width:75,children:[(0,i.jsx)(Ra,{align:"center",css:{background:e.accreditation.color,borderRadius:"$1","& svg":{fill:s,height:"50%",width:"50%"}},height:24,justify:"center",width:24,children:(0,i.jsx)(n,{})}),(0,i.jsx)(br,{color:"gray800",css:{fontSize:"10px"},fontWeight:"medium",textAlign:"center",children:e.accreditation.name})]},t)})}),xx=e=>{const t=Gn(Wc),n=Gn(ah),s=e.event.volunteerRegistration.userInfo,o=(0,ic.A)(Object.values((0,nc.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toISO())),e=>e[0].positionSlot.range.start.startOf("day").toMillis()),r=(0,rr.A)(Zs.DateOnly.WeekdayLongMonthLong,"year"),a=s.fields?.cf16442?.value??"";return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_orga-bene_recto.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",position:"relative"},direction:"column",height:597,width:434,children:[(0,i.jsx)(br,{color:"gray500",css:{fontSize:"12px",fontWeight:"500",position:"absolute",top:"248px"},textAlign:"center",width:1,children:s.name}),(0,i.jsx)(br,{css:{position:"absolute",textTransform:"uppercase",top:"268px"},font:"gray800 displayXs bold",textAlign:"center",width:1,children:a||"Bénévole"}),(0,i.jsx)(Ra,{css:{position:"absolute",px:"60px",top:"312px"},direction:"column",gap:"2",children:o.map((e,s)=>(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray800",css:{fontSize:"10px",textTransform:"capitalize"},children:t.toLocaleString(e[0].positionSlot.range.start,r)}),e.map((e,t)=>(0,i.jsxs)(br,{color:"gray800",css:{fontSize:"10px"},fontWeight:"semiBold",children:[e.position.name," :"," ",n.toLocaleString(e.positionSlot.range,{locale:"fr-FR"},{hour:"numeric",minute:"numeric"})]},t))]},s))}),(0,i.jsx)(fx,{event:e.event})]})},_x=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xx,{event:e.event}),(0,i.jsx)(Up,{})]}),Ix=()=>(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_verso.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",pageBreakBefore:"always",position:"relative"},direction:"column",height:597,width:435,children:(0,i.jsx)(br,{css:{height:"472px",left:"29px",position:"absolute",top:"45px",width:"376px"},children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/pastourelle2024/programme.png`,width:"100%"})})}),vx=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields?.cf16442?.value??"";return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_presta_recto.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",position:"relative"},direction:"column",height:597,width:435,children:[(0,i.jsx)(br,{css:{position:"absolute",textTransform:"uppercase",top:"430px"},font:"gray800 displayXs bold",textAlign:"center",width:1,children:n}),(0,i.jsx)(fx,{event:e.event})]})},bx=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vx,{event:e.event}),(0,i.jsx)(Ix,{})]}),jx=({date:e})=>(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid black",borderRadius:"$1",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("d")}),(0,i.jsx)(br,{css:{fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMM",{locale:"fr"})})]}),Cx=e=>e?`${D.HEAVENT_ASSETS_URL}/badges/pec/accorArena/bg_accor_v7.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/pec/adidasArena/bg_adidas_v1.jpg`,yx=e=>(0,ic.A)((0,ch.A)(e.map(([e,t])=>t.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),kx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=e.event.tags.some(e=>"🏟️ Accor Arena"===e.name),o=(0,Va.A)(t.accreditationsUsersInfos.map(e=>e.accreditation.acronym)),r=(0,nc.A)(t.accreditationsUsersInfos.flatMap(e=>"Parking"!==e.accreditationCategory.name&&e.accreditationSlot.date?.isValid?[[e.accreditation.name,e.accreditationSlot.date]]:[]),([e])=>e),a=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>"PARK 30"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),l=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>"PARK 38"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),d=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>"Liv. P30"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),c=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>"Liv. P38"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),u=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>"PKG"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),h=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>"PL"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),g=eo(a)||eo(l)||eo(d)||eo(c)||eo(u)||eo(h),p=t.positionsSlotsUsersInfos[0],f=n.fields?.cf37410?.value??"",x=t.ticketId;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${Cx(s)}) no-repeat`,backgroundSize:"cover",fontFamily:s?"$montserrat":"$franklinGothic",position:"relative"},height:Hm,width:qm,children:[m(e.options.header?.content)&&(0,i.jsx)(br,{css:{borderTopLeftRadius:"10px",borderTopRightRadius:"10px",left:"44px",overflow:"hidden",position:"absolute",top:"40px"},height:217,width:706,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsx)(br,{css:{left:"92px",position:"absolute",top:"285px"},children:(0,i.jsx)(qg,{email:n.email,image:n.fields?.picture?.url,name:n.name,size:56})}),(0,i.jsx)(br,{css:{color:"black",fontSize:"22px",fontWeight:"700",left:"172px",position:"absolute",top:"296px"},children:n.name}),(0,i.jsx)(br,{css:{color:"#0000e3",fontSize:"18px",fontWeight:"700",left:"172px",position:"absolute",top:"324px"},children:t.delegation?.name??""}),(0,i.jsx)(br,{css:{left:"614px",position:"absolute",top:"281px"},height:80,width:80,children:m(x)&&(0,i.jsx)("img",{height:"100%",src:sg(x,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Ra,{css:{gap:"10px",left:"92px",position:"absolute",top:s?"521px":"501px"},width:610,wrap:"wrap",children:Object.entries(r).map(([e,t])=>(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:300,children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:e}),(0,i.jsx)(Ra,{css:{gap:"6px"},width:300,wrap:"wrap",children:yx(t).map(e=>(0,i.jsx)(jx,{date:e},e.toMillis()))})]},`group-${t[0]}`))}),g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:s?"643px":"623px"},direction:"column",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:"Plaque d'immatriculation"}),(0,i.jsx)(br,{children:n.fields.cf29549?.value})]}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:s?"643px":"623px"},direction:"column",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:"Type de véhicule"}),(0,i.jsx)(br,{children:f})]}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"699px",visibility:eo(a)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:"Parking Porte 30"}),(0,i.jsx)(Ra,{css:{gap:"6px"},width:300,wrap:"wrap",children:a.map(e=>(0,i.jsx)(jx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"699px",visibility:eo(l)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:"Parking Porte 38"}),(0,i.jsx)(Ra,{css:{gap:"6px"},width:300,wrap:"wrap",children:l.map(e=>(0,i.jsx)(jx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"699px",visibility:eo(d)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:"Livraison Porte 30"}),(0,i.jsx)(Ra,{css:{gap:"6px"},width:300,wrap:"wrap",children:d.map(e=>(0,i.jsx)(jx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"699px",visibility:eo(c)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:"Livraison Porte 38"}),(0,i.jsx)(Ra,{css:{gap:"6px"},width:300,wrap:"wrap",children:c.map(e=>(0,i.jsx)(jx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"679px",visibility:eo(u)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:"Parking Privé"}),(0,i.jsx)(Ra,{css:{gap:"6px"},width:300,wrap:"wrap",children:u.map(e=>(0,i.jsx)(jx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"679px",visibility:eo(h)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:"Aire de livraison :"}),(0,i.jsx)(Ra,{css:{gap:"6px"},width:300,wrap:"wrap",children:h.map(e=>(0,i.jsx)(jx,{date:e},e.toMillis()))})]})]}):(0,i.jsx)(Ra,{align:"center",css:{fontWeight:"600",left:"97px",position:"absolute",top:"643px"},height:104,justify:"center",width:600,children:"Aucun véhicule autorisé"}),(0,i.jsxs)(Ra,{css:{gap:"10px",left:"92px",position:"absolute",top:s?"817px":"795px"},direction:"column",width:219,children:[o.includes("P38")&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:"Porte 38 (selon horaire)"}),(0,i.jsx)(br,{children:"Accor Arena"}),(0,i.jsx)(br,{children:"8 Bd de Bercy,"}),(0,i.jsx)(br,{children:"75012 Paris"})]}),o.includes("P30")&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:"Porte 30"}),(0,i.jsx)(br,{children:"Accor Arena"}),(0,i.jsx)(br,{children:"222 Quai de Bercy,"}),(0,i.jsx)(br,{children:"75012 Paris"})]}),o.includes("P4")&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:"Porte 4"}),(0,i.jsx)(br,{children:"Accor Arena"}),(0,i.jsx)(br,{children:"8 Bd de Bercy,"}),(0,i.jsx)(br,{children:"75012 Paris"})]}),o.includes("P35/36")&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:"Porte 35/36"}),(0,i.jsx)(br,{children:"Accor Arena"}),(0,i.jsx)(br,{children:"Boulevard de Bercy,"}),(0,i.jsx)(br,{children:"75012 Paris"})]}),o.includes("P28")&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:"Porte 35/36"}),(0,i.jsx)(br,{children:"Accor Arena"}),(0,i.jsx)(br,{children:"222 Quai de Bercy,"}),(0,i.jsx)(br,{children:"75012 Paris"})]}),o.includes("PP+PM")&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:"Accès principal"}),(0,i.jsx)(br,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(br,{children:"75018 Paris"})]}),o.includes("PP+PE")&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:"Entrée prestataire et exploitation"}),(0,i.jsx)(br,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(br,{children:"75018 Paris"})]}),o.includes("ORG + EXP")&&(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{fontWeight:"600"},children:"Entrée organisation exploitation"}),(0,i.jsx)(br,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(br,{children:"75018 Paris"})]})]})]}),p&&(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/pec/accorArena/Fiche_Affectation_Accor.jpg) no-repeat`,backgroundSize:"cover",fontFamily:s?"$montserrat":"$franklinGothic",pageBreakBefore:"always",position:"relative"},height:Hm,width:qm,children:[m(e.options.header?.content)&&(0,i.jsx)(br,{css:{borderTopLeftRadius:"10px",borderTopRightRadius:"10px",left:"44px",overflow:"hidden",position:"absolute",top:"44px"},height:217,width:706,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsxs)(Ra,{css:{position:"absolute",px:"92px",top:"381px"},direction:"column",children:[(0,i.jsx)(br,{css:{color:"black",fontSize:"14px",fontWeight:"700"},children:p.position.name}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray800",css:{fontWeight:"600",textTransform:"capitalize"},children:p.positionSlot.range.start.toLocaleString(Zs.DateOnly.WeekdayLongMonthLong,{locale:"fr"})}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{css:{color:"black"},children:(0,i.jsx)(hg,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:p.position.description})})]})]})]})},Ax=e=>3376===e?`${D.HEAVENT_ASSETS_URL}/badges/playground/fiche_reims_v2.jpg`:3827===e?`${D.HEAVENT_ASSETS_URL}/badges/playground/fiche_corrida.jpg`:3823===e?`${D.HEAVENT_ASSETS_URL}/badges/playground/fiche_semi_boulogne.jpg`:3808===e?`${D.HEAVENT_ASSETS_URL}/badges/playground/fiche_toulouse.jpg`:5233===e?`${D.HEAVENT_ASSETS_URL}/badges/playground/fiche_unicef.jpg`:5158===e?`${D.HEAVENT_ASSETS_URL}/badges/playground/fiche_marseille.jpg`:5644===e||5341===e?`${D.HEAVENT_ASSETS_URL}/badges/playground/fiche_montpellier.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/playground/fiche_gcsd_v3.jpg`,wx=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"},Sx=e=>3827===e||5233===e?{top:"859px"}:5158===e?{top:"746px"}:5644===e||5341===e?{top:"744px"}:{top:"915px"},Ex=e=>{const t=e.vr.userInfo,n=e.positionSlotUserInfo.position,s=e.positionSlotUserInfo.positionSlot,o=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)(Ra,{css:{background:`url(${Ax(e.eventId)}) no-repeat`,backgroundSize:"cover",color:"#333333",position:"relative"},direction:"column",height:Hm,width:qm,children:[(0,i.jsx)(br,{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)(Ra,{css:{left:"210px",padding:"$7 $8 0 $8",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(br,{css:wx(e.eventId),textAlign:"center",width:1,children:n.name}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{css:a,children:"Détails de la mission :"}),(0,i.jsx)(Ba,{height:"2"}),m(n.description)&&(0,i.jsx)(br,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(hg,{text:n.description})}),kh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:a,children:"Lieu de mission :"}),Ch(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{children:n.address})]}),yh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{height:180,width:1,children:(0,i.jsx)("a",{href:mg(n.latitude,n.longitude),style:{background:`url(${D.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:a,children:"À cette heure ci :"}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{css:{gap:"22px"},width:1,children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{css:{fontWeight:"700"},children:s.range.start.toFormat("dd MMMM yyyy",{locale:"fr"})}),(0,i.jsxs)(br,{children:["De ",s.range.start.toFormat("H'h'mm")," à"," ",s.range.end.toFormat("H'h'mm")]})]}),o&&(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{css:{fontWeight:"700"},children:"Mon contact d'urgence"}),(0,i.jsxs)(br,{children:[o.userInfo.firstName," :"," ",o.userInfo.phone?.internationalFormat]}),r&&(0,i.jsxs)(br,{children:[r.userInfo.firstName," :"," ",r.userInfo.phone?.internationalFormat]})]})]}),(0,i.jsx)(Ba,{height:"6"}),m(n.fields.cf38780)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:a,children:"Transports"}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{dangerouslySetInnerHTML:{__html:n.fields.cf38780.split("\n").join("
")}})]})]}),(0,i.jsx)(br,{css:{left:"53px",position:"absolute",...Sx(e.eventId)},height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:sg(e.vr.ticketId,{height:104,width:104}),width:"100%"})})]})},Tx=e=>{const t=(0,M.useMemo)(()=>(0,ic.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)(Ex,{eventId:e.event.id,positionSlotUserInfo:t,vr:e.event.volunteerRegistration},t.positionSlot.id))})},zx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/roiarthur/roiarthur.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{color:"#181d3a",fontSize:"18px",fontWeight:"700",left:"426px",position:"absolute",textAlign:"center",top:"89px"},width:320,children:n.name}),(0,i.jsxs)(br,{css:{color:"#181d3a",fontSize:"12px",left:"426px",position:"absolute",textAlign:"center",top:"116px"},width:320,children:["Numéro code-barres : ",t.ticketId]}),(0,i.jsx)(br,{css:{left:"530px",position:"absolute",top:"144px"},height:114,width:114,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:114,width:114}),width:"100%"})})]})},Ox=(e,t)=>t?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page1.jpg`:"Direction"===e||"All Access"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page1.jpg`:"Backstage"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page1.jpg`:"Stand & Food & Bar"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/stand/stand_page1.jpg`:"Agora"===e||"Agora F"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page1.jpg`:"",Rx=(e,t)=>t?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page2.jpg`:"Direction"===e||"All Access"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page2.jpg`:"Backstage"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page2.jpg`:"Agora"===e||"Agora F"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page2.jpg`:"",$x=(e,t)=>t?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page3.jpg`:"Direction"===e||"All Access"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page3.jpg`:"Backstage"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page3.jpg`:"Stand & Food & Bar"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/stand/stand_page3.jpg`:"Agora"===e||"Agora F"===e?`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page3.jpg`:"",Dx=e=>(0,i.jsx)(br,{css:{left:`${e.left}px`,position:"absolute",top:`${e.top}px`},children:(0,i.jsx)("img",{height:"19px",src:`${D.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/bracelet_asset.png`,width:"38px"})}),Px=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=3571===e.event.id,o=jg(n.fields,"population"),r=t.accreditationsUsersInfos.find(e=>1602===e.accreditationCategory.id)?.accreditation.name||"",a="Direction"===r||"All Access"===r||"Backstage"===r,l=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),d=(0,ic.A)((0,ch.A)(t.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),c=(s?d:l).filter(e=>[29,30,31,1].includes(e.day)),u=t.accreditationsUsersInfos.flatMap(e=>3229===e.accreditation.id?[e.accreditationSlot.name]:[]),h=t.accreditationsUsersInfos.flatMap(e=>3230===e.accreditation.id?[e.accreditationSlot.name]:[]),g=(0,Va.A)([u.includes("29")?"Midi":null,h.includes("29")?"Soir":null]).join(" & "),p=(0,Va.A)([u.includes("30")?"Midi":null,h.includes("30")?"Soir":null]).join(" & "),f=(0,Va.A)([u.includes("31")?"Midi":null,h.includes("31")?"Soir":null]).join(" & "),x=(0,Va.A)([u.includes("1")?"Midi":null,h.includes("1")?"Soir":null]).join(" & "),_=t.accreditationsUsersInfos.flatMap(e=>3436===e.accreditation.id?[e.accreditationSlot.name]:[]),I=t.accreditationsUsersInfos.flatMap(e=>3439===e.accreditation.id?[e.accreditationSlot.name]:[]),v=t.accreditationsUsersInfos.flatMap(e=>3437===e.accreditation.id?[e.accreditationSlot.name]:[]),b=t.accreditationsUsersInfos.flatMap(e=>3438===e.accreditation.id?[e.accreditationSlot.name]:[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${Ox(r,s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$neueMontreal",position:"relative"},height:Hm,width:qm,children:[!s&&(0,i.jsx)(br,{css:{color:"#ee78ac",fontFamily:"$helveticaBlackCondensed",fontSize:"22px",fontWeight:"900",left:"251px",position:"absolute",textTransform:"uppercase",top:"130px"},textAlign:"center",width:292,children:o}),!s&&(0,i.jsxs)(br,{css:{color:"black",fontSize:"18px",fontWeight:"700",left:"299px",position:"absolute",top:"167px"},textAlign:"center",width:244,children:["Bracelet ",r]}),(0,i.jsxs)(br,{css:{color:"black",fontSize:"24px",fontWeight:"700",lineHeight:"28px",left:"95px",position:"absolute",textTransform:"uppercase",top:"237px"},children:[n.fields?.firstName?.value||"",(0,i.jsx)("br",{}),n.fields?.lastName?.value||""]}),!s&&(0,i.jsx)(br,{css:{color:"#ee78ac",fontSize:"18px",fontWeight:"700",left:"95px",position:"absolute",top:"295px"},children:t.delegation?.name}),(0,i.jsx)(br,{css:{position:"absolute",right:"95px",top:"232px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ra,{css:{gap:"6px",left:"95px",position:"absolute",top:"430px"},children:c.map((e,t)=>(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid black",borderRadius:"4px",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(br,{css:{color:"black",fontFamily:"Helvetica",fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(br,{css:{color:"black",fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMMM",{locale:"fr"})})]},t))}),_.includes("29")&&(0,i.jsx)(Dx,{left:289,top:803}),_.includes("30")&&(0,i.jsx)(Dx,{left:402,top:803}),_.includes("31")&&(0,i.jsx)(Dx,{left:515,top:803}),_.includes("1")&&(0,i.jsx)(Dx,{left:628,top:803}),I.includes("29")&&(0,i.jsx)(Dx,{left:289,top:839}),I.includes("30")&&(0,i.jsx)(Dx,{left:402,top:839}),I.includes("31")&&(0,i.jsx)(Dx,{left:515,top:839}),I.includes("1")&&(0,i.jsx)(Dx,{left:628,top:839}),v.includes("29")&&(0,i.jsx)(Dx,{left:289,top:875}),v.includes("30")&&(0,i.jsx)(Dx,{left:402,top:875}),v.includes("31")&&(0,i.jsx)(Dx,{left:515,top:875}),v.includes("1")&&(0,i.jsx)(Dx,{left:628,top:875}),b.includes("29")&&(0,i.jsx)(Dx,{left:289,top:911}),b.includes("30")&&(0,i.jsx)(Dx,{left:402,top:911}),b.includes("31")&&(0,i.jsx)(Dx,{left:515,top:911}),b.includes("1")&&(0,i.jsx)(Dx,{left:628,top:911})]}),"Stand & Food & Bar"!==r&&(0,i.jsx)(Ra,{css:{background:`url(${Rx(r,s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$neueMontreal",pageBreakBefore:"always",position:"relative"},height:Hm,width:qm,children:a&&(0,i.jsxs)(Ra,{css:{fontWeight:"700",left:"95px",lineHeight:"20px",position:"absolute",top:"598px"},direction:"column",children:[m(g)&&(0,i.jsxs)(br,{children:["29 août : ",g]}),m(p)&&(0,i.jsxs)(br,{children:["30 août : ",p]}),m(f)&&(0,i.jsxs)(br,{children:["31 août : ",f]}),m(x)&&(0,i.jsxs)(br,{children:["1 septembre : ",x]})]})}),(0,i.jsx)(Ra,{css:{background:`url(${$x(r,s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm}),!s&&"Agora"!==r&&(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/rose/v3/page4.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Hm,width:qm})]})},Fx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.find(e=>1662===e.accreditationCategory.id),o=(0,ic.A)((0,ch.A)(t.accreditationsUsersInfos.flatMap(e=>e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/rose/parking_vide.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(Ra,{css:{position:"absolute",top:"232px"},justify:"center",width:1,children:(0,i.jsx)(br,{css:{background:s?.accreditation.color,color:Gd(s?.accreditation.color||"#000000"),fontSize:"50px",fontWeight:"800",padding:"$1 $3",textTransform:"uppercase"},children:s?.accreditation.name||"parking"})}),(0,i.jsx)(br,{css:{fontFamily:"$bnCartaNoirBold",fontSize:"36px",fontWeight:"700",left:"48px",position:"absolute",textTransform:"uppercase",top:"353px"},children:n.name}),(0,i.jsx)(br,{css:{position:"absolute",right:"57px",top:"359px"},height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(Ra,{css:{gap:"6px",left:"48px",position:"absolute",top:"436px"},children:o.map((e,t)=>(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid black",borderRadius:"4px",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(br,{css:{color:"black",fontFamily:"Helvetica",fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(br,{css:{color:"black",fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMMM",{locale:"fr"})})]},t))})]})},Mx=e=>{const t=e.event.volunteerRegistration.userInfo.formsUsersInfos.map(e=>e.formId);return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/salamandre/2024/verso_v2.jpg) no-repeat`,backgroundSize:"cover",overflow:"hidden",paddingBottom:"24px",paddingTop:"56px",px:"16px"},direction:"column",height:Zm-5,width:Xm,children:[(0,i.jsx)(br,{css:{color:"#336998",fontSize:"10px",fontWeight:"700"},children:"Renseignements complémentaires"}),(0,i.jsx)(Ba,{height:"3"}),t.includes(2163)?e.event.volunteerRegistration.positionsSlotsUsersInfos.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Responsable de la mission"}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:(0,Fs.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos.flatMap(e=>e.position.leaders.map(e=>`${e.userInfo.name} : ${e.userInfo.phone?.internationalFormat??"-"}`))).join(", ")}),(0,i.jsx)(Ba,{height:"4"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Responsable des bénévoles"}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"Anika Andenmatten : 079 689 52 51"}),(0,i.jsx)(Ba,{height:"4"})]}),(0,i.jsx)(br,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Police"}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"117"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Pompiers"}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"118"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Ambulance"}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"144"})]})};var Nx;function Lx(){return Lx=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(Ra,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Ra,{align:"center",css:{background:"white",borderRadius:"34px",color:"#336998",height:"34px",width:"34px",svg:{fill:"#5a9e9f",height:"50%",width:"50%"}},justify:"center",children:"Camera"===e.icon?(0,i.jsx)(gf,{}):(0,i.jsx)(Bx,{})}),(0,i.jsx)(br,{css:{color:"#761c31",fontSize:"10px"},children:e.name})]}),Ux={MAsoir:1,MERC:2,MEmatin:3,MEmidi:4,MEsoir:5,JEUD:6,JEmatin:7,JEmidi:8,JEsoir:9,VEND:10,VEmatin:11,VEmidi:12,VEsoir:13,SAM:14,SAmatin:15,SAmidi:16,SAsoir:17,DIM:18,DImatin:19,DImidi:20,DIsoir:21},Wx=e=>{const t=e.event.volunteerRegistration.userInfo,n=(0,ic.A)(e.event.volunteerRegistration.accreditationsUsersInfos,e=>Ux[e.accreditation.acronym||""]||-1),s=e.event.volunteerRegistration.userInfo.formsUsersInfos.map(e=>e.formId),o=t.fields?.cf11135?.value??"",r=t.fields?.cf10429?.value??"";return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/salamandre/2024/recto.jpg) no-repeat`,backgroundSize:"cover",overflow:"hidden",padding:"12px 14px",position:"relative"},direction:"column",height:Zm-5,width:Xm,children:[(0,i.jsx)(br,{color:"white",css:{fontFamily:"$gravur",fontSize:"22px",left:"0",position:"absolute",textAlign:"center",top:"117px",width:"100%"},children:t.name}),(0,i.jsx)(br,{color:"white",css:{fontSize:"20px",fontWeight:"800",left:"0",position:"absolute",textAlign:"center",top:"139px",width:"100%"},children:s.includes(2164)?o:r}),(0,i.jsx)(id,{css:{flex:"1",gap:"8px 40px",padding:"12px 36px",position:"absolute",top:"194px",left:0},gridtemplatecolumns:"repeat(3, 1fr)",gridtemplaterows:"repeat(3, 1fr)",height:187,width:1,children:n.map((e,t)=>(0,i.jsx)(Vx,{icon:e.accreditation.icon,name:e.accreditation.acronym||""},t))})]})},Gx=e=>(0,i.jsxs)(Ra,{height:Zm,width:2*Xm,children:[(0,i.jsx)(Wx,{event:e.event}),(0,i.jsx)(Mx,{event:e.event})]}),Hx=e=>(0,i.jsx)(Ra,{height:Hm,width:qm,children:(0,i.jsx)(Gx,{event:e.event})}),qx=e=>(0,i.jsx)(i.Fragment,{children:(0,Ug.A)(e.event.volunteersRegistrations.nodes,8).map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(Ra,{css:{overflow:"hidden",pageBreakBefore:0!==n?"always":void 0},height:1,width:Hm,wrap:"wrap",children:t.map(t=>(0,i.jsx)(Wx,{event:{...e.event,volunteerRegistration:t}},`front-${t.userInfo.id}`))}),(0,i.jsx)(Ra,{css:{overflow:"hidden",pageBreakBefore:"always"},height:1,width:Hm,wrap:"wrap",children:(0,Ug.A)(t,4).map(t=>(0,i.jsx)(Ra,{direction:"rowReverse",width:1,children:t.map(t=>(0,i.jsx)(Mx,{event:{...e.event,volunteerRegistration:t}},`back-${t.userInfo.id}`))},`group-${t[0].utid}`))})]},`page-${n}`))}),Yx="#e30613",Kx="#26306b",Zx={cf25078:"Parcours",cf25079:"Plan village",cf25080:"Poste vélo",cf25511:"Poste course à pied",cf25512:"Plan d'accès"},Xx=Object.keys(Zx),Jx=e=>{const t=Gn(Wc),n=e.positionSlotUserInfo.position,s=n.category,o=e.positionSlotUserInfo.positionSlot,r=s.leaders[0],a=Xx.some(e=>m(n.fields[e]?.url)),l=a||"Restauration athlètes"===s.name||"Ravitaillement"===s.name||"Retrait des dossards"===s.name;return(0,i.jsxs)(Ra,{css:{background:"white",fontFamily:"$roboto"},direction:"column",height:Hm,width:qm,children:[(0,i.jsxs)(Ra,{height:185,width:1,children:[(0,i.jsx)(Ra,{height:1,width:185,children:m(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"100%"})}),(0,i.jsx)(Ra,{css:{padding:"$4 $7"},width:609,children:(0,i.jsxs)(Ra,{direction:"column",justify:"between",width:1,children:[(0,i.jsxs)(Ra,{justify:"between",width:1,children:[(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(br,{css:{color:Yx,fontSize:"34px",fontWeight:"700",lineHeight:"40px"},children:m(n.acronym)?n.acronym:n.name}),(0,i.jsxs)(br,{css:{color:Yx,ellipsis:!0,fontSize:"18px",fontWeight:"700"},children:["POSTE / ",s.name]})]}),l&&(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(br,{css:{color:Yx,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Adresse"}),(0,i.jsx)(br,{css:{color:Kx,fontSize:"16px",fontWeight:"500",textAlign:"right"},children:n.address})]})]}),l&&(0,i.jsxs)(Ra,{justify:"between",width:1,children:[(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{color:Kx,fontSize:"18px",fontWeight:"700"},children:"Point GPS"}),(0,i.jsxs)(br,{css:{color:Yx,fontSize:"16px",fontWeight:"500"},children:[n.latitude,", ",n.longitude]})]}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{color:Kx,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Horaires de mission"}),(0,i.jsxs)(br,{css:{color:Yx,fontSize:"16px",fontWeight:"500",textAlign:"right",textTransform:"capitalize"},children:[t.toLocaleString(o.range.start,{month:"short",day:"numeric",weekday:"short"})," ","| ",o.range.start.toFormat("HH'h'mm")," -"," ",o.range.end.toFormat("HH'h'mm")]})]})]}),!l&&(0,i.jsx)(Ra,{width:1,children:(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{color:Yx,fontSize:"18px",fontWeight:"700"},children:"Adresse"}),(0,i.jsx)(br,{css:{color:Kx,fontSize:"16px",fontWeight:"500"},children:n.address})]})})]})})]}),(0,i.jsx)(br,{css:{background:Yx},height:10,width:1}),(0,i.jsxs)(Ra,{css:{flex:"1",padding:"$6 $7"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(br,{css:{color:Yx,fontSize:"20px",fontWeight:"700"},children:"VOTRE MISSION"}),(0,i.jsx)(br,{css:{color:Kx,fontSize:"16px",fontWeight:"500","& .h-rich-text > p":{margin:0}},children:(0,i.jsx)(hg,{text:n.description})})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{background:Yx},height:10,width:1}),(0,i.jsx)(Ra,{css:{padding:"$5 $7"},gap:"5",height:335,width:1,children:Xx.map(e=>{if(m(n.fields[e]?.url)){const t=Zx[e];return(0,i.jsxs)(Ra,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(br,{css:{color:Yx,fontSize:"20px",fontWeight:"700"},children:t}),(0,i.jsx)(br,{height:255,width:1,children:(0,i.jsx)("img",{height:"100%",src:n.fields[e].url,width:"100%"})})]},e)}return null})})]}),(0,i.jsx)(Ra,{align:"center",css:{background:Yx,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Vous rencontrez un problème ?"}),(0,i.jsxs)(Ra,{css:{padding:"$4"},direction:"column",height:88,width:1,children:[(0,i.jsx)(br,{css:{color:Kx,fontSize:"20px",fontWeight:"500",textAlign:"center"},width:1,children:"Contactez votre responsable de secteur"}),r&&(0,i.jsxs)(br,{css:{color:Kx,fontSize:"20px",fontWeight:"700",textAlign:"center"},width:1,children:[r.userInfo.name," : ",r.userInfo.phone?.internationalFormat]})]}),(0,i.jsx)(Ra,{align:"center",css:{background:Kx,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Merci"})]})},Qx=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteerRegistration.positionsSlotsUsersInfos.map((t,n)=>(0,i.jsx)(Jx,{options:e.options,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},n))}),e_=e=>{switch(e){case"Organisateur":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Organisation_Recto.jpg`;case"Bénévole":default:return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Benevole_Recto.jpg`;case"Partenaire":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Partenaire_Recto.jpg`;case"Officiel":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Officiel_Recto.jpg`;case"Exposant":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Exposant_Recto.jpg`;case"Prestataire":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Intervenant_Recto.jpg`}},t_=e=>{switch(e){case"Organisateur":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Organisation_Verso.jpg`;case"Bénévole":default:return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Benevole_Verso.jpg`;case"Partenaire":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Partenaire_Verso.jpg`;case"Exposant":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Exposant_Verso.jpg`;case"Prestataire":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Intervenant_Verso.jpg`;case"Officiel":return`${D.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Officiel_Verso.jpg`}},n_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n?.fields?.cf27672?.value||"Organisateur",o=(0,ic.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),r="Organisateur"!==s&&"Bénévole"!==s,a="Organisateur"===s||"Bénévole"==s;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${e_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:597,width:435,children:[(0,i.jsx)(br,{css:{color:"black",fontSize:"22px",fontWeight:"700",position:"absolute",top:"449px"},textAlign:"center",width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{color:"black",fontSize:"22px",fontWeight:"700",position:"absolute",top:"478px"},textAlign:"center",width:1,children:n.fields?.lastName?.value||""}),r&&(0,i.jsx)(br,{css:{color:"black",fontSize:"18px",fontWeight:"500",position:"absolute",top:"519px"},textAlign:"center",width:1,children:n.fields?.cf27673?.value})]}),(0,i.jsx)(Ra,{css:{background:`url(${t_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",pageBreakBefore:"always",position:"relative"},height:597,width:435,children:a&&(0,i.jsx)(Ra,{css:{position:"absolute",top:"83px"},direction:"column",gap:"2",width:1,children:o.map(e=>(0,i.jsxs)(br,{css:{color:"black",fontSize:"12px",fontWeight:"500"},textAlign:"center",width:1,children:[e.position.name," :"," ",e.positionSlot.range.start.toFormat("dd MMMM yyyy H'h'mm",{locale:"fr"})," ","à ",e.positionSlot.range.end.toFormat("H'h'mm")]},e.id))})})]})},i_=e=>e.includes("Intervenant")?`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Bordeaux.jpg`:e.includes("VIP")?`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Dore.jpg`:e.includes("Protocole")?`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Blanc.jpg`:e.includes("Accrédité")||e.includes("Spare")||e.includes("Press")||e.includes("Pro")?`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Vert.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Noir.jpg`,s_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf24297?.value||"Spare",o=s.includes("Protocole")?"black":"white";return(0,i.jsxs)(Ra,{css:{background:`url(${i_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$utopiales",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"408px"},textAlign:"center",width:397,children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"447px"},textAlign:"center",width:397,children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{color:o,fontSize:"24px",position:"absolute",textTransform:"uppercase",top:"505px"},textAlign:"center",width:397,children:s.includes("Bénévole")?s:s.includes("VIP")?"Pass VIP":n.fields.cf38606?.value}),(0,i.jsx)(br,{css:{fontFamily:"$default",fontSize:"16px",left:"397px",position:"absolute",top:"300px"},textAlign:"center",width:397,children:"Code membre :"}),(0,i.jsx)(br,{css:{left:"543px",position:"absolute",top:"367px"},height:106,width:106,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:106,width:106}),width:"100%"})})]})},o_=e=>e.includes("Intervenant")?`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Inrae_Recto.jpg`:e.includes("VIP")?`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Pass_vip_Recto.jpg`:e.includes("Protocole")?`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Ville_de_Nantes_Recto.jpg`:e.includes("Accrédité")||e.includes("Spare")||e.includes("Press")||e.includes("Pro")?`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Cea_Recto.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Staff_Recto.jpg`,r_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf24297?.value||"Spare",o=s.includes("Protocole")?"black":"white";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${o_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$utopiales",position:"relative"},height:490,width:340,children:[(0,i.jsx)(br,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"336px"},textAlign:"center",width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"375px"},textAlign:"center",width:1,children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{color:o,fontSize:"24px",position:"absolute",textTransform:"uppercase",top:"433px"},textAlign:"center",width:1,children:s.includes("Bénévole")?s:s.includes("VIP")?"Pass VIP":n.fields.cf38606?.value})]}),(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Verso.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:490,width:340,children:[(0,i.jsx)(br,{css:{fontSize:"16px",position:"absolute",top:"258px"},textAlign:"center",width:1,children:"Code membre :"}),(0,i.jsx)(br,{css:{left:"117px",position:"absolute",top:"315px"},height:106,width:106,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:106,width:106}),width:"100%"})})]})]})},a_=Bs.IX.after(Bs.c9.fromObject({day:23,month:8,year:2024}),Bs.dw.fromObject({day:3})),l_=e=>Bs.IX.fromDateTimes(Bs.c9.fromObject({day:e,month:8,year:2024,hour:7}),Bs.c9.fromObject({day:e,month:8,year:2024,hour:25===e?15:16})),d_=e=>Bs.IX.fromDateTimes(Bs.c9.fromObject({day:e,month:8,year:2024,hour:25===e?15:16}),Bs.c9.fromObject({day:e+1,month:8,year:2024,hour:4})),c_=e=>Bs.IX.after(Bs.c9.fromObject({day:e,month:8,year:2024}),Bs.dw.fromObject({day:1})),u_=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf22493?.value??"",o=n.fields?.cf26370?.value??"",r=t.positionsSlotsUsersInfos.filter(e=>e.positionSlot.range.overlaps(a_)),a=(0,Fs.A)(r.map(e=>e.position.category.name)).join(", "),l=r.reduce(([e,t,n],i)=>[e||i.positionSlot.range.overlaps(c_(23)),t||i.positionSlot.range.overlaps(c_(24)),n||i.positionSlot.range.overlaps(c_(25))],[!1,!1,!1]),d=(0,Va.A)((0,Fs.A)(t.positionsSlotsUsersInfos.flatMap(e=>[e.positionSlot.range.start?.day,e.positionSlot.range.end?.day])));let c=0;d.length>2?c=2:d.length>0&&(c=1);const u=l.reduce((e,t)=>t?e+12:e,0),h=r.reduce(([e,t],n)=>{const i=n.positionSlot.range;return[[e[0]||i.overlaps(l_(23)),e[1]||i.overlaps(l_(24)),e[2]||i.overlaps(l_(25))],[t[0]||i.overlaps(d_(23)),t[1]||i.overlaps(d_(24)),t[2]||i.overlaps(d_(25))]]},[[!1,!1,!1],[!1,!1,!1]]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vandb/Contremarque_1.jpg) no-repeat`,backgroundSize:"cover",color:"#103725",fontFamily:"$firaSans",position:"relative"},height:Hm,width:qm,children:[(0,i.jsxs)(Ra,{css:{gap:"10px",justifyContent:"space-between",left:"109px",position:"absolute",top:"181px",right:"109px"},children:[(0,i.jsxs)(Ra,{css:{flexDirection:"column",gap:"6px"},children:[(0,i.jsx)(br,{css:{fontFamily:"$badTyp",fontSize:"22px",fontWeight:500,lineHeight:"28px",textTransform:"uppercase"},children:n.name}),(0,i.jsxs)(br,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:s}),` | ${a}`]}),(0,i.jsxs)(br,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:"T-shirt :"}),` ${c} en taille ${o||""}`]}),(0,i.jsxs)(br,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:"Montant EXO :"}),` ${u}`]})]}),(0,i.jsxs)(Ra,{css:{alignItems:"flex-end",flexDirection:"column",gap:"4px"},children:[(0,i.jsx)(br,{height:80,width:80,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(br,{css:{fontSize:"10px"},children:t.ticketId})]})]}),h[0][0]&&(0,i.jsx)(Ra,{css:{height:"32px",justifyContent:"center",left:"265px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[0][1]&&(0,i.jsx)(Ra,{css:{height:"32px",justifyContent:"center",left:"407px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[0][2]&&(0,i.jsx)(Ra,{css:{height:"32px",justifyContent:"center",left:"549px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][0]&&(0,i.jsx)(Ra,{css:{height:"32px",justifyContent:"center",left:"265px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][1]&&(0,i.jsx)(Ra,{css:{height:"32px",justifyContent:"center",left:"407px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][2]&&(0,i.jsx)(Ra,{css:{height:"32px",justifyContent:"center",left:"549px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${D.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})})]}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vandb/Contremarque_2.jpg) no-repeat`,backgroundSize:"cover"},height:Hm,width:qm})]})},h_=e=>(0,i.jsxs)(Ra,{align:"center",css:{visibility:e.visible?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{css:{border:"1px solid white",borderRadius:"6px"},height:24,width:24}),(0,i.jsx)(br,{css:{color:"white",fontSize:"8px",fontWeight:"500"},children:e.children})]}),m_=e=>{switch(e){case"BENEVOLES":return"#f49538";case"PARTENAIRES":return"#fecc16";case"EXPOSANTS":return"#17bd6d";case"MEDIAS":case"PHOTOGRAPHE":case"VIDÉASTE":return"#fd5e97";case"FOURNISSEURS":case"PRESTATAIRES":case"OFFICIEL":return"#da43c2";case"MEDICAL":return"#ff0000";case"ORGANISATION":return"#36b3e9";default:return""}},g_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf18560?.value||"",o=t.accreditationsUsersInfos.map(e=>e.accreditation.acronym||"");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vannes/2024/recto.png) no-repeat`,backgroundColor:m_(s),backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:454,width:378,children:[(0,i.jsx)(br,{css:{fontSize:"20px",fontWeight:"700",left:"39px",position:"absolute",top:"167px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"20px",fontWeight:"700",left:"39px",position:"absolute",top:"195px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"20px",fontWeight:"500",left:"39px",position:"absolute",textTransform:"capitalize",top:"241px"},children:s.toLowerCase()}),(0,i.jsx)(Ra,{css:{left:"41px",position:"absolute",top:"347px"},gap:"2",children:(0,wc.A)(1,8).map(e=>(0,i.jsx)(Ra,{align:"center",css:{background:"#00e5ff",borderRadius:"32px",fontSize:"18px",fontWeight:"700",visibility:o.includes(e.toString(10))?"visible":"hidden"},height:32,justify:"center",width:32,children:e},e))})]}),(0,i.jsx)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vannes/2024/verso_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:454,width:378,children:(0,i.jsxs)(Ra,{css:{gap:"32px",left:"38px",position:"absolute",top:"374px"},children:[(0,i.jsx)(h_,{visible:o.includes("ven midi"),children:"Ven. Midi"}),(0,i.jsx)(h_,{visible:o.includes("sam midi"),children:"Sam. Midi"}),(0,i.jsx)(h_,{visible:o.includes("sam soir"),children:"Sam. Soir"}),(0,i.jsx)(h_,{visible:o.includes("dim"),children:"Dim."}),(0,i.jsx)(h_,{visible:o.includes("cocktail"),children:"Cocktail"})]})})]})};var p_;function f_(){return f_=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Gn(Wc),n=e.positionSlotUserInfo.positionSlot,s=e.positionSlotUserInfo.position,o=s.category,r=s.leaders.concat(o.leaders)[0];return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vannes/2024/assignemnt_v3.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{background:"#00e5ff",borderRadius:"$1",color:"white",fontSize:"24px",fontWeight:"700",padding:"10px",position:"absolute",right:"44px",top:"32px"},children:s.name}),(0,i.jsxs)(Ra,{css:{left:"56px",padding:"$7",position:"absolute",top:"152px"},direction:"column",width:682,children:[(0,i.jsxs)(Ra,{justify:"between",width:1,children:[(0,i.jsxs)(Ra,{css:{color:"#1d2939",fontSize:"24px",fontWeight:"700",lineHeight:"28px"},direction:"column",children:[(0,i.jsx)(br,{children:e.userInfo.fields?.firstName?.value||""}),(0,i.jsx)(br,{children:e.userInfo.fields?.lastName?.value||""})]}),(0,i.jsxs)(Ra,{align:"end",css:{lineHeight:"28px"},direction:"column",children:[(0,i.jsx)(br,{css:{fontSize:"22px",fontWeight:"600",textTransform:"capitalize"},children:t.toLocaleString(n.range.start,Zs.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(br,{css:{fontSize:"16px",fontWeight:"700"},children:o.name})]})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(br,{color:"gray800",children:["Nous te remercions chaleureusement d’avoir accepté de participer à l’organisation de la 24ème édition du"," ",(0,i.jsx)(Gm,{fontWeight:"bold",children:"Marathon de Vannes"})," en tant que bénévole."]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{css:{border:"1px solid $gray200",borderRadius:"5px",boxShadow:"$xs",padding:"$4"},children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(kp,{})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:"Mission affectée"}),(0,i.jsx)(br,{color:"gray800",children:s.name})]})]}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(x_,{})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:"Heure de la mission"}),(0,i.jsxs)(br,{color:"gray800",children:["De"," ",t.toLocaleString(n.range.start,Zs.TimeOnly)," ","à"," ",t.toLocaleString(n.range.end,Zs.TimeOnly)]})]})]}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(Mf,{})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:"Lieu de rendez-vous"}),(0,i.jsx)(br,{color:"gray800",children:s.address})]})]}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(v_,{})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:"Coordonnées GPS"}),(0,i.jsxs)(br,{color:"gray800",children:[s.latitude,(0,i.jsx)("br",{}),s.longitude]})]})]})]}),(0,i.jsx)(br,{height:255,width:308,children:(0,i.jsx)("a",{href:mg(s.latitude,s.longitude),style:{background:`url(${D.HEAVENT_API_URL}/image/event/${e.eventId}/position/${s.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px"},direction:"column",children:[(0,i.jsx)(br,{fontWeight:"bold",children:"Description de la mission"}),m(s.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{color:"gray800",css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(hg,{text:s.description})})})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{css:{lineHeight:"20px"},direction:"column",children:[(0,i.jsx)(br,{fontWeight:"bold",children:"Coordonnées des responsables"}),(0,i.jsx)(br,{children:"Merci de te présenter avec cette convocation auprès de ton responsable sur place :"})]}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{fontSize:"textMd",fontWeight:"bold",textAlign:"center",width:1,children:r?`${r.userInfo.name} : ${r.userInfo.phone?.internationalFormat}`:""})]})]})},j_=e=>{const t=(0,M.useMemo)(()=>(0,ic.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)(b_,{eventId:e.event.id,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},t.positionSlot.id))})},C_=e=>(0,i.jsx)(Ra,{align:"center",css:{background:e.color,flex:"1",visibility:e.visible?"visible":"hidden"},height:28,justify:"center",width:45,children:(0,i.jsx)(br,{css:{color:"white",fontFamily:"$raleway",fontSize:"17px",fontWeight:"700"},children:e.children})}),y_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym);return(0,i.jsxs)(Ra,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vendanges/vendanges_2024.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:325,width:204,children:[(0,i.jsx)(br,{css:{borderRadius:"92px",height:"92px",left:"56px",overflow:"hidden",position:"absolute",top:"133px",width:"92px"},children:n.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture?.url,width:"100%"})}),(0,i.jsx)(br,{css:{color:"#802c8d",fontFamily:"$raleway",fontSize:"12px",fontWeight:"800",position:"absolute",textAlign:"center",top:"240px",width:"100%"},children:n.name}),(0,i.jsxs)(Ra,{css:{left:"0",position:"absolute",top:"146px"},direction:"column",children:[(0,i.jsx)(C_,{color:"#98cd00",visible:s.includes("JEU 19"),children:"JEU"}),(0,i.jsx)(C_,{color:"#ff9f01",visible:s.includes("VEN 20")||s.includes("VEN 20 & SAM 21"),children:"VEN"}),(0,i.jsx)(C_,{color:"#a655b1",visible:s.includes("SAM 21")||s.includes("VEN 20 & SAM 21"),children:"SAM"})]}),(0,i.jsxs)(Ra,{css:{height:"53px",left:"0",position:"absolute",top:"272px",width:"100%"},children:[(0,i.jsx)(Ra,{align:"center",css:{background:"#6eafe2",height:"100%",flex:"1",visibility:s.includes("1")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(br,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"1"})}),(0,i.jsx)(Ra,{align:"center",css:{background:"#9261a8",height:"100%",flex:"1",visibility:s.includes("2")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(br,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"2"})}),(0,i.jsx)(Ra,{align:"center",css:{background:"#accb44",height:"100%",flex:"1",visibility:s.includes("3")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(br,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"3"})}),(0,i.jsx)(Ra,{align:"center",css:{background:"#e7a726",height:"100%",flex:"1",visibility:s.includes("4")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(br,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"4"})}),(0,i.jsx)(Ra,{align:"center",css:{background:"#d23780",height:"100%",flex:"1",visibility:s.includes("5")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(br,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"5"})})]})]})},k_=e=>(0,i.jsx)(br,{css:{background:`url(${e.url})`,backgroundSize:"cover",visibility:e.visible?"visible":"hidden"},height:27,width:27}),A_=e=>{switch(e){case"Organisation":return`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-rouge.jpg`;case"Intervenant":return`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-violet.jpg`;case"Media":return`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-vert.jpg`;case"Partenaire":return`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-gris.jpg`;case"Team":return`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-bleu.jpg`;case"Village":return`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-jaune.jpg`;default:return""}},w_=e=>{const t="Media"===jg(e.userInfo.fields,"population")?e.userInfo.fields?.cf37885?.value??"":e.delegation?.name??"";return t.includes("(")?t.substring(0,t.indexOf("(")).trim():t},S_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=jg(n.fields,"population",""),o=w_(t),r=t.accreditationsUsersInfos.map(e=>e.accreditation.acronym),a=r.includes("AAA")||r.includes("PVG")&&r.includes("PCM")&&r.includes("PCC")&&r.includes("ZE")&&r.includes("CAF"),l=n.fields?.cf37926?.value??"";return(0,i.jsxs)(Ra,{css:{background:`url(${A_(s)}) no-repeat`,backgroundSize:"cover",color:"#231c45",fontFamily:"$poppins",position:"relative"},height:325,width:204,children:[(0,i.jsx)(br,{css:{left:"16px",position:"absolute",top:"81px"},height:78,width:78,children:(0,i.jsx)("img",{height:"100%",src:m(n.fields?.picture?.url)?n.fields.picture.url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/avatar_defaut.jpg`,width:"100%"})}),(0,i.jsx)(Ra,{css:{bottom:"133px",fontSize:"10px",fontWeight:"700",left:"16px",lineHeight:"10px",position:"absolute",textTransform:"uppercase"},width:106,wrap:"wrap",children:o}),(0,i.jsx)(br,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/divider.png) no-repeat`,backgroundSize:"cover",height:"1px",left:"16px",position:"absolute",top:"194px",width:"78px"}}),(0,i.jsx)(br,{css:{fontSize:"10px",fontWeight:"700",left:"16px",position:"absolute",textTransform:"uppercase",top:"198px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"14px",fontWeight:"700",left:"16px",position:"absolute",textTransform:"uppercase",top:"208px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{color:"white",fontSize:"13px",fontWeight:"700",left:"15px",position:"absolute",textTransform:"uppercase",top:"244px"},children:s}),(0,i.jsx)(br,{css:{color:"rgba(255, 255, 255, 0.70)",fontSize:"10px",fontWeight:"700",left:"15px",position:"absolute",textTransform:"uppercase",top:"258px"},children:l}),r.includes("CLE")&&(0,i.jsx)(br,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v5/Accompagnant.png) no-repeat`,backgroundSize:"cover",left:"100px",position:"absolute",top:"81px"},height:59,width:27}),(0,i.jsx)(br,{css:{left:"139px",position:"absolute",top:"22px"},height:46,width:46,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:46,width:46}),width:"100%"})}),a?(0,i.jsx)(br,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/All_Access.png) no-repeat`,backgroundSize:"cover",left:"133px",position:"absolute",top:"80px"},height:143,width:27}):(0,i.jsxs)(Ra,{css:{gap:"2px",left:"133px",position:"absolute",top:"80px"},direction:"column",children:[(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Ponton.png`,visible:r.includes("PVG")}),(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Media.png`,visible:r.includes("PCM")}),(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/PC_Course.png`,visible:r.includes("PCC")}),(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Equipage.png`,visible:r.includes("ZE")}),(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Cafe_de_Presse.png`,visible:r.includes("CAF")})]}),(0,i.jsxs)(Ra,{css:{gap:"2px",left:"164px",position:"absolute",top:"80px"},direction:"column",children:[(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Hospitalite.png`,visible:r.includes("VH")}),(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/24h.png`,visible:r.includes("H24")}),(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Regie_TV.png`,visible:r.includes("TV")}),(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Couloir_Ponton.png`,visible:r.includes("COU")}),(0,i.jsx)(k_,{url:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Passerrelle.png`,visible:r.includes("PAS")})]})]})},E_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=w_(t),o=n.fields?.cf37884?.value||[],r=jg(n.fields,"population",""),a=n.fields?.cf37926?.value??"";return(0,i.jsxs)(Ra,{css:{background:`url(${l=o,l.some(e=>e.includes("Anglais"))?`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/contremarque/contremarque_en.jpg`:`${D.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/contremarque/contremarque_fr.jpg`}) no-repeat`,backgroundSize:"cover",color:"#231c45",fontFamily:"$poppins",position:"relative"},height:Hm,width:qm,children:[(0,i.jsx)(br,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",textTransform:"uppercase",top:"68px"},children:r}),(0,i.jsx)(br,{css:{fontSize:"18px",left:"431px",position:"absolute",top:"99px"},children:a}),(0,i.jsx)(br,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",top:"172px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",top:"201px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(br,{css:{fontSize:"18px",left:"431px",position:"absolute",top:"238px"},children:s}),(0,i.jsx)(br,{css:{position:"absolute",right:"60px",top:"64px"},height:84,width:84,children:(0,i.jsx)("img",{height:"100%",src:sg(t.ticketId,{height:84,width:84}),width:"100%"})}),(0,i.jsx)(br,{css:{fontSize:"9px",fontWeight:"700",position:"absolute",right:"60px",top:"150px"},children:t.ticketId})]});var l};function T_(e,t,n,s){switch(e){case ge.Animajeconvention:return(0,i.jsx)(lg,{event:t});case ge.Asoassignment:return(0,i.jsx)(vg,{date:s,event:t,options:n});case ge.Cerclestaff:return(0,i.jsx)(Rg,{event:t});case ge.Cerclelivraison:return(0,i.jsx)(Eg,{event:t});case ge.Cerclepressandpartenaire:return(0,i.jsx)(zg,{event:t});case ge.Cercleopcom:return(0,i.jsx)(Tg,{event:t});case ge.Delta:return(0,i.jsx)(Dg,{event:t});case ge.Dfcoa4:return(0,i.jsx)(Ng,{event:t});case ge.Dfcosmall:return(0,i.jsx)(Vg,{event:t});case ge.Eurockeennes:return(0,i.jsx)(Xg,{event:t});case ge.Fcg:return(0,i.jsx)(tp,{event:t});case ge.Garorockplanning:return(0,i.jsx)(ip,{event:t});case ge.Goldencoast:return(0,i.jsx)(op,{event:t});case ge.Hbcldc:return(0,i.jsx)(dp,{event:t});case ge.Hbclnh:return(0,i.jsx)(mp,{event:t});case ge.Lnh:return(0,i.jsx)(fp,{event:t});case ge.Moorea:return(0,i.jsx)(xp,{event:t});case ge.Nuitssecretes:return(0,i.jsx)(_p,{event:t});case ge.Openbrest:return(0,i.jsx)(vp,{event:t});case ge.P2nassignment:return(0,i.jsx)(Tp,{event:t});case ge.P2nassignmentmontagedemontage:return(0,i.jsx)(Op,{event:t});case ge.P2nbadge:return(0,i.jsx)($p,{event:t});case ge.Paris20km:return(0,i.jsx)(Np,{event:t});case ge.Paris20kmassignment:return(0,i.jsx)(Bp,{date:s,event:t});case ge.Paris20kmcontremarque:return(0,i.jsx)(Vp,{event:t});case ge.Pastourelle:return(0,i.jsx)(_x,{event:t});case ge.Pastourelleexposant:return(0,i.jsx)(bx,{event:t});case ge.Pec:return(0,i.jsx)(kx,{event:t,options:n});case ge.Playground:return(0,i.jsx)(Tx,{event:t});case ge.Roiarthur:return(0,i.jsx)(zx,{event:t});case ge.Rose:return(0,i.jsx)(Px,{event:t});case ge.Roseparking:return(0,i.jsx)(Fx,{event:t});case ge.Salamandre:return(0,i.jsx)(Hx,{event:t});case ge.T24assignment:return(0,i.jsx)(Qx,{event:t,options:n});case ge.Triathlonlarochellebadge:return(0,i.jsx)(n_,{event:t});case ge.Utopialesimprimeur:return(0,i.jsx)(r_,{event:t});case ge.Utopialesa4:return(0,i.jsx)(s_,{event:t});case ge.Vandbcontremarque:return(0,i.jsx)(u_,{event:t});case ge.Vannes:return(0,i.jsx)(g_,{event:t});case ge.Vannesassignment:return(0,i.jsx)(j_,{event:t});case ge.Vendanges:return(0,i.jsx)(y_,{event:t});case ge.Vendeeglobebadge:return(0,i.jsx)(S_,{event:t});case ge.Vendeeglobecontremarque:return(0,i.jsx)(E_,{event:t});default:return nl()}}function z_(e){switch(e){case ge.Animajeconvention:return"Animaje Convention";case ge.Asoassignment:return"Fiche d'affectation ASO";case ge.Cerclestaff:return"Cercle Staff & Visiteurs";case ge.Cerclelivraison:return"Cercle Livraison";case ge.Cerclepressandpartenaire:return"Cercle Press & Partenaire";case ge.Cercleopcom:return"Cercle OPCom";case ge.Delta:return"Badge Delta";case ge.Dfcoa4:return"Badge Dijon DFCO A4";case ge.Dfcosmall:return"Badge Dijon DFCO Carte";case ge.Eurockeennes:return"Planning Les Eurockéennes";case ge.Fcg:return"Accréditation FCG";case ge.Garorockplanning:return"Planning Garorock";case ge.Goldencoast:return"Badge Golden Coast";case ge.Hbcldc:return"Badge HBC Ligue des Champions";case ge.Hbclnh:return"Badge HBC LNH";case ge.Lnh:return"Badge LNH";case ge.Moorea:return"Badge Moorea";case ge.Nuitssecretes:return"Badge Nuits Secrètes";case ge.Openbrest:return"Badge Open de Brest";case ge.P2nassignment:return"Fiche d'affectation P2N (Exploit)";case ge.P2nassignmentmontagedemontage:return"Fiche d'affectation P2N (Montage/Démontage)";case ge.P2nbadge:return"Badge P2N";case ge.Paris20km:return"Badge 20km de Paris";case ge.Paris20kmassignment:return"Fiche d'affectation 20km de Paris";case ge.Paris20kmcontremarque:return"Contremarque 20km de Paris";case ge.Pastourelle:return"Badge Pastourelle bénévoles";case ge.Pastourelleexposant:return"Badge Pastourelle staffs";case ge.Pec:return"Badge Paris Entertainment Company";case ge.Playground:return"Fiche d'affectation Playground";case ge.Roiarthur:return"Badge Roi Arthur";case ge.Rose:return"Contremarque Rose Festival";case ge.Roseparking:return"Rose Festival Pass Parking";case ge.Salamandre:return"Badge Salamandre";case ge.T24assignment:return"Fiche d'affectation T24";case ge.Triathlonlarochellebadge:return"Badge Triathlon la Rochelle";case ge.Utopialesimprimeur:return"Badge Utopiales (version imprimeur)";case ge.Utopialesa4:return"Badge Utopiales (version A4)";case ge.Vandbcontremarque:return"V and B Fest' Convocation";case ge.Vannes:return"Badge Marathon de Vannes";case ge.Vannesassignment:return"Fiche d'affectation Marathon de Vannes";case ge.Vendanges:return"Badge Les Vendanges Musicales";case ge.Vendeeglobebadge:return"Badge Vendée Globe";case ge.Vendeeglobecontremarque:return"Contremarque Vendée Globe";default:return nl()}}function O_(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 R_(e){switch(e){case $e.Archived:case $e.Done:return"error";case $e.Ongoing:return"success";case $e.Upcoming:return"purple";default:return nl()}}function $_(e,t){const n=Bs.c9.now().setZone("utc",{keepLocalTime:!0}).startOf("day");return Bs.IX.fromDateTimes(e.startOf("day"),t.endOf("day")).contains(n)?n:e}const D_=e=>{const{translate:t}=cl(),{mutate:n}=function(e={}){return Kn("mutation BackofficeEventUnarchive($eventId: EventId!) {\n backofficeEventUnarchive(eventId: $eventId)\n}\n",e)}();return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{width:100,children:e.event.id}),(0,i.jsx)(yc,{children:(0,i.jsx)(Vc,{to:Bi.EVENT({organizationId:e.organizationId,eventId:e.event.id}),children:e.event.name})}),(0,i.jsx)(yc,{children:(0,i.jsx)(Jd,{color:R_(e.event.state),children:t(e.event.state)})}),(0,i.jsx)(yc,{children:e.event.state===$e.Archived&&(0,i.jsx)(jl,{color:"invisible",onClick:async()=>{await n({eventId:e.event.id}),e.reload()},children:t("d_sarchiver_76082")})})]})},P_=e=>{const{history:t,translate:n}=cl(),s=Rc(),o=Gn(Um),r=Gn(Da),{mutate:a}=function(e={}){return Kn("mutation BackofficeOrganizationUpdate(\n $id: OrganizationId!\n $organization: BackofficeOrganizationInput!\n) {\n backofficeOrganizationUpdate(id: $id, organization: $organization) {\n id\n }\n}\n",e)}(),[l,d,c]=Pc(""),[u,h]=(0,M.useState)([]),[g,p]=(0,M.useState)({direction:vt.Asc,attribute:Re.Name}),[f,x]=(0,M.useState)(0),{data:_,isLoading:I,reload:v}=Yn("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:m(d)?d:void 0,states:eo(u)?u:void 0,sort:g,offset:f},[]);const{numberOfPages:b,totalCount:j}=vu(_.backoffice?.events),C=(0,M.useMemo)(()=>(0,ch.A)(D.ADMINS.concat(e.organization.users).map(e=>({id:e.id,name:e.email})),({id:e})=>e),[e.organization]),y=(0,M.useMemo)(()=>(0,ic.A)(Jt.map(e=>({value:e,name:z_(e)})),({name:e})=>e),[]),k=e=>{p(e),x(0)};return(0,i.jsx)(fl,{height:1,hideDefaultErrors:!0,initialValues:{organization:o.organizationInputDefault(e.organization)},render:({form:t,handleSubmit:o,submitting:r})=>(0,i.jsx)(zm,{button:(0,i.jsx)(jl,{isLoading:r,textAlign:"center",onClick:o,children:n("mettre_jour_l_12499")}),category:"Backoffice",fallbackClosePath:Os.BACKOFFICE_ORGANIZATIONS,title:n("mise_jour_de_17055",e.organization.name),children:(0,i.jsxs)(Em,{children:[(0,i.jsx)(hl,{}),(0,i.jsxs)(Om,{children:[(0,i.jsx)(Rl,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Dm,{label:n("date_de_fin_de_17750"),name:"organization.periodEndAt"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("fonctionnalit_s_47714"),multiple:!0,name:"organization.features",children:ln.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Mm,{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)(Ba,{height:"4"}),(0,i.jsx)(Mm,{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)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:n("id_de_l_organis_67465"),name:"organization.weezeventOrganizationId",rightIcon:"xmark",shouldParseAsInt:!0,onRightIconClick:()=>{t.change("organization.weezeventOrganizationId",null)}}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)($m,{name:"organization.isBlocked",children:n("bloquer_l_organ_81103")})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Rm,{hideToggle:!0,initialIsOpen:!0,title:n("facturation_53594"),children:[(0,i.jsx)(Bm,{name:"organization.useOldBilling",children:n("utilise_l_ancie_40491")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Rl,{label:n("nombre_de_membr_16400"),name:"organization.membersLimit",shouldParseAsInt:!0}),(0,i.jsx)(Fm,{label:n("prix_par_membre_20633"),name:"organization.pricePerMember"})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{children:n("nombre_de_membr_20439",e.organization.membersStats.numberOfMembers)}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{children:n("nombre_de_membr_54470",e.organization.membersStats2024.numberOfMembers)}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Lm,{label:n("commentaire_sur_40207"),name:"organization.billingComment"})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,title:n("Event"),children:(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsx)(fc,{isSelectAllVisible:!0,multiple:!0,placeholder:n("status_06428"),values:u,onChange:e=>{h(e),x(0)},children:s(an)})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:n("rechercher_un_40024"),value:l,onChange:e=>{c(e),x(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{width:100,children:"ID"}),(0,i.jsx)(mm,{attribute:Re.Name,setSort:k,sort:g,children:n("nom_de_l_v_nem_08711")}),(0,i.jsx)(Fc,{children:n("status_06428")}),(0,i.jsx)(Fc,{})]}),numberOfPages:b,offset:f,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):_.backoffice.events.nodes.map(t=>(0,i.jsx)(D_,{event:t,organizationId:e.organization.id,reload:v},t.id)),setOffset:x,title:n("liste_des_v_ne_29929"),totalCount:j})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{isLoading:r,textAlign:"center",onClick:o,children:n("mettre_jour_l_12499")})})]})}),validate:r.validateForForm(o.updateOrganizationSchema()),width:1,onSubmit:async n=>{await a({id:e.organization.id,organization:n.organization}),t.goBack(Os.BACKOFFICE)}})},F_=()=>{const{organizationId:e}=Zn(),{data:t,loader:n}=Yn(Fr,{organizationId:e},[Ms.OrganizationBackofficeFragment]);return n||(0,i.jsx)(P_,{organization:t.data.row})},M_=()=>(Td(Hn()("back_office_83072")),(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:Os.BACKOFFICE_ORGANIZATIONS,children:(0,i.jsx)(wm,{})}),(0,i.jsx)(Cr.qh,{exact:!0,path:Os.EDIT_BACKOFFICE_ORGANIZATION(":organizationId"),children:(0,i.jsx)(F_,{})}),(0,i.jsx)(Cr.qh,{exact:!0,path:Os.BACKOFFICE_INVOICES,children:(0,i.jsx)(iu,{})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.BACKOFFICE_ORGANIZATIONS,replace:!0})})]})),N_=hr(Ra,{backgroundColor:"$blueGray900",".amicale-theme &, .volunteers-theme &":{backgroundColor:"white"},".mso-theme &":{backgroundColor:"$cyan"}}),L_=()=>(0,i.jsx)(Yl,{}),B_=M.forwardRef((e,t)=>(0,i.jsxs)(N_,{ref:t,align:"stretch",css:{overflow:"auto",padding:"$6"},justify:"between",width:1,children:[(0,i.jsx)(br,{width:100}),(0,i.jsxs)(Ra,{align:"stretch",css:{height:"fit-content",py:"$2",width:"920px"},direction:"column",gap:"6",children:[(0,i.jsx)(Ra,{css:{marginBottom:"$7","& svg":{height:"100%"}},height:32,justify:"center",children:(0,i.jsx)(L_,{})}),e.children]}),(0,i.jsx)(Ra,{justify:"end",width:100,children:(0,i.jsx)(jl,{color:"gray",leftIcon:"xmark",onClick:e.onClose})})]}));B_.displayName="OnboardingView";const V_=["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 U_(e){return"string"!=typeof e||""===e.trim()||c(e.toLowerCase())===e}const W_=["country","code","number"];let G_=class extends Pl{countriesService;constructor(e,t){super(e),this.countriesService=t}basePhoneInputDefault(){return{country:"",code:"",number:""}}phoneInputDefault(e){return{...this.basePhoneInputDefault(),...e.phone}}phoneInputSchema(){return d.Ik().shape({country:d.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.countriesCodes,this.t("le_num_ro_de_t_76885")),code:d.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.phoneCodes,this.t("le_num_ro_de_t_76885")),number:d.Yj().required(this.t("le_num_ro_de_t_76885"))})}phoneInputSchemaNotRequired(){return d.Ik().nullable().shape({country:d.Yj(),code:d.Yj(),number:d.Yj()})}};G_=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn,su])],G_);let H_=class extends Pl{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=d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),adminFirstName:d.Yj().required(this.t("le_pr_nom_est_r_10935")),adminLastName:d.Yj().required(this.t("le_nom_est_requ_61536")),adminPhone:this.phoneInputService.phoneInputSchema()});return e||(t=t.shape({termsAccepted:d.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})),t}createOrganizationSchema(e){return d.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??Bs.c9.local().zoneName,emailSenderId:e.emailSenderId,dateFormat:e.dateFormat,datetimeFormat:e.datetimeFormat,timeFormat:e.timeFormat}}organizationInfosInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),adminName:d.Yj().required(this.t("le_nom_du_respo_43823")),adminEmail:d.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 U_(this.parent.adminEmail)}),street:d.Yj().required(this.t("l_adresse_est_r_40489")),postalCode:d.Yj().required(this.t("le_code_postal_43189")),city:d.Yj().required(this.t("la_ville_est_re_35239")),country:d.Yj().oneOf(this.countriesService.countriesCodes).required(this.t("le_pays_est_req_33749")),emailSenderId:d.ai().nullable(),dateFormat:d.Yj().required(this.t("le_format_est_r_17097")),datetimeFormat:d.Yj().required(this.t("le_format_est_r_17097")),timeFormat:d.Yj().required(this.t("le_format_est_r_17097"))})}updateOrganizationGeneralSchema(){return d.Ik().shape({organization:this.organizationInfosInputSchema()})}};H_=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,G_,Vn])],H_);let q_=class extends Dl{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??Bs.c9.invalid("Invalid"),endAt:e?.endAt??Bs.c9.invalid("Invalid"),languages:e?.languages??[t.user.language],timeZone:e?.timeZone??Bs.c9.local().zoneName??"utc",country:e?.country??t.user.country,layer:e?.layer??Je.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}}eventInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("nom_de_l_v_nem_58512")),description:d.Yj(),startAt:Vm.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:Vm.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 Bs.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Bs.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),languages:d.YO().of(d.Yj().oneOf(hd,this.t("les_langues_doi_27712"))).required(this.t("les_langues_son_53717")).min(1,this.t("vous_devez_s_le_16610")),timeZone:d.Yj().required(this.t("le_fuseau_horai_37109")).oneOf(V_,this.t("le_fuseau_horai_37109")),latitude:d.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:d.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:d.ai().nullable(),dayStartTime:d.Yj().required(this.t("l_heure_laque_87748")),isWeezeventSynchronized:d.zM().required(),usePositions:d.zM().required(),useAccreditations:d.zM().required(),useDelegations:d.zM().required(),useForms:d.zM().required(),useDocuments:d.zM().required(),useWorkflows:d.zM().required()})}eventOrganizationInputSchema(e){return d.Ik().shape({event:this.eventInputSchema(),organization:this.organizationInputService.organizationInputSchema(e)})}createUpdateEventSchema(){return d.Ik().shape({event:this.eventInputSchema()})}};q_=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,H_,Vn])],q_);const Y_=e=>{if(0===e.names.length)return e.render(e.fields);{const[t,...n]=e.names;return(0,i.jsx)(Fa.D0,{name:t,render:s=>(0,i.jsx)(Y_,{fields:{...e.fields||{},[t]:s},names:n,render:e.render,subscription:e.subscription}),subscription:e.subscription})}},K_=({value:e,onChange:t,css:n,label:s,state:o,description:r,hint:a,...l})=>{const d=Hn(),u=(0,M.useCallback)(e=>{e&&p(e.getBoundingClientRect().width)},[]),h=(0,M.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[g,p]=(0,M.useState)(200),[f,x]=(0,M.useState)(!1),[_,I]=(0,M.useState)(""),v=Gn(su),b=(0,M.useMemo)(()=>(0,ic.A)(v.countries.flatMap(e=>Qs(e.phoneCode).map(t=>({...e,phoneCode:t}))),({name:e})=>c(e)),[]),j=(0,M.useMemo)(()=>b.find(({code:t,phoneCode:n})=>t===e.country&&n===e.code),[e.country,e.code]),C=(0,M.useMemo)(()=>b.filter(e=>!m(_)||e.name.toLowerCase().includes(_.trim().toLowerCase())||e.phoneCode.includes(_.trim())),[b,_]),y=(0,M.useMemo)(()=>C.map((n,s)=>(0,i.jsx)(Nd,{onClick:()=>{t({...e,country:n.code,code:n.phoneCode}),I(""),x(!1)},children:(0,i.jsxs)(Ra,{gap:"2",width:1,children:[(0,i.jsx)(br,{children:n.emoji}),(0,i.jsx)(br,{css:{ellipsis:!0},children:n.name}),(0,i.jsx)(br,{color:"gray500",children:n.phoneCode})]})},s)),[C,e,t]),{inputId:k,descId:A,errorId:w}=Na();return(0,i.jsxs)(Ra,{ref:u,css:n,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:k,children:s}),(0,i.jsx)(wl,{id:A,children:r}),(s||r)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{children:[(0,i.jsxs)(Pd,{isOpen:f,onStateChange:e=>x(e),children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(zl,{css:{borderRight:"none",borderBottomRightRadius:"0",borderTopRightRadius:"0",userSelect:"none",width:"100px","& .styled-input-container-circle-exclamation":{display:"none"}},cursor:"pointer",rightIcon:f?"chevron-up":"chevron-down",state:o,children:j&&(0,i.jsxs)(br,{width:1,children:[j.emoji," ",j.phoneCode]})})}),(0,i.jsx)(Vd,{placement:"bottom-start",renderOnPortal:!0,width:g,children:(0,i.jsxs)(Ra,{direction:"column",height:Math.min(201,40*C.length+41),width:1,children:[(0,i.jsx)(br,{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:h,"aria-label":d("indicatif_t_l_p_02025"),placeholder:d("rechercher_un_p_04678"),type:"text",value:_,onChange:e=>{I(e.target.value)}})}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ra,{css:{height:"calc(100% - 41px)",overflowY:"auto"},direction:"column",children:y})]})})]}),(0,i.jsx)(zl,{css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0",flex:"1"},cursor:"text",state:o,children:(0,i.jsx)(br,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},children:(0,i.jsx)("input",{"aria-describedby":r?A:void 0,"aria-errormessage":"error"===o?w:void 0,"aria-invalid":"error"===o,autoComplete:"tel-national",disabled:"disabled"===o,id:k,type:"tel",value:e.number,onChange:n=>{t({...e,number:n.target.value})},...l})})})]}),(0,i.jsx)(Sl,{id:w,state:o,children:a})]})},Z_=(0,M.memo)(function({prefix:e,hint:t,state:n,...s}){const o=`${e}country`,r=`${e}code`,a=`${e}number`;return(0,i.jsx)(Y_,{names:[o,r,a],render:e=>{const l=kl(e[r].meta)||kl(e[a].meta);return(0,i.jsx)(K_,{hint:l?e[r].meta.error||e[a].meta.error:t,state:l?"error":n,value:{country:e[o].input.value,code:e[r].input.value,number:e[a].input.value},onChange:t=>{e[o].input.onChange(t.country),e[r].input.onChange(t.code),e[a].input.onChange(t.number)},...s})}})}),X_=(0,M.memo)(function(){const e=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rl,{label:e("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Rl,{label:e("pr_nom_66988"),name:"organization.adminFirstName"}),(0,i.jsx)(Rl,{label:e("last_name"),name:"organization.adminLastName"})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Z_,{label:e("Phone"),prefix:"organization.adminPhone."})]})}),J_=()=>{const e=Hn(),{user:t}=ni();return(0,i.jsx)($m,{name:"organization.termsAccepted",children:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("en_cr_ant_votre_88363",xd(gd(t?.language,new URL(location.href).searchParams)),pd)}})})},Q_=e=>{const t=Hn(),n=Bs.c9.utc(),{event:s}=e.values;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"event.startAt",children:t=>{t.isValid&&!1===e.form.getFieldState("event.endAt").touched&&e.form.change("event.endAt",t)}}),(0,i.jsx)(Rl,{label:t("nom_de_l_v_nem_08711"),name:"event.name"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)(Dm,{label:t("date_de_d_but_43380"),min:n,name:"event.startAt"}),(0,i.jsx)(Dm,{label:t("date_de_fin_86920"),min:s.startAt&&s.startAt.isValid?s.startAt:n,name:"event.endAt"})]})]})},eI=()=>{const{translate:e,params:{weezeventOrganizationId:t}}=cl(),n=Gn(q_),s=Gn(H_),o=Gn(Da),{mutate:r}=function(e={}){return Kn("mutation EventOrganizationCreate($eventOrganization: EventOrganizationInput!) {\n eventOrganizationCreate(eventOrganization: $eventOrganization) {\n id\n organizationId\n }\n}\n",e)}({redirectOnSuccess:!0}),a=Xn(),l=(0,M.useRef)(null),d=!!ni().user?.termsAcceptedAt;return(0,i.jsx)(fl,{customErrorRef:l,height:1,initialValues:{event:n.eventInputDefault(),organization:s.organizationInputDefault(t)},render:({form:t,values:n,handleSubmit:s})=>(0,i.jsxs)(B_,{ref:l,onClose:K,children:[(0,i.jsx)(hl,{}),(0,i.jsx)(Rm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:e("param_trer_votr_94121"),title:e("dites_en_nous_u_13238"),children:(0,i.jsx)(Q_,{form:t,values:n})}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,subtitle:e("ajouter_le_nom_69919"),title:e("_propos_de_vot_88855"),children:(0,i.jsx)(X_,{})}),(0,i.jsxs)(Om,{children:[!d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(J_,{}),(0,i.jsx)(Ba,{height:"4"})]}),(0,i.jsx)(jl,{textAlign:"center",onClick:s,children:e("cr_er_l_v_neme_16731")})]})]}),validate:o.validateForForm(n.eventOrganizationInputSchema(d)),width:1,onSubmit:async e=>{const{eventOrganizationCreate:{id:t,organizationId:n}}=await r({eventOrganization:e});a.push(Bi.EVENT({organizationId:n,eventId:t}))}})},tI=()=>{const{data:e,loader:t}=Yn("query HomeOrganizations {\n user {\n roles {\n organizationId\n }\n }\n}\n",{},[]),n=Xn();return(0,i.jsx)(yd,{loader:t,onLoad:()=>{const t=e.user?.roles?.[0]?.organizationId;t?n.replace(Bi.EVENTS({organizationId:t})):n.replace(Os.CREATE_EVENT_WITH_ORGANIZATION())}})},nI=()=>{const{translate:e,history:t}=cl(),n=Gn(H_),s=Gn(Da),{mutate:o}=function(e={}){return Kn("mutation OrganizationCreate($organization: OrganizationInput!) {\n organizationCreate(organization: $organization) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),r=(0,M.useRef)(null),{user:a}=ni(),l=!!a?.termsAcceptedAt;return(0,i.jsx)(fl,{customErrorRef:r,height:1,hideDefaultErrors:!0,initialValues:{organization:n.organizationInputDefault()},render:({handleSubmit:n})=>(0,i.jsxs)(B_,{ref:r,onClose:()=>t.goBack(Os.BACKOFFICE),children:[(0,i.jsx)(hl,{}),(0,i.jsx)(Rm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:e("ajouter_le_nom_69919"),title:e("_propos_de_vot_88855"),children:(0,i.jsx)(X_,{})}),(0,i.jsxs)(Om,{children:[!l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(J_,{}),(0,i.jsx)(Ba,{height:"4"})]}),(0,i.jsx)(jl,{textAlign:"center",onClick:n,children:e("cr_er_l_organis_55358")})]})]}),validate:s.validateForForm(n.createOrganizationSchema(l)),width:1,onSubmit:async e=>{const{organizationCreate:{id:n}}=await o({organization:e.organization});t.push(Ii.ORGANIZATION({organizationId:n}))}})},iI=({children:e,termsAccepted:t})=>{const{organizationId:n}=Zn(),s=Xn();return t||window.location.pathname.includes(Os.ACCEPT_TERMS_AND_CONDITIONS(n))?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(ei,{path:Os.ACCEPT_TERMS_AND_CONDITIONS(n),state:s.location})};var sI=n(5830);class oI extends sI.Ay{events;forms;organizations;segmentsFolders;constructor(){super("recrewteer"),this.version(6).stores({events:"id",forms:"id",organizations:"id",segmentsFolders:"id"})}}const rI=new oI,aI=M.createContext({}),lI=e=>{const{history:t,params:{organizationId:n}}=cl(),{data:s,loader:o,reload:r}=Yn('query CommonOrganization($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n features\n }\n\n user {\n email\n language\n\n userInfo(organizationId: $organizationId) {\n name\n firstName: fieldValue(slug: "firstName")\n picture {\n url\n }\n }\n }\n}\n',{organizationId:n},[]),a=M.useCallback(e=>!!s.organization&&function(e,t){return e.features.includes(t)}(s.organization,e),[s.organization]);return o||(o||s.organization?(0,i.jsx)(aI.Provider,{value:{user:s.user,hasFeature:a,reload:r},children:e.children}):(setTimeout(()=>{t.replace(Os.HOME)},100),null))},dI=[xt.OrganizationAdmin],cI=[xt.OrganizationAdmin,xt.EventAdmin],uI=[xt.OrganizationAdmin,xt.OrganizationReader],hI=[xt.OrganizationAdmin,xt.OrganizationReader,xt.EventAdmin,xt.EventReader];function mI(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 s=e.usersPositions.some(e=>t===e.roleId&&e.positionId===n.positionId);return i||s}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 gI(e,t,n){const i=n?e.roles.filter(t=>"positionCategoryId"in n||"positionId"in n?t.accessLevel===ft.Position?mI(e,t.id,n):t.accessLevel===ft.Organization||t.accessLevel===ft.Event:"delegationCategoryId"in n?t.accessLevel===ft.DelegationCategory?mI(e,t.id,n):t.accessLevel===ft.Organization||t.accessLevel===ft.Event:"eventId"in n&&(t.accessLevel===ft.Event?mI(e,t.id,n):t.accessLevel===ft.Organization)):e.roles;return t.map(e=>i.some(t=>"1"===t.permissions[e]))}function pI(e,t){return e.roles.filter(e=>e.accessLevel===ft.Organization).some(e=>"1"===e.permissions[t])}const fI=M.createContext({}),xI=e=>{const{history:t,params:{organizationId:n},translate:s}=cl(),{data:o,loader:r,reload:a}=Yn('query Organization($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n id\n name\n periodEndAt\n features\n customBadges\n isBlocked\n key\n weezeventOrganizationId\n\n invoices(state: Overdue) {\n invoiceNumber\n url\n insertedAt\n }\n\n events(sort: { attribute: StartAt, direction: Desc }) {\n nodes {\n id\n name\n state\n weezeventEventId\n }\n }\n\n roles {\n id\n 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 picture {\n url\n }\n }\n }\n}\n',{organizationId:n},[]),{hasFeature:l,reload:d}=M.useContext(aI),[c,h]=M.useState(),[m,g]=M.useState(null),p=M.useCallback(async e=>{const t=(0,Ua.A)(m,{id:n},e);await rI.organizations.put(t),g(t)},[n,m,g]),f=M.useMemo(()=>eo(o.user?.roles??[]),[o.user]),x=M.useMemo(()=>(o.user?.roles??[]).some(e=>e.type===xt.OrganizationAdmin),[o.user]),_=M.useMemo(()=>(o.user?.roles??[]).some(e=>e.type===xt.OrganizationAdmin||e.type===xt.OrganizationReader),[o.user]),I=M.useMemo(()=>o.organization?{organizationRoles:(0,ic.A)(o.organization.roles.filter(e=>e.accessLevel===ft.Organization),e=>u(e.name)),eventRoles:(0,ic.A)(o.organization.roles.filter(e=>e.accessLevel===ft.Event),e=>u(e.name)),delegationCategoryRoles:(0,ic.A)(o.organization.roles.filter(e=>e.accessLevel===ft.DelegationCategory),e=>u(e.name)),positionRoles:(0,ic.A)(o.organization.roles.filter(e=>e.accessLevel===ft.Position),e=>u(e.name))}:{organizationRoles:[],eventRoles:[],delegationCategoryRoles:[],positionRoles:[]},[o.organization]);return M.useEffect(()=>{o.organization&&(async()=>{let e=await rI.organizations.get(n);e||(e={id:n},await rI.organizations.put(e)),g(e)})()},[n,o.organization]),r||(r||o.organization?f?(0,i.jsx)(fI.Provider,{value:{isOrganizationAdmin:x,isOrganizationReader:_,localOrganization:m,organization:o.organization,roles:I,selectedEventId:c,user:o.user,hasPermission:e=>pI(o.user,e),hasPermissions:e=>function(e,t){return t.map(t=>pI(e,t))}(o.user,e),hasFeature:l,reload:()=>{d(),a()},setSelectedEventId:h,updateLocalOrganization:p},children:(0,i.jsx)(iI,{termsAccepted:null!==o.user.termsAcceptedAt,children:e.children})}):(0,i.jsx)(Qc,{size:"sm",onClose:Hl.A,children:(0,i.jsx)(br,{textAlign:"center",children:s("vous_n_avez_pas_23261")})}):(setTimeout(()=>{t.replace(Os.HOME)},100),null))};function _I(){return M.useContext(fI)}const II=e=>{const t=Hn();return(0,i.jsxs)(Ra,{align:"center",direction:"column",children:[(0,i.jsx)(Ra,{align:"center",css:{background:"$primary500",borderRadius:"48px",fontSize:"$textXl",color:"white",height:"48px",width:"48px"},justify:"center",children:(0,i.jsx)(Ya,{icon:e.icon})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textMd",children:e.title||t("la_fonctionnali_59786")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:e.subtitle||t("si_vous_voulez_24448")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(jl,{to:`mailto:${D.EMAIL_FROM}`,children:t("contacter_l_qu_16617")})]})},vI={PLURAL:"campaigns",SINGLE:"campaign"},bI={CAMPAIGNS:vI.PLURAL,CAMPAIGN:e=>oi([vI.SINGLE,e])},jI={CAMPAIGNS:({organizationId:e,eventId:t})=>oi([t?Bi.EVENT({organizationId:e,eventId:t}):ji.COMMUNITY({organizationId:e}),bI.CAMPAIGNS]),CAMPAIGNS_SEGMENT:({organizationId:e,segmentId:t})=>oi([jI.CAMPAIGNS({organizationId:e}),t]),CAMPAIGN:({organizationId:e,eventId:t,campaignId:n})=>oi([t?Bi.EVENT({organizationId:e,eventId:t}):ji.COMMUNITY({organizationId:e}),bI.CAMPAIGN(n)]),CAMPAIGN_DASHBOARD:e=>oi([jI.CAMPAIGN(e),di.DASHBOARD]),CAMPAIGN_PREVIEW:({userInfoId:e,...t})=>oi([jI.CAMPAIGN(t),di.PREVIEW,e]),CREATE(e){const t=ui(jI.CAMPAIGNS(e));return e.options?`${t}/${e.options}`:t},CREATE_TEMPLATE:e=>oi([ui(jI.CAMPAIGNS(e)),"template"]),UPDATE:e=>hi(jI.CAMPAIGN(e))},CI={PLURAL:"members",SINGLE:"member"},yI={PLURAL:"profiles",SINGLE:"profile"},kI="accreditations",AI="actions",wI="availabilities",SI="campaigns",EI="comments",TI="documents",zI="events",OI="history",RI="informations",$I="messages",DI="positions",PI="forms",FI="form",MI="scans",NI=e=>oi([CI.SINGLE,e]),LI=e=>oi([yI.SINGLE,e]),BI={USER_PROFILE:({userInfoId:e,...t})=>oi([Ii.ORGANIZATION(t),LI(e)]),USER_PROFILES:e=>oi([Ii.ORGANIZATION(e),yI.PLURAL]),MEMBERS:e=>oi(["delegationId"in e?as.DELEGATION(e):"eventId"in e&&e.eventId?Bi.EVENT(e):ji.COMMUNITY(e),CI.PLURAL]),MEMBER:({userInfoId:e,...t})=>oi(["eventId"in t&&t.eventId?Bi.EVENT(t):ji.COMMUNITY(t),NI(e)]),MEMBER_INFORMATION:e=>oi([BI.MEMBER(e),RI]),MEMBER_ACTIONS:e=>oi([BI.MEMBER(e),AI]),MEMBER_AVAILABILITIES:e=>oi([BI.MEMBER(e),wI]),MEMBER_COMMENTS:e=>oi([BI.MEMBER(e),EI]),MEMBER_HISTORY:e=>oi([BI.MEMBER(e),OI]),MEMBER_HISTORY_CAMPAIGNS:e=>oi([BI.MEMBER(e),OI,SI]),MEMBER_HISTORY_EVENTS:e=>oi([BI.MEMBER(e),OI,zI]),MEMBER_HISTORY_FORMS:e=>oi([BI.MEMBER(e),OI,PI]),MEMBER_HISTORY_SCANS:e=>oi([BI.MEMBER(e),OI,MI]),MEMBER_POSITIONS:e=>oi([BI.MEMBER(e),DI]),MEMBER_ACCREDITATIONS:e=>oi([BI.MEMBER(e),kI]),MEMBER_FORMS:e=>oi([BI.MEMBER(e),PI]),MEMBER_FORM:e=>oi([BI.MEMBER(e),FI,e.formId]),MEMBER_FORM_EDIT:e=>hi(BI.MEMBER_FORM(e)),MEMBER_MESSAGES:e=>oi([BI.MEMBER(e),$I]),MEMBER_DOCUMENTS:e=>oi([BI.MEMBER(e),TI]),CREATE:e=>ui(BI.MEMBERS(e))},VI={PLURAL:"workflows",SINGLE:"workflow"},UI=e=>oi([VI.SINGLE,e]),WI={WORKFLOWS:({eventId:e,...t})=>oi([e?Bi.EVENT({...t,eventId:e}):ji.COMMUNITY(t),VI.PLURAL]),WORKFLOW:({workflowId:e,eventId:t,...n})=>oi([t?Bi.EVENT({...n,eventId:t}):ji.COMMUNITY(n),UI(e)]),CREATE:e=>ui(WI.WORKFLOWS(e)),UPDATE:e=>hi(WI.WORKFLOW(e))};var GI;!function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList"}(GI||(GI={}));const HI=[GI.Assignments,GI.Badge,GI.Certificate,GI.UserHours,GI.UserPlanning,GI.UserPlanningDays,GI.UserPlanningList];function qI(e){let t=e;try{t=new URL(e).pathname}catch{}if(m(t)){const e=t.split(/[\\/]/).pop(),n=e.lastIndexOf(".");let i=e,s="";return n>=0&&(i=e.substring(0,n),s=e.substring(n+1).toLowerCase()),{path:t,name:i,extension:s}}return{path:"",name:"",extension:""}}const YI=["jpg","png","jpeg","gif"];var KI;!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"}(KI||(KI={}));const ZI=e=>{switch(e.toLowerCase()){case"csv":return KI.Csv;case"xls":case"xlsx":return KI.Excel;case"gif":return KI.Gif;case"jpg":case"jpeg":return KI.Jpeg;case"pdf":return KI.Pdf;case"png":return KI.Png;case"zip":return KI.Zip;default:return KI.Default}};function XI(e,t){const n=document.createElement("a");n.href=e,n.target="_blank",n.download=t,n.click()}async function JI(e,t,n,i){const s=await q(),{awsS3PostCredentials:{endpointUrl:o,policy:r,amzCredential:a,amzSignature:l,amzDate:d}}=await function(e,t){return co("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},s),{name:c,extension:u}=qI(t.name),m=`organization/${e}/${L()}/${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",ZI(u)),g.append("file",t),new Promise((e,s)=>{const r=new XMLHttpRequest;r.upload.onprogress=e=>{if(e.lengthComputable){const t=Math.round(e.loaded/e.total*100);i?.(t)}},r.onerror=()=>{s(new Error("Could not upload file to S3"))},r.onreadystatechange=()=>{if(4===r.readyState){const i=r.responseXML?.querySelector("Error Code");null!==i?(si("Could not upload file to S3",{code:i?.textContent??"",message:r.responseXML?.querySelector("Error Message")?.textContent??""}),s(new Error("Could not upload file to S3"))):e({acl:n,key:m,name:t.name,size:t.size})}},r.open("POST",o,!0),r.send(g)})}function QI(e,t){return`https://${t}.s3-eu-west-1.amazonaws.com/${e.key}`}function ev(e){return new Promise((t,n)=>{!function(e,n,i){const s=document.createElement("script");s.onload=()=>{t(!0)},s.onerror=()=>{i&&i()},s.src=e,document.body.appendChild(s)}(e,0,()=>{n(new Error(`Could not load ${e}`))})})}function tv(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 nv=hr("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"}}}}),iv=hr("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 sv;!function(e){e[e.EmptyFile=0]="EmptyFile",e[e.Pdf=1]="Pdf",e[e.Image=2]="Image"}(sv||(sv={}));class ov extends M.Component{contentRef;renderPagesDebounced;constructor(e){super(e);let t=sv.Image;"string"!=typeof this.props.fileUrl||0===this.props.fileUrl.trim().length?t=sv.EmptyFile:"pdf"===qI(this.props.fileUrl).extension&&(t=sv.Pdf),this.state={image:null,isLoading:!0,fileType:t,pdf:null,rotate:0,zoomLevel:100},this.renderPagesDebounced=(0,$c.A)(()=>{this.renderPdfPages()},200),this.contentRef=M.createRef()}componentDidMount(){var e;this.state.fileType===sv.Pdf?(e=this.props.fileUrl,(void 0===window.pdfjsLib?ev("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===sv.Image&&this.loaderImage()}renderPdfPages(){this.state.fileType===sv.Pdf&&async function(e,t,n,i){Array.from(t.childNodes).forEach(e=>{t.removeChild(e)});for(let s=1;s<=e.numPages;s++){const o=await e.getPage(s),r=o.getViewport(n),a=document.createElement("div"),l=document.createElement("canvas"),d=l.getContext("2d"),c=tv(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),o.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===sv.Image){const e=new Image;e.onload=()=>{const t=this.contentRef.current.getBoundingClientRect(),n=t.height/e.height,i=t.width/e.width,s=Math.min(n,i);let o=100;s<1&&(o=100*(s-.1*s)),this.setState({image:e,isLoading:!1,zoomLevel:o})},e.onerror=()=>{this.setState({isLoading:!1,fileType:sv.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)(Wn,{children:({container:e})=>{const t=e.get(Vn);return(0,i.jsxs)(Ra,{css:{position:"relative"},direction:"column",height:1,width:1,children:[(0,i.jsx)(br,{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===sv.Image&&!1===this.state.isLoading&&(0,i.jsx)(br,{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`,...tv(this.state.rotate,this.imageHeight(),this.imageWidth())}})}),!0===this.state.isLoading&&(0,i.jsx)(br,{css:{background:"white",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"10"},children:(0,i.jsx)(_l,{})}),this.state.fileType===sv.EmptyFile&&(0,i.jsx)(Ra,{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)(Ra,{align:"center",css:{height:"50px",width:"100%"},justify:"center",children:[(0,i.jsxs)(nv,{controls:!0,children:[(0,i.jsx)("i",{className:"fas fa-minus",onClick:this.zoomMinus.bind(this)}),(0,i.jsx)(iv,{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)(nv,{rotate:!0,onClick:this.rotate.bind(this),children:(0,i.jsx)("i",{className:"far fa-undo"})})]})]})}})}}const rv=({acl:e,document:t,onDelete:n,...s})=>{const[o,r]=(0,M.useState)(!1),a=jc(),l="public-read"===e||m(t.url),d=m(t.url)?t.url:QI(t,D.HEAVENT_AWS_UPLOADS_BUCKET);return(0,i.jsxs)(Ra,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",fontSize:"$textSm",overflow:"hidden",padding:"$3",minHeight:"72px","@tablet":{border:"1px solid $gray300",borderRadius:"$2",fontSize:"$textMd",padding:"$3"}},gap:"4",width:1,...a&&{onClick:()=>{XI(d,t.name)}},...s,children:[(0,i.jsx)(Ra,{css:{flex:"1",minHeight:0,overflow:"hidden"},children:(0,i.jsx)(br,{color:{"@initial":"gray800","@tablet":"gray700"},css:{ellipsis:!0},width:1,children:t.name})}),l&&(0,i.jsxs)(i.Fragment,{children:[!1===a&&(0,i.jsx)(br,{css:{cursor:"pointer"},onClick:()=>{r(!0)},children:(0,i.jsx)(Ya,{icon:"eye"})}),(0,i.jsx)(br,{css:{cursor:"pointer"},...!1===a&&{onClick:()=>{XI(d,t.name)}},children:(0,i.jsx)(Ya,{icon:"download"})})]}),n&&(0,i.jsx)(br,{css:{cursor:"pointer"},onClick:n,children:(0,i.jsx)(Ya,{icon:"trash-can"})}),o&&(0,Wt.createPortal)((0,i.jsx)(Ra,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"250"},height:1,width:1,children:(0,i.jsx)(zm,{title:t.name,onClose:()=>r(!1),children:(0,i.jsx)(ov,{fileUrl:d})})}),document.body)]})},av=({name:e,progress:t,...n})=>{const s=Math.min(100,Math.max(0,t));return(0,i.jsxs)(Ra,{css:{border:"1px solid $gray300",borderRadius:"$2",padding:"$4"},direction:"column",width:1,...n,children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"regular",children:e}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(br,{css:{background:"$gray100",borderRadius:"$1",flex:"1",height:"8px",position:"relative"},children:(0,i.jsx)(br,{css:{background:"$success500",borderRadius:"$1",height:"100%",left:0,position:"absolute",top:0,width:`${s}%`}})}),(0,i.jsxs)(br,{color:"gray700",children:[s,"%"]})]})]})};var lv,dv=n(3112);function cv(e){return Qs(e).flatMap(e=>{switch(e){case lv.Archives:return["zip"];case lv.Csv:return["csv"];case lv.Gpx:return["gpx"];case lv.Images:return["jpg","png","jpeg","gif"];case lv.Kml:return["kml"];case lv.Pdf:return["pdf"];default:return nl()}})}function uv(e){return Qs(e).flatMap(e=>e===lv.Images?"image/*":cv(e).map(e=>`.${e}`)).join(",")}n(8181),function(e){e[e.Archives=0]="Archives",e[e.Csv=1]="Csv",e[e.Gpx=2]="Gpx",e[e.Images=3]="Images",e[e.Kml=4]="Kml",e[e.Pdf=5]="Pdf"}(lv||(lv={}));var hv=n(9618);const mv=({allowCrop:e,onChange:t,hint:n,label:s,...o})=>{const r=Hn(),a=(0,M.useRef)(null),[l,d]=(0,M.useState)(!1),[c,u]=(0,M.useState)(null),[h,m]=(0,M.useState)(!1),g=cv(lv.Images),p=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{u({src:t,type:(0,dv.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}m(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{gap:"4",width:1,children:[(0,i.jsx)(Ra,{align:"center",css:{background:l?"$primary50":"$gray50",border:l?"1px solid $primary300":"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,onClick:()=>{a.current?.click()},onDragEnter:e=>{Al(e),d(!0)},onDragLeave:e=>{Al(e),d(!1)},onDragOver:e=>{Al(e),l||d(!0)},onDrop:n=>{Al(n),d(!1);const i=n.dataTransfer.files.item(0);i&&g.includes(qI(i.name).extension)&&(e?p(n.dataTransfer.files):t(i))},children:(0,i.jsx)(Ra,{align:"center",css:{background:l?"$primary100":"$gray100",borderRadius:"36px",color:l?"$primary600":"$gray600"},height:l?48:32,justify:"center",width:l?48:32,children:(0,i.jsx)(Ya,{icon:"plus"})})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:s}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray400",children:n})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:()=>{a.current?.click()},children:r("s_lectionner_un_50712")})})]}),(0,i.jsx)(br,{css:{display:"none"},children:(0,i.jsx)("input",{ref:a,accept:uv(lv.Images),type:"file",onChange:n=>{n.target.files?.[0]&&(e?p(n.target.files):t(n.target.files[0]))},...o})})]}),e&&h&&c&&(0,i.jsx)(gv,{image:c,onChange:t,onClose:()=>m(!1)})]})},gv=({image:e,onChange:t,onClose:n})=>{const s=Hn(),o=(0,M.useRef)(null);return(0,M.useEffect)(()=>()=>{e&&e.src&&URL.revokeObjectURL(e.src)},[e]),(0,i.jsx)(Qc,{size:"md",onClose:n,children:(0,i.jsxs)(Ra,{css:{overflow:"auto"},direction:"column",gap:"3",children:[(0,i.jsx)(hv.IOb,{ref:o,className:"cropper",defaultSize:({imageSize:e,visibleArea:t})=>({width:(t||e).width,height:(t||e).height}),src:e.src,stencilProps:{aspectRatio:1}}),(0,i.jsx)(jl,{size:"lg",textAlign:"center",onClick:()=>{const i=o.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:s("submit_21373")})]})})},pv=({accept:e,allowCrop:t,capture:n,onChange:s,...o})=>{const r=Hn(),a=(0,M.useRef)(null),[l,d]=(0,M.useState)(!1),[c,u]=(0,M.useState)(null),[h,m]=(0,M.useState)(!1),g=cv(e||[]),p=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{u({src:t,type:(0,dv.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}m(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{background:l?"$primary50":"$gray50",border:l?"1px solid $primary300":"1px solid $gray200",borderRadius:"$2",cursor:"pointer",padding:"$4"},direction:"column",width:1,onClick:()=>{a.current?.click()},onDragEnter:e=>{Al(e),d(!0)},onDragLeave:e=>{Al(e),d(!1)},onDragOver:e=>{Al(e),l||d(!0)},onDrop:n=>{Al(n),d(!1);const i=n.dataTransfer.files.item(0);if(i&&(0===g.length||g.includes(qI(i.name).extension)))if(t){if(e!==lv.Images)throw new Error("Crop enabled on non-image file uploader");p(n.dataTransfer.files)}else s(i)},children:[(0,i.jsx)(Ra,{align:"center",css:{background:l?"$primary100":"$gray100",borderRadius:"36px",color:l?"$primary600":"$gray600"},height:l?48:32,justify:"center",width:l?48:32,children:(0,i.jsx)(Ya,{icon:"cloud-arrow-up"})}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsxs)(Ra,{gap:"1",justify:"center",wrap:"wrap",children:[(0,i.jsx)(br,{color:"primary700",fontWeight:"regular",children:r("cliquez_pour_s_77962")}),(0,i.jsx)(br,{color:l?"primary600":"gray500",children:r("ou_glissez_d_po_61590")})]}),g.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:l?"primary600":"gray500",css:{textTransform:"uppercase"},children:g.join(", ")})]}),(0,i.jsx)(br,{css:{width:.1,height:.1,opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},children:(0,i.jsx)("input",{ref:a,accept:e?uv(e):void 0,capture:n,type:"file",onChange:n=>{if(n.target.files?.[0])if(t){if(e!==lv.Images)throw new Error("Crop enabled on non-image file uploader");p(n.target.files)}else s(n.target.files[0])},...o})})]}),t&&h&&c&&(0,i.jsx)(gv,{image:c,onChange:s,onClose:()=>m(!1)})]})};var fv;!function(e){e[e.File=0]="File",e[e.Uploader=1]="Uploader",e[e.Uploading=2]="Uploading"}(fv||(fv={}));const xv=({acl:e,css:t,descId:n,description:s,errorId:o,inputId:r,label:a,labelId:l,hint:d,onChange:c,organizationId:u,state:h,value:m,...g})=>{const p=Hn(),[f,x]=(0,M.useState)(m?fv.File:fv.Uploader),[_,I]=(0,M.useState)(""),[v,b]=(0,M.useState)(0);return(0,i.jsxs)(Ra,{"aria-live":"polite",css:t,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:r,id:l,children:a}),(0,i.jsx)(wl,{id:n,children:s}),(a||s)&&(0,i.jsx)(Ba,{height:"1"}),f===fv.File&&m?(0,i.jsx)(rv,{acl:e,"aria-label":p("delete_uploaded_14711"),document:m,id:r,role:"button",onDelete:()=>{c(null),x(fv.Uploader)}}):f===fv.Uploading?(0,i.jsx)(av,{"aria-busy":!0,"aria-describedby":n,"aria-label":p("uploading_file_46483"),id:r,name:_,progress:v}):(0,i.jsx)(pv,{"aria-describedby":n,"aria-errormessage":o,"aria-invalid":"error"===h,"aria-label":p("upload_file_97740"),id:r,onChange:async t=>{x(fv.Uploading),I(t.name),b(0);try{const n=await JI(u,t,e,b);c({...n,file:t}),x(fv.File)}catch{x(fv.Uploader)}},...g}),(0,i.jsx)(Sl,{state:h,children:d})]})},_v=e=>{const t=Hn();return(0,i.jsxs)(Ra,{align:"center",gap:"1",children:[e.children,(0,i.jsxs)(br,{color:"gray500",fontSize:"textXs",fontWeight:"regular",children:["(",t("facultatif_76747"),")"]})]})},Iv=(0,M.createContext)({}),vv=hr("div",{background:"$gray50",border:"1px solid $gray100",borderRadius:"$2",display:"flex",gap:"$2",height:"44px",minHeight:"44px",padding:"$1",position:"relative",width:"100%"}),bv=hr("div",{alignItems:"center",color:"$gray500",cursor:"pointer",display:"flex",fontWeight:"$medium",height:"100%",justifyContent:"center",userSelect:"none",width:"100%",variants:{selected:{true:{background:"white",borderRadius:"6px",boxShadow:"$sm",color:"$gray700"}}}}),jv=e=>(0,i.jsx)(Iv.Provider,{value:{selectedItem:e.selectedItem,onChange:e.onChange},children:(0,i.jsx)(vv,{children:e.children})}),Cv=e=>{const{selectedItem:t,onChange:n}=(0,M.useContext)(Iv);return(0,i.jsx)(bv,{selected:t===e.item,onClick:()=>{n(e.item)},children:e.children})},yv=({value:e,css:t,label:n,description:s,hint:o,icon:r,onChange:a,state:l,...d})=>{const c=m(e)&&e.length>5?e.substring(0,5):e,{inputId:u,descId:h,errorId:g}=Na();return(0,i.jsxs)(Ra,{css:t,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:u,children:n}),(0,i.jsx)(wl,{id:h,children:s}),(n||s)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(zl,{cursor:"default",icon:r,state:l,children:(0,i.jsx)(br,{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":s?h:void 0,"aria-errormessage":"error"===l?g:void 0,"aria-invalid":"error"===l,disabled:"disabled"===l,id:u,type:"time",value:c,onChange:e=>{a(e.target.value)},...d})})}),(0,i.jsx)(Sl,{id:g,state:l,children:o})]})},kv=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Fa.D0,{name:e,render:o=>{const r=kl(o.meta);return(0,i.jsx)(yv,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}});var Av=n(3333),wv=n(5488),Sv=n.n(wv);n(4385),n(5833),n(9844),n(6871),n(2830);const Ev=({css:e,label:t,description:n,state:s,initialValue:o,onChange:r,onBlur:a,onFocus:l,hint:d,placeholder:c,value:u,...h})=>{const{translate:m,params:{organizationId:g}}=cl(),{language:p}=Gn(Vn),f=(0,M.useMemo)(()=>[{color:"white",label:m("blanc_36425")},{color:mr.colors.gray800.value,label:m("gris_fonc_51159")},{color:mr.colors.gray400.value,label:m("gris_clair_52465")},{color:mr.colors.primary900.value,label:m("bleu_fonc_40491")},{color:mr.colors.primary700.value,label:m("bleu_41949")},{color:mr.colors.error700.value,label:m("rouge_fonc_45023")},{color:mr.colors.error500.value,label:m("rouge_75079")},{color:mr.colors.warning300.value,label:m("jaune_53503")},{color:mr.colors.warning600.value,label:m("orange_64132")},{color:mr.colors.success700.value,label:m("vert_fonc_37265")},{color:mr.colors.success500,label:m("vert_27018")},{color:mr.colors.purple700.value,label:m("violet_fonc_77270")},{color:mr.colors.purple500.value,label:m("violet_54005")},{color:mr.colors.pink700.value,label:m("rose_fonc_98996")},{color:mr.colors.pink500.value,label:m("rose_49360")}],[]);return(0,i.jsxs)(Ra,{css:e,direction:"column",width:1,children:[(0,i.jsx)(El,{children:t}),(0,i.jsx)(wl,{children:n}),(t||n)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{"--ck-border-radius":"$radii$1","--ck-color-toolbar-background":"$colors$gray100","& .ck.ck-toolbar":{borderColor:"error"===s?"$error500":"$gray300",borderBottom:"none","& .ck.ck-toolbar__separator":{background:"$gray200"},"& .ck.ck-button":{color:"$gray600","&:hover":{background:"$gray200",color:"$gray800",cursor:"pointer"},"&.ck-on, &.ck-on:hover:not(.ck-disabled)":{background:"$primary300",color:"$primary700"}}},"& .ck.ck-content":{borderColor:"error"===s?"$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"},...ug("& .ck.ck-content")},width:1,children:(0,i.jsx)(Av.CKEditor,{config:{placeholder:c,fontColor:{colors:f},fontBackgroundColor:{colors:f},language:p.toString().toLowerCase(),simpleUpload:{uploadUrl:`${D.HEAVENT_API_URL}/image/upload?organizationId=${g}`},heading:{options:[{model:"paragraphSmall",view:{name:"p",classes:"h-small"},title:m("paragraphe_pet_01073"),class:"ck-heading_paragraph_small",converterPriority:"high"},{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading2"}]}},data:o,editor:Sv(),onBlur:()=>{a?.()},onChange:(e,t)=>{r(t.getData())},onFocus:()=>{l?.()},...h})}),(0,i.jsx)(Sl,{state:s,children:d})]})},Tv=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Fa.D0,{name:e,parse:yl.A,render:o=>{const r=kl(o.meta);return(0,i.jsx)(Ev,{hint:r?o.meta.error:t,initialValue:o.input.value,name:e,state:r?"error":n,onChange:e=>{o.input.onChange(e)},...s})}}),zv=e=>{const{history:t,translate:n,params:{organizationId:s}}=cl(),[o,r]=(0,M.useState)(e.values.campaign.documents);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rl,{label:n("sujet_36033"),name:"campaign.subject"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(jv,{selectedItem:e.values.textOrHtml,onChange:t=>{e.form.change("textOrHtml",t)},children:[(0,i.jsx)(Cv,{item:"text",children:n("contenu_en_vers_04808")}),(0,i.jsx)(Cv,{item:"html",children:n("contenu_parti_04631")})]}),(0,i.jsx)(Ba,{height:"7"}),"text"===e.values.textOrHtml&&(0,i.jsx)(Tv,{hint:(0,i.jsx)(br,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_29668"),name:"campaign.text"}),"html"===e.values.textOrHtml&&(0,i.jsx)(Lm,{hint:(0,i.jsx)(br,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("code_html_60711"),name:"campaign.html"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Mm,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(_v,{children:n("_metteur_de_l_e_51616")}),name:"campaign.emailSenderId",onCreateClick:()=>{t.push(Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(t=>(0,i.jsx)("option",{value:t.id,children:`${t.name} ${t.id===e.emailSenderId?n("_metteur_par_d_03442"):t.isValidToSendEmail?"":n("_e_mail_non_con_07618")}`},t.id))}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Rl,{isEmail:!0,label:(0,i.jsx)(_v,{children:n("adresse_de_r_po_86181")}),name:"campaign.replyTo"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{align:"center",gap:"1",children:[(0,i.jsx)(br,{color:"gray700",fontSize:"textMd",fontWeight:"semiBold",children:n("pi_ce_s_jointe_82370")}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray500",children:(0,i.jsx)(Ya,{icon:"circle-exclamation"})})}),(0,i.jsx)(_m,{placement:"bottom",children:n("si_vos_pi_ces_j_95233")})]})]}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:n("int_grer_dans_v_73429")}),e.canCustomDocuments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Mm,{isSearchVisible:!0,label:n("documents_dit_25968"),multiple:!0,name:"campaign.attachments",children:[e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),HI.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]})]}),o.map(t=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(xv,{acl:"public-read",organizationId:s,value:t,onChange:()=>{const n=(0,sc.A)(o,t);r(n),e.form.change("campaign.documents",n)}})]},t.key)),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(xv,{acl:"public-read",label:n("fichier_personn_20046"),organizationId:s,value:null,onChange:t=>{const n=[...o,(0,rr.A)(t,"file")];r(n),e.form.change("campaign.documents",n)}}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)($m,{name:"campaign.hasCalendarInvite",children:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[n("ajouter_une_inv_92123"),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray500",children:(0,i.jsx)(Ya,{icon:"circle-exclamation"})})}),(0,i.jsx)(_m,{placement:"top",children:n("un_fichier_ics_01663")})]})]})}),e.values.campaign.hasCalendarInvite&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{css:{paddingLeft:"$6"},width:1,children:(0,i.jsxs)(Ra,{css:{background:"$gray50",bd:!0,padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Rl,{label:n("nom_de_l_v_nem_08711"),name:"campaign.calendarInviteName"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Dm,{label:n("date_de_d_but_43380"),name:"campaign.calendarInviteStartDate"}),(0,i.jsx)(kv,{label:n("heure_de_d_but_27566"),name:"campaign.calendarInviteStartTime"})]}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Dm,{label:n("date_de_fin_86920"),name:"campaign.calendarInviteEndDate"}),(0,i.jsx)(kv,{label:n("heure_de_fin_95071"),name:"campaign.calendarInviteEndTime"})]})]})})]})]})},Ov=[" ","@","£","$","¥","è","é","ù","ì","ò","Ç","Ø","ø","Å","å","Æ","æ","ß","É","!",'"',"#","¤","%","&","'","(",")","*","+",",","-",".","/","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","ä","ö","ñ","ü","à"],Rv=["^","{","}","\\","|","[","]","~","€","\n"],$v=Ov.concat(Rv);function Dv(e,t){const n=t?145:160,i=Array.from(e??"").reduce((e,t)=>Ov.includes(t)?e+1:Rv.includes(t)?e+2:e,0);return i<=n?{numberOfCharacters:i,numberOfSms:1}:{numberOfCharacters:i,numberOfSms:Math.ceil(i/153)}}const Pv=e=>(0,i.jsx)(Fa.D0,{name:e.name,render:t=>{const n=t.input.checked?"checked":"unchecked";return(0,i.jsx)(hc,{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}),Fv=e=>{const t=Hn(),n=e.formProps.values,{numberOfCharacters:s,numberOfSms:o}=Dv(n.campaign.text,n.customSender);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("voulez_vous_per_07528")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Pv,{name:"customSender",value:!1,children:t("non_je_souhait_47056")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"customSender",value:!0,children:t("oui_je_souhait_40974")}),e.formProps.values.customSender&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Rl,{hint:t("doit_commencer_93759"),name:"campaign.sender",placeholder:t("_metteur_du_mes_17005")})})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Lm,{hint:(0,i.jsx)(br,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:t("vous_pouvez_ajo_23408")}}),label:(0,i.jsxs)(Ra,{justify:"between",children:[(0,i.jsx)(br,{children:t("contenu_29668")}),(0,i.jsx)(br,{color:"gray500",children:t("_1_caract_re_04414",s,o)})]}),name:"campaign.text"})]})},Mv=e=>{const t=Hn();return(0,i.jsxs)(i.Fragment,{children:[e.formProps.values.campaign.campaignType===ce.Email?(0,i.jsx)(zv,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,form:e.formProps.form,values:e.formProps.values}):(0,i.jsx)(Fv,{formProps:e.formProps}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:e.formProps.submitting,onClick:e.formProps.handleSubmit,children:e.isTemplate?e.isEdit?t("mettre_jour_l_13576"):t("cr_er_le_mod_le_06346"):e.isSent?t("mettre_jour_l_32694"):t("suivant_desti_10756")})})]})},Nv=e=>(0,i.jsxs)(br,{css:{borderRadius:"$1",boxShadow:"$sm",overflow:"hidden",width:"100%"},children:[(0,i.jsxs)(Ra,{align:"center",css:{background:e.isOpen?"$gray900":"white",cursor:e.canSelect?"pointer":"default",px:"$6"},gap:"4",height:64,width:1,onClick:()=>{e.canSelect&&e.onSelect()},children:[(0,i.jsx)(Ra,{align:"center",css:{background:e.isCompleted?"$success200":"white",border:e.isCompleted?"none":"1px solid $gray200",borderRadius:"32px",color:e.isCompleted?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:e.isCompleted?(0,i.jsx)(Ya,{icon:"check"}):e.stepNumber}),(0,i.jsx)(br,{color:e.isOpen?"white":"gray800",fontSize:"textMd",fontWeight:"medium",children:e.title})]}),e.isOpen&&(0,i.jsx)(br,{css:{background:"white",padding:"$6 70px",width:"100%"},children:e.children})]}),Lv=e=>(0,i.jsx)(pl,{direction:"column",formRenderProps:e.formProps,render:e.render}),Bv=e=>{const[t,n]=M.useState(!1),[s,o]=M.useState(0),r=Gn(Da),a=M.Children.toArray(e.children);return(0,i.jsx)(Fa.lV,{initialValues:e.initialValues,initialValuesEqual:Or.A,mutators:{...Pa.A,forceErrors:ml},render:r=>a.map((a,l)=>{const d=s>=l||e.isEdit&&r.valid;return(0,i.jsxs)(La.Provider,{value:{errors:r.errors,showErrors:t,submitErrors:r.submitErrors,setShowErrors:n},children:[(0,i.jsx)(Nv,{canSelect:d,isCompleted:s>l,isOpen:s===l,stepNumber:l+1,title:a.props.title,onSelect:()=>{d&&(n(!1),o(l))},children:M.cloneElement(a,{formProps:r})}),(0,i.jsx)(Ba,{height:"6"})]},l)}),validate:e=>r.validateForForm(a[s].props.schema)(e),onSubmit:async(t,i)=>{s===a.length-1?await e.onSubmit(t,i):(n(!1),o(s+1))}})};var Vv=n(5526);const Uv=/^[a-z][a-z0-9]{2,10}$/i;var Wv;!function(e){e.Accreditations="accreditations",e.Everyone="everyone",e.Positions="positions",e.Segments="segments",e.States="states",e.Users="users"}(Wv||(Wv={}));let Gv=class extends Pl{constructor(e){super(e)}createUpdateCampaignValuesDefault(e,t,n,i){const s=this.campaignInputDefault(e,t,n,i);return{campaign:s,recipients:s.sendToEveryone?Wv.Everyone:eo(s.states)?Wv.States:eo(s.segmentsIds)?Wv.Segments:eo(s.accreditationsCategoriesIds)||eo(s.accreditationsIds)||eo(s.accreditationsSlotsIds)?Wv.Accreditations:eo(s.positionsCategoriesIds)||eo(s.positionsIds)||eo(s.positionsSlotsIds)?Wv.Positions:Wv.Users,customSender:m(n?.sender),textOrHtml:m(n?.html)?"html":"text",delivery:s.state===de.Scheduled&&n?.scheduledAt?.isValid?"later":"now"}}campaignStep1Fields(){return{name:d.Yj().required(this.t("le_nom_de_la_ca_63405")),campaignType:d.Yj().required(this.t("le_type_de_camp_96559")).oneOf(Zt,this.t("le_type_de_camp_56467"))}}campaignStep1Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep1Fields()})})}campaignStep2Fields(){const e=this;return{sender:d.Yj().test("is-valid",this.t("l_metteur_ne_r_16421"),function(){return!m(this.parent.sender)||Uv.test(this.parent.sender)}),text:d.Yj().test("non-empty-text",this.t("le_contenu_est_45048"),function(){return m(this.parent.text)||m(this.parent.html)}).test("only-valid-characters","",function(){if(this.parent.campaignType===ce.Email)return!0;{const n=(t=this.parent.text,new Set(Array.from(t??"").filter(e=>!$v.includes(e))));return!(n.size>0)||this.createError({message:e.translationService.translate("les_caract_res_84839",Array.from(n).join(", "))})}var t}).test("max-length",this.t("le_contenu_ne_p_25416"),function(){return this.parent.campaignType===ce.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:d.Yj().when("campaignType",{is:ce.Email,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),html:d.Yj().test("non-empty-text",this.t(this.t("le_code_html_es_52280")),function(){return m(this.parent.text)||m(this.parent.html)}),replyTo:d.Yj().email(this.t("l_adresse_de_r_53879")).test("clean-reply-to",this.t("l_adresse_de_r_53879"),function(){return U_(this.parent.replyTo)}),documents:d.YO().test("max-size",this.t("l_ensemble_des_32797"),function(){return this.parent.campaignType!==ce.Email||!eo(this.parent.documents)||(0,Vv.A)(this.parent.documents,e=>e.size)<2e7}),emailSenderId:d.ai().nullable(),attachments:d.YO().of(d.Yj()),hasCalendarInvite:d.zM().required(),calendarInviteName:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:Vm.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:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:Vm.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:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})}}campaignStep2Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep2Fields()})})}campaignStep3Fields(){const e=this,t=function(){return this.parent.state!==de.Draft&&this.parent.state!==de.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:d.zM().required(this.t("requis_75853")),states:d.YO().of(d.Yj()).test("non-empty","",t),positionsCategoriesIds:d.YO().of(d.ai()).test("non-empty","",t),positionsIds:d.YO().of(d.ai()).test("non-empty","",t),positionsSlotsIds:d.YO().of(d.ai()).test("non-empty","",t),tagsIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsCategoriesIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsSlotsIds:d.YO().of(d.ai()).test("non-empty","",t),usersInfosIds:d.YO().of(d.ai()).test("non-empty","",t),segmentsIds:d.YO().of(d.ai()).test("non-empty","",t)}}campaignStep3Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep3Fields()})})}campaignStep4Fields(){return{scheduledAtDate:Vm.when("state",{is:de.Scheduled,then:e=>e.required(this.t("la_date_d_envoi_17792")).typeError(this.t("la_date_d_envoi_17792"))}),scheduledAtTime:d.Yj().when("state",{is:de.Scheduled,then:e=>e.required(this.t("l_heure_d_envoi_53643")).matches(/\d{2}:\d{2}/,this.t("l_heure_d_envoi_53643"))})}}campaignStep4Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep4Fields()})})}campaignInputSchema(){return d.Ik().shape({...this.campaignStep1Fields(),...this.campaignStep2Fields(),...this.campaignStep3Fields(),...this.campaignStep4Fields()})}createUpdateCampaignSchema(){return d.Ik().shape({campaign:this.campaignInputSchema()})}campaignInputDefault(e,t,n,i){let s=n?.segmentsIds??[],o=n?.usersInfosIds??[];if(m(i))try{const e=JSON.parse(r(i));e.segmentId&&(s=[e.segmentId]),eo(e.usersInfosIds)&&(o=e.usersInfosIds)}catch{}const a=!eo(s)&&!eo(o)&&(n?.sendToEveryone??!1);return{name:n?.name??"",state:n?.state??(e?de.Template:de.Draft),campaignType:n?.campaignType??ce.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:o,segmentsIds:s,scheduledAtDate:n?.scheduledAt??void 0,scheduledAtTime:n?.scheduledAt?.toFormat("HH:mm")??void 0,documents:n?.documents??[],emailSenderId:n?.emailSenderId??t,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}}};Gv=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Gv);const Hv=M.createContext({}),qv=e=>{const{params:{eventId:t}}=cl(),n=M.useMemo(()=>function(e){return e.roles.some(e=>hI.includes(e.type))}(e.userPermissions),[e.userPermissions]);return t?(0,i.jsx)(Hv.Provider,{value:{isEventAdmin:e.isEventAdmin??!1,isEventReader:n,userPermissions:e.userPermissions,hasPermission:(t,n)=>function(e,t,n){return gI(e,[t],n)[0]}(e.userPermissions,t,n),hasPermissions:(t,n)=>gI(e.userPermissions,t,n)},children:e.children}):(0,i.jsx)(i.Fragment,{children:e.children})};function Yv(){return M.useContext(Hv)}var Kv=n(8923);const Zv=M.createContext({}),Xv=e=>{const[t,n]=M.useState(e.numberOfWaitingAccreditations),[s,o]=M.useState(e.numberOfWaitingAssigments),[r,a]=M.useState(null),l=M.useCallback(async t=>{const n=(0,Kv.A)(r,{id:e.event.id},t);await rI.events.put(n),a(n)},[e.event.id,r,a]),{isEventAdmin:d,isEventReader:c,userPermissions:u,hasPermission:h,hasPermissions:m}=Yv();return M.useEffect(()=>{(async()=>{let t=await rI.events.get(e.event.id);t||(t={id:e.event.id},await rI.events.put(t)),a(t)})()},[e.event]),(0,i.jsx)(Zv.Provider,{value:{event:e.event,isEventAdmin:d,isEventReader:c,localEvent:r,numberOfWaitingAccreditations:t,numberOfWaitingAssigments:s,userPermissions:u,hasPermission:h,hasPermissions:m,setNumberOfWaitingAccreditations:n,setNumberOfWaitingAssigments:o,updateLocalEvent:l},children:e.children})};function Jv(){return M.useContext(Zv)}const Qv=e=>{const t=(0,M.useRef)(null),n=(0,M.useCallback)(e=>{e&&(t.current=e,setTimeout(()=>{e.style.right=mr.space[6].value},100))},[]),s=(0,M.useCallback)(()=>{t.current.style.right="-400px",e.onClose()},[e.onClose]);return(0,Wt.createPortal)((0,i.jsxs)(Ra,{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)(Ra,{align:"center",css:{color:"white"},justify:"center",children:(0,i.jsx)(Ya,{icon:"black"===e.color?"circle-exclamation":"error"===e.color?"circle-xmark":"circle-check",iconStyle:"solid"})}),(0,i.jsx)(br,{color:"white",css:{flex:"1","& a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:e.text},fontWeight:"medium"}),(0,i.jsx)(Ra,{align:"center",css:{color:"white",cursor:"pointer",fontSize:"$textMd"},height:32,justify:"center",width:32,onClick:s,children:(0,i.jsx)(Ya,{icon:"xmark"})})]}),document.body)},eb=2e3,tb=M.createContext({}),nb=e=>{const t=Hn(),[n,s]=M.useState(!1),[o,r]=M.useState({color:"success",text:""}),a=M.useCallback(()=>{setTimeout(()=>{s(!1)},1200)},[s]),l=M.useCallback(e=>{s(!0),r("string"==typeof e?{text:e}:e),setTimeout(a,Bs.dw.fromObject({seconds:5}).toMillis())},[s,r,a]),{mutate:d}=function(e={}){return Kn("mutation DelegationsImportResult(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $jobId: UUID!\n) {\n delegationsImportResult(organizationId: $organizationId, eventId: $eventId, jobId: $jobId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),c=M.useRef(null),u=M.useCallback((e,n,i)=>{c.current=window.setInterval(async()=>{const{delegationsImportResult:{state:s,event:o}}=await d({organizationId:e,eventId:n,jobId:i});s===be.Done&&(clearInterval(c.current),l({color:"success",text:t("votre_import_es_98992",o.name)}))},eb)},[]),{mutate:h}=function(e={}){return Kn("mutation EventDocumentsExportResult($eventId: EventId!, $jobId: UUID!) {\n eventDocumentsExportResult(eventId: $eventId, jobId: $jobId) {\n state\n url\n }\n}\n",e)}(),m=M.useRef(null),g=M.useCallback((e,n)=>{m.current=window.setInterval(async()=>{const{eventDocumentsExportResult:i}=await h({eventId:e,jobId:n});i.state===Pe.Done&&(clearInterval(m.current),l({color:"success",text:t("l_export_de_vos_38257",i.url)}))},eb)},[]),{mutate:p}=function(e={}){return Kn("mutation EventsImportResult($organizationId: OrganizationId!, $jobId: UUID!) {\n eventsImportResult(organizationId: $organizationId, jobId: $jobId) {\n state\n }\n}\n",e)}(),f=M.useRef(null),x=M.useCallback((e,n)=>{f.current=window.setInterval(async()=>{const{eventsImportResult:{state:i}}=await p({organizationId:e,jobId:n});i===Oe.Done&&(clearInterval(f.current),l({color:"success",text:t("votre_import_es_60265")}))},eb)},[]),{mutate:_}=function(e={}){return Kn("mutation ExportResult($organizationId: OrganizationId!, $eventId: EventId, $jobId: UUID!) {\n exportResult(organizationId: $organizationId, eventId: $eventId, jobId: $jobId) {\n state\n url\n }\n}\n",e)}(),I=M.useRef(null),v=M.useCallback((e,n,i)=>{I.current=window.setInterval(async()=>{const{exportResult:s}=await _({organizationId:e,eventId:n,jobId:i});s.state===Pe.Done&&(clearInterval(I.current),l({color:"success",text:t("votre_export_es_96069",s.url)}))},eb)},[]),{mutate:b}=function(e={}){return Kn("mutation FilesImportResult($organizationId: OrganizationId!, $jobId: UUID!) {\n filesImportResult(organizationId: $organizationId, jobId: $jobId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),j=M.useRef(null),C=M.useCallback((e,n)=>{j.current=window.setInterval(async()=>{const{filesImportResult:{state:i,event:s}}=await b({organizationId:e,jobId:n});i===Be.Done&&(clearInterval(j.current),l({color:"success",text:s?t("votre_import_es_11791",s.name):t("votre_import_es_10672")}))},eb)},[]),{mutate:y}=function(e={}){return Kn("mutation PositionsImportResult($organizationId: OrganizationId!, $jobId: UUID!) {\n positionsImportResult(organizationId: $organizationId, jobId: $jobId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),k=M.useRef(null),A=M.useCallback((e,n)=>{k.current=window.setInterval(async()=>{const{positionsImportResult:{state:i,event:s}}=await y({organizationId:e,jobId:n});i===rt.Done&&(clearInterval(k.current),l({color:"success",text:t("votre_import_es_11848",s.name)}))},eb)},[]),{mutate:w}=function(e={}){return Kn("mutation VolunteersImportResult(\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $jobId: UUID!\n) {\n volunteersImportResult(\n organizationId: $organizationId\n delegationId: $delegationId\n jobId: $jobId\n ) {\n state\n event {\n name\n }\n }\n}\n",e)}(),S=M.useRef(null),E=M.useCallback((e,n)=>{S.current=window.setInterval(async()=>{const{volunteersImportResult:{state:i,event:s}}=await w({organizationId:e,jobId:n});i===Rt.Done&&(clearInterval(S.current),l({color:"success",text:s?t("votre_import_es_37822",s.name):t("votre_import_es_14145")}))},eb)},[]);return(0,i.jsx)(tb.Provider,{value:{checkDelegationsImport:u,checkDocumentsExport:g,checkEventsImport:x,checkExport:v,checkFilesImport:C,checkPositionsImport:A,checkVolunteersImport:E,showNotification:l},children:(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(Qv,{color:o.color??"success",text:o.text,onClose:a}),e.children]})})};function ib(){return M.useContext(tb)}const sb=M.createContext({});function ob(){return M.useContext(sb)}const rb=(0,dr.I4)("dialog",{background:"white",border:"none",display:"flex",flexDirection:"column",overflowY:"auto",padding:"0",variants:{mobile:{true:{height:"100%",width:"100%"},false:{borderRadius:"12px",maxHeight:"calc(100% - 80px)",width:"688px"}}},defaultVariants:{mobile:!1}}),ab=e=>{const t=Hn(),{onClose:n}=ob();return(0,i.jsxs)(Ra,{css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$6 $7"},gap:"3",justify:"end",children:[!e.hideCancelButton&&(0,i.jsx)(jl,{color:"white",onClick:n,children:t("annuler_48254")}),"function"==typeof e.children?e.children(n):e.children]})},lb=e=>(0,i.jsx)(Ra,{direction:"column",...za(e),css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$5 $7 $7 $7",...e.css},children:e.children}),db=({icon:e,iconColor:t,children:n,subtitle:s,onClose:o})=>(0,i.jsxs)(Ra,{children:[(0,i.jsxs)(Ra,{align:"center",css:{flexGrow:"1",padding:"$6 $7 $5 $7"},gap:"4",children:[(0,i.jsx)(Ra,{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)(Ya,{className:"fa-xl",icon:e})}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray900 textLg medium",children:n}),m(s)&&(0,i.jsx)(br,{color:"gray500",children:s})]})]}),o&&(0,i.jsx)(Ra,{align:"center",css:{color:"$gray500",cursor:"pointer",fontSize:"textMd",padding:"$2",margin:"$3 $3"},height:24,justify:"center",width:24,onClick:o,children:(0,i.jsx)(Ya,{className:"fa-xl",icon:"xmark"})})]}),cb=({children:e})=>{const{isOpen:t,onClose:n}=ob();return Od(n),Ka("common-front/src/designSystem/components/modals/__deprecated/modal/modal.tsx","common-front/src/designSystem/components/modals/base/modal.tsx"),t?(0,Wt.createPortal)((0,i.jsx)(Ra,{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)(rb,{onClick:e=>Al(e,!1),children:e})}),document.body):null},ub=e=>{const[t,n]=M.useState(e.isOpen??!1),s=M.useCallback(()=>{n(!1),e.onClose?.()},[n,e.onClose]);return M.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsx)(sb.Provider,{value:{isOpen:t,onClose:s,setIsOpen:n},children:e.children})},hb=e=>{const{setIsOpen:t}=ob(),n=e.children,s=M.useCallback(e=>{Al(e),t(!0),n.props.onClick?.(e)},[t,n]),o=M.useMemo(()=>M.cloneElement(M.Children.only(n),{onClick:s,onKeyPress:s,tabIndex:0}),[n,s]);return(0,i.jsx)(i.Fragment,{children:o})};var mb=n(7431);const gb=()=>{const{translate:e}=cl(),t=Gn(su),[n,s]=(0,M.useState)(""),o=(0,M.useMemo)(()=>t.countries.filter(e=>"number"==typeof e.smsPrice),[t]),r=(0,M.useMemo)(()=>{if(m(n)){const e=u(n);return o.filter(t=>u(t.name).includes(e)||Qs(t.phoneCode).some(e=>e.includes(n)))}return o},[o,n]);return(0,i.jsxs)(ub,{children:[(0,i.jsx)(hb,{children:(0,i.jsx)(br,{color:"primary700",children:e("voir_la_liste_d_69122")})}),(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"message",children:e("liste_des_prix_58579")}),(0,i.jsxs)(lb,{css:{overflow:"auto"},direction:"column",gap:"3",height:300,children:[(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:"Rechercher un pays",state:"search",value:n,onChange:s}),(0,i.jsxs)(vc,{children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:e("Country")}),(0,i.jsx)(Fc,{children:e("indicatif_40634")}),(0,i.jsx)(Fc,{children:e("prix_ht_10965")})]}),r.map(e=>{return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:e.name}),(0,i.jsx)(yc,{children:e.phoneCode}),(0,i.jsx)(yc,{children:(0,mb.A)((t=e.smsPrice,t*(14/9)),3)})]},e.code);var t})]})]}),(0,i.jsx)(ab,{})]})]})},pb=e=>{const t=Hn(),{hasFeature:n}=_I(),s=n(Fe.Sms);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"campaign.campaignType",children:t=>{t===ce.Sms?s?(e.formProps.form.change("campaign.text",""),e.formProps.form.change("campaign.html","")):e.formProps.form.change("campaign.campaignType",ce.Email):(e.formProps.form.change("campaign.text",""),e.formProps.form.change("campaign.html",""))}}),(0,i.jsx)(Rl,{label:e.isTemplate?t("nom_de_votre_mo_02364"):t("nom_de_votre_ca_08001"),name:"campaign.name"}),!e.isSent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:e.isTemplate?t("quel_type_de_mo_32965"):t("quel_type_de_ca_11960")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"campaign.campaignType",value:ce.Email,children:t("e_mail_13869")}),(0,i.jsx)(Ba,{height:"3"}),e.isAdmin&&(0,i.jsx)(Pv,{disabled:!s,name:"campaign.campaignType",value:ce.Sms,children:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{children:"SMS"}),(0,i.jsx)(gb,{}),!s&&(0,i.jsx)(br,{color:"gray500",css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:t("contactez_nous_22980",D.EMAIL_FROM,D.EMAIL_FROM)},fontSize:"textXs"})]})})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:e.formProps.handleSubmit,children:e.isTemplate?t("suivant_conte_33443"):t("suivant_conte_90603")})})]})},fb=e=>{const t=Hn(),{form:n,handleSubmit:s,values:o}=e.formProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"delivery",children:e=>{n.change("campaign.state","now"===e?de.Draft:de.Scheduled)}}),(0,i.jsx)(br,{color:"gray800",children:t("quand_voulez_vo_96615")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"delivery",value:"now",children:t("je_souahite_l_e_46027")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"delivery",value:"later",children:t("je_souhaite_pro_98854")}),"later"===o.delivery&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Dm,{min:Bs.c9.local(),name:"campaign.scheduledAtDate",placeholder:t("choisissez_la_d_30578")}),(0,i.jsx)(kv,{hint:t("le_fuseau_horai_57116",e.timeZone),name:"campaign.scheduledAtTime",placeholder:t("choisissez_l_he_55311")})]})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:s,children:t("suivant_r_cap_22677")})})]})};var xb;!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"}(xb||(xb={}));const _b=e=>{const{translate:t,params:{eventId:n}}=cl(),s=Gn(Wc),[o,r]=(0,M.useState)(!0),[a,l]=(0,M.useState)(!0),[d,c]=(0,M.useState)([]),[u,h]=(0,M.useState)([]),[m,g]=(0,M.useState)(!1),[p,f]=(0,M.useState)([]);return(0,M.useEffect)(()=>{(async()=>{if("accreditations"===e.recipients&&o){const e=await(t={eventId:n},i=await q(),co("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,ic.A)(e.event.accreditationsCategories,e=>e.name)),h(Object.entries((0,nc.A)(e.event.accreditations.nodes,e=>e.accreditationCategoryName))),g(eo(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?s.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,o]),e.recipients===Wv.Accreditations?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{marginLeft:"$2"},children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mm,{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)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsIds",placeholder:t("ajouter_des_acc_26514"),children:u.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{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},Ib=e=>{const t=_I(),n=Jv(),s=M.useMemo(()=>(t?.user?.roles.map(e=>e.type)||[]).concat(n?.userPermissions?.roles.map(e=>e.type)||[]),[t,n]);return M.useMemo(()=>!!s.includes(xt.OrganizationAdmin)||(eo(e.rolesTypes)?eo((0,lh.A)(s,e.rolesTypes)):"function"==typeof n?.hasPermissions&&eo(Qs(e.permissions))?n.hasPermissions(Qs(e.permissions),e.scope).some(e=>e):!!eo(Qs(e.permissions))&&t.hasPermissions(Qs(e.permissions)).some(e=>e)),[e.permissions,e.rolesTypes,e.scope,s,n])?(0,i.jsx)(i.Fragment,{children:e.children}):null},vb=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=Gn(ah),{isEventAdmin:r}=Jv(),[a,l]=(0,M.useState)(!0),[d,c]=(0,M.useState)(!0),[u,h]=(0,M.useState)([]),[g,p]=(0,M.useState)([]),[f,x]=(0,M.useState)([]),[_,I]=(0,M.useState)([]);return(0,M.useEffect)(()=>{(async()=>{if("positions"===e.recipients&&a){const e=await(t={organizationId:n,eventId:s},i=await q(),co("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:[]}));h((0,ic.A)(e.event.positionsCategories,e=>e.name)),p(Object.entries((0,nc.A)(e.event.positions.nodes,e=>e.positionCategoryName))),x(e.event.positions.nodes.map(e=>{const t=e.slots.map(t=>{const n=m(t.name)?`${t.name} - `:"",i=o.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===Wv.Positions?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{marginLeft:"$6"},children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ib,{permissions:xb.CAMPAIGN_SEND,scope:{positionCategoryId:"ANY"},children:[(0,i.jsx)(Mm,{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)(Ba,{height:"2"})]}),(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsIds",placeholder:t("ajouter_des_mis_44522"),children:g.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsSlotsIds",placeholder:t("ajouter_des_cr_25566"),children:f.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:"campaign.tagsIds",placeholder:t("ajouter_des_tag_57392"),children:_.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]})]})})]}):null},bb=e=>{const{translate:t,params:{eventId:n}}=cl(),[s,o]=(0,M.useState)(!0),[r,a]=(0,M.useState)(!0),[l,d]=(0,M.useState)([]);return(0,M.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await(t={eventId:n},i=await q(),co("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),o(!1),a(!1)}var t,i})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Mm,{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 jb({eventId:e,hasSelected:t,includePhone:n,nameDebounced:s,organizationId:o,populationsIds:r,reloadKey:a,userInfoIds:l}){const[d,c]=M.useState(!1),[u,h]=M.useState(null),g=M.useMemo(()=>(0,ic.A)((0,ch.A)((u?.usersInfos.nodes??[]).concat(u?.selectedUsersInfos?.nodes??[]),e=>e.id),e=>e.name.toLowerCase()),[u]),p=M.useMemo(()=>g.map(e=>(0,i.jsxs)("option",{value:e.id,children:[m(e.name)?e.name:"-"," (",n?e.phone?.internationalFormat||"-":e.email,")"]},e.id)),[g]);return M.useEffect(()=>{(async()=>{c(!0);const{organization:i}=await(a={organizationId:o,eventId:e,hasSelected:t,includePhone:n||!1,userInfoIds:l,name:m(s)?s:void 0,populationsIds:r},d=await q(),co('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)})()},[o,e,n,s,r,a]),{usersInfos:g,usersInfosOptions:p,isLoading:d}}const Cb=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),[o,r,a]=Pc(""),{usersInfosOptions:l,isLoading:d}=jb({organizationId:n,eventId:s,includePhone:e.campaignType===ce.Sms,hasSelected:eo(e.usersInfosIds),nameDebounced:r,userInfoIds:e.usersInfosIds});return"users"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{marginLeft:"$6"},children:(0,i.jsx)(Mm,{isSearchLoading:d,isSearchVisible:!0,multiple:!0,name:"campaign.usersInfosIds",placeholder:t("ajouter_des_mem_58427"),searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",name:o,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:a}),children:l})})]}):null},yb=e=>{const t=Hn(),{event:n,isEventAdmin:s,hasPermission:o}=Jv(),{form:r,handleSubmit:a,values:l}=e.formProps,d=n.usePositions,c=n.useAccreditations&&s;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"recipients",children:e=>{if("everyone"===e)r.change("campaign.sendToEveryone",!0),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("states"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("positions"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("accreditations"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("users"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Rr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Rr.Yr,{name:"campaign.positionsCategoriesIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsCategoriesIds.length>0&&r.change("campaign.positionsCategoriesIds",[])}}),(0,i.jsx)(Rr.Yr,{name:"campaign.positionsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsIds.length>0&&r.change("campaign.positionsIds",[])}}),(0,i.jsx)(Rr.Yr,{name:"campaign.positionsSlotsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsSlotsIds.length>0&&r.change("campaign.positionsSlotsIds",[])}}),(0,i.jsx)(Rr.Yr,{name:"campaign.tagsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.tagsIds.length>0&&r.change("campaign.tagsIds",[])}}),(0,i.jsx)(Rr.Yr,{name:"campaign.usersInfosIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.usersInfosIds.length>0&&r.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Rr.Yr,{name:"campaign.segmentsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.segmentsIds.length>0&&r.change("campaign.segmentsIds",[])}}),(0,i.jsx)(br,{color:"gray800",children:t("_qui_voulez_vo_96064")}),(0,i.jsx)(Ba,{height:"3"}),s&&d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pv,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_31761")}),(0,i.jsx)(Ba,{height:"3"})]}),s&&d&&(0,i.jsx)(Pv,{name:"recipients",value:"states",children:t("_certains_memb_35722")}),"states"===l.recipients&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{marginLeft:"$6"},children:(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:"campaign.states",placeholder:t("ajouter_des_sta_70922"),children:Rn.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"recipients",value:"positions",children:s?t("_certaines_cat_59188"):o(xb.CAMPAIGN_SEND,{positionCategoryId:"ANY"})?t("_certaines_cat_22161"):t("_certaines_mis_80674")})]}),(0,i.jsx)(vb,{recipients:l.recipients}),(0,i.jsx)(Ba,{height:"3"}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pv,{name:"recipients",value:"accreditations",children:t("_certaines_cat_14293")}),(0,i.jsx)(_b,{recipients:l.recipients}),(0,i.jsx)(Ba,{height:"3"})]}),(0,i.jsx)(Pv,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(Cb,{campaignType:e.formProps.values.campaign.campaignType,recipients:l.recipients,usersInfosIds:e.formProps.values.campaign.usersInfosIds}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(bb,{recipients:l.recipients}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:a,children:t("suivant_livra_97068")})})]})},kb=e=>{const{translate:t,params:{organizationId:n}}=cl(),[s,o]=(0,M.useState)(!0),[r,a]=(0,M.useState)(!0),[l,d]=(0,M.useState)([]);return(0,M.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await(t={organizationId:n},i=await q(),co("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),o(!1),a(!1)}var t,i})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Mm,{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},Ab=e=>{const t=Hn(),{form:n,handleSubmit:s,values:o}=e.formProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.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)(Rr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(n.change("campaign.segmentsIds",[]),n.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Rr.Yr,{name:"campaign.usersInfosIds",children:()=>{o.campaign.sendToEveryone&&o.campaign.usersInfosIds.length>0&&n.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Rr.Yr,{name:"campaign.segmentsIds",children:()=>{o.campaign.sendToEveryone&&o.campaign.segmentsIds.length>0&&n.change("campaign.segmentsIds",[])}}),(0,i.jsx)(Pv,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_83616")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(Cb,{campaignType:e.formProps.values.campaign.campaignType,recipients:o.recipients,usersInfosIds:e.formProps.values.campaign.usersInfosIds}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(kb,{recipients:o.recipients}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:s,children:t("suivant_livra_97068")})})]})},wb=e=>{const t=Hn(),{organizationId:n,eventId:s}=Zn(),[o,r]=(0,M.useState)(null),{mutate:a}=function(e={}){return Kn("mutation CampaignEstimate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaign: CampaignInput!\n) {\n campaignEstimate(organizationId: $organizationId, eventId: $eventId, campaign: $campaign) {\n numberOfRecipients\n price\n }\n}\n",e)}(),{form:l,handleSubmit:d,submitting:c,values:u}=e.formProps,h=(0,M.useMemo)(()=>{if(e.formProps.values.campaign.campaignType===ce.Email){const t=e.emailsSenders.find(t=>t.id===e.formProps.values.campaign.emailSenderId);return t&&!t.isValidToSendEmail}return!1},[e.emailsSenders,e.formProps.values.campaign.emailSenderId]);return(0,M.useEffect)(()=>{a({organizationId:n,eventId:s,campaign:e.formProps.values.campaign}).then(e=>{r(e.campaignEstimate)})},[]),o?(0,i.jsxs)(i.Fragment,{children:[h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ja,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_33410")}),(0,i.jsx)(Ba,{height:"4"})]}),(0,i.jsxs)(Ra,{gap:"1",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("nombre_de_desti_22505")}),(0,i.jsx)(br,{color:"gray800",children:t("_1_membre_49737",o.numberOfRecipients)})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsxs)(Ra,{gap:"1",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("prix_total_03054")}),(0,i.jsx)(br,{color:"gray800",children:0===o.price?t("gratuit_13712"):`${o.price}€`})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(jl,{disabled:h,isLoading:c,onClick:()=>{u.campaign.state!==de.Scheduled&&l.change("campaign.state",de.InProgress),d()},children:u.campaign.state===de.Scheduled?t("programmer_la_c_01938"):e.isEdit?t("mettre_jour_l_63945"):t("cr_er_et_envoye_81501")}),(0,i.jsx)(jl,{color:"white",isLoading:c,onClick:()=>{l.change("campaign.state",de.Draft),d()},children:t("enregistrer_en_81222")})]})]}):(0,i.jsx)(_l,{})},Sb=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl(),{showNotification:r}=ib(),a=Gn(Gv),l=e.initialValues.campaign.state===de.Template,d=(0,M.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.campaign.name):o(l?"cr_ation_d_un_m_50096":"cr_ation_d_une_80936"),[e.isEdit,e.initialValues]);Td(d);const c=[de.Done,de.InProgress].includes(e.initialValues.campaign.state),u=jI.CAMPAIGNS({organizationId:n,eventId:s});return(0,i.jsx)(zm,{category:d,fallbackClosePath:u,title:e.isEdit?e.initialValues.campaign.name:o(l?"nouveau_mod_le_74336":"nouvelle_campag_28814"),children:(0,i.jsx)(Em,{children:(0,i.jsxs)(Bv,{initialValues:e.initialValues,isEdit:e.isEdit,onSubmit:async n=>{await e.mutate(n.campaign),r(e.isEdit?o("la_campagne_a_50262"):o("la_campagne_a_02968")),t.goBack(u)},children:[(0,i.jsx)(Lv,{render:t=>(0,i.jsx)(pb,{formProps:t,isAdmin:e.isAdmin,isSent:c,isTemplate:l}),schema:a.campaignStep1Schema(),title:o(l?"initialisation_84842":"initialisation_48904")}),(0,i.jsx)(Lv,{render:t=>(0,i.jsx)(Mv,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,formProps:t,isEdit:e.isEdit,isSent:c,isTemplate:l}),schema:a.campaignStep2Schema(),title:o("contenu_29668")}),!l&&!c&&(0,i.jsx)(Lv,{render:t=>"event"===e.campaignType?(0,i.jsx)(yb,{formProps:t}):(0,i.jsx)(Ab,{formProps:t}),schema:a.campaignStep3Schema(),title:o("destinataires_19592")}),!l&&!c&&(0,i.jsx)(Lv,{render:t=>(0,i.jsx)(fb,{formProps:t,timeZone:e.timeZone}),schema:a.campaignStep4Schema(),title:o("livraison_86944")}),!l&&!c&&(0,i.jsx)(Lv,{render:t=>(0,i.jsx)(wb,{emailsSenders:e.emailsSenders,formProps:t,isEdit:e.isEdit}),schema:a.createUpdateCampaignSchema(),title:o("r_capitulatif_a_79107")})]})})})},Eb=e=>{const{organizationId:t,eventId:n,options:s}=Zn(),o=Gn(Gv),{data:r,loader:a}=Co({organizationId:t,eventId:n}),{mutate:l}=bo(),{event:d}=Jv();return a||(0,i.jsx)(Sb,{campaignType:n?"event":"organization",canCustomDocuments:d?.useDocuments??!1,customDocuments:r.organization?.event?.customDocuments??[],emailSenderId:r.organization?.event?.emailSender?.id??r.organization.emailSenderId,emailsSenders:r.organization.emailsSenders,initialValues:o.createUpdateCampaignValuesDefault(e.isTemplate,r.organization.emailSenderId,null,s),isAdmin:!0,isEdit:!1,mutate:async e=>{const{campaignCreate:{id:i}}=await l({organizationId:t,eventId:n,campaign:e});return i},timeZone:r.organization?.event?.timeZone??r.organization.timeZone})},Tb=()=>{const{organizationId:e,eventId:t,campaignId:n}=Zn(),{data:s,loader:o}=Yn("query CampaignToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $campaignId: CampaignId!\n) {\n organization(id: $organizationId) {\n emailsSenders {\n ...CreateCampaignEmailSender\n }\n }\n\n event(id: $eventId) {\n timeZone\n\n campaign(id: $campaignId) {\n ...CampaignEdit\n }\n\n customDocuments {\n slug\n name\n }\n\n emailSender {\n ... on EmailsSender {\n id\n }\n }\n }\n}\n",{organizationId:e,eventId:t,campaignId:n},[Ms.CreateCampaignEmailSenderFragment,Ms.CampaignEditFragment]),r=Gn(Gv),{mutate:a}=jo(),{event:l,isEventAdmin:d}=Jv();return o||(0,i.jsx)(Sb,{campaignType:"event",canCustomDocuments:l.useDocuments,customDocuments:s.event.customDocuments,emailSenderId:s.event.emailSender?.id,emailsSenders:s.organization.emailsSenders,initialValues:r.createUpdateCampaignValuesDefault(!1,s.event.emailSender?.id,s.event.campaign,null),isAdmin:d,isEdit:!0,mutate:async i=>{const{campaignUpdate:{id:s}}=await a({organizationId:e,eventId:t,campaignId:n,campaign:i});return s},timeZone:s.event.timeZone})},zb=()=>{const{organizationId:e,campaignId:t}=Zn(),{data:n,loader:s}=Yn("query CampaignOrganizationToEdit($organizationId: OrganizationId!, $campaignId: CampaignId!) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n campaign(id: $campaignId) {\n ...CampaignEdit\n }\n\n emailsSenders {\n ...CreateCampaignEmailSender\n }\n }\n}\n",{organizationId:e,campaignId:t},[Ms.CampaignEditFragment,Ms.CreateCampaignEmailSenderFragment]),o=Gn(Gv),{mutate:r}=jo();return s||(0,i.jsx)(Sb,{campaignType:"organization",canCustomDocuments:!1,customDocuments:[],emailSenderId:n.organization.emailSenderId,emailsSenders:n.organization.emailsSenders,initialValues:o.createUpdateCampaignValuesDefault(!1,n.organization.emailSenderId,n.organization.campaign,null),isAdmin:!0,isEdit:!0,mutate:async n=>{const{campaignUpdate:{id:i}}=await r({organizationId:e,campaignId:t,campaign:n});return i},timeZone:n.organization.timeZone})},Ob=e=>(0,i.jsx)(Ra,{...za(e),css:{background:"$gray50",flex:"1",padding:"$7",...e.css},direction:"column",children:e.children}),Rb=e=>(0,i.jsx)(Ra,{css:{background:"white",borderBottom:e.hideBorder?"":"1px solid $gray200",padding:"$6 $7"},...za(e),children:e.children}),$b=e=>(0,i.jsx)(Ra,{css:e.css,direction:"column",height:1,width:1,children:e.children}),Db=e=>{const t=Jn().pathname.includes(e.basePath||e.path);return(0,i.jsxs)(i.Fragment,{children:[e.disabled?(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray500",css:{borderBottom:"unset",paddingBlock:"$3"},children:e.children})}),(0,i.jsx)(_m,{placement:"top",children:e.disabledMessage})]}):(0,i.jsx)(Ha,{replace:!0,to:e.path,children:(0,i.jsx)(br,{color:t?"primary700":"gray500",css:{borderBottom:t?"2px solid $primary700":"unset",cursor:t?"inherit":"pointer",paddingBlock:"$3","&:hover":{color:t?"$primary800":"$gray800"}},children:e.children})}),(0,i.jsx)(br,{width:24})]})},Pb=e=>(0,i.jsxs)(Ra,{"aria-orientation":"horizontal",as:Ta.Nav,css:{borderBottom:"1px solid $gray200",...e.css},role:"tablist",width:1,children:[e.center&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{css:{flex:"1"}})}),e.children,(0,i.jsx)(br,{css:{flex:"1"}})]}),Fb=e=>(0,i.jsx)(i.Fragment,{children:e.children});Fb.displayName="TabPanel";const Mb=e=>{const[t,n]=(0,Xu.A)(M.Children.toArray(e.children),e=>M.isValidElement(e)&&e.type===Fb);return(0,i.jsxs)(Ra,{direction:"column",width:1,...za(e),children:[n,(0,i.jsx)(Cr.dO,{children:t.map((e,t)=>(0,i.jsx)(Cr.qh,{path:e.props.path,children:e},t))})]})},Nb=M.createContext({}),Lb=e=>(0,i.jsx)(Nb.Provider,{value:{...e},children:e.children}),Bb=e=>(0,i.jsxs)(br,{css:{background:"white",bd:!0,padding:"$6",width:"100%"},children:[(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:e.title}),(0,i.jsx)(br,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:e.content})]}),Vb=hr(Ra,{gap:"$3",variants:{avatarOnTop:{true:{flexDirection:"column",gap:"$2"},false:{alignItems:"center",flexDirection:"row"}}}}),Ub=e=>{const{params:{organizationId:t,eventId:n}}=cl(),s=M.useMemo(()=>m(e.userInfo.name)?e.userInfo.name:"-",[e.userInfo.name]),o=()=>(0,i.jsx)(br,{color:e.disabled?"gray300":"gray800",css:{ellipsis:""},disabled:e.disabled,fontWeight:"medium",title:s,children:s});return(0,i.jsxs)(Vb,{avatarOnTop:{"@initial":!!e.badge,"@tablet":!1},width:1,children:[(0,i.jsx)(qg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:e.size||40}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",justify:"center",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[e.isClickDisabled?o():(0,i.jsx)(Vc,{to:BI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.userInfo.id}),children:o()}),(0,i.jsx)(br,{css:{flexShrink:0},children:e.badge})]}),(0,i.jsx)(br,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.email,children:e.areContactLinksEnabled?(0,i.jsx)(Vc,{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)(br,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.phone?.internationalFormat,children:e.areContactLinksEnabled?(0,i.jsx)(Vc,{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 Wb(e){switch(e){case Se.Waiting:case Se.Queued:return{color:"warning",leftIcon:"hourglass-empty"};case Se.Bounced:return{color:"error",leftIcon:"circle-exclamation"};default:return{color:"success",leftIcon:"check"}}}const Gb=e=>{const{translate:t,params:{organizationId:n,eventId:s,campaignId:o}}=cl(),r=Gn(Wc),{mutate:a}=ir(),{mutate:l}=Wo();return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Ub,{userInfo:e.email.userInfo})}),(0,i.jsx)(yc,{children:e.email.sentAt?r.toLocaleString(e.email.sentAt.toLocal(),Zs.DateTime):""}),(0,i.jsxs)(yc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Jd,{...Wb(e.email.state),children:t(e.email.state)}),e.email.state===Se.Bounced&&m(e.email.infos?.bounceDiagnosticCode)&&(0,i.jsx)(br,{css:{ellipsis:!0},title:e.email.infos.bounceDiagnosticCode,width:1,children:e.email.infos.bounceDiagnosticCode})]}),(0,i.jsx)(Uc,{justify:"end",children:(0,i.jsx)(Bc,{children:(0,i.jsx)(Ld,{icon:"paper-plane",onClick:async()=>{e.emailType?await l({organizationId:n,eventId:s,userInfoId:e.email.userInfo.id,emailType:e.emailType}):await a({organizationId:n,eventId:s,campaignId:o,selecteds:{ids:[e.email.userInfo.id]}}),e.reload()},children:t("r_envoyer_90741")})})})]})},Hb=e=>{const{params:{organizationId:t,campaignId:n},translate:s}=cl(),[o,r,a]=Pc(""),[l,d]=(0,M.useState)(""),[c,u]=(0,M.useState)(0),{data:h,isLoading:g,reload:p}=Yn("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:m(r)?r:void 0,state:""!==l?l:void 0,offset:c},[Ms.EmailRecipientFragment]);const f=Rc();return(0,i.jsxs)(Ob,{direction:"column",gap:"7",children:[(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)(Bb,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(Bb,{content:e.campaign.numberOfOpen??0,title:s("nombre_d_ouvert_84187")}),(0,i.jsx)(Bb,{content:e.campaign.numberOfClick??0,title:s("nombre_de_clics_64232")})]}),(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{value:l,onChange:e=>{d(e),u(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),f(on.filter(e=>e!==Se.Queued))]})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{a(e),u(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Fc,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Fc,{children:s("status_06428")}),(0,i.jsx)(Fc,{width:100})]}),numberOfPages:h.organization?.campaign.emails.numberOfPages??0,offset:c,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:h.organization.campaign.emails.nodes.map((e,t)=>(0,i.jsx)(Gb,{email:e,emailType:null,reload:p},t))}),setOffset:u,title:s("liste_des_desti_16448"),totalCount:h.organization?.campaign.emails.totalCount??0})]})},qb=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=cl(),[a,l,d]=Pc(""),{usersInfosOptions:c,isLoading:u}=jb({organizationId:s,eventId:o,hasSelected:!0,nameDebounced:l,userInfoIds:[r],populationsIds:e.populationsIds});return(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7",...e.css},gap:"4",children:[(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:n("aper_u_pour_le_81451")}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(fc,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",name:a,placeholder:n("rechercher_un_m_05904"),state:"search",onChange:d}),values:[r],onChange:n=>{eo(n)&&t.replace(e.getPath(n[0]))},children:c})}),m(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})};function Yb(e){switch(e){case Ot.Assigned:return{color:"success",leftIcon:"check"};case Ot.Refused:return{color:"error",leftIcon:"xmark"};case Ot.PreAssigned:return{color:"pink",leftIcon:"wand-magic-sparkles"};case Ot.WaitingAssignment:return{color:"warning",leftIcon:"hourglass-empty"};case Ot.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return nl()}}function Kb(e){switch(e){case re.Accredited:return{color:"success",leftIcon:"check"};case re.AutoAccredited:return{color:"success",leftIcon:"bolt-auto"};case re.Refused:return{color:"error",leftIcon:"xmark"};case re.WaitingAccreditation:return{color:"warning",leftIcon:"hourglass-empty"};case re.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return nl()}}const Zb=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{getVolunteersSegmentPath:r}=M.useContext(Nb),a=(0,M.useMemo)(()=>e.campaign.positionsCategories.map(e=>({id:`pc-${e.id}`,name:e.name,link:ms.POSITION_CATEGORY({organizationId:s,eventId:o,positionCategoryId:e.id})})).concat(e.campaign.positions.map(e=>({id:`p-${e.id}`,name:e.name,link:ms.POSITION({organizationId:s,eventId:o,positionId:e.id})}))).concat(e.campaign.positionsSlots.map(e=>({id:`ps-${e.id}`,name:`${e.position.name} - ${e.nameOrRange}`,link:ms.POSITION({organizationId:s,eventId:o,positionId:e.position.id})}))).concat(e.campaign.tags.map(e=>({id:`t-${e.id}`,name:e.name,link:""}))),[e.campaign]),l=(0,M.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:Ji.ACCREDITATION({organizationId:s,eventId:o,accreditationId:e.id})}))).concat(e.campaign.accreditationsSlots.map(e=>({id:`as-${e.id}`,name:`${e.accreditation.name} - ${e.name}}`,link:Ji.ACCREDITATION({organizationId:s,eventId:o,accreditationId:e.accreditation.id})}))),[e.campaign]),d=(0,M.useMemo)(()=>l.length+a.length,[l,a]);return(0,i.jsxs)(Ra,{gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:n("_96502")}),e.campaign.sendToEveryone?(0,i.jsx)(br,{color:"gray800",children:n("tous_vos_membre_30731")}):eo(e.campaign.states)?(0,i.jsx)(Ra,{css:{flex:"1"},gap:"2",wrap:"wrap",children:e.campaign.states.map(e=>(0,i.jsx)(Jd,{...Yb(e),children:n(e)},e))}):eo(e.campaign.usersInfos)?(0,i.jsx)(Ra,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.usersInfos.map((n,r)=>(0,i.jsxs)(br,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(BI.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:n.id}))},children:[n.nameOrEmail,r!==e.campaign.usersInfos.length-1&&", "]},n.id))}):eo(e.campaign.segments)?(0,i.jsx)(Ra,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.segments.map((n,s)=>(0,i.jsxs)(br,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(r(n.id))},children:[n.name,s!==e.campaign.segments.length-1&&", "]},n.id))}):(0,i.jsx)(Ra,{css:{flex:"1"},gap:"1",wrap:"wrap",children:a.concat(l).map((e,n)=>(0,i.jsxs)(br,{color:m(e.link)?"primary700":"gray800",css:{cursor:m(e.link)?"pointer":"initial",textDecoration:"underline"},onClick:()=>{m(e.link)&&t.push(e.link)},children:[e.name,n!==d-1?", ":""]},e.id))})]})},Xb=e=>{const t=Hn(),n=(0,M.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)(Ra,{css:{background:"$gray50",minHeight:"100%",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Ra,{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)(Ra,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("cr_e_par_16667")}),(0,i.jsx)(br,{color:"gray800",children:e.createdBy})]}),(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.from&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("de_70487")}),(0,i.jsx)(br,{color:"gray800",children:e.from})]}),(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.to&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{margin:"0 $6"},width:1,children:(0,i.jsx)(Zb,{campaign:e.to})}),(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.subject&&(0,i.jsxs)(Ra,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("objet_86482")}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:e.subject})]}),e.content&&(0,i.jsxs)(Ra,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",flexGrow:"1",padding:"$7"},direction:"column",gap:"6",children:[(0,i.jsx)(br,{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})}),(eo(e.attachments)||eo(e.documents))&&(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textXl semiBold",children:t("pi_ces_jointes_36761")}),(0,i.jsx)(Ra,{gap:"2",children:(e.attachments||[]).map(e=>(0,i.jsx)(Jd,{color:"white",size:"md",children:HI.includes(e)?t(e):Jt.includes(e)?z_(e):e},e))}),(0,i.jsx)(Ra,{direction:"column",gap:"3",children:(e.documents||[]).map(e=>(0,i.jsx)(rv,{acl:"public-read",document:e},e.id))})]})]})]})})},Jb=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:s}}=cl(),{data:o,loader:r}=Wr({organizationId:e,campaignId:n,userInfoId:s}),a=(0,M.useMemo)(()=>o.organization?.campaign.createdBy?`${o.organization.campaign.createdBy.name} (${o.organization.campaign.createdBy.email})`:null,[o.organization]),l=(0,M.useMemo)(()=>o.organization?.campaign.emailSender?`${o.organization.campaign.emailSender.fromName} (${o.organization.campaign.emailSender.fromEmail})`:D.EMAIL_FROM,[o.organization]);return r||(0,i.jsx)(Ob,{children:(0,i.jsx)(Xb,{attachments:o.organization.campaign.attachments,content:o.organization.campaign.preview,createdBy:a,documents:o.organization.campaign.documents,from:l,subject:o.organization.campaign.subject,to:o.organization.campaign,userSelector:(0,i.jsx)(qb,{css:{border:"none",px:"$6"},getPath:i=>jI.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})})})})},Qb=({children:e,color:t,fontWeight:n,returnPathFallback:s})=>{const o=Xn();return(0,i.jsxs)(Ra,{align:"center",css:{color:"primary"===t?"$primary700":"$gray900",cursor:"pointer",fontSize:"textXl",fontWeight:n??"normal",padding:0},gap:"2",onClick:()=>o.goBack(s),children:[(0,i.jsx)(Ya,{icon:"arrow-left"}),e]})},ej=e=>{const{translate:t,params:{organizationId:n,eventId:s,campaignId:o}}=cl(),{isOrganizationAdmin:r}=_I(),{hasPermission:a}=Jv(),l=r||a(xb.CAMPAIGN_SEND);return(0,i.jsxs)(Rb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Qb,{returnPathFallback:jI.CAMPAIGNS({organizationId:n,eventId:s})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.campaign.name}),l&&(0,i.jsx)(jl,{to:jI.UPDATE({organizationId:n,eventId:s,campaignId:o}),children:t("_diter_la_campa_04069")})]})};function tj(e){switch(e){case kt.Waiting:return{color:"warning",leftIcon:"hourglass-empty"};case kt.Sent:case kt.Delivered:return{color:"success",leftIcon:"check"};default:return{color:"error",leftIcon:"circle-exclamation"}}}const nj=e=>(0,i.jsx)(br,{color:"gray800",css:{borderBottom:"1px solid $gray200",padding:"$6"},fontSize:"textXl",fontWeight:"medium",children:e.children}),ij=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"3",width:1,children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[e.message.createdBy&&(0,i.jsx)(br,{color:"gray800",textAlign:"end",children:e.message.createdBy.name}),(0,i.jsx)(br,{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)(br,{children:(0,i.jsx)(qg,{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)(M.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"3",width:1,children:[(0,i.jsx)(br,{children:(0,i.jsx)(qg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:40})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray800",children:e.userInfo.name}),(0,i.jsx)(br,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},width:1,children:unescape(t)})]})]})]},n))]}),sj=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("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)}(),[s,o]=(0,M.useState)(""),{numberOfCharacters:r,numberOfSms:a}=Dv(s,!1),l=m(s);return(0,i.jsxs)(Ra,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Nm,{label:(0,i.jsxs)(Ra,{justify:"between",children:[(0,i.jsx)(br,{children:t("contenu_de_la_r_08075")}),(0,i.jsx)(br,{color:"gray500",children:t("_1_caract_re_04414",r,a)})]}),value:s,onChange:o}),(0,i.jsx)(Ra,{justify:"end",children:(0,i.jsx)(jl,{disabled:!l,onClick:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,parentId:e.parentId,content:s}),e.reload()},children:t("envoyer_le_mess_41092")})})]})},oj=e=>{const t=Hn(),{data:n,loader:s,reload:o}=Yn("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},[Ms.CreatedByFragment]);const r=(0,M.useMemo)(()=>(0,ic.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)(hu,{size:"sm",onClose:e.onClose,children:[(0,i.jsx)(nj,{children:t("r_ponse_de_1_77675",e.userInfo.name)}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(mu,{children:[r.map((t,n)=>(0,i.jsx)(ij,{message:t,userInfo:e.userInfo},n)),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(gu,{children:(0,i.jsx)(sj,{eventId:e.eventId,organizationId:e.organizationId,parentId:e.textMessage.id,reload:o})})]})]})},rj=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=Gn(Wc),{mutate:r}=function(e={}){return Kn("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,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Ub,{userInfo:e.textMessage.userInfo})}),(0,i.jsx)(yc,{children:e.textMessage.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(yc,{children:e.textMessage.sentAt?o.toLocaleString(e.textMessage.sentAt,Zs.DateTime):""}),(0,i.jsx)(yc,{children:(0,i.jsx)(Jd,{...tj(e.textMessage.state),children:t(e.textMessage.state)})}),(0,i.jsx)(yc,{children:e.textMessage.numberOfReplies>0?(0,i.jsx)(jl,{color:"white",size:"sm",onClick:async t=>{Al(t),await r({organizationId:n,eventId:s,textMessageId:e.textMessage.id}),l(!0)},children:t("voir_la_reponse",e.textMessage.numberOfReplies)}):""})]}),a&&(0,i.jsx)(oj,{createdBy:e.createdBy,eventId:s,organizationId:n,text:e.text,textMessage:e.textMessage,userInfo:e.textMessage.userInfo,onClose:()=>{l(!1)}})]})},aj=e=>{const{params:{organizationId:t,campaignId:n},translate:s}=cl(),[o,r,a]=Pc(""),[l,d]=(0,M.useState)(""),[c,u]=(0,M.useState)(""),[h,g]=(0,M.useState)(0),{data:p,isLoading:f}=Yn("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:m(r)?r:void 0,state:""!==l?l:void 0,replies:""!==c?c:void 0,offset:h},[Ms.CreatedByFragment,Ms.CampaignUserInfoFragment]);const x=Rc(),{numberOfPages:_,totalCount:I}=vu(p.organization?.campaign.textMessages);return(0,i.jsxs)(Ob,{direction:"column",gap:"7",children:[(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)(Bb,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(Bb,{content:e.campaign.numberOfDelivery??0,title:s("nombre_de_messa_93859")}),(0,i.jsx)(Bb,{content:e.campaign.cost,title:s("co_t_de_la_camp_54312")})]}),(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{value:l,onChange:e=>{d(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),x(Tn)]})}),(0,i.jsx)(br,{width:240,children:(0,i.jsxs)(Au,{value:c,onChange:e=>{u(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:s("avec_et_sans_r_23765")}),x(En)]})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{a(e),g(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Fc,{children:s("Phone")}),(0,i.jsx)(Fc,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Fc,{children:s("status_06428")}),(0,i.jsx)(Fc,{children:s("r_ponses_97000")})]}),numberOfPages:_,offset:h,rows:f?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:p.organization.campaign.textMessages.nodes.map((t,n)=>(0,i.jsx)(rj,{createdBy:p.organization.campaign.createdBy,text:e.campaign.text,textMessage:t},n))}),setOffset:g,title:s("liste_des_desti_16448"),totalCount:I})]})},lj=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:s}}=cl(),o=Gn(Wc),{data:r,loader:a}=Wr({organizationId:e,campaignId:n,userInfoId:s}),l=r.organization?.campaign.sentAt?.setZone(Bs.c9.local().zone);return a||(0,i.jsx)(Ob,{children:(0,i.jsx)(Ra,{css:{background:"$gray50",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Ra,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",overflow:"hidden",paddingBottom:"$6"},direction:"column",gap:"3",width:640,children:[(0,i.jsx)(qb,{css:{border:"none",px:"$6"},getPath:i=>jI.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})}),(0,i.jsx)(br,{css:{px:"$6"},children:(0,i.jsx)(Zb,{campaign:r.organization.campaign})}),(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",height:"1px",px:"$6"}}),(0,i.jsxs)(Ra,{css:{px:"$6"},gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(br,{children:(0,i.jsx)(qg,{email:r.organization.campaign.createdBy.email,image:r.organization.campaign.createdBy.picture?.url,name:r.organization.campaign.createdBy.name,size:40})}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(r.organization.campaign.createdBy||l)&&(0,i.jsxs)(Ra,{gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:r.organization.campaign.createdBy.name}),l&&(0,i.jsx)(br,{color:"gray500",children:o.toLocaleString(l,Zs.DateTime)})]}),(0,i.jsx)(br,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},dangerouslySetInnerHTML:{__html:r.organization.campaign.preview}})]})]})]})})})},dj=()=>{const{params:{organizationId:e,eventId:t,campaignId:n},translate:s}=cl(),{data:o,loader:r}=Yn("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,M.useMemo)(()=>o.organization?t?o.organization.event?.volunteersRegistrations.nodes[0]?.userInfoId:o.organization.usersInfos.nodes[0].id:-1,[t,o.organization]);Td(`${o.organization?.campaign.name??""} ${s("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=oi([jI.CAMPAIGN(l(!1)),di.PREVIEW]);return r||(0,i.jsxs)($b,{children:[(0,i.jsx)(ej,{campaign:o.organization.campaign}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:jI.CAMPAIGN_DASHBOARD(l(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(Db,{basePath:c,disabled:!a,disabledMessage:s("vous_devez_avoir_2345"),path:jI.CAMPAIGN_PREVIEW(d(!1)),children:s("aper_u_25595")})]}),(0,i.jsx)(Fb,{path:jI.CAMPAIGN_DASHBOARD(l(!0)),children:o.organization?.campaign.campaignType===ce.Email?(0,i.jsx)(Hb,{campaign:o.organization?.campaign}):(0,i.jsx)(aj,{campaign:o.organization?.campaign})}),(0,i.jsx)(Fb,{path:jI.CAMPAIGN_PREVIEW(d(!0)),children:o.organization?.campaign.campaignType===ce.Email?(0,i.jsx)(Jb,{}):(0,i.jsx)(lj,{})})]})]})},cj=()=>{const{organizationId:e,eventId:t}=Zn();return(0,i.jsx)(Lb,{getVolunteersSegmentPath:n=>Os.VOLUNTEERS_SEGMENT(e,t,n),isOrganizationCampaign:!1,children:(0,i.jsx)(dj,{})})},uj=()=>{const{organizationId:e}=Zn();return(0,i.jsx)(Lb,{getVolunteersSegmentPath:t=>Os.COMMUNITY_USERS_SEGMENT(e,t),isOrganizationCampaign:!0,children:(0,i.jsx)(dj,{})})};function hj(e){switch(e){case Ce.Expired:return{color:"error",leftIcon:"clock"};case Ce.Full:return{color:"error",leftIcon:"hundred-points"};case Ce.Locked:return{color:"error",leftIcon:"lock-keyhole"};case Ce.Ongoing:return{color:"success",leftIcon:"check"};default:return nl()}}let mj=class extends Pl{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,s=eo(t?.delegationsCategories)&&t?.parentDelegation?t.delegationsCategories.find(e=>e.name===t.parentDelegation?.delegationCategory.name):null;let o=e?.delegationCategoryId??s?.id??t?.delegationCategoryId;return Number.isInteger(o)||(o=null),{...this.getDefaultAccreditations(e),delegationCategoryId:o,parentId:e?.parentId??t?.parentId??null,name:e?.name??"",description:e?.description??"",leadersIds:e?.leadersIds??t?.parentDelegation?.leadersIds??[],formId:i,deadlineDate:e?.deadlineDate??null,maxResources:e?.maxResources??null,showInDelegationSpace:e?.showInDelegationSpace??!0,showFormLinkInDelegationSpace:e?.showFormLinkInDelegationSpace??!0,columns:e?.columns??t?.parentDelegation?.columns??["name","accreditations","accreditation_state"],canLeadersAddMembers:e?.canLeadersAddMembers??!0,canLeadersDeleteMembers:e?.canLeadersDeleteMembers??!0,canLeadersEditColumns:e?.canLeadersEditColumns??!0,canLeadersEditCustomFields:e?.canLeadersEditCustomFields??!0,canLeadersEditMembers:e?.canLeadersEditMembers??!0,canLeadersImportMembers:e?.canLeadersImportMembers??!1,canLeadersSeeHiddenAccreditationsSlots:e?.canLeadersSeeHiddenAccreditationsSlots??!1,privateNote:e?.privateNote??t?.parentDelegation?.privateNote??"",addDefaultAccreditationsByAvailability:e?.addDefaultAccreditationsByAvailability??!1,tagsIds:e?.tagsIds??t?.parentDelegation?.tagsIds??[],customFields:e?.customFields||[],fields:e?.fields??{},campaignsIds:e?.campaignsIds??[],customDocumentsSlugs:e?.customDocumentsSlugs??[],usedCustomFieldsIds:e?.usedCustomFieldsIds??[]}}delegationInputSchema(){return d.Ik().shape({parentId:d.ai().nullable(),name:d.Yj().when("parentId",{is:null,then:e=>e.required(this.t("le_nom_de_la_d_10042"))}),description:d.Yj(),delegationCategoryId:d.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:d.YO().of(d.ai()),formId:d.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:Vm.typeError(this.t("la_date_limite_91708")).nullable(),maxResources:d.ai().min(0).nullable(),showInDelegationSpace:d.zM().required(),showFormLinkInDelegationSpace:d.zM().required(),columns:d.YO().of(d.Yj()).required(this.t("vous_devez_choi_82605")).min(1,this.t("vous_devez_choi_82605")),canLeadersAddMembers:d.zM().required(),canLeadersDeleteMembers:d.zM().required(),canLeadersEditColumns:d.zM().required(),canLeadersEditMembers:d.zM().required(),canLeadersEditCustomFields:d.zM().required(),canLeadersImportMembers:d.zM().required(),canLeadersSeeHiddenAccreditationsSlots:d.zM().required(),privateNote:d.Yj(),accreditations:d.YO().of(d.Ik().shape({accreditationCategoryId:d.ai().required(),accreditationId:d.ai().required(),maxResources:d.gl().nullable(),willAutoAccredit:d.zM().required()})),accreditationsSlots:d.YO().of(d.Ik().shape({accreditationCategoryId:d.ai().required(),accreditationId:d.ai().required(),accreditationSlotId:d.ai().required(),isDefault:d.zM().required(),maxResources:d.gl().nullable()})),campaignsIds:d.YO().of(d.ai()),customDocumentsSlugs:d.YO().of(d.gl()),usedCustomFieldsIds:d.YO().of(d.ai())})}createUpdateDelegationSchema(){return d.Ik().shape({delegation:this.delegationInputSchema()})}adminAddSchema(){return d.Ik().shape({usersInfosIds:d.YO().of(d.ai())})}getDefaultAccreditations(e){let t=e?.accreditations||[];const n=e?.accreditationsSlots||[];return to(t)&&eo(n)&&(t=(0,ch.A)(n,e=>e.accreditationId).map(e=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,maxResources:null,willAutoAccredit:!1}))),{accreditations:t,accreditationsSlots:n}}};mj=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],mj);var gj=n(2662);const pj=["key","name","acl"];let fj=class extends Pl{constructor(e){super(e)}documentInputDefault(){return{key:"",name:"",acl:""}}documentInputSchema(e){const t=m(e)?this.t("_1_est_requis_99856",e):this.t("le_document_est_86403");return d.Ik().shape({key:d.Yj().required(t),name:d.Yj().required(t),acl:d.Yj().required(t)})}documentInputSchemaNotRequired(){return d.Ik().shape({key:d.Yj(),name:d.Yj(),acl:d.Yj()})}};fj=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],fj);const xj=({onChange:e,css:t,label:n,description:s,value:o,hint:r,state:a,initialValue:l,icon:d,...c})=>{const u=Hn(),h=(0,M.useRef)(null),m=(0,$c.A)(t=>{e(t)},500),{inputId:g,descId:p,errorId:f}=Na();return(0,i.jsxs)(Ra,{css:t,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:g,isClickable:!1,children:n}),(0,i.jsx)(wl,{id:p,children:s}),(n||s)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(zl,{cursor:"default",icon:d,state:a,onClick:()=>{h.current?.click()},children:[(0,i.jsxs)(Ra,{align:"center",css:{flex:"1"},height:1,children:[(0,i.jsx)(br,{css:{background:o,borderRadius:"2px",height:"24px",width:"24px","& input":{background:"transparent",border:"none",borderRadius:"2px",cursor:"pointer",height:"24px",width:"24px","&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"2px",border:"none"},"&::-moz-color-swatch":{border:"none"}}},children:(0,i.jsx)("input",{ref:h,"aria-describedby":s?p:void 0,id:g,type:"color",value:o,onChange:e=>{m(e.target.value)},...c})}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(br,{color:"gray800",css:{flex:"1","& input[type=text]":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},height:1,onClick:Al,children:(0,i.jsx)("input",{"aria-describedby":s?p:void 0,"aria-errormessage":"error"===a?f:void 0,"aria-invalid":"error"===a,disabled:"disabled"===a,id:g,type:"text",value:o,onChange:t=>{e(t.target.value)},...c})})]}),l&&(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer",userSelect:"none"},fontWeight:"medium",onClick:t=>{Al(t),e(l)},children:u("remettre_sa_v_90478")})]}),(0,i.jsx)(Sl,{id:f,state:a,children:r})]})},_j=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Fa.D0,{name:e,render:o=>{const r=kl(o.meta);return(0,i.jsx)(xj,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onChange:e=>{o.input.onChange(e)},...s})}}),Ij=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Fa.D0,{name:e,render:o=>{const r=o.meta.data?.forceDisplayError&&o.meta.invalid||o.meta.touched&&o.meta.invalid;return(0,i.jsx)($u,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),vj=({onChange:e,prefix:t,state:n,withFileField:s,...o})=>{const r=`${t}key`,a=`${t}name`,l=`${t}acl`,d=[r,a,l];let c;return s&&(c=`${t}file`,d.push(c)),(0,i.jsx)(Y_,{names:d,render:t=>{let d=null;m(t[r].input.value)&&m(t[a].input.value)&&m(t[l].input.value)&&(d={key:t[r].input.value,name:t[a].input.value,acl:t[l].input.value});const{invalid:u,hint:h}=Object.values(t).reduce((e,t)=>e.invalid?e:kl(t.meta)?{invalid:!0,hint:t.meta.error||t.meta.submitError}:e,{invalid:!1,hint:void 0});return(0,i.jsx)(xv,{hint:h,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(),s&&(t[c].input.onChange(n?.file),t[c].input.onBlur(),n?.file&&e?.(n.file))},...o})}})},bj=hr("div",{alignItems:"center",borderRadius:"$1",color:"$gray600",cursor:"pointer",display:"flex",height:"40px",justifyContent:"center",width:"40px",variants:{active:{true:{background:"$primary200",color:"$primary700"},false:{"&:hover":{background:"$gray200",color:"$gray800"}}}}}),jj=({css:e,label:t,description:n,value:s,height:o,renderOnPortal:r,onChange:a,...l})=>{const d=Hn(),[c,u]=(0,M.useState)(!1),h=(0,M.useMemo)(()=>(0,ic.A)(mn.map(e=>({value:e,name:d(e)})),e=>e.name),[]);return(0,i.jsxs)(Ra,{css:e,direction:"column",width:1,children:[(0,i.jsx)(El,{children:t}),(0,i.jsx)(wl,{children:n}),(t||n)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Pd,{isOpen:c,onStateChange:u,children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(zl,{cursor:"pointer",icon:qa(s),rightIcon:c?"chevron-up":"chevron-down",...l,children:(0,i.jsx)(br,{css:{flex:"1"},children:d(s)})})}),(0,i.jsx)(Vd,{maxHeight:300,placement:"bottom",renderOnPortal:r,width:"match",children:(0,i.jsx)(Ra,{css:{px:"$2"},gap:"2",width:1,wrap:"wrap",children:h.map(e=>(0,i.jsx)(bj,{active:s===e.value,onClick:()=>{u(!1),a(e.value)},children:(0,i.jsx)(Ya,{icon:qa(e.value)})},e.value))})})]})]})},Cj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Fa.D0,{name:e,render:o=>{const r=kl(o.meta);return(0,i.jsx)(jj,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),yj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Fa.D0,{name:e,render:o=>{const r=kl(o.meta);return(0,i.jsx)(Au,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),kj=e=>{const{translate:t,params:{organizationId:n}}=cl(),s=Gn(fj),o=Gn(G_),r=Gn(su),a=Rc();if((0,M.useEffect)(()=>{e.slug===ne.Acronym||e.slug===ne.Address||e.slug===ne.Color||e.slug===ne.Description||e.slug===ne.Icon||e.slug===ne.Name||e.slug===st.Acronym||e.slug===st.Address||e.slug===st.Color||e.slug===st.Description||e.slug===st.Icon||e.slug===st.Name||e.slug===Ie.Description||e.slug===Ie.Name||e.customField?.fieldType===Le.Address||e.customField?.fieldType===Le.Country||e.customField?.fieldType===Le.Language||e.customField?.fieldType===Le.Nationality||e.customField?.fieldType===Le.Sex||e.customField?.fieldType===Le.Text||e.customField?.fieldType===Le.Textarea||e.customField?.fieldType===Le.Time?"string"!=typeof e.value&&e.change(e.name,""):e.slug===ne.AutoAccredit||e.slug===ne.WeezeventIsSynchronized||e.slug===fe.Privacy||e.slug===Ie.IsLocked||e.slug===Ie.ShowInDelegationSpace||e.slug===Ie.CanLeadersAddMembers||e.slug===Ie.CanLeadersEditCustomFields||e.slug===Ie.CanLeadersEditMembers||e.slug===Ie.CanLeadersDeleteMembers||e.slug===Ie.CanLeadersEditColumns||e.slug===Ie.CanLeadersImportMembers||e.slug===Ie.CanLeadersSeeHiddenAccreditationsSlots||e.slug===Ie.ShowFormLinkInDelegationSpace||e.customField?.fieldType===Le.Checkbox||e.customField?.fieldType===Le.Validation?"boolean"!=typeof e.value&&e.change(e.name,!1):e.slug===ne.Category||e.slug===Ie.Category||e.slug===st.Category?"number"!=typeof e.value&&e.change(e.name,e.categories[0]?.id):e.slug===ne.Index||e.slug===ne.Latitude||e.slug===ne.Longitude||e.slug===st.Latitude||e.slug===st.Longitude||e.slug===Ie.MaxResources||e.customField?.fieldType===Le.Number?"number"!=typeof e.value&&e.change(e.name,0):e.slug===ne.Tag||e.slug===st.Tag||e.slug===Ie.Campaigns||e.slug===Ie.Documents||e.slug===Ie.Tag||e.slug===st.Traces?Array.isArray(e.value)||e.change(e.name,[]):e.slug===Ie.DeadlineDate||e.customField?.fieldType===Le.Date||e.customField?.fieldType===Le.Datetime?Bs.c9.isDateTime(e.value)||m(e.value)||e.change(e.name,Bs.c9.invalid("Invalid")):e.customField?.fieldType===Le.File?null!==e.value&&"object"==typeof e.value||e.change(e.name,s.documentInputDefault()):e.customField?.fieldType===Le.Phone?null!==e.value&&"object"==typeof e.value||e.change(e.name,o.basePhoneInputDefault()):e.customField?.fieldType===Le.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===Ie.Form&&"number"!=typeof e.value&&e.change("massEdit.value",e.forms[0].id)},[e.customField,e.slug]),e.slug===ne.Acronym||e.slug===st.Acronym||e.slug===ne.Address||e.slug===st.Address||e.customField?.fieldType===Le.Address||e.customField?.fieldType===Le.Text)return(0,i.jsx)(Rl,{name:e.name});if(e.slug===ne.AutoAccredit||e.slug===ne.WeezeventIsSynchronized||e.slug===Ie.IsLocked||e.slug===Ie.ShowFormLinkInDelegationSpace||e.slug===Ie.ShowInDelegationSpace||e.slug===Ie.CanLeadersAddMembers||e.slug===Ie.CanLeadersEditCustomFields||e.slug===Ie.CanLeadersEditMembers||e.slug===Ie.CanLeadersDeleteMembers||e.slug===Ie.CanLeadersEditColumns||e.slug===Ie.CanLeadersImportMembers||e.slug===Ie.CanLeadersSeeHiddenAccreditationsSlots||e.customField?.fieldType===Le.Checkbox||e.customField?.fieldType===Le.Validation)return(0,i.jsxs)(yj,{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===fe.Privacy)return(0,i.jsxs)(yj,{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===ne.Category||e.slug===Ie.Category||e.slug===st.Category)return(0,i.jsx)(Mm,{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===ne.Color||e.slug===st.Color)return(0,i.jsx)(_j,{name:e.name});if(e.slug===ne.Description||e.slug===Ie.Description||e.slug===st.Description)return(0,i.jsx)(br,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(Tv,{name:e.name})});if(e.slug===ne.Icon||e.slug===st.Icon)return(0,i.jsx)(Cj,{name:e.name});if(e.slug===ne.Latitude||e.slug===st.Latitude)return(0,i.jsx)(Fm,{name:e.name});if(e.slug===ne.Longitude||e.slug===st.Longitude)return(0,i.jsx)(Fm,{name:e.name});if(e.slug===ne.Name||e.slug===st.Name)throw new Error("Should not happen");if(e.slug===Ie.Campaigns)return(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===Ie.Documents)return(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))});if(e.slug===ne.Tag||e.slug===st.Tag||e.slug===Ie.Tag)return(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.tags.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===st.Traces)return(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===ne.Index||e.slug===Ie.MaxResources||e.customField?.fieldType===Le.Number)return(0,i.jsx)(Rl,{name:e.name,shouldParseAsInt:!0});if(e.customField?.fieldType===Le.Country)return(0,i.jsx)(Mm,{isSearchVisible:!0,name:e.name,children:r.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))});if(e.slug===Ie.DeadlineDate||e.customField?.fieldType===Le.Date)return(0,i.jsx)(Dm,{name:e.name});if(e.customField?.fieldType===Le.Datetime)return(0,i.jsx)(Ij,{name:e.name});if(e.customField?.fieldType===Le.File){const t=e.customField.fieldProperty===Me.Picture?[lv.Images]:[lv.Images,lv.Pdf],s=e.customField.fieldProperty===Me.Picture?"public-read":"private";return(0,i.jsx)(vj,{accept:t,acl:s,organizationId:n,prefix:`${e.name}.`})}return e.customField?.fieldType===Le.Language?e.customField.fieldProperty===Me.Language?(0,i.jsxs)(yj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),a(hd)]}):(0,i.jsxs)(yj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),a(fn)]}):e.customField?.fieldType===Le.Nationality?(0,i.jsx)(Mm,{isSearchVisible:!0,name:e.name,children:r.getNationalitiesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):e.customField?.fieldType===Le.Phone?(0,i.jsx)(Z_,{prefix:`${e.name}.`}):e.customField?.fieldType===Le.Select?e.customField.canSelectMultiple?(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customField.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):(0,i.jsx)(Mm,{isSearchVisible:!0,name:e.name,placeholder:t("s_lectionnez_un_44130"),children:e.customField.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):e.customField?.fieldType===Le.Sex?(0,i.jsxs)(yj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_43620")}),a(Sn)]}):e.customField?.fieldType===Le.Textarea?(0,i.jsx)(Lm,{name:e.name}):e.customField?.fieldType===Le.Time?(0,i.jsx)(kv,{name:e.name}):e.slug===Ie.Form?(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):null},Aj=e=>(0,i.jsxs)(Ra,{css:{background:"$gray50",borderRadius:"$1",padding:"$6"},direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1",textTransform:"uppercase"},font:"gray800 textXs semiBold",children:e.title}),e.buttons]}),e.children]}),wj=e=>{const{translate:t}=cl(),n=e.customFields.find(t=>t.id===e.customFieldValues.customFieldId);return(0,i.jsxs)(Aj,{buttons:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),(0,i.jsx)(_m,{placement:"top",children:t("supprimer_43083")})]}),title:t("champ_de_formul_73221",e.index+1),children:[(0,i.jsxs)(Mm,{isSearchVisible:!0,label:t("CustomField"),name:`${e.field}.customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:t("s_lectionner_un_48159")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),n&&(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",n.name)}),(0,i.jsx)(kj,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:n,forms:[],name:`${e.field}.value`,slug:n.slug,tags:[],traces:[],value:e.customFieldValues.value}),n.fieldType===Le.Select&&n.canSelectMultiple&&(0,i.jsx)($m,{name:`${e.field}.addValues`,children:t("ajouter_les_val_22996")})]})]})},Sj=e=>{const t=Hn();return(0,i.jsxs)(i.Fragment,{children:[e.values.map((t,n)=>{const s=`${e.name}[${n}]`;return(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(wj,{change:e.change,customFieldValues:e.values[n],customFields:e.customFields,field:s,index:n,remove:()=>{e.change(e.name,oo(e.values,n))}})]},n)}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsxs)(br,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:["+ ",t("ajouter_un_nouv_22370")]})]})},Ej=e=>(0,i.jsx)(Ra,{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)(Ra,{align:"center",css:{background:`$${e.color}100`,borderRadius:"32px"},height:32,justify:"center",width:32,children:(0,i.jsx)(Ya,{icon:e.icon})})}),Tj=e=>{const t=Hn(),n=Gn(Da),s=Na();return(0,i.jsx)(Qc,{size:e.size||"sm",onClose:e.onClose,children:(0,i.jsx)(fl,{css:{overflow:"hidden"},direction:"column",height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:n=>{const{handleSubmit:o,submitting:r}=n;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:e.icon})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",id:s.labelId,textAlign:"center",children:e.title}),e.subtitle&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",id:s.descId,textAlign:"center",children:e.subtitle})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(hl,{errorId:s.errorId}),(0,i.jsx)(Ra,{css:{overflowY:"auto"},direction:"column",children:"function"==typeof e.children?e.children(n):e.children}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:r,onClick:o,children:e.buttonText}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},validate:t=>e.schema?n.validateForForm(e.schema)(t):{},onSubmit:e.onSubmit})})},zj=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("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)(Tj,{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)(Rl,{label:t("nom_du_tag_95054"),name:"name"})})},Oj=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.tags),[o,r]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mm,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(_v,{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))}),o&&(0,i.jsx)(zj,{organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:t=>{s([...n,t]),e.change(`${e.name}tagsIds`,[...e.tagsIds,t.id])}})]})},Rj=/^[0-9]{11}$/i,$j=Bs.c9.now().year-2e3;function Dj(e){if(m(e)&&Rj.test(e)){const t=(0,gj.A)(e.substring(0,2),10);let n=(0,gj.A)(e.substring(0,9),10);const i=(0,gj.A)(e.substring(9),10);return t<=$j&&(n=2e9+n),i===97-n%97}return!1}const Pj=/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/,Fj={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};let Mj=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 Le.Text:case Le.Textarea:case Le.Time:case Le.Address:return t[e.slug]||"";case Le.Sex:return this.getSexValue(e,t);case Le.Language:return this.getLanguageValue(e,t);case Le.Nationality:return this.getNationalityValue(e,t);case Le.Country:return this.getCountryValue(e,t);case Le.Select:return this.getSelectValue(e,t);case Le.Checkbox:case Le.Validation:return this.getBooleanValue(e,t);case Le.Date:return this.getDateValue(e,t,n.dateFormat);case Le.Datetime:return this.getDatetimeValue(e,t,n.datetimeFormat);case Le.File:return"name"===n.fileReturnValue?t[e.slug]?.name||"":t[e.slug]?.url||"";case Le.Phone:return this.getPhoneValue(e,t);case Le.Number:return this.getIntValue(e,t);default:return nl(e.fieldType)}}getValue(e,t){return t[e.slug]}getSelectValues(e,t){const n=Qs(this.getValue(e,t)??[]);return(0,Va.A)(n.map(t=>e.values.find(e=>e.id===t)?.value))}getSexValue(e,t){return this.translationService.translate(this.getValue(e,t)??"")}getLanguageValue(e,t){return this.translationService.translate(this.getValue(e,t)??"")}getNationalityValue(e,t){return this.countriesService.getNationality(this.getValue(e,t)??"")??""}getCountryValue(e,t){return this.countriesService.getName(this.getValue(e,t)??"")??""}getBooleanValue(e,t){const n=this.getValue(e,t);return!0===n?this.translationService.translate("oui_54361"):!1===n?this.translationService.translate("non_33516"):""}getDateValue(e,t,n){let i=this.getValue(e,t);return m(i)&&(i=Bs.c9.fromISO(i,{zone:"utc"})),Bs.c9.isDateTime(i)&&i.isValid?m(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,Zs.DateOnly.MonthLong):""}getDatetimeValue(e,t,n){let i=this.getValue(e,t);return m(i)&&(i=Bs.c9.fromISO(i,{zone:"utc"})),Bs.c9.isDateTime(i)&&i.isValid?m(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=Qs(this.getValue(e,t)??[]);return(0,Va.A)(n.map(t=>e.values.find(e=>e.id===t)?.value)).join(", ")}};Mj=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],Mj);const Nj=[Le.Country,Le.Language,Le.Nationality,Le.Select];function Lj(e,t,n){if(e.hasCondition&&e.conditionCustomField){const i=n.find(t=>t.id===e.conditionCustomField.id);if(i){if(Lj(i,t,n)){const n=t[e.conditionCustomField.slug];return"boolean"==typeof n&&e.conditionCustomField.fieldType===Le.Checkbox?n===e.conditionValue:!(!Nj.includes(e.conditionCustomField.fieldType)||!eo(e.conditionValue))&&(0,lh.A)(Qs(n),e.conditionValue).length>0}return!1}return!1}return!0}const Bj=hd.concat(fn);let Vj=class extends Pl{countriesService;documentInputService;phoneInputService;translationService;constructor(e,t,n,i){super(i),this.countriesService=e,this.documentInputService=t,this.phoneInputService=n,this.translationService=i}fieldsUpdateInputDefault(e,t,n,i){return Object.fromEntries(t.map(t=>{const s=this.getFieldValue(e,t);return[t.slug,s??this.fieldUpdateInputDefault(t,n,i)]}))}fieldSchema(e,t){const n=(n,i)=>{if(e.conditionCustomField)return d.Ik().when(e.conditionCustomField.slug,([s])=>t&&(e.conditionCustomField.fieldType===Le.Checkbox&&s===e.conditionValue||Nj.includes(e.conditionCustomField.fieldType)&&eo(e.conditionValue)&&(0,lh.A)(Qs(s),e.conditionValue).length>0)?n():i());{let e;return e=t?n():i(),e}};switch(e.fieldType){case Le.File:return n(()=>this.documentInputService.documentInputSchema(e.name),()=>this.documentInputService.documentInputSchemaNotRequired());case Le.Phone:return n(()=>this.phoneInputService.phoneInputSchema(),()=>this.phoneInputService.phoneInputSchemaNotRequired());case Le.Text:case Le.Textarea:case Le.Time:case Le.Address:return e.fieldProperty===Me.Eid?n(()=>d.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"),Dj),()=>d.Yj()):e.fieldSubtype!==Ne.Freeform?n(()=>d.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=>{switch(e.fieldSubtype){case Ne.Eid:return Dj(t);case Ne.Avs:return function(e){if(m(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 Ne.Iban:return function(e){if(m(e)){const t=e.toUpperCase().trim().replace(/\s+/g,"");if(Pj.test(t)){const e=t.substring(0,2);if(t.length===Fj[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 Ne.Freeform:return!0;default:return nl(e.fieldSubtype)}}),()=>d.Yj()):n(()=>d.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj());case Le.Number:return n(()=>d.ai().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.ai().nullable());case Le.Checkbox:return n(()=>d.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.zM());case Le.Validation:return n(()=>d.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)),()=>d.zM());case Le.Select:return e.canSelectMultiple?n(()=>d.YO().of(d.ai().required()).required(this.t("_1_est_requis_99856",e.name)).min(1,this.t("vous_devez_s_le_55757",e.name)),()=>d.YO().of(d.ai())):n(()=>d.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)),()=>d.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))));case Le.Date:case Le.Datetime:return n(()=>Vm.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)),()=>d.gl().nullable());case Le.Sex:return n(()=>d.Yj().oneOf(Sn,this.oneOfMessage(e.name,Sn)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj().oneOf(Sn,this.oneOfMessage(e.name,Sn)));case Le.Language:return n(()=>d.Yj().oneOf(Bj,this.oneOfMessage(e.name,Bj)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj().oneOf(Bj,this.oneOfMessage(e.name,Bj)));case Le.Nationality:case Le.Country:return n(()=>d.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)),()=>d.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)));default:return nl(e.fieldType)}}fieldUpdateInputDefault(e,t,n){switch(e.fieldType){case Le.Checkbox:case Le.Validation:return!!n&&void 0;case Le.File:return this.documentInputService.documentInputDefault();case Le.Phone:return this.phoneInputService.phoneInputDefault(t);case Le.Select:return e.canSelectMultiple?[]:void 0;case Le.Address:case Le.Date:case Le.Datetime:case Le.Language:case Le.Number:case Le.Sex:case Le.Text:case Le.Textarea:case Le.Time:return;case Le.Country:return t.user.country;case Le.Nationality:return t.user.nationality;default:return nl(e.fieldType)}}getFieldValue(e,t){const n=e[t.slug];return t.fieldType===Le.Phone&&n?(0,yr.A)(n,W_):t.fieldType===Le.File?(0,yr.A)(n,pj):t.fieldType===Le.Date&&n?Bs.c9.fromISO(n,{zone:"UTC"}):n}};Vj=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,fj,G_,Vn])],Vj);const Uj=({formattedAddressProps:e,latitudeProps:t,longitudeProps:n,placeProps:s,...o})=>{const r=(0,M.useRef)(null);return(0,M.useEffect)(()=>{const i=new google.maps.places.Autocomplete(r.current,{types:["geocode"]});i.addListener("place_changed",async()=>{const o=i.getPlace(),r=o.geometry.location.lat(),a=o.geometry.location.lng();e.input.onChange(o.formatted_address),t?.input.onChange(r),n?.input.onChange(a),s?.input.onChange(o)})},[]),(0,i.jsx)(Ol,{ref:r,value:e.input.value,onBlur:e.input.onBlur,onChange:e.input.onChange,onFocus:e.input.onFocus,...o})},Wj=({addressName:e,latitudeName:t,longitudeName:n,placeName:s,...o})=>{const r=[e];return t&&r.push(t),n&&r.push(n),s&&r.push(s),(0,i.jsx)(Y_,{names:r,render:r=>(0,i.jsx)(Uj,{formattedAddressProps:r[e],latitudeProps:t?r[t]:void 0,longitudeProps:n?r[n]:void 0,placeProps:s?r[s]:void 0,...o})})},Gj=e=>{const t=Hn();return(0,i.jsxs)(Ra,{gap:"4",width:1,children:[(0,i.jsx)(br,{css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden"},height:126,width:126,children:(0,i.jsx)("img",{height:"126px",src:e.url,width:"126px"})}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray400",children:e.hint})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",onClick:e.onDelete,children:t("supprimer_43083")})]})]})},Hj=e=>(0,i.jsxs)(Ra,{gap:"4",width:1,children:[(0,i.jsx)(Ra,{align:"center",css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,children:(0,i.jsx)(Ra,{height:64,width:64,children:(0,i.jsx)(xl,{color:mr.colors.gray900.value,height:"64px",strokeWidth:"4",width:"64px"})})}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray400",children:e.hint})]})]})]}),qj=({value:e,onChange:t,label:n,hint:s,organizationId:o,...r})=>{const[a,l]=(0,M.useState)(e?fv.File:fv.Uploader);return a===fv.File&&e?(0,i.jsx)(Gj,{hint:s,label:n,url:QI(e,D.HEAVENT_AWS_UPLOADS_BUCKET),onDelete:()=>{t(null),l(fv.Uploader)}}):a===fv.Uploading?(0,i.jsx)(Hj,{hint:s,label:n}):(0,i.jsx)(mv,{hint:s,label:n,onChange:async e=>{l(fv.Uploading);try{const n=await JI(o,e,"public-read");t(n),l(fv.File)}catch{l(fv.Uploader)}},...r})},Yj=({prefix:e,...t})=>{const n=`${e}key`,s=`${e}name`,o=`${e}acl`;return(0,i.jsx)(Y_,{names:[n,s,o],render:e=>{let r=null;return m(e[n].input.value)&&m(e[s].input.value)&&m(e[o].input.value)&&(r={key:e[n].input.value,name:e[s].input.value,acl:e[o].input.value}),(0,i.jsx)(qj,{value:r,onChange:t=>{e[n].input.onChange(t?.key??""),e[s].input.onChange(t?.name??""),e[o].input.onChange(t?.acl??"")},...t})}})},Kj=e=>{const t=Hn(),n=Rc(),s=Gn(su),o=Gn(Vj),r=e.isMandatory?e.field.name:(0,i.jsx)(_v,{children:e.field.name}),a=`${e.prefix}${e.field.slug}`,l=e.field.description,d=(0,M.useMemo)(()=>a.startsWith("formRegister.userInfo.fields."),[a]);if((0,M.useEffect)(()=>{e.display||e.change(a,o.fieldUpdateInputDefault(e.field,s.getDefaultCountryValues()))},[e.display,e.field,e.change]),!e.display)return null;switch(e.field.fieldType){case Le.Text:return(0,i.jsx)(Rl,{description:l,label:r,name:a});case Le.Textarea:return(0,i.jsx)(Lm,{description:l,label:r,name:a});case Le.Checkbox:return(0,i.jsx)($m,{name:a,subtext:l,children:r});case Le.Validation:return(0,i.jsx)($m,{name:a,subtext:(0,i.jsxs)(i.Fragment,{children:[m(l)&&(0,i.jsx)("span",{children:l}),m(l)&&e.field.document&&(0,i.jsx)("br",{}),e.field.document&&(0,i.jsx)(Vc,{css:{color:"$primary700"},download:e.field.document.name,to:e.field.document.url,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:t("consulter_le_do_69928")})]}),children:r});case Le.Select:return e.field.canSelectMultiple?(0,i.jsx)(Mm,{description:l,isSearchVisible:!0,isSelectAllVisible:!0,label:r,multiple:!0,name:a,children:e.field.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):(0,i.jsx)(Mm,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:e.field.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))});case Le.Date:return"dateOfBirth"===e.field.slug?(0,i.jsx)(Dm,{autoComplete:d?"bday":void 0,description:l,label:r,max:Bs.c9.now(),name:a}):(0,i.jsx)(Dm,{description:l,label:r,name:a});case Le.Datetime:return(0,i.jsx)(Ij,{description:l,label:r,name:a});case Le.Time:return(0,i.jsx)(kv,{description:l,label:r,name:a});case Le.Phone:return(0,i.jsx)(Z_,{description:l,label:r,prefix:`${a}.`});case Le.Number:return(0,i.jsx)(Rl,{description:l,label:r,name:a,shouldParseAsInt:!0});case Le.Sex:return(0,i.jsxs)(yj,{autoComplete:d?"sex":void 0,description:l,label:r,name:a,children:[(0,i.jsx)("option",{disabled:!0,value:"",children:t("choisir_une_val_00277")}),n(Sn)]});case Le.Language:return e.field.fieldProperty===Me.Language?(0,i.jsx)(Mm,{autoComplete:d?"language":void 0,description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:n(hd)}):(0,i.jsx)(Mm,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:n(fn)});case Le.Nationality:return(0,i.jsx)(Mm,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s.getNationalitiesIdName(e.countryCode).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});case Le.Address:return(0,i.jsx)(Wj,{addressName:a,autoComplete:d?"street-address":void 0,description:l,label:r,placeName:e.field.fieldProperty===Me.Street?"place":void 0});case Le.Country:return(0,i.jsx)(Mm,{autoComplete:d?"country":void 0,description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s.getCountriesIdName(e.countryCode).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});case Le.File:return e.field.fieldProperty===Me.Picture?(0,i.jsx)(Yj,{allowCrop:!0,hint:l,label:r,organizationId:e.organizationId,prefix:`${a}.`}):(0,i.jsx)(vj,{accept:[lv.Images,lv.Pdf],acl:e.fileAcl??"private",description:l,label:r,organizationId:e.organizationId,prefix:`${a}.`});default:return nl(e.field.fieldType)}},Zj=e=>{const t=Hn(),[n,s]=(0,M.useState)(""),o=(0,M.useMemo)(()=>{if(m(n)){const t=n.trim().toLowerCase();return e.customFields.filter(e=>e.name.trim().toLowerCase().includes(t)||m(e.label)&&e.label.trim().toLowerCase().includes(t))}return e.customFields},[e.customFields,n]),r=(0,M.useMemo)(()=>(0,ic.A)(Object.entries((0,nc.A)(o,e=>e.category.name)),([e])=>e).map(([e,t])=>[e,(0,ic.A)(t,e=>e.name)]),[o]);return(0,i.jsxs)(Ra,{css:{padding:"$3"},direction:"column",width:1,children:[(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:n,onChange:s}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{css:{maxHeight:"300px",overflowY:"auto"},children:r.map(([n,s],o)=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(rc,{index:o,children:n}),s.map(n=>n.conditionCustomField&&!e.selectedCustomFieldsIds.has(n.conditionCustomField.id)?(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsxs)(Ra,{align:"center",css:{px:"$3"},gap:"3",height:40,width:1,children:[(0,i.jsx)(lc,{disabled:!0,shouldPreventDefault:!1,state:"unchecked",onClick:Hl.A}),(0,i.jsx)(br,{color:"gray400",css:{ellipsis:!0,flex:"1"},title:n.name,children:n.name})]},n.id)}),(0,i.jsx)(_m,{placement:"top-start",children:t("ce_champ_d_pend_31209",n.conditionCustomField?.name)})]},n.id):(0,i.jsx)(mc,{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))]},o))})]})},Xj=e=>{const{translate:t}=cl();return(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",children:t("ajouter_97327")})}),(0,i.jsx)(Vd,{placement:"top-start",width:400,children:(0,i.jsx)(Zj,{customFields:e.customFields,selectedCustomFieldsIds:e.usedCustomFieldsIds,toggle:e.toggle})})]})},Jj=e=>{const{translate:t}=cl();return(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("aucun_champ_per_21094")}),(0,i.jsx)(Xj,{customFields:e.customFields,toggle:e.toggle,usedCustomFieldsIds:e.usedCustomFieldsIds})]})},Qj=e=>{const{params:{organizationId:t}}=cl(),n=(0,M.useMemo)(()=>e.customFields.filter(t=>e.usedCustomFieldsIds.includes(t.id)),[e.customFields,e.usedCustomFieldsIds]),s=(0,M.useMemo)(()=>new Set(e.usedCustomFieldsIds),[e.usedCustomFieldsIds]),o=(0,M.useCallback)(t=>{s.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,s]);return(0,i.jsx)(Ra,{children:eo(e.usedCustomFieldsIds)?(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:[n.map(n=>(0,i.jsxs)(Ra,{align:"end",gap:"3",children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Kj,{change:e.change,display:!0,field:n,fileAcl:"public-read",isMandatory:!1,organizationId:t,prefix:`${e.prefix}fields.`})}),(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",onClick:()=>o(n)})]},n.id)),(0,i.jsx)(Xj,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})]}):(0,i.jsx)(Jj,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})})},eC=e=>{const t=Hn();return(0,i.jsxs)(Pd,{doNotCloseOnOtherOpen:!0,isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(br,{children:(0,i.jsxs)(jl,{color:e.color,leftIcon:"bars-filter",children:[t("filtres_64574")," ",(e.numberOfAppliedFilters||0)>0?`(${e.numberOfAppliedFilters})`:""]})})}),(0,i.jsx)(Vd,{placement:"bottom-end",width:385,children:(0,i.jsxs)(Ra,{direction:"column",onChange:Al,children:[(0,i.jsxs)(Ra,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),e.children]}),e.showButtons&&(0,i.jsxs)(Ra,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:e.reinit,children:t("r_initialiser_77538")}),(0,i.jsx)(jl,{size:"sm",onClick:e.apply,children:t("appliquer_05753")})]})]})})]})};function tC(e){return`${e.name}${m(e.acronym)?` (${e.acronym})`:""}`}function nC(e,t,n,i,s){return i.accreditationDisplay!==ut.None&&!i.hiddenAccreditationsIds.includes(e.id)&&(0===i.displayedAccreditationsIds.length||i.displayedAccreditationsIds.includes(e.id))&&bh(e,n)&&(!e.hasSlots||e.slots.some(e=>Sh(e,t,i,s)))||s.some(n=>n.accreditationId===e.id&&(!e.hasSlots||e.slots.some(e=>Sh(e,t,i,s))))}function iC(e){return sC(e.map(({accreditationSlot:e})=>e))}function sC(e){return(0,ic.A)(Object.values((0,nc.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:m(n.acronym)?n.acronym:n.name,minDate:(0,dh.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,index:t,text:n,minDate:i})=>[e.toLowerCase(),oC(t),n.toLowerCase(),i])}function oC(e){return"number"!=typeof e||isNaN(e)?"9999":e.toString(10).padStart(4,"0")}function rC(e){return(0,ic.A)(e,e=>[e.accreditationCategoryName||"",oC(e.index),e.name.toLowerCase()])}function aC(e,t,n,i,s){let o;const r=t.map(e=>e.accreditationId);if(n){const t={accreditationCategoryId:i.accreditationCategoryId,accreditationId:i.accreditationId,maxResources:null,willAutoAccredit:!0};o=(0,ch.A)([...e,t],e=>e.accreditationId)}else o=e.filter(e=>r.includes(e.accreditationId));s("delegation.accreditations",o)}const lC=({accreditationCategoryId:e,accreditationId:t,accreditationName:n,accreditationSlotsIdsValues:s,change:o,slot:r,values:a})=>{const l=Gn(Wc),d=(0,M.useMemo)(()=>s.includes(r.id),[s]);return(0,i.jsx)(dc,{state:d?"checked":"unchecked",onClick:()=>{const n={accreditationCategoryId:e,accreditationId:t,accreditationSlotId:r.id,isDefault:!1,isVisible:!0},i=d?a.accreditationsSlots.filter(e=>e.accreditationSlotId!==r.id):[...a.accreditationsSlots,n];o("delegation.accreditationsSlots",i),aC(a.accreditations,i,!d,n,o)},children:wh(l,r,n)})},dC=({accreditationCategoryId:e,accreditation:t,accreditationSlotsIdsValues:n,change:s,fullAccreditation:o,values:r})=>{const a=Hn(),[l,d]=(0,M.useState)(!0),c=(0,M.useMemo)(()=>!o.slots.some(e=>!n.includes(e.id)),[t.slots,n]),u=eo((0,M.useMemo)(()=>r.accreditationsSlots.filter(e=>e.accreditationId==t.id),[r])),h=(e,t,n)=>{const i=e?[...r.accreditationsSlots,...n]:r.accreditationsSlots.filter(e=>e.accreditationId!==t);s("delegation.accreditationsSlots",i),aC(r.accreditations,i,e,n[0],s)};return o.hasSlots?(0,i.jsxs)(Ra,{css:{padding:"$4 0",borderRadius:"5px",border:"1px solid $gray200",boxShadow:"$xs",background:"$white"},direction:"column",gap:"4",children:[(0,i.jsxs)(Ra,{css:{padding:"0 $5"},children:[(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer"},gap:"2",onClick:()=>{d(!l)},children:[(0,i.jsx)(Ya,{icon:l?"chevron-down":"chevron-up"}),t.name]}),(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsx)(jl,{color:"invisible",onClick:()=>{const n=t.slots.map(n=>({accreditationCategoryId:e,accreditationId:t.id,accreditationSlotId:n.id,isDefault:!1,isVisible:!0}));h(!c,t.id,n)},children:a(c?"tout_des_lectio_13935":"tout_s_lectionn_48027")})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ra,{css:{padding:"0 $5"},direction:"column",gap:"4",children:t.slots.toSorted((e,t)=>{if(e.date&&t.date){const n=e.date.toJSDate(),i=t.date.toJSDate();return ni?1:0}return e.namet.name?1:0}).map(o=>(0,i.jsx)(lC,{accreditationCategoryId:e,accreditationId:t.id,accreditationName:t.name,accreditationSlotsIdsValues:n,change:s,slot:o,values:r},o.id))})]})]}):(0,i.jsx)(dc,{css:{padding:"$4 $5",borderRadius:"5px",border:"1px solid $gray200",boxShadow:"$xs",background:"$white"},state:u?"checked":"unchecked",onClick:()=>{const n=[{accreditationCategoryId:e,accreditationId:t.id,accreditationSlotId:t.hiddenSlotId,isDefault:!1,isVisible:!0}];h(!u,t.id,n)},children:t.name})},cC=({accreditationCategory:e,accreditationSlotsIdsValues:t,change:n,fullAccreditationCategory:s,values:o})=>{const r=(0,M.useMemo)(()=>rC(e.accreditations),[e.accreditations]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray500",fontSize:"textSm",children:e.name}),r.map(r=>(0,i.jsx)(dC,{accreditation:r,accreditationCategoryId:e.id,accreditationSlotsIdsValues:t,change:n,fullAccreditation:s.accreditations.find(e=>e.id===r.id),values:o},r.id))]})},uC=({allAccreditationCategories:e,change:t,eventStartAt:n,eventEndAt:s,setIsAddAccreditationOpen:o,values:r})=>{const{params:{organizationId:a,eventId:l,delegationId:d},translate:c}=cl(),[u,h]=(0,M.useState)(""),[m,p]=(0,M.useState)([]),[f,x]=(0,M.useState)([]),[_,I]=(0,M.useState)(Bs.c9.invalid("Invalid")),v=(0,M.useMemo)(()=>r.accreditationsSlots.flatMap(e=>e.accreditationSlotId),[r]),b=(0,M.useMemo)(()=>e.flatMap(e=>e.accreditations),[e]),j=(0,M.useMemo)(()=>(0,ic.A)(e.flatMap(e=>{const t=to(m)||m.includes(e.id),n=e.accreditations.flatMap(e=>{const t=(g(u)||(n=e.name,i=u,n.toUpperCase().includes(i.toUpperCase())))&&(to(f)||f.includes(e.id));var n,i;const s=e.slots.filter(e=>!_?.isValid||!e.date?.isValid||e.date.equals(_));return t&&(to(e.slots)||eo(s))?[{...e,slots:s}]:[]});return t&&eo(n)?[{...e,accreditations:n}]:[]}),e=>e.name.toLowerCase()),[u,m,f,_]);return(0,i.jsxs)(hu,{returnToFallback:as.DELEGATION_ACCREDITATIONS({organizationId:a,eventId:l,delegationId:d}),size:"md",onClose:()=>{o(!1)},children:[(0,i.jsxs)(mu,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray900 textXl medium",children:c("add_an_accreditation")}),(0,i.jsx)(br,{color:"gray500",children:c("add_default_accreditations_to_delegation")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"3",justify:"evenly",children:[(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:c("rechercher_une_65646"),value:u,onChange:e=>{h(e)}}),(0,i.jsxs)(eC,{color:"gray",showButtons:!1,children:[(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,label:c("cat_gories_24533"),multiple:!0,renderOnPortal:!0,values:m,onChange:p,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,label:c("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:f,onChange:x,children:b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Tu,{label:"Date",max:s,min:n,value:_,onChange:I})]})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Ra,{direction:"column",gap:"4",children:j.map(n=>(0,i.jsx)(cC,{accreditationCategory:n,accreditationSlotsIdsValues:v,change:t,fullAccreditationCategory:e.find(e=>e.id===n.id),values:r},n.id))}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(gu,{children:(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{onClick:()=>o(!1),children:c("ajouter_97327")}),(0,i.jsx)(jl,{color:"white",onClick:()=>{t("delegation.accreditations",[]),t("delegation.accreditationsSlots",[])},children:c("r_initialiser_77538")})]})})]})},hC=e=>(0,i.jsx)(Ra,{css:{background:"$gray50",overflowX:"auto",padding:"$6",...e.css},direction:"column",gap:"4",height:1,width:1,children:e.children}),mC=e=>(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:e.category.name}),(0,i.jsx)(Ra,{direction:"column",gap:"3",children:e.children})]},e.category.id),gC=hr(Ra,{borderRadius:"$2",fontSize:"$textSm",height:"32px",width:"32px","@tablet":{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"}}),pC=e=>{const t=(0,M.useMemo)(()=>Kd(e.color),[e.color]),n=(0,M.useMemo)(()=>mn.includes(e.icon)?qa(e.icon):e.icon,[e.icon]);return(0,i.jsx)(gC,{align:"center",css:{background:t[100],color:t[700]},justify:"center",role:"presentation",children:(0,i.jsx)(Ya,{icon:n})})},fC=e=>{const{translate:t}=cl(),n=M.useMemo(()=>tC(e.accreditation),[e.accreditation]),[s,o]=M.useState(!0),r=e.displaySlots||"function"==typeof e.renderCheckbox;return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(Ra,{align:"center",css:{cursor:r?"pointer":"default",padding:"$3 $4"},gap:"2",onClick:()=>{o(!s),e.onClick?.()},children:[e.displaySlots&&(0,i.jsx)(Ra,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(Ya,{icon:s?"chevron-down":"chevron-right"})}),e.renderCheckbox?.(),(0,i.jsx)(pC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:n}),e.displayNumberOfSlots&&(0,i.jsx)(br,{color:"gray500",children:t("creneau",e.numberOfSlots)})]}),e.renderActions?.()]}),(e.displayFormCustomFields||e.displaySlots&&s)&&(0,i.jsx)(Ra,{css:{borderTop:"1px solid $gray200"},direction:"column",children:e.children})]})},xC=e=>{const{translate:t}=cl(),[n,s]=(0,M.useState)(void 0),o=(0,M.useCallback)(t=>{e.change("delegation.accreditationsSlots",(0,cu.jM)(e.values.delegation.accreditationsSlots,n=>{n.forEach(n=>{e.slotsIds.includes(n.accreditationSlotId)&&(n.maxResources=t)})})),s(t)},[e.selectedSlotsIds,e.slotsIds,e.values,e.change,s]),r=(0,M.useMemo)(()=>e.values.delegation.accreditationsSlots.find(t=>t.accreditationSlotId===e.selectedSlotsIds[0]),[e.selectedSlotsIds,e.values]),a=r?.isDefault??!1,l=r?.isVisible??!0,d=(0,M.useCallback)(()=>{e.change("delegation.accreditationsSlots",(0,cu.jM)(e.values.delegation.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(a?(t.isDefault=!1,t.isVisible=!0):t.isDefault=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[e.selectedSlotsIds,e.values,e.change,a]),c=(0,M.useCallback)(()=>{e.change("delegation.accreditationsSlots",(0,cu.jM)(e.values.delegation.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(l?(t.isDefault=!0,t.isVisible=!1):t.isVisible=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[e.selectedSlotsIds,e.values,e.change,l]),u=(0,M.useCallback)(()=>{e.change("selectedAccreditationsSlotsIds",(0,oc.A)(e.values.selectedAccreditationsSlotsIds,e.selectedSlotsIds)),e.change("delegation.accreditationsSlots",e.values.delegation.accreditationsSlots.filter(t=>!e.selectedSlotsIds.includes(t.accreditationSlotId)))},[e.selectedSlotsIds,e.values,e.change]);return eo(e.selectedSlotsIds)?(0,i.jsxs)(Ra,{gap:"3",onClick:Al,children:[(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:d,children:[(0,i.jsx)(br,{fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:"badge"})}),(0,i.jsx)(br,{fontWeight:"medium",children:t(a?"ne_pas_accr_dit_59893":"accr_diter_par_72403")})]}),(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:c,children:[(0,i.jsx)(br,{fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:l?"eye-slash":"eye"})}),(0,i.jsx)(br,{fontWeight:"medium",children:t(l?"masquer_34645":"rendre_visible_37057")})]}),(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",children:[(0,i.jsx)(br,{fontWeight:"medium",children:t("total_07173")}),(0,i.jsx)(br,{width:100,children:(0,i.jsx)(Ol,{min:0,rightIcon:"xmark",shouldParseAsInt:!0,value:n??"",onChange:o,onRightIconClick:()=>o(void 0)})})]}),(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:u,children:[(0,i.jsx)(br,{fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:"trash-can"})}),(0,i.jsx)(br,{fontWeight:"medium",children:t("supprimer_43083")})]})]}):(0,i.jsxs)(Ra,{align:"center",gap:"6",onClick:Al,children:[e.hasSlots&&(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{children:t("limite_totale_35352")}),(0,i.jsx)(br,{width:60,children:(0,i.jsx)(Rl,{name:`${e.prefix}maxResources`})})]}),(0,i.jsx)(Bm,{name:`${e.prefix}willAutoAccredit`,children:t("attribuer_autom_13895")})]})},_C=e=>{const{translate:t}=cl(),n=Gn(Wc),s=(0,M.useMemo)(()=>e.values.delegation.accreditationsSlots.findIndex(t=>t.accreditationSlotId===e.slot.id),[e.values,e.slot]),o=e.values.delegation.accreditationsSlots[s],r=`delegation.accreditationsSlots[${s}].`,a=o?.isDefault?"checked":"unchecked",l=(0,M.useMemo)(()=>e.values.selectedAccreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked",[e.slot,e.values.selectedAccreditationsSlotsIds]),d=(0,M.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"checked"===t&&e.values.delegation.accreditationsSlots.forEach((t,n)=>{t.accreditationSlotId!==o.accreditationSlotId&&t.accreditationId===o.accreditationId&&e.change(`delegation.accreditationsSlots[${n}].isDefault`,!1)}),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,o,e.values,e.change]),c=(0,M.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,e.change]),u=(0,M.useCallback)(t=>{e.change("selectedAccreditationsSlotsIds",no(e.values.selectedAccreditationsSlotsIds,e.slot.id,"checked"===t))},[e.slot,e.values.selectedAccreditationsSlotsIds,e.change]);return(0,i.jsxs)(Tc,{children:[e.displaySelectedCheckbox&&(0,i.jsx)(yc,{width:48,children:(0,i.jsx)(lc,{state:l,onClick:u})}),(0,i.jsx)(yc,{css:{textTransform:"capitalize"},children:e.slot.date?n.toLocaleString(e.slot.date,Zs.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(yc,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(yc,{children:e.accreditationDisplay===te.Radio?(0,i.jsx)(hc,{state:a,onClick:d,children:t("accr_ditation_p_28030")}):(0,i.jsx)(dc,{state:a,onClick:c,children:t("accr_ditation_p_28030")})}),(0,i.jsx)(yc,{width:100,children:(0,i.jsx)(jl,{color:"white",disabled:!o.isDefault,leftIcon:o.isVisible?"eye":"eye-slash",onClick:()=>{e.change(`${r}isVisible`,!o.isVisible)}})}),(0,i.jsx)(yc,{width:130,children:(0,i.jsx)(Rl,{min:0,name:`${r}maxResources`,shouldParseAsInt:!0})})]})},IC=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>e.values.delegation.accreditations.findIndex(t=>t.accreditationId===e.accreditation.id),[e.values,e.accreditation]),s=(0,M.useMemo)(()=>zh(e.slots.filter(t=>t.accreditationId===e.accreditation.id)),[e.slots,e.accreditation]),o=(0,M.useMemo)(()=>s.map(e=>e.id),[s]),r=`delegation.accreditations[${n}].`,a=(0,M.useMemo)(()=>{if(e.accreditation.hasSlots){const t=(0,Fs.A)(s.map(t=>e.values.selectedAccreditationsSlotsIds.includes(t.id)));return 2===t.length?"indeterminate":t[0]?"checked":"unchecked"}return"unchecked"},[e.accreditation,e.values.selectedAccreditationsSlotsIds,s]),l=(0,M.useMemo)(()=>o.filter(t=>e.values.selectedAccreditationsSlotsIds.includes(t)),[e.values.selectedAccreditationsSlotsIds,o]),d=(0,M.useCallback)(t=>{"checked"===t?e.change("selectedAccreditationsSlotsIds",(0,Fs.A)(e.values.selectedAccreditationsSlotsIds.concat(o))):e.change("selectedAccreditationsSlotsIds",(0,oc.A)(e.values.selectedAccreditationsSlotsIds,o))},[e.values.selectedAccreditationsSlotsIds,e.change,o]);return(0,i.jsx)(fC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:s.length,renderActions:()=>(0,i.jsx)(xC,{change:e.change,hasSlots:e.accreditation.hasSlots,prefix:r,selectedSlotsIds:l,slotsIds:o,values:e.values}),children:(0,i.jsxs)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[e.accreditation.hasSlots&&(0,i.jsx)(Fc,{width:48,children:(0,i.jsx)(lc,{state:a,onClick:d})}),(0,i.jsx)(Fc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Fc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Fc,{children:t("accr_ditation_p_28030")}),(0,i.jsx)(Fc,{width:100,children:t("Privacy")}),(0,i.jsx)(Fc,{width:130,children:t("total_07173")})]}),s.map((t,n)=>(0,i.jsx)(_C,{accreditationDisplay:e.accreditation.accreditationDisplay,change:e.change,displaySelectedCheckbox:e.accreditation.hasSlots,slot:t,values:e.values},`${t.id}-${n}`))]})})},vC=e=>{const t=(0,M.useMemo)(()=>rC(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(mC,{category:e.category,children:t.map((t,n)=>(0,i.jsx)(IC,{accreditation:t,change:e.change,slots:e.slots,values:e.values},`${t.id}-${n}`))})},bC=e=>{const t=(0,M.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationCategoryId),[e.values]),n=(0,M.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationId),[e.values]),s=(0,M.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),[e.values]),o=(0,M.useMemo)(()=>(0,ic.A)(e.accreditationCategories.filter(e=>t.includes(e.id)),e=>e.name.toLowerCase()),[e.accreditationCategories,t]),r=(0,M.useMemo)(()=>e.accreditationCategories.flatMap(e=>e.accreditations).filter(e=>n.includes(e.id)),[e.accreditationCategories,n]),a=(0,M.useMemo)(()=>r.flatMap(e=>e.slots).filter(e=>s.includes(e.id)),[r,s]);return(0,i.jsx)(hC,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:o.map(t=>(0,i.jsx)(vC,{accreditations:r,category:t,change:e.change,slots:a,values:e.values},t.id))})},jC=({allAccreditationCategories:e,setIsAddAccreditationOpen:t,change:n,values:s})=>{const{translate:o}=cl(),r=(0,M.useMemo)(()=>s.delegation.accreditationsSlots.some(({isDefault:e})=>e),[s]);return(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray900 textMd medium",children:o("liste_des_accr_46997")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(bC,{accreditationCategories:e,change:n,values:s}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",onClick:()=>{t(!0)},children:o("add_accreditation")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:o("attribution_des_59896")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Bm,{name:"delegation.addDefaultAccreditationsByAvailability",children:o("attribuer_les_a_56919")})]})]})},CC=e=>(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",width:280,children:e.title}),(0,i.jsx)(Ra,{css:{flex:"1"},direction:"column",children:e.children})]}),yC=e=>{const{translate:t}=cl(),n=Gn(Bh),[s,o]=(0,M.useState)(!1),r=(0,M.useMemo)(()=>n.getDelegationMembersPossibleColumns(e.customFields,{isWeezeventConnected:!0,positionDisplay:mt.Position,slotDisplay:pt.Custom}),[n,e.customFields]),a=(0,M.useMemo)(()=>(0,Va.A)(e.values.delegation.columns.map(e=>r.find(t=>t.slug===e))),[r,e.values.delegation]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Ra,{css:{background:"$gray50",borderBottom:"1px solid $gray200",color:"$gray500",padding:"$3 $6"},children:t("liste_des_colon_20101")}),(0,i.jsxs)(Ra,{css:{padding:"$4"},direction:"column",gap:"4",children:[(0,i.jsx)(Ra,{direction:"column",gap:"2",children:a.map(t=>(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",padding:"$3"},gap:"3",children:[(0,i.jsx)(br,{color:"gray700",css:{flex:"1"},children:t.name}),(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("delegation.columns",(0,sc.A)(e.values.delegation.columns,t.slug))}})]},t.slug))}),(0,i.jsx)(jl,{color:"invisible",leftIcon:"gear",onClick:()=>{o(!0)},children:t("_diter_les_colo_39630")})]})]}),s&&(0,i.jsx)(_u,{columns:r,initialSelectedColumns:e.values.delegation.columns,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>{o(!1)},onSave:t=>{e.change("delegation.columns",t)}})]})},kC=e=>{const{translate:t}=cl();return(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(CC,{title:t("liste_des_colon_20101"),children:(0,i.jsx)(yC,{change:e.change,customFields:e.customFields,values:e.values})}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(CC,{title:t("droits_des_resp_01552"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Bm,{name:"delegation.showFormLinkInDelegationSpace",children:t("afficher_le_lie_05841")}),(0,i.jsx)(Bm,{name:"delegation.canLeadersAddMembers",children:t("CanLeadersAddMembers")}),(0,i.jsx)(Bm,{name:"delegation.canLeadersImportMembers",children:t("CanLeadersImportMembers")}),(0,i.jsx)(Bm,{name:"delegation.canLeadersEditMembers",children:t("CanLeadersEditMembers")}),(0,i.jsx)(Bm,{name:"delegation.canLeadersDeleteMembers",children:t("CanLeadersDeleteMembers")}),(0,i.jsx)(Bm,{name:"delegation.canLeadersEditColumns",children:t("CanLeadersEditColumns")}),(0,i.jsx)(Bm,{name:"delegation.canLeadersEditCustomFields",children:t("CanLeadersEditCustomFields")}),(0,i.jsx)(Bm,{name:"delegation.canLeadersSeeHiddenAccreditationsSlots",children:t("CanLeadersSeeHiddenAccreditationsSlots")})]})}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(CC,{title:t("communication_05277"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Mm,{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)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("liste_des_docum_18767"),multiple:!0,name:"delegation.customDocumentsSlugs",children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})]})})]})};function AC(e){return(0,ic.A)(e,e=>e.name.toLowerCase())}const wC=e=>{const t=Hn(),n=(0,M.useMemo)(()=>d.Ik().shape({name:d.Yj().required(t("le_nom_est_requ_61536"))}),[]);return(0,i.jsx)(Tj,{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)(Rl,{label:t("nom_de_la_cat_g_03860"),name:"name"})})},SC=e=>{const{mutate:t}=function(e={}){return Kn("mutation DelegationCategoryCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategory: DelegationsCategoryInput!\n) {\n delegationCategoryCreate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(wC,{initialName:"",isEdit:!1,mutate:async n=>(await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategory:{name:n}})).delegationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},EC=e=>{const{mutate:t}=function(e={}){return Kn("mutation DelegationCategoryUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n $delegationCategory: DelegationsCategoryInput!\n) {\n delegationCategoryUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(wC,{initialName:e.delegationCategory.name,isEdit:!0,mutate:async n=>(await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategoryId:e.delegationCategory.id,delegationCategory:{name:n}})).delegationCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},TC=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),[o,r]=(0,M.useState)(0),[a,l,d]=Pc(""),{usersInfosOptions:c,isLoading:u}=jb({organizationId:n,eventId:null,hasSelected:eo(e.leadersIds),nameDebounced:l,reloadKey:o,userInfoIds:e.leadersIds}),[h,m]=(0,M.useState)(!1),[g,p]=(0,M.useState)(AC(e.categories)),[f,x]=(0,M.useState)(!!e.initialParentId),_=(0,M.useCallback)(t=>{t||e.change("delegation.parentId",null),x(t)},[e.change,x]),I=(0,M.useCallback)(t=>{const n=e.organizationDelegations.find(e=>e.id===t);n&&(e.change("delegation.leadersIds",n.leadersIds),r(e=>e+1))},[e.organizationDelegations,e.leadersIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"delegation.parentId",children:I}),"event"===e.delegationType&&eo(e.organizationDelegations)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xu,{value:f,onChange:_,children:t("lier_cette_d_l_78975")}),(0,i.jsx)(Ba,{height:"6"})]}),f?(0,i.jsx)(Mm,{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)(Rl,{label:t("nom_de_votre_d_69290"),name:"delegation.name"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Mm,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"delegation.delegationCategoryId",onCreateClick:()=>{m(!0)},children:g.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Mm,{isSearchLoading:u,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,name:"delegation.leadersIds",searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:a,onChange:d}),children:c}),h&&(0,i.jsx)(SC,{eventId:s,organizationId:n,onClose:()=>{m(!1)},onSuccess:t=>{p(AC([...g,t])),e.change("delegation.delegationCategoryId",t.id)}})]})},zC=e=>(0,i.jsx)(TC,{categories:e.categories,change:e.change,delegationType:"event",initialParentId:e.initialParentId,leadersIds:e.leadersIds,organizationDelegations:e.organizationDelegations}),OC=e=>(0,i.jsx)(TC,{categories:e.categories,change:e.change,delegationType:"organization",initialParentId:null,leadersIds:e.leadersIds,organizationDelegations:[]}),RC=e=>{const t=Hn(),n=(0,M.useMemo)(()=>(0,ic.A)(e.forms,e=>e.name),[e.forms]),[s,o]=(0,M.useState)(!!e.initialValues.delegation.deadlineDate),[r,a]=(0,M.useState)(Number.isInteger(e.initialValues.delegation.maxResources));return(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(CC,{title:t("Form"),children:(0,i.jsx)(Mm,{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)(Wu,{height:"5"}),(0,i.jsxs)(CC,{title:t("inscription_dan_16147"),children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:t("les_inscription_64653")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(hc,{state:s?"checked":"unchecked",onClick:()=>{o(!0)},children:t("oui_il_y_a_une_68479")}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Dm,{name:"delegation.deadlineDate"}),(0,i.jsx)(Ba,{height:"3"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:s?"unchecked":"checked",onClick:()=>{o(!1),e.change("delegation.deadlineDate",null)},children:t("non_les_inscri_87979")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:t("les_inscription_76218")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(hc,{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)(Ba,{height:"2"}),(0,i.jsx)(Rl,{name:"delegation.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(Ba,{height:"3"})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:r?"unchecked":"checked",onClick:()=>{a(!1),e.change("delegation.maxResources",null)},children:t("non_les_inscri_07566")})]})]})},$C=e=>{const{translate:t}=cl();return(0,i.jsx)(ub,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"triangle-exclamation",children:t("accr_ditations_34551")}),(0,i.jsx)(lb,{children:(0,i.jsxs)(Ra,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(br,{font:"gray900 textLg medium",children:t("voulez_vous_met_24993")}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("les_accr_ditati_76418",e.deletedAccreditationsSlots.join(", "))})]})}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("mettre_jour_l_69948")})})]})})},DC=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=M.useMemo(()=>m(e.initialValues.delegation.description)||m(e.initialValues.delegation.privateNote),[e.initialValues]),r=M.useMemo(()=>e.isEdit&&eo(e.initialValues.delegation.accreditationsSlots),[e.initialValues,e.isEdit]),a=M.useMemo(()=>e.isEdit&&eo(e.initialValues.delegation.usedCustomFieldsIds),[e.initialValues,e.isEdit]),l=M.useMemo(()=>e.isEdit&&eo(e.initialValues.delegation.customFields),[e.initialValues,e.isEdit]),d=M.useMemo(()=>eo(e.initialValues.delegation.tagsIds),[e.initialValues]),c=function(e,t,n){const i=Gn(Wc),s=(0,M.useMemo)(()=>{const e=t.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),i=n.delegation.accreditationsSlots.map(e=>e.accreditationSlotId);return(0,oc.A)(e,i)},[t,n]);return(0,M.useMemo)(()=>e.flatMap(e=>e.accreditations.flatMap(e=>e.slots.flatMap(t=>s.includes(t.id)?[wh(i,t,e.name,{accreditation:{includeName:!0}})]:[]))),[s,e])}("event"===e.delegationType?e.accreditationsCategories:[],e.initialValues,e.values),[u,h]=M.useState(!1),[g,p]=M.useState(!1),f=M.useCallback(()=>{eo(c)?p(!0):e.handleSubmit()},[c,p,e.handleSubmit]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zm,{button:e.isEdit?(0,i.jsx)(jl,{isLoading:e.submitting,onClick:f,children:t("mettre_jour_l_69948")}):null,category:e.isEdit?t("mise_jour_de_17055",e.initialValues.delegation.name):t("cr_ation_d_une_07120"),color:"dark",fallbackClosePath:as.DELEGATIONS({organizationId:n,eventId:s}),title:e.isEdit?e.initialValues.delegation.name:t("nouvelle_d_l_ga_42871"),children:(0,i.jsxs)(Em,{ref:e.centeredContainerRef,children:[(0,i.jsx)(hl,{}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,title:t("informations_su_34607"),children:"event"===e.delegationType?(0,i.jsx)(zC,{categories:e.categories,change:e.form.change,initialParentId:e.initialValues.delegation.parentId,leadersIds:e.values.delegation.leadersIds,organizationDelegations:e.organizationDelegations}):(0,i.jsx)(OC,{categories:e.categories,change:e.form.change,leadersIds:e.values.delegation.leadersIds})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,title:t("param_tres_de_l_81810"),children:(0,i.jsx)(RC,{change:e.form.change,forms:e.forms,initialValues:e.initialValues})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:e.values.delegation.showInDelegationSpace,subtitle:t("param_trer_les_35157"),title:t("espace_d_l_gati_59251"),onToggle:t=>{t||(e.form.change("delegation.campaignsIds",[]),e.form.change("delegation.customDocumentsSlugs",[])),e.form.change("delegation.showInDelegationSpace",t)},children:(0,i.jsx)(kC,{campaigns:e.campaigns,change:e.form.change,customDocuments:"event"===e.delegationType?e.customDocuments:[],customFields:e.customFields,values:e.values})}),(0,i.jsx)(Ba,{height:"5"}),"event"===e.delegationType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rm,{initialIsOpen:r,subtitle:t("delegation_accreditations_desc"),title:t("accr_ditations_39450"),onToggle:t=>{t||e.form.change("delegation.accreditationsSlots",[])},children:(0,i.jsx)(jC,{allAccreditationCategories:e.accreditationsCategories,change:e.form.change,setIsAddAccreditationOpen:h,values:e.values})}),(0,i.jsx)(Ba,{height:"5"})]}),(0,i.jsx)(Rm,{initialIsOpen:a,subtitle:t("ajouter_des_inf_57824"),title:t("champs_de_formu_64126"),onToggle:t=>{t||(e.form.change("delegation.usedCustomFieldsIds",[]),e.form.change("delegation.fields",(0,rr.A)(e.values.delegation.fields,e.delegationCustomFields.map(e=>e.slug))))},children:(0,i.jsx)(Qj,{change:e.form.change,customFields:e.delegationCustomFields,prefix:"delegation.",usedCustomFieldsIds:e.values.delegation.usedCustomFieldsIds})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:l,subtitle:t("choisissez_une_24029"),title:t("d_finir_la_vale_27863"),onToggle:t=>{t||e.form.change("delegation.customFields",[])},children:(0,i.jsx)(Sj,{change:e.form.change,customFields:e.customFields,name:"delegation.customFields",values:e.values.delegation.customFields})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsxs)(Rm,{initialIsOpen:o,subtitle:t("ajoutez_une_des_54307"),title:t("description_et_59312"),onToggle:t=>{t||(e.form.change("delegation.description",""),e.form.change("delegation.privateNote",""))},children:[(0,i.jsx)(Tv,{label:(0,i.jsx)(_v,{children:t("description_58935")}),name:"delegation.description"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Tv,{label:(0,i.jsx)(_v,{children:t("note_priv_e_06303")}),name:"delegation.privateNote"})]}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:d,subtitle:t("ajouter_des_tag_35833"),title:t("tags_79499"),onToggle:t=>{t||e.form.change("delegation.tagsIds",[])},children:(0,i.jsx)(Oj,{change:e.form.change,name:"delegation.",organizationId:n,tags:e.tags,tagsIds:e.values.delegation.tagsIds})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{isLoading:e.submitting,textAlign:"center",onClick:f,children:e.isEdit?t("mettre_jour_l_69948"):t("cr_er_la_d_l_ga_53268")})})]})}),"event"===e.delegationType&&u&&(0,i.jsx)(uC,{allAccreditationCategories:e.accreditationsCategories,change:e.form.change,eventEndAt:e.eventEndAt,eventStartAt:e.eventStartAt,setIsAddAccreditationOpen:h,values:e.values.delegation}),(0,i.jsx)($C,{deletedAccreditationsSlots:c,handleSubmit:e.handleSubmit,isOpen:g,submitting:e.submitting,onClose:()=>{p(!1)}})]})},PC=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{showNotification:r}=ib(),a=Gn(mj),l=Gn(Da),d=(0,M.useRef)(null);return Td((0,M.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.delegation.name):n("cr_ation_d_une_07120"),[e.isEdit,e.initialValues])),(0,i.jsx)(fl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:n,submitting:s,values:o})=>(0,i.jsx)(DC,{...e,centeredContainerRef:d,form:t,handleSubmit:n,submitting:s,values:o}),validate:l.validateForForm(a.createUpdateDelegationSchema()),width:1,onSubmit:async i=>{await e.mutate({organizationId:s,eventId:o,delegation:i.delegation}),r(e.isEdit?n("la_d_l_gation_a_86694"):n("la_d_l_gation_a_01157")),t.goBack(as.DELEGATIONS({organizationId:s,eventId:o}))}})},FC=(e,t)=>{try{if(m(e)&&!isNaN((0,gj.A)(e,10)))return{delegationCategoryId:(0,gj.A)(e,10)};if(m(e)){const n=JSON.parse(r(e)),i=n.parentId,s=n.applyParentSettings?t.find(e=>e.id===i):null;return{parentId:i,parentDelegation:s}}return{}}catch{return{}}},MC=()=>{const{params:{organizationId:e,eventId:t,options:n}}=cl(),s=Gn(mj),{data:o,loader:r}=Yn("query DelegationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n delegations(level: Organization) {\n nodes {\n id\n name\n privateNote\n leadersIds\n tagsIds\n columns\n\n delegationCategory {\n name\n }\n\n form {\n name\n }\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n }\n}\n",{organizationId:e,eventId:t},[Ms.CreatePositionTagsFragment,Ms.OrganizationCustomFieldsFragment,Ms.AttachCustomFieldFragment,Ms.CreateDelegationEventFragment]),{mutate:a}=Yr(),l=(0,M.useMemo)(()=>{if(o.organization){const{delegationCategoryId:e,parentId:t,parentDelegation:i}=FC(n,o.organization.delegations.nodes);return s.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e,delegationsCategories:o.organization.delegationsCategories.nodes,forms:o.event.forms.nodes,parentId:t,parentDelegation:i})}return{}},[n,o]);return r||(0,i.jsx)(PC,{accreditationsCategories:o.event.accreditationsCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:as.DELEGATIONS({organizationId:e,eventId:t}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",eventEndAt:o.event.endAt,eventStartAt:o.event.startAt,forms:o.event.forms.nodes,initialValues:l,isEdit:!1,mutate:async e=>(await a(e)).delegationCreate.id,organizationDelegations:o.organization.delegations.nodes,tags:o.organization.tags.nodes})},NC=()=>{const{params:{organizationId:e,options:t}}=cl(),n=Gn(mj),{data:s,loader:o}=Yn("query DelegationOrganizationInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n campaigns(level: Organization, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...CreateDelegationForm\n }\n }\n }\n}\n",{organizationId:e},[Ms.CreatePositionTagsFragment,Ms.OrganizationCustomFieldsFragment,Ms.AttachCustomFieldFragment,Ms.CreateDelegationFormFragment]),{mutate:r}=Yr(),a=(0,M.useMemo)(()=>{const{delegationCategoryId:e}=FC(t,[]);return n.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e})},[]);return o||(0,i.jsx)(PC,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:Os.COMMUNITY_DELEGATIONS(e),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:a,isEdit:!1,mutate:async e=>(await r(e)).delegationCreate.id,tags:s.organization.tags.nodes})},LC=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=cl(),s=Gn(mj),{data:o,loader:r}=Yn("query DelegationEventToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n delegations(level: Organization) {\n nodes {\n id\n name\n leadersIds\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n\n delegation(id: $delegationId) {\n name\n description\n delegationCategoryId\n parentId\n leadersIds\n formId\n deadlineDate\n maxResources\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersEditMembers\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n campaignsIds\n customDocumentsSlugs\n usedCustomFieldsIds\n\n customFields {\n addValues\n customFieldId\n value\n }\n\n accreditations {\n accreditationCategoryId\n accreditationId\n maxResources\n willAutoAccredit\n }\n\n accreditationsSlots {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n maxResources\n isVisible\n }\n }\n }\n}\n",{organizationId:e,eventId:t,delegationId:n},[Ms.CreatePositionTagsFragment,Ms.OrganizationCustomFieldsFragment,Ms.AttachCustomFieldFragment,Ms.CreateDelegationEventFragment]),{mutate:a}=Kr(),l=(0,M.useMemo)(()=>s.createUpdateDelegationValuesDefault(o.event?.delegation,null),[o.event]);return r||(0,i.jsx)(PC,{accreditationsCategories:o.event.accreditationsCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:as.DELEGATION({organizationId:e,eventId:t,delegationId:n}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",eventEndAt:o.event.endAt,eventStartAt:o.event.startAt,forms:o.event.forms.nodes,initialValues:l,isEdit:!0,mutate:async e=>(await a({...e,delegationId:n})).delegationUpdate.id,organizationDelegations:o.organization.delegations.nodes,tags:o.organization.tags.nodes})},BC=()=>{const{params:{organizationId:e,delegationId:t}}=cl(),n=Gn(mj),{data:s,loader:o}=Yn("query DelegationOrganizationToEdit($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n campaigns(level: Organization, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n delegation(id: $delegationId) {\n name\n description\n delegationCategoryId\n leadersIds\n formId\n deadlineDate\n maxResources\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersEditMembers\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n campaignsIds\n customDocumentsSlugs\n usedCustomFieldsIds\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,delegationId:t},[Ms.CreatePositionTagsFragment,Ms.OrganizationCustomFieldsFragment,Ms.AttachCustomFieldFragment,Ms.CreateDelegationFormFragment]),{mutate:r}=Kr(),a=(0,M.useMemo)(()=>n.createUpdateDelegationValuesDefault(s.organization?{...s.organization.delegation,accreditations:[],accreditationsSlots:[]}:null,null),[s.organization]);return o||(0,i.jsx)(PC,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:Os.COMMUNITY_DELEGATION(e,t),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:a,isEdit:!0,mutate:async e=>(await r({...e,delegationId:t})).delegationUpdate.id,tags:s.organization.tags.nodes})};function VC(e,t,n){const{getLocalOrganization:i,updateLocalOrganization:s}=function(e){const t=M.useCallback(async()=>{let t=await rI.organizations.get(e);return t||(t={id:e},await rI.organizations.put(t)),t},[e]),n=M.useCallback(async n=>{const i=await t(),s=(0,Kv.A)(i,{id:e},n);return await rI.organizations.put(s),s},[e,t]);return{getLocalOrganization:t,updateLocalOrganization:n}}(e),[o,r]=M.useState(n),[a,l]=M.useState(!0),d=M.useCallback(async e=>{r(e),await s({[t]:e})},[t,r,s]);return M.useEffect(()=>{(async()=>{const e=await i();e[t]&&r(e[t]),l(!1)})()},[e,i,r,l]),[o,d,a]}function UC(e){return(0,M.useMemo)(()=>new Map(e.map(e=>[e.slug,e])),[e])}function WC(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""}const GC=(0,M.createContext)({});function HC(){return(0,M.useContext)(GC)}const qC=e=>{const t=Gn(Mj),{isEditMode:n}=HC(),{isEditMode:s}=tm(),o=n||s,r=t.getValue(e.customField,e.fields),a=t.getValueString(e.customField,e.fields),l=!0===r?"checked":!1===r?"unchecked":"indeterminate";return o&&e.updatable?(0,i.jsxs)(yc,{css:{border:"2px solid transparent","& > .h-checkbox-cell-hover":{display:"none"},"&:hover":{border:"2px solid $primary700"},"&:hover > .h-checkbox-cell-default":{display:"none"},"&:hover > .h-checkbox-cell-hover":{display:"block"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Al,children:[(0,i.jsx)(br,{className:"h-checkbox-cell-default",children:a}),(0,i.jsx)(br,{className:"h-checkbox-cell-hover",children:(0,i.jsx)(lc,{state:l,onClick:async t=>{await e.mutate("checked"===t,e.customField.slug),e.reload()}})})]}):(0,i.jsx)(yc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:a})},YC="h-update-cell-open",KC=e=>{const t=Hn(),n=M.useRef(L()),[s,o]=M.useState(!1),[r,a]=M.useState(e.initialValue),l=M.useCallback(t=>{o(t),document.body.dispatchEvent(new CustomEvent(YC,{bubbles:!0,detail:{uuid:n.current}})),e.onStateChange?.(t)},[o,e.onStateChange]),d=M.useCallback(e=>{e.detail.uuid!==n.current&&o(!1)},[o]),c=M.useCallback(()=>{l(!1),a(e.initialValue)},[e.initialValue,l,a]);return M.useEffect(()=>(document.addEventListener(YC,d),()=>{document.removeEventListener(YC,d)}),[d]),(0,i.jsxs)(Pd,{doNotCloseOnOtherOpen:!0,isOpen:s,onStateChange:l,children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(yc,{css:{...e.css,border:"2px solid transparent",cursor:"text","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Al,children:"string"==typeof e.renderValue?e.renderValue:e.renderValue()})}),(0,i.jsxs)(Vd,{css:{padding:"0"},placement:"bottom-start",width:380,children:[(0,i.jsx)(Ra,{css:{padding:"$4 $6"},onKeyDown:t=>{"Enter"===t.key&&e.onSave(r)},children:e.renderInput(r,a)}),(0,i.jsxs)(Ra,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:c,children:t("annuler_48254")}),(0,i.jsx)(jl,{size:"sm",onClick:()=>{e.onSave(r)},children:t("appliquer_05753")})]})]})]})},ZC=e=>{const{isEditMode:t}=HC(),{isEditMode:n}=tm();return(t||n)&&e.updatable?(0,i.jsx)(KC,{column:e.column,initialValue:e.initialValue,renderInput:e.renderInput,renderValue:e.renderValue,onSave:async t=>{await e.mutate(t),e.reload()}}):(0,i.jsx)(yc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:"string"==typeof e.renderValue?e.renderValue:e.renderValue()})};function XC(e,t){return(0,M.useCallback)(n=>t(n,e.slug),[e,t])}const JC=e=>{const t=Gn(Mj),n=t.getValueString(e.customField,e.fields),s=(0,M.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return m(n)?Bs.c9.fromISO(n,{zone:"utc"}):n},[]),o=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Tu,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},QC=e=>{const t=Gn(Mj),n=t.getValueString(e.customField,e.fields),s=(0,M.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return m(n)?Bs.c9.fromISO(n,{zone:"utc"}):n},[]),o=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)($u,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},ey=e=>{const{params:{organizationId:t}}=cl(),n=Gn(Mj),s=n.getValueString(e.customField,e.fields,{fileReturnValue:"name"}),o=n.getValueString(e.customField,e.fields,{fileReturnValue:"url"}),r=(0,M.useMemo)(()=>n.getValue(e.customField,e.fields),[e.customField,e.fields]),a=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:r,mutate:a,reload:e.reload,renderInput:(n,s)=>(0,i.jsx)(xv,{accept:[lv.Images,lv.Pdf],acl:"private",label:e.customField.name,organizationId:t,value:n,onChange:s}),renderValue:()=>(0,i.jsx)(Vc,{css:{fontWeight:"$regular"},to:o,children:s}),updatable:e.updatable})},ty=e=>{const t=Gn(Mj),n=t.getValueString(e.customField,e.fields),s=(0,M.useMemo)(()=>t.getValue(e.customField,e.fields)||0,[e.customField,e.fields]),o=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Ol,{label:e.customField.name,shouldParseAsInt:!0,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},ny=e=>{const t=Gn(Mj),n=Gn(G_),s=t.getValueString(e.customField,e.fields),o=(0,M.useMemo)(()=>{const i=t.getValue(e.customField,e.fields),s=n.basePhoneInputDefault();return{country:i?.country||s.country,code:i?.code||s.code,number:i?.number||s.number}},[e.fields]),r=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:o,mutate:r,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(K_,{label:e.customField.name,value:t,onChange:n}),renderValue:s,updatable:e.updatable})};function iy(e){const t=Gn(su),n=Rc();return(0,M.useMemo)(()=>e?e.fieldType===Le.Country?t.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===Le.Language?e.fieldProperty===Me.Language?n(hd):n(fn):e.fieldType===Le.Nationality?t.getNationalitiesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===Le.Sex?n(Sn):e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e)):(0,i.jsx)(i.Fragment,{}),[e])}let sy=null;function oy(e,{fontSize:t,fontWeight:n}={}){sy||=document.createElement("canvas");const i=sy.getContext("2d");return i.font=`${n||"400"} ${t||"14px"} 'Open Sans`,i.measureText(e).width}const ry=({badge:e})=>(0,i.jsx)(Jd,{color:e.color,count:e.count,css:{cursor:e.onClick?"pointer":"inherit"},leftIcon:e.icon?mn.includes(e.icon)?qa(e.icon):e.icon:void 0,size:"md",onClick:e.onClick,children:e.text}),ay=({badges:e})=>(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Jd,{cursor:"pointer",size:"md",children:`+${e.length}`})}),(0,i.jsx)(Vd,{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)(Ra,{children:(0,i.jsx)(ry,{badge:e})},e.id))})]}),ly=({badges:e,doNotSort:t,onClick:n})=>{const[s,o]=(0,M.useState)(0),r=(0,M.useCallback)(e=>{e&&o(e.getBoundingClientRect().width)},[]),a=(0,M.useMemo)(()=>{const n=e.map(e=>({...e,textWidth:Math.floor(oy(e.text,{fontSize:"12px"}))+60}));return!0===t?n:(0,ic.A)(n,({textWidth:e})=>e)},[e,t]),[l,d]=(0,M.useMemo)(()=>{let e=37;const t=[],n=[];for(const i of a)e+=i.textWidth+8,eeo(d),[d]);return(0,i.jsxs)(Ra,{ref:r,align:"center",css:{cursor:n?"pointer":"inherit","&:hover":{color:"black"}},gap:"2",height:1,width:1,onClick:e=>{n&&eo(a)&&(Al(e),n())},children:[l.map(e=>(0,i.jsx)(ry,{badge:e},e.id)),c&&(n?(0,i.jsx)(Jd,{css:{cursor:"pointer"},size:"md",children:"+"+(a.length-l.length)}):(0,i.jsx)(ay,{badges:d}))]})},dy=e=>{const t=Hn(),n=Gn(Mj),s=(0,M.useMemo)(()=>{if(e.customField.canSelectMultiple){const t=n.getSelectValues(e.customField,e.fields).map(e=>({id:e,color:"gray",icon:null,text:e}));return()=>(0,i.jsx)(ly,{badges:t})}return n.getValueString(e.customField,e.fields)},[n,e.customField,e.fields]),o=(0,M.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return e.customField.canSelectMultiple?eo(t)?t:[]:t||""},[]),r=iy(e.customField),a=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:o,mutate:a,reload:e.reload,renderInput:(n,s)=>e.customField.canSelectMultiple?(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.customField.name,multiple:!0,renderOnPortal:!0,values:n,onChange:s,children:r}):(0,i.jsx)(fc,{isSearchVisible:!0,label:e.customField.name,multiple:!1,placeholder:t("choisir_une_val_00277"),renderOnPortal:!0,values:[n],onChange:e=>{eo(e)?s(e[0]):s(null)},children:r}),renderValue:s,updatable:e.updatable})},cy=e=>{const t=Gn(Mj).getValueString(e.customField,e.fields),n=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Nm,{label:e.customField.name,value:t,onChange:n}),renderValue:t,updatable:e.updatable})},uy=e=>{const t=Gn(Mj).getValueString(e.customField,e.fields),n=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Ol,{autoFocus:!0,label:e.customField.name,value:t,onChange:n}),renderValue:t,updatable:e.updatable})},hy=e=>{const t=Gn(Mj),n=t.getValueString(e.customField,e.fields),s=(0,M.useMemo)(()=>t.getValueString(e.customField,e.fields),[]),o=XC(e.customField,e.mutate);return(0,i.jsx)(ZC,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(yv,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},my=e=>{const t=Gn(Mj);return e.customField?.fieldType===Le.Checkbox?(0,i.jsx)(qC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.Date?(0,i.jsx)(JC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.Phone?(0,i.jsx)(ny,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.Select||e.customField?.fieldType===Le.Country||e.customField?.fieldType===Le.Language||e.customField?.fieldType===Le.Sex||e.customField?.fieldType===Le.Nationality?(0,i.jsx)(dy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.Text?(0,i.jsx)(uy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.Textarea?(0,i.jsx)(cy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.Number?(0,i.jsx)(ty,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.File?(0,i.jsx)(ey,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.Datetime?(0,i.jsx)(QC,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Le.Time?(0,i.jsx)(hy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):(0,i.jsx)(yc,{children:e.customField?t.getValueString(e.customField,e.fields,{fileReturnValue:"name"}):""})},gy=e=>{const{translate:t}=cl(),{isEditMode:n}=HC(),{isEditMode:s}=tm(),o=n||s,r=(0,M.useMemo)(()=>({firstName:e.userInfo.fields.firstName||"",lastName:e.userInfo.fields.lastName||""}),[e.userInfo]),a=(0,M.useCallback)(async t=>{await e.mutate(t.firstName,"firstName"),await e.mutate(t.lastName,"lastName"),e.reload()},[e.mutate,e.reload]);return o&&e.updatable?(0,i.jsx)(KC,{column:e.column,initialValue:r,renderInput:(e,n)=>(0,i.jsxs)(Ra,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Ol,{label:t("pr_nom_66988"),value:e.firstName,onChange:t=>{n({...e,firstName:t})}}),(0,i.jsx)(Ol,{label:t("last_name"),value:e.lastName,onChange:t=>{n({...e,lastName:t})}})]}),renderValue:()=>(0,i.jsx)(Ub,{isClickDisabled:!0,size:32,userInfo:e.userInfo}),onSave:a}):(0,i.jsx)(yc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ub,{isClickDisabled:!e.canClickMemberName,size:32,userInfo:e.userInfo})})};function py(e,t){return e?e.usersOrganizations.map(e=>({id:e.role.id,color:"gray",icon:e.role.type===xt.OrganizationAdmin?"gem":"glasses-round",text:`${e.role.name}`})).concat(e.usersEvents.map(e=>({id:e.role.id,color:"gray",icon:e.role.type===xt.EventAdmin?"gem":"glasses-round",text:`${e.event.name} - ${e.role.name}`}))).concat(e.usersDelegations.map((e,n)=>({id:`ud-${n}`,color:"gray",icon:"user-group",text:`${e.delegation.name} - ${t("responsable_de_70462")}`}))).concat(e.usersDelegationsCategories.map(e=>({id:e.role.id,color:"gray",icon:"user-group",text:`${e.delegationCategory.name} - ${e.role.name}`}))).concat(e.usersPositions.map(e=>({id:e.role.id,color:"gray",icon:"sitemap",text:`${e.position.name} - ${e.role.name}`}))).concat(e.usersPositionsCategories.map(e=>({id:e.role.id,color:"gray",icon:"sitemap",text:`${e.positionCategory.name} - ${e.role.name}`}))):[]}const fy=e=>{const t=Hn(),n=(0,M.useMemo)(()=>e.userPermissions?py(e.userPermissions,t):[],[e.userPermissions]);return(0,i.jsx)(yc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ly,{badges:n,doNotSort:!0})})},xy=({column:e,eventId:t,onClick:n,reload:s,updatable:o,volunteerRegistration:r})=>{const a=Hn(),{mutate:l}=vo(),{mutate:d}=qo(),c=Gn(Wc),{isEditMode:u}=HC(),{isEditMode:h}=tm(),m=u||h,[g,p]=(0,M.useState)(!0),[f,x]=(0,M.useState)(null),_=(0,M.useMemo)(()=>r?.accreditationsUsersInfos||[],[r]),I=(0,M.useMemo)(()=>iC(_),[_]),v=(0,M.useMemo)(()=>_.map(e=>e.accreditationSlot.id),[_]),b=(0,M.useCallback)(async e=>{if(e&&g){const{event:e}=await(n={eventId:t},s=await q(),co("query UpdateCellAccreditationsSlots($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n hasSlots\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n isBlocked\n }\n }\n }\n }\n}\n",{variables:n,token:s||void 0,fragments:[]})),o=(0,ic.A)(e.accreditationsCategories,e=>e.name.toLowerCase()).flatMap(e=>rC(e.accreditations).map(t=>{const n=t.accreditationDisplay===te.Radio?t.name:void 0,s=zh(t.slots);return(0,i.jsx)("optgroup",{label:`${e.name} - ${t.name}`,children:s.map(e=>{const s=wh(c,e,t.name,{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{"data-radio":n,disabled:e.isBlocked,value:e.id,children:s},e.id)})},t.id)}));x(o),p(!1)}var n,s},[g]),j=(0,M.useCallback)(async e=>{eo(e)?await l({eventId:t,massAccredit:{accreditationsSlotsIds:e,selecteds:{ids:[r.userInfo.id]},strategy:Qe.Replace}}):await d({eventId:t,massStateUpdate:{selecteds:{ids:[r.userInfo.id]},state:re.WaitingAccreditation}}),s()},[t,r,l,s]);return m&&o?(0,i.jsx)(KC,{column:e,css:{gap:"$2"},initialValue:v,renderInput:(e,t)=>g?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:a("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:f}),renderValue:()=>(0,i.jsx)(ly,{badges:I,doNotSort:!0}),onSave:j,onStateChange:b}):(0,i.jsx)(yc,{css:{border:"2px solid transparent"},minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(ly,{badges:I,doNotSort:!0,onClick:n})})},_y=e=>{const t=(0,M.useMemo)(()=>(0,ch.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)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},Iy=e=>{const t=Hn(),{mutate:n}=Qo();return(0,i.jsx)(Ra,{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)(Jd,{...Kb(e.state),children:t(e.state)})})},vy=e=>{const t=Hn(),{isEditMode:n}=HC(),{isEditMode:s}=tm(),o=n||s,[r,a]=(0,M.useState)(!1),l=(0,M.useCallback)(e=>{o&&a(e)},[o,a]),d=(0,M.useCallback)(()=>{l(!1)},[l]);return o&&e.updatable?(0,i.jsx)(yc,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Al,children:(0,i.jsxs)(Pd,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(Ud,{children:(0,i.jsxs)(Ra,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(Jd,{...Kb(e.state),cursor:"text",children:t(e.state)}),r&&(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"chevron-down"})})]})}),(0,i.jsxs)(Vd,{offset:2,placement:"bottom",width:240,children:[e.state!==re.WaitingAccreditation&&(0,i.jsx)(Iy,{close:d,eventId:e.eventId,reload:e.reload,state:re.WaitingAccreditation,volunteerRegistrationId:e.volunteerRegistrationId}),e.state!==re.NotApplicable&&(0,i.jsx)(Iy,{close:d,eventId:e.eventId,reload:e.reload,state:re.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})]})}):(0,i.jsx)(yc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Jd,{...Kb(e.state),children:t(e.state)})})},by=e=>{const t=Gn(Wc),n=Gn(ah),s=(0,M.useMemo)(()=>{const i=e.volunteerRegistration.userInfo.formsUsersInfos||[];return(0,ic.A)(i.flatMap(e=>(e.slots||[]).map(t=>({range:t.range,display:e.form.slotDisplay}))),({range:e})=>e.start.toMillis()).map((e,i)=>({id:i,color:"gray",icon:null,text:e.display===pt.Calendar||e.display===pt.DisplayDays?t.toLocaleString(e.range.start,Zs.DateOnly.Numeric):n.toDisplayString(e.range,{formats:{localeFormat:Zs.DateOnly.Numeric}})}))},[e.volunteerRegistration.userInfo.formsUsersInfos]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:s,doNotSort:!0,onClick:e.onClick})})},jy=e=>{const{translate:t}=cl();return(0,i.jsxs)(ub,{children:[(0,i.jsx)(hb,{children:(0,i.jsx)(br,{css:{cursor:"pointer"},height:e.size,width:e.size,children:(0,i.jsx)("img",{height:"100%",src:sg(e.ticketId,{height:e.size,width:e.size}),width:"100%"})})}),(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"qrcode",children:t("code_barres_1_82428",e.nameOrEmail)}),(0,i.jsxs)(lb,{align:"center",css:{padding:"$4"},gap:"3",justify:"center",children:[(0,i.jsx)(br,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:sg(e.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(br,{children:e.ticketId})]}),(0,i.jsx)(ab,{})]})]})},Cy=e=>{const t=e.volunteerRegistration.ticketId;return(0,i.jsxs)(yc,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(jy,{nameOrEmail:e.volunteerRegistration.userInfo.nameOrEmail,size:30,ticketId:e.volunteerRegistration.ticketId}),m(e.volunteerRegistration.weezeventTicketUrl)?(0,i.jsx)(Vc,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventTicketUrl,children:t}):t]})},yy=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(e.volunteerRegistration.userInfo.emails??[]).map(e=>{const{color:n,leftIcon:i}=Wb(e.state);return{id:e.id,color:n,icon:i,text:`${e.campaign?.name??""} - ${t(e.state)}`}}),[e.volunteerRegistration]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:n})})},ky=e=>{const t=(0,M.useMemo)(()=>(e.volunteerRegistration.positionsSlotsUsersInfos||[]).filter(e=>e.state!==ue.Waiting),[e.volunteerRegistration]),n=(0,M.useMemo)(()=>Ah(t),[t]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:n,doNotSort:!0,onClick:e.onClick})})},Ay=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{mutate:o}=Ko(),{mutate:r}=$o(),{isEditMode:a}=HC(),{isEditMode:l}=tm(),d=a||l,c=(0,M.useMemo)(()=>e.volunteerRegistration.delegation,[e.volunteerRegistration.delegation]),u=(0,M.useMemo)(()=>c?[c.id]:[],[c]),[h,m]=(0,M.useState)(!0),[g,p]=(0,M.useState)([]),f=(0,M.useCallback)(async e=>{if(e&&h){const{event:{delegations:e}}=await Jo({eventId:s},await q());p(e.nodes),m(!1)}},[h]),x=(0,M.useCallback)(async t=>{eo(t)?await o({eventId:s,delegationId:t[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]}}):c&&await r({organizationId:n,eventId:s,delegationId:c.id,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},deleteFromEvent:!1}),e.reload()},[s,e.volunteerRegistration]);return d&&e.updatable?(0,i.jsx)(KC,{column:e.column,css:{gap:"$2"},initialValue:u,renderInput:(e,n)=>h?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(fc,{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)(Jd,{cursor:"pointer",ellipsis:!0,children:c.name}):null,onSave:x,onStateChange:f}):(0,i.jsx)(yc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:c&&(0,i.jsx)(Jd,{cursor:"pointer",ellipsis:!0,title:c.name,children:(0,i.jsx)(Ha,{to:as.DELEGATION({organizationId:n,eventId:s,delegationId:c.id}),children:c.name})})})},wy=e=>{const{params:{organizationId:t,eventId:n}}=cl(),s=e.volunteerRegistration.delegation?.delegationCategory;return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:s&&(0,i.jsx)(Jd,{cursor:"pointer",ellipsis:!0,title:s.name,children:(0,i.jsx)(Ha,{to:as.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:s.id}),children:s.name})})})},Sy=e=>{const t=(0,M.useMemo)(()=>(e.volunteerRegistration.userInfo?.formsUsersInfos??[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.volunteerRegistration.userInfo]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},Ey=e=>{const t=Hn(),{mutate:n}=Yo(),{mutate:s}=Zo(),o=Gn(ah),{isEditMode:r}=HC(),{isEditMode:a}=tm(),l=r||a,d=(0,M.useMemo)(()=>e.volunteerRegistration?.positionsSlotsUsersInfos||[],[e.volunteerRegistration]),c=(0,M.useMemo)(()=>Ah(d),[d]),u=(0,M.useMemo)(()=>d.map(e=>e.positionSlot.id),[d]),[h,m]=(0,M.useState)(!0),[g,p]=(0,M.useState)([]),f=(0,M.useCallback)(async t=>{if(t&&h){const{event:{positionsSlots:t}}=await(n={eventId:e.eventId},i=await q(),co("query UpdateCellPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{variables:n,token:i||void 0,fragments:[]})),s=(0,ic.A)(t.nodes,e=>[e.range.start.toMillis(),e.name]).map(e=>({id:e.id,positionName:e.position.name,name:ph(o,e,e.position.name,{position:{includeNameAtEnd:!0}})}));p((0,ic.A)(Object.entries((0,nc.A)(s,e=>e.positionName)),([e])=>e)),m(!1)}var n,i},[h]),x=(0,M.useCallback)(async t=>{eo(t)?await n({eventId:e.eventId,massAssign:{positionsSlotsIds:t,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:Qe.Replace}}):await s({eventId:e.eventId,massStateUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},state:Ot.WaitingAssignment}}),e.reload()},[e.eventId,e.volunteerRegistration,n,e.reload]);return l&&e.updatable?(0,i.jsx)(KC,{column:e.column,css:{gap:"$2"},initialValue:u,renderInput:(e,n)=>h?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("missions_63972"),multiple:!0,renderOnPortal:!0,values:e,onChange:n,children:g.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),renderValue:()=>(0,i.jsx)(ly,{badges:c,doNotSort:!0}),onSave:x,onStateChange:f}):(0,i.jsx)(yc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:c,doNotSort:!0,onClick:e.onClick})})},Ty=e=>{const t=(0,M.useMemo)(()=>(0,ch.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)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},zy=e=>{const t=(0,M.useMemo)(()=>(e.volunteerRegistration?.preassignPositions||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},Oy=e=>{const t=(0,M.useMemo)(()=>(e.volunteerRegistration?.preassignPositionsCategories||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},Ry=e=>{const t=(0,M.useMemo)(()=>(e.volunteerRegistration.accreditationsUsersInfos||[]).filter(e=>e.checkInAt?.isValid),[e.volunteerRegistration]),n=(0,M.useMemo)(()=>iC(t),[t]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:n,doNotSort:!0,onClick:e.onClick})})},$y=e=>(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:m(e.volunteerRegistration.shortTag)&&m(e.volunteerRegistration.weezeventPayUrl)?(0,i.jsx)(Vc,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventPayUrl,children:e.volunteerRegistration.shortTag}):e.volunteerRegistration.shortTag||""}),Dy=(...e)=>({name:"canCommentFn",args:e}),Py=(...e)=>({name:"canRegistrationStateUpdateFn",args:e}),Fy=(...e)=>({name:"canUserInfoSlotsUpdateFn",args:e});async function My(e){try{const t=await q(),n=await function(e,t){return co("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 Ny=new Map;function Ly({checks:e}){const t=e.map(e=>[e,JSON.stringify(e)]),n=t.filter(([e,t])=>!Ny.has(t));if(n.length>0){const e=My({checks:n.map(([e,t])=>e)});n.forEach(([t,n],i)=>{Ny.set(n,e.then(e=>e[i]))})}return Promise.all(t.map(([e,t])=>Ny.get(t)))}function By({withCaching:e,checks:t}){const[{isLoading:n,permissions:i},s]=(0,M.useState)({isLoading:!0,permissions:new Array(t.length).fill(!1)}),o=e?Ly:My;return(0,M.useEffect)(()=>{o({checks:t}).then(e=>{s({isLoading:!1,permissions:e})},()=>{s({isLoading:!1,permissions:i})})},[]),{isLoading:n,permissions:i}}function Vy(...e){return By({withCaching:!0,checks:e})}const Uy=e=>{const t=Hn(),{mutate:n}=Qo();return(0,i.jsx)(Ra,{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)(Jd,{cursor:"pointer",...Yb(e.state),children:t(e.state)})})},Wy=e=>{const{permissions:[t,n],isLoading:s}=function(...e){return By({withCaching:!1,checks:e})}(Py(e.eventId,Ot.PreAssigned,e.volunteerRegistrationId),Py(e.eventId,Ot.Assigned,e.volunteerRegistrationId));return s?null:(0,i.jsxs)(i.Fragment,{children:[n&&e.state!==Ot.WaitingAssignment&&(0,i.jsx)(Uy,{close:e.close,eventId:e.eventId,reload:e.reload,state:Ot.WaitingAssignment,volunteerRegistrationId:e.volunteerRegistrationId}),t&&(0,i.jsx)(Uy,{close:e.close,eventId:e.eventId,reload:e.reload,state:Ot.PreAssigned,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==Ot.Refused&&(0,i.jsx)(Uy,{close:e.close,eventId:e.eventId,reload:e.reload,state:Ot.Refused,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==Ot.NotApplicable&&(0,i.jsx)(Uy,{close:e.close,eventId:e.eventId,reload:e.reload,state:Ot.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})},Gy=e=>{const t=Hn(),{isEditMode:n}=HC(),{isEditMode:s}=tm(),o=n||s,[r,a]=(0,M.useState)(!1),l=(0,M.useCallback)(e=>{o&&a(e)},[o,a]),d=(0,M.useCallback)(()=>{l(!1)},[l]);return o&&e.updatable?(0,i.jsx)(yc,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Al,children:(0,i.jsxs)(Pd,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(Ud,{children:(0,i.jsxs)(Ra,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(Jd,{...Yb(e.state),cursor:"text",ellipsis:!0,children:t(e.state)}),r&&(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"chevron-down"})})]})}),(0,i.jsx)(Vd,{offset:2,placement:"bottom",width:230,children:(0,i.jsx)(Wy,{close:d,...e})})]})}):(0,i.jsx)(yc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Jd,{...Yb(e.state),children:t(e.state)})})},Hy=e=>{const t=(0,M.useMemo)(()=>e.volunteerRegistration.userInfo.tags||[],[e.volunteerRegistration]),n=(0,M.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:n})})},qy=e=>{const{history:t,params:{organizationId:n,eventId:s,segmentId:o}}=cl(),r=(0,M.useMemo)(()=>(e.volunteerRegistration.teams||[]).map(({teamCode:i})=>({id:i,color:"gray",icon:null,text:i,onClick(){t.push(Os.VOLUNTEERS_LIST_USER_PANEL_TEAM(n,s,o,e.volunteerRegistration.userInfo.id,i))}})),[e.volunteerRegistration]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:r})})},Yy=e=>{const{params:{organizationId:t,eventId:n}}=cl(),s=(0,M.useMemo)(()=>(0,ic.A)(e.teamMembers,e=>u(e.name)),[e.teamMembers]);return(0,i.jsx)(Ra,{children:s.map((e,s)=>(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{css:{cursor:"pointer",position:"relative",left:-4*s+"px"},children:(0,i.jsx)(Ha,{to:BI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.id}),children:(0,i.jsx)(qg,{email:e.email,image:e.picture?.url,name:e.name,size:24})})})}),(0,i.jsx)(_m,{placement:"top",children:e.name})]},e.id))})},Ky=e=>{const t=(0,M.useMemo)(()=>(e.volunteerRegistration.userInfo.formsUsersInfos||[]).flatMap(e=>e.teamMembers||[]),[e.volunteerRegistration]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Yy,{teamMembers:t})})},Zy=e=>{const t=(0,M.useMemo)(()=>(e.volunteerRegistration.weezaccessChecklists||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},Xy=e=>{const t=(0,M.useMemo)(()=>sC(e.volunteerRegistration?.accreditationsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t,doNotSort:!0,onClick:e.onClick})})},Jy=e=>{const t=Gn(ah),n=(0,M.useMemo)(()=>function(e,t,n,i){return(0,ch.A)(t,e=>e.id).map(e=>({id:`c-${e.id}`,color:"gray",icon:null,text:e.name})).concat((0,ch.A)(n,e=>e.id).map(e=>({id:`p-${e.id}`,color:e.color,icon:e.icon,text:m(e.acronym)?e.acronym:e.name}))).concat((0,ch.A)(i,e=>e.id).map(t=>{const n=m(t.position.acronym)?t.position.acronym:t.position.name,i=ph(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)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:n,onClick:e.onClick})})},Qy=e=>{const{history:t}=cl(),n=Gn(Wc),s=Gn(Kg),o=(0,M.useMemo)(()=>function(e,t){return t.flatMap(t=>t.form?[`${t.form.name} : ${e.toLocaleString(t.insertedAt.toLocal(),Zs.DateTime)}`]:[]).join(", ")}(n,e.row.userInfo.formsUsersInfos||[]),[e.row]),{mutate:r}=Qo(),a=(0,M.useCallback)((t,n)=>r({eventId:e.eventId,volunteerRegistrationId:e.row.id,slug:n,value:t}),[e.eventId,e.row,r]),l=e.row.userInfo;switch(e.column.slug){case Nh.Accreditations:return(0,i.jsx)(xy,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canAccredit,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/assigned`)}:void 0});case Nh.AccreditationsCategories:return(0,i.jsx)(_y,{column:e.column,volunteerRegistration:e.row});case Nh.AccreditationState:return(0,i.jsx)(vy,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.accreditationState,updatable:e.canAccredit,volunteerRegistrationId:e.row.id});case Nh.ScannedAccreditations:return(0,i.jsx)(Ry,{column:e.column,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/scanned`)}:void 0});case Nh.Availability:return(0,i.jsx)(by,{column:e.column,volunteerRegistration:e.row,onClick:m(e.availabilitiesPanelPath)?()=>{t.push(e.availabilitiesPanelPath)}:void 0});case Nh.Comments:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:eo(l.comments)?l.comments.flatMap(e=>e.content).join("; "):""});case Nh.CampaignsStates:return(0,i.jsx)(yy,{column:e.column,volunteerRegistration:e.row});case Nh.CheckedInPositions:return(0,i.jsx)(ky,{column:e.column,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Nh.CompletedForms:return(0,i.jsx)(Sy,{column:e.column,volunteerRegistration:e.row});case Nh.FormsInsertedAt:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:o,children:o})});case Nh.Delegations:return(0,i.jsx)(Ay,{column:e.column,reload:e.reloadRow,updatable:e.canChangeDelegation,volunteerRegistration:e.row});case Nh.DuplicatedFrom:return(0,i.jsx)(yc,{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 Nh.DelegationCategory:return(0,i.jsx)(wy,{column:e.column,volunteerRegistration:e.row});case Nh.Email:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:l.email});case Nh.Id:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:l.id});case Nh.LocalId:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId});case Nh.InsertedAt:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.row.insertedAt.toLocal(),Zs.DateTime)});case Nh.Name:return(0,i.jsx)(gy,{canClickMemberName:e.canClickMemberName,column:e.column,mutate:a,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:e.row.userInfo});case Nh.NumberOfAccreditations:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAccreditations});case Nh.NumberOfAssignments:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignments});case Nh.NumberOfAssignmentsDays:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignmentsDays});case Nh.NumberOfAvailableDays:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAvailableDays});case"picture":return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qg,{email:l.email,image:l.picture?.url,name:l.name,size:32})});case Nh.Positions:return(0,i.jsx)(Ey,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canAssign,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Nh.PositionsCategories:return(0,i.jsx)(Ty,{column:e.column,volunteerRegistration:e.row});case Nh.PreassignedPositions:return(0,i.jsx)(zy,{column:e.column,volunteerRegistration:e.row});case Nh.PreassignedPositionsCategories:return(0,i.jsx)(Oy,{column:e.column,volunteerRegistration:e.row});case Nh.Roles:return(0,i.jsx)(fy,{minWidth:e.column.minWidth,userPermissions:e.row.userInfo,width:e.column.width});case Nh.Tags:return(0,i.jsx)(Hy,{column:e.column,volunteerRegistration:e.row});case Nh.TeamCode:return(0,i.jsx)(qy,{column:e.column,volunteerRegistration:e.row});case Nh.TeamMembers:return(0,i.jsx)(Ky,{column:e.column,volunteerRegistration:e.row});case Nh.VolunteerMinutes:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:s.minutesToHoursMinutesString(e.row.volunteerMinutes)});case Nh.VolunteerRegistrationState:return(0,i.jsx)(Gy,{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 Nh.WishedAccreditationSlots:return(0,i.jsx)(Xy,{column:e.column,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/wished`)}:void 0});case Nh.WishedPositions:return(0,i.jsx)(Jy,{column:e.column,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/wished`)}:void 0});case Nh.WeezaccessChecklists:return(0,i.jsx)(Zy,{column:e.column,volunteerRegistration:e.row});case Nh.WeezeventBarcodeId:return(0,i.jsx)(Cy,{column:e.column,volunteerRegistration:e.row});case Nh.WeezeventPairedAt:return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.weezeventPairedAt?.isValid?n.toLocaleString(e.row.weezeventPairedAt.toLocal(),Zs.DateTime):""});case Nh.WeezeventShortTag:return(0,i.jsx)($y,{column:e.column,volunteerRegistration:e.row});default:return Object.values(Nh).includes(e.column.slug)?(console.error(`003: Unhandled default column ${e.column.slug}`),(0,i.jsx)(yc,{children:"ERR"})):e.column.slug.startsWith("form_inserted_at")?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:WC(n,e.column.slug,e.row.userInfo.formsUsersInfos||[])}):(0,i.jsx)(my,{column:e.column,customField:e.customField,fields:e.row.userInfo.fields,mutate:a,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0})}},ek=({title:e,subtitle:t})=>(0,i.jsx)(Tc,{css:{height:"fit-content"},children:(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{align:"center",css:{padding:"$8 0"},direction:"column",justify:"center",width:1,children:[(0,i.jsx)(Ej,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:e}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t})]})})}),tk=M.createContext({}),nk=e=>{const{mutate:t}=vo(),{mutate:n}=sr(),[s,o]=M.useState(e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot)),r=M.useMemo(()=>s.map(({id:e})=>e),[s]),[a,l]=M.useState(e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlot]:[])),[d,c]=M.useState(e.volunteerRegistration.accreditationsSlots),u=M.useMemo(()=>(0,ic.A)((0,ch.A)(s.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[s]),h=M.useMemo(()=>(0,ic.A)((0,ch.A)(a.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[a]),m=M.useMemo(()=>(0,ic.A)((0,ch.A)(d.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[d]),g=M.useMemo(()=>(0,ch.A)(s.map(e=>e.accreditation),e=>e.id),[s]),p=M.useMemo(()=>(0,ch.A)(a.map(e=>e.accreditation),e=>e.id),[a]),f=M.useMemo(()=>(0,ch.A)(d.map(e=>e.accreditation),e=>e.id),[d]),x=M.useCallback(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:Qe.Delete}}),o(e=>e.filter(e=>e.id!==n)),l(e=>e.filter(e=>e.id!==n))},[e.eventId,e.userInfoId,o,l]),_=M.useCallback(async t=>{await n({eventId:e.eventId,delegationId:e.delegationId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:Qe.Delete}}),c(e=>e.filter(e=>e.id!==t))},[e.eventId,e.delegationId,e.userInfoId]),I=M.useCallback(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:Qe.Add}});const i=d.find(e=>e.id===n);o(e=>[...e,i])},[e.eventId,e.volunteerRegistration,d,o]),v=M.useCallback(t=>e.volunteerRegistration.accreditationsUsersInfos.find(e=>e.accreditationSlot.id===t).checkInAt,[e.volunteerRegistration]);return(0,i.jsx)(tk.Provider,{value:{assignedAccreditations:g,assignedCategories:u,assignedSlots:s,assignedSlotsIds:r,canAccredit:e.canAccredit,canEditWished:e.canEditWished,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,scannedCategories:h,scannedAccreditations:p,scannedSlots:a,wishedAccreditations:f,wishedCategories:m,wishedSlots:d,assignSlot:I,deleteAssignedSlot:x,deleteWishedSlot:_,getScannedAt:v},children:e.children})};function ik(){return M.useContext(tk)}const sk=e=>{const{translate:t}=cl(),n=Gn(Wc),{assignedSlotsIds:s,assignSlot:o,canAccredit:r,canEditWished:a,defaultHiddenAccreditationsSlotsIds:l,deleteAssignedSlot:d,deleteWishedSlot:c,getScannedAt:u}=ik(),[h,m]=(0,M.useState)(!1);return"assigned"===e.state&&!e.isBlocked&&r?(0,i.jsx)(Ra,{css:{flex:"1",px:"$4"},justify:"end",children:h?(0,i.jsx)(ec,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(br,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{m(!0),await d(e.accreditationSlotId)},children:t("retirer_05155")})}):"wished"===e.state&&r?(0,i.jsx)(Ra,{css:{flex:"1",px:"$4"},justify:"end",children:s.includes(e.accreditationSlotId)?(0,i.jsxs)(Ra,{align:"center",gap:"1",children:[(0,i.jsx)(br,{color:"success500",children:(0,i.jsx)(Ya,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(br,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}):e.isBlocked?null:(0,i.jsx)(jl,{isLoading:h,size:"sm",onClick:async()=>{m(!0),await o(e.accreditationSlotId),m(!1)},children:t("ajouter_97327")})}):"wished"!==e.state||!a||e.isBlocked||l.includes(e.accreditationSlotId)?"scanned"===e.state?(0,i.jsx)(Ra,{css:{flex:"1",px:"$4"},children:(0,i.jsx)(br,{css:{ellipsis:!0},children:n.toLocaleString(u(e.accreditationSlotId),Zs.DateTime)})}):(0,i.jsx)(Ra,{css:{flex:"1",px:"$4"}}):(0,i.jsx)(Ra,{css:{flex:"1",px:"$4"},justify:"end",children:h?(0,i.jsx)(ec,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(br,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{m(!0),await c(e.accreditationSlotId)},children:t("retirer_05155")})})},ok=e=>{const t=Gn(Wc),{canAccredit:n,canEditWished:s}=ik(),o="assigned"===e.state&&n||"scanned"===e.state||"wished"===e.state&&(n||s),r=m(e.slot.name)?e.slot.name:"-";return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{css:{textTransform:"capitalize"},children:e.slot.date?t.toLocaleString(e.slot.date,Zs.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(yc,{children:(0,i.jsx)(br,{css:{ellipsis:!0},title:r,width:1,children:r})}),o&&(0,i.jsx)(sk,{accreditationSlotId:e.slot.id,isBlocked:e.slot.isBlocked,state:e.state})]})},rk=e=>{const{translate:t}=cl(),{assignedSlots:n,canAccredit:s,canEditWished:o,scannedSlots:r,wishedSlots:a}=ik(),l=(0,M.useMemo)(()=>(0,ic.A)(("assigned"===e.state?n:"scanned"===e.state?r:a).filter(t=>t.accreditationId===e.accreditation.id),e=>[e.date?.toMillis()??1,e.name?.toLowerCase()||""]),[n,r,a,e.accreditation,e.state]),d="assigned"===e.state&&s||"scanned"===e.state||"wished"===e.state&&(s||o);return(0,i.jsx)(fC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:e.accreditation.hasSlots,numberOfSlots:l.length,renderActions:!e.accreditation.hasSlots&&d?()=>(0,i.jsx)(sk,{accreditationSlotId:e.accreditation.hiddenSlotId,isBlocked:!1,state:e.state}):void 0,children:(0,i.jsxs)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Fc,{children:t("nom_du_cr_neau_54351")}),d&&(0,i.jsx)(Fc,{children:"scanned"===e.state&&t("scann_e_le_27812")})]}),l.map(t=>(0,i.jsx)(ok,{slot:t,state:e.state},t.id))]})})},ak=e=>{const{assignedAccreditations:t,scannedAccreditations:n,wishedAccreditations:s}=ik(),o=(0,M.useMemo)(()=>rC(("assigned"===e.state?t:"scanned"===e.state?n:s).filter(t=>t.accreditationCategoryId===e.category.id)),[t,s,e.category,e.state]);return(0,i.jsx)(mC,{category:e.category,children:o.map(t=>(0,i.jsx)(rk,{accreditation:t,state:e.state},t.id))})},lk=e=>{const t=Hn(),{assignedCategories:n,scannedCategories:s,wishedCategories:o}=ik(),r="assigned"===e.state?n:"scanned"===e.state?s:o;return(0,i.jsx)(hC,{children:eo(r)?r.map(t=>(0,i.jsx)(ak,{category:t,state:e.state},t.id)):(0,i.jsx)(ek,{title:t("no_accreditations")})})},dk=e=>{const{translate:t}=cl();return(0,i.jsx)(nk,{canAccredit:e.canAccredit,canEditWished:e.canEditWished,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,userInfoId:e.userInfoId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(hu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nj,{children:t("accr_ditations_39450")}),(0,i.jsx)(mu,{css:{padding:"0"},children:(0,i.jsxs)(Mb,{height:1,children:[(0,i.jsxs)(Pb,{center:!0,children:[(0,i.jsx)(Db,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(Db,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")}),(0,i.jsx)(Db,{path:`${e.basePath}/scanned`,children:t("scann_es_13169")})]}),(0,i.jsx)(Fb,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(lk,{state:"assigned"})}),(0,i.jsx)(Fb,{path:`${e.basePath}/wished`,children:(0,i.jsx)(lk,{state:"wished"})}),(0,i.jsx)(Fb,{path:`${e.basePath}/scanned`,children:(0,i.jsx)(lk,{state:"scanned"})})]})})]})})},ck=e=>{const{translate:t,params:{organizationId:n}}=cl(),{mutate:s}=Po(),[o,r]=(0,M.useState)(he.CheckInOut),[a,l]=(0,M.useState)(e.positionSlotUserInfo.checkInAt?.toLocal()),[d,c]=(0,M.useState)(e.positionSlotUserInfo.checkOutAt?.toLocal()),[u,h]=(0,M.useState)(e.positionSlotUserInfo.breakTime),m=(0,M.useMemo)(()=>Xs(),[]),g=o===he.Reset||a?.isValid&&d?.isValid&&d>a||a?.isValid&&!d?.isValid;return(0,i.jsx)(ub,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"sliders",children:t("mise_jour_du_76261")}),(0,i.jsxs)(lb,{gap:"2",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(hc,{state:o===he.CheckInOut?"checked":"unchecked",onClick:()=>{r(he.CheckInOut)},children:t("mettre_jour_l_00128")}),o===he.CheckInOut&&(0,i.jsxs)(Ra,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"6",children:[(0,i.jsx)($u,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:a,zone:m,onChange:l,onRightIconClick:()=>l(null)}),(0,i.jsx)($u,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:d,zone:m,onChange:c,onRightIconClick:()=>c(null)}),(0,i.jsx)(Ol,{css:{visibility:2723===n?"hidden":"visible"},hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:u,onChange:h})]}),(0,i.jsx)(hc,{state:o===he.Reset?"checked":"unchecked",onClick:()=>{r(he.Reset)},children:t("remettre_z_ro_11572")})]}),(0,i.jsx)(ab,{children:n=>(0,i.jsx)(jl,{disabled:!g,onClick:async()=>{await s({eventId:e.positionSlotUserInfo.eventId,checkIn:{breakTime:u,checkInAt:a?.toUTC(),checkOutAt:d?.toUTC(),strategy:o,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),n()},children:t("mettre_jour_85141")})})]})})},uk=e=>{const{translate:t}=cl(),{mutate:n}=Po(),{mutate:s}=Yo(),[o,r]=M.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{triggerElem:e.triggerElem,children:[e.canCheckIn&&(0,i.jsx)(Ld,{icon:"circle-check",onClick:()=>{r(!0)},children:t("mettre_jour_l_00128")}),e.canCheckIn&&e.psui.state!==ue.Waiting&&(0,i.jsx)(Ld,{icon:"arrows-rotate",onClick:async()=>{await n({eventId:e.psui.eventId,checkIn:{strategy:he.Reset,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reloadCheckIn(e.psui.id)},children:t("remettre_z_ro_11572")}),e.canDelete&&(0,i.jsx)(Ld,{color:"red",icon:"user-xmark",onClick:async()=>{await s({eventId:e.psui.eventId,massAssign:{positionsSlotsIds:[e.psui.positionSlot.id],selecteds:{ids:[e.psui.userInfoId]},strategy:Qe.Delete}}),e.onDelete(e.psui.id)},children:t("d_saffecter_du_47122")})]}),(0,i.jsx)(ck,{isOpen:o,positionSlotUserInfo:e.psui,onClose:()=>{e.reloadCheckIn(e.psui.id),r(!1)}})]})},hk=e=>{const{translate:t}=cl(),n=Gn(Wc),s=Gn(Kg),o=Gn(ah),{mutate:r}=Po(),a=jc(),l=(0,M.useMemo)(()=>{const t=e.positionSlotUserInfo.positionSlot;return m(t.name)?`${t.name} - ${o.toDisplayString(t.range)}`:o.toDisplayString(t.range)},[e.positionSlotUserInfo.positionSlot]),d=()=>(0,i.jsxs)(Ra,{align:"center",css:{padding:"$3","@tablet":{padding:"$3 $4"}},gap:"3",width:1,wrap:"wrap",children:[(0,i.jsx)(pC,{color:e.positionSlotUserInfo.position.color,icon:e.positionSlotUserInfo.position.icon}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray800",css:{fontWeight:"$medium",overflow:"hidden",textOverflow:"ellipsis","@tablet":{fontWeight:"$semiBold"}},children:e.positionSlotUserInfo.position.name}),(0,i.jsx)(br,{color:"gray500",fontSize:"textSm",children:l})]})]});return(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs","@tablet":{borderRadius:"$2"}},direction:"column",width:1,children:[e.canCheckIn?(0,i.jsx)(Ha,{to:ms.POSITION({organizationId:e.positionSlotUserInfo.organizationId,eventId:e.positionSlotUserInfo.eventId,positionId:e.positionSlotUserInfo.position.id}),children:d()}):d(),(e.canCheckIn||e.canDelete)&&(0,i.jsxs)(Ra,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$3","@tablet":{padding:"$3 $4"}},justify:"between",width:1,children:[e.positionSlotUserInfo.state===ue.CheckedOut?(0,i.jsx)(Jd,{leftIcon:"clock",children:t("temps_total_79448",s.minutesToHoursMinutesString(e.positionSlotUserInfo.timeDifferenceMinutes))}):e.positionSlotUserInfo.state===ue.CheckedIn?(0,i.jsx)(Jd,{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)(Jd,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")}),(0,i.jsxs)(Ra,{gap:"3",children:[e.canCheckIn&&e.positionSlotUserInfo.state===ue.Waiting&&(0,i.jsx)(jl,{size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:he.CheckIn,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("pointer_80927")}),e.canCheckIn&&e.positionSlotUserInfo.state===ue.CheckedIn&&(0,i.jsx)(jl,{color:"white",size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:he.CheckOut,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("d_pointer_25328")}),(0,i.jsx)(uk,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,psui:e.positionSlotUserInfo,reloadCheckIn:e.reloadCheckIn,triggerElem:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",rightIcon:"ellipsis-vertical",size:"sm"})}),onDelete:e.onDelete})]})]})]})},mk=M.createContext({}),gk=e=>{const{data:t}=Fo({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id}),[n,s]=M.useState(e.volunteerRegistration.positionsSlotsUsersInfos),o=M.useMemo(()=>(0,ic.A)((0,ch.A)(n.map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[n]),r=M.useCallback(e=>{s(t=>t.filter(t=>t.id!==e))},[s]),a=M.useCallback(async t=>{const i=n.find(e=>e.id===t),{event:{volunteerRegistration:{positionSlotUserInfo:o}}}=await(r={eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistration.id,positionSlotId:i.positionSlot.id},a=await q(),co("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:[Ms.UserPositionSlotUserInfoFragment]}));var r,a;s(e=>e.map(e=>e.id===t?o:e))},[e.eventId,e.volunteerRegistration,n,s]);return(0,i.jsx)(mk.Provider,{value:{assignedCategories:o,assignedPsuis:n,canCheckIn:e.canCheckIn,canDelete:e.canDelete,formsUsersInfos:t.organization?.userInfo.formsUsersInfos??[],onAssignedPsuiDelete:r,reloadCheckIn:a},children:e.children})};function pk(){return M.useContext(mk)}const fk=()=>{const{assignedCategories:e,assignedPsuis:t,canCheckIn:n,canDelete:s,onAssignedPsuiDelete:o,reloadCheckIn:r}=pk(),a=(0,M.useMemo)(()=>(0,nc.A)(t,e=>e.positionCategory.id),[t]);return(0,i.jsx)(hC,{children:e.map(e=>{const t=a[e.id];return(0,i.jsx)(mC,{category:e,children:t.map(e=>(0,i.jsx)(hk,{canCheckIn:"function"==typeof n?n(e.positionCategoryId,e.position.id):n,canDelete:s(e.positionCategoryId,e.position.id),positionSlotUserInfo:e,reloadCheckIn:r,onDelete:o},e.id))},e.id)})})},xk=e=>(0,i.jsxs)(Ra,{align:"center",css:e.css,direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(br,{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??cd.WeezeventBlankPerson,width:"100%"})}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold","@tablet":{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}},textAlign:"center",children:e.title}),m(e.subtitle)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{color:"gray500",fontSize:"textSm",textAlign:"center",children:e.subtitle})]}),e.button&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Ra,{justify:"center",children:e.button})]})]});function _k(e,t,n,i){return(0,ic.A)(e.map(e=>{const s=e.positions.map((s,o)=>({name:s.name,range:s.range?t.toDisplayString(s.range):"-",path:ms.POSITION({organizationId:n,eventId:i,positionId:s.id}),form:e.form,rank:o+1})),o=e.positionsCategories.map((s,o)=>({name:s.name,range:s.range?t.toDisplayString(s.range):"-",path:ms.POSITION_CATEGORY({organizationId:n,eventId:i,positionCategoryId:s.id}),form:e.form,rank:o+1})),r=e.positionsSlots.map(t=>({name:t.position.name,range:t.nameOrRange,path:ms.POSITION({organizationId:n,eventId:i,positionId:t.position.id}),form:e.form,rank:-1}));return s.concat(o).concat(r)}).flat(),[e=>e.form.name,(e,t)=>t])}const Ik=({message:e,title:t})=>(0,i.jsxs)(Ja,{color:"warning",leftIcon:"triangle-exclamation",children:[(0,i.jsx)(Ra,{css:{fontWeight:"$medium"},direction:"column",children:t}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{fontWeight:"normal"},children:e})]}),vk=({editDisabled:e,editPath:t,eventId:n,form:s,organizationId:o,userInfoId:r})=>{const a=Xn();return(0,i.jsx)(Jd,{color:"primary",cursor:e?"default":"pointer",onContentClick:()=>{e||a.push(t?n?t(o,r,n,s.id):t(o,r,s.id):Fi.FORM({organizationId:o,eventId:n??void 0,formId:s.id}))},children:s.name})},bk=({editFormPath:e,editPath:t,formsUsersInfos:n,isEditDisabled:s=!1})=>{const{history:o,params:{organizationId:r,eventId:a,userInfoId:l},translate:d}=cl(),c=Gn(ah),u=(0,M.useMemo)(()=>_k(n,c,r,a),[n]),h=jc();return(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,children:[s&&(0,i.jsx)(Ik,{message:d("you_are_already_assigned_to_missions"),title:d("wished_positions_can_no_longer_be_changed")}),(0,i.jsx)(Oc,{filters:m(t)&&(0,i.jsx)(jl,{color:"white",disabled:s,size:"sm",to:t,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:d("nom_de_la_missi_64605")}),!h&&(0,i.jsx)(Fc,{children:d("Date")}),!h&&(0,i.jsx)(Fc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:eo(u)?u.map((t,n)=>(0,i.jsxs)(Tc,{children:[(0,i.jsxs)(yc,{align:"start",css:{color:"$gray800",fontWeight:"$medium",fontSize:"$textSm"},direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(br,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{o.push(t.path)},children:t.name}),t.form.positionRanking===We.Ranked&&(0,i.jsx)(br,{color:"gray500",children:d("choix_n_1_00613",t.rank)}),h&&(0,i.jsx)(br,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:t.range})]}),!h&&(0,i.jsx)(yc,{children:t.range}),!h&&(0,i.jsx)(yc,{children:(0,i.jsx)(vk,{editDisabled:s,editPath:e,eventId:a,form:t.form,organizationId:r,userInfoId:l})})]},n)):(0,i.jsx)(Tc,{css:{height:"200px"},children:(0,i.jsx)(yc,{children:(0,i.jsx)(xk,{title:d("aucune_mission_61179")})})})}),setOffset:Hl.A,title:d("missions_souhai_23225"),totalCount:0})]})},jk=()=>{const{formsUsersInfos:e}=pk();return(0,i.jsx)(Ra,{css:{background:"$gray50",padding:"$6"},height:1,width:1,children:(0,i.jsx)(bk,{formsUsersInfos:e})})},Ck=e=>{const{translate:t}=cl();return(0,i.jsx)(gk,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(hu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nj,{children:t("missions_63972")}),(0,i.jsx)(mu,{css:{padding:"0"},children:(0,i.jsxs)(Mb,{height:1,children:[(0,i.jsxs)(Pb,{center:!0,children:[(0,i.jsx)(Db,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(Db,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")})]}),(0,i.jsx)(Fb,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(fk,{})}),(0,i.jsx)(Fb,{path:`${e.basePath}/wished`,children:(0,i.jsx)(jk,{})})]})})]})})},yk=M.createContext({}),kk=e=>{const{data:t,loader:n}=Yn("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},[Ms.UserInfoTeamRightPanelFragment]);const{mutate:s}=Yo(),[o,r]=M.useState([]),a=M.useMemo(()=>{const e=o.flatMap(e=>e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,yr.A)(e,["id","name","icon","color"])}))))),t=o.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,yr.A)(e,["id","name","icon","color"])})))),n=o.flatMap(e=>e.positionsSlots);return(0,ch.A)(e.concat(t).concat(n),e=>e.id)},[o]),l=M.useMemo(()=>(0,ch.A)(o.flatMap(e=>e.positionsSlotsUsersInfos.map(e=>({...e.positionSlot,position:e.position}))),e=>e.id),[o]),d=M.useMemo(()=>(0,ic.A)((0,ch.A)(a.concat(l),e=>e.id),e=>[e.position.name.toLowerCase(),e.range.start.toMillis()]),[a,l]),c=M.useMemo(()=>Object.fromEntries(o.map(e=>{const t=(0,Fs.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]})),[o]),u=M.useMemo(()=>Object.fromEntries(o.map(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlot.id);return[e.userInfo.id,t]})),[o]),h=M.useCallback(async(t,n)=>{await s({eventId:e.eventId,massAssign:{positionsSlotsIds:[n],selecteds:{ids:[t]},strategy:Qe.Add}});const{event:i}=await function(e,t){return co("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:[Ms.UserInfoTeamRightPanelFragment]})}({eventId:e.eventId,userInfoId:t},await q());r(e=>e.map(e=>e.userInfo.id===t?i.volunteerRegistration:e))},[e.eventId,r]);return M.useEffect(()=>{r(t.event?.team?.members??[])},[t.event,r]),(0,i.jsx)(yk.Provider,{value:{allSlots:d,form:t.event?.team?.form,loader:n,memberIdToAssignedSlotsIds:u,memberIdToWishedSlotsIds:c,members:o,assign:h},children:e.children})};function Ak(){return M.useContext(yk)}const wk=e=>{const{translate:t}=cl(),{assign:n,memberIdToAssignedSlotsIds:s,memberIdToWishedSlotsIds:o}=Ak(),[r,a]=(0,M.useState)(!1),l=s[e.member.userInfo.id].includes(e.slot.id),d=o[e.member.userInfo.id].includes(e.slot.id);return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Ub,{size:32,userInfo:e.member.userInfo})}),(0,i.jsx)(yc,{justify:"end",children:l?(0,i.jsxs)(Ra,{align:"center",gap:"1",children:[(0,i.jsx)(br,{color:"success500",children:(0,i.jsx)(Ya,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(br,{font:"gray800 textXs medium",children:t("d_j_affect_71706")})]}):d?(0,i.jsx)(jl,{isLoading:r,size:"sm",onClick:()=>{a(!0),n(e.member.userInfo.id,e.slot.id)},children:t("affecter_94255")}):(0,i.jsxs)(Ra,{align:"center",gap:"1",children:[(0,i.jsx)(br,{color:"error500",children:(0,i.jsx)(Ya,{icon:"circle-xmark",iconStyle:"solid"})}),(0,i.jsx)(br,{font:"gray800 textXs medium",children:t("non_souhait_46147")})]})})]})},Sk=e=>{const{translate:t}=cl(),{members:n}=Ak(),s=Gn(ah),o=(0,M.useMemo)(()=>ph(s,e.slot,e.slot.position.name,{slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ra,{css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(pC,{color:e.slot.position.color,icon:e.slot.position.icon}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:e.slot.position.name}),(0,i.jsx)(br,{color:"gray500",children:o})]})]}),(0,i.jsxs)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:t("full_name")}),(0,i.jsx)(Fc,{})]}),n.map(t=>(0,i.jsx)(wk,{member:t,slot:e.slot},t.userInfo.id))]})]})},Ek=()=>{const{allSlots:e}=Ak();return(0,i.jsx)(Ra,{direction:"column",gap:"3",width:1,children:e.map(e=>(0,i.jsx)(Sk,{slot:e},e.id))})},Tk=e=>{const{translate:t}=cl(),{form:n,loader:s}=Ak();return(0,i.jsxs)(hu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nj,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{children:t("_quipe_1_19590",e.teamCode)}),(0,i.jsx)(br,{color:"gray500",fontSize:"textSm",children:t("formulaire_1_39637",n?.name)})]})}),(0,i.jsx)(mu,{css:{background:"$gray50",py:"$6"},children:s||(0,i.jsx)(Ek,{})})]})},zk=e=>(0,i.jsx)(kk,{eventId:e.eventId,teamCode:e.teamCode,children:(0,i.jsx)(Tk,{...e})}),Ok=({editFormPath:e,editPath:t,eventId:n,organizationId:s,formsUsersInfos:o,showEditButton:r,userInfoId:a,isEditDisabled:l=!1})=>{const{translate:d}=cl(),c=Gn(Wc),u=Gn(ah),h=(0,M.useMemo)(()=>(0,ic.A)(o.flatMap(e=>e.slots.map(t=>({range:t.range,display:e.form.slotDisplay,form:e.form}))),({range:e})=>e.start.toMillis()),[o]),m=jc(),g=(0,M.useCallback)((e,t)=>{switch(t){case pt.Calendar:case pt.DisplayDays:return(0,i.jsx)(br,{children:c.toLocaleString(e.start,Zs.DateOnly.MonthLong)});case pt.Display:case pt.Custom:return(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{css:{lineHeight:"20px"},children:u.toDisplayString(e,{hideTime:!0})}),(0,i.jsx)(br,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:u.toDisplayString(e,{hideDate:!0})})]});case pt.Hide:return null;default:return nl()}},[]);return(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[l&&(0,i.jsx)(Ik,{message:d("you_are_already_assigned_to_missions"),title:d("availabilities_can_no_longer_be_changed")}),(0,i.jsx)(Oc,{filters:r&&(0,i.jsx)(jl,{color:"white",disabled:l,size:"sm",to:t,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:d("Date")}),!m&&(0,i.jsx)(Fc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:eo(h)?h.map((t,o)=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:g(t.range,t.display)}),!m&&(0,i.jsx)(yc,{children:(0,i.jsx)(vk,{editDisabled:l,editPath:e,eventId:n,form:t.form,organizationId:s,userInfoId:a})})]},o)):(0,i.jsx)(Tc,{css:{height:"200px"},children:(0,i.jsx)(yc,{children:(0,i.jsx)(xk,{title:d("aucune_disponib_15602")})})})}),setOffset:Hl.A,title:d("disponibilit_s_49923"),totalCount:0})]})},Rk=e=>{const t=Hn(),{data:n,loader:s}=Go({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.userInfoId}),{permissions:[o],isLoading:r}=Vy(Fy({eventId:e.eventId,userInfoId:e.userInfoId}));return(0,i.jsxs)(hu,{returnToFallback:e.returnPathFallback,size:"md",children:[(0,i.jsx)(nj,{children:t("disponibilit_s_49923")}),(0,i.jsx)(mu,{children:s||r?s:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Ok,{editFormPath:(t,n,i,s)=>location.host.startsWith("app.")?Os.EDIT_USER_SLOTS_FORM(t,i,n,s):e.delegationId?as.MEMBER_EDIT({organizationId:t,userInfoId:n,delegationId:e.delegationId,eventId:i,formId:s}):BI.MEMBER_FORM_EDIT({organizationId:t,userInfoId:n,eventId:i,formId:s}),editPath:Os.EDIT_USER_SLOTS(e.organizationId,e.eventId,e.userInfoId),eventId:e.eventId,formsUsersInfos:n.organization.userInfo.formsUsersInfos,organizationId:e.organizationId,showEditButton:o,userInfoId:e.userInfoId}),(0,i.jsx)(Ba,{height:"6"})]})})]})},$k=e=>{const{history:t}=cl();return(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:e.accreditationsPanelPath,children:(0,i.jsx)(dk,{basePath:e.accreditationsPanelPath,canAccredit:e.canAccredit,canEditWished:e.canEditWishedAccreditations,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})}),(0,i.jsx)(Cr.qh,{path:e.availabilitiesPanelPath,children:(0,i.jsx)(Rk,{delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,returnPathFallback:e.availabilitiesPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),(0,i.jsx)(Cr.qh,{path:e.positionsPanelPath,children:(0,i.jsx)(Ck,{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,s)=>(0,i.jsx)(Cr.qh,{path:n,children:(0,i.jsx)(zk,{eventId:e.eventId,teamCode:(e.volunteerRegistration.teams||[])[s].teamCode,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})},s))]})};function Dk(e,t){return 0===e.length||e.includes(t)}const Pk=e=>{const t=Hn(),[n,s]=M.useState(!1),o=M.useCallback(async()=>{let t=!0;return s(!0),await e.onDelete(),t&&s(!1),()=>{t=!1}},[e.onDelete,n,s]);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ra,{align:"center",css:{background:"$error100",borderRadius:"48px",color:"$error600",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(Ya,{icon:"circle-exclamation",iconStyle:"light"})})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray900 textLg regular",textAlign:"center",title:e.text,children:e.text}),"subtext"in e&&Qs(e.subtext).map((e,t)=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:e})]},t)),"children"in e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{color:"gray500",css:{alignSelf:"center"},children:e.children})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{color:"error",isLoading:n,onClick:o,children:e.buttonText}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},Fk=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=cl(),{mutate:r}=Ho(),{mutate:a}=$o(),{mutate:l}=No(),[d,c]=(0,M.useState)(!1),[u,h]=(0,M.useState)(!1),m=(0,M.useMemo)(()=>e.customDocuments.filter(t=>Dk(t.populationsIds,e.member.fields.population)),[e.customDocuments,e.member]),g=s&&e.canAccredit&&e.accreditationState===re.WaitingAccreditation,p=s&&e.showDocumentsDownload&&void 0!==e.member.links&&eo(e.allowedCustomDocuments);return g||p||e.canDelete||e.showDeleteFromEvent?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ld,{icon:"check",onClick:async()=>{await r({eventId:s,delegationId:o,usersInfosIds:[e.member.id]}),e.reload()},children:t("valider_les_acc_80801")}),(0,i.jsx)(Ld,{icon:"badge-check",to:Os.ACCREDIT(n,s,e.member.id),children:t("accr_diter_70543")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"})]}),p&&(0,i.jsx)(i.Fragment,{children:eo(e.allowedCustomDocuments)&&(0,i.jsx)(i.Fragment,{children:e.allowedCustomDocuments.map((n,s)=>{const o=m.find(e=>e.slug===n);return o?(0,i.jsx)(Ld,{download:`${e.member.nameOrEmail}-${o.name}`,icon:"arrow-down-to-bracket",target:"_blank",to:rg(e.member.links?.userCustomDocumentLinks[n],"pdf"),children:t("t_l_charger_1_80752",o.name)},s):Jt.includes(n)?(0,i.jsx)(Ld,{download:`${e.member.nameOrEmail}-custom-badge`,icon:"arrow-down-to-bracket",target:"_blank",to:rg(e.member.links?.userCustomBadgeLinks[n],"pdf"),children:t("t_l_charger_1_80752",z_(n))},s):null})})}),p&&e.canDelete&&(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),e.canDelete&&(0,i.jsx)(Ld,{color:"red",icon:"user-xmark",onClick:()=>c(!0),children:t("retirer_de_la_d_64963")}),e.showDeleteFromEvent&&(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>h(!0),children:t("delete_from_eve_69290")})]}),d&&(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_sur_d_88752")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>c(!1),onDelete:async()=>{await a({organizationId:n,eventId:s,delegationId:o,selecteds:{ids:[e.member.id]},deleteFromEvent:e.deleteFromEvent}),e.reload()}}),u&&e.volunteerRegistrationId&&(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:[t("are_you_sure_yo_46668")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>h(!1),onDelete:async()=>{await l({eventId:s,selecteds:{ids:[e.member.id]}}),e.reload()}})]}):null};function Mk(e,t){switch(t){case _e.Accreditation:return e("accr_ditations_39450");case _e.Delegation:return e("d_l_gations_78318");case _e.Event:return e("Event");case _e.Position:return e("missions_63972");case _e.UserInfo:return e("membres_11310");default:return nl()}}function Nk(e){return m(e.label)?`${e.name} (${e.label})`:e.name}const Lk=({displayName:e,isAddDeleteVisible:t,isResetVisible:n,massEditFieldInput:s,reset:o,strategy:r,change:a})=>{const{translate:l}=cl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray700 textSm medium",children:l("que_souhaitez_v_87607")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(hc,{state:o||r!==Qe.Replace?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",Qe.Replace)},children:l("remplacer_les_v_78885")}),!o&&r===Qe.Replace&&s,(0,i.jsx)(Ba,{height:"3"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:o||r!==Qe.Add?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",Qe.Add)},children:l("ajouter_des_val_80159")}),!o&&r===Qe.Add&&s,(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:o||r!==Qe.Delete?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",Qe.Delete)},children:l("supprimer_des_v_96120")}),!o&&r===Qe.Delete&&s,(0,i.jsx)(Ba,{height:"3"})]}),n&&(0,i.jsx)(hc,{state:o?"checked":"unchecked",onClick:()=>a("massEdit.reset",!0),children:l("r_initialiser_42983",e)})]})},Bk=e=>{const t=Hn(),n=(0,M.useMemo)(()=>(0,ic.A)(e.customFields??[],e=>e.name.toLowerCase()),[e.customFields]),s=(0,M.useMemo)(()=>(0,ic.A)(n.map(e=>({slug:e.slug,name:e.name,label:e.label})).concat(e.properties.map(e=>({slug:e,name:t(e),label:null}))),e=>e.name.toLowerCase()),[n,e.properties]);return(0,i.jsx)(Qc,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Fa.lV,{initialValues:{massEdit:{reset:!1,selecteds:e.selecteds,slug:"",value:"",strategy:Qe.Replace}},initialValuesEqual:Or.A,render:({form:o,handleSubmit:r,submitting:a,values:l})=>{const{reset:d,slug:c,strategy:u}=l.massEdit,h=s.find(e=>e.slug===c),g=n.find(e=>e.slug===c),p=m(c)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{paddingLeft:"$6"},children:(0,i.jsx)(kj,{campaigns:e.campaigns,categories:e.categories,change:o.change,customDocuments:e.customDocuments,customField:g,forms:e.forms,name:"massEdit.value",slug:c,tags:e.tags,traces:e.traces,value:l.massEdit.value})})]}):null,f=c===ne.Tag||c===Ie.Campaigns||c===Ie.Documents||!0===g?.canSelectMultiple,x=c!==ne.Category&&c!==fe.Category&&c!==Ie.Category&&c!==st.Category&&c!==ne.WeezeventIsSynchronized&&c!==fe.Privacy&&c!==Ie.Form&&c!==Ie.IsLocked&&c!==Ie.ShowFormLinkInDelegationSpace&&c!==Ie.ShowInDelegationSpace&&c!==Ie.CanLeadersAddMembers&&c!==Ie.CanLeadersEditCustomFields&&c!==Ie.CanLeadersEditMembers&&c!==Ie.CanLeadersDeleteMembers&&c!==Ie.CanLeadersEditColumns&&c!==Ie.CanLeadersImportMembers&&c!==Ie.CanLeadersSeeHiddenAccreditationsSlots;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_dition_de_la_v_67585")}),(0,i.jsx)(Ba,{height:"7"}),e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Mm,{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:Nk(e)},e.slug))}),h&&(0,i.jsx)(Lk,{change:o.change,displayName:h.name,isAddDeleteVisible:f,isResetVisible:x,massEditFieldInput:p,reset:d,strategy:u}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{disabled:(_=l.massEdit,I=g,!(_.reset||!I||I.fieldType!==Le.Select||I.canSelectMultiple||"number"==typeof _.value&&!isNaN(_.value))),isLoading:a,onClick:r,children:t("modifier_la_val_07602")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]});var _,I},onSubmit:async t=>{const n=(await e.mutate(t.massEdit)).numberOfEdited;e.onSuccess(n),e.onClose()}})})},Vk=e=>{const{data:t,isLoading:n}=Yn("query PositionsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Position, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n\n traces {\n id\n name\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ms.MassEditCustomFieldFragment]);const s=(0,M.useMemo)(()=>vn.filter(e=>e!==st.Name),[]);return(0,i.jsx)(Bk,{campaigns:[],categories:t.event?.positionsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:t.event?.traces??[],onClose:e.onClose,onSuccess:e.onSuccess})},Uk=e=>{const{data:t,isLoading:n}=Yn("query AccreditationsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ms.MassEditCustomFieldFragment]);const s=(0,M.useMemo)(()=>qt.filter(e=>e!==ne.Name),[]);return(0,i.jsx)(Bk,{campaigns:[],categories:t.event?.accreditationsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},Wk=e=>{const{data:t,isLoading:n}=(s={organizationId:e.organizationId},Yn(ho,s,[]));var s;const o=(0,M.useMemo)(()=>Qt.filter(e=>e!==fe.Label&&e!==fe.Name),[]);return(0,i.jsx)(Bk,{campaigns:[],categories:t.organization?.customFieldsCategories.nodes??[],customDocuments:[],customFields:[],forms:[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},Gk=e=>{const{data:t,isLoading:n}=(s={organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?tt.Event:tt.Organization},Yn(mo,s,[Ms.MassEditCustomFieldFragment]));var s;const o=(0,M.useMemo)(()=>tn.filter(e=>e!==Ie.Name&&e!==Ie.Columns),[]);return(0,i.jsx)(Bk,{campaigns:t.organization?.campaigns.nodes??[],categories:t.organization?.delegationsCategories.nodes??[],customDocuments:t.organization?.event?.customDocuments??[],customFields:t.organization?.customFields.nodes??[],forms:t.organization?.forms.nodes??[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},Hk=e=>{const{data:t,isLoading:n}=Yn("query UsersInfosMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",{organizationId:e.organizationId},[Ms.MassEditCustomFieldFragment]);return(0,i.jsx)(Bk,{campaigns:[],categories:[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},qk=e=>(0,i.jsx)(Bk,{campaigns:[],categories:[],customDocuments:[],customFields:e.customFields,forms:[],isLoading:!1,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess});let Yk=class extends Pl{translationService;constructor(e){super(e),this.translationService=e}massAccreditStep1Schema(){return d.Ik().shape({massAccredit:d.Ik().shape({...this.massAccreditStep1Fields()})})}massAccreditStep2Schema(){return d.Ik().shape({massAccredit:d.Ik().shape({...this.massAccreditStep2Fields()})})}massAccreditSchema(){return d.Ik().shape({...this.massAccreditStep1Fields(),...this.massAccreditStep2Fields()})}massAccreditStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(_n,this.t("la_strat_gie_es_82287"))}}massAccreditStep2Fields(){return{accreditationsSlotsIds:d.YO().of(d.ai()).required(this.t("vous_devez_s_le_72138")).min(1,this.t("vous_devez_s_le_72138"))}}};Yk=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Yk);const Kk=e=>(0,Wt.createPortal)((0,i.jsx)(br,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"50",...e.css},height:1,width:1,children:e.children}),document.body),Zk=e=>{const t=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massAccredit.strategy",value:Qe.Add,children:t("ajouter_des_acc_17744")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massAccredit.strategy",value:Qe.Replace,children:t("remplacer_les_a_92733")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massAccredit.strategy",value:Qe.Delete,children:t("supprimer_des_a_04246")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:e.handleSubmit,children:t("suivant_accr_25709")})})]})};var Xk=n(9120);const Jk=e=>(0,ic.A)(e,e=>e.toMillis()),Qk=hr("div",{alignItems:"center",borderRadius:"$2",color:"$gray400",display:"flex",fontWeight:"$medium",height:"32px",justifyContent:"center",userSelect:"none",width:"32px",variants:{isSelectable:{true:{color:"$gray800",cursor:"pointer","&:hover":{background:"$primary700",color:"white"}}},isSelected:{true:{background:"$primary700",color:"white",cursor:"pointer"}}},compoundVariants:[{isSelectable:!0,isSelected:!0,css:{background:"$primary700",color:"white",cursor:"pointer"}}]}),eA=({disabledDates:e,firstDayOfMonth:t,max:n,min:s,onChange:o,startHour:r,values:a})=>{const l=Hn(),d=Gn(Wc),c=(0,M.useMemo)(()=>t.minus({day:t.weekday-1}),[t]),u=(0,M.useMemo)(()=>t.endOf("month"),[t]),h=(0,M.useMemo)(()=>{const e=u.plus({day:7-u.weekday});return Math.ceil(e.diff(c,"days").days)},[u]),m=(0,M.useMemo)(()=>(0,wc.A)(0,h).map(i=>{const o=c.plus({day:i}).set({hour:r||0}),l=o.toMillis(),d=a.some(e=>e.toMillis()===l),u=!!eo(e)&&e.some(e=>e.toMillis()===l);return{day:o,isSelected:d,isDisabled:u,isSelectable:!u&&o.month===t.month&&o>=s&&o<=n}}),[c,h,a,e,r]),g=(0,M.useMemo)(()=>!m.some(({isSelectable:e,isSelected:t})=>e&&!t),[m]),p=(0,M.useCallback)(()=>{o(g?[]:m.flatMap(({day:e,isSelectable:t,isSelected:n})=>t||n?[e]:[]))},[m,g,o]);return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$5 $4"},direction:"column",children:[(0,i.jsx)(br,{css:{textTransform:"capitalize"},font:"gray800 textXl semiBold",textAlign:"center",width:1,children:d.toLocaleString(t,{month:"long",year:"numeric"})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(id,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:(0,wc.A)(0,7).map(e=>{const t=c.plus({day:e});return(0,i.jsx)(br,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",width:32,children:d.toLocaleString(t,{weekday:"short"})},e)})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(id,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:m.map(({day:e,isSelected:t,isSelectable:n},s)=>(0,i.jsx)(Qk,{isSelectable:n,isSelected:t,onClick:i=>{if(n&&t)o(Jk((0,Xk.A)(a,[e],e=>e.toMillis())));else if(n&&!t){const t=a.findLast(t=>tt.plus({day:e+1}));o(Jk([...a,...i]))}else o(Jk([...a,e]))}},children:e.day},s))}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(jl,{color:"white",textAlign:"center",onClick:p,children:l(g?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})},tA=e=>{const{minDate:t,maxDate:n,numberOfMonths:s,totalDaysDiff:o}=(0,M.useMemo)(()=>Eh(e.slots),[e.slots]),r=(0,M.useMemo)(()=>e.slots.flatMap(t=>t.date?.isValid&&e.accreditationsSlotsIds.includes(t.id)?[t.date]:[]),[e.slots,e.accreditationsSlotsIds]),a=(0,M.useMemo)(()=>(0,wc.A)(0,o).flatMap(n=>{const i=t.plus({day:n});return e.slots.some(e=>e.date?.isValid&&e.date.toMillis()===i.toMillis())?[]:[i]}),[t,o,e.slots]);return(0,i.jsx)(Ra,{gap:"4",wrap:"wrap",children:(0,wc.A)(0,s).map(o=>{const l=t.plus({month:o}).startOf("month"),d=0===o?t:l,c=o===s-1?n:l.endOf("month"),u=r.filter(e=>e.startOf("month").equals(l));return(0,i.jsx)(eA,{disabledDates:a,firstDayOfMonth:l,max:c,min:d,values:u,onChange:t=>{e.change(`${e.prefix}accreditationsSlotsIds`,Th(e.accreditationsSlotsIds,e.slots,l,t))}},o)})})},nA=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>e.slots.filter(e=>e.date?.isValid),[e.slots]);return eo(n)?(0,i.jsx)(tA,{...e,slots:n}):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})};let iA=class{translationService;constructor(e){this.translationService=e}getFormatter(e={}){return Intl.NumberFormat(this.translationService.language.toString().toLowerCase(),{notation:e.notation||"compact",style:e.style||"unit",unit:e.unit||"byte",unitDisplay:e.unitDisplay||"narrow"})}toNumberOrInfinity(e){return"number"==typeof e&&e!==1/0?e.toLocaleString():"∞"}static bytesToMegabytes(e){return`${parseFloat((e/1e6).toPrecision(1))} MB`}static bytesToGigabytes(e){return`${parseFloat((e/1e9).toPrecision(1))} GB`}};iA=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],iA);const sA=e=>{const{translate:t}=cl(),n=Gn(iA),s=(0,M.useMemo)(()=>tC(e.accreditation),[e.accreditation]),o=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",px:"$4",userSelect:"none"},gap:"2",height:64,onClick:()=>{e.onClick(e.slot.id,"unchecked"===o)},children:[(0,i.jsx)(lc,{shouldPreventDefault:!1,state:o,onClick:Hl.A}),(0,i.jsx)(pC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Ra,{css:{px:"$3"},width:310,children:(0,i.jsx)(Jd,{color:e.slot.assignedResources>=(e.slot.maxResources||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,n.toNumberOrInfinity(e.slot.maxResources))})})]})},oA=e=>{const t=Hn(),n=Gn(Wc),s=Gn(iA),o=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Tc,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===o)},children:[(0,i.jsx)(yc,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(lc,{shouldPreventDefault:!1,state:o,onClick:Hl.A}):(0,i.jsx)(uc,{shouldPreventDefault:!1,state:o,onClick:Hl.A})}),(0,i.jsx)(yc,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(yc,{children:e.slot.date?.isValid?n.toLocaleString(e.slot.date,Zs.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(yc,{children:(0,i.jsx)(Jd,{color:e.slot.assignedResources>=(e.slot.maxResources||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,s.toNumberOrInfinity(e.slot.maxResources))})})]})},rA=e=>{const t=Hn(),n=(0,M.useMemo)(()=>(0,ic.A)(e.slots.filter(t=>t.accreditation.id===e.accreditation.id),e=>(0,Va.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.slots,e.accreditation]),s=(0,M.useMemo)(()=>n.map(e=>e.id),[n]),o=(0,M.useMemo)(()=>{const t=(0,lh.A)(e.accreditationsSlotsIds,s);return t.length===s.length?"checked":0===t.length?"unchecked":"indeterminate"},[s,e.accreditationsSlotsIds]),r=(0,M.useCallback)((t,n)=>{if(e.accreditation.accreditationDisplay===te.Radio){const i=(0,oc.A)(e.accreditationsSlotsIds,s).concat(n?[t]:[]);e.change("massAccredit.accreditationsSlotsIds",i)}else e.change("massAccredit.accreditationsSlotsIds",no(e.accreditationsSlotsIds,t,n))},[e.accreditation,e.accreditationsSlotsIds,e.change,s]),a=e.accreditation.accreditationDisplay===te.List||e.strategy===Qe.Delete;return e.accreditation.hasSlots?(0,i.jsx)(fC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:e.accreditation.accreditationDisplay===te.Calendar?(0,i.jsx)(Ra,{css:{background:"$gray50",padding:"$4"},children:(0,i.jsx)(nA,{accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:"massAccredit.",slots:n})}):(0,i.jsxs)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{justify:"center",width:48,children:a&&(0,i.jsx)(lc,{state:o,onClick:t=>{"checked"===t?e.change("massAccredit.accreditationsSlotsIds",(0,Fs.A)(e.accreditationsSlotsIds.concat(s))):e.change("massAccredit.accreditationsSlotsIds",(0,oc.A)(e.accreditationsSlotsIds,s))}})}),(0,i.jsx)(Fc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Fc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Fc,{})]}),n.map(t=>(0,i.jsx)(oA,{accreditationsSlotsIds:e.accreditationsSlotsIds,shouldDisplayList:a,slot:t,onClick:r},t.id))]})}):(0,i.jsx)(sA,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,slot:n[0],onClick:r})},aA=e=>{const t=(0,M.useMemo)(()=>(0,ic.A)(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id),e=>e.name.toLowerCase()),[]);return(0,i.jsx)(mC,{category:e.category,children:t.map(t=>(0,i.jsx)(rA,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,slots:e.slots,strategy:e.strategy},t.id))})},lA=e=>{const t=Hn(),[n,s]=(0,M.useState)(!1),[o,r]=(0,M.useState)(e.excludeEmpty?"checked":"unchecked"),[a,l]=(0,M.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,M.useState)(e.excludePast?"checked":"unchecked"),u=(e.excludeEmpty?1:0)+(e.excludeFull?1:0)+(e.excludePast?1:0);return(0,i.jsxs)(Ra,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(eC,{apply:()=>{e.setExcludeEmpty("checked"===o),e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),s(!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(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsx)(dc,{state:o,onClick:r,children:t("cacher_les_cr_n_76382")}),(0,i.jsx)(dc,{state:a,onClick:l,children:t("cacher_les_cr_n_31908")}),(0,i.jsx)(dc,{state:d,onClick:c,children:t("masquer_les_cr_05336")})]})]})},dA=e=>{const t=Hn(),[n,s,o]=Pc(""),[r,a]=(0,M.useState)(!1),[l,d]=(0,M.useState)(!1),[c,u]=(0,M.useState)(!1),{data:h,loader:g}=Yn("query MassAccreditSlots(\n $eventId: EventId!\n $delegationId: DelegationId\n $accreditationName: String\n $excludeFull: Boolean\n $excludeEmpty: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n accreditationsSlots(\n delegationId: $delegationId\n accreditationName: $accreditationName\n includeHidden: true\n excludeFull: $excludeFull\n excludeEmpty: $excludeEmpty\n excludePast: $excludePast\n ) {\n nodes {\n id\n name\n assignedResources\n maxResources\n date\n isBlocked\n isFull\n\n accreditation {\n id\n accreditationCategoryId\n name\n accreditationDisplay\n hasSlots\n color\n icon\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationName:m(s)?s:void 0,excludeEmpty:r,excludeFull:l,excludePast:c},[]);const p=(0,M.useMemo)(()=>(h.event?.accreditationsSlots.nodes??[]).filter(e=>!e.isBlocked),[h.event]),f=(0,M.useMemo)(()=>(0,ic.A)((0,ch.A)(p.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[p]),x=(0,M.useMemo)(()=>(0,ch.A)(p.map(e=>e.accreditation),e=>e.id),[p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lA,{excludeEmpty:r,excludeFull:l,excludePast:c,name:n,setExcludeEmpty:a,setExcludeFull:d,setExcludePast:u,setName:o}),(0,i.jsx)(Ba,{height:"6"}),g||(0,i.jsx)(hC,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:f.map(t=>(0,i.jsx)(aA,{accreditations:x,accreditationsSlotsIds:e.values.massAccredit.accreditationsSlotsIds,category:t,change:e.change,slots:p,strategy:e.values.massAccredit.strategy},t.id))}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:e.submitting,onClick:e.handleSubmit,children:m(e.buttonText)?e.buttonText:t(e.values.massAccredit.strategy===Qe.Add?"accr_diter_les_78545":e.values.massAccredit.strategy===Qe.Replace?"r_accr_diter_le_34059":"d_saccr_diter_l_28590",e.numberOfSelected)})})]})},cA=({eventId:e,numberOfSelected:t,onClose:n,onSuccess:s,selecteds:o})=>{const r=Hn(),a=Gn(Yk),{mutate:l}=vo();return(0,i.jsx)(Kk,{children:(0,i.jsx)(zm,{category:r("Accreditation"),title:r("accr_diter_les_48281"),onClose:n,children:(0,i.jsx)(Em,{children:(0,i.jsxs)(Bv,{initialValues:{massAccredit:{selecteds:o,strategy:Qe.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{const i=(await l({eventId:e,massAccredit:t.massAccredit})).numberOfMembers;s(r("_1_membres_ont_05068",i)),n()},children:[(0,i.jsx)(Lv,{render:({handleSubmit:e})=>(0,i.jsx)(Zk,{handleSubmit:e}),schema:a.massAccreditStep1Schema(),title:r("initialisation_38640")}),(0,i.jsx)(Lv,{render:({form:n,handleSubmit:s,submitting:o,values:r})=>(0,i.jsx)(dA,{change:n.change,delegationId:null,eventId:e,handleSubmit:s,numberOfSelected:t,submitting:o,values:r}),schema:a.massAccreditStep2Schema(),title:r("accr_ditations_39450")})]})})})})},uA=e=>{const{history:t,translate:n}=cl(),{mutate:s,isLoading:r}=ir(),[a,l]=(0,M.useState)([]),d=eo(a);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",children:n("SendCampaign")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(fc,{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)(Ba,{height:"2"}),(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",onClick:()=>{const n=o(JSON.stringify({usersInfosIds:e.selecteds.ids}));t.push(jI.CREATE({organizationId:e.organizationId,eventId:e.eventId||void 0,options:n}))},children:n("cr_er_une_nouve_86635")})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{disabled:!d,isLoading:r,onClick:async()=>{if(eo(a)){const t=e.campaigns.find(e=>e.id===a[0]),i=(await s({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)(jl,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},hA=e=>{const{data:t}=Yn("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?tt.Event:tt.Organization,eventId:e.eventId},[]);return(0,i.jsx)(uA,{campaigns:t.organization?.campaigns.nodes??[],canCreate:!0,delegationId:null,eventId:e.eventId,organizationId:e.organizationId,selecteds:e.selecteds,onClose:e.onClose,onSuccess:e.onSuccess})},mA=e=>{const{translate:t}=cl(),n=Gn(Yk),{mutate:s}=sr();return(0,i.jsx)(Kk,{children:(0,i.jsx)(zm,{category:t("Accreditation"),title:t("update_desired_accreditations"),onClose:e.onClose,children:(0,i.jsx)(Em,{css:{py:"$7"},children:(0,i.jsxs)(Bv,{initialValues:{massAccredit:{selecteds:e.selecteds,strategy:Qe.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{await s({eventId:e.eventId,delegationId:e.delegationId,massAccredit:t.massAccredit}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(Lv,{render:({handleSubmit:e})=>(0,i.jsx)(Zk,{handleSubmit:e}),schema:n.massAccreditStep1Schema(),title:t("initialisation_38640")}),(0,i.jsx)(Lv,{render:({form:n,handleSubmit:s,values:o,submitting:r})=>(0,i.jsx)(dA,{buttonText:o.massAccredit.strategy===Qe.Delete?t("supprimer_les_a_93519"):t("update_desired_accreditations"),change:n.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:s,numberOfSelected:e.numberOfSelected,submitting:r,values:o}),schema:n.massAccreditStep2Schema(),title:t("accr_ditations_39450")})]})})})})},gA=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=cl(),{mutate:r}=zo(),{mutate:a}=Ho(),{mutate:l}=$o(),[d,c]=(0,M.useState)(!1),[u,h]=(0,M.useState)(!1),[m,g]=(0,M.useState)(!1),[p,f]=(0,M.useState)(!1),[x,_]=(0,M.useState)(!1),I=e.massActions.getSelectedsInput(null,null),v=e.showAccreditationsValidate||eo(e.campaigns)||e.showDelete;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{color:"invisible-gray",leftIcon:"pen",onClick:()=>{c(!0)},children:t("_diter_un_champ_64621")}),e.showWishedAccreditationsEdit&&(0,i.jsx)(jl,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>{h(!0)},children:t("_diter_les_accr_41957")}),e.showAccreditationsEdit&&(0,i.jsx)(jl,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>{g(!0)},children:t("_diter_les_accr_86042")}),v&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"invisible-gray",rightIcon:"chevron-down",children:t("plus_77692")})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[e.showAccreditationsValidate&&(0,i.jsx)(Ld,{icon:"check",onClick:async()=>{await a({eventId:s,delegationId:o,usersInfosIds:I.ids}),e.onMassEditSuccess()},children:t("valider_les_acc_80801")}),eo(e.campaigns)&&(0,i.jsx)(Ld,{icon:"paper-plane",onClick:()=>{f(!0)},children:t("SendCampaign")}),e.showDelete&&(0,i.jsx)(Ld,{color:"red",icon:"user-xmark",onClick:()=>_(!0),children:t("retirer_de_la_d_64963")})]})]}),d&&(0,i.jsx)(qk,{customFields:e.customFields,mutate:e=>r({organizationId:n,eventId:s,delegationId:o,massEdit:e}),selecteds:I,onClose:()=>{c(!1)},onSuccess:e.onMassEditSuccess}),u&&(0,i.jsx)(mA,{delegationId:o,eventId:s,numberOfSelected:e.massActions.numberOfSelected,selecteds:I,onClose:()=>{h(!1)},onSuccess:e.onMassEditSuccess}),m&&(0,i.jsx)(cA,{eventId:s,numberOfSelected:e.massActions.numberOfSelected,selecteds:I,onClose:()=>{g(!1)},onSuccess:e.onMassEditSuccess}),p&&(0,i.jsx)(uA,{campaigns:e.campaigns,canCreate:!1,delegationId:o,eventId:s,organizationId:n,selecteds:I,onClose:()=>{f(!1)},onSuccess:e.onMassEditSuccess}),x&&(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_sur_d_29974"),text:t("suppression_de_57689",I.ids?.length??0),onClose:()=>_(!1),onDelete:async()=>{await l({organizationId:n,eventId:s,delegationId:o,selecteds:I,deleteFromEvent:e.deleteFromEvent}),e.onMassEditSuccess()}})]})};function pA(e){return(0,ic.A)((0,ch.A)(e,e=>e.accreditation.id).map(t=>({...t.accreditation,accreditationCategory:t.accreditationCategory,slots:zh(e.filter(e=>e.accreditation.id===t.accreditation.id))})),e=>[e.accreditationCategory.name.toLowerCase(),oC(e.index),e.name.toLowerCase()])}function fA(e,t){return e.flatMap(e=>{const n=e.slots.map(e=>e.id),i=to(t)?e.slots.length:(0,lh.A)(n,t).length;return 0===i?[]:[{...e,numberOfSlots:i}]})}function xA(e,t){return e.flatMap(e=>e.slots.filter(e=>to(t)||t.includes(e.id)))}const _A=e=>{const{translate:t}=cl(),n=M.useRef(null),s=Gn(Wc);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{ref:n,css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsxs)(Ra,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(fc,{isSearchVisible:!0,isSelectAllVisible:!0,menuWidth:300,multiple:!0,triggerElem:(0,i.jsxs)(jl,{color:"white",leftIcon:"bars-filter",size:"sm",children:[t("accr_ditations_39450"),eo(e.selectedSlotsIds)&&` (${e.selectedSlotsIds.length})`]}),values:e.selectedSlotsIds,onChange:e.setSelectedSlotsIds,children:e.allAccreditations.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(t=>(0,i.jsx)("option",{value:t.id,children:wh(s,t,e.name,{accreditation:{includeNameAtEnd:!0}})},t.id))},e.id))})}),(0,i.jsx)(Ra,{css:{borderRight:"1px solid $gray200",height:"$cellHeightSm"},width:1,onClick:()=>{n.current?.requestFullscreen()}}),e.data.map(t=>e.renderLeftColumn(t))]}),(0,i.jsx)(Ra,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(Ra,{css:{borderBottom:"1px solid $gray200",height:"$cellHeightSm"},children:e.filteredAccreditations.map(t=>{const n=m(t.acronym)?t.acronym:t.name;return(0,i.jsxs)(Ra,{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)(br,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:n,width:1,children:n}),(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:t.accreditationCategory.name,width:1,children:t.accreditationCategory.name})]},t.id)})}),(0,i.jsx)(Ra,{css:{height:"$cellHeightSm"},children:e.slots.map(t=>{const n=t.date?.isValid?s.toLocaleString(t.date,Zs.DateOnly.Numeric):"-";return(0,i.jsxs)(Ra,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t.name||"-",width:1,children:t.name||"-"}),(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n,width:1,children:n})]},t.id)})}),e.data.map(t=>e.renderRow(t))]})})]}),(0,i.jsx)(zc,{children:(0,i.jsx)(Ec,{limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,setLimit:e.setLimit,setOffset:e.setOffset,showLimits:!0,totalCount:e.totalCount})})]})},IA=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[e.accreditationSlotId]:[]),[e.vr]),s=(0,M.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[]:[e.accreditationSlotId]),[e.vr]),o=(0,M.useMemo)(()=>(e.vr.matrixWishedSlots||[]).map(e=>e.id),[e.vr]);return(0,i.jsx)(Ra,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:e.slotsIds.map(r=>{const a=n.includes(r),l=s.includes(r),d=o.includes(r),c=e.isEditMode&&("assigned"===e.editMode&&(a||l)||"wished"===e.editMode&&d),u=e.isEditMode&&("assigned"===e.editMode&&!a&&!l||"wished"===e.editMode&&!d);return(0,i.jsxs)(Ra,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4",width:"$cellWidth","& > .h-accreditations-matrix-cell":{display:"flex"},"&:hover > .h-accreditations-matrix-cell":{display:"none"},"& > .h-accreditations-matrix-edit-cell":{display:"none"},"&:hover > .h-accreditations-matrix-edit-cell":{display:"flex"}},height:1,children:[c&&(0,i.jsx)(Ra,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$error200",bd:"error500 1",color:"$error700",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.deleteAccreditationSlot(e.vr.userInfo.id,r),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Ya,{icon:"trash-can"})}),u&&(0,i.jsx)(Ra,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary200",bd:"primary500 1",color:"$primary700",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationSlot(e.vr.userInfo.id,r),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Ya,{icon:"plus"})}),a||l?(0,i.jsx)(Ra,{align:"center",className:e.isEditMode?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Ya,{icon:n.includes(r)?"bolt-auto":"check"})}):d?(0,i.jsx)(Ra,{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)(br,{font:"gray800 textXs medium",children:t("souhait_e_52100")})}):null]},r)})})},vA=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>pA(e.allAccreditationsSlots),[e.allAccreditationsSlots]),s=(0,M.useMemo)(()=>fA(n,e.selectedSlotsIds),[n,e.selectedSlotsIds]),o=(0,M.useMemo)(()=>xA(s,e.selectedSlotsIds),[s,e.selectedSlotsIds]),r=(0,M.useMemo)(()=>o.map(e=>e.id),[o]),a=(0,M.useCallback)(e=>(0,i.jsx)(Ra,{css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(Ub,{size:32,userInfo:e.userInfo})},e.userInfo.id),[]),l=(0,M.useCallback)(t=>e.isRowLoading(t.id)?(0,i.jsx)(Mc,{css:{border:"none",borderTop:"1px solid $gray200",height:"$cellHeightSm"}},t.userInfo.id):(0,i.jsx)(IA,{addAccreditationSlot:e.addAccreditationSlot,deleteAccreditationSlot:e.deleteAccreditationSlot,editMode:e.editMode,isEditMode:e.isEditMode,reloadRow:e.reloadRow,slotsIds:r,vr:t},t.userInfo.id),[e.addAccreditationSlot,e.deleteAccreditationSlot,e.editMode,e.isEditMode,e.isRowLoading,e.reloadRow,r]);return(0,i.jsx)(Ra,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(_l,{}):to(e.members)||to(s)?(0,i.jsx)(Ra,{css:{background:"white",border:"1px solid $gray200"},height:400,children:to(e.members)?(0,i.jsx)(xk,{imageSrc:dd.Blanks.Member,title:t("aucun_membre_ne_07054")}):(0,i.jsx)(xk,{imageSrc:dd.Blanks.Accreditation,title:t("aucune_accr_dit_97505")})}):(0,i.jsx)(_A,{allAccreditations:n,cellWidth:120,data:e.members,filteredAccreditations:s,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:a,renderRow:l,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setSelectedSlotsIds:e.setSelectedSlotsIds,slots:o,totalCount:e.totalCount})})},bA=e=>{const{params:{eventId:t,delegationId:n}}=cl(),{data:s,idToLoading:o,isEditMode:r,isLoading:a,limit:l,numberOfPages:d,offset:c,reloadRow:u,setLimit:h,setOffset:m,totalCount:g}=tm(),{mutate:p}=sr(),{data:f,isLoading:x}=Yn("query DelegationMembersAccreditationsMatrix($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsSlots(onlyVisible: true) {\n accreditationSlot {\n ...AccreditationSlotMatrix\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:n},[Ms.AccreditationSlotMatrixFragment]),_=(0,M.useMemo)(()=>(f.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlot),[f]),I=(0,M.useCallback)(e=>o[e]??!1,[o]),v=(0,M.useCallback)((e,i)=>p({eventId:t,delegationId:n,massAccredit:{accreditationsSlotsIds:[i],selecteds:{ids:[e]},strategy:Qe.Add}}),[t,n,p]),b=(0,M.useCallback)((e,i)=>(console.log("delete accreditation slot",{eventId:t,delegationId:n,userInfoId:e,accreditationSlotId:i}),p({eventId:t,delegationId:n,massAccredit:{accreditationsSlotsIds:[i],selecteds:{ids:[e]},strategy:Qe.Delete}})),[t,n,p]);return(0,i.jsx)(vA,{addAccreditationSlot:v,allAccreditationsSlots:_,deleteAccreditationSlot:b,editMode:"wished",isEditMode:r,isLoading:a||x,isRowLoading:I,limit:l,members:s,numberOfPages:d,offset:c,reloadRow:u,selectedSlotsIds:e.selectedSlotsIds,setLimit:h,setOffset:m,setSelectedSlotsIds:e.setSelectedSlotsIds,totalCount:g})},jA=e=>{const{params:{organizationId:t,eventId:n,delegationId:s}}=cl(),o=Gn(Bh),r=Qn(),[a,l,d]=VC(t,"eventDelegationMembers.columns",e.columns),[c,u,h]=VC(t,"eventDelegationMembers.limit",kc),[m,g,p]=VC(t,"eventDelegationMembers.predicates",[]),[f,x,_]=VC(t,"eventDelegationMembers.rendering",Ph.List),[I,v,b]=VC(t,"eventDelegationMembers.selectedSlotsIds",[]),[j,C,y]=VC(t,"eventDelegationMembers.sort",null),{data:k,isLoading:A}=Yn("query EventDelegationMembersInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n\n customDocuments {\n ...CustomDocumentPopulation\n }\n\n delegation(id: $delegationId) {\n numberOfDelegationsAccreditationsSlots\n\n accreditationsSlots(onlyDefault: true, onlyHidden: true) {\n accreditationSlotId\n }\n\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n positionDisplay\n slotDisplay\n\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:n,delegationId:s,privacy:e.customFieldsPrivacy},[Ms.SegmentCustomFieldFragment,Ms.CustomDocumentPopulationFragment]);const w=d||h||p||_||b||y||A,S=(0,M.useMemo)(()=>e.customFieldsPrivacy===pe.All?k.organization?.customFields.nodes??[]:(0,Va.A)((k.event?.delegation.form.elements.map(e=>e.customField)||[]).concat(k.event?.delegation.columnsCustomFields||[])),[e.customFieldsPrivacy,k.organization,k.event]),E=UC(S),T=(0,M.useMemo)(()=>k.event?o.getDelegationMembersFilters(t,n,S,k.event,k.event.delegation.form,k.event.isWeezeventConnected):[],[n,S,k.event]),z=(0,M.useMemo)(()=>k.event?o.getDelegationMembersPossibleColumns(S,{isWeezeventConnected:k.event.isWeezeventConnected,positionDisplay:k.event.delegation.form.positionDisplay,slotDisplay:k.event.delegation.form.slotDisplay}):[],[S,k.event]),O=(0,M.useMemo)(()=>(k.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlotId),[k.event]),R=(0,M.useMemo)(()=>"function"==typeof e.showEditMode?e.showEditMode(f):e.showEditMode,[e.showEditMode,f]),$=(k.event?.delegation.numberOfDelegationsAccreditationsSlots??0)>0;return(0,M.useEffect)(()=>{r.setItem($l.DELEGATIONS_SPACE_TAB,"members")},[]),w?(0,i.jsx)(_l,{}):(0,i.jsx)(lm,{columns:e.canEditColumns?a:e.columns,columnsSearch:[],columnsToIncludes:Lh,eventId:n,filters:T,getMassActionId:e=>e.userInfo.id,limit:c,loadDataList:nr,loadDataListParams:{delegationId:s,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:er,loadRowParams:{delegationId:s,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:z,possibleRenderings:[Ph.List,Ph.AccreditationsMatrix],predicates:m,renderActions:(t,n,s)=>(0,i.jsx)(gA,{campaigns:e.campaigns,customFields:S,deleteFromEvent:e.deleteFromEvent,massActions:t,showAccreditationsEdit:e.showAccreditationsEdit,showAccreditationsValidate:e.showAccreditationsValidate,showDelete:e.canDeleteMembers,showWishedAccreditationsEdit:$,onMassEditSuccess:s}),rendering:f,setColumns:l,setLimit:u,setPredicates:g,setRendering:x,setSort:C,showEditColumns:f===Ph.List&&e.canEditColumns,showEditMode:R,showFilters:!0,showMassActions:e.canEditMembers,showRowDropdown:!0,showRowEdit:e.canEditMembers,showSearchColumns:!1,sort:j,children:f===Ph.AccreditationsMatrix?(0,i.jsx)(bA,{selectedSlotsIds:I,setSelectedSlotsIds:v}):(0,i.jsx)(bm,{getEditPath:e.getEditPath,renderCell:(o,r,a)=>(0,i.jsx)(Qy,{accreditationsPanelPath:as.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),availabilitiesPanelPath:as.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),canAccredit:e.canAccredit,canAssign:!1,canChangeDelegation:!1,canClickMemberName:e.canClickMemberName,column:o,customField:E.get(o.slug),eventId:n,positionsPanelPath:as.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),reloadRow:a,row:r}),renderRowDropdown:(t,n)=>(0,i.jsx)(Fk,{accreditationState:t.accreditationState,allowedCustomDocuments:e.customBadges,canAccredit:e.canAccredit,canDelete:e.canDeleteMembers&&t.canDelete,customDocuments:k.event?.customDocuments??[],deleteFromEvent:e.deleteFromEvent,member:t.userInfo,reload:n,showDeleteFromEvent:e.showDeleteFromEvent,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:t.id}),renderRowPanels:(o,r)=>(0,i.jsx)($k,{accreditationsPanelPath:as.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),availabilitiesPanelPath:as.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),canAccredit:e.canAccredit,canCheckIn:!1,canDeletePosition:()=>!1,canEditWishedAccreditations:!0,defaultHiddenAccreditationsSlotsIds:O,delegationId:s,eventId:n,organizationId:t,positionsPanelPath:as.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),reloadRow:r,returnPathFallback:as.DELEGATION_MEMBERS({organizationId:t,eventId:n,delegationId:s}),volunteerRegistration:o})})})};function CA(e){return{includeDelegations:e.includes("delegations")||e.includes("delegations_categories"),includeEvents:e.includes("events")||e.includes("number_of_events"),includeForms:e.includes("forms")||e.includes("forms_inserted_at"),includeTags:e.includes("tags"),includeRoles:e.includes("roles")}}let yA=class extends du{constructor(e,t,n){super(e,t,n)}getOrganizationUsersFilters(e,t,n){return[...this.getBaseFilters(n.customFields.nodes),...this.getEventsFilters(e),...this.getFormsFilters(e),...this.getPositionsFilters(),...this.getDelegationsFilters(e),...this.getEmailsFilters(e),...this.getCommentsFilters(),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:Ve.Select,needLoading:!0,organizationId:e,tagContext:Ct.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:Ve.Number,hideEmpty:!0},{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("autres_99130"),fieldType:Ve.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:Ve.Checkbox},{slug:"isLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:Ve.Checkbox}]}getDelegationMembersFilters(e){return this.getBaseFilters(e)}getOrganizationUsersPossibleColumns(e){return[...this.getBaseColumns(),{slug:"events",name:this.t("_v_nements_53672"),minWidth:320},{slug:"number_of_events",name:this.t("nombre_d_v_nem_14214"),width:230},{slug:"forms",name:this.t("formulaires_rem_62495"),minWidth:320},{slug:"forms_inserted_at",name:this.t("dates_de_rempli_65075"),minWidth:320},{slug:"delegations",name:this.t("d_l_gations_78318"),isSearchable:!0,minWidth:320},{slug:"delegations_categories",name:this.t("cat_gories_de_d_45259"),minWidth:320},{slug:"inserted_at",name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:zt.InsertedAt,width:230},{slug:"tags",name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:"roles",name:this.t("r_les_61679"),minWidth:320},...this.customFieldsToPossibleColumns(e)]}getDelegationMembersPossibleColumns(e){return[...this.getBaseColumns(),...this.customFieldsToPossibleColumns(e)]}getBaseColumns(){return[{slug:"name",name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:zt.Name,minWidth:240},{slug:"email",name:this.t("e_mail_du_membr_69509"),isSearchable:!0,minWidth:180},{slug:"id",name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:zt.Id,width:100}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Text},{slug:"registrationDate",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Date,hideEmpty:!0},...this.customFieldsToFilters(e)]}getEventsFilters(e){return[{slug:"event",name:this.t("_v_nement_22345"),category:this.t("Event"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"numberOfEvents",name:this.t("nombre_d_v_nem_14214"),category:this.t("Event"),fieldType:Ve.Number,hideEmpty:!0}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:Ve.Select,needLoading:!0,organizationId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:Ve.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:Ve.Text,hideEmpty:!0},{slug:"positionCategoryName",name:this.t("nom_de_la_cat_g_57279"),category:this.t("missions_63972"),fieldType:Ve.Text,hideEmpty:!0},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0}]}getDelegationsFilters(e){return[{slug:"delegation",name:this.t("fait_partie_de_32196"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,needLoading:!0,organizationId:e},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,needLoading:!0,organizationId:e},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox}]}getEmailsFilters(e){return[{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:Ve.Campaign,needLoading:!0,organizationId:e},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:Ve.Checkbox,hideEmpty:!0}]}getCommentsFilters(){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:Ve.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:Ve.Date,hideEmpty:!0}]}};yA=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],yA);const kA=e=>{const t=(0,M.useMemo)(()=>(e.user.events||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.user]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},AA=e=>{const{params:{organizationId:t}}=cl(),n=Gn(Wc),{mutate:s}=function(e={}){return Kn("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)}(),o=(0,M.useCallback)((n,i)=>s({organizationId:t,userInfoId:e.row.id,slug:i,value:n}),[e.row,s]),r=(0,M.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.row.formsUsersInfos]),a=(0,M.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[`${e.form.name} : ${n.toLocaleString(e.insertedAt.toLocal(),Zs.DateTime)}`]:[]).join(", "),[e.row.formsUsersInfos]),l=(0,M.useMemo)(()=>(e.row.delegations||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.delegations]),d=(0,M.useMemo)(()=>(0,ch.A)(e.row.delegations||[],e=>e.delegationCategory.id).map(e=>({id:e.delegationCategory.id,color:"gray",icon:null,text:e.delegationCategory.name})),[e.row.delegations]),c=(0,M.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)(gy,{canClickMemberName:e.canClickMemberName,column:e.column,mutate:o,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"id"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"picture"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qg,{email:e.row.email,image:e.row.picture?.url,name:e.row.name,size:32})}):"email"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.email}):"events"===e.column.slug?(0,i.jsx)(kA,{column:e.column,user:e.row}):"number_of_events"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.events?.length??0}):"forms"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:r})}):"forms_inserted_at"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:a,children:a})}):"delegations"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:l})}):"delegations_categories"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:d})}):"inserted_at"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.row.insertedAt.toLocal(),Zs.DateTime)}):"tags"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:c})}):"roles"===e.column.slug?(0,i.jsx)(fy,{minWidth:e.column.minWidth,userPermissions:e.row,width:e.column.width}):(0,i.jsx)(my,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:e.updatable})},wA=e=>{const{params:{organizationId:t,delegationId:n}}=cl(),s=Gn(yA),o=Qn(),[r,a,l]=VC(t,"organizationDelegationMembers.columns",e.columns),[d,c,u]=VC(t,"organizationDelegationMembers.limit",kc),[h,m,g]=VC(t,"organizationDelegationMembers.predicates",[]),[p,f,x]=VC(t,"organizationDelegationMembers.sort",null),{data:_,isLoading:I}=Yn("query OrganizationDelegationMembersInfos(\n $organizationId: OrganizationId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegation(id: $delegationId) {\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,privacy:e.isOrganizationAdmin?pe.All:pe.Public,delegationId:n},[Ms.SegmentCustomFieldFragment]);const v=l||u||g||x||I,b=(0,M.useMemo)(()=>e.isOrganizationAdmin?_.organization?.customFields.nodes??[]:(0,Va.A)((_.organization?.delegation.form.elements.map(e=>e.customField)||[]).concat(_.organization?.delegation.columnsCustomFields??[])),[_.organization]),j=UC(b),C=(0,M.useMemo)(()=>s.getDelegationMembersFilters(b),[b]),y=(0,M.useMemo)(()=>s.getDelegationMembersPossibleColumns(b),[b]);return(0,M.useEffect)(()=>{o.setItem($l.DELEGATIONS_SPACE_TAB,"members")},[]),v?(0,i.jsx)(_l,{}):(0,i.jsx)(lm,{columns:e.canEditColumns?r:e.columns,columnsSearch:[],columnsToIncludes:CA,eventId:null,filters:C,limit:d,loadDataList:Bo,loadDataListParams:{delegationId:n},loadRow:Lo,organizationId:t,possibleColumns:y,predicates:h,renderActions:(t,n,s)=>(0,i.jsx)(gA,{campaigns:e.campaigns,customFields:b,deleteFromEvent:!1,massActions:t,showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:e.canDeleteMembers,showWishedAccreditationsEdit:!1,onMassEditSuccess:s}),rendering:Ph.List,setColumns:a,setLimit:c,setPredicates:m,setSort:f,showEditColumns:e.canEditColumns,showEditMode:e.isOrganizationAdmin,showFilters:!0,showMassActions:!0,showRowDropdown:!0,showRowEdit:e.canEditMembers,showSearchColumns:!1,sort:p,children:(0,i.jsx)(bm,{getEditPath:e.getEditPath,renderCell:(t,n,s)=>(0,i.jsx)(AA,{canClickMemberName:e.canClickMemberName,column:t,customField:j.get(t.slug),reloadRow:s,row:n,updatable:e.canEditMembers}),renderRowDropdown:(t,n)=>(0,i.jsx)(Fk,{accreditationState:null,allowedCustomDocuments:e.customBadges,canAccredit:!1,canDelete:e.canDeleteMembers,customDocuments:[],deleteFromEvent:!1,member:t,reload:n,showDeleteFromEvent:!1,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:null})})})};function SA(){return bc(cr.desktop)}const EA=e=>{const t=SA(),n=(0,M.useMemo)(()=>e.min.startOf("week").equals(e.value.startOf("week")),[e.min,e.value]),s=(0,M.useMemo)(()=>e.max.endOf("week").equals(e.value.endOf("week")),[e.max,e.value]);return(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsx)(jl,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.value.minus(t?{week:1}:{day:1}))}}),(0,i.jsx)(br,{width:160,children:(0,i.jsx)(Tu,{...e})}),(0,i.jsx)(jl,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.value.plus(t?{week:1}:{day:1}))}})]})},TA=M.createContext({}),zA=e=>{const{days:t,interval:n}=M.useContext(TA),s=t[0],o=t[6]??t[0],r=M.useMemo(()=>(e.startAt??Bs.c9.max(s,n.start)).startOf("day"),[e.startAt,s,n]),a=M.useMemo(()=>(e.endAt??Bs.c9.min(o,n.end)).endOf("day"),[e.endAt,o,n]),l=M.useMemo(()=>"number"==typeof e.startHour&&e.startHour>0&&e.startAt?.isValid&&e.startAt.hour{const e=Math.max(r.diff(s,"days").days+1,1);return l?e-1:e},[l,r,s]),c=M.useMemo(()=>{const e=Math.min(Math.ceil(a.diff(s,"days").days)+1,8);return l?e-1:e},[l,a,s]);return r>o||a{const t=M.useMemo(()=>{if("week"===e.display){const t=e.date.startOf("week");return(0,wc.A)(0,7).map(e=>t.plus({day:e}))}return[e.date]},[e.date]),n=M.useMemo(()=>Bs.IX.fromDateTimes(e.minDate.startOf("day"),e.maxDate.endOf("day")),[e.minDate,e.maxDate]),[s,o]=M.useState(300),r=M.useCallback(e=>{if(e){const t=Math.max(Math.ceil(e.getBoundingClientRect().height),300);o(t)}},[e.date,o]),a=e.showBorder?{bd:!0,overflow:"hidden"}:{};return(0,i.jsx)(TA.Provider,{value:{days:t,interval:n},children:(0,i.jsxs)(Ra,{css:{...a,...e.css},direction:"column",children:[(0,i.jsx)(Ra,{css:{borderBottom:"1px solid $gray200"},height:60,width:1,children:t.map(e=>(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray50"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(br,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",children:e.toLocaleString({weekday:"long"})}),(0,i.jsx)(br,{font:"gray800 textXl semiBold",children:e.day})]},e.toISO()))}),(0,i.jsxs)(Ra,{className:"h-calendar-events-container",css:{position:"relative"},direction:"column",height:s,width:1,children:[(0,i.jsx)(id,{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)(Ra,{css:{background:n.contains(e)?"white":"$primary50",borderRight:"1px solid $gray200",gridColumn:`${t+1} / ${t+2}`,gridRow:"1 / 2"}},e.toISO()))}),(0,i.jsx)(id,{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})]})]})})},RA=e=>{const{translate:t}=cl(),n=e.member.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId);return(0,i.jsx)(Tc,{children:(0,i.jsxs)(yc,{children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Ub,{userInfo:e.member.userInfo})}),(0,i.jsx)(Ra,{align:"center",gap:"3",children:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"1",children:[(0,i.jsx)(br,{color:"success500",children:(0,i.jsx)(Ya,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(br,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsx)(Vd,{placement:"bottom-end",children:(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>e.deleteAccreditationSlot(e.member.userInfo.id,e.accreditationSlotId),children:t("retirer_l_accr_62187")})})]})]}):(0,i.jsx)(jl,{size:"sm",onClick:()=>e.addAccreditationSlot(e.member.userInfo.id,e.accreditationSlotId),children:t("ajouter_97327")})})]})})},$A=e=>{const t=Hn();return(0,i.jsx)(Ra,{css:{background:"white",bd:!0,padding:"$4 $6"},direction:"column",gap:"2",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),e.isWeezeventConnected&&(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"badge-check"})}),(0,i.jsx)(br,{css:{flex:"1"},children:t("attribu_es_48167")}),(0,i.jsx)(br,{children:e.stats.assignedResources})]}),(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"hand-holding-heart"})}),(0,i.jsx)(br,{css:{flex:"1"},children:t("souhait_es_78101")}),(0,i.jsx)(br,{children:e.stats.wishedResources})]}),e.isWeezeventConnected&&(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"scanner-gun"})}),(0,i.jsx)(br,{css:{flex:"1"},children:t("scann_es_13169")}),(0,i.jsx)(br,{children:e.stats.scannedResources})]})]})})},DA=e=>{const{params:{eventId:t,delegationId:n},translate:s}=cl(),{mutate:o}=vo(),r=(0,M.useMemo)(()=>`${e.das.accreditation.name}${m(e.das.accreditationSlot.name)?` - ${e.das.accreditationSlot.name}`:""}`,[e.das]),[a,l]=(0,M.useState)(!1),[d,c]=(0,M.useState)(e.das),[u,h]=(0,M.useState)((0,ic.A)(e.das.volunteersRegistrations,e=>e.userInfo.name)),[g,p]=(0,M.useState)({}),f=(0,M.useCallback)(async i=>{l(!0),p(e=>({...e,[i]:!0}));const{event:s}=await(o={eventId:t,delegationId:n,accreditationSlotId:e.accreditationSlotId,userInfoId:i},r=await q(),co("query DelegationAccreditationSlotMember(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n }\n }\n\n member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n}\n",{variables:o,token:r||void 0,fragments:[Ms.DelegationAccreditationSlotStatsFragment,Ms.VolunteerRegistrationDelegationAccreditationSlotFragment]}));var o,r;h(t=>t.flatMap(t=>{if(t.userInfo.id===i){const t=s.member.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId),n=s.member.accreditationsSlots.some(t=>t.id===e.accreditationSlotId);return t||n?[s.member]:[]}return[t]})),c(s.delegation.accreditationSlot),p(e=>({...e,[i]:!1})),l(!1)},[e.accreditationSlotId,n,t,l,c,p,h]),x=(0,M.useCallback)(async(e,n)=>{p(t=>({...t,[e]:!0})),await o({eventId:t,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e]},strategy:Qe.Add}}),await f(e)},[t,f,p]),_=(0,M.useCallback)(async(e,n)=>{p(t=>({...t,[e]:!0})),await o({eventId:t,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e]},strategy:Qe.Delete}}),await f(e)},[t,f,p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nj,{children:r}),(0,i.jsxs)(mu,{css:{background:"$gray50",gap:"$6",padding:"$6"},children:[(0,i.jsx)($A,{isLoading:a,isWeezeventConnected:e.isWeezeventConnected,stats:d}),(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Fc,{children:s("nom_du_membre_69353")})}),u.map(t=>g[t.userInfo.id]?(0,i.jsx)(Mc,{bx:!0},t.id):(0,i.jsx)(RA,{accreditationSlotId:e.accreditationSlotId,addAccreditationSlot:x,deleteAccreditationSlot:_,member:t},t.id))]})]})]})},PA=e=>{const{data:t,loader:n,isLoading:s}=Yn("query DelegationAccreditationSlotMembers(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n event(id: $eventId) {\n isWeezeventConnected\n\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n\n accreditationSlot {\n date\n name\n }\n\n accreditation {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlotId},[Ms.DelegationAccreditationSlotStatsFragment,Ms.VolunteerRegistrationDelegationAccreditationSlotFragment]);return(0,i.jsx)(hu,{size:"md",onClose:e.onClose,children:s?n:(0,i.jsx)(DA,{accreditationSlotId:e.accreditationSlotId,das:t.event.delegation.accreditationSlot,isWeezeventConnected:t.event.isWeezeventConnected})})},FA=e=>{const t="horizontal"===e.display?{}:{flex:"1"};return(0,i.jsxs)(Ra,{align:"center",gap:"2",width:"horizontal"===e.display?void 0:1,children:[(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:e.icon})}),(0,i.jsx)(br,{css:t,fontSize:"textXs",children:e.text}),(0,i.jsx)(Ra,{align:"center",css:{background:e.background,borderRadius:"$1",fontSize:"$textXs",fontWeight:"$medium",padding:"2px 8px",minWidth:"30px"},justify:"center",children:e.count})]})},MA=e=>{const{translate:t,params:{eventId:n,delegationId:s}}=cl(),[o,r]=(0,M.useState)(e.das),a=(0,M.useMemo)(()=>Kd(e.das.accreditation.color),[e.das]),l=(0,M.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,M.useMemo)(()=>`${e.das.accreditation.name}${m(e.das.accreditationSlot.name)?` - ${e.das.accreditationSlot.name}`:""}`,[e.das]),c=(0,M.useCallback)(async()=>{const{event:{delegation:t}}=await Oo({eventId:n,delegationId:s,accreditationSlotId:e.das.accreditationSlot.id},await q());r(t.accreditationSlot)},[e.das,r]),[u,h]=(0,M.useState)(!1),g=o.maxResources?`/${o.maxResources}`:"",p=`${o.assignedResources}${g}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"horizontal"===e.display?"center":"start",css:{...l,borderRadius:"$1",cursor:e.isEventAdmin?"pointer":"default",minHeight:"32px",px:"$2",py:"horizontal"===e.display?"0":"$2"},direction:"horizontal"===e.display?"row":"column",gap:"horizontal"===e.display?"6":"2",width:1,onClick:()=>{e.isEventAdmin&&h(!0)},children:[(0,i.jsx)(br,{css:{flex:"1"},fontSize:"textXs",fontWeight:"medium",children:d}),(0,i.jsx)(FA,{background:a[100],count:p,display:e.display,icon:"badge-check",text:t("attribu_es_48167")}),e.showWished&&(0,i.jsx)(FA,{background:a[100],count:o.wishedResources,display:e.display,icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(FA,{background:a[100],count:o.scannedResources,display:e.display,icon:"scanner-gun",text:t("scann_es_13169")})]}),e.isEventAdmin&&u&&(0,i.jsx)(PA,{accreditationSlotId:e.das.accreditationSlot.id,delegationId:s,eventId:n,onClose:()=>(h(!1),c())})]})},NA=e=>{const t=SA(),n=(0,M.useMemo)(()=>e.event.startAt.startOf("day").equals(e.event.endAt.startOf("day")),[e.event]),s=(0,M.useMemo)(()=>(0,ic.A)(e.accreditationsSlots.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,oC(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),o=(0,M.useMemo)(()=>(0,ic.A)(e.accreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,oC(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),r=(0,M.useMemo)(()=>Object.fromEntries(e.accreditations.map(e=>[e.accreditationId,e.willAutoAccredit||e.accreditation.willAutoAccredit])),[e.accreditations]);return(0,i.jsxs)(OA,{css:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[s.map(t=>(0,i.jsx)(zA,{children:(0,i.jsx)(MA,{das:t,display:n?"vertical":"horizontal",isEventAdmin:e.isEventAdmin,showWished:!r[t.accreditationId]})},t.accreditationSlot.id)),o.map(t=>(0,i.jsx)(zA,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(MA,{das:t,display:"vertical",isEventAdmin:e.isEventAdmin,showWished:!r[t.accreditationId]})},t.accreditationSlot.id))]})},LA=e=>{const t=Gn(iA),{delegationAccreditationsSlots:n,showWished:s}=GA(),o=n.find(t=>t.accreditationSlot.id===e.slot.id);return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{css:{paddingLeft:"76px",textTransform:"capitalize"},children:e.slot.name}),s&&(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(o?.wishedResources??0)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(o?.assignedResources??0)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(o?.maxResources)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(o?.scannedResources??0)})]})},BA=e=>{const t=Gn(iA),{delegationAccreditations:n,delegationAccreditationsSlots:s,accreditationIdToSlots:o,accreditationIdToOpen:r,setAccreditationIdToOpen:a,showWished:l}=GA(),d=r[e.accreditation.id]??!0,c=o[e.accreditation.id],u=(0,M.useMemo)(()=>{const t=n.find(t=>t.accreditationId===e.accreditation.id);if("number"==typeof t?.maxResources)return t.maxResources;{const t=s.filter(t=>t.accreditationId===e.accreditation.id&&"number"==typeof t.maxResources);return eo(t)?(0,Vv.A)(t,e=>e.maxResources):null}},[e.accreditation,n,s]),h=(0,M.useMemo)(()=>(0,Vv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.wishedResources),[e.accreditation,s]),m=(0,M.useMemo)(()=>(0,Vv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.assignedResources),[e.accreditation,s]),g=(0,M.useMemo)(()=>(0,Vv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.scannedResources),[e.accreditation,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{children:[(0,i.jsxs)(yc,{align:"center",css:{cursor:"pointer",paddingLeft:"44px",userSelect:"none"},gap:"2",onClick:()=>a({...r,[e.accreditation.id]:!d}),children:[e.accreditation.hasSlots&&(0,i.jsx)(Ra,{align:"center",css:{color:"$gray800"},height:32,justify:"center",width:32,children:(0,i.jsx)(Ya,{icon:d?"chevron-up":"chevron-right"})}),(0,i.jsx)(pC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(br,{children:e.accreditation.name})]}),l&&(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(h)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(m)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(u)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(g)})]}),e.accreditation.hasSlots&&d&&c.map(e=>(0,i.jsx)(LA,{slot:e},`s-${e.id}`))]})},VA=e=>{const t=Gn(iA),{delegationAccreditations:n,delegationAccreditationsSlots:s,categoryIdToOpen:o,categoryIdToAccreditations:r,setCategoryIdToOpen:a,showWished:l}=GA(),d=o[e.category.id]??!0,c=(0,M.useMemo)(()=>rC(r[e.category.id]),[r,e.category.id]),u=(0,M.useMemo)(()=>{const t=(0,Va.A)(n.filter(t=>t.accreditationCategoryId===e.category.id).map(e=>{if("number"==typeof e.maxResources)return e.maxResources;{const t=s.filter(t=>t.accreditationId===e.accreditationId&&"number"==typeof t.maxResources);return eo(t)?(0,Vv.A)(t,e=>e.maxResources):null}}));return eo(t)?(0,Gg.A)(t):null},[e.category,n,s]),h=(0,M.useMemo)(()=>(0,Vv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.wishedResources),[e.category,s]),m=(0,M.useMemo)(()=>(0,Vv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.assignedResources),[e.category,s]),g=(0,M.useMemo)(()=>(0,Vv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.scannedResources),[e.category,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{background:"$gray100"},children:[(0,i.jsxs)(yc,{align:"center",css:{cursor:"pointer",userSelect:"none"},gap:"2",onClick:()=>a({...o,[e.category.id]:!d}),children:[(0,i.jsx)(Ra,{align:"center",css:{color:"$gray800"},height:32,justify:"center",width:32,children:(0,i.jsx)(Ya,{icon:d?"chevron-up":"chevron-right"})}),(0,i.jsx)(br,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"medium",children:e.category.name})]}),l&&(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(h)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(m)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(u)}),(0,i.jsx)(yc,{width:150,children:t.toNumberOrInfinity(g)})]}),d&&c.map(e=>(0,i.jsx)(BA,{accreditation:e},`a-${e.id}`))]})},UA=(0,M.createContext)({}),WA=e=>{const{translate:t,params:{organizationId:n}}=cl(),s=Gn(Wc),o=(0,M.useMemo)(()=>(0,ic.A)((0,ch.A)(e.accreditationsSlots.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[e.accreditationsSlots]),r=(0,M.useMemo)(()=>(0,tc.A)((0,nc.A)((0,ch.A)(e.accreditations.map(e=>e.accreditation),e=>e.id),e=>e.accreditationCategoryId),e=>(0,ic.A)(e,e=>e.name.toLowerCase())),[e.accreditations]),a=(0,M.useMemo)(()=>(0,tc.A)((0,nc.A)(e.accreditationsSlots.map(e=>({...e.accreditationSlot,name:wh(s,e.accreditationSlot,"",{date:{localeFormat:Zs.DateOnly.WeekdayLongMonthLong}})})),e=>e.accreditationId),e=>zh(e)),[e.accreditationsSlots]),l=(0,M.useMemo)(()=>e.accreditations.some(e=>!e.willAutoAccredit&&!e.accreditation.willAutoAccredit),[e.accreditations]),[d,c]=VC(n,"eventDelegationAccreditations.categoryIdToOpen",{}),[u,h]=VC(n,"eventDelegationAccreditations.accreditationIdToOpen",{});return(0,i.jsx)(UA.Provider,{value:{accreditationIdToOpen:u,accreditationIdToSlots:a,categories:o,categoryIdToAccreditations:r,categoryIdToOpen:d,delegationAccreditations:e.accreditations,delegationAccreditationsSlots:e.accreditationsSlots,setAccreditationIdToOpen:h,setCategoryIdToOpen:c,showWished:l},children:(0,i.jsxs)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:t("cat_gorie_accr_40335")}),l&&(0,i.jsx)(Fc,{width:150,children:t("souhait_es_78101")}),(0,i.jsx)(Fc,{width:150,children:t("affect_es_00048")}),(0,i.jsx)(Fc,{width:150,children:t("quota_00069")}),(0,i.jsx)(Fc,{width:150,children:t("scann_es_13169")})]}),o.map(e=>(0,i.jsx)(VA,{category:e},`c-${e.id}`))]})})};function GA(){return(0,M.useContext)(UA)}const HA=e=>{const{translate:t,params:{organizationId:n}}=cl(),[s,o]=(0,M.useState)(""),[r,a]=VC(n,"eventDelegationAccreditations.rendering","calendar"),[l,d]=(0,M.useState)(e.event.delegation.minAccreditationSlotDate),c=(0,M.useMemo)(()=>l?.isValid?l:e.event.startAt,[e.event,l]),[u,h]=(0,M.useState)(null),g=(0,M.useMemo)(()=>e.event.delegation.accreditationsSlots.filter(e=>{const t=!m(s)||e.accreditation.name.toLowerCase().includes(s.toLowerCase())||e.accreditationSlot.name.toLowerCase().includes(s.toLowerCase())||"table"!==r||e.accreditationCategory.name.toLowerCase().includes(s.toLowerCase()),n=!u?.isValid||!!e.accreditationSlot.date?.isValid&&u.toSQLDate()===e.accreditationSlot.date.toSQLDate();return t&&n}),[e.event,s,r,u]);return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ra,{css:{background:"white",padding:"$5 $5"},gap:"3",children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:s,onChange:o})}),(0,i.jsx)(br,{css:{flex:"1"}}),"calendar"===r&&(0,i.jsx)(EA,{max:e.event.endAt,min:e.event.startAt,value:c,onChange:d}),"table"===r&&(0,i.jsx)(br,{width:160,children:(0,i.jsx)(Tu,{max:e.event.endAt,min:e.event.startAt,value:u,onChange:h})}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"table"===r?"table":"calendar",children:t("table"===r?"vue_tableau_18026":"vue_calendrier_58086")})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"calendar",onClick:()=>a("calendar"),children:t("vue_calendrier_58086")}),(0,i.jsx)(Ld,{icon:"table",onClick:()=>a("table"),children:t("vue_tableau_18026")})]})]})]}),"table"===r?(0,i.jsx)(WA,{accreditations:e.event.delegation.accreditations,accreditationsSlots:g}):(0,i.jsx)(NA,{accreditations:e.event.delegation.accreditations,accreditationsSlots:g,event:e.event,isEventAdmin:e.isEventAdmin,selectedDay:c})]})},qA=()=>{const e=Hn();return(0,i.jsx)(Ra,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},height:1,justify:"center",width:1,children:(0,i.jsx)(br,{height:250,width:1,children:(0,i.jsx)(xk,{title:e("aucune_accr_dit_27643")})})})},YA=e=>{const{params:{eventId:t,delegationId:n}}=cl(),{data:s,loader:o}=Yn("query DelegationAccreditations(\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n delegation(id: $delegationId) {\n minAccreditationSlotDate\n\n accreditations {\n accreditationId\n accreditationCategoryId\n willAutoAccredit\n maxResources\n\n accreditation {\n id\n accreditationCategoryId\n name\n color\n icon\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n accreditationsSlots(onlyVisible: $onlyVisible) {\n ...DelegationAccreditationSlotStats\n\n accreditationSlot {\n id\n accreditationId\n date\n name\n }\n\n accreditation {\n name\n color\n index\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:n,onlyVisible:e.onlyVisible},[Ms.DelegationAccreditationSlotStatsFragment]);return o||(eo(s.event?.delegation.accreditationsSlots)?(0,i.jsx)(HA,{event:s.event,isEventAdmin:e.isEventAdmin}):(0,i.jsx)(qA,{}))},KA=e=>{const{translate:t,params:{eventId:n,delegationId:s}}=cl(),{mutate:o,isLoading:r}=Ro(),a=(0,M.useMemo)(()=>e.customDocuments.filter(t=>t.slug===e.slug),[e.customDocuments,e.slug]),l=(0,M.useMemo)(()=>eo(a)?a.map(e=>e.name).join(", "):Jt.includes(e.slug)?z_(e.slug):null,[a,e.slug]),d=eo(a);return l?(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Ra,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(Ya,{icon:"file-lines"})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 textSm medium",children:l}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",isLoading:r,leftIcon:"download",onClick:()=>o({eventId:n,delegationId:s,documentsExport:{badgeType:d?null:e.slug,customDocumentSlug:d?e.slug:null,documentType:d?we.UserCustomDocument:we.CustomBadge,language:jt.Fr,oneFile:!1,segmentsIds:[],strategy:ke.OnePerPage}})})})}),(0,i.jsx)(_m,{placement:"top",children:t("recevoir_les_do_31669")})]})]}):null},ZA=e=>{const{translate:t}=cl();return(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("documents_dispo_46996")}),(0,i.jsx)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:e.delegationsSpaceCustomBadges.map(t=>(0,i.jsx)(KA,{customDocuments:e.customDocuments,slug:t},t))})]})},XA=hr(br,{overflow:"hidden",textOverflow:"ellipsis"}),JA=e=>{const t=Gn(Mj);switch(e.field.fieldType){case Le.File:{const n=t.getValue(e.field,e.fields);return n?(0,i.jsx)(rv,{acl:"public-read",document:n}):(0,i.jsx)(XA,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:"-"})}case Le.Phone:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(XA,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:m(n)?(0,i.jsx)(Vc,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:`tel:${n}`,children:n}):"-"})}default:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(XA,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:m(n)?URL.canParse(n)?(0,i.jsx)(Vc,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:n,children:n}):n:"-"})}}},QA=e=>(0,i.jsx)(Ra,{css:{background:"white",bd:!0,...e.css},direction:"column",width:1,children:(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsxs)(Ra,{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)(br,{color:"gray900",css:{flex:"1",alignContent:"center"},fontSize:"textMd",fontWeight:"semiBold",children:e.title}),e.rightIcon&&(0,i.jsx)(br,{color:"gray900",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"semiBold",textAlign:"center",width:20,onClick:t=>{e.rightIconClick?.(t)},children:(0,i.jsx)(Ya,{icon:e.rightIcon})}),e.select]}),(0,i.jsx)(br,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e.children})]})}),ew=({css:e,title:t,children:n})=>(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:t}),(0,i.jsx)(Ra,{css:{bd:!0,padding:"$4",...e},direction:"column",children:n})]}),tw=({children:e,...t})=>jc()?(0,i.jsx)(ew,{...t,children:e}):(0,i.jsx)(QA,{...t,children:e});var nw=n(6502),iw=n(2716);function sw(e){return e<=.2?mr.colors.error500.value:e<.7?mr.colors.warning500.value:e<=1?mr.colors.success500.value:mr.colors.blueGray500.value}const ow=({percent:e,prospectivePercent:t})=>(0,i.jsxs)(br,{css:{background:"$gray100",borderRadius:"$1",position:"relative"},height:8,width:1,children:[(0,i.jsx)(br,{css:{background:sw(e),borderRadius:"$1",left:0,maxWidth:"100%",position:"absolute",top:0,width:100*e+"%"},height:1}),void 0!==t&&(0,i.jsx)(br,{css:{background:sw(t),borderRadius:"$1",left:0,opacity:.4,maxWidth:"100%",position:"absolute",top:0,width:100*t+"%"},height:1})]}),rw=e=>{const t=(0,M.useMemo)(()=>(0,iw.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(Math.PI/2),[]),n=(0,M.useMemo)(()=>e.total===1/0?1:0===e.total?1/0:e.count/e.total,[e.count,e.total]),s=(0,M.useMemo)(()=>{const e=(0,nw.A)().domain([0,1]).range([-Math.PI/2,Math.PI/2]);return(0,iw.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(e(n<=1?n:1))},[n]);return(0,i.jsxs)(br,{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:mr.colors.gray100.value}),(0,i.jsx)("path",{d:s(void 0),fill:sw(n)})]})}),(0,i.jsxs)(Ra,{align:"baseline",css:{bottom:"0",left:"0",position:"absolute"},gap:"2",justify:"center",width:1,children:[(0,i.jsx)(br,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:e.count}),(0,i.jsxs)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:["/",e.total===1/0?"∞":e.total]})]})]})},aw=(e,t=null,n={})=>(Object.entries(e).forEach(([e,i])=>{const s=t?`${t}.${e}`:e;"object"!=typeof i||null===i||Array.isArray(i)?n[s]=i:aw(i,s,n)}),n);const lw=/(\{([\w\.]+)\})/g;let dw=class{fieldService;constructor(e){this.fieldService=e}renderText(e,t={}){const n={organization:t.organization||void 0,event:t.event||void 0,delegation:t.delegation||void 0,invitedBy:t?.invitedBy?this.getUser(t.invitedBy,t):void 0,recipient:t?.recipient?this.getUser(t.recipient,t):void 0,user:t.userInfo?this.getUser(t.userInfo,t):void 0,...t.extraInfos},i=aw(n);return Object.entries(i).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,n),e).replace(lw,(e,n,i)=>{const[s,o,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")?rg(e.userPlanningDaysLink,"pdf",l):i.includes("planningList")?rg(e.userPlanningListLink,"pdf",l):i.includes("planning")?rg(e.userPlanningLink,"pdf",l):i.includes("assignments")?rg(e.userAssignmentsLink,"pdf",l):i.includes("paris20kmassignment")&&e?.userCustomBadgeLinks[ge.Paris20kmassignment]?rg(e.userCustomBadgeLinks[ge.Paris20kmassignment],"pdf",l):""}return""})}getUser(e,t){const n=t.customFields||[],i=this.getFields(e,n),s=this.getLanguage(e),o=s?{lang:s.toString()}:{},r=e.links?rg(e.links.userAssignmentsLink,"pdf",o):"",a=e.links?rg(e.links.userPlanningLink,"pdf",o):"",l=e.links?rg(e.links.userPlanningListLink,"pdf",o):"",d=e.links?rg(e.links.userPlanningDaysLink,"pdf",o):"",c=e.links?{assignments:r,badge:rg(e.links.userBadgeLink,"pdf",o),certificate:rg(e.links.userCertificateLink,"pdf",o),planning:a,planningList:l,planningDays:d,...Object.fromEntries(Object.entries(e.links.userCustomBadgeLinks).map(([e,t])=>[e.toLowerCase(),rg(t,"pdf",o)])),...Object.fromEntries(Object.entries(e.links.userCustomDocumentLinks).map(([e,t])=>[e,rg(t,"pdf",o)]))}:{},u=t.volunteerRegistration?.ticketId??"",h=(e.fields.isExpanded?e.fields?.firstName?.value:e.fields.firstName)||"",m=(e.fields.isExpanded?e.fields?.lastName?.value:e.fields.lastName)||"",g=`
\n \n
`;return{id:e.id,localId:t.volunteerRegistration?.localId||"",email:e.email,...i,firstName:h,lastName:m,ticketId:u,qrcode:g,memberCode:t.volunteerRegistration?.weezevent?.memberCode||"",name:bg({firstName:h,lastName:m}),registrationDate:e.registrationDate?.toFormat(t.organization?.datetimeFormat??"yyyy-MM-dd HH:mm")??"",assignmentSheet:t.event?r:"",documents:c,delegation:{name:t.volunteerRegistration?.delegation?.name??"",leader:{firstName:t.volunteerRegistration?.delegation?.leaders?.[0]?.firstName??"",lastName:t.volunteerRegistration?.delegation?.leaders?.[0]?.lastName??"",phone:t.volunteerRegistration?.delegation?.leaders?.[0]?.phone?.internationalFormat??""}},weezevent:{barcode:u,qrcode:g,identificationNumber:""}}}getFields(e,t){return e.fields.isExpanded?Object.fromEntries(Object.entries(e.fields).map(([e,{value:t}])=>[e,eo(t)?t.join(", "):m(t)?t:""])):Object.fromEntries(t.map(t=>[t.slug,this.fieldService.getValueString(t,e.fields)]))}getLanguage(e){return e.fields.isExpanded?e.fields?.language?.rawValue:e.fields?.language}};dw=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mj])],dw);const cw=({description:e})=>{const t=Hn();return(0,i.jsx)(tw,{title:t("description_58935"),children:m(e)?(0,i.jsx)(hg,{text:e}):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})})},uw=({privateNote:e})=>{const t=Hn();return(0,i.jsx)(tw,{title:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(Ya,{icon:"lock"}),(0,i.jsx)(br,{children:t("note_priv_e_06303")})]}),children:m(e)?(0,i.jsx)(hg,{text:e}):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:t("aucune_note_pri_86832")})})};let hw=class extends Pl{constructor(e){super(e)}associateTagsIdsSchema(){return d.Ik().shape({tagsIds:d.YO().of(d.ai())})}};hw=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],hw);const mw=e=>{const t=Hn(),n=Gn(hw),[s,o]=(0,M.useState)(e.tags),[r,a]=(0,M.useState)(!1);return(0,i.jsx)(Tj,{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)(Mm,{isCreateVisible:!0,isSearchVisible:!0,multiple:!0,name:"tagsIds",onCreateClick:()=>{a(!0)},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.name))}),r&&(0,i.jsx)(zj,{organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:e=>{o([...s,e]),t.change("tagsIds",[...n.tagsIds,e.id])}})]})})},gw=e=>{const{data:t,loader:n}=(s={organizationId:e.organizationId},Yn(po,s,[]));var s;return n?null:(0,i.jsx)(mw,{organizationId:e.organizationId,subtitle:e.subtitle,tags:t.organization.tags.nodes,tagsIds:e.tagsIds,onClose:e.onClose,onSave:e.onSave})},pw=e=>{const t=Hn(),{organizationId:n}=Zn(),[s,o]=(0,M.useState)(!1);return"associateTags"in e?(0,i.jsxs)(tw,{rightIcon:"pen",rightIconClick:()=>{o(!0)},title:t("tags_79499"),children:[eo(e.tags)?(0,i.jsx)(Ra,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(Jd,{children:e.name},e.id))}):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")}),s&&(0,i.jsx)(gw,{organizationId:n,subtitle:e.modalSubtitle,tagsIds:e.tags.map(({id:e})=>e),onClose:()=>{o(!1)},onSave:async t=>{await e.associateTags(t),e.reload(),o(!1)}})]}):(0,i.jsx)(tw,{title:t("tags_79499"),children:eo(e.tags)?(0,i.jsx)(Ra,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(Jd,{children:e.name},e.id))}):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")})})},fw=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=cl(),{hasFeature:r}=_I(),a=Gn(Wc),l=Gn(dw),{isOrganizationAdmin:d}=_I(),{mutate:c}=wo(),u=(0,M.useMemo)(()=>ng({organizationId:n,eventId:s,delegationId:o,formId:e.delegation?.form.id}),[e.delegation]),h=(0,M.useMemo)(()=>tg(n,as.DELEGATION({organizationId:n,eventId:s,delegationId:o})),[e.delegation]),g=(0,M.useMemo)(()=>m(e.delegation.description)?l.renderText(e.delegation.description,{delegation:{...e.delegation,formLink:u}}):"",[e.delegation]),p=(0,M.useMemo)(()=>e.delegation.usedCustomFields.concat(e.customFields),[e.customFields,e.delegation]),f=(e,t)=>(0,i.jsxs)(Ra,{children:[(0,i.jsx)(br,{textAlign:"start",children:e}),(0,i.jsx)(br,{css:{borderBlockEnd:"2px dotted $gray500",flex:"1",marginBlockEnd:"$1"}}),(0,i.jsx)(br,{color:"gray900",css:{fontSize:"$textMd"},textAlign:"end",children:t})]});return(0,i.jsx)(Ob,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)(Ra,{css:{flex:"3",height:"100%"},direction:"column",gap:"6",children:(0,i.jsx)(tw,{css:{flex:"1 1"},title:t("limite_de_membr_42978"),children:(0,i.jsxs)(Ra,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:[(0,i.jsx)(br,{css:{margin:"auto"},children:(0,i.jsx)(rw,{count:e.delegation.numberOfResources,total:e.delegation.maxResources??1/0})}),(0,i.jsx)(Ra,{direction:"column",gap:"4",children:r(Fe.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray700",css:{fontSize:"$textXs",fontWeight:600,fontFamily:"Open Sans",lineHeight:"18px",textTransform:"uppercase"},children:t("dont_76603")}),(0,i.jsxs)(Ra,{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)(Ra,{css:{flex:"6"},direction:"column",gap:"6",children:(0,i.jsx)(tw,{title:t("param_tres_78420"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ra,{gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",children:t("cat_gorie_00291")}),(0,i.jsx)(br,{children:(0,i.jsx)(Vc,{to:as.DELEGATION_CATEGORY({organizationId:n,eventId:s,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})]}),(0,i.jsx)(Uu,{direction:"horizontal"}),d&&e.delegation.parent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",children:t("d_l_gation_pare_68507")}),(0,i.jsx)(Ra,{align:"center",css:{color:"$primary700",fontWeight:"$medium","&:hover":{textDecoration:"underline"}},gap:"2",children:(0,i.jsx)(Ha,{to:as.DELEGATION({organizationId:n,delegationId:e.delegation.parent.id}),children:(0,i.jsx)(Jd,{color:"white",cursor:"pointer",size:"md",children:e.delegation.parent.name},e.delegation.parent.id)})})]}),(0,i.jsx)(Uu,{direction:"horizontal"})]}),(0,i.jsxs)(Ra,{gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",children:t("status_06428")}),(0,i.jsx)(br,{color:"gray800",children:(0,i.jsx)(Jd,{color:"success",children:t(e.delegation.state)})})]}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsxs)(Ra,{gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",children:t("date_limite_d_i_79779")}),(0,i.jsx)(br,{color:"gray800",children:e.delegation.deadlineDate?a.toLocaleString(e.delegation.deadlineDate,Zs.DateOnly.MonthLong):"-"})]}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsxs)(Ra,{gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",children:t("Form")}),(0,i.jsx)(Vc,{css:{color:"$primary700"},to:u,children:e.delegation.form.name})]}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsxs)(Ra,{gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",children:t("DelegationSpaceLink")}),(0,i.jsx)(Vc,{css:{color:"$primary700"},to:h,children:t("portail_d_l_gat_06817")})]})]})})})]}),eo(p)&&(0,i.jsx)(tw,{title:t("champs_de_formu_64126"),children:(0,i.jsx)(Ra,{direction:"column",gap:"4",width:1,children:p.map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",css:{flex:"1"},children:t.name}),(0,i.jsx)(Ra,{justify:"end",width:300,children:(0,i.jsx)(JA,{field:t,fields:e.delegation.fields})})]})]},t.slug))})}),(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(tw,{title:t("reponsable_82458_plural"),children:eo(e.delegation.leaders)?e.delegation.leaders.map((e,t)=>(0,i.jsxs)(M.Fragment,{children:[0!==t&&(0,i.jsx)(Wu,{height:"4"}),(0,i.jsx)(Ub,{userInfo:e})]},e.id)):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})}),(0,i.jsx)(pw,{associateTags:e=>c({organizationId:n,eventId:s,massEdit:{reset:!1,selecteds:{ids:[o]},slug:Ie.Tag,strategy:Qe.Replace,value:e}}),modalSubtitle:t("ajouter_des_tag_35833"),reload:e.reload,tags:e.delegation.tags})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(cw,{description:g}),(0,i.jsx)(uw,{privateNote:e.delegation.privateNote})]})]})]})})},xw=()=>{const{params:{organizationId:e,delegationId:t}}=cl(),{data:n,loader:s,reload:o}=Yn("query DelegationDashboard($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n customFields(variety: Delegation, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n delegation(id: $delegationId) {\n id\n name\n description\n deadlineDate\n privateNote\n state\n numberOfResources\n maxResources\n numberOfMembersAccredited\n numberOfMembersWaitingAccreditation\n numberOfMembersRefusedAccreditation\n fields\n\n delegationCategory {\n id\n name\n }\n\n parent {\n id\n name\n }\n\n form {\n id\n name\n }\n\n leaders {\n id\n email\n name\n\n picture {\n url\n }\n }\n\n tags {\n id\n name\n }\n\n usedCustomFields {\n ...CustomFieldWithCondition\n }\n }\n }\n}\n",{organizationId:e,delegationId:t},[Ms.CustomFieldWithConditionFragment]);return s||(0,i.jsx)(fw,{customFields:n.organization.customFields.nodes,delegation:n.organization.delegation,reload:o})},_w=e=>{switch(e){case Iw.Event:return{color:"success",leftIcon:"calendar"};case Iw.ParentDelegation:return{color:"pink",leftIcon:"people-group"};default:return nl()}};var Iw;!function(e){e.Event="event",e.ParentDelegation="parent-delegation"}(Iw||(Iw={}));const vw=({state:e,userInfo:t,onClick:n})=>{const s=Hn(),o=m(t.name);return(0,i.jsxs)(Ra,{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)(lc,{shouldPreventDefault:!1,state:e,onClick:Hl.A}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(qg,{email:t.email,image:t.picture?.url,name:t.name,size:40}),(0,i.jsx)(Ba,{width:"4"}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(br,{ellipsis:!0,color:"gray700",children:o?t.name:t.email}),o&&(0,i.jsx)(br,{ellipsis:!0,color:"gray500",children:t.email})]}),t.source&&(0,i.jsx)(br,{children:(0,i.jsx)(Jd,{..._w(t.source),leftIconStyle:"solid",children:t.source===Iw.Event?s("_v_nement_22345"):s("d_l_gation_pare_68507")})})]})},bw=({availableMembers:e,select:t,usersInfosIds:n})=>(0,i.jsx)(i.Fragment,{children:e.map(e=>{const s=n.includes(e.id)?"checked":"unchecked";return(0,i.jsx)(vw,{state:s,userInfo:e,onClick:()=>{t(e.id)}},e.id)})}),jw=({delegationId:e,nameOrEmail:t,organizationId:n,usersInfosIds:s,select:o})=>{const{data:r,loader:a}=ba({organizationId:n,excludedDelegationId:e,name:m(t)?t:null});return a||(0,i.jsx)(bw,{availableMembers:r.organization.usersInfos.nodes,select:o,usersInfosIds:s})},Cw=({delegationId:e,eventId:t,nameOrEmail:n,usersInfosIds:s,select:o})=>{const{data:r,loader:a}=Yn("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:m(n)?n:null},[Ms.ExistingVolunteerFragment]);const l=(0,M.useMemo)(()=>{if(r.event){const e=r.event.volunteersRegistrations.nodes.map(e=>({...e.userInfo,source:Iw.Event})),t=e.map(({id:e})=>e),n=r.event.delegation.parentUsersInfos.flatMap(e=>t.includes(e.id)?[]:[{...e,source:Iw.ParentDelegation}]);return e.concat(n)}return[]},[r.event]);return a||(0,i.jsx)(bw,{availableMembers:l,select:o,usersInfosIds:s})},yw=({delegationId:e,eventId:t,organizationId:n,onClose:s,reload:o})=>{const r=Hn(),a=Gn(mj),[l,d,c]=Pc(""),{mutate:u}=Ko(),{mutate:h}=ya();return(0,i.jsx)(Tj,{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:s,onSubmit:async i=>{t?await u({eventId:t,delegationId:e,selecteds:{ids:i.usersInfosIds}}):await h({organizationId:n,delegationId:e,selecteds:{ids:i.usersInfosIds}}),s(),o()},children:({form:s,values:o})=>{const a=e=>{s.change("usersInfosIds",io(o.usersInfosIds,e))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:r("rechercher_un_m_05904"),value:l,onChange:c}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(hl,{}),(0,i.jsx)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",children:t?(0,i.jsx)(Cw,{delegationId:e,eventId:t,nameOrEmail:d,select:a,usersInfosIds:o.usersInfosIds}):(0,i.jsx)(jw,{delegationId:e,nameOrEmail:d,organizationId:n,select:a,usersInfosIds:o.usersInfosIds})})]})}})},kw=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{showNotification:o}=ib(),{mutate:r}=Jr();return(0,i.jsx)(Pk,{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:s,selecteds:{ids:[e.delegation.id]}}),o(t("la_d_l_gation_31201",e.delegation.name)),e.onSuccess()}})},Aw=({delegation:e,reload:t})=>{const{history:n,translate:s,params:{organizationId:o,eventId:r,delegationId:a}}=cl(),{isOrganizationAdmin:l}=_I(),{isEventAdmin:d,hasPermission:c}=Jv(),{mutate:u}=Zr(),{mutate:h}=Ho(),{mutate:m}=wo(),[g,p]=(0,M.useState)(!1),[f,x]=(0,M.useState)(!1),_=l||d,I=l||c?.(xb.MEMBER_ACCREDIT),v=l||c?.(xb.DELEGATION_EDIT),b=e.lockedAt?.isValid;return(0,i.jsxs)(Rb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Qb,{returnPathFallback:as.DELEGATIONS({organizationId:o,eventId:r})}),(0,i.jsxs)(Ra,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(br,{font:"gray900 displayXs medium",children:e.name}),b&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"error600",fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"lock-keyhole"})})}),(0,i.jsx)(_m,{placement:"top",children:s("cette_d_l_gatio_29556")})]})]}),_&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",disabled:e.numberOfResources>=(e.maxResources??1/0),children:s("ajouter_un_memb_33261")})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"user-plus",onClick:()=>{n.push(BI.CREATE({organizationId:o,eventId:r,delegationId:a}))},children:s("ajouter_un_nouv_29283")}),(0,i.jsx)(Ld,{icon:"user-group",onClick:e=>{$d(e.target),x(!0)},children:s("ajouter_des_mem_06922")})]})]}),v&&(0,i.jsx)(jl,{to:hi(as.DELEGATION({organizationId:o,eventId:r,delegationId:e.id})),children:s("_diter_la_d_l_g_30300")}),(I||v)&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[I&&r&&(0,i.jsx)(Ld,{icon:"check",onClick:async()=>{await h({eventId:r,delegationId:e.id}),t()},children:s("valider_les_acc_80801")}),v?b?(0,i.jsx)(Ld,{icon:"lock-keyhole-open",onClick:async()=>{await m({organizationId:o,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Ie.IsLocked,strategy:Qe.Replace,value:!1}}),t()},children:s("d_verrouiller_67042")}):(0,i.jsx)(Ld,{icon:"lock-keyhole",onClick:async()=>{await m({organizationId:o,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Ie.IsLocked,strategy:Qe.Replace,value:!0}}),t()},children:s("verrouiller_24528")}):null,v&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>{const{delegationDuplicate:t}=await u({organizationId:o,eventId:r,delegationId:e.id});n.push(hi(as.DELEGATION({organizationId:o,eventId:r,delegationId:t.id})))},children:s("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:s("supprimer_43083")})]})]})]}),g&&(0,i.jsx)(kw,{delegation:e,onClose:()=>p(!1),onSuccess:()=>n.replace(r?as.DELEGATIONS({organizationId:o,eventId:r}):Os.COMMUNITY_DELEGATIONS(o))}),f&&(0,i.jsx)(yw,{delegationId:e.id,eventId:r,organizationId:o,reload:t,onClose:()=>{x(!1)}})]})};var ww=n(6349);const Sw=e=>({title:{display:!0,font:{weight:500},padding:{bottom:30},text:e}}),Ew=()=>({border:{display:!1},grid:{color:mr.colors.gray100.value}}),Tw=({datasets:e,labels:t,options:n})=>{const s=(0,M.useMemo)(()=>(0,Ma.A)("chart-"),[]),o=(0,M.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:Ew()}};return(0,M.useEffect)(()=>{o.current&&o.current.destroy(),o.current=new ww.Ay(document.getElementById(s),{type:"bar",options:(0,Ua.A)(r,n),data:{labels:t,datasets:e}})},[e,t,n]),(0,i.jsx)(br,{height:1,width:1,children:(0,i.jsx)("canvas",{id:s})})},zw=e=>{const t=Hn(),n=Gn(Wc),s=(0,M.useMemo)(()=>zh(e.slots),[e.slots]),o=(0,M.useMemo)(()=>e.accreditation.hasSlots?s.map(e=>wh(n,e,"",{accreditation:{includeName:!1}})):[e.accreditation.name],[s,e.accreditation]),r=(0,M.useMemo)(()=>{const n=s.some(e=>"number"==typeof e.maxResources),i=s.some(e=>"number"==typeof e.delegationsTotalResources&&e.delegationsTotalResources>0);return(0,Va.A)([e.accreditation.willAutoAccredit?null:{label:t("souhait_es_78101"),data:s.map(e=>e.wishedResources),backgroundColor:n?s.map(e=>e.assignedResources+e.wishedResources<=(e.maxResources??1/0)?mr.colors.primary400.value:Hd(mr.colors.primary400.value,.5)):mr.colors.primary400.value},{label:t("affect_es_00048"),data:s.map(e=>e.assignedResources),backgroundColor:n?s.map(e=>e.assignedResources<=(e.maxResources??1/0)?mr.colors.primary700.value:Hd(mr.colors.error500.value,.7)):mr.colors.primary700.value},{label:t("scann_es_13169"),data:s.map(e=>e.scannedResources),backgroundColor:mr.colors.primary900.value},n?{label:t("maximum_56225"),data:s.map(e=>e.maxResources??1/0),backgroundColor:mr.colors.gray200.value}:null,i?{label:t("total_attribu_e_97130"),data:s.map(e=>e.delegationsTotalResources??0),backgroundColor:mr.colors.gray400.value}:null])},[s]);return(0,i.jsx)(Tw,{datasets:r,labels:o,options:{scales:{y:{...Ew(),ticks:{precision:0},...Sw(t("nb_d_accr_dita_23359"))},x:{grid:{display:!1},...Sw(t(e.accreditation.hasSlots?"slots_05517":"Accreditation"))}}}})},Ow=e=>{const t=(0,M.useMemo)(()=>e.event.delegation.accreditationsSlots.filter(t=>t.accreditationId===e.accreditation.id).map(e=>({maxResources:e.maxResources,assignedResources:e.assignedResources,scannedResources:e.scannedResources,wishedResources:e.wishedResources,name:e.accreditationSlot.name,date:e.accreditationSlot.date})),[e.accreditation,e.event]);return(0,i.jsx)(tw,{title:e.accreditation.name,children:(0,i.jsx)(br,{height:380,width:1,children:(0,i.jsx)(zw,{accreditation:e.accreditation,slots:t})})})},Rw=e=>{const t=(0,M.useMemo)(()=>rC((0,ch.A)(e.event.delegation.accreditations.map(e=>{const t=e.willAutoAccredit||e.accreditation.willAutoAccredit;return{...e.accreditation,willAutoAccredit:t}}),e=>e.id)),[e.event]);return(0,i.jsx)(Ra,{direction:"column",gap:"4",children:eo(t)?t.map(t=>(0,i.jsx)(Ow,{accreditation:t,event:e.event},t.id)):(0,i.jsx)(qA,{})})},$w=()=>{const{params:{eventId:e,delegationId:t}}=cl(),{data:n,loader:s}=Yn("query DelegationReporting($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditations {\n accreditationId\n willAutoAccredit\n\n accreditation {\n id\n name\n accreditationCategoryName\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n accreditationsSlots {\n accreditationId\n maxResources\n assignedResources\n scannedResources\n wishedResources\n\n accreditationSlot {\n name\n date\n }\n }\n }\n }\n}\n",{eventId:e,delegationId:t},[]);return s||(0,i.jsx)(Rw,{event:n.event})},Dw=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=cl(),{hasFeature:r,isOrganizationAdmin:a}=_I(),{isEventAdmin:l,isEventReader:d}=Jv(),c=a||l,u=(0,M.useMemo)(()=>e.organization.allowDelegationSpaceDownload||eo(e.organization.delegation.customDocuments??[]),[e.organization]),h=(0,M.useMemo)(()=>(e.organization.delegationsSpaceCustomBadges??[]).concat(e.organization.delegation.customDocuments.map(e=>e.slug)??[]),[e.organization]),m=(0,M.useMemo)(()=>e.organization.delegation.event?.customDocuments??[],[e.organization]),g=e=>({organizationId:e?":organizationId":n,eventId:s?e?":eventId":s:void 0,delegationId:e?":delegationId":o});return Td(e.organization.delegation.name),(0,i.jsxs)($b,{children:[(0,i.jsx)(Aw,{delegation:e.organization.delegation,reload:e.reload}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:as.DELEGATION_DASHBOARD(g(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(Db,{path:as.DELEGATION_MEMBERS(g(!1)),children:t("membres_125561",e.organization.delegation.numberOfResources)}),s&&r(Fe.Accreditation)&&(0,i.jsx)(Db,{path:as.DELEGATION_ACCREDITATIONS(g(!1)),children:t("accr_ditations_39450")}),s&&r(Fe.Accreditation)&&(0,i.jsx)(Db,{path:as.DELEGATION_REPORTING(g(!1)),children:"Reporting"}),s&&u&&(0,i.jsx)(Db,{path:as.DELEGATION_DOCUMENTS(g(!1)),children:t("Documents")})]}),(0,i.jsx)(Fb,{path:as.DELEGATION_DASHBOARD(g(!0)),children:(0,i.jsx)(xw,{})}),(0,i.jsx)(Fb,{path:as.DELEGATION_MEMBERS(g(!0)),children:s?(0,i.jsx)(Ob,{children:(0,i.jsx)(jA,{campaigns:e.organization.delegation.campaigns,canAccredit:c,canClickMemberName:!0,canDeleteMembers:c,canEditColumns:!0,canEditMembers:c,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,customFieldsPrivacy:pe.All,deleteFromEvent:!1,getEditPath:t=>Os.EDIT_USER_DELEGATION_FORM(n,s,o,t.userInfo.id,e.organization.delegation.formId),onlyVisibleAccreditationsSlots:!d,showAccreditationsEdit:c,showAccreditationsValidate:c,showDeleteFromEvent:c,showDocumentsDownload:!0,showEditMode:c})}):(0,i.jsx)(Ob,{children:(0,i.jsx)(wA,{campaigns:e.organization.delegation.campaigns,canClickMemberName:!0,canDeleteMembers:c,canEditColumns:!0,canEditMembers:c,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,getEditPath:e=>Os.COMMUNITY_EDIT_USER_DELEGATION(n,o,e.id),isOrganizationAdmin:c,showDocumentsDownload:!0})})}),(0,i.jsx)(Fb,{path:as.DELEGATION_ACCREDITATIONS(g(!0)),children:(0,i.jsx)(Ob,{children:(0,i.jsx)(YA,{isEventAdmin:l,onlyVisible:!d})})}),(0,i.jsx)(Fb,{path:as.DELEGATION_REPORTING(g(!0)),children:(0,i.jsx)(Ob,{children:(0,i.jsx)($w,{})})}),(0,i.jsx)(Fb,{path:as.DELEGATION_DOCUMENTS(g(!0)),children:(0,i.jsx)(Ob,{children:(0,i.jsx)(ZA,{customDocuments:m,delegationsSpaceCustomBadges:h})})})]})]})},Pw=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=cl(),{data:s,loader:o,reload:r}=Yn("query Delegation($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n delegation(id: $delegationId) {\n id\n name\n formId\n numberOfResources\n maxResources\n columns\n parentId\n lockedAt\n\n campaigns {\n id\n name\n }\n\n customDocuments {\n slug\n name\n }\n\n event {\n customDocuments {\n slug\n name\n }\n }\n }\n }\n}\n",{organizationId:e,delegationId:n},[Ms.OrganizationCustomFieldsFragment]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:as.DELEGATION({organizationId:":organizationId",eventId:t?":eventId":void 0,delegationId:":delegationId"}),children:(0,i.jsx)(ei,{path:as.DELEGATION_DASHBOARD({organizationId:e,eventId:t,delegationId:n}),replace:!0})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(Dw,{organization:s.organization,reload:r})})]})},Fw=({backgroundColor:e,button:t,iconColor:n,value:s,icon:o,text:r})=>(0,i.jsxs)(Ra,{css:{backgroundColor:e??"$white",bd:!0,flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ra,{css:{borderBottom:t?"1px solid $gray200":"none",padding:"$6"},direction:"column",children:[o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ej,{color:n??"primary",icon:o}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(br,{color:"gray500",children:r}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:s})]}),t&&(0,i.jsx)(Ra,{css:{background:"$gray50",padding:"$4 $6"},gap:"4",justify:"end",children:t})]}),Mw=e=>{const t=Hn(),[n,s,o]=Pc(""),{data:r,loader:a}=Yn("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:m(s)?s:void 0},[Ms.LeaderUserInfoFragment]);const[l,d]=(0,M.useState)(!1),[c,u]=(0,M.useState)(null),[h,g]=(0,M.useState)(null),{styles:p,attributes:f,update:x}=(0,Bd.E)(c,h,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,8]}}]}),_=(0,M.useMemo)(()=>c?.getBoundingClientRect().width??100,[c]),I=(0,M.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,M.useEffect)(()=>{x?.()},[x,l,c,I]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{ref:u,onClick:e=>{Al(e),d(!l)},children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_17775"),value:n,onChange:o})}),(0,i.jsx)(Ra,{ref:g,css:{background:"white",border:"1px solid $gray100",borderRadius:"$2",boxShadow:"$md",display:l?"flex":"none",maxHeight:"360px",overflowY:"auto",py:"$2",zIndex:1e3,...p.popper},direction:"column",width:_,onClick:e=>{Al(e)},...f.poppeer,children:a||I.map(n=>(0,i.jsxs)(Ra,{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)(Jd,{color:"primary",children:t("administrateur_38490")}),disabled:n.isDisabled,userInfo:n}),!n.isDisabled&&(0,i.jsx)(jl,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(n)}})]},n.id))})]})},Nw=e=>{const t=Hn();return(0,i.jsxs)(Ra,{align:"center",gap:"5",children:[(0,i.jsx)(br,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(Ub,{userInfo:e.leader.userInfo})}),(0,i.jsx)(br,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(Au,{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)(br,{color:"gray500",css:{cursor:"pointer",width:"$6",padding:"$1"},onClick:e.onDelete,children:(0,i.jsx)(Ya,{icon:"trash-can"})})]})},Lw=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.currentLeaders),o=e.roles[0];return(0,i.jsxs)(Qc,{size:"lg",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"user-gear"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("modification_de_24714")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("les_responsable_92946")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Mw,{currentLeaders:n,eventId:e.eventId,organizationId:e.organizationId,onAdd:e=>{s(n.concat([{userInfo:e,role:o}]))}}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:n.map((t,o)=>(0,i.jsx)(Nw,{leader:t,roles:e.roles,onDelete:()=>{s((0,sc.A)(n,t))},onRoleChange:t=>{s((0,cu.jM)(n=>{n[o].role=e.roles.find(e=>e.id===t)}))}},t.userInfo.id))}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{onClick:()=>{e.onSave(n.map(e=>({userInfoId:e.userInfo.id,roleId:e.role.id})))},children:t("enregistrer_06519")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},Bw=({leaders:e})=>{const t=Hn();return eo(e)?(0,i.jsx)(i.Fragment,{children:e.map((e,n)=>(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Wu,{height:"4"}),(0,i.jsx)(Ub,{badge:(0,i.jsx)(Jd,{color:"gray",children:t(e.role.name)}),userInfo:e.userInfo})]},e.userInfo.id))}):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})},Vw=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{isEventAdmin:o}=Jv(),[r,a]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tw,{rightIcon:o?"pen":void 0,rightIconClick:()=>{a(!0)},title:t("reponsable_82458_plural"),children:(0,i.jsx)(Bw,{leaders:e.leaders})}),o&&r&&(0,i.jsx)(Lw,{currentLeaders:e.leaders,eventId:s,organizationId:n,roles:e.roles,onClose:()=>{a(!1)},onSave:async t=>{await e.onSave(t),e.reload()}})]})},Uw=e=>{const t=Hn();return"onSave"in e?(0,i.jsx)(Vw,{...e}):(0,i.jsx)(tw,{title:t("reponsable_82458_plural"),children:(0,i.jsx)(Bw,{leaders:e.leaders})})},Ww=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=cl(),[r,a,l]=Pc(""),[d,c]=(0,M.useState)(0),{data:u,isLoading:h}=Yn("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:s,level:s?tt.Event:tt.Organization,delegationCategoryId:o,name:m(a)?a:void 0,offset:d},[]);const{numberOfPages:g,totalCount:p}=vu(u.organization?.delegations);return(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_une_31213"),value:r,onChange:l})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:t("nom_de_la_d_l_g_28087")}),(0,i.jsx)(Fc,{children:t("status_06428")})]}),numberOfPages:g,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):u.organization.delegations.nodes.map(o=>(0,i.jsxs)(Tc,{css:{cursor:"pointer"},onClick:()=>{e.push(as.DELEGATION({organizationId:n,eventId:s,delegationId:o.id}))},children:[(0,i.jsx)(yc,{children:(0,i.jsx)(br,{font:"gray900 textSm medium",children:o.name})}),(0,i.jsx)(yc,{children:(0,i.jsx)(Jd,{...hj(o.state),children:t(o.state)})})]},o.id)),setOffset:c,title:t("liste_des_d_l_g_86270"),totalCount:p})},Gw=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=cl(),{roles:r}=_I(),{mutate:a}=function(e={}){return Kn("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)(Ob,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ra,{gap:"6",width:1,children:[(0,i.jsx)(Fw,{text:t("nombre_de_d_l_g_45708"),value:e.delegationCategory.numberOfDelegations}),(0,i.jsx)(Fw,{text:t("number_of_membe_24698"),value:e.delegationCategory.numberOfResources})]}),(0,i.jsx)(Ra,{children:(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Ww,{})})}),(0,i.jsx)(Ra,{children:(0,i.jsx)(Uw,{leaders:e.delegationCategory.leaders,reload:e.reload,roles:r.delegationCategoryRoles,onSave:e=>a({organizationId:n,eventId:s,massLeaders:{leaders:e,selecteds:{ids:[o]},strategy:Qe.Replace}})})})]})})},Hw=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("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)(Pk,{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()}})},qw=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{isOrganizationAdmin:r}=_I(),{hasPermission:a}=Jv(),{mutate:l}=function(e={}){return Kn("mutation DelegationCategoryDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n) {\n delegationCategoryDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n ) {\n id\n }\n}\n",e)}(),d=r||a(xb.DELEGATION_EDIT),[c,u]=(0,M.useState)(!1),[h,m]=(0,M.useState)(!1);return(0,i.jsxs)(Rb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Qb,{returnPathFallback:as.DELEGATIONS({organizationId:s,eventId:o})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.category.name}),d&&(0,i.jsx)(jl,{color:"white",onClick:()=>m(!0),children:n("_diter_62574")}),d&&(0,i.jsx)(jl,{onClick:()=>{t.push(o?Os.CREATE_DELEGATION(s,o,e.category.id):Os.COMMUNITY_CREATE_DELEGATION(s,e.category.id))},children:n("ajouter_une_d_l_79133")}),d&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"copy",onClick:async()=>{const{delegationCategoryDuplicate:{id:n}}=await l({organizationId:s,eventId:o,delegationCategoryId:e.category.id});t.push(as.DELEGATION_CATEGORY({organizationId:s,eventId:o,delegationCategoryId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{u(!0)},children:n("supprimer_43083")})]})]}),h&&(0,i.jsx)(EC,{delegationCategory:e.category,eventId:o,organizationId:s,onClose:()=>{m(!1)},onSuccess:e.reload}),c&&(0,i.jsx)(Hw,{delegationCategory:e.category,eventId:o,organizationId:s,onClose:()=>{u(!1)},onSuccess:()=>{t.replace(as.DELEGATIONS({organizationId:s,eventId:o}))}})]})},Yw=()=>{const{params:{organizationId:e,eventId:t,delegationCategoryId:n}}=cl(),s=Gn(Bh),o=Gn(yA),{isOrganizationAdmin:r}=_I(),{isEventAdmin:a}=Jv(),l=r||a,[d,c,u]=VC(e,"delegationCategoryMembers.columns",["name","delegations"]),[h,m,g]=VC(e,"delegationCategoryMembers.limit",kc),[p,f,x]=VC(e,"delegationCategoryMembers.predicates",[]),[_,I,v]=VC(e,"delegationCategoryMembers.sort",null),{data:b,isLoading:j}=Yn("query DelegationCategoryMembersInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n }\n }\n}\n",{organizationId:e,eventId:t},[Ms.SegmentCustomFieldFragment]),C=u||g||x||v||j,y=(0,M.useMemo)(()=>b.organization?.customFields.nodes??[],[b.organization]),k=UC(y),A=(0,M.useMemo)(()=>b.organization?t?s.getDelegationCategoryMembersFilters(e,t,y,b.organization.event,b.organization?.event?.isWeezeventConnected??!1):o.getDelegationMembersFilters(y):[],[t,y]),w=(0,M.useMemo)(()=>t?s.getDelegationCategoryMembersPossibleColumns(y,b.organization?.event?.isWeezeventConnected??!1):o.getDelegationMembersPossibleColumns(y),[t,y,b]);return C?(0,i.jsx)(_l,{}):(0,i.jsx)(Ob,{children:(0,i.jsx)(lm,{columns:d,columnsSearch:[],columnsToIncludes:t?Lh:CA,eventId:t,filters:A,getMassActionId:e=>t?e.userInfo.id:e.id,limit:h,loadDataList:t?nr:Bo,loadDataListParams:{delegationCategoryId:n,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:t?er:Lo,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:e,possibleColumns:w,predicates:p,renderActions:(e,t,n)=>(0,i.jsx)(gA,{campaigns:[],customFields:y,deleteFromEvent:!1,massActions:e,showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:!1,showWishedAccreditationsEdit:!1,onMassEditSuccess:n}),rendering:Ph.List,setColumns:c,setLimit:m,setPredicates:f,setSort:I,showEditColumns:!0,showEditMode:l,showFilters:!0,showMassActions:l,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:_,children:(0,i.jsx)(bm,{renderCell:(e,n,s)=>t?(0,i.jsx)(Qy,{canAccredit:!0,canAssign:!1,canChangeDelegation:!0,canClickMemberName:!0,column:e,customField:k.get(e.slug),eventId:t,reloadRow:s,row:n}):(0,i.jsx)(AA,{canClickMemberName:!0,column:e,customField:k.get(e.slug),reloadRow:s,row:n,updatable:!0})})})})},Kw=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=cl(),r=e=>({organizationId:e?":organizationId":n,eventId:s?e?":eventId":s:void 0,delegationCategoryId:e?":delegationCategoryId":o}),a=e.organization.delegationCategory;return(0,i.jsxs)($b,{children:[(0,i.jsx)(qw,{category:a,reload:e.reload}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:as.DELEGATION_CATEGORY_DASHBOARD(r(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(Db,{path:as.DELEGATION_CATEGORY_MEMBERS(r(!1)),children:t("membres_125561",a.numberOfResources)})]}),(0,i.jsx)(Fb,{path:as.DELEGATION_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(Gw,{delegationCategory:a,reload:e.reload})}),(0,i.jsx)(Fb,{path:as.DELEGATION_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(Yw,{})})]})]})},Zw=e=>{const{params:{organizationId:t,eventId:n,delegationCategoryId:s}}=cl(),{data:o,loader:r,reload:a}=Yn("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:s},[Ms.LeaderInfosFragment]);return r||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:as.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(ei,{path:as.DELEGATION_CATEGORY_DASHBOARD({organizationId:t,eventId:n,delegationCategoryId:s}),replace:!0})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(Kw,{organization:o.organization,reload:a})})]})},Xw=()=>{const e=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ja,{color:"primary",leftIcon:"clock",children:e("votre_import_es_05273")}),(0,i.jsx)(Ba,{height:"6"})]})};const Jw=5e9;let Qw=class extends Pl{constructor(e){super(e)}schema(){const e=this.t("le_document_est_86403");return d.Ik().shape({acl:d.Yj().required(e),key:d.Yj().required(e).test("is-a-zip",this.t("le_fichier_n_es_91526"),e=>ZI(qI(e).extension)===KI.Zip),name:d.Yj().required(e),file:d.gl().test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],Qw);let eS=class extends Pl{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 d.Ik().shape({input:d.Ik().shape({archive:this.archiveInputService.schema(),fieldId:d.Yj().required(this.t("le_champ_person_80074")).typeError(this.t("le_champ_person_80074"))})})}};eS=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[fj,Qw,Vn])],eS);const tS=()=>{const{translate:e,params:{organizationId:t}}=cl();return(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,subtitle:e("s_lectionnez_vo_27155",iA.bytesToGigabytes(Jw),iA.bytesToMegabytes(2e7)),title:e("votre_fichier_d_51776"),children:(0,i.jsx)(vj,{accept:lv.Archives,acl:"private",organizationId:t,prefix:"input.archive.",withFileField:!0})})},nS=({customFields:e})=>{const t=Hn();return(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,subtitle:t("_ditez_la_corre_24969"),title:t("correspondance_10480"),children:(0,i.jsxs)(yj,{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))]})})},iS=({customFileFields:e})=>(0,i.jsx)(nS,{customFields:e}),sS=e=>!!e.getFieldState("input.archive.key")?.valid&&!!e.getFieldState("input.archive.file")?.valid,oS=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=cl(),s=Gn(eS),o=Gn(Da),r=(0,M.useRef)(null),{data:a,loader:l}=Yn("query FilesImportCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFileFields: customFields(variety: UserInfo, fieldTypes: [File]) {\n nodes {\n id\n name\n slug\n customFieldCategoryId\n customFieldCategoryName\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n }\n }\n }\n}\n",{organizationId:t},[]),{mutate:d}=function(e={}){return Kn("mutation FilesImport(\n $eventId: EventId\n $organizationId: OrganizationId!\n $input: FilesImportInput!\n) {\n jobId: filesImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkFilesImport:c}=ib();return l||(0,i.jsx)(fl,{customErrorRef:r,height:1,initialValues:{input:s.default().input},render:({form:s,handleSubmit:o,submitting:l,values:d})=>(0,i.jsx)(zm,{button:(0,i.jsx)(jl,{isLoading:l,onClick:o,children:e("importer_la_lis_12866")}),category:e("importe_des_fic_85041"),color:"dark",fallbackClosePath:n?Os.VOLUNTEERS(t,n):ji.COMMUNITY_USERS({organizationId:t}),title:e("nouvel_import_48306"),children:(0,i.jsxs)(Em,{ref:r,children:[s.getState().submitSucceeded&&(0,i.jsx)(Xw,{}),(0,i.jsx)(hl,{}),(0,i.jsxs)(Ra,{direction:"column",gap:"5",children:[(0,i.jsx)(tS,{}),d.input.archive?.file&&sS(s)&&(0,i.jsx)(iS,{customFileFields:a.organization.customFileFields.nodes})]})]})}),validate:o.validateForForm(s.schema()),onSubmit:async({input:e})=>{const i=(e=>{const t={...e.archive};return delete t.file,{...e,archive:t}})(e);try{const{jobId:e}=await d({eventId:n,organizationId:t,input:i});r.current&&(r.current.scrollTop=0),c(t,e)}catch{}}})},rS=e=>{const t=Hn(),{mutate:n}=ta(),{data:s}=Qr({organizationId:e.organizationId}),o=(0,M.useMemo)(()=>(s.organization?.events.nodes??[]).filter(t=>t.id!==e.eventId),[s.organization,e.eventId]),r=(0,M.useMemo)(()=>d.Ik().shape({eventId:d.ai().required(t("l_v_nement_est_88155")).oneOf(o.map(e=>e.id),t("l_v_nement_est_88155"))}),[o]);return(0,i.jsxs)(Tj,{buttonText:t("dupliquer_ce_fo_10581"),icon:"sliders",initialValues:{eventId:-1},schema:r,size:"md",subtitle:t("dupliquer_votre_17703"),title:t("dupliquer_vers_48809"),onClose:e.onClose,onSubmit:async t=>{await n({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,newEventId:t.eventId}),e.onClose()},children:[(0,i.jsxs)(Ja,{color:"warning",leftIcon:"triangle-exclamation",children:[t("toutes_les_info_60876"),(0,i.jsx)("br",{}),t("certains_param_05954")]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Mm,{isSearchVisible:!0,label:t("sur_quel_v_nem_94155"),multiple:!1,name:"eventId",children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},aS=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{isOrganizationAdmin:o}=_I(),{showNotification:r}=ib(),{mutate:a}=ta(),{mutate:l}=function(e={}){return Kn("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,M.useState)(!1),[u,h]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"6",width:1,children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Vc,{to:Fi.FORM_ELEMENTS({organizationId:n,eventId:s,formId:e.form.id}),children:e.form.name})}),(0,i.jsxs)(br,{color:"gray500",children:[t("nombre_de_champ_91879")," ",(0,i.jsx)(Gm,{color:"gray800",children:e.form.numberOfCustomFields})]}),(0,i.jsx)(Ib,{permissions:xb.FORM_EDIT,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[e.canDuplicate&&(0,i.jsx)(Ld,{icon:"clone",onClick:async t=>{Al(t),await a({organizationId:n,eventId:s,formId:e.form.id}),e.reload()},children:t("dupliquer_28256")}),o&&s&&e.canDuplicate&&(0,i.jsx)(Ld,{icon:"clone",onClick:()=>{c(!0)},children:t("dupliquer_sur_u_11076")}),e.canDuplicate&&(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{Al(e),h(!0)},children:t("supprimer_43083")})]})]})})]}),d&&(0,i.jsx)(rS,{eventId:s,formId:e.form.id,organizationId:n,onClose:()=>{c(!1)}}),u&&(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_75358"),text:t("suppression_de_73669",e.form.name),onClose:()=>{h(!1)},onDelete:async()=>{await l({organizationId:n,eventId:s,formId:e.form.id}),r(t("le_formulaire_76783",e.form.name)),e.reload()}})]})};function lS(){const{hasFeature:e,hasPermission:t}=_I(),{event:n,hasPermission:i}=Jv();return(0,M.useMemo)(()=>{const s=e=>t(e)||(i?.(e)??!1),o=e(Fe.Accreditation)&&(n?.useAccreditations??!1),r=n?.useCampaigns??!0,a=e(Fe.Delegation)&&(n?.useDelegations??!0),l=e(Fe.CustomDocument)&&(n?.useDocuments??!1),d=n?.useForms??!0,c=n?.usePositions??!1,u=n?.useWorkflows??!0;return{canAccreditationEdit:o&&s(xb.ACCREDITATION_EDIT),canAccreditationRead:o&&s(xb.ACCREDITATION_READ),canCampaignRead:r&&s(xb.CAMPAIGN_READ),canCampaignSend:r&&s(xb.CAMPAIGN_SEND),canCommentAdd:s(xb.COMMENT_ADD),canCommentRead:s(xb.COMMENT_READ),canCustomFieldEdit:s(xb.CUSTOM_FIELD_EDIT),canCustomFieldRead:s(xb.CUSTOM_FIELD_READ),canDelegationEdit:a&&s(xb.DELEGATION_EDIT),canDelegationRead:a&&s(xb.DELEGATION_READ),canDocumentEdit:l&&s(xb.DOCUMENT_EDIT),canDocumentRead:l&&s(xb.DOCUMENT_READ),canEmailEdit:s(xb.EMAIL_EDIT),canEventEdit:s(xb.EVENT_EDIT),canFormEdit:d&&s(xb.FORM_EDIT),canFormRead:d&&s(xb.FORM_READ),canMemberAccredit:o&&s(xb.MEMBER_ACCREDIT),canMemberAssign:c&&s(xb.MEMBER_ASSIGN),canMemberAssignmentStateEdit:c&&s(xb.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:s(xb.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:s(xb.MEMBER_CREATE),canMemberDelete:s(xb.MEMBER_DELETE),canMemberEdit:s(xb.MEMBER_EDIT),canOrganizationParamEdit:s(xb.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:s(xb.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:s(xb.ORGANIZATION_USER_EDIT),canOrganizationUserRead:s(xb.ORGANIZATION_USER_READ),canPositionEdit:c&&s(xb.POSITION_EDIT),canPositionRead:c&&s(xb.POSITION_READ),canSegmentEdit:s(xb.SEGMENT_EDIT),canWorkflowEdit:u&&s(xb.WORKFLOW_EDIT),canWorkflowRead:u&&s(xb.WORKFLOW_READ)}},[e,n,t,i])}function dS(){const{hasFeature:e,hasPermission:t}=_I();return(0,M.useMemo)(()=>{const n=e(Fe.Accreditation),i=e(Fe.Delegation),s=e(Fe.CustomDocument);return{canAccreditationEdit:n&&t(xb.ACCREDITATION_EDIT),canAccreditationRead:n&&t(xb.ACCREDITATION_READ),canCampaignRead:t(xb.CAMPAIGN_READ),canCampaignSend:t(xb.CAMPAIGN_SEND),canCommentAdd:t(xb.COMMENT_ADD),canCommentRead:t(xb.COMMENT_READ),canCustomFieldEdit:t(xb.CUSTOM_FIELD_EDIT),canCustomFieldRead:t(xb.CUSTOM_FIELD_READ),canDelegationEdit:i&&t(xb.DELEGATION_EDIT),canDelegationRead:i&&t(xb.DELEGATION_READ),canDocumentEdit:s&&t(xb.DOCUMENT_EDIT),canDocumentRead:s&&t(xb.DOCUMENT_READ),canEmailEdit:t(xb.EMAIL_EDIT),canEventEdit:t(xb.EVENT_EDIT),canFormEdit:t(xb.FORM_EDIT),canFormRead:t(xb.FORM_READ),canMemberAccredit:t(xb.MEMBER_ACCREDIT),canMemberAssign:t(xb.MEMBER_ASSIGN),canMemberAssignmentStateEdit:t(xb.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:t(xb.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:t(xb.MEMBER_CREATE),canMemberDelete:t(xb.MEMBER_DELETE),canMemberEdit:t(xb.MEMBER_EDIT),canOrganizationParamEdit:t(xb.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:t(xb.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:t(xb.ORGANIZATION_USER_EDIT),canOrganizationUserRead:t(xb.ORGANIZATION_USER_READ),canPositionEdit:t(xb.POSITION_EDIT),canPositionRead:t(xb.POSITION_READ),canSegmentEdit:t(xb.SEGMENT_EDIT),canWorkflowEdit:t(xb.WORKFLOW_EDIT),canWorkflowRead:t(xb.WORKFLOW_READ)}},[e,t])}let cS=class extends Pl{constructor(e){super(e)}formInputDefault(){return{name:""}}formInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536"))})}createFormSchema(){return d.Ik().shape({form:this.formInputSchema()})}};cS=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],cS);const uS=e=>{const t=Hn(),n=Gn(cS),{mutate:s}=function(e={}){return Kn("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)(Tj,{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 s({organizationId:e.organizationId,eventId:e.eventId,form:t.form});e.onSuccess(n.id)},children:(0,i.jsx)(Rl,{label:t("nom_du_formulai_14952"),name:"form.name"})})},hS=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{canFormEdit:r}=lS(),[a,l]=(0,M.useState)(e.isCreateOpen);return(0,i.jsxs)(Rb,{gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:n("Form_plural")}),e.isSearchVisible&&(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:n("rechercher_un_f_28561"),value:e.name,onChange:e.setName})}),r&&e.canCreateNewForm&&(0,i.jsx)(jl,{onClick:()=>{l(!0)},children:n("cr_er_un_formul_78352")}),a&&(0,i.jsx)(uS,{eventId:o,organizationId:s,onClose:()=>{l(!1)},onSuccess:e=>{t.push(Fi.FORM_ELEMENTS({organizationId:s,eventId:o,formId:e}))}})]})},mS=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$2",height:72,width:1})]}),gS=e=>{const{translate:t}=cl(),{event:n}=Jv(),{hasFeature:s}=_I();Td(`${n?.name??t("communaut_20896")} ${t("Form_plural")}`);const[o,r]=(0,M.useState)(""),a=(0,M.useMemo)(()=>m(o)?e.forms.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.id.toString(10)===o):e.forms,[e.forms,o]),l=(0,M.useMemo)(()=>0===e.forms.length||s(Fe.Multiform),[e.forms]);return(0,i.jsxs)($b,{children:[(0,i.jsx)(hS,{canCreateNewForm:l,isCreateOpen:e.isCreateOpen,isSearchVisible:eo(e.forms),name:o,setName:r}),(0,i.jsx)(Ob,{children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(mS,{})]}):0===e.forms.length?(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(xk,{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.jsx)(Ja,{color:"warning",leftIcon:"circle-info",children:(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:t("vous_avez_attei_23858")}),(0,i.jsx)(br,{children:t("votre_abonnemen_18069")})]})}),(0,i.jsx)(Ba,{height:"7"})]}),a.map(t=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(aS,{canDuplicate:l,form:t,reload:e.reload}),(0,i.jsx)(Ba,{height:"3"})]},t.id))]})})]})},pS=e=>{const{organizationId:t,eventId:n}=Zn(),{data:s,isLoading:o,reload:r}=na({organizationId:t,level:tt.Event,eventId:n}),a=(0,M.useMemo)(()=>(0,ic.A)(s.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[s.organization]);return(0,i.jsx)(gS,{forms:a,isCreateOpen:e.isCreateOpen,isLoading:o,reload:r})},fS=e=>{const{organizationId:t}=Zn(),{data:n,isLoading:s,reload:o}=na({organizationId:t,level:tt.Organization}),r=(0,M.useMemo)(()=>(0,ic.A)(n.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[n.organization]);return(0,i.jsx)(gS,{forms:r,isCreateOpen:e.isCreateOpen,isLoading:s,reload:o})};function xS(e){navigator.clipboard.writeText(e)}function _S(){const[e,t]=(0,M.useState)(!1);return{isLoading:e,copy:(0,M.useCallback)(e=>{t(!0),xS(e),setTimeout(()=>t(!1),500)},[])}}const IS=({children:e,isActive:t,onClick:n,replace:s=!0,to:o})=>{const r=Jn(),a=t?.(r.pathname)??r.pathname===o;return(0,i.jsx)(Ra,{align:"center",css:{borderBottom:a?"2px solid $primary700":"2px solid transparent",borderTop:"2px solid transparent",color:a?"$primary700":"$gray500",fontWeight:"$medium",px:"$3",userSelect:"none"},height:1,children:(0,i.jsx)(Ha,{height:1,replace:s,to:o,width:1,onClick:async()=>{n&&await n()},children:e})})},vS=e=>(0,i.jsx)(Ra,{as:Ta.Nav,css:{borderBottom:"1px solid $gray200"},gap:"2",height:e.height,justify:"center",role:"menubar",width:e.width,children:e.children}),bS=()=>{const{translate:e,params:t}=cl();return(0,i.jsxs)(vS,{height:1,width:1,children:[(0,i.jsx)(IS,{to:Fi.FORM_ELEMENTS(t),children:e("champs_91671")}),(0,i.jsx)(IS,{isActive:e=>null!==e.match(/\/form\/\d+\/parameters/),to:Fi.FORM_PARAMETERS_GENERAL(t),children:e("param_tres_78420")}),(0,i.jsx)(IS,{to:Fi.FORM_INTEGRATION(t),children:e("int_gration_10662")}),(0,i.jsx)(IS,{to:Fi.FORM_EMAILS(t),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(IS,{to:Fi.FORM_PREVIEW(t),children:e("aper_u_25595")})]})},jS=e=>{const{translate:t}=cl(),{canFormEdit:n}=lS();return(0,i.jsx)(zm,{button:n&&e.button,category:t("cr_ation_d_un_f_67278"),color:"dark",title:e.title,onClose:e.onClose,children:(0,i.jsxs)(id,{gridtemplatecolumns:"1fr",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(bS,{}),(0,i.jsx)(br,{css:{overflowY:"auto"},children:e.children})]})})},CS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=cl(),{data:r}=ia({organizationId:n,formId:o});Td(r.organization?.form.name??"");const{isLoading:a,copy:l}=_S(),d=ng({organizationId:n,eventId:s,formId:o}),c=``.replace(/\s+/g," ");return(0,i.jsx)(jS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Fi.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsx)(Ra,{justify:"center",width:1,children:(0,i.jsxs)(Ra,{direction:"column",width:"$container",children:[(0,i.jsx)(Ba,{height:"8"}),(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:t("FormLink")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Vc,{css:{color:"$primary700"},to:d,children:d}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:t("code_html_pour_00029")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{"& pre":{border:"1px solid $gray300",borderRadius:"$2",padding:"$3"}},children:(0,i.jsx)("pre",{children:c})}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:a,leftIcon:"copy",onClick:()=>l(c),children:t("copier_le_code_99588")})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:t("qr_code_du_lien_34278")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:sg(d,{height:100,width:100}),width:"100%"})})]})})})},yS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=cl(),{data:r}=ia({organizationId:n,formId:o});Td(r.organization?.form.name??"");const[a,l]=(0,M.useState)("opened"),d=ng({organizationId:n,eventId:s,formId:o,query:{preview:!0,previewState:a}});return(0,i.jsx)(jS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Fi.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsxs)(Ra,{align:"center",direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ra,{direction:"column",width:"$container",children:[(0,i.jsx)(Ba,{height:"8"}),(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{font:"gray900 textLg semiBold",children:t("aper_u_du_formu_51076")}),(0,i.jsx)(br,{color:"gray500",children:t("pr_visualiser_v_58073")})]}),(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{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)(Ba,{height:"5"}),(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)("iframe",{height:"100%",src:d,style:{border:"none"},width:"100%"})})]})})},kS=e=>{const{history:t,translate:n}=cl();return(0,i.jsx)(ub,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"triangle-exclamation",children:n("changements_non_17558")}),(0,i.jsx)(lb,{children:(0,i.jsxs)(Ra,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(br,{font:"gray900 textLg medium",children:n("voulez_vous_qui_84408")}),(0,i.jsx)(br,{color:"gray500",children:n("des_donn_es_ne_27178")})]})}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{color:"error",onClick:()=>t.goBack(e.fallbackPath),children:n("quitter_sans_sa_28486")})})]})})},AS=(0,dr.I4)("div",{alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",overflow:"hidden",userSelect:"none",variants:{color:{primary:{background:"$primary700",color:"white","& > .h-button-dropdown-content":{border:"1px solid $primary700",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $primary700",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0",borderLeft:"1px solid $primary800"},"& > .h-button-dropdown-content:hover":{background:"$primary800",border:"1px solid $primary800",borderRight:"none"},"& > .h-button-dropdown-icon:hover":{background:"$primary800",border:"1px solid $primary800"}},white:{background:"white",color:"$gray700","& > .h-button-dropdown-content":{border:"1px solid $gray300",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $gray300",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},"& > .h-button-dropdown-content:hover":{background:"$gray50",color:"$gray800"},"& > .h-button-dropdown-icon:hover":{background:"$gray50",color:"$gray800"}}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}}},defaultVariants:{color:"primary",size:"md"}}),wS=M.forwardRef((e,t)=>{const{history:n}=cl();return(0,i.jsxs)(AS,{color:e.color,size:e.size,children:[(0,i.jsx)(Ra,{ref:t,align:"center",className:"h-button-dropdown-content",css:{flex:"1",px:"$4"},height:1,onClick:t=>{e.onClick&&e.onClick(t),m(e.path)&&n.push(e.path)},children:e.children}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Ra,{align:"center",className:"h-button-dropdown-icon",height:40,justify:"center",width:40,children:(0,i.jsx)(Ya,{icon:"chevron-down"})})}),(0,i.jsx)(Vd,{placement:"bottom-end",renderOnPortal:!0,children:e.menu})]})]})});wS.displayName="ButtonDropdown";const SS=({returnPathFallback:e})=>(0,i.jsx)(hu,{returnToFallback:e,size:"md",children:(0,i.jsx)(mu,{children:(0,i.jsx)(_l,{})})});let ES=class extends Pl{documentInputService;constructor(e,t){super(t),this.documentInputService=e}customFieldInputDefault(e,t){return{name:e?.name??"",label:e?.label??"",customFieldCategoryId:e?.customFieldCategoryId??t[0].id,description:e?.description??"",variety:e?.variety??_e.UserInfo,fieldType:e?.fieldType??Le.Text,fieldSubtype:e?.fieldSubtype??Ne.Freeform,isPrivate:e?.isPrivate??!1,values:eo(e?.values)?e.values:[],hasCondition:e?.hasCondition??!1,conditionCustomFieldId:e?.conditionCustomFieldId??null,conditionValue:e?.conditionValue??!1,canSelectMultiple:e?.canSelectMultiple??!1,document:e?.document||this.documentInputService.documentInputDefault(),isEncrypted:e?.isEncrypted??!1}}customFieldInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_champ_17959")),label:d.Yj(),customFieldCategoryId:d.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:d.Yj().required(this.t("le_type_est_req_41180")).oneOf(cn,this.t("le_type_est_req_41180")),isPrivate:d.zM().nullable(),hasCondition:d.zM().nullable(),values:d.YO().when("fieldType",{is:Le.Select,then:e=>e.of(d.Ik().shape({id:d.ai(),value:d.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:d.ai().when("hasCondition",{is:!0,then:e=>e.required(),otherwise:e=>e.nullable()}),conditionValue:d.gl(),canSelectMultiple:d.zM().nullable(),document:this.documentInputService.documentInputSchemaNotRequired(),isEncrypted:d.zM().required()})}createUpdateCustomFieldSchema(){return d.Ik().shape({customField:this.customFieldInputSchema()})}};ES=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[fj,Vn])],ES);const TS=e=>{const t=Hn(),n=(0,M.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.change("customField.values",so(e.values,n.index,i.index))},[e.values,e.change]),s=!e.isEdit||e.isSelectV2;return(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",children:t("valeurs_de_la_l_43599")}),(0,i.jsxs)(Ra,{css:{background:"$gray100",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[s?(0,i.jsx)(uu.JY,{onDragEnd:n,children:(0,i.jsx)(uu.gL,{droppableId:"1",children:t=>(0,i.jsxs)(Ra,{direction:"column",gap:"3",...t.droppableProps,ref:t.innerRef,children:[e.values.map((t,n)=>(0,i.jsx)(uu.sx,{draggableId:n.toString(),index:n,children:t=>(0,i.jsxs)(Ra,{align:"center",gap:"4",...t.draggableProps,ref:t.innerRef,children:[(0,i.jsx)(br,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...t.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Rl,{name:`customField.values[${n}].value`})}),(0,i.jsx)(br,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{e.change("customField.values",oo(e.values,n))},children:(0,i.jsx)(Ya,{icon:"trash-can"})})]})},n)),t.placeholder]})})}):e.values.map((e,t)=>(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Rl,{name:`customField.values[${t}].value`})},t)),(0,i.jsxs)(br,{css:{cursor:"pointer"},font:"primary700 textSm medium",onClick:()=>{e.change("customField.values",e.values.concat([{value:""}]))},children:["+ ",t("ajouter_une_nou_98358")]})]})]})},zS=e=>{const{translate:t}=cl(),{showNotification:n}=ib(),s=Gn(ES),o=Rc(),r=Gn(Da),{mutate:a}=function(e={}){return Kn("mutation CustomFieldCategoryCreate(\n $organizationId: OrganizationId!\n $category: CustomFieldsCategoryInput!\n) {\n customFieldCategoryCreate(organizationId: $organizationId, customFieldCategory: $category) {\n id\n name\n }\n}\n",e)}(),l=(0,M.useRef)(null),d=(0,M.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.customField.name):t("nouveau_champ_p_27686"),[e.isEdit,e.initialValues]);Td(d);const c=(0,M.useMemo)(()=>(0,ic.A)(e.organization.customFields.nodes.filter(t=>t.id!==e.customFieldId),e=>e.name.toLowerCase()),[e.customFieldId,e.organization]),[u,h]=(0,M.useState)(AC(e.organization.customFieldsCategories.nodes)),[m,g]=(0,M.useState)(e.initialValues.customField.fieldType),[p,f]=(0,M.useState)(e.initialValues.customField.hasCondition),[x,_]=(0,M.useState)(c.find(t=>t.id===e.initialValues.customField.conditionCustomFieldId)),[I,v]=(0,M.useState)(!1),b=!e.isFromForm,j=x?.fieldType===Le.Checkbox,C=iy(x);return(0,i.jsx)(fl,{customErrorRef:l,initialValues:e.initialValues,render:({form:n,handleSubmit:s,submitting:r,values:y})=>{const k=(y.customField.variety===_e.Delegation||y.customField.variety===_e.UserInfo)&&m===Le.Text,A=e.isEdit||y.customField.fieldSubtype!==Ne.Freeform,w=(y.customField.variety===_e.Delegation||y.customField.variety===_e.UserInfo)&&m!==Le.Validation&&!0!==e.isFromForm,S=y.customField.variety===_e.UserInfo&&eo(c);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(hu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nj,{children:d}),(0,i.jsxs)(mu,{ref:l,children:[(0,i.jsx)(Rr.Yr,{name:"customField.fieldType",children:e=>{g(e),e===Le.Validation&&n.change("customField.isPrivate",!1)}}),(0,i.jsx)(Rr.Yr,{name:"customField.fieldSubtype",children:e=>{n.change("customField.isEncrypted",e!==Ne.Freeform)}}),(0,i.jsx)(Rr.Yr,{name:"customField.hasCondition",children:e=>{n.change("customField.conditionCustomFieldId",c[0].id),f(e)}}),(0,i.jsx)(Rr.Yr,{name:"customField.conditionCustomFieldId",children:e=>{const t=c.find(t=>t.id===e);t&&(n.change("customField.conditionValue",t.fieldType===Le.Checkbox||[]),_(t))}}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(hl,{}),(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,children:[b&&(0,i.jsxs)(yj,{label:t("typologie_34041"),name:"customField.variety",state:e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:_e.Accreditation,children:t("accr_ditations_39450")}),(0,i.jsx)("option",{value:_e.Delegation,children:t("d_l_gations_78318")}),(0,i.jsx)("option",{value:_e.Event,children:t("Event")}),(0,i.jsx)("option",{value:_e.Position,children:t("missions_63972")}),(0,i.jsx)("option",{value:_e.UserInfo,children:t("membres_11310")})]}),(0,i.jsx)(Rl,{hint:t("titre_de_la_que_69079"),label:t("nom_du_champ_48329"),name:"customField.name"}),(0,i.jsx)(Rl,{hint:t("nom_technique_u_74183"),label:(0,i.jsx)(_v,{children:t("label_08243")}),name:"customField.label"}),(0,i.jsx)(Rl,{hint:t("sous_titre_de_l_90967"),label:(0,i.jsx)(_v,{children:t("sous_titre_97472")}),name:"customField.description"}),(0,i.jsx)(yj,{label:t("type_35427"),name:"customField.fieldType",state:e.isEdit?"disabled":"active",children:o(cn)}),y.customField.fieldType===Le.Text&&(0,i.jsx)(yj,{label:t("sous_type_de_ch_73883"),name:"customField.fieldSubtype",state:e.isEdit?"disabled":"active",children:o(dn)}),(0,i.jsx)(Mm,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"customField.customFieldCategoryId",placeholder:t("rechercher_ou_c_16469"),onCreateClick:()=>{v(!0)},children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),m===Le.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(TS,{change:n.change,isEdit:e.isEdit,isSelectV2:e.isSelectV2,values:y.customField.values}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("est_ce_qu_il_es_10680")}),(0,i.jsx)($m,{disabled:e.isEdit,name:"customField.canSelectMultiple",children:t("oui_il_est_pos_25233")})]})]}),m===Le.Validation&&(0,i.jsx)(vj,{accept:[lv.Images,lv.Pdf],acl:"public-read",label:(0,i.jsx)(_v,{children:t("document_87149")}),organizationId:e.organizationId,prefix:"customField.document."}),k&&(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("chiffrement_des_84602")}),(0,i.jsx)(Bm,{disabled:A,name:"customField.isEncrypted",subtext:t("seuls_les_4_der_85542"),children:t("les_donn_es_son_85588")})]}),w&&(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("ce_champ_est_il_98722")}),(0,i.jsx)($m,{name:"customField.isPrivate",children:t("oui_le_champ_n_99925")})]}),S&&(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("l_affichage_de_99189")}),(0,i.jsx)($m,{name:"customField.hasCondition",children:t("oui_le_champ_d_00513")})]}),p&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",gap:"4",children:[(0,i.jsx)(Mm,{isSearchVisible:!0,label:t("nom_du_champ_do_17104"),name:"customField.conditionCustomFieldId",children:c.map(e=>(0,i.jsx)("option",{value:e.id,children:Nk(e)},e.id))}),x&&(0,i.jsx)(i.Fragment,{children:j?(0,i.jsxs)(yj,{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)(Mm,{isSearchVisible:!0,label:t("pour_quelle_val_60529",x.name),multiple:!0,name:"customField.conditionValue",children:C},x.id)})]})]})]}),(0,i.jsx)(Ba,{height:"7"})]}),(0,i.jsx)(gu,{children:(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:r,onClick:s,children:e.isEdit?t("mettre_jour_l_31784"):t("cr_er_le_champ_05516")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]}),I&&(0,i.jsx)(wC,{initialName:"",isEdit:!1,mutate:async t=>{const{customFieldCategoryCreate:n}=await a({organizationId:e.organizationId,category:{name:t}});return n},onClose:()=>{v(!1)},onSuccess:e=>{h(AC([...u,e])),n.change("customField.customFieldCategoryId",e.id)}})]})},validate:r.validateForForm(s.createUpdateCustomFieldSchema()),onSubmit:async i=>{const{customField:s}=await e.mutate({organizationId:e.organizationId,customField:{...i.customField,description:i.customField.description||""}});n(e.isEdit?t("le_champ_person_31517"):t("le_champ_person_90348")),e.onClose(),e.onSuccess(s)}})},OS=e=>{const{organizationId:t}=Zn(),n=Gn(ES),{data:s,loader:o}=Yn("query OrganizationInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n }\n}\n",{organizationId:e.organizationId},[Ms.CreateCustomFieldInfosFragment]);const{mutate:r}=function(e={}){return Kn("mutation CustomFieldCreate($organizationId: OrganizationId!, $customField: CustomFieldInput!) {\n customField: customFieldCreate(organizationId: $organizationId, customField: $customField) {\n id\n name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return o?(0,i.jsx)(SS,{returnPathFallback:Os.CUSTOM_FIELDS(t)}):(0,i.jsx)(zS,{customFieldId:null,initialValues:{customField:n.customFieldInputDefault(null,s.organization.customFieldsCategories.nodes)},isEdit:!1,isFromForm:e.isFromForm,isSelectV2:!0,mutate:r,organization:s.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},RS=e=>{const{organizationId:t}=Zn(),n=Gn(ES),{data:s,loader:o}=Yn("query CustomFieldToEdit($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n\n customField(id: $customFieldId) {\n name\n label\n customFieldCategoryId\n description\n variety\n fieldType\n fieldSubtype\n isPrivate\n hasCondition\n conditionCustomFieldId\n canSelectMultiple\n conditionValue\n isSelectV2\n isEncrypted\n\n document {\n acl\n name\n key\n }\n\n values {\n id\n value\n }\n }\n }\n}\n",{organizationId:e.organizationId,customFieldId:e.customFieldId},[Ms.CreateCustomFieldInfosFragment]);const{mutate:r}=function(e={}){return Kn("mutation CustomFieldUpdate(\n $organizationId: OrganizationId!\n $customFieldId: CustomFieldId!\n $customField: CustomFieldInput!\n) {\n customField: customFieldUpdate(\n organizationId: $organizationId\n customFieldId: $customFieldId\n customField: $customField\n ) {\n id\n name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return o?(0,i.jsx)(SS,{returnPathFallback:Os.CUSTOM_FIELDS(t)}):(0,i.jsx)(zS,{customFieldId:e.customFieldId,initialValues:{customField:n.customFieldInputDefault(s.organization.customField,s.organization.customFieldsCategories.nodes)},isEdit:!0,isSelectV2:s.organization.customField.isSelectV2,mutate:t=>r({...t,customFieldId:e.customFieldId}),organization:s.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},$S=e=>{const{params:{organizationId:t,customFieldId:n}}=cl();return(0,i.jsx)(RS,{customFieldId:n,organizationId:t,...e})},DS=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.initialName);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("nouvelle_sectio_88105")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("ajouter_des_sec_58545")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ol,{label:t("nom_de_la_secti_38728"),value:n,onChange:s}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{onClick:()=>{e.onAdd(n),e.onClose()},children:m(e.initialName)?t("renommer_la_sec_00650"):t("cr_er_la_sectio_96175")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},PS=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.initialText);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("champ_texte_lib_91587")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("ajouter_des_cha_68672")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(Ev,{initialValue:n,onChange:s})}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{onClick:()=>{e.onAdd(n),e.onClose()},children:m(e.initialText)?t("mettre_jour_l_69246"):t("ajouter_le_cham_74670")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},FS=e=>{const{translate:t,params:{organizationId:n}}=cl(),{canCustomFieldEdit:s}=lS(),[o,r]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(uu.sx,{draggableId:e.elementId,index:e.index,children:n=>(0,i.jsxs)(Ra,{align:"center",css:{bd:!0,padding:"$4 $6",...e.css},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Ib,{permissions:xb.FORM_EDIT,children:(0,i.jsx)(br,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:e.field.name}),e.field.conditionCustomField&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Ya,{icon:"split"})})}),(0,i.jsx)(_m,{placement:"top",children:t("ce_champ_d_pend_31209",e.field.conditionCustomField?.name)})]})]}),(0,i.jsx)(br,{color:"gray500",children:t(e.field.fieldType)})]}),(0,i.jsxs)(Ib,{permissions:xb.FORM_EDIT,children:[(0,i.jsx)(xu,{value:e.isMandatory,onChange:t=>{e.toggleIsMandatory(e.index,t)},children:t("obligatoire_35326")}),(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(e.index)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("supprimer_le_ch_99740")})]}),e.showEdit&&s&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{r(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_le_champ_78018")})]})]})]})]})}),o&&(0,i.jsx)(RS,{customFieldId:e.field.id,organizationId:n,onClose:()=>{r(!1)},onSuccess:e.updateCustomField})]})},MS=e=>{const{translate:t}=cl(),[n,s]=M.useState(e.element.conditionCustomFieldId),[o,r]=M.useState(e.element.conditionValue),a=t=>{const n=e.conditionCustomFields.find(e=>e.id===t);n&&(r(n.fieldType===Le.Checkbox||[]),s(t))},l=e.conditionCustomFields.find(e=>e.id===n),d=null!==n&&("boolean"==typeof o||eo(o)),c=iy(l);return(0,i.jsx)(ub,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"split",children:t("ajouter_une_con_66324")}),(0,i.jsxs)(lb,{gap:"4",children:[(0,i.jsx)(fc,{isSearchVisible:!0,label:t("champ_sur_leque_68198"),renderOnPortal:!0,values:n?[n]:[],onChange:e=>{eo(e)?a(e[0]):a(null)},children:e.conditionCustomFields.map(e=>(0,i.jsx)("option",{value:e.id,children:Nk(e)},e.id))}),l&&(0,i.jsx)(i.Fragment,{children:l.fieldType===Le.Checkbox?(0,i.jsxs)(Au,{label:t("pour_quelle_val_60529",l.name),shouldParseAsBoolean:!0,value:o,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("pour_quelle_val_60529",l.name),multiple:!0,renderOnPortal:!0,values:o,onChange:r,children:c},l.id)})]}),(0,i.jsxs)(ab,{hideCancelButton:!0,children:[(0,i.jsx)(jl,{disabled:!d,onClick:()=>{e.onConditionAdd(e.index,n,o),e.onClose()},children:t("ajouter_une_con_66324")}),(0,i.jsx)(jl,{color:"white",onClick:()=>{e.onConditionDelete(e.index),e.onClose()},children:t("supprimer_la_co_57888")})]})]})})},NS=e=>{const t=Hn(),[n,s]=(0,M.useState)(!1),[o,r]=(0,M.useState)(!1),a=(0,M.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(uu.sx,{draggableId:e.element.id,index:e.index,children:n=>(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray900",bd:"gray900 2",color:"white",marginBottom:"$2",marginTop:"$5",padding:"$4 $6"},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Ib,{permissions:xb.FORM_EDIT,children:(0,i.jsx)(br,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ra,{css:{flex:"1"},gap:"2",children:[(0,i.jsx)(br,{fontWeight:"semiBold",children:e.element.section||""}),a&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"white",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Ya,{icon:"split"})})}),(0,i.jsx)(_m,{placement:"top",children:t("cette_section_d_50768",a.name)})]})]}),(0,i.jsx)(Ib,{permissions:xb.FORM_EDIT,children:(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(_m,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(_m,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(_m,{placement:"top",children:t("renommer_42135")})]})]})})]})}),n&&(0,i.jsx)(DS,{initialName:e.element.section||"",onAdd:t=>{e.onRename(e.index,t)},onClose:()=>{s(!1)}}),o&&(0,i.jsx)(MS,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},LS=e=>{const t=Hn(),[n,s]=(0,M.useState)(!1),[o,r]=(0,M.useState)(!1),a=(0,M.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(uu.sx,{draggableId:e.element.id,index:e.index,children:n=>(0,i.jsxs)(Ra,{align:"center",css:{bd:!0,padding:"$4 $6"},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Ib,{permissions:xb.FORM_EDIT,children:(0,i.jsx)(br,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ra,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(br,{children:(0,i.jsx)(hg,{text:e.element.text||""})}),a&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Ya,{icon:"split"})})}),(0,i.jsx)(_m,{placement:"top",children:t("ce_texte_d_pend_87251",a.name)})]})]}),(0,i.jsx)(Ib,{permissions:xb.FORM_EDIT,children:(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(_m,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(_m,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]})]})})]})}),n&&(0,i.jsx)(PS,{initialText:e.element.text||"",onAdd:t=>{e.onEdit(e.index,t)},onClose:()=>s(!1)}),o&&(0,i.jsx)(MS,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},BS=e=>{const t=(0,M.useMemo)(()=>Object.fromEntries(e.customFields.map(e=>[e.id,e])),[e.customFields]),n=(0,M.useMemo)(()=>e.customFields.filter(e=>[Le.Checkbox,Le.Country,Le.Language,Le.Nationality,Le.Select].includes(e.fieldType)),[e.customFields]);return(0,i.jsx)(uu.JY,{onDragEnd:e.onDragEnd,children:(0,i.jsx)(uu.gL,{droppableId:"1",children:s=>(0,i.jsxs)(Ra,{direction:"column",gap:"3",width:1,...s.droppableProps,ref:s.innerRef,children:[e.elements.map((s,o)=>{switch(s.elementType){case Ue.Field:return(0,i.jsx)(FS,{elementId:s.id,field:t[s.customFieldId],index:o,isMandatory:s.isMandatory,showEdit:!0,toggleIsMandatory:e.fieldsToggleMandatory,updateCustomField:e.updateCustomField,onDelete:e.onDelete},s.id);case Ue.Section:return(0,i.jsx)(NS,{conditionCustomFields:n,element:s,index:o,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onRename:e.sectionOnRename},s.id);case Ue.Text:return(0,i.jsx)(LS,{conditionCustomFields:n,element:s,index:o,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onEdit:e.textOnEdit},s.id);default:return nl(s.elementType)}}),s.placeholder]})})})},VS=e=>{const{translate:t,params:{organizationId:n}}=cl(),{isOrganizationAdmin:s}=_I(),[o,r]=M.useState(!1),[a,l]=M.useState(!1),[d,c]=M.useState(!1),[u,h]=M.useState(e.customFields),m=M.useMemo(()=>new Set(e.elements.flatMap(e=>e.elementType===Ue.Field?[e.customFieldId]:[])),[e.elements]),g=M.useCallback(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.setElements(so(e.elements,n.index,i.index))},[e.elements,e.setElements]),p=M.useCallback(t=>{m.has(t.id)?e.setElements(e.elements.filter(e=>!e.customFieldId||e.customFieldId!==t.id)):e.setElements([...e.elements,{id:L(),elementType:Ue.Field,customFieldId:t.id,isMandatory:!0,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements,m]),f=M.useCallback((t,n)=>{e.setElements((0,cu.jM)(e=>{e[t].isMandatory=n}))},[e.setElements]),x=M.useCallback(t=>{e.setElements([...e.elements,{id:L(),elementType:Ue.Section,section:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),_=M.useCallback((t,n)=>{e.setElements((0,cu.jM)(e=>{e[t].section=n}))},[e.setElements]),I=M.useCallback(t=>{e.setElements([...e.elements,{id:L(),elementType:Ue.Text,text:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),v=M.useCallback((t,n)=>{e.setElements((0,cu.jM)(e=>{e[t].text=n}))},[e.setElements]),b=M.useCallback(t=>{e.setElements((0,cu.jM)(e=>{e.splice(t,1)}))},[e.setElements]),j=M.useCallback(e=>{h(u.map(t=>t.id===e.id?e:t))},[u]),C=M.useCallback((t,n,i)=>{e.setElements((0,cu.jM)(e=>{e[t].hasCondition=!0,e[t].conditionCustomFieldId=n,e[t].conditionValue=i}))},[e.setElements]),y=M.useCallback(t=>{e.setElements((0,cu.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)(br,{height:.5,width:1,children:(0,i.jsx)(xk,{subtitle:t("ajouter_des_cha_37944"),title:t("aucun_champ_ou_18338")})}):(0,i.jsx)(BS,{customFields:u,elements:e.elements,fieldsToggleMandatory:f,sectionOnRename:_,textOnEdit:v,updateCustomField:j,onConditionAdd:C,onConditionDelete:y,onDelete:b,onDragEnd:g}),(0,i.jsxs)(Ib,{permissions:xb.FORM_EDIT,children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"4",justify:0===e.elements.length?"center":"start",width:1,children:[(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:s?(0,i.jsx)(wS,{menu:(0,i.jsx)(Ld,{icon:"pen-field",onClick:()=>{c(!0)},children:t("cr_eer_un_champ_08883")}),children:t("ajouter_des_cha_35843")}):(0,i.jsx)(jl,{children:t("ajouter_des_cha_35843")})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(Zj,{customFields:u,selectedCustomFieldsIds:m,toggle:p})})]}),(0,i.jsx)(jl,{color:"white",onClick:()=>{r(!0)},children:t("ajouter_une_sec_90063")}),(0,i.jsx)(jl,{color:"white",onClick:()=>{l(!0)},children:t("ajouter_un_cham_31151")})]})]}),o&&(0,i.jsx)(DS,{initialName:"",onAdd:x,onClose:()=>{r(!1)}}),a&&(0,i.jsx)(PS,{initialText:"",onAdd:I,onClose:()=>{l(!1)}}),d&&(0,i.jsx)(OS,{isFromForm:!0,organizationId:n,onClose:()=>{c(!1)},onSuccess:async t=>{h([...u,t]),setTimeout(()=>{p(t),e.onSave()}),c(!1)}})]})},US=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$2",height:76,width:1})]}),WS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=cl(),{data:r,isLoading:a}=Yn("query FormElements($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n ...FormCustomFields\n\n form(id: $formId) {\n name\n\n elements {\n ...FormElementsElement\n }\n }\n }\n}\n",{organizationId:n,formId:o},[Ms.FormCustomFieldsFragment,Ms.FormElementsElementFragment]);Td(r.organization?.form.name??"");const{mutate:l,isLoading:d}=function(e={}){return Kn("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,M.useState)([]),[h,m]=(0,M.useState)(""),g=(0,M.useCallback)(async()=>{await l({organizationId:n,eventId:s,formId:o,elements:c.map((e,t)=>({id:e.id,elementType:e.elementType,customFieldId:e.customFieldId,section:e.section,text:e.text,isMandatory:e.isMandatory,hasCondition:e.hasCondition,conditionCustomFieldId:e.conditionCustomFieldId,conditionValue:e.conditionValue,index:t}))}),m(JSON.stringify(c))},[l,c]),[p,f]=(0,M.useState)(!1),x=(0,M.useCallback)(()=>{JSON.stringify(c)===h?e.push(Fi.FORMS({organizationId:n,eventId:s})):f(!0)},[c,h]);return(0,M.useEffect)(()=>{u(r.organization?.form.elements??[]),m(JSON.stringify(r.organization?.form.elements??[]))},[r.organization]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jS,{button:(0,i.jsx)(jl,{isLoading:d,onClick:g,children:t("enregistrer_06519")}),title:r.organization?.form.name??"-",onClose:x,children:(0,i.jsx)(Ra,{justify:"center",width:1,children:(0,i.jsxs)(Ra,{direction:"column",width:"$container",children:[(0,i.jsx)(Ba,{height:"8"}),a?(0,i.jsx)(US,{}):(0,i.jsx)(VS,{customFields:r.organization.formCustomFields.nodes,elements:c,setElements:u,onSave:g}),(0,i.jsx)(Ba,{height:"8"})]})})}),(0,i.jsx)(kS,{fallbackPath:Fi.FORMS({organizationId:n,eventId:s}),isOpen:p,onClose:()=>{f(!1)}})]})},GS=e=>(0,i.jsx)(Tc,{css:{background:e.isSelected?"$primary100":"white",cursor:"pointer","&:hover":{background:"$gray100"}},onClick:e.onClick,children:(0,i.jsxs)(yc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",children:e.title}),(0,i.jsx)(br,{color:"gray500",children:e.subtitle})]})});let HS=class extends Pl{constructor(e){super(e)}emailTemplateDefault(e,t,n,i,s){const o=this.emailTypeToDefault(e,t,i,s);return n&&(o.subject=n.subject,o.content=n.content),{useDefault:n?.useDefault??!0,emailType:e,emailSenderId:n?.emailSenderId,attachments:n?.attachments??[],...o}}emailTemplateSchema(){return d.Ik().shape({useDefault:d.zM().required(""),emailType:d.Yj().required(this.t("le_type_d_e_mai_84281")).oneOf(rn,this.t("le_type_d_e_mai_84281")),subject:d.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),content:d.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===Te.Code)||this.parent.content.includes("{code}")})}),attachments:d.YO().of(d.Yj())})}updateEmailTemplateSchema(){return d.Ik().shape({emailTemplate:this.emailTemplateSchema()})}emailTypeToDefault(e,t,n,i){switch(e){case Te.Accreditations:return this.accreditationsDefault();case Te.AccreditationsRefused:return this.accreditationsRefusedDefault();case Te.Assignments:return this.assignmentsDefault();case Te.Code:return this.codeDefault(n,i);case Te.FormInvite:return this.formInviteDefault();case Te.FormSubmit:return this.formSubmitDefault(n);case Te.NotifyLeaders:return this.notifyLeadersDefault(t);case Te.DelegationCategoryLeaderAssign:return this.delegationCategoryLeaderAssign(t);case Te.DelegationFormInvite:return this.delegationFormInviteDefault();case Te.DelegationLeaderAssign:return this.delegationLeaderAssign();case Te.PositionCategoryLeaderAssign:return this.positionCategoryLeaderAssignDefault(t);case Te.PositionLeaderAssign:return this.positionLeaderAssign(t);case Te.Refused:return this.refusedDefault();case Te.VolunteerRegistration:return this.volunteerRegistrationDefault();case Te.Campaign:case Te.DelegationsImport:case Te.EventsImport:case Te.FilesImport:case Te.Documents:case Te.EventInvite:case Te.Export:case Te.MembersImport:case Te.NewMember:case Te.OrganizationInvite:case Te.PositionsImport:throw new Error("Impossible to change this email");default:return nl()}}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,pd)}}delegationCategoryLeaderAssign(e){return{subject:this.t("_event_name_69973"),content:this.t("_p_bonjour_use_97817",pd,e.href,pd)}}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",pd,e.href,pd)}}positionLeaderAssign(e){return{subject:this.t("_event_name_60486"),content:this.t("leader_assign_default_1",pd,e.href,pd)}}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")}}};HS=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],HS);const qS=e=>{const{history:t,translate:n}=cl(),{organization:s}=_I(),{event:o}=Jv(),{data:r,loader:a}=Yn("query EmailTemplate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId\n $source: LoginCodeSource\n $emailType: EmailType!\n) {\n organization(id: $organizationId) {\n emailsSenders {\n id\n name\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n\n emailTemplate(emailType: $emailType, eventId: $eventId, formId: $formId, source: $source) {\n emailType\n useDefault\n subject\n content\n emailSenderId\n attachments\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailType:e.emailType},[]);const{mutate:l,isLoading:d}=function(e={}){return Kn("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=Gn(HS),u=Gn(Da),h=o?.useDocuments&&(e.emailType===Te.Accreditations||e.emailType===Te.Assignments||e.emailType===Te.FormSubmit&&e.eventId);return a||(0,i.jsx)(fl,{direction:"column",initialValues:{emailTemplate:c.emailTemplateDefault(e.emailType,D.HEAVENT_APP_URL,r.organization.emailTemplate,e.eventId,e.formId)},render:({handleSubmit:o,values:a})=>(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("contenu_de_l_e_19848")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)($m,{name:"emailTemplate.useDefault",children:n("utiliser_le_mod_93521")}),(0,i.jsx)(Ba,{height:"6"}),!a.emailTemplate.useDefault&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rl,{label:n("sujet_de_l_e_ma_66809"),name:"emailTemplate.subject"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Mm,{hint:n("cet_metteur_se_80394"),isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(_v,{children:n("_metteur_de_l_e_51616")}),name:"emailTemplate.emailSenderId",onCreateClick:()=>{t.push(Os.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)(Ba,{height:"6"}),(0,i.jsx)(Tv,{hint:(0,i.jsx)(br,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_de_l_e_19848"),name:"emailTemplate.content"}),(0,i.jsx)(Ba,{height:"6"}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mm,{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)),s.customBadges.map(e=>(0,i.jsx)("option",{value:e,children:z_(e)},e)),HI.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]}),(0,i.jsx)(Ba,{height:"6"})]})]}),(0,i.jsx)(Ib,{permissions:xb.EMAIL_EDIT,children:(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:d,onClick:o,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})}})},YS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=cl(),{data:r}=ia({organizationId:n,formId:o});Td(r.organization?.form.name??"");const[a,l]=(0,M.useState)(Te.FormSubmit);return(0,i.jsx)(jS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Fi.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsx)(Ra,{justify:"center",width:1,children:(0,i.jsxs)(Ra,{direction:"column",width:"$container",children:[(0,i.jsx)(Ba,{height:"8"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Fc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(GS,{isSelected:a===Te.FormSubmit,subtitle:t("cet_e_mail_est_29404"),title:t("remplissage_du_09925"),onClick:()=>l(Te.FormSubmit)}),(0,i.jsx)(GS,{isSelected:a===Te.Code,subtitle:t("cet_e_mail_est_49525"),title:t("code_20843"),onClick:()=>l(Te.Code)}),s&&(0,i.jsx)(GS,{isSelected:a===Te.FormInvite,subtitle:t("cet_email_est_e_46197"),title:t("invitation_d_un_88753"),onClick:()=>l(Te.FormInvite)})]})]}),(0,i.jsx)(br,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ra,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(qS,{emailType:a,eventId:s,formId:o,organizationId:n,source:null})})]}),(0,i.jsx)(Ba,{height:"8"})]})})})};let KS=class extends Pl{constructor(e){super(e)}formParametersBroadcastInputDefault(e){return{segmentsIds:(e?.segments??[]).map(e=>e.segmentId),noAccessTitle:e?.noAccessTitle||"",noAccessMessage:e?.noAccessMessage||""}}formParametersBroadcastInputSchema(){return d.Ik().shape({segmentsIds:d.YO().of(d.ai())})}updateFormParametersBroadcastSchema(){return d.Ik().shape({form:this.formParametersBroadcastInputSchema()})}};KS=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],KS);const ZS=({children:e,isActive:t,replace:n=!0,to:s})=>{const o=Jn(),r=t?.(o.pathname)??o.pathname===s;return(0,i.jsx)(br,{css:{background:r?"$primary100":"transparent",borderRadius:"6px",color:r?"$primary700":"$gray500",cursor:r?"default":"pointer",padding:"$2 $3"},children:(0,i.jsx)(Ha,{replace:n,to:s,children:e})})},XS=e=>(0,i.jsx)(Ra,{"aria-orientation":"vertical",as:Ta.Nav,direction:"column",gap:"2",role:"menubar",width:1,children:e.children}),JS=e=>{const{translate:t,params:n}=cl(),{hasFeature:s}=_I(),{event:o}=Jv();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(id,{css:{py:"$8"},gridtemplatecolumns:"1fr 210px 80px 880px 1fr",gridtemplaterows:"1fr",width:1,children:[(0,i.jsx)(br,{css:{gridColumn:"2 / 3"},children:(0,i.jsxs)(XS,{children:[(0,i.jsx)(ZS,{to:Fi.FORM_PARAMETERS_GENERAL(n),children:t("g_n_ral_64953")}),(0,i.jsx)(ZS,{to:Fi.FORM_PARAMETERS_DESIGN(n),children:t("design_15043")}),n.eventId&&(0,i.jsx)(ZS,{to:Fi.FORM_PARAMETERS_AVAILABILITIES(n),children:t("disponibilit_s_49923")}),n.eventId&&o.usePositions&&(0,i.jsx)(ZS,{to:Fi.FORM_PARAMETERS_MISSIONS(n),children:t("missions_63972")}),n.eventId&&o.useAccreditations&&s(Fe.Accreditation)&&(0,i.jsx)(ZS,{to:Fi.FORM_PARAMETERS_ACCREDITATIONS(n),children:t("accr_ditations_39450")}),(0,i.jsx)(ZS,{to:Fi.FORM_PARAMETERS_BROADCAST(n),children:t("diffusion_56689")}),(0,i.jsx)(ZS,{to:Fi.FORM_PARAMETERS_STATE(n),children:t("cl_turer_88223")})]})}),(0,i.jsx)(br,{css:{gridColumn:"4 / 5"},width:1,children:e.children})]}),(0,i.jsx)(kS,{fallbackPath:Fi.FORMS({organizationId:n.organizationId,eventId:n.eventId}),isOpen:e.isNotSavedOpen,onClose:e.onNotSavedClose})]})};function QS(e,t,n){const{history:i,params:{organizationId:s,eventId:o}}=cl(),[r,a]=(0,M.useState)(!1),[l,d]=(0,M.useState)(JSON.stringify(e)),c=(0,M.useCallback)(()=>{const e=JSON.stringify(t);l===e?i.push(Fi.FORMS({organizationId:s,eventId:o})):a(!0)},[l,t]),u=(0,M.useCallback)(()=>{a(!1)},[a]),h=(0,M.useCallback)(()=>{n(),d(JSON.stringify(t))},[n,t]);return(0,M.useEffect)(()=>{d(JSON.stringify(e))},[e]),{isNotSavedModalOpen:r,onClose:c,onNotSavedClose:u,onSave:h}}const eE=e=>{const t=Hn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=QS(e.initialValues,e.values,e.handleSubmit),[a,l]=M.useState(eo(e.initialValues.form.segmentsIds)),d=M.useMemo(()=>eo(e.eventSegments)&&eo(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))})]}):eo(e.eventSegments)?(0,i.jsx)(i.Fragment,{children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):eo(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 M.useEffect(()=>{l(eo(e.initialValues.form.segmentsIds))},[e.initialValues.form.segmentsIds]),(0,i.jsx)(jS,{button:(0,i.jsx)(jl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(JS,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("diffusion_du_fo_47764")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnalisez_l_57514")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("_qui_s_adresse_82507")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:a?"unchecked":"checked",onClick:()=>{l(!1),e.change("form.segmentsIds",[])},children:t("_tout_le_monde_35921")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:a?"checked":"unchecked",onClick:()=>{l(!0)},children:t("_certaines_vue_55512")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!0,name:"form.segmentsIds",children:d})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("nom_de_l_tape_85862"),name:"form.noAccessTitle"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Tv,{label:t("message_affich_57692"),name:"form.noAccessMessage"})]})]})})})},tE=e=>{const{params:{organizationId:t,eventId:n,formId:s}}=cl(),o=Gn(Da),r=Gn(KS),{mutate:a,isLoading:l}=function(e={}){return Kn("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=M.useMemo(()=>({form:r.formParametersBroadcastInputDefault(e.form)}),[e.form]);return(0,i.jsx)(fl,{direction:"column",height:1,initialValues:d,render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(eE,{change:t.change,eventSegments:e.eventSegments,handleSubmit:n,initialValues:d,isMutateLoading:l,loader:e.loader,name:e.form?.name??"",organizationSegments:e.organizationSegments,values:s}),validate:o.validateForForm(r.updateFormParametersBroadcastSchema()),width:1,onSubmit:e=>a({organizationId:t,eventId:n,formId:s,form:e.form})})},nE=()=>{const{params:{organizationId:e,formId:t}}=cl(),{data:n,loader:s}=Yn("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 Td(n.organization?.form.name??""),(0,i.jsx)(tE,{eventSegments:[],form:n.organization?.form,loader:s,organizationSegments:n.organization?.segments??[]})},iE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=cl(),{data:s,loader:o}=Yn("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 Td(s.organization?.form.name??""),(0,i.jsx)(tE,{eventSegments:s.event?.segments??[],form:s.organization?.form,loader:o,organizationSegments:s.organization?.segments??[]})};function sE(e){return{gray50:e?.gray50??mr.colors.gray50.value,gray500:e?.gray500??mr.colors.gray500.value,gray700:e?.gray700??mr.colors.gray700.value,gray800:e?.gray800??mr.colors.gray800.value,gray900:e?.gray900??mr.colors.gray900.value,primary700:e?.primary700??mr.colors.primary700.value,primary800:e?.primary800??mr.colors.primary800.value}}let oE=class extends Pl{documentInputService;constructor(e,t){super(t),this.documentInputService=e}organizationDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),logo:e?.logo??this.documentInputService.documentInputDefault(),colors:sE(e?.colors)}}formParametersDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),colors:sE(e?.colors)}}};oE=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[fj,Vn])],oE);const rE=e=>{const{translate:t}=cl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:e.title}),e.showLogo&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:t("logo_18191")}),(0,i.jsx)(Yj,{hint:t("nous_recommando_20904"),label:t("s_lectionnez_un_82734"),organizationId:e.organizationId,prefix:`${e.prefix}logo.`})]})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:t("banni_re_86634")}),(0,i.jsx)(vj,{accept:lv.Images,acl:"public-read",hint:t("taille_de_l_ima_84109"),organizationId:e.organizationId,prefix:`${e.prefix}banner.`})]}),(0,i.jsx)(Ba,{height:"10"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("charte_graphiqu_02725")}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:t("couleur_de_fond_75677")}),(0,i.jsx)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:(0,i.jsx)(_j,{initialValue:mr.colors.gray50.value,label:t("couleur_de_fond_75677"),name:`${e.prefix}colors.gray50`})})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:t("textes_07935")}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(_j,{initialValue:mr.colors.gray800.value,label:t("couleur_du_text_32021"),name:`${e.prefix}colors.gray800`}),(0,i.jsx)(_j,{initialValue:mr.colors.gray900.value,label:t("couleur_des_tit_58918"),name:`${e.prefix}colors.gray900`}),(0,i.jsx)(_j,{initialValue:mr.colors.gray500.value,label:t("couleur_des_sou_18968"),name:`${e.prefix}colors.gray500`}),(0,i.jsx)(_j,{initialValue:mr.colors.gray700.value,label:t("couleur_des_lab_38397"),name:`${e.prefix}colors.gray700`})]})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:t("boutons_35604")}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(_j,{initialValue:mr.colors.primary700.value,label:t("couleur_des_bou_24410"),name:`${e.prefix}colors.primary700`}),(0,i.jsx)(_j,{initialValue:mr.colors.primary800.value,label:t("couleur_des_bou_16515"),name:`${e.prefix}colors.primary800`})]})]})]})},aE=e=>{const t=Hn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=QS(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(jS,{button:(0,i.jsx)(jl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(JS,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsx)(rE,{organizationId:e.organizationId,prefix:"design.",showLogo:!1,title:t("images_de_votre_00576")})})})},lE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=cl(),{data:s,loader:o}=Yn("query FormParametersDesign($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n\n design {\n banner {\n acl\n name\n key\n }\n\n colors\n }\n }\n }\n}\n",{organizationId:e,formId:n},[]);Td(s.organization?.form.name??"");const r=Gn(oE),{mutate:a,isLoading:l}=function(e={}){return Kn("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=M.useMemo(()=>({design:r.formParametersDesignInputDefault(s.organization?.form.design)}),[s.organization]);return(0,i.jsx)(fl,{direction:"column",height:1,initialValues:d,render:({handleSubmit:t,values:n})=>(0,i.jsx)(aE,{handleSubmit:t,initialValues:d,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",organizationId:e,values:n}),width:1,onSubmit:i=>a({organizationId:e,eventId:t,formId:n,design:i.design})})};let dE=class extends Pl{constructor(e){super(e)}formParametersGeneralInputDefault(e){return{name:e?.name??"",setAssignmentStateToWaiting:e?.setAssignmentStateToWaiting??!1,setAccreditationStateToWaiting:e?.setAccreditationStateToWaiting??!1,allowMultiProfiles:e?.allowMultiProfiles??!1,canRefill:e?.canRefill??!1,description:e?.description||"",successMessage:e?.successMessage||"",customFields:e?.customFields||[],areTeamsAllowed:e?.areTeamsAllowed??!1,maxTeamMembers:e?.maxTeamMembers,teamMemberFillFullForm:e?.teamMemberFillFullForm??!0,emailTitle:e?.emailTitle||"",informationTitle:e?.informationTitle||"",registerButtonText:e?.registerButtonText||"",isEditableInMemberSpace:e?.isEditableInMemberSpace??!0}}formParametersGeneralInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),allowMultiProfiles:d.zM().required(),setAssignmentStateToWaiting:d.zM().required(),setAccreditationStateToWaiting:d.zM().required(),description:d.Yj(),successMessage:d.Yj(),areTeamsAllowed:d.zM().required(),maxTeamMembers:d.ai().nullable(),teamMemberFillFullForm:d.zM().required(),informationTitle:d.Yj(),registerButtonText:d.Yj()})}updateFormParametersGeneralSchema(){return d.Ik().shape({form:this.formParametersGeneralInputSchema()})}};dE=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],dE);const cE=e=>{const t=Hn(),[n,s]=M.useState(eo(e.values)),o=M.useCallback(t=>{s(t),t||e.change(e.name,[])},[e.name,e.change,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("d_finir_la_vale_27863")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("choisissez_une_24029")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(xu,{value:n,onChange:o,children:t("je_souhaite_d_f_72912")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Sj,{...e})]})]})},uE=e=>{const{translate:t,params:{eventId:n}}=cl(),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=QS(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(jS,{button:(0,i.jsx)(jl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(JS,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("initialisation_29288")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_27381")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("nom_du_formulai_14952"),name:"form.name"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("affectation_des_81808")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)($m,{name:"form.setAssignmentStateToWaiting",children:t("les_membres_ser_52180")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("accr_ditation_d_48426")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)($m,{name:"form.setAccreditationStateToWaiting",children:t("les_membres_ser_34727")})]}),(0,i.jsx)(Wu,{height:"7"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_trage_de_41992")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("donner_la_possi_56694")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:t("inscriptions_mu_35073")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Bm,{name:"form.allowMultiProfiles",children:t("autoriser_les_i_26880")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:t("remplissages_mu_72343")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Bm,{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)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:t("inscriptions_en_77739")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Bm,{name:"form.areTeamsAllowed",children:t("permettre_aux_m_56083")}),e.values.form.areTeamsAllowed&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Bm,{name:"form.teamMemberFillFullForm",children:t("tous_les_membre_59937")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("nombre_maximum_14615"),name:"form.maxTeamMembers",shouldParseAsInt:!0})]})]}),(0,i.jsx)(Wu,{height:"7"}),(0,i.jsx)(cE,{change:e.change,customFields:e.customFields,name:"form.customFields",values:e.values.form.customFields}),(0,i.jsx)(Wu,{height:"7"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_00197")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_68212")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Rl,{name:"form.emailTitle"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("description_de_80800")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("la_description_13257")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Tv,{name:"form.description"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_92536")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_66470")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Rl,{name:"form.informationTitle"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_du_bouton_05866")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_02611")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Rl,{name:"form.registerButtonText"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("message_de_succ_99510")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_55334")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Tv,{name:"form.successMessage"}),(0,i.jsx)(Wu,{height:"7"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("_dition_des_inf_90758")}),(0,i.jsx)(br,{color:"gray500",children:t("donner_la_possi_56683")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("espace_membre_06532")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Bm,{name:"form.isEditableInMemberSpace",children:t("permettre_aux_m_40630")})]})})})},hE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=cl(),{data:s,loader:o}=Yn("query FormParametersGeneral($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n form(id: $formId) {\n name\n setAssignmentStateToWaiting\n setAccreditationStateToWaiting\n allowMultiProfiles\n canRefill\n description\n successMessage\n areTeamsAllowed\n maxTeamMembers\n teamMemberFillFullForm\n emailTitle\n informationTitle\n registerButtonText\n isEditableInMemberSpace\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,formId:n},[Ms.MassEditCustomFieldFragment]);Td(s.organization?.form.name??"");const r=Gn(Da),a=Gn(dE),{mutate:l,isLoading:d}=function(e={}){return Kn("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=M.useMemo(()=>({form:a.formParametersGeneralInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(uE,{change:e.change,customFields:s.organization?.customFields.nodes??[],handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.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 mE=class extends Pl{constructor(e){super(e)}formParametersStateInputDefault(e){return{state:e?.state||He.Open,closedTitle:e?.closedTitle||"",closedMessage:e?.closedMessage||"",closedAt:e?.closedAt||null}}formParametersStateInputSchema(){return d.Ik().shape({state:d.Yj().required(this.t("cl_turer_le_for_10541")).oneOf(hn,this.t("cl_turer_le_for_10541")),closedMessage:d.Yj(),closedAt:Vm.when("state",{is:He.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 d.Ik().shape({form:this.formParametersStateInputSchema()})}};mE=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],mE);const gE=e=>{const{translate:t,params:{eventId:n}}=cl(),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=QS(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(jS,{button:(0,i.jsx)(jl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(JS,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"form.state",children:t=>{t!==He.ClosedAt&&e.change("form.closedAt",null)}}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("cl_turer_le_for_46483")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("choisir_si_le_f_14519")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Pv,{name:"form.state",value:He.Open,children:t("ne_pas_cl_turer_46870")}),(0,i.jsx)(Ba,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pv,{name:"form.state",value:He.CloseWhenEventDone,children:t("cl_turer_le_for_61719")}),(0,i.jsx)(Ba,{height:"3"})]}),(0,i.jsx)(Pv,{name:"form.state",value:He.Closed,children:t("cl_turer_le_for_10120")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.state",value:He.ClosedAt,children:t("cl_turer_le_for_19176")}),e.values.form.state===He.ClosedAt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(Ij,{name:"form.closedAt"})]})]}),e.values.form.state!==He.Open&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("nom_de_l_tape_85862"),name:"form.closedTitle"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Tv,{hint:t("ce_message_sera_03472"),label:t("message_de_cl_t_95276"),name:"form.closedMessage"})]})]})})})},pE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=cl(),{data:s,loader:o}=Yn("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},[]);Td(s.organization?.form.name??"");const r=Gn(Da),a=Gn(mE),{mutate:l,isLoading:d}=function(e={}){return Kn("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=M.useMemo(()=>({form:a.formParametersStateInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(fl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(gE,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersStateSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};function fE(e,t,n,i){return(0,Va.A)([i.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:BI.CREATE({organizationId:t})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:ji.COMMUNITY_USERS({organizationId:t})},i.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:Os.CREATE_EVENT(t)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${Ii.ORGANIZATION({organizationId:t})}/events`},i.canCustomFieldEdit&&-1!==n?{icon:"text",text:e("cr_eer_un_champ_08883"),link:Os.CREATE_CUSTOM_FIELD(t,n)}:null,i.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:Os.CUSTOM_FIELDS(t)}:null,i.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:Fi.CREATE({organizationId:t})}:null,i.canFormEdit?{icon:"file-lines",text:e("voir_les_formul_55824"),link:Fi.FORMS({organizationId:t})}:null,i.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:Os.COMMUNITY_CREATE_DELEGATION(t)}:null,i.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:as.DELEGATIONS({organizationId:t})}:null,i.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:jI.CREATE({organizationId:t})}:null,i.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:jI.CAMPAIGNS({organizationId:t})}:null,i.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:WI.CREATE({organizationId:t})}:null,i.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:WI.WORKFLOWS({organizationId:t})}:null])}function xE(e,t,n,i,s){return(0,Va.A)([s.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:BI.CREATE({organizationId:t,eventId:n})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:Os.VOLUNTEERS(t,n)},s.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:Os.CREATE_EVENT(t)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${Ii.ORGANIZATION({organizationId:t})}/events`},s.canCustomFieldEdit&&-1!==i?{icon:"text",text:e("cr_eer_un_champ_08883"),link:Os.CREATE_CUSTOM_FIELD(t,i)}:null,s.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:Os.CUSTOM_FIELDS(t)}:null,s.canPositionEdit?{icon:"sitemap",text:e("cr_er_une_missi_66818"),link:Os.CREATE_POSITION(t,n)}:null,s.canPositionRead?{icon:"sitemap",text:e("voir_les_missio_71964"),link:ms.POSITIONS({organizationId:t,eventId:n})}:null,s.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:Fi.CREATE({organizationId:t,eventId:n})}:null,s.canFormRead?{icon:"file-lines",text:e("voir_les_formul_55824"),link:Fi.FORMS({organizationId:t,eventId:n})}:null,s.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_une_accr_33475"),link:Os.CREATE_ACCREDITATION(t,n)}:null,s.canAccreditationRead?{icon:"badge-check",text:e("voir_les_accr_d_34867"),link:Ji.ACCREDITATIONS({organizationId:t,eventId:n})}:null,s.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:Os.CREATE_DELEGATION(t,n)}:null,s.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:as.DELEGATIONS({organizationId:t,eventId:n})}:null,s.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:jI.CREATE({organizationId:t,eventId:n})}:null,s.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:jI.CAMPAIGNS({organizationId:t,eventId:n})}:null,s.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:WI.CREATE({organizationId:t,eventId:n})}:null,s.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:WI.WORKFLOWS({organizationId:t,eventId:n})}:null])}function _E(e){switch(e.segmentType){case _t.Accreditations:return e.eventId?Os.ACCREDITATIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case _t.Campaigns:return jI.CAMPAIGNS_SEGMENT({organizationId:e.organizationId,segmentId:e.id});case _t.CustomFields:return Os.CUSTOM_FIELDS_SEGMENT(e.organizationId,e.id);case _t.Delegations:return e.eventId?Os.DELEGATIONS_SEGMENT(e.organizationId,e.eventId,e.id):Os.COMMUNITY_DELEGATIONS_SEGMENT(e.organizationId,e.id);case _t.Events:return Os.EVENTS_SEGMENT(e.organizationId,e.id);case _t.Positions:return e.eventId?Os.POSITIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case _t.Volunteers:return e.eventId?Os.VOLUNTEERS_SEGMENT(e.organizationId,e.eventId,e.id):Os.COMMUNITY_USERS_SEGMENT(e.organizationId,e.id);default:return nl(e.segmentType)}}const IE=e=>(0,i.jsx)(Vc,{css:{"&:hover":{textDecoration:"none"}},hideIcon:!0,to:e.link,width:1,onClick:()=>{e.onClose()},children:(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",px:"$4","&:hover":{background:"$gray100"}},gap:"2",height:40,width:1,children:[e.avatar,e.icon&&(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:e.icon})}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:e.children})]})}),vE=e=>(0,i.jsx)(Ra,{css:{px:"$4"},children:(0,i.jsx)(br,{font:"gray500 textSm medium",children:e.children})}),bE=e=>(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(vE,{children:e.title}),e.children]}),jE="h-open-omnibar",CE=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=dS(),r=lS(),[a,l]=(0,M.useState)(!1),[d,c]=(0,M.useState)(!1),[h,g,p]=Pc(""),[f,x]=(0,M.useState)([]),[_,I]=(0,M.useState)([]),[v,b]=(0,M.useState)([]),[j,C]=(0,M.useState)(-1),[y,k]=(0,M.useState)([]),[A,w]=(0,M.useState)([]),[S,E]=(0,M.useState)([]),[T,z]=(0,M.useState)([]),[O,R]=(0,M.useState)([]),[$,D]=(0,M.useState)([]),[P,F]=(0,M.useState)([]),[N,L]=(0,M.useState)(s?xE(t,n,s,j,r):fE(t,n,j,o)),B=(0,M.useMemo)(()=>to(N)&&to(f)&&to(_)&&to(v)&&to(y)&&to(A)&&to(S)&&to(T)&&to(O)&&to($)&&to(P),[N,f,_,v,y,A,S,T,O,$,P]),V=(0,M.useCallback)(()=>{L(s?xE(t,n,s,j,r):fE(t,n,j,o)),x([]),I([]),b([]),k([]),w([]),E([]),z([]),R([]),D([]),F([])},[n,s,o,r,L,x,I,b,k,w,E,z,R,D,F]),U=(0,M.useCallback)(e=>{Al(e),c(!1),p(""),V(),l(e=>!e)},[l,c,p,V]),W=(0,M.useCallback)(()=>{l(!1)},[l]);return sm("k",U),Od(W),zd(W),(0,M.useEffect)(()=>(document.addEventListener(jE,U),()=>{document.removeEventListener(jE,U)}),[U]),(0,M.useEffect)(()=>{(async()=>{if(m(g)){if(c(!0),s){const{organization:o,event:a}=await(e={organizationId:n,eventId:s,name:g},i=await q(),co('query EventOmnibar($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n organization(id: $organizationId) {\n customFields(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n events(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFieldsSegment: segments(segmentType: CustomFields) {\n id\n }\n }\n\n event(id: $eventId) {\n accreditations(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n campaigns(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n delegations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n forms(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n positions(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\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:[]}));L(xE(t,n,s,o.customFieldsSegment[0].id,r).filter(e=>u(e.text).includes(u(g)))),x(a.volunteersRegistrations.nodes.map(e=>e.userInfo)),I(r.canEventEdit?o.events.nodes:[]),b(r.canCustomFieldEdit?o.customFields.nodes:[]),C(o.customFieldsSegment[0].id),k(r.canPositionRead?a.positions.nodes:[]),w(r.canFormRead?a.forms.nodes:[]),E(r.canAccreditationRead?a.accreditations.nodes:[]),z(r.canDelegationRead?a.delegations.nodes:[]),R(r.canCampaignRead?a.campaigns.nodes:[]),D(r.canWorkflowRead?a.workflows.nodes:[]),F(a.segments)}else{const{organization:e}=await function(e,t){return co("query OrganizationOmnibar($organizationId: OrganizationId!, $name: String) {\n organization(id: $organizationId) {\n accreditations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n campaigns(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFields(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFieldsSegment: segments(segmentType: CustomFields) {\n id\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:g},await q());L(fE(t,n,j,o).filter(e=>u(e.text).includes(u(g)))),x(e.usersInfos.nodes),I(e.events.nodes),b(o.canCustomFieldRead?e.customFields.nodes:[]),C(e.customFieldsSegment[0].id),k(o.canPositionRead?e.positions.nodes:[]),w(o.canFormRead?e.forms.nodes:[]),E(o.canAccreditationRead?e.accreditations.nodes:[]),z(o.canDelegationRead?e.delegations.nodes:[]),R(o.canCampaignRead?e.campaigns.nodes:[]),D(o.canWorkflowRead?e.workflows.nodes:[]),F(e.segments)}c(!1)}else V();var e,i})()},[n,s,o,r,g,c,L,x,I,b,C,k,w,E,z,R,D,F,V]),a&&("organization"===e.level&&!s||"event"===e.level&&s)?(0,Wt.createPortal)((0,i.jsx)(Ra,{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)(Ra,{css:{background:"white",borderRadius:"$3",overflow:"hidden"},direction:"column",width:640,onClick:e=>Al(e),children:[(0,i.jsx)(br,{css:{"& .h-styled-input-container":{height:"48px"}},height:48,children:(0,i.jsx)(Ol,{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:h,onChange:p})}),(0,i.jsx)(Ra,{css:{overflowY:"auto",py:"$4"},direction:"column",height:350,children:d?(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(ec,{borderRadius:"$1",height:36}),(0,i.jsx)(ec,{borderRadius:"$1",height:36}),(0,i.jsx)(ec,{borderRadius:"$1",height:36})]}):B?(0,i.jsxs)(Ra,{align:"center",direction:"column",gap:"4",height:1,justify:"center",children:[(0,i.jsx)(Ra,{align:"center",css:{bd:!0,fontSize:"$textMd"},height:48,justify:"center",width:48,children:(0,i.jsx)(Ya,{icon:"magnifying-glass"})}),(0,i.jsx)(br,{font:"gray900 textSm semiBold",children:t("aucun_r_sultat_73664",g)})]}):(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[eo(N)&&(0,i.jsx)(bE,{title:t("actions_rapides_42479"),children:N.map((e,t)=>(0,i.jsx)(IE,{icon:e.icon,link:e.link,onClose:W,children:e.text},t))}),eo(f)&&(0,i.jsx)(bE,{title:t("membres_11310"),children:f.map(e=>(0,i.jsx)(IE,{avatar:(0,i.jsx)(qg,{email:e.email,image:e.picture?.url,name:e.name,size:24}),link:BI.MEMBER_INFORMATION({organizationId:n,eventId:s,userInfoId:e.id}),onClose:W,children:e.name},e.id))}),eo(_)&&(0,i.jsx)(bE,{title:t("Event"),children:_.map(e=>(0,i.jsx)(IE,{icon:"cake-candles",link:Bi.EVENT({organizationId:n,eventId:e.id}),onClose:W,children:e.name},e.id))}),eo(v)&&(0,i.jsx)(bE,{title:t("champs_de_formu_64126"),children:v.map(e=>(0,i.jsx)(IE,{icon:"text",link:Os.EDIT_CUSTOM_FIELD(n,j,e.id),onClose:W,children:e.name},e.id))}),eo(y)&&(0,i.jsx)(bE,{title:t("missions_63972"),children:y.map(e=>(0,i.jsx)(IE,{icon:"sitemap",link:ms.POSITION({organizationId:n,eventId:s,positionId:e.id}),onClose:W,children:e.name},e.id))}),eo(A)&&(0,i.jsx)(bE,{title:t("Form_plural"),children:A.map(e=>(0,i.jsx)(IE,{icon:"file-lines",link:Fi.FORM_ELEMENTS({organizationId:n,eventId:s,formId:e.id}),onClose:W,children:e.name},e.id))}),eo(S)&&(0,i.jsx)(bE,{title:t("accr_ditations_39450"),children:S.map(e=>(0,i.jsx)(IE,{icon:"badge-check",link:Ji.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.id}),onClose:W,children:e.name},e.id))}),eo(T)&&(0,i.jsx)(bE,{title:t("d_l_gations_78318"),children:T.map(e=>(0,i.jsx)(IE,{icon:"users",link:as.DELEGATION({organizationId:n,eventId:s,delegationId:e.id}),onClose:W,children:e.name},e.id))}),eo(O)&&(0,i.jsx)(bE,{title:t("Campaigns"),children:O.map(e=>(0,i.jsx)(IE,{icon:"paper-plane",link:jI.CAMPAIGN_DASHBOARD({organizationId:n,eventId:s,campaignId:e.id}),onClose:W,children:e.name},e.id))}),eo($)&&(0,i.jsx)(bE,{title:t("automatisations_60045"),children:$.map(e=>(0,i.jsx)(IE,{icon:"hand-sparkles",link:WI.UPDATE({organizationId:n,eventId:s,workflowId:e.id}),onClose:W,children:e.name},e.id))}),eo(P)&&(0,i.jsx)(bE,{title:t("vues_personnali_80652"),children:P.map(e=>(0,i.jsx)(IE,{link:_E(e),onClose:W,children:e.name},e.id))})]})})]})}),document.body):null},yE=(0,M.memo)(function(){const{translate:e}=cl(),{pathname:t}=Jn(),{organization:n,selectedEventId:s}=_I(),[o,r]=(0,M.useState)(!1),a=t===Bi.EVENTS({organizationId:n.id})||null!==t.match(/\/events/)||null!==t.match(/\/event\/\d+/),l=(0,ic.A)(n.events.nodes.filter(e=>e.state===$e.Ongoing||e.state===$e.Upcoming),e=>e.name),d=n.events.nodes.find(e=>e.id===s);return(0,i.jsxs)(Pd,{onStateChange:r,children:[(0,i.jsx)(Ud,{children:(0,i.jsxs)(Ra,{align:"center","aria-expanded":o,"aria-label":e("ouvrir_la_liste_52670"),"aria-selected":o,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"),o?(0,i.jsx)(Ya,{icon:"angle-up"}):(0,i.jsx)(Ya,{icon:"angle-down"})]})}),(0,i.jsxs)(Vd,{"aria-orientation":"vertical",id:"events-menu",maxHeight:300,offset:-10,placement:"bottom-start",children:[(0,i.jsx)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",children:l.map(e=>(0,i.jsx)(Nd,{to:Bi.EVENT({organizationId:n.id,eventId:e.id}),onClick:e=>{$d(e.target),document.getElementById("main")?.focus()},children:e.name},e.id))}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Nd,{to:Bi.EVENTS({organizationId:n.id}),onClick:e=>{$d(e.target),document.getElementById("main")?.focus()},children:e("tous_les_v_nem_16033")})]})]})});var kE,AE;function wE(){return wE=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{translate:t,params:{eventId:n}}=cl(),{organization:s}=_I(),o=(0,M.useMemo)(()=>{let t=`https://admin.${D.WEEZEVENT_DOMAIN}/ticket/O${e.weezeventOrganizationId}`;if(n){const e=s.events.nodes.find(e=>e.id===n);"number"==typeof e?.weezeventEventId&&(t+=`/E${e.weezeventEventId}`)}return t},[n,s]),r=`https://admin.${D.WEEZEVENT_DOMAIN}/access/O${e.weezeventOrganizationId}`,a=`https://admin.${D.WEEZEVENT_DOMAIN}/pay/#!/${e.weezeventOrganizationId}`;return(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Ra,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",children:(0,i.jsx)(Ra,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(Ya,{icon:"grid",iconStyle:"solid"})})})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Ra,{css:{padding:"$3 $4"},direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("passer_75488")}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(Ha,{to:o,children:(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(br,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(PE,{})}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:"WeezTicket"}),(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:t("billetterie_53780")})]})]})}),(0,i.jsx)(Ha,{to:r,children:(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(br,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(SE,{})}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:"WeezAccess"}),(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:t("contr_le_d_acc_03854")})]})]})}),(0,i.jsx)(Ha,{to:a,children:(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(br,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(OE,{})}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:"WeezPay"}),(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:"Cashless"})]})]})})]})]})})]})},ME=({to:e,children:t,isActive:n,onClick:s})=>{const{pathname:o}=Jn(),r=n?n(o):e===o;return(0,i.jsx)(Ra,{"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)(Ha,{height:1,to:e,width:1,onClick:s,children:t})})},NE=M.memo(function(){const{translate:e,params:{organizationId:t}}=cl(),{organization:n,roles:s,user:o,updateLocalOrganization:r}=_I(),{data:a}=oa({}),[l,d]=M.useState(!1),c=M.useMemo(()=>{const e=(0,nc.A)(a.user?.roles??[],e=>e.organizationId);return(0,ic.A)((a.organizations||[]).filter(t=>eo(e[t.id])),e=>e.name)},[a.organizations,a.user]),u=(0,M.useMemo)(()=>eo(s.organizationRoles),[s]);return(0,i.jsxs)(Ra,{align:"center",css:{background:mr.colors.blueGray900.value,color:"white",cursor:"pointer",position:"relative",px:"$6"},height:1,justify:"between",width:1,children:[(0,i.jsx)(Ra,{align:"center","aria-label":e("page_d_accueil_12532"),css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(Ha,{height:1,to:Bi.EVENTS({organizationId:t}),children:(0,i.jsx)(Yl,{})})}),(0,i.jsx)(Ra,{"aria-label":e("menu_de_l_organ_58508"),as:Ta.Nav,height:1,children:(0,i.jsxs)(Ra,{align:"center",justify:"center",role:"menubar",children:[(0,i.jsx)(yE,{}),(0,i.jsx)(Ib,{permissions:xb.CUSTOM_FIELD_READ,children:(0,i.jsx)(ME,{isActive:e=>e.startsWith(Os.CUSTOM_FIELDS(t)),to:Os.CUSTOM_FIELDS(t),onClick:async()=>await r({customFieldsSegmentId:null}),children:e("champs_de_formu_64126")})}),u&&(0,i.jsx)(ME,{isActive:e=>e.startsWith(ji.COMMUNITY({organizationId:t})),to:ji.COMMUNITY_USERS({organizationId:t}),children:e("communaut_20896")}),(0,i.jsx)(ME,{isActive:e=>e.startsWith(Os.ORGANIZATION_PARAMETERS(t)),to:Os.ORGANIZATION_PARAMETERS_PROFILE(t),children:e("param_tres_78420")})]})}),(0,i.jsxs)(Ra,{align:"center",gap:"6",justify:"end",width:300,children:["number"==typeof n.weezeventOrganizationId&&(0,i.jsx)(FE,{weezeventOrganizationId:n.weezeventOrganizationId}),(0,i.jsxs)(Pd,{"aria-label":e("menu_utilisateu_40033"),"aria-orientation":"vertical",isOpen:l,onStateChange:d,children:[(0,i.jsx)(Ud,{children:(0,i.jsxs)(Ra,{align:"center","aria-expanded":l,"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)(qg,{email:o.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:32}),(0,i.jsxs)(br,{css:{maxWidth:"calc(100% - 66px)"},children:[(0,i.jsx)(br,{css:{ellipsis:!0},fontWeight:"semiBold",children:o.userInfo.firstName||o.email}),(0,i.jsx)(br,{css:{ellipsis:!0},fontSize:"textXs",children:n.name})]}),(0,i.jsx)("div",{children:l?(0,i.jsx)("i",{className:"far fa-angle-up"}):(0,i.jsx)("i",{className:"far fa-angle-down"})})]})}),(0,i.jsxs)(Vd,{"aria-orientation":"vertical",id:"user-menu",maxHeight:500,placement:"bottom-end",width:300,children:[(0,i.jsx)(Nd,{children:(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(qg,{email:o.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:32}),(0,i.jsxs)(br,{css:{width:"calc(100% - 44px)"},children:[(0,i.jsx)(br,{css:{ellipsis:!0},fontWeight:"semiBold",children:o.userInfo.name||o.email}),m(o.userInfo.name)&&(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},children:o.email})]})]})}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Ra,{as:Ta.Nav,direction:"column",role:"menubar",children:[c.map(({id:e,name:t})=>(0,i.jsx)(Nd,{onClick:async()=>{await r({eventsSegmentId:null}),location.href=`${D.HEAVENT_APP_URL.pathname}${Bi.EVENTS({organizationId:e})}`,document.getElementById("main")?.focus()},children:t},e)),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Ib,{rolesTypes:uI,children:[(0,i.jsx)(Nd,{to:Os.ORGANIZATION_PARAMETERS_PROFILE(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("mon_profil_48224")}),(0,i.jsx)(Nd,{to:Os.ORGANIZATION_PARAMETERS_INFOS(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("organisation_71863")}),(0,i.jsx)(Nd,{to:Os.ORGANIZATION_PARAMETERS_TEAM(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("utilisateurs_04975")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"})]}),Nc(o.email)&&(0,i.jsx)(Nd,{to:Os.BACKOFFICE,onClick:()=>{document.getElementById("main")?.focus()},children:e("back_office_83072")}),(0,i.jsx)(Nd,{color:"red",onClick:K,children:e("se_d_connecter_74151")})]})]})]})]})]})}),LE=[1033,1538,1787,2574,2954,3059],BE=e=>{const t=Hn(),{organizationId:n}=Zn(),s=Jn(),{organization:o}=_I(),[r,a]=M.useState(!1),l=function(e){return Math.ceil(e.periodEndAt.diff(Bs.c9.utc(),"days").days)}(o),d=(c=l)>0&&c<=15;var c;const u=o.invoices.length>0,h=M.useCallback(()=>{a(!0)},[a]);if(M.useEffect(()=>(document.addEventListener(lo,h),()=>{document.removeEventListener(lo,h)}),[]),o.isBlocked&&!s.pathname.endsWith(fi))return(0,i.jsx)(ei,{path:Ii.IS_BLOCKED(Ii.ORGANIZATION({organizationId:n}))});if(!o.isBlocked&&s.pathname.endsWith(fi))return(0,i.jsx)(ei,{path:Ii.ORGANIZATION({organizationId:n})});if(l<=0&&!s.pathname.endsWith(xi))return(0,i.jsx)(ei,{path:Ii.IS_EXPIRED(Ii.ORGANIZATION({organizationId:n}))});if(l>0&&s.pathname.endsWith(xi))return(0,i.jsx)(ei,{path:Ii.ORGANIZATION({organizationId:n})});{const s=u&&!LE.includes(n),c=64+(r?40:0)+(d||s?64:0);return(0,i.jsxs)(Ra,{css:{overflow:"hidden"},direction:"column",height:1,role:"presentation",width:1,children:[r&&(0,i.jsxs)(Ra,{align:"center",css:{background:"$primary700",px:"$6"},gap:"1",height:40,justify:"between",role:"alert",width:1,children:[(0,i.jsx)(br,{}),(0,i.jsxs)(Ra,{gap:"1",children:[(0,i.jsx)(br,{color:"white",children:t("une_nouvelle_ve_69718")}),(0,i.jsx)(br,{color:"white",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{window.location.reload()},children:t("cliquez_pour_re_36838")})]}),(0,i.jsx)(br,{color:"white",css:{cursor:"pointer"},fontSize:"textMd",onClick:()=>{a(!1)},children:(0,i.jsx)(Ya,{icon:"xmark"})})]}),d&&!s&&(0,i.jsx)(Ra,{align:"center",css:{background:"$primary700",color:"white"},dangerouslySetInnerHTML:{__html:`

${t("trial_remaining_days",l,`${D.EMAIL_FROM}`,pd)}

`},height:64,justify:"center",width:1}),s&&(0,i.jsx)(Ra,{align:"center",css:{background:"$primary700",color:"white","& > a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:t("sauf_erreur_de_03325",o.invoices[0].url,o.invoices[0].invoiceNumber)},height:64,justify:"center",width:1}),(0,i.jsx)(br,{as:Ta.Header,height:64,width:1,children:(0,i.jsx)(NE,{})}),(0,i.jsx)(br,{as:Ta.Main,css:{height:`calc(100% - ${c}px)`},id:"main",tabIndex:-1,width:1,children:e.children}),(0,i.jsx)(CE,{level:"organization"})]})}};let VE=class extends Pl{countriesService;documentInputService;fieldInputService;phoneInputService;constructor(e,t,n,i,s){super(e),this.countriesService=t,this.documentInputService=n,this.fieldInputService=i,this.phoneInputService=s}userInfoUpdateInputDefault(e,t,n={}){const i=this.countriesService.getDefaultCountryValues(n.countryCode);return{id:e?.id??null,fields:this.fieldInputService.fieldsUpdateInputDefault(e?.fields||{},t,i,n.checkboxDefaultEmpty)}}formUserInfoInputSchema(e){return d.Ik().shape({fields:d.Ik().shape(Object.fromEntries(e.map(({isMandatory:e,customField:t})=>[t.slug,this.fieldInputService.fieldSchema(t,e)])))})}userInfoInputSchema(e,t){const n={};return e.forEach(e=>{const t=e.field,i=this.fieldInputService.fieldSchema(e.field,e.isMandatory);n[t.slug]=i}),t&&t.forEach(e=>{n[e.slug]=this.fieldInputService.fieldSchema(e,!1)}),d.Ik().shape({fields:d.Ik().shape({...n})})}userInfoProfileInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{email:e.email,fields:{firstName:e.userInfo?.fields?.firstName??"",lastName:e.userInfo?.fields?.lastName??"",language:e.userInfo?.fields?.language??e.language??t.user.language??jt.En,picture:e.userInfo.fields.picture?(0,yr.A)(e.userInfo.fields.picture,pj):this.documentInputService.documentInputDefault(),phone:e.userInfo.fields.phone?(0,yr.A)(e.userInfo.fields.phone,W_):this.phoneInputService.phoneInputDefault(t)}}}userInfoFields(){return{fields:d.Ik().shape({firstName:d.Yj().nullable(),lastName:d.Yj().nullable(),picture:this.documentInputService.documentInputSchemaNotRequired(),language:d.Yj().required(this.t("les_langues_doi_27712")).oneOf(hd,this.t("les_langues_doi_27712")),phone:this.phoneInputService.phoneInputSchemaNotRequired()})}}userInfoProfileInputSchema(){return d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),...this.userInfoFields()})}updateUserInfoSchema(e){return d.Ik().shape({userInfo:this.formUserInfoInputSchema(e)})}updateProfileSchema(){return d.Ik().shape({userInfo:this.userInfoProfileInputSchema()})}userInfoAndTermsInputDefault(e){return{...(0,rr.A)(e.userInfo,["id"]),termsAccepted:!1}}userInfoAndTermsInputSchema(){return d.Ik().shape({firstName:d.Yj().nullable(),lastName:d.Yj().nullable(),phone:this.phoneInputService.phoneInputSchemaNotRequired(),termsAccepted:d.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})}updateUserInfoAndTermsSchema(){return d.Ik().shape({userInfoAndTerms:this.userInfoAndTermsInputSchema()})}};VE=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn,su,fj,Vj,G_])],VE);let UE=class extends Pl{constructor(e){super(e)}volunteersRegistrationsSlotInputDefault(e){return{startDate:e||Bs.c9.invalid("Invalid"),startTime:"",endDate:e||Bs.c9.invalid("Invalid"),endTime:""}}volunteersRegistrationsSlotInputSchema(e,t){const n=t.plus({day:1}).endOf("day");return d.Ik().shape({startDate:Vm.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:d.Yj().required(this.t("heure_de_d_but_90785")),endDate:Vm.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)=>Bs.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&Bs.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:d.Yj().required(this.t("l_heure_de_fin_78626"))})}};UE=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],UE);let WE=class extends Pl{translationService;userInfoInputService;volunteerRegistrationSlotInputService;constructor(e,t,n){super(e),this.translationService=e,this.userInfoInputService=t,this.volunteerRegistrationSlotInputService=n}slotsFields(e,t,n){switch(e){case pt.Display:case pt.DisplayDays:case pt.Calendar:case pt.Custom:return{slots:d.YO().of(this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputSchema(t,n)).min(1,this.t("vous_devez_ajou_68961"))};case pt.Hide:return{};default:return nl()}}volunteersRegistrationsSlotsUpdateInputDefault(e){return eo(e)?e.map(e=>({startDate:e.startDate,startTime:e.startTime,endDate:e.endDate,endTime:e.endTime})):[]}userInfoSlotsSchema(e,t,n){return d.Ik().shape({userInfo:d.Ik().shape({slots:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.slotsFields(e,t,n)}))})})}volunteersRegistrationsWishedPositionsInputDefault(){return{positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[]}}volunteersRegistrationsWishedPositionsUpdateInputDefault(e){return e?{positionsCategoriesIds:e?.positionsCategoriesIds,positionsIds:e?.positionsIds,positionsSlotsIds:e?.positionsSlotsIds}:this.volunteersRegistrationsWishedPositionsInputDefault()}wishedPositionsFields(e,t){if(e===We.Ranked){if(t===mt.Category)return{positionsCategoriesIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_32044")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,Va.A)((e||[]).filter(e=>-1!==e));return eo(t)&&(0,Fs.A)(t).length===t.length})};if(t===mt.Position)return{positionsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,Va.A)((e||[]).filter(e=>-1!==e));return eo(t)&&(0,Fs.A)(t).length===t.length})};throw new Error("Should not happen")}switch(t){case mt.Category:return{positionsCategoriesIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_32044"))};case mt.Position:return{positionsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_89603"))};case mt.Slot:return{positionsSlotsIds:d.YO().of(d.ai()).min(1,this.t("vous_devez_s_le_89603"))};case mt.None:return{};default:return nl()}}volunteerRegistrationWishedPositionsSchema(e,t){return d.Ik().shape({volunteerRegistration:d.Ik().shape({...this.wishedPositionsFields(e,t)})})}userInfoWishedPositionsSchema(e,t){return d.Ik().shape({userInfo:d.Ik().shape({missions:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.wishedPositionsFields(e,t)}))})})}volunteersRegistrationsWishedAccreditationsInputDefault(){return{accreditationsSlotsIds:[]}}volunteersRegistrationsWishedAccreditationsUpdateInputDefault(e){return e?{accreditationsSlotsIds:e.accreditationsSlotsIds}:this.volunteersRegistrationsWishedAccreditationsInputDefault()}accreditationsFields(e,t){if(t)return{};switch(e){case ut.Accreditation:return{accreditationsSlotsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_96571"))).min(1,this.t("vous_devez_s_le_72138"))};case ut.None:return{};default:return nl()}}volunteerRegistrationAccreditationsSchema(e){return d.Ik().shape({volunteerRegistration:d.Ik().shape({...this.accreditationsFields(e,null)})})}userInfoAccreditationsSchema(e){return d.Ik().shape({userInfo:d.Ik().shape({accreditations:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.accreditationsFields(e,null)}))})})}updateVolunteerRegistrationSchema(e,t,n,i,s,o,r){let a={userInfo:this.userInfoInputService.userInfoInputSchema(e,t)};return a={...a,...this.slotsFields(n,o,r),...this.wishedPositionsFields(i,s)},d.Ik().shape({email:d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),volunteerRegistration:d.Ik().shape({...a})})}adminCreateSchema(){return d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_n_est_57882")).required(this.t("l_e_mail_n_est_57882")),sendVolunteerRegistrationEmail:d.zM().required(),firstName:d.Yj(),lastName:d.Yj()})}adminAddSchema(){return d.Ik().shape({usersInfosIds:d.YO().of(d.ai()).min(1,this.t("vous_devez_s_le_83608")),sendVolunteerRegistrationEmail:d.zM().required()})}};WE=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn,VE,UE])],WE);let GE=class extends Pl{fieldInputService;userInfoInputService;volunteerRegistrationInputService;volunteerRegistrationSlotInputService;constructor(e,t,n,i,s){super(e),this.fieldInputService=t,this.userInfoInputService=n,this.volunteerRegistrationInputService=i,this.volunteerRegistrationSlotInputService=s}formRegisterInputDefault(e,t,n,i){return{autoAccredit:!1,forOther:i.forOther,positionsSlotsIds:i.team?.positionsSlotsIds??[],positionsIds:i.team?.positionsIds??[],positionsCategoriesIds:i.team?.positionsCategoriesIds??[],accreditationsSlotsIds:(i.delegationAccreditations??[]).filter(e=>e.isDefault).map(e=>e.accreditationSlotId),userInfo:this.userInfoInputService.userInfoUpdateInputDefault(t,n,{countryCode:i.countryCode}),sendNotificationEmail:i.sendNotificationEmail,slots:i.slotDisplay===pt.Display?[this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputDefault(i.eventStartDate)]:i.team?.slots??[],source:e}}formRegisterInformationsSchema(e){return d.Ik().shape({formRegister:d.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e)})})}formRegisterSlotsSchema(e,t,n){return d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.slotsFields(e,t,n)})})}formRegisterPositionsSchema(e,t){return d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.wishedPositionsFields(e,t)})})}formRegisterAccreditationsSchema(e,t,n,i){const s=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 d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.accreditationsFields(e,i),userInfo:d.Ik().shape({fields:d.Ik().shape(Object.fromEntries(s.map(e=>{const n=e.isMandatory&&eo((0,lh.A)(e.accreditationsSlotsIds,t));return[e.customField.slug,this.fieldInputService.fieldSchema(e.customField,n)]})))})})})}formRegisterSchema(e,t,n,i,s,o,r,a){return d.Ik().shape({email:d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),formRegister:d.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e),...this.volunteerRegistrationInputService.slotsFields(t,n,i),...this.volunteerRegistrationInputService.wishedPositionsFields(s,o),...this.volunteerRegistrationInputService.accreditationsFields(r,a)})})}};GE=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn,Vj,VE,WE,UE])],GE);const HE=e=>{const t=Gn(su);return(0,i.jsx)(Rr.Yr,{name:e.name,children:n=>{e.change(`${e.prefix}street`,n.name);const i=n.geometry?.location?.lat(),s=n.geometry?.location?.lng(),o=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 s&&e.changeLatLng&&(e.change(`${e.prefix}latitude`,i),e.change(`${e.prefix}longitude`,s)),o&&e.changeCity&&e.change(`${e.prefix}city`,o.long_name),r&&e.changePostalCode&&e.change(`${e.prefix}postalCode`,r.long_name),t.countryCodeExists(a)&&e.changeCountry&&e.change(`${e.prefix}country`,a)}})},qE=e=>{const t=M.useMemo(()=>e.elements.flatMap(e=>e.elementType===Ue.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.elements]);return(0,i.jsx)(br,{children:e.elements.map((n,s)=>{switch(n.elementType){case Ue.Field:{const o=n.customField,r=Lj(o,e.values,t);return(0,i.jsxs)(M.Fragment,{children:[o.fieldProperty===Me.Street&&(0,i.jsx)(HE,{change:e.change,changeCity:!0,changeCountry:!0,changeLatLng:!0,changePostalCode:!0,name:"place",prefix:e.prefix}),r&&0!==s&&(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Kj,{change:e.change,countryCode:e.countryCode,display:r,field:o,isMandatory:!0===n.isMandatory,organizationId:e.organizationId,prefix:e.prefix},s)]},s)}case Ue.Section:return Lj(n,e.values,t)?(0,i.jsx)(M.Fragment,{children:"function"==typeof e.renderSection?e.renderSection(n.section,s):(0,i.jsxs)(i.Fragment,{children:[e.featureFlags?.isV4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ba,{height:"5"})]}):0!==s&&(0,i.jsx)(Ba,{height:"8"}),(0,i.jsx)(br,{font:"gray800 textMd semiBold",children:"function"==typeof e.renderText?e.renderText(n.section):n.section})]})},s):null;case Ue.Text:return Lj(n,e.values,t)?(0,i.jsx)(M.Fragment,{children:(0,i.jsxs)(i.Fragment,{children:[0!==s&&(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(hg,{text:"function"==typeof e.renderText?e.renderText(n.text):n.text})]})},s):null;default:return nl(n.elementType)}})})},YE=e=>{const t=Hn();return(0,i.jsxs)(Qc,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(jl,{onClick:e.onClose,children:t("fermer_62479")})}),size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",width:1,children:(0,i.jsx)(Ej,{color:"primary",icon:"circle-info"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",width:1,children:t("informations_su_86120",e.name)}),(0,i.jsx)(Ba,{height:"7"}),m(e.description)&&(0,i.jsxs)(Ra,{css:{overflowY:"auto"},direction:"column",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:t("description_58935")}),(0,i.jsx)(hg,{text:e.description})]}),(0,i.jsx)(Ba,{height:"4"})]})},KE=e=>{const{translate:t}=cl(),n=Gn(Wc);return(0,i.jsx)(i.Fragment,{children:eo(e.slots)?e.slots.map(t=>(0,i.jsx)(dc,{state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{e.change(`${e.prefix}accreditationsSlotsIds`,no(e.accreditationsSlotsIds,t.id,"checked"===n))},children:(0,i.jsx)(br,{css:{textTransform:"capitalize"},children:wh(n,t,e.accreditation.name,{date:{localeFormat:Zs.DateOnly.WeekdayLongMonthLong}})})},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},ZE=e=>{const{translate:t}=cl(),n=Gn(Wc),s=(0,M.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]);return(0,i.jsx)(i.Fragment,{children:eo(e.slots)?e.slots.map(t=>(0,i.jsx)(hc,{state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{const i=[...e.accreditationsSlotsIds.filter(e=>!s.includes(e)),..."checked"===n?[t.id]:[]];e.change(`${e.prefix}accreditationsSlotsIds`,i)},children:(0,i.jsx)(br,{css:{textTransform:"capitalize"},children:wh(n,t,e.accreditation.name,{date:{localeFormat:Zs.DateOnly.WeekdayLongMonthLong}})})},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},XE=e=>{const{params:{organizationId:t},translate:n}=cl(),[s,o]=(0,M.useState)(!1),r=(0,M.useMemo)(()=>(0,ic.A)(e.accreditation.slots.filter(t=>Sh(t,e.slots,e.options,e.delegationAccreditations)),e=>(0,Va.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.accreditation.slots,e.delegationAccreditations,e.slots,e.options]),a=(0,M.useMemo)(()=>m(e.accreditation.description)&&e.options.showAccreditationDescription,[e.accreditation,e.options]),l=(0,M.useMemo)(()=>{const t=e.accreditation.hasSlots?r.map(e=>e.id):[e.accreditation.hiddenSlotId];return e.displayFormCustomFields&&eo(e.accreditation.formCustomFields)&&eo((0,lh.A)(t,e.accreditationsSlotsIds))},[e.accreditation,e.accreditationsSlotsIds,e.displayFormCustomFields,r]),d=e.accreditationsSlotsIds.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fC,{accreditation:e.accreditation,displayFormCustomFields:l,displayNumberOfSlots:!1,displaySlots:e.accreditation.hasSlots,numberOfSlots:0,renderActions:()=>a&&(0,i.jsx)(jl,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(!0)},children:n("voir_la_descrip_62304")}),renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(lc,{shouldPreventDefault:!1,state:d,onClick:Hl.A}),onClick:()=>{e.accreditation.hasSlots||e.change(`${e.prefix}accreditationsSlotsIds`,no(e.accreditationsSlotsIds,e.accreditation.hiddenSlotId,"unchecked"===d))},children:(0,i.jsxs)(Ra,{css:{background:"white",padding:"$4"},direction:"column",gap:"3",children:[e.accreditation.hasSlots?e.accreditation.accreditationDisplay===te.Calendar?(0,i.jsx)(nA,{accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r}):(0,i.jsx)(Ra,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.accreditationDisplay===te.Radio?(0,i.jsx)(ZE,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r}):(0,i.jsx)(KE,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r})}):null,l&&(0,i.jsx)(Ra,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.formCustomFields.map(({customField:n,isMandatory:s})=>(0,i.jsx)(Kj,{change:e.change,display:!0,field:n,isMandatory:s,organizationId:t,prefix:`${e.prefix}userInfo.fields.`},n.id))})]})}),s&&(0,i.jsx)(YE,{description:e.accreditation.description,name:e.accreditation.name,onClose:()=>{o(!1)}})]})},JE=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>rC(e.category.accreditations.filter(t=>nC(t,e.slots,e.userInfoFields,e.options,e.delegationAccreditations))),[e.category,e.delegationAccreditations,e.slots,e.userInfoFields,e.options]);return(0,i.jsx)(mC,{category:e.category,children:eo(n)?n.map(t=>(0,i.jsx)(XE,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.slots},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},QE=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)(e.categories,e=>e.name.toLowerCase()),[e.categories]);return(0,i.jsx)(hC,{css:{background:"transparent",padding:"0"},children:eo(n)?(0,i.jsxs)(i.Fragment,{children:[n.map(t=>(0,i.jsx)(JE,{accreditationsSlotsIds:e.accreditationsSlotsIds,category:t,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t.id)),e.showAutoAccredit&&(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray900 textSm medium",children:t("attribution_des_59896")}),(0,i.jsx)(Bm,{name:`${e.prefix}autoAccredit`,children:t("attribuer_les_a_75431")})]})]}):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},eT=e=>{const t=(0,M.useMemo)(()=>e.event.accreditationsCategories.filter(t=>{return n=t,i=e.slots,s=e.userInfosFields,o=e.options,r=e.delegationAccreditations,o.accreditationDisplay!==ut.None&&!o.hiddenAccreditationsCategoriesIds.includes(n.id)&&(0===o.displayedAccreditationsCategoriesIds.length||o.displayedAccreditationsCategoriesIds.includes(n.id))&&n.accreditations.some(e=>nC(e,i,s,o,r))||r.some(e=>e.accreditationCategoryId===n.id&&n.accreditations.some(e=>nC(e,i,s,o,r)));var n,i,s,o,r}),[e.event.accreditationsCategories,e.slots,e.userInfosFields,e.options]);return eo(e.delegationAccreditations)||e.options.accreditationDisplay===ut.Accreditation?(0,i.jsx)(QE,{accreditationsSlotsIds:e.accreditationsSlotsIds,categories:t,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,showAutoAccredit:e.showAutoAccredit,slots:e.slots,userInfoFields:e.userInfosFields}):null},tT=e=>{const[t,n]=(0,M.useState)(!1),s=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dc,{css:{alignItems:"center"},state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsCategoriesIds`,no(e.positionsCategoriesIds,e.category.id,"checked"===t))},children:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{children:e.category.name}),s&&(0,i.jsx)(br,{onClick:e=>{Al(e),n(!0)},children:(0,i.jsx)(Ya,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(YE,{description:e.category.description,name:e.category.name,onClose:()=>{n(!1)}})]})},nT=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)(e.categories,e=>e.name),[e.categories]);return(0,i.jsx)(i.Fragment,{children:eo(n)?n.map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(tT,{category:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},iT=e=>{const[t,n]=(0,M.useState)(!1),s=m(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dc,{css:{alignItems:"center"},state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsIds`,no(e.positionsIds,e.position.id,"checked"===t))},children:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{children:e.position.name}),s&&(0,i.jsx)(br,{onClick:e=>{Al(e),n(!0)},children:(0,i.jsx)(Ya,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(YE,{description:e.position.description,name:e.position.name,onClose:()=>{n(!1)}})]})},sT=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)(e.category.positions.filter(t=>jh(t,e.userInfoFields,e.slots,e.options)),e=>e.name),[e.category,e.userInfoFields,e.slots,e.options]),[s,o]=(0,M.useState)(!1),r=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"semiBold",children:e.category.name}),r&&(0,i.jsx)(br,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(Ya,{icon:"circle-info"})})]}),(0,i.jsx)(Ba,{height:"2"}),eo(n)?n.map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(iT,{change:e.change,options:e.options,position:t,positionsIds:e.positionsIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(YE,{description:e.category.description,name:e.category.name,onClose:()=>{o(!1)}})]})},oT=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)(e.categories,e=>e.name),[e.categories]);return(0,i.jsx)(i.Fragment,{children:eo(n)?n.map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(sT,{category:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields})]},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},rT=e=>{const t=Hn(),n=SA(),s=(0,M.useMemo)(()=>(0,ic.A)(e.categories,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[eo(s)?n?(0,i.jsxs)(fc,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsCategoriesIds?.[e.index]??-1],onChange:t=>{eo(t)&&e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(Au,{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")}),s]}):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Ba,{height:"4"})]})},aT=e=>{const t=Hn(),n=SA(),s=(0,M.useMemo)(()=>e.categories.flatMap(t=>(0,ic.A)(t.positions.filter(t=>jh(t,e.userInfoFields,e.slots,e.options)),e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[eo(s)?n?(0,i.jsxs)(fc,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsIds?.[e.index]??-1],onChange:t=>{eo(t)&&e.change(`${e.prefix}positionsIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(Au,{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")}),s]}):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Ba,{height:"4"})]})},lT=e=>{const{translate:t}=cl();return(0,i.jsx)(i.Fragment,{children:eo(e.categories)?(0,wc.A)(0,e.options.positionLimit).map(t=>e.options.positionDisplay===mt.Category?(0,i.jsx)(rT,{categories:e.categories,change:e.change,index:t,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix},t):(0,i.jsx)(aT,{categories:e.categories,change:e.change,index:t,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})};function dT(e){const t=Gn(ah),n=(0,M.useMemo)(()=>t.toDisplayString(e.range,{formats:{displayWeekday:!0}}),[e]),i=m(e.name);return{isRenamed:i,finalName:i?e.name:n,rangeString:n}}const cT=e=>{const{translate:t}=cl(),{rangeString:n,finalName:s,isRenamed:o}=dT(e.slot),r=(0,M.useMemo)(()=>{if(e.options.willAutoAssign){const t=e.allSlots.filter(t=>e.positionsSlotsIds.includes(t.id));return fh(e.slot,t)}return!1},[e.options.willAutoAssign,e.allSlots,e.positionsSlotsIds]);return(0,i.jsxs)(M.Fragment,{children:[0!==e.index&&(0,i.jsx)(Ba,{height:"3"}),r?(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(dc,{disabled:!0,shouldPreventDefault:!1,state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?n:void 0,onClick:Hl.A,children:s})})}),(0,i.jsx)(_m,{placement:"top-start",children:t("ce_cr_neau_en_c_55775")})]}):(0,i.jsx)(dc,{state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?n:void 0,onClick:t=>{e.change(`${e.prefix}positionsSlotsIds`,no(e.positionsSlotsIds,e.slot.id,"checked"===t))},children:s})]},e.slot.id)},uT=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)(e.position.slots.filter(t=>_h(t,e.slots,e.options)),[e=>e.range.start.toMillis(),e=>e.nameOrRange]),[e.position,e.slots,e.options]),[s,o]=(0,M.useState)(!1),r=m(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"semiBold",children:e.position.name}),r&&(0,i.jsx)(br,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(Ya,{icon:"circle-info"})})]}),(0,i.jsx)(Ba,{height:"2"}),eo(n)?n.map((t,n)=>(0,i.jsx)(cT,{allSlots:e.allSlots,change:e.change,index:n,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slot:t},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(YE,{description:e.position.description,name:e.position.name,onClose:()=>{o(!1)}})]})},hT=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)(e.category.positions.filter(t=>jh(t,e.userInfoFields,e.slots,e.options)),e=>e.name),[e.category,e.userInfoFields,e.slots,e.options]),[s,o]=(0,M.useState)(!1),r=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{color:"gray500",css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.category.name}),r&&(0,i.jsx)(br,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(Ya,{icon:"circle-info"})})]}),eo(n)?n.map(t=>(0,i.jsx)(uT,{allSlots:e.allSlots,change:e.change,options:e.options,position:t,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(YE,{description:e.category.description,name:e.category.name,onClose:()=>{o(!1)}})]})},mT=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)(e.categories,e=>e.name),[e.categories]),s=(0,M.useMemo)(()=>e.categories.flatMap(e=>e.positions.flatMap(e=>e.slots)),[e.categories]);return(0,i.jsx)(i.Fragment,{children:eo(n)?n.map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(hT,{allSlots:s,category:t,change:e.change,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t.id)]},t.id)):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},gT=e=>{const t=(0,M.useMemo)(()=>(0,ic.A)(e.event.positionsCategories.filter(t=>{return n=t,i=e.slots,s=e.userInfoFields,!(o=e.options).hiddenPositionsCategoriesIds.includes(n.id)&&(0===o.displayedPositionsCategoriesIds.length||o.displayedPositionsCategoriesIds.includes(n.id))&&n.positions.some(e=>jh(e,s,i,o));var n,i,s,o}),e=>(0,dh.A)(e.positions.flatMap(e=>e.slots.flatMap(e=>e.range.start.toMillis())))),[e.event.positionsCategories,e.slots,e.userInfoFields,e.options]);if(e.options.positionRanking===We.Ranked)return(0,i.jsx)(lT,{categories:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});switch(e.options.positionDisplay){case mt.Category:return(0,i.jsx)(nT,{categories:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix});case mt.Position:return(0,i.jsx)(oT,{categories:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case mt.Slot:return(0,i.jsx)(mT,{categories:t,change:e.change,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case mt.None:return null;default:return nl(e.options.positionDisplay)}},pT=e=>{const t=(0,M.useMemo)(()=>gh(e.dayStartTime)?.[0]??0,[e.dayStartTime]),n=(0,M.useMemo)(()=>Vh(e.startAt,e.endAt,e.ranges,e.daysDisplay,t),[e.startAt,e.endAt,e.ranges,e.daysDisplay,t]),s=(0,M.useMemo)(()=>(0,Ju.A)(n,e=>e.toMillis()),[n]),o=(0,M.useMemo)(()=>(0,Qu.A)(n,e=>e.toMillis()),[n]),r=(0,M.useMemo)(()=>Math.ceil(o.endOf("month").diff(s.startOf("month"),"months").months),[s,o]),a=(0,M.useCallback)((t,n)=>{const i=e.currentSlots.filter(e=>e.startDate.year!==t.year||e.startDate.month!==t.month).concat(n.map(e=>Ys(Bs.IX.fromDateTimes(e,e.plus({day:1})))));e.change(`${e.prefix}slots`,i)},[e.currentSlots,e.prefix,e.change]);return(0,i.jsx)(Ra,{gap:"6",wrap:"wrap",children:(0,wc.A)(0,r).map(n=>{const l=s.plus({month:n}).startOf("month"),d=0===n?s:l,c=n===r-1?o:l.endOf("month"),u=e.currentSlots.flatMap(e=>e.startDate.year===l.year&&e.startDate.month===l.month?[e.startDate.startOf("day").set({hour:t||0})]:[]);return(0,i.jsx)(eA,{firstDayOfMonth:l,max:c,min:d,startHour:t,values:u,onChange:e=>{a(l,e)}},n)})})},fT=e=>{const{intervals:t,minDate:n,maxDate:s,numberOfMonths:o}=(0,M.useMemo)(()=>{const t=e.intervalsGrouped.flatMap(([e,t])=>t.map(({interval:e})=>e)),n=(0,Ju.A)(t,e=>e.start.toMillis()).start.startOf("day"),i=(0,Qu.A)(t,e=>e.end.toMillis()).end.endOf("day"),s=Math.ceil(i.endOf("month").diff(n.startOf("month"),"months").months);return{intervals:t,minDate:n,maxDate:i,numberOfMonths:s}},[e.intervalsGrouped]),r=t.flatMap(t=>e.isSelected(t)?[t.start.startOf("day")]:[]);return(0,i.jsx)(Ra,{gap:"6",wrap:"wrap",children:(0,wc.A)(0,o).map(a=>{const l=n.plus({month:a}).startOf("month"),d=0===a?n:l,c=a===o-1?s:l.endOf("month"),u=r.filter(e=>e.month===l.month&&e.year===l.year);return(0,i.jsx)(eA,{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)})})},xT=e=>{const[t,n]=(0,M.useState)(e.intervals.some(({interval:t})=>e.isSelected(t))?"checked":"unchecked"),s=(0,M.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)(Ra,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},direction:"column",children:[(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",padding:"$4 $5"},gap:"2",onClick:s,children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:"checked"===t?"chevron-down":"chevron-right"})}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:e.day})]}),"checked"===t&&(0,i.jsx)(Ra,{css:{borderTop:"1px solid $gray200",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervals.map(({name:t,interval:n},s)=>(0,i.jsx)(dc,{state:e.isSelected(n)?"checked":"unchecked",onClick:t=>{e.setSelected(n,"checked"===t)},children:Wh(t,n)},s))})]})},_T=e=>(0,i.jsx)(Ra,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervalsGrouped.map(([t,[{name:n,interval:s}]],o)=>{const r=`${n} ${s.toFormat("HH:mm")}`.trim(),a=`${t} ${e.hideNameDates?"":`(${r})`}`.trim();return(0,i.jsx)(dc,{state:e.isSelected(s)?"checked":"unchecked",onClick:t=>{e.setSelected(s,"checked"===t)},children:a},o)})}),IT=({customSlotPeriod:e,daysDisplay:t,event:n,isSelected:s,setSelected:o,setSelectedBatch:r})=>{const a=Gn(Wc),l=(0,M.useMemo)(()=>Uh(e.startDate??n.startAt,e.endDate??n.endAt,e.customSlots,n.ranges,t),[e,n,t]),d=(0,M.useMemo)(()=>(0,ic.A)(Object.entries((0,nc.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)(Ra,{direction:"column",gap:"2",width:1,children:[m(e.name)&&(0,i.jsx)(br,{font:"gray900 textSm semiBold",children:e.name}),1===e.customSlots.length?0===d.length?null:e.displayAsCalendar?(0,i.jsx)(fT,{intervalsGrouped:d,isSelected:s,setSelectedBatch:r}):(0,i.jsx)(_T,{hideNameDates:e.hideNameDates,intervalsGrouped:d,isSelected:s,setSelected:o}):d.map(([e,t],n)=>(0,i.jsx)(xT,{day:e,intervals:t,isSelected:s,setSelected:o},n))]})},vT=e=>{const t=(0,M.useMemo)(()=>e.customSlotsPeriods.flatMap(t=>Uh(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,s]=(0,M.useState)(Object.fromEntries(t.map(t=>{const n=e.currentSlots.some(e=>Hs(e).equals(t));return[t.toISO(),n]}))),o=(0,M.useCallback)(e=>n[e.toISO()],[n]),r=(0,M.useCallback)((t,n)=>{const i=t.toISO();s(e=>({...e,[i]:n})),e.change(`${e.prefix}slots`,Gh(e.currentSlots,t,n))},[e.currentSlots,s]),a=(0,M.useCallback)(t=>{const n=t.reduce((e,{interval:t,isSelected:n})=>{const i=t.toISO();return s(e=>({...e,[i]:n})),Gh(e,t,n)},e.currentSlots);e.change(`${e.prefix}slots`,n)},[e.currentSlots,s]);return(0,i.jsx)(i.Fragment,{children:e.customSlotsPeriods.map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(IT,{customSlotPeriod:t,daysDisplay:e.daysDisplay,event:e.event,isSelected:o,setSelected:r,setSelectedBatch:a})]},n))})},bT=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>Vh(e.startAt,e.endAt,e.ranges,e.daysDisplay,gh(e.dayStartTime)?.[0]??0),[e.startAt,e.endAt,e.ranges,e.daysDisplay,e.dayStartTime]),s=(0,M.useMemo)(()=>n.filter(t=>(e.blockedSlots??[]).some(e=>Ks(e,t))),[e.blockedSlots,n]),o=Gn(Wc),[r,a]=(0,M.useState)(Object.fromEntries(n.map((t,n)=>{const i=Bs.IX.fromDateTimes(t,t.plus({day:1}));return[`day${n}`,void 0!==e.currentSlots.find(e=>Hs(e).equals(i))]})));return console.log(e.startAt.toISO()),(0,i.jsx)(i.Fragment,{children:n.map((n,l)=>{const d=s.includes(n);return(0,i.jsxs)(M.Fragment,{children:[0!==l&&(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{disabled:d,state:r[`day${l}`]?"checked":"unchecked",onClick:t=>{a({...r,[`day${l}`]:"checked"===t}),e.change(`${e.prefix}slots`,Gh(e.currentSlots,Bs.IX.fromDateTimes(n,n.plus({day:1})),"checked"===t))},children:d?(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(tl,{children:o.toLocaleString(n,Zs.DateOnly.WeekdayLongMonthLong)})}),(0,i.jsx)(_m,{placement:"right",children:t("vous_avez_d_j_92810")})]}):o.toLocaleString(n,Zs.DateOnly.WeekdayLongMonthLong)})]},l)})})};var jT=n(3088);const CT=e=>{const t=Hn();return(0,i.jsx)(Aj,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),title:t("disponibilit_n_50484",e.index+1),children:(0,i.jsxs)(Ra,{direction:{"@initial":"column","@desktop":"row"},gap:"4",children:[(0,i.jsx)(Dm,{label:t("date_de_d_but_43380"),max:e.max,min:e.min,name:`${e.prefix}startDate`}),(0,i.jsx)(kv,{label:t("heure_de_d_but_27566"),name:`${e.prefix}startTime`}),(0,i.jsx)(Dm,{label:t("date_de_fin_86920"),max:e.max,min:e.min,name:`${e.prefix}endDate`}),(0,i.jsx)(kv,{label:t("heure_de_fin_95071"),name:`${e.prefix}endTime`})]})})},yT=e=>{const t=Hn(),n=Gn(UE),s=(0,M.useMemo)(()=>e.max.endOf("day"),[e.max]);return(0,i.jsx)(jT.ED,{name:`${e.prefix}slots`,children:({fields:o})=>(0,i.jsxs)(i.Fragment,{children:[o.map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(CT,{index:n,max:s,min:e.min,prefix:`${t}.`,remove:()=>{o.remove(n)}})]},n)),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",onClick:()=>{o.push(n.volunteersRegistrationsSlotInputDefault(e.min))},children:t("ajouter_une_dis_96540")})]})})},kT=e=>{switch(e.slotDisplay){case pt.Display:return(0,i.jsx)(yT,{max:e.event.endAt,min:e.event.startAt,prefix:e.prefix});case pt.DisplayDays:return(0,i.jsx)(bT,{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 pt.Calendar:return(0,i.jsx)(pT,{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 pt.Custom:return(0,i.jsx)(vT,{change:e.change,currentSlots:e.currentSlots,customSlotsPeriods:e.customSlotsPeriods,daysDisplay:e.daysDisplay,event:e.event,prefix:e.prefix});case pt.Hide:return null;default:return nl(e.slotDisplay)}},AT=e=>(0,i.jsxs)(Ra,{css:{bd:!0,padding:"$6",background:"$white"},direction:"column",children:[e.title&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray800 textMd semiBold",children:e.title}),(0,i.jsx)(Ba,{height:"5"})]}),e.children]}),wT=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=(0,M.useMemo)(()=>s&&e.form.slotDisplay!==pt.Hide,[e.form,s]),r=(0,M.useMemo)(()=>s&&e.form.positionDisplay!==mt.None,[e.form,s]),a=(0,M.useMemo)(()=>s&&(e.form.accreditationDisplay!==ut.None||eo(e.delegationAccreditations)),[e.delegationAccreditations,e.form,s]);return(0,i.jsxs)(i.Fragment,{children:[e.showEmail&&(0,i.jsxs)(AT,{children:[m(e.form.description)&&(0,i.jsx)(hg,{text:e.form.description}),(0,i.jsx)(Rl,{isEmail:!0,label:t("Email"),name:"email"})]}),(0,i.jsx)(AT,{title:m(e.form.informationTitle)?e.form.informationTitle:t("informations_pe_37892"),children:(0,i.jsx)(qE,{change:e.change,elements:e.form.elements,organizationId:n,prefix:"formRegister.userInfo.fields.",values:e.values.formRegister.userInfo.fields})}),o&&e.event&&(0,i.jsxs)(AT,{title:m(e.form.slotTitle)?e.form.slotTitle:t("disponibilit_s_49923"),children:[m(e.form.slotSubtitle)&&(0,i.jsx)(hg,{text:e.form.slotSubtitle}),(0,i.jsx)(kT,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.values.formRegister.slots,customSlotsPeriods:e.form.customSlotsPeriods,daysDisplay:e.form.daysDisplay,event:e.event,prefix:"formRegister.",slotDisplay:e.form.slotDisplay})]}),r&&e.event&&(0,i.jsxs)(AT,{title:m(e.form.positionTitle)?e.form.positionTitle:t("missions_souhai_23225"),children:[m(e.form.positionSubtitle)&&(0,i.jsx)(hg,{text:e.form.positionSubtitle}),(0,i.jsx)(gT,{change:e.change,event:e.event,options:e.form,positionsCategoriesIds:e.values.formRegister.positionsCategoriesIds,positionsIds:e.values.formRegister.positionsIds,positionsSlotsIds:e.values.formRegister.positionsSlotsIds,prefix:"formRegister.",slots:e.values.formRegister.slots,userInfoFields:e.values.formRegister.userInfo.fields})]}),a&&e.event&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(AT,{title:m(e.form.accreditationTitle)?e.form.accreditationTitle:t("accr_ditations_74375"),children:[m(e.form.accreditationSubtitle)&&(0,i.jsx)(hg,{text:e.form.accreditationSubtitle}),(0,i.jsx)(eT,{accreditationsSlotsIds:e.values.formRegister.accreditationsSlotsIds,change:e.change,delegationAccreditations:e.delegationAccreditations??[],displayFormCustomFields:!0,event:e.event,options:e.form,prefix:"formRegister.",showAutoAccredit:e.showAutoAccredit,slots:e.values.formRegister.slots,userInfosFields:e.values.formRegister.userInfo.fields})]})})]})},ST=e=>{const t=Gn(GE),n=(0,M.useMemo)(()=>(e.organization.form.elements??[]).flatMap(e=>e.elementType===Ue.Field?[e.customField]:[]),[e.organization]);return(0,M.useEffect)(()=>{const i=t.formRegisterInputDefault(Ge.Admin,null,n,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditations:e.organization.delegation?.accreditationsSlots??[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:e.organization.form.slotDisplay,team:null});e.setInitialValues({email:e.values.email||"",formRegister:{...i,userInfo:{...i.userInfo,...e.values.formRegister.userInfo}}})},[e.organization]),(0,i.jsx)(Om,{css:{gap:"$6"},children:(0,i.jsx)(wT,{change:e.change,delegationAccreditations:e.organization.delegation?.accreditationsSlots??[],event:e.organization.event,form:e.organization.form,showAutoAccredit:!0,showEmail:!1,values:e.values})})},ET=e=>{const{translate:t,params:{delegationId:n}}=cl();return(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(Rl,{isEmail:!0,label:t("Email"),name:"email"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Rl,{label:(0,i.jsx)(_v,{children:t("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)(Rl,{label:(0,i.jsx)(_v,{children:t("Name")}),name:"formRegister.userInfo.fields.lastName"})]})]}),!n&&(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("param_tres_du_m_69378")}),(0,i.jsx)(br,{color:"gray500",children:t("s_lectionnez_le_16209")})]}),(0,i.jsx)(Mm,{isSearchVisible:!0,label:(0,i.jsx)(_v,{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)(fc,{isSearchVisible:!0,label:(0,i.jsx)(_v,{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)(fc,{isSearchVisible:!0,label:(0,i.jsx)(_v,{children:t("Form")}),state:eo(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))})]})]})},TT=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,delegationId:r}}=cl(),a=Gn(GE),l=Gn(Da),d=(0,M.useRef)(null),{mutate:c,isLoading:u}=function(e={}){return Kn("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)}(),{mutate:h}=function(e={}){return Kn("mutation FormRegister(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $formId: FormId!\n $email: UserEmail!\n $formRegister: FormRegisterInput!\n) {\n formRegister(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n formId: $formId\n email: $email\n formRegister: $formRegister\n ) {\n teamCode\n }\n}\n",e)}(),[m,g]=(0,M.useState)(null),p=(0,M.useMemo)(()=>m?.form.elements.filter(e=>e.elementType===Ue.Field)??[],[m]),[f,x]=(0,M.useState)({email:"",formRegister:a.formRegisterInputDefault(Ge.Admin,null,[],{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditations:[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:pt.Hide,team:null})}),_=(0,M.useCallback)(e=>l.validateForForm(a.formRegisterSchema(p,m?.form.slotDisplay??pt.Hide,m?.event?.startAt??Bs.c9.now(),m?.event?.endAt??Bs.c9.now(),m?.form.positionRanking??We.Unranked,m?.form.positionDisplay??mt.None,m?.form.accreditationDisplay??ut.None,m?.delegation?.id))(e),[p,a,m,l]),I=(0,M.useCallback)(async n=>{m?await h({organizationId:s,eventId:o,delegationId:m.delegation?.id,formId:m.form.id,email:n.email,formRegister:n.formRegister}):await c({organizationId:s,eventId:o,email:n.email,userInfo:n.formRegister.userInfo,sendNotificationEmail:n.formRegister.sendNotificationEmail}),t.push(e.closePath)},[e.closePath,m]),v=e.organization.delegations.nodes,b=e.organization.forms.nodes,[j,C]=(0,M.useState)(!1),[y,k]=(0,M.useState)([]),[A,w]=(0,M.useState)([]),S=(0,M.useCallback)(async e=>{if(w(e),eo(e)){C(!0);const{organization:t}=await _a({organizationId:s,eventId:o,formId:e[0]},await q());g(t),C(!1)}else g(null)},[o,s]),E=(0,M.useCallback)(async e=>{if(k(e),eo(e)){const t=v.find(t=>t.id===e[0]);w([t.formId]),C(!0);const{organization:n}=await _a({organizationId:s,delegationId:e[0],eventId:o,formId:t.formId},await q());g(n),C(!1)}else g(null)},[v,s,o]);return Td(n("cr_ation_d_un_m_98624")),(0,M.useEffect)(()=>{r&&E([r])},[r,E]),(0,i.jsx)(fl,{customErrorRef:d,height:1,hideDefaultErrors:!0,initialValues:f,render:({form:t,handleSubmit:s,values:r})=>(0,i.jsx)(zm,{category:n("cr_ation_d_un_m_98624"),color:"dark",fallbackClosePath:e.closePath,title:n("nouveau_membre_94535"),children:(0,i.jsx)(Em,{ref:d,children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(hl,{hideSpacer:!0}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,title:n("informations_su_05921"),children:(0,i.jsx)(ET,{delegations:v,delegationsIds:y,forms:b,formsIds:A,population:e.organization.population,setDelegationsIds:E,setFormsIds:S})}),j&&(0,i.jsx)(Om,{css:{minHeight:"200px"},children:(0,i.jsx)(_l,{})}),!j&&m&&(0,i.jsx)(ST,{change:t.change,organization:m,setInitialValues:x,values:r}),(0,i.jsx)(Om,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[o&&(0,i.jsx)($m,{name:"formRegister.sendNotificationEmail",children:n("envoyer_l_email_75574")}),(0,i.jsx)(jl,{isLoading:u,textAlign:"center",onClick:s,children:n("ajouter_le_memb_57505")})]})})]})})}),validate:_,width:1,onSubmit:I})},zT=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=cl(),{data:s,loader:o}=Yn('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?tt.Event:tt.Organization},[]);return o||(0,i.jsx)(TT,{closePath:n?as.DELEGATION_MEMBERS({organizationId:e,eventId:t,delegationId:n}):t?Os.VOLUNTEERS(e,t):ji.COMMUNITY_USERS({organizationId:e}),organization:s.organization})};let OT=class extends Pl{constructor(e){super(e)}commentInputDefault(){return{content:""}}commentInputSchema(){return d.Ik().shape({content:d.Yj().required(this.t("le_commentaire_33393"))})}createCommentSchema(){return d.Ik().shape({comment:this.commentInputSchema()})}};function RT(e){return e.replace(/\*\*(.+?)\*\*/g,"$1").replace(/\+\+(.+?)\+\+/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1")}OT=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],OT);const $T=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("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)(Pk,{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()}})},DT=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{mutate:o}=function(e={}){return Kn("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,M.useState)(e.comment.content),[l,d]=(0,M.useState)(!1),c=m(r);return(0,i.jsxs)(ub,{children:[(0,i.jsx)(hb,{children:(0,i.jsx)(br,{color:"gray500",css:{cursor:"pointer"},children:(0,i.jsx)(Ya,{icon:"pen"})})}),(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"message",children:t("mise_jour_du_59845")}),(0,i.jsx)(lb,{children:(0,i.jsx)(Nm,{label:t("commentaire_08754"),value:r,onChange:a})}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{disabled:!c,isLoading:l,onClick:async()=>{d(!0),await o({organizationId:n,eventId:s,commentId:e.comment.id,comment:{content:r}}),e.reload()},children:t("mettre_jour_85141")})})]})]})},PT=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=Gn(Wc),{user:r}=ni(),[a,l]=(0,M.useState)(!1),d=e.comment.event,c=e.comment.writtenBy;return(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(qg,{email:c.email,image:c.userInfo.picture?.url,name:c.userInfo.name,size:40}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"2",children:[(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:c.userInfo.nameOrEmail}),(0,i.jsx)(br,{color:"gray500",children:o.toLocaleString(e.comment.insertedAt.toLocal(),Zs.DateTime)}),e.showEvent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray500",children:"•"}),(0,i.jsx)(br,{color:"gray500",children:d?.name??t("communaut_20896")})]}),c.id===r?.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray500",children:"•"}),(0,i.jsx)(DT,{comment:e.comment,reload:e.reload})]}),(0,i.jsxs)(Ib,{permissions:xb.COMMENT_ADD,children:[(0,i.jsx)(br,{color:"gray500",children:"•"}),(0,i.jsx)(br,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{l(!0)},children:(0,i.jsx)(Ya,{icon:"trash-can"})})]})]}),(0,i.jsx)(br,{color:"gray800",css:{background:"$gray100",borderRadius:"0 $2 $2 $2",boxShadow:"$sm",padding:"$3",whiteSpace:"pre-line"},dangerouslySetInnerHTML:{__html:RT(e.comment.content)}})]}),a&&(0,i.jsx)($T,{commentId:e.comment.id,eventId:s,organizationId:n,onClose:()=>{l(!1)},onSuccess:e.reload})]})},FT=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=cl(),r=Gn(OT),a=Gn(Da),{data:l,loader:d,reload:c}=va({organizationId:t,userInfoId:s}),{mutate:u,isLoading:h}=Ia(),[m,g]=(0,M.useState)(1),p=(0,M.useCallback)(()=>{g(m+1),c()},[m,g,c]);return(0,i.jsx)(fl,{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)(M.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(PT,{comment:t,reload:p,showEvent:e.showEvent})]},n)),(0,i.jsxs)(Ib,{permissions:xb.COMMENT_ADD,children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(hl,{}),(0,i.jsx)(Lm,{label:o("commentaire_08754"),name:"comment.content"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(jl,{isLoading:h,onClick:t,children:(0,i.jsx)(br,{textAlign:"center",width:1,children:o("ajouter_un_nouv_86295")})})]}),(0,i.jsx)(Ba,{height:"8"})]}),validate:a.validateForForm(r.createCommentSchema()),width:1,onSubmit:async e=>{await u({organizationId:t,eventId:n,userInfoId:s,comment:e.comment}),p()}},m)},MT=({canEdit:e,editFormPath:t,editPath:n,formsUsersInfos:s,isEditDisabled:o=!1})=>{const{params:{organizationId:r,eventId:a,userInfoId:l},translate:d}=cl(),c=Gn(Wc),u=(0,M.useMemo)(()=>(0,ic.A)(s.filter(e=>eo(e.accreditationsSlots)).map(e=>({...e,accreditationsSlots:(0,ic.A)(e.accreditationsSlots,e=>[e.accreditationCategory.name.toLowerCase(),oC(e.accreditation.index),e.accreditation.name.toLowerCase(),e.date?.toMillis()??1,e.name.toLowerCase()])})),e=>e.form.name.toLowerCase()),[s]),h=jc();return(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[o&&(0,i.jsx)(Ik,{message:d("you_are_already_assigned_to_accreditations"),title:d("wished_accreds_can_no_longer_be_changed")}),(0,i.jsx)(Oc,{filters:e&&(0,i.jsx)(jl,{color:"white",disabled:o,size:"sm",to:n,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:d("nom_de_l_accr_d_11908")}),!h&&(0,i.jsx)(Fc,{children:d("cr_neau_11117")}),!h&&(0,i.jsx)(Fc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:eo(u)?u.flatMap((e,n)=>e.accreditationsSlots.map((s,d)=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:s.accreditation.name}),!h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{children:wh(c,s,"")}),(0,i.jsx)(yc,{children:(0,i.jsx)(vk,{editDisabled:o,editPath:t,eventId:a,form:e.form,organizationId:r,userInfoId:l})})]})]},`${n}-${d}`))):(0,i.jsx)(Tc,{css:{height:"200px"},children:(0,i.jsx)(yc,{children:(0,i.jsx)(xk,{title:d("aucune_accr_dit_56501")})})})}),setOffset:Hl.A,title:d("accr_ditations_74375"),totalCount:0})]})},NT=e=>{const t=Gn(Wc),n=M.useMemo(()=>{const t=Kd(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)(Ra,{css:{...n,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Ra,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsx)(br,{children:wh(t,e.aui.accreditationSlot,"")}),e.aui.isAutoAccredit&&(0,i.jsx)(br,{fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:"bolt-auto"})})]}),(0,i.jsx)(br,{fontSize:"textXs",fontWeight:"medium",children:e.aui.accreditation.name})]}),e.aui.accreditation.id)})},LT=e=>{const t=SA(),n=M.useMemo(()=>(0,ic.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),oC(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]),s=M.useMemo(()=>(0,ic.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),oC(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]);return(0,i.jsxs)(OA,{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)(zA,{children:(0,i.jsx)(NT,{aui:t,renderAccreditation:e.renderAccreditation})},t.id)),s.map(t=>(0,i.jsx)(zA,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(NT,{aui:t,renderAccreditation:e.renderAccreditation})},t.id))]})},BT=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=cl(),r=Gn(Wc),{mutate:a}=vo(),{mutate:l}=function(e={}){return Kn("mutation AccreditationsSlotsUsersInfosCheckIn(\n $eventId: EventId!\n $checkIn: AccreditationSlotCheckInInput!\n) {\n accreditationsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}(),d=(0,M.useMemo)(()=>wh(r,e.aui.accreditationSlot,e.aui.accreditation.name),[e.aui]);return(0,i.jsxs)(Tc,{children:[(0,i.jsxs)(yc,{align:"center",gap:"3",children:[(0,i.jsx)(pC,{color:e.aui.accreditation.color,icon:e.aui.accreditation.icon}),(0,i.jsxs)(Ra,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Vc,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:Ji.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.aui.accreditation.id}),children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.aui.accreditation.name,width:1,children:e.aui.accreditation.name})}),(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},title:d,width:1,children:d})]})]}),(0,i.jsxs)(yc,{align:"start",direction:"column",justify:"center",children:[e.aui.state===ue.Waiting&&(0,i.jsxs)(Ra,{align:"center",gap:"1",children:[(0,i.jsx)(br,{color:"warning500",children:(0,i.jsx)(Ya,{icon:"hourglass-empty",iconStyle:"solid"})}),(0,i.jsx)(br,{font:"gray800 textXs medium",children:t("pas_encore_scan_88057")})]}),e.aui.state===ue.CheckedIn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"1",children:[(0,i.jsx)(br,{color:"success500",children:(0,i.jsx)(Ya,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(br,{font:"gray800 textXs medium",children:t("scann_e_01567")})]}),(0,i.jsx)(br,{font:"gray500 textXs regular",children:e.aui.checkInAt?.isValid?r.toLocaleString(e.aui.checkInAt.toLocal(),Zs.DateTime):""})]})]}),(0,i.jsx)(yc,{children:e.aui.isAutoAccredit&&(0,i.jsx)(br,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"check"})})}),(0,i.jsx)(yc,{children:e.aui.isWorkflow&&(0,i.jsx)(br,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"check"})})}),(0,i.jsxs)(yc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(br,{children:e.aui.createdBy?.name??"-"}),(0,i.jsx)(br,{color:"gray500",children:r.toLocaleString(e.aui.insertedAt.toLocal(),Zs.DateTime)})]}),(0,i.jsxs)(Uc,{justify:"end",width:200,children:[e.aui.state===ue.Waiting&&(0,i.jsx)(jl,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.aui.eventId,checkIn:{strategy:he.CheckIn,accreditationsSlotsUsersInfosIds:[e.aui.id]}}),e.reload()},children:"Scanner"}),(0,i.jsx)(Bc,{children:(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:async()=>{await a({eventId:s,massAccredit:{accreditationsSlotsIds:[e.aui.accreditationSlot.id],selecteds:{ids:[o]},strategy:Qe.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})})]})]})},VT=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.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(),oC(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.date?.toMillis()??1,e.accreditationSlot.name.toLowerCase()]),[e.event,e.selectedDay]);return(0,i.jsxs)(vc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:t("Accreditation")}),(0,i.jsx)(Fc,{children:t("scann_e_le_27812")}),(0,i.jsx)(Fc,{children:t("affect_e_automa_74071")}),(0,i.jsx)(Fc,{children:t("ajout_via_une_69544")}),(0,i.jsx)(Fc,{children:t("ajout_e_par_71330")}),(0,i.jsx)(Fc,{width:200})]}),n.map(t=>(0,i.jsx)(BT,{aui:t,reload:e.reload},t.id))]})},UT=e=>{const{translate:t}=cl(),[n,s]=M.useState($_(e.event.startAt,e.event.endAt)),[o,r]=M.useState(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ra,{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)(Ra,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(br,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(ol,{textStyle:"heading",children:e.title}),e.subtitle&&(0,i.jsx)(tl,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Ra,{as:"nav",gap:"3",children:["calendar"===e.accreditationsDisplay&&(0,i.jsx)(EA,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:s}),"list"===e.accreditationsDisplay&&!e.hideListView&&(0,i.jsx)(br,{width:160,children:(0,i.jsx)(Tu,{rightIcon:"xmark",value:o,onChange:r,onRightIconClick:()=>r(null)})}),!e.hideListView&&e.setAccreditationsDisplay&&(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{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)(LT,{event:e.event,featureFlags:e.featureFlags,renderAccreditation:e.renderAccreditation,selectedDay:n}):(0,i.jsx)(VT,{event:e.event,reload:e.reload,selectedDay:o})]})})};function WT(e,t,n={}){const{localEvent:i,updateLocalEvent:s}=Jv(),[o,r]=M.useState("function"==typeof n.deserialize?n.deserialize(i?.[e])||t:i?.[e]??t);return[o,M.useCallback(async t=>{r(t),await s({[e]:"function"==typeof n.serialize?n.serialize(t):t})},[e,r,s])]}const GT=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=cl(),[r,a]=WT("user.accreditations.display","calendar");return(0,i.jsx)(UT,{...e,accreditationsDisplay:r,actions:(0,i.jsx)(Ib,{rolesTypes:cI,children:(0,i.jsx)(jl,{to:Os.EDIT_ACCREDIT(t,n,s),children:o("_diter_les_accr_86042")})}),setAccreditationsDisplay:a})},HT=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=cl(),{isEventAdmin:r}=Jv(),a=(0,M.useMemo)(()=>eo(e.organization.userInfo.formsUsersInfos.filter(e=>eo(e.accreditationsSlots)))||(e.event?.hasFormWithAccreditationDisplay??!1),[e.organization,e.event]);return(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,children:[eo(e.event.volunteerRegistration.accreditationsUsersInfos)&&(0,i.jsx)(GT,{event:e.event,reload:e.reload,renderAccreditation:(e,s)=>(0,i.jsx)(Ha,{style:{width:"100%"},to:Ji.ACCREDITATION({organizationId:t,eventId:n,accreditationId:s}),children:e}),subtitle:o("visualisez_tout_53227"),title:o("accr_ditations_33155")}),a&&(0,i.jsx)(MT,{canEdit:r,editPath:Os.EDIT_USER_ACCREDITATIONS(t,n,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(Ba,{height:"8"})]})},qT=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Zn(),{data:s,loader:o,reload:r}=Yn("query UserProfileAccreditations(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n formsUsersInfos(eventId: $eventId, level: Event) {\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n index\n }\n\n accreditationCategory {\n name\n }\n }\n\n form {\n id\n name\n }\n }\n }\n }\n\n event(id: $eventId) {\n name\n dayStartTime\n startAt\n endAt\n hasFormWithAccreditationDisplay\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n accreditationsUsersInfos {\n ...UserPanelAccreditationSlotUserInfo\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ms.UserPanelAccreditationSlotUserInfoFragment]);return o||(0,i.jsx)(HT,{event:s.event,organization:s.organization,reload:r})},YT=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl(),{organization:r,hasFeature:a}=_I(),{event:l,isEventAdmin:d}=Jv(),{canDocumentRead:c,canMemberAccredit:u,canMemberAssignmentStateEdit:h,canMemberDelete:m}=lS(),{mutate:g,isLoading:p}=Wo(),{mutate:f,isLoading:x}=Zo(),{mutate:_,isLoading:I}=Zo(),{mutate:v,isLoading:b}=Zo(),{mutate:j}=$o(),{mutate:C}=No(),{mutate:y,isLoading:k}=qo(),{mutate:A,isLoading:w}=qo(),[S,E]=(0,M.useState)(!1),[T,z]=(0,M.useState)(!1),O=(0,M.useMemo)(()=>(0,ic.A)(e.customDocuments.filter(t=>Dk(t.populationsIds,e.userInfo.fields.population)),e=>e.name),[e.customDocuments,e.userInfo]),{permissions:[R]}=Vy(((...e)=>({name:"canUserInfoAssignFn",args:e}))(e.userInfo.id)),$=c&&(e.links&&(e.state===Ot.Assigned||eo(r.customBadges))||eo(O)),D=d&&l.useDelegations&&a(Fe.Delegation)&&e.delegation,P={lang:e.userInfo.language};return(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(R||h)&&(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("affectation")}),h&&(e.state===Ot.Assigned||e.state===Ot.Refused||e.state===Ot.NotApplicable||e.state===Ot.PreAssigned)&&(0,i.jsx)(jl,{color:"white",isLoading:x,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await f({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Ot.WaitingAssignment}}),e.reload()},children:o("changer_le_stat_90266")}),h&&(e.state===Ot.Assigned||e.state===Ot.WaitingAssignment||e.state===Ot.NotApplicable||e.state===Ot.PreAssigned)&&(0,i.jsx)(jl,{color:"white",isLoading:I,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await _({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Ot.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),h&&(e.state===Ot.WaitingAssignment||e.state===Ot.Assigned)&&(0,i.jsx)(jl,{color:"white",isLoading:b,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await v({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Ot.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),R&&e.state===Ot.Assigned&&(0,i.jsx)(jl,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:Os.EDIT_ASSIGNMENT(n,s,e.userInfo.id),children:o("_diter_les_affe_42283")}),R&&(e.state===Ot.WaitingAssignment||e.state===Ot.PreAssigned)&&(0,i.jsx)(jl,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:Os.ASSIGNMENT(n,s,e.userInfo.id),children:o("affecter_94255")}),R&&e.state===Ot.Assigned&&(0,i.jsx)(jl,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:Te.Assignments})},children:o("r_envoyer_l_e_65315")}),d&&e.state===Ot.Refused&&(0,i.jsx)(jl,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:Te.Refused})},children:o("r_envoyer_l_e_06733")})]}),u&&(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Accreditation")}),(e.accreditationState===re.NotApplicable||e.accreditationState===re.Refused||e.accreditationState===re.Accredited||e.accreditationState===re.AutoAccredited)&&(0,i.jsx)(jl,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await A({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:re.WaitingAccreditation}}),e.reload()},children:o("changer_le_stat_20528")}),(e.accreditationState===re.Accredited||e.accreditationState===re.AutoAccredited||e.accreditationState===re.WaitingAccreditation||e.accreditationState===re.NotApplicable)&&(0,i.jsx)(jl,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await A({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:re.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),(e.accreditationState===re.WaitingAccreditation||e.accreditationState===re.Accredited||e.accreditationState===re.AutoAccredited)&&(0,i.jsx)(jl,{color:"white",isLoading:k,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await y({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:re.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),e.accreditationState===re.Accredited&&(0,i.jsx)(jl,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:Os.EDIT_ACCREDIT(n,s,e.userInfo.id),children:o("_diter_les_accr_86042")}),(e.accreditationState===re.AutoAccredited||e.accreditationState===re.WaitingAccreditation)&&(0,i.jsx)(jl,{color:"white",leftIcon:"badge-check",rightIcon:"arrow-right",to:Os.ACCREDIT(n,s,e.userInfo.id),children:o("accr_diter_70543")}),(e.accreditationState===re.Accredited||e.accreditationState===re.AutoAccredited)&&(0,i.jsx)(jl,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:Te.Accreditations})},children:o("r_envoyer_l_e_24677")})]}),$&&(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Documents")}),$&&e.state===Ot.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.nameOrEmail}-assignments`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userAssignmentsLink,"pdf",P),children:o("t_l_charger_la_82882")}),(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userPlanningLink,"pdf",P),children:o("t_l_charger_le_74660")}),(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-days`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userPlanningDaysLink,"pdf",P),children:o("t_l_charger_le_43587")}),(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-list`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userPlanningListLink,"pdf",P),children:o("t_l_charger_le_58518")}),(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.nameOrEmail}-user-hours`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userHoursLink,"pdf",P),children:o("t_l_charger_les_98537")}),a(Fe.Documents)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.nameOrEmail}-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userBadgeLink,"pdf",P),children:o("t_l_charger_le_53240")}),(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.nameOrEmail}-certificate`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userCertificateLink,"pdf",P),children:o("t_l_charger_l_a_02386")})]})]}),r.customBadges.map(t=>(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.nameOrEmail}-custom-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userCustomBadgeLinks[t],"pdf",P),children:o("t_l_charger_1_80752",z_(t))},t)),O.map((t,n)=>(0,i.jsx)(jl,{color:"white",download:`${e.userInfo.name}-custom-document`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:rg(e.links.userCustomDocumentLinks[t.slug],"pdf",P),children:o("t_l_charger_1_80752",t.name)},n))]}),m&&(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("g_n_ral_64953")}),D&&(0,i.jsx)(jl,{color:"white",leftIcon:"minus",rightIcon:"arrow-right",onClick:()=>E(!0),children:o("retirer_de_la_d_64963")}),(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>z(!0),children:o("d_sinscrire_de_06416")})]}),D&&S&&(0,i.jsx)(Pk,{buttonText:o("retirer_de_la_d_64963"),subtext:[o("_tes_vous_sur_d_34901",e.delegation.name)],text:o("suppression_de_73669",e.userInfo.name),onClose:()=>E(!1),onDelete:async()=>{await j({organizationId:r.id,eventId:s,delegationId:e.delegation.id,selecteds:{ids:[e.userInfo.id]}}),t.push(Os.VOLUNTEERS(n,s))}}),T&&(0,i.jsx)(Pk,{buttonText:o("d_sinscrire_27046"),subtext:[o("_tes_vous_s_r_d_29576"),o("_1_sera_toujou_13334",e.userInfo.nameOrEmail)],text:o("d_sinscription_69522",e.userInfo.nameOrEmail),onClose:()=>z(!1),onDelete:async()=>{await C({eventId:s,selecteds:{ids:[e.userInfo.id]}}),t.push(Os.VOLUNTEERS(n,s))}}),(0,i.jsx)(Ba,{height:"8"})]})},KT=()=>{const{params:{eventId:e,userInfoId:t}}=cl(),{data:n,loader:s,reload:o}=Yn("query UserOverlayActionsEvent($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n customDocuments {\n ...CustomDocumentPopulation\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n accreditationState\n state\n\n delegation {\n id\n name\n }\n\n userInfo {\n ...UserInfoOverlay\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n }\n }\n }\n}\n",{eventId:e,userInfoId:t},[Ms.CustomDocumentPopulationFragment,Ms.UserInfoOverlayFragment,Ms.UserInfoLinksFragment]);if(s)return s;{const e=n.event.volunteerRegistration;return(0,i.jsx)(YT,{accreditationState:e.accreditationState,customDocuments:n.event.customDocuments,delegation:e.delegation,links:e.userInfo.links,reload:o,state:e.state,userInfo:e.userInfo})}},ZT=e=>{const{history:t,params:{organizationId:n},translate:s}=cl(),{mutate:o}=function(e={}){return Kn("mutation UserInfoAdminDelete($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n userInfoAdminDelete(organizationId: $organizationId, userInfoId: $userInfoId) {\n id\n }\n}\n",e)}(),[r,a]=(0,M.useState)(!1);return(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("g_n_ral_64953")}),(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>a(!0),children:s("supprimer_43083")}),r&&(0,i.jsx)(Pk,{buttonText:s("supprimer_43083"),subtext:[s("_tes_vous_s_r_d_53083"),s("cette_action_es_08212")],text:s("suppression_de_04261",e.userInfo.nameOrEmail),onClose:()=>a(!1),onDelete:async()=>{await o({organizationId:n,userInfoId:e.userInfo.id}),t.push(ji.COMMUNITY_USERS({organizationId:n}))}})]})},XT=()=>{const{params:{organizationId:e,userInfoId:t}}=cl(),{data:n,loader:s}=Yn("query UserOverlayActionsOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n }\n }\n}\n",{organizationId:e,userInfoId:t},[Ms.UserInfoOverlayFragment]);return s||(0,i.jsx)(ZT,{userInfo:n.organization.userInfo})},JT=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=cl(),r=Gn(Gv),a=Gn(Wc),{mutate:l}=bo(),{data:d}=Co({organizationId:n,eventId:s,userInfoId:o}),c=(0,M.useMemo)(()=>{const n=r.createUpdateCampaignValuesDefault(!1,d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,null,null),i=d.organization?.userInfo?.name||"",s=a.toLocaleString(Bs.c9.now(),Zs.FullDateTime);return{...n,campaign:{...n.campaign,name:e.campaignType===ce.Sms?t("sms_1_le_2_25252",i,s):t("e_mail_1_le_21805",i,s),campaignType:e.campaignType,state:de.InProgress,sendToEveryone:!1,usersInfosIds:[o]}}},[e.campaignType,d.organization]);return(0,i.jsx)(fl,{initialValues:c,render:n=>(0,i.jsxs)(hu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nj,{children:e.campaignType===ce.Sms?t("envoi_d_un_sms_22148"):t("envoi_d_un_emai_99336")}),(0,i.jsx)(mu,{css:{padding:"$6"},children:e.campaignType===ce.Email?(0,i.jsx)(zv,{canCustomDocuments:e.canCustomDocuments,customDocuments:d.organization?.event?.customDocuments??[],emailSenderId:d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,emailsSenders:d.organization?.emailsSenders??[],form:n.form,values:n.values}):(0,i.jsx)(Fv,{formProps:n})}),(0,i.jsx)(gu,{children:(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")}),(0,i.jsx)(jl,{isLoading:n.submitting,onClick:n.handleSubmit,children:t("envoyer_26609")})]})})]}),onSubmit:async t=>{await l({organizationId:n,eventId:s,campaign:t.campaign}),e.onClose()}})},QT=e=>{const t=Hn(),n=Gn(Bl),{mutate:s}=function(e={}){return Kn("mutation EmailUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $email: UserEmail!\n) {\n emailUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n userInfoId: $userInfoId\n email: $email\n )\n}\n",e)}();return(0,i.jsx)(Tj,{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 s({email:t.email,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.userInfoId}),e.onClose(),e.onSuccess()},children:(0,i.jsx)(Rl,{label:t("adresse_e_mail_60930"),name:"email"})})},ez=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{hasFeature:o}=_I(),{event:r}=Jv(),[a,l]=(0,M.useState)(!1),[d,c]=(0,M.useState)(!1),[u,h]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"4",width:1,children:[(0,i.jsx)(qg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:88}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(br,{font:"gray800 textXl medium",children:e.userInfo.name}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("Email")}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Jd,{color:"white",cursor:"pointer",leftIcon:"at",rightIcon:"chevron-down",size:"md",children:e.userInfo.email})}),(0,i.jsxs)(Vd,{placement:"bottom-start",children:[(0,i.jsx)(Ld,{icon:"copy",onClick:()=>{xS(e.userInfo.email)},children:t("copier_1_59210",e.userInfo.email)}),e.canEditEmail&&(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{l(!0)},children:t("modifier_1_38587",e.userInfo.email)}),(0,i.jsx)(Ld,{icon:"at",onClick:()=>c(!0),children:t("_crire_1_90053",e.userInfo.email)})]})]})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("t_l_phone_31755")}),m(e.userInfo.phone?.internationalFormat)?(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Jd,{color:"white",cursor:"pointer",leftIcon:"phone",rightIcon:"chevron-down",size:"md",children:e.userInfo.phone?.internationalFormat??"-"})}),(0,i.jsxs)(Vd,{placement:"bottom-start",children:[(0,i.jsx)(Ld,{color:"default",icon:"copy",onClick:()=>xS(e.userInfo.phone.internationalFormat),children:t("copier_1_59210",e.userInfo.phone?.internationalFormat??"-")}),(0,i.jsx)(Ha,{to:{pathname:`tel:${e.userInfo.phone.internationalFormat.replaceAll(" ","")}`},children:(0,i.jsx)(Ld,{color:"default",icon:"phone",children:t("appeler_1_57163",e.userInfo.phone?.internationalFormat??"-")})}),o(Fe.Sms)&&(0,i.jsx)(Ld,{icon:"phone",onClick:()=>h(!0),children:t("_crire_1_90053",e.userInfo.phone?.internationalFormat??"-")})]})]}):(0,i.jsx)(br,{color:"gray500",children:"-"})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:e.populationFieldName}),(0,i.jsx)(br,{color:"gray500",children:m(e.userInfo.population)?e.userInfo.population:"-"})]}),e.assignmentState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("status_d_affect_75769")}),(0,i.jsx)(Ra,{children:(0,i.jsx)(Jd,{...Yb(e.assignmentState),children:t(e.assignmentState)})})]})}),e.accreditationState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("statut_d_accr_d_75527")}),(0,i.jsx)(Ra,{children:(0,i.jsx)(Jd,{...Kb(e.accreditationState),children:t(e.accreditationState)})})]})})]})]})]}),a&&(0,i.jsx)(QT,{email:e.userInfo.email,eventId:s,organizationId:n,userInfoId:e.userInfo.id,onClose:()=>{l(!1)},onSuccess:e.reload}),d&&(0,i.jsx)(JT,{campaignType:ce.Email,canCustomDocuments:!!s&&r?.useDocuments,onClose:()=>c(!1)}),u&&(0,i.jsx)(JT,{campaignType:ce.Sms,canCustomDocuments:!1,onClose:()=>h(!1)})]})},tz=()=>(0,i.jsxs)(Ra,{gap:"4",width:1,children:[(0,i.jsx)(ec,{size:88,variant:"circular"}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(ec,{borderRadius:"$1",height:28,width:200}),(0,i.jsx)(ec,{borderRadius:"$1",height:48,width:1})]})]}),nz=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=cl(),a=Gn(Wc),{mutate:l}=ir(),d=e.campaign.sentAt?.setZone(Bs.c9.local().zone),c=(0,M.useMemo)(()=>e.campaign.campaignType===ce.Email&&e.campaign.email?e.campaign.email.state:null,[e.campaign]),u=(0,M.useMemo)(()=>e.campaign.campaignType===ce.Sms&&e.campaign.textMessage?e.campaign.textMessage.state:null,[e.campaign]);return(0,i.jsxs)(Tc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{t.push(jI.CAMPAIGN({organizationId:e.campaign.organizationId,eventId:e.campaign.eventId||void 0,campaignId:e.campaign.id}))},children:[(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(br,{color:"gray800",children:e.campaign.name}),d&&(0,i.jsx)(br,{color:"gray500",children:n("envoy_e_le_1_31494",a.toLocaleString(d,Zs.DateOnly.MonthLong),a.toLocaleString(d,Zs.TimeOnly))})]})}),(0,i.jsxs)(yc,{width:150,children:[(0,i.jsx)(br,{width:22,children:e.campaign.campaignType===ce.Email?(0,i.jsx)(Ya,{icon:"at"}):(0,i.jsx)(Ya,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsxs)(yc,{width:200,children:[c&&(0,i.jsx)(Jd,{...Wb(c),children:n(c)}),u&&(0,i.jsx)(Jd,{...tj(u),children:n(u)})]}),(0,i.jsx)(yc,{children:(0,i.jsx)(br,{css:{ellipsis:!0},children:e.campaign.event?.name??n("communaut_20896")})}),(0,i.jsx)(Uc,{justify:"end",children:(0,i.jsx)(Bc,{children:(0,i.jsx)(Ld,{icon:"paper-plane",onClick:async()=>{await l({organizationId:s,eventId:o,campaignId:e.campaign.id,selecteds:{ids:[r]}})},children:n("r_envoyer_90741")})})})]})},iz=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=cl(),{data:s,isLoading:o,reload:r}=Yn("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)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:e("nom_de_la_campa_45063")}),(0,i.jsx)(Fc,{width:150,children:e("type_35427")}),(0,i.jsx)(Fc,{width:200,children:e("status_06428")}),(0,i.jsx)(Fc,{children:e("_v_nement_22345")}),(0,i.jsx)(Fc,{width:100})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):s.organization.userInfo.campaigns.nodes.map(e=>(0,i.jsx)(nz,{campaign:e,reload:r},e.id))]})},sz=e=>{const{translate:t}=cl(),n=Gn(Wc),s=(0,M.useMemo)(()=>Object.values((0,nc.A)(e.vr.positionsSlotsUsersInfos,e=>e.position.id)).map(e=>{const t=e[0].position;return{id:t.id,text:m(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]),o=(0,M.useMemo)(()=>Object.values((0,nc.A)(e.vr.accreditationsUsersInfos,e=>e.accreditation.id)).map(e=>{const t=e[0].accreditation;return{id:t.id,text:m(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]);return(0,i.jsxs)(Tc,{children:[(0,i.jsxs)(yc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(br,{children:e.vr.event.name}),(0,i.jsx)(br,{color:"gray500",children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt.toLocal(),Zs.DateTime))})]}),(0,i.jsx)(yc,{children:(0,i.jsx)(ly,{badges:s})}),(0,i.jsx)(yc,{children:(0,i.jsx)(ly,{badges:o})}),(0,i.jsx)(yc,{children:e.vr.delegation&&(0,i.jsx)(Jd,{ellipsis:!0,children:e.vr.delegation.name})})]})},oz=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=cl(),{data:s,isLoading:o}=Yn("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)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Fc,{children:e("missions_63972")}),(0,i.jsx)(Fc,{children:e("accr_ditations_39450")}),(0,i.jsx)(Fc,{children:e("Delegation")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):s.organization.userInfo.volunteersRegistrations.map(e=>(0,i.jsx)(sz,{vr:e},e.id))]})},rz=e=>{const{translate:t}=cl(),n=Gn(Wc);return(0,i.jsxs)(Tc,{children:[(0,i.jsxs)(yc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(br,{children:e.fui.form.name}),(0,i.jsx)(br,{color:"gray500",children:t("rempli_le_1_29292",n.toLocaleString(e.fui.insertedAt.toLocal(),Zs.DateTime))})]}),(0,i.jsx)(yc,{children:(0,i.jsx)(br,{css:{ellipsis:!0},children:e.fui.event?.name??t("communaut_20896")})})]})},az=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=cl(),{data:s,isLoading:o}=Yn("query UserHistoryForms($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n formsUsersInfos {\n id\n insertedAt\n\n form {\n name\n }\n\n event {\n name\n }\n }\n }\n }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:"Nom du formulaire"}),(0,i.jsx)(Fc,{children:e("_v_nement_22345")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):s.organization.userInfo.formsUsersInfos.map(e=>(0,i.jsx)(rz,{fui:e},e.id))]})},lz=e=>{const t=Gn(Wc),{organization:n}=_I(),s=(0,M.useMemo)(()=>Bs.c9.fromISO(e.weezeventWebhook.data?.values?.validated)?.isValid?Bs.c9.fromISO(e.weezeventWebhook.data?.values?.validated):e.weezeventWebhook.insertedAt,[e.weezeventWebhook]),o=e.weezeventWebhook.checklist?ag(n.weezeventOrganizationId,e.weezeventWebhook.checklist.id):"";return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Vc,{to:o,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.weezeventWebhook.checklist?.name??"-",width:1,children:e.weezeventWebhook.checklist?.name??"-"})})}),(0,i.jsx)(yc,{children:t.toLocaleString(s,{...Zs.DateTime,weekday:"long"})}),(0,i.jsx)(yc,{children:e.weezeventWebhook.data?.values?.partner_name??"-"})]})},dz=()=>{const{translate:e,params:{eventId:t,userInfoId:n}}=cl(),{data:s,isLoading:o}=Yn('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)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:e("liste_de_contr_79815")}),(0,i.jsx)(Fc,{children:e("Date")}),(0,i.jsx)(Fc,{children:e("op_rateur_30804")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):s.event.volunteerRegistration.weezeventWebhooks.nodes.map(e=>(0,i.jsx)(lz,{weezeventWebhook:e},e.id))]})},cz=e=>{const{translate:t,params:n}=cl(),{event:s}=Jv(),o={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"},r=s?.useCampaigns??!0,a=s?.useForms??!0,l=e.isEvent&&e.isWeezeventConnected;return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,overflow:"hidden",paddingTop:"$5"},direction:"column",gap:"5",children:[(0,i.jsx)(br,{css:{px:"$6"},font:"gray900 textMd semiBold",children:"Historique"}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$6"},children:[(0,i.jsx)(Db,{path:BI.MEMBER_HISTORY_EVENTS(n),children:t("Event")}),r&&(0,i.jsx)(Db,{path:BI.MEMBER_HISTORY_CAMPAIGNS(n),children:t("Campaigns")}),a&&(0,i.jsx)(Db,{path:BI.MEMBER_HISTORY_FORMS(n),children:t("Form_plural")}),l&&(0,i.jsx)(Db,{path:BI.MEMBER_HISTORY_SCANS(n),children:"Scans"})]}),(0,i.jsx)(Fb,{path:BI.MEMBER_HISTORY_EVENTS(o),children:(0,i.jsx)(oz,{})}),r&&(0,i.jsx)(Fb,{path:BI.MEMBER_HISTORY_CAMPAIGNS(o),children:(0,i.jsx)(iz,{})}),a&&(0,i.jsx)(Fb,{path:BI.MEMBER_HISTORY_FORMS(o),children:(0,i.jsx)(az,{})}),l&&(0,i.jsx)(Fb,{path:BI.MEMBER_HISTORY_SCANS(o),children:(0,i.jsx)(dz,{})})]})]})},uz=e=>(0,i.jsx)(br,{color:"gray800",css:{overflow:"hidden",textOverflow:"ellipsis",...e.css},fontSize:"textSm",fontWeight:"medium",children:e.children}),hz=e=>(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(uz,{children:e.field.name}),(0,i.jsx)(JA,{field:e.field,fields:e.fields})]});function mz(e,t){return{name:t("commentaire_r_12290"),slug:`form${e}`,fieldType:Le.Textarea,values:[]}}const gz=e=>{const{translate:t}=cl(),n=Gn(Wc),[s,o]=(0,M.useState)(!0),r=(0,M.useCallback)(async()=>{const t=!s;o(t),await rI.forms.put({id:e.form.id,isOpenInUserOverlay:t})},[s,o]),a=(0,M.useMemo)(()=>e.form.elements.flatMap(e=>e.elementType===Ue.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.form]),l=(0,M.useMemo)(()=>e.form.elements.filter(t=>t.elementType===Ue.Field?Lj(t.customField,e.userInfo.fields,a):t.elementType===Ue.Section&&Lj(t,e.userInfo.fields,a)),[a,e.form.elements,e.userInfo.fields]),d=e.canEdit&&!1!==e.form.isEditableInMemberSpace,c="all"!==e.form.id?mz(e.form.id,t):null;return(0,M.useEffect)(()=>{(async()=>{o((await rI.forms.get(e.form.id))?.isOpenInUserOverlay??!0)})()},[]),(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",padding:"$5 $6",userSelect:"none"},gap:"4",onClick:r,children:[(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:s?"chevron-up":"chevron-down"})}),(0,i.jsxs)(Ra,{align:"start",css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{children:e.form.name}),e.showIsFilled?e.filledAt?(0,i.jsx)(Jd,{color:"success",size:"sm",children:t("rempli_le_1_29292",n.toLocaleString(e.filledAt.toLocal(),Zs.DateTime))}):(0,i.jsx)(Jd,{color:"error",size:"sm",children:t("non_rempli_80877")}):null]}),d&&(0,i.jsx)(jl,{color:"white",size:"sm",to:e.getEditUserFormPath(e.form.id),children:t("_diter_62574")})]}),s&&(0,i.jsxs)(Ra,{css:{borderTop:"1px solid $gray200",padding:"$6"},direction:"column",children:[l.map((t,n)=>{switch(t.elementType){case Ue.Field:return(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(hz,{field:t.customField,fields:e.userInfo.fields}),n!==l.length-1&&(0,i.jsx)(Ba,{height:"6"})]},t.id);case Ue.Section:return(0,i.jsxs)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t.section}),n!==l.length-1&&(0,i.jsx)(Ba,{height:"4"})]},t.id);case Ue.Text:return null;default:return nl(t.elementType)}}),c&&m(e.userInfo.fields[c.slug])&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("inscription_en_49989")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(hz,{field:c,fields:e.userInfo.fields})]})]})]})};function pz(e,t){switch(e){case Le.Text:case Le.Textarea:return"text";case Le.Checkbox:return"square-check";case Le.Validation:return"check";case Le.Select:return"population"===t?"users":"list-ul";case Le.Date:return"calendar";case Le.Datetime:return"calendar-day";case Le.Time:return"clock";case Le.File:return"file";case Le.Phone:return"phone";case Le.Language:return"language";case Le.Number:return"00";case Le.Sex:return"venus-mars";case Le.Nationality:case Le.Country:return"flag";case Le.Address:return"map-location";default:return nl()}}function fz(e){return(0,ic.A)(Object.entries((0,nc.A)(e,e=>e.category.name)),([e])=>e).flatMap(([e,t])=>[{id:L(),elementType:Ue.Section,section:e,hasCondition:!1,conditionValue:!1}].concat(t.map(e=>({id:L(),elementType:Ue.Field,customField:e,hasCondition:!1,conditionValue:!1}))))}const xz=e=>(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(Ya,{icon:e.icon}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:e.title})]}),e.children]}),_z=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl();return(0,i.jsx)(xz,{icon:"people-group",title:n("d_l_gations_78318"),children:(0,i.jsx)(Ra,{gap:"2",wrap:"wrap",children:e.delegations.map(e=>{const n=o?e.name:e.event?`${e.event.name} : ${e.name}`:e.name;return(0,i.jsx)(Jd,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{t.push(e.event?as.DELEGATION({organizationId:s,eventId:e.event.id,delegationId:e.id}):Os.COMMUNITY_DELEGATION(s,e.id))},children:n},e.id)})})})},Iz=e=>{const{history:t,translate:n}=cl(),s=Gn(Wc),[o,r]=(0,M.useState)(!1),a=(0,M.useMemo)(()=>e.customFields.filter(e=>e.isPrivate),[e.customFields]),l=(0,M.useMemo)(()=>eo(e.profilePrivateFields)?e.profilePrivateFields:a.map(e=>e.slug),[a,e.profilePrivateFields]),d=(0,M.useMemo)(()=>(0,ic.A)(a.filter(t=>l.includes(t.slug)&&Lj(t,e.userInfo.fields,e.customFields)),({slug:e})=>l.indexOf(e)),[e.customFields,a,l]),c=(0,M.useCallback)(async t=>{await e.profilePrivateFieldsUpdate(t),e.reload()},[e.profilePrivateFieldsUpdate,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(xz,{icon:"lock-keyhole",title:n("informations_pr_15873"),children:[d.map(t=>(0,i.jsx)(hz,{field:t,fields:e.userInfo.fields},t.slug)),(0,i.jsx)(br,{css:{textTransform:"uppercase"},font:"gray500 textXs regular",children:n("inscrit_le_1_12018",s.toLocaleString(e.insertedAt.toLocal(),Zs.DateTime))}),(0,i.jsx)(Ib,{rolesTypes:cI,children:(0,i.jsx)(wS,{color:"white",menu:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ld,{icon:"gear",onClick:()=>{r(!0)},children:n("g_rer_les_champ_00431")})}),onClick:()=>t.push(e.getEditUserFormPath("private")),children:n("_diter_62574")})})]}),o&&(0,i.jsx)(_u,{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})]})},vz=e=>{const{translate:t}=cl();return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(Ya,{icon:"users-viewfinder"}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("profils_li_s_03417")})]}),e.usersInfos.map(e=>(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(Ub,{size:32,userInfo:e}),eo(e.delegations)&&(0,i.jsx)(Ra,{css:{paddingLeft:"44px"},gap:"2",wrap:"wrap",children:e.delegations.map(e=>(0,i.jsx)(Jd,{color:"white",size:"md",children:e.name},e.id))})]},e.id))]})},bz=({team:{organizationId:e,eventId:t,formId:n,teamCode:s,teamMembers:o}})=>{const r=Hn(),a=ng({organizationId:e,eventId:t,formId:n,teamCode:s}),{isLoading:l,copy:d}=_S(),c=(0,M.useCallback)(()=>{d(ng({organizationId:e,eventId:t,formId:n,teamCode:s}))},[e,t,n,s]);return(0,i.jsxs)(xz,{icon:"user-group",title:(0,i.jsxs)(i.Fragment,{children:[r("_quipe_76857")," ",(0,i.jsxs)(Gm,{font:"gray500 textSm regular",children:["(",s,")"]})]}),children:[o.map(e=>(0,i.jsx)(Ub,{size:32,userInfo:e},e.id)),(0,i.jsxs)(Ra,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(Ha,{to:a,children:r("lien_d_invitati_45319")}),(0,i.jsx)(jl,{color:"white",isLoading:l,rightIcon:"copy",size:"sm",onClick:c})]})]})},jz=e=>{const{translate:t,params:{eventId:n}}=cl(),{isEventAdmin:s}=Jv(),o=Gn(Wc),{mutate:r}=function(e={}){return Kn("mutation VolunteerRegistrationTicketIdRegenerate(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n volunteerRegistrationTicketIdRegenerate(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n ) {\n id\n ticketId\n }\n}\n",e)}(),[a,l]=(0,M.useState)(!1),d=(0,M.useMemo)(()=>m(e.volunteerRegistration.weezevent.lastSynchronizedAt)&&Bs.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt)?.isValid?o.toLocaleString(Bs.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt).toLocal(),Zs.DateTime):"-",[e.volunteerRegistration]),c=(0,M.useMemo)(()=>e.volunteerRegistration.weezeventPairedAt?.isValid?o.toLocaleString(e.volunteerRegistration.weezeventPairedAt.toLocal(),Zs.DateTime):"-",[e.volunteerRegistration]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(Ya,{icon:"memo-circle-info"}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("informations_22954")})]}),(0,i.jsxs)(Ra,{align:"center",gap:"5",children:[(0,i.jsx)(jy,{nameOrEmail:e.nameOrEmail,size:64,ticketId:e.volunteerRegistration.ticketId}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("TicketId")}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Jd,{color:"white",cursor:"pointer",leftIcon:"ticket",rightIcon:"chevron-down",size:"md",children:e.volunteerRegistration.ticketId})}),(0,i.jsxs)(Vd,{placement:"bottom-start",children:[(0,i.jsx)(Ld,{icon:"copy",onClick:()=>{xS(e.volunteerRegistration.ticketId)},children:t("copier_75889")}),m(e.volunteerRegistration.weezeventTicketUrl)&&(0,i.jsx)(Ha,{to:e.volunteerRegistration.weezeventTicketUrl,children:(0,i.jsx)(Ld,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_97529")})}),m(e.volunteerRegistration.weezeventPayUrl)&&(0,i.jsx)(Ha,{to:e.volunteerRegistration.weezeventPayUrl,children:(0,i.jsx)(Ld,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_14636")})}),s&&(0,i.jsx)(Ld,{icon:"repeat",onClick:()=>l(!0),children:t("r_g_n_rer_le_co_81294")})]})]})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("num_ro_de_puce_50039")}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:m(e.volunteerRegistration.shortTag)?e.volunteerRegistration.shortTag:"-"})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("derni_re_synchr_59823")}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:d})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("appair_le_70213")}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:c})]})]})]}),a&&(0,i.jsx)(Pk,{buttonText:t("r_g_n_rer_37440"),subtext:[t("_tes_vous_s_r_d_57752"),t("cela_rendra_l_a_42228")],text:t("r_g_n_rer_le_co_81294"),onClose:()=>l(!1),onDelete:async()=>{await r({eventId:n,volunteerRegistrationId:e.volunteerRegistration.id}),e.reload()}})]})},Cz=e=>{const{translate:t,params:{eventId:n,userInfoId:s}}=cl(),{isOrganizationAdmin:o,organization:r}=_I(),{event:a,hasPermission:l}=Jv(),d=n?a?.useForms&&l(xb.MEMBER_EDIT):o,[c,u]=(0,M.useState)(""),[h,g]=(0,M.useState)(e.initialShowNotFilled),p=(0,M.useCallback)(t=>{g(t),e.setShowNotFilled(t)},[e.setShowNotFilled,g]),f=(0,M.useMemo)(()=>Object.fromEntries(e.formsUsersInfos.map(e=>[e.formId,e.insertedAt])),[e.formsUsersInfos]),x=(0,M.useMemo)(()=>(0,ic.A)(e.forms.filter(e=>!(!h&&void 0===f[e.id])&&(!m(c)||e.name.toLowerCase().includes(c.toLowerCase().trim()))),[e=>void 0!==f[e.id]?1:2,e=>e.name]),[e.forms,f,c,h]),_=(0,M.useMemo)(()=>eo(e.delegations)&&(!n||a?.useDelegations),[a,n,e.delegations]),I=(0,M.useMemo)(()=>e.formsUsersInfos.filter(e=>m(e.teamCode)),[e.formsUsersInfos]),v=(0,M.useMemo)(()=>!eo(I)||!n||a?.useForms,[I,n,a]),b=(0,M.useMemo)(()=>e.usersInfos.filter(e=>e.id!==s),[e.usersInfos,s]),j=(0,M.useMemo)(()=>py(e.userPermissions,t),[e.userPermissions,r]);return(0,i.jsxs)(Ra,{gap:"6",width:1,children:[(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"4",children:[e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(jz,{nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$4"},gap:"2",children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_f_28561"),value:c,onChange:u})}),(0,i.jsx)(dc,{state:h?"checked":"unchecked",onClick:e=>{p("checked"===e)},children:t("afficher_les_fo_84832")})]}),(0,i.jsx)(Ra,{direction:"column",gap:"3",children:0===x.length?(0,i.jsx)(Ra,{css:{background:"white",bd:!0},height:400,children:(0,i.jsx)(xk,{button:(0,i.jsx)(Ib,{permissions:xb.MEMBER_EDIT,children:(0,i.jsx)(jl,{to:e.getEditUserFormPath("all"),children:t("_diter_les_cham_66020")})}),title:t("aucun_formulair_41857")})}):x.map(t=>(0,i.jsx)(gz,{canEdit:d,filledAt:f[t.id],form:t,getEditUserFormPath:e.getEditUserFormPath,showIsFilled:"all"!==t.id,userInfo:e.userInfo},t.id))})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:348,children:[eo(j)&&(0,i.jsx)(xz,{icon:"shield",title:"Rôles",children:(0,i.jsx)(Ra,{gap:"2",wrap:"wrap",children:j.map(e=>(0,i.jsx)(ry,{badge:e},e.id))})}),eo(b)&&(0,i.jsx)(vz,{usersInfos:b}),_&&(0,i.jsx)(_z,{delegations:e.delegations}),v&&I.map((e,t)=>(0,i.jsx)(bz,{team:e},t)),(0,i.jsx)(Iz,{customFields:e.customFields,getEditUserFormPath:e.getEditUserFormPath,insertedAt:e.insertedAt,profilePrivateFields:e.profilePrivateFields,profilePrivateFieldsUpdate:e.profilePrivateFieldsUpdate,reload:e.reload,userInfo:e.userInfo})]})]})},yz=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Zn(),{localEvent:s,updateLocalEvent:o}=Jv(),{mutate:r}=function(e={}){return Kn("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}=Yn("query UserInformationsEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n ...UserAllPermissions\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n ...FormUserInfoUserProfile\n }\n\n user {\n usersInfos(organizationId: $organizationId, eventId: $eventId) {\n id\n name\n email\n\n picture {\n url\n }\n\n delegations(level: Event) {\n id\n name\n }\n }\n }\n }\n }\n\n event(id: $eventId) {\n isWeezeventConnected\n profilePrivateFields\n\n forms {\n nodes {\n ...FormUserOverlay\n }\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n insertedAt\n shortTag\n ticketId\n weezevent\n weezeventPairedAt\n weezeventPayUrl\n weezeventTicketUrl\n\n delegation {\n ...DelegationUserProfile\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ms.CustomFieldWithConditionFragment,Ms.UserInfoOverlayFragment,Ms.UserAllPermissionsFragment,Ms.FormUserInfoUserProfileFragment,Ms.FormUserOverlayFragment,Ms.DelegationUserProfileFragment]),c=(0,M.useMemo)(()=>(0,ic.A)(a.event?.forms.nodes??[],e=>e.name),[a.event]),u=(0,M.useMemo)(()=>(0,Va.A)([a.event?.volunteerRegistration.delegation]),[a.event]);return l||(0,i.jsx)(Cz,{customFields:a.organization.customFields.nodes,delegations:u,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:i=>Os.EDIT_USER_FORM(e,t,n,i),initialShowNotFilled:s?.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=>{o({showNotFilled:e})},userInfo:a.organization.userInfo,userPermissions:a.organization.userInfo,usersInfos:a.organization.userInfo.user.usersInfos,volunteerRegistration:a.event?.volunteerRegistration})},kz=()=>{const{params:{organizationId:e,userInfoId:t},translate:n}=cl(),{localOrganization:s,updateLocalOrganization:o}=_I(),{mutate:r}=function(e={}){return Kn("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}=Yn("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},[Ms.CustomFieldWithConditionFragment,Ms.FormUserOverlayFragment,Ms.UserInfoOverlayFragment,Ms.UserAllPermissionsFragment,Ms.DelegationUserProfileFragment,Ms.FormUserInfoUserProfileFragment]),c=(0,M.useMemo)(()=>{if(a.organization){const e=fz(a.organization.customFields.nodes),t={id:"all",name:n("tous_les_champs_57939"),elements:e};return(0,ic.A)(a.organization.forms.nodes,e=>e.name).concat([t])}return[]},[a.organization,n]);return l||(0,i.jsx)(Cz,{customFields:a.organization.customFields.nodes,delegations:a.organization.userInfo.delegations,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:n=>Os.COMMUNITY_EDIT_USER_FORM(e,t,n),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:a.organization.userInfo.insertedAt,isWeezeventConnected:!1,profilePrivateFields:a.organization.profilePrivateFields,profilePrivateFieldsUpdate:t=>r({organizationId:e,profilePrivateFields:t}),reload:d,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:a.organization.userInfo,userPermissions:a.organization.userInfo,usersInfos:a.organization.userInfo.user.usersInfos,volunteerRegistration:null})},Az=e=>{const{translate:t,params:{eventId:n}}=cl(),s=Gn(ah),{mutate:o}=Po(),r=(0,M.useMemo)(()=>Xs(),[]),[a,l]=(0,M.useState)(e.assignments.map(e=>({...e,checkInAt:e.checkInAt?.toLocal(),checkOutAt:e.checkOutAt?.toLocal()}))),d=(0,M.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,M.useCallback)((e,t,n)=>{l((0,cu.jM)(i=>{i.forEach(i=>{i.id===e&&(i[t]=n||void 0)})}))},[a,l]);return(0,i.jsx)(ub,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"sliders",children:t("mettre_jour_d_54198")}),(0,i.jsx)(lb,{gap:"4",children:a.map(e=>(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsxs)(br,{font:"gray800 textSm medium",children:[e.position.name," -"," ",(0,i.jsx)(Gm,{fontWeight:"regular",children:ph(s,e.positionSlot,"",{slot:{includeRange:!0}})})]}),(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)($u,{rightIcon:"xmark",value:e.checkInAt,zone:r,onChange:t=>{c(e.id,"checkInAt",t)},onRightIconClick:()=>{c(e.id,"checkInAt",null)}}),(0,i.jsx)($u,{rightIcon:"xmark",value:e.checkOutAt,zone:r,onChange:t=>{c(e.id,"checkOutAt",t)},onRightIconClick:()=>{c(e.id,"checkOutAt",null)}}),(0,i.jsx)(Ol,{shouldParseAsInt:!0,value:e.breakTime,onChange:t=>{c(e.id,"breakTime",t)}})]})]},e.id))}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{disabled:!d,onClick:async()=>{await Promise.all(a.map(e=>o({eventId:n,checkIn:{strategy:he.CheckInOut,breakTime:e.breakTime,checkInAt:e.checkInAt,checkOutAt:e.checkOutAt,positionsSlotsUsersInfosIds:[e.id]}}))),e.onClose(),e.onSuccess()},children:t("mettre_jour_85141")})})]})})},wz=e=>{const{translate:t}=cl(),n=Gn(ah),s=M.useMemo(()=>{const t=Kd(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)(Ra,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Ra,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[e.psui.positionSlot.name&&(0,i.jsx)(br,{children:e.psui.positionSlot.name}),(0,i.jsx)(br,{children:n.toDisplayString(e.psui.positionSlot.range,{hideDate:!0})})]}),e.psui.state===ue.CheckedOut&&(0,i.jsx)(Ya,{icon:"stopwatch",title:t("d_pointer_25328")}),e.psui.state===ue.CheckedIn&&(0,i.jsx)(Ya,{icon:"timer",title:t("pointer_80927")})]}),(0,i.jsx)(br,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]}),e.psui.position.id)})},Sz=e=>{const t=SA(),[n]=gh(e.dayStartTime),s=M.useMemo(()=>sh(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)(OA,{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:s.map((t,s)=>(0,i.jsx)(zA,{endAt:t.range.start,startAt:t.range.start,startHour:n,children:(0,i.jsx)(wz,{psui:t,renderPosition:e.renderPosition,startHour:n})},s))})},Ez=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{hasPermission:o}=Yv(),r=Gn(Wc),a=Gn(Kg),l=Gn(ah),{mutate:d}=Po(),c=(0,M.useMemo)(()=>ph(l,e.psui.positionSlot,"",{slot:{includeRange:!0}}),[e.psui]),u=o(xb.MEMBER_ASSIGN),h=o(xb.POSITION_READ,{positionCategoryId:e.psui.positionCategoryId,positionId:e.psui.position.id});return(0,i.jsxs)(Tc,{children:[(0,i.jsxs)(yc,{align:"center",gap:"3",children:[(0,i.jsx)(pC,{color:e.psui.position.color,icon:e.psui.position.icon}),(0,i.jsxs)(Ra,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Vc,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:ms.POSITION({organizationId:n,eventId:s,positionId:e.psui.position.id}),children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.psui.position.name,width:1,children:e.psui.position.name})}),(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),(0,i.jsx)(yc,{children:e.psui.state===ue.CheckedOut?(0,i.jsx)(Jd,{leftIcon:"clock",children:t("temps_total_79448",a.minutesToHoursMinutesString(e.psui.timeDifferenceMinutes))}):e.psui.state===ue.CheckedIn?(0,i.jsx)(Jd,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",r.toLocaleString(e.psui.checkInAt.toLocal(),Zs.DateTime))}):(0,i.jsx)(Jd,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")})}),(0,i.jsx)(yc,{children:e.psui.isAutoAssign&&(0,i.jsx)(br,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"check"})})}),(0,i.jsxs)(yc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(br,{children:e.psui.createdBy?.name??"-"}),(0,i.jsx)(br,{color:"gray500",children:r.toLocaleString(e.psui.insertedAt.toLocal(),Zs.DateTime)})]}),(0,i.jsxs)(Uc,{justify:"end",width:200,children:[h&&(e.psui.state===ue.Waiting?(0,i.jsx)(jl,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:he.CheckIn,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("pointer_80927")}):e.psui.state===ue.CheckedIn?(0,i.jsx)(jl,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:he.CheckOut,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("d_pointer_25328")}):null),(0,i.jsx)(uk,{canCheckIn:h,canDelete:u,psui:e.psui,reloadCheckIn:e.reload,onDelete:e.reload})]})]})},Tz=e=>{const{translate:t}=cl(),{hasPermission:n}=Yv(),s=n(xb.POSITION_READ),o=(0,M.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)(vc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:t("Position")}),(0,i.jsx)(Fc,{children:t("statut_du_point_52451")}),(0,i.jsx)(Fc,{children:t("affect_e_automa_74071")}),(0,i.jsx)(Fc,{children:t("ajout_e_par_71330")}),s&&(0,i.jsx)(Fc,{width:200})]}),o.map(t=>(0,i.jsx)(Ez,{psui:t,reload:e.reload},t.id))]})},zz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=cl(),{isEventAdmin:r}=Yv(),[a,l]=M.useState($_(e.event.startAt,e.event.endAt)),[d,c]=M.useState(null),[u,h]=M.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{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)(Ra,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(br,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(ol,{textStyle:"heading",children:e.title}),e.subtitle&&(0,i.jsx)(tl,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Ra,{as:"nav",gap:"3",children:["calendar"===e.positionsDisplay&&(0,i.jsx)(EA,{max:e.event.endAt,min:e.event.startAt,value:a,onChange:l}),"list"===e.positionsDisplay&&!e.hideListView&&(0,i.jsx)(br,{width:160,children:(0,i.jsx)(Tu,{rightIcon:"xmark",value:d,onChange:c,onRightIconClick:()=>c(null)})}),!e.hideListView&&e.setPositionsDisplay&&(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{value:e.positionsDisplay,onChange:e.setPositionsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:o("Calendar")}),(0,i.jsx)("option",{value:"list",children:o("List")})]})}),r&&(0,i.jsx)(jl,{to:Os.EDIT_ASSIGNMENT(t,n,s),children:o("_diter_les_affe_42283")}),r&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Vd,{placement:"bottom-end",children:(0,i.jsx)(Ld,{icon:"circle-check",onClick:()=>h(!0),children:o("mettre_jour_d_54198")})})]})]})]}),"calendar"===e.positionsDisplay?(0,i.jsx)(Sz,{assignments:e.assignments,dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,featureFlags:e.featureFlags,renderPosition:e.renderPosition,selectedDay:a,startAt:e.event.startAt}):!e.hideListView&&(0,i.jsx)(Tz,{assignments:e.assignments,reload:e.reload,selectedDay:d})]}),Az&&(0,i.jsx)(Az,{assignments:e.assignments,isOpen:u,onClose:()=>h(!1),onSuccess:()=>e.reload()})]})},Oz=e=>{const[t,n]=WT("user.positions.display","calendar");return(0,i.jsx)(zz,{...e,positionsDisplay:t,setPositionsDisplay:n})},Rz=e=>{const t=Hn(),n=Gn(ah),{mutate:s,isLoading:o}=Yo(),r=m(e.slot.name)?`${e.slot.name} - ${n.toDisplayString(e.slot.range)}`:n.toDisplayString(e.slot.range);return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:e.slot.position.name}),(0,i.jsx)(yc,{children:r}),(0,i.jsx)(yc,{justify:"end",width:200,children:(0,i.jsx)(jl,{color:"white",isLoading:o,size:"sm",onClick:async()=>{await s({eventId:e.eventId,massAssign:{strategy:Qe.Add,selecteds:{ids:[e.userInfoId]},positionsSlotsIds:[e.slot.id]}}),e.reload()},children:t("affecter_94255")})})]})},$z=e=>{const{params:{eventId:t,userInfoId:n},translate:s}=cl(),[o,r,a]=Pc(""),[l,d]=(0,M.useState)(0),[c,u]=(0,M.useState)(null),h=(0,M.useCallback)(e=>{u(e),d(0)},[u,d]),{data:g,isLoading:p}=Yn("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:m(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:x}=vu(g.event?.volunteerRegistration.availablePositionsSlots),_=g.event?.volunteerRegistration.availablePositionsSlots.nodes??[];return(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:s("rechercher_une_69998"),value:o,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mm,{attribute:at.Position,setSort:h,sort:c,children:s("nom_de_la_missi_64605")}),(0,i.jsx)(mm,{attribute:at.Range,setSort:h,sort:c,children:s("cr_neau_11117")}),(0,i.jsx)(Fc,{width:200})]}),numberOfPages:f,offset:l,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):eo(_)?_.map(n=>(0,i.jsx)(Rz,{eventId:t,reload:e.reload,slot:n,userInfoId:e.userInfoId},n.id)):(0,i.jsx)(Tc,{css:{height:"200px"},children:(0,i.jsx)(xk,{title:s("aucune_mission_03533")})}),setOffset:d,title:s("missions_dispon_68881"),totalCount:x})},Dz=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl(),r=Gn(ah),a=(0,M.useMemo)(()=>{const t=e.volunteerRegistration.preassignPositions.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:ms.POSITION({organizationId:n,eventId:s,positionId:e.id})})),i=e.volunteerRegistration.preassignPositionsCategories.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:ms.POSITION_CATEGORY({organizationId:n,eventId:s,positionCategoryId:e.id})}));return t.concat(i)},[e.volunteerRegistration]);return eo(a)?(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:o("nom_de_la_missi_64605")}),(0,i.jsx)(Fc,{children:o("Date")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:a.map((e,n)=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(br,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{t.push(e.path)},children:e.name})}),(0,i.jsx)(yc,{children:e.range})]},n))}),setOffset:Hl.A,title:o("pr_affectation_68999"),totalCount:0}):null},Pz=e=>{const{translate:t}=cl(),n=Gn(Kg);return(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(br,{font:"gray500 textSm medium",children:t("nombre_d_heures_46954")}),(0,i.jsx)(br,{font:"gray900 displaySm semiBold",children:n.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes)})]}),(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(br,{font:"gray500 textSm medium",children:t("nombre_de_missi_80367")}),(0,i.jsx)(br,{font:"gray900 displaySm semiBold",children:e.numberOfAssignments})]})]})},Fz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=cl(),r=(0,M.useMemo)(()=>(0,ic.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event]);return(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,children:[eo(r)&&(0,i.jsx)(Oz,{assignments:r,event:e.event,reload:()=>{e.reload(),r.length<=1&&e.reloadHeader()},renderPosition:(e,s)=>(0,i.jsx)(Ha,{style:{width:"100%"},to:ms.POSITION({organizationId:t,eventId:n,positionId:s}),children:e}),subtitle:o("visualisez_tout_59046"),title:o("missions_affect_97811")}),(0,i.jsx)(Dz,{volunteerRegistration:e.event.volunteerRegistration}),e.event.hasFormWithPositionDisplay&&(0,i.jsx)(bk,{editPath:Os.EDIT_USER_MISSIONS(t,n,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(Ib,{permissions:xb.MEMBER_ASSIGN,children:(0,i.jsx)($z,{reload:e.reload,userInfoId:s})}),eo(r)&&(0,i.jsx)(Pz,{numberOfAssignments:r.length,volunteerRegistration:e.event.volunteerRegistration})]})},Mz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{data:o,loader:r,reload:a}=Fo({organizationId:t,eventId:n,userInfoId:s});return r||(0,i.jsx)(Fz,{event:o.event,organization:o.organization,reload:a,reloadHeader:e.reload})},Nz=()=>{const{params:{organizationId:e,eventId:t,userInfoId:n}}=cl(),{data:s,loader:o}=Go({organizationId:e,eventId:t,userInfoId:n}),{permissions:[r],isLoading:a}=Vy(Fy({eventId:t,userInfoId:n}));return o||a?o:(0,i.jsx)(i.Fragment,{children:s.event.hasFormWithSlotDisplay&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ok,{editPath:Os.EDIT_USER_SLOTS(e,t,n),eventId:t,formsUsersInfos:s.organization.userInfo.formsUsersInfos,organizationId:e,showEditButton:r,userInfoId:n})})})},Lz=e=>{const{params:t,translate:n}=cl(),{data:s,isLoading:o,reload:r}=Yn('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,[Ms.UserInfoOverlayFragment]),a=(0,M.useMemo)(()=>s.organization?.userInfo.numberOfComments??0,[s.organization]),l={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"};Td(s.organization?.userInfo?.nameOrEmail||"");const{params:{eventId:d,delegationId:c,organizationId:u,userInfoId:h}}=cl(),{permissions:[m,g],isLoading:p}=Vy(Dy({eventId:d,organizationId:u,userInfoId:h}),((...e)=>({name:"canEmailUpdateFn",args:e}))({delegationId:c,eventId:d,organizationId:u,userInfoId:h})),f=o||p;return(0,i.jsxs)($b,{children:[(0,i.jsx)(Rb,{hideBorder:!0,children:f?(0,i.jsx)(tz,{}):(0,i.jsx)(ez,{accreditationState:s.organization?.userInfo.volunteerRegistration?.accreditationState,assignmentState:s.organization?.userInfo.volunteerRegistration?.state,canEditEmail:g,populationFieldName:s.organization?.populationField.name||"",reload:r,userInfo:s.organization.userInfo})}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:BI.MEMBER_INFORMATION(t),children:n("informations_22954")}),e.showAvailabilities&&(0,i.jsx)(Db,{path:BI.MEMBER_AVAILABILITIES(t),children:n("disponibilit_s_49923")}),e.showPositions&&(0,i.jsx)(Db,{path:BI.MEMBER_POSITIONS(t),children:n("missions_63972")}),e.showAccreditations&&(0,i.jsx)(Db,{path:BI.MEMBER_ACCREDITATIONS(t),children:n("accr_ditations_39450")}),e.showActions&&(0,i.jsx)(Db,{path:BI.MEMBER_ACTIONS(t),children:n("actions_21689")}),m&&(0,i.jsx)(Db,{path:BI.MEMBER_COMMENTS(t),children:n("commentaires_97857",a)}),e.showHistory&&(0,i.jsx)(Db,{basePath:BI.MEMBER_HISTORY(t),path:BI.MEMBER_HISTORY_EVENTS(t),children:n("historique_06296")})]}),(0,i.jsx)(Fb,{path:BI.MEMBER_INFORMATION(l),children:e.isEvent?(0,i.jsx)(Ob,{children:(0,i.jsx)(yz,{})}):(0,i.jsx)(Ob,{children:(0,i.jsx)(kz,{})})}),e.showAvailabilities&&(0,i.jsx)(Fb,{path:BI.MEMBER_AVAILABILITIES(l),children:(0,i.jsx)(Ob,{children:(0,i.jsx)(Nz,{})})}),e.showPositions&&(0,i.jsx)(Fb,{path:BI.MEMBER_POSITIONS(l),children:(0,i.jsx)(Ob,{children:(0,i.jsx)(Mz,{reload:r})})}),e.showAccreditations&&(0,i.jsx)(Fb,{path:BI.MEMBER_ACCREDITATIONS(l),children:(0,i.jsx)(Ob,{children:(0,i.jsx)(qT,{})})}),e.showActions&&(0,i.jsx)(Fb,{path:BI.MEMBER_ACTIONS(l),children:e.isEvent?(0,i.jsx)(Ob,{children:(0,i.jsx)(KT,{})}):(0,i.jsx)(Ob,{children:(0,i.jsx)(XT,{})})}),m&&(0,i.jsx)(Fb,{path:BI.MEMBER_COMMENTS(l),children:(0,i.jsx)(Ob,{children:(0,i.jsx)(FT,{showEvent:!0})})}),e.showHistory&&(0,i.jsx)(Fb,{path:BI.MEMBER_HISTORY(l),children:(0,i.jsx)(Ob,{children:(0,i.jsx)(cz,{isEvent:e.isEvent,isWeezeventConnected:s.organization?.event?.isWeezeventConnected??!1})})})]})]})},Bz=()=>{const{isEventReader:e}=Jv(),{canAccreditationRead:t,canDocumentRead:n,canMemberAccredit:s,canMemberAssign:o,canMemberAssignmentStateEdit:r,canMemberAvailabilitiesEdit:a,canMemberDelete:l,canPositionRead:d}=lS(),c=n||s||o||r||l,u=t||d||a,h=e;return(0,i.jsx)(Lz,{isEvent:!0,showAccreditations:s,showActions:c,showAvailabilities:u,showHistory:h,showPositions:d})},Vz=()=>(0,i.jsx)(Lz,{isEvent:!1,showAccreditations:!1,showActions:!0,showAvailabilities:!1,showHistory:!0,showPositions:!1});var Uz=n(6301);function Wz(e=[]){const t=String.fromCharCode(65+(0,Uz.A)(25));return!1===e.includes(t)?t:Wz(e)}function Gz(e=[]){const t=(0,Uz.A)(9);return!1===e.includes(t)?t:Gz(e)}const Hz=["Q","O","I","L"],qz=[0,1];function Yz(e=10){const t=(0,wc.A)(0,e-1).map(()=>{return e=Hz,t=qz,0===(0,Uz.A)(1)?Wz(e):Gz(t).toString();var e,t}).join("");return`${Wz(Hz)}${t}`}const Kz=e=>{const t=Hn(),n=`formKeyToTeamCode.f${e.form.id}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray900 textLg medium",children:"Équipe"}),(0,i.jsx)(Wu,{height:"4"}),(0,i.jsx)(Rl,{hint:t("d_finissez_votr_19710"),label:t("code_quipe_14296"),name:n,rightIcon:"arrows-rotate",onRightIconClick:()=>{e.change(n,Yz())}}),(0,i.jsx)(Ba,{height:"9"})]})},Zz=e=>{const{history:t,params:{eventId:n},translate:s}=cl(),o=M.useMemo(()=>(0,ic.A)(e.forms,e=>e.name.toLowerCase()),[e.forms]);return(0,i.jsxs)(Ra,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsxs)(Ra,{align:"center",css:{margin:"auto",overflowY:"auto"},direction:"column",height:1,width:1,children:[e.banner,(0,i.jsxs)(Ra,{css:{padding:"$6 $4",width:"100%","@tablet":{padding:"$6 $8"},"@desktop":{padding:"$7",width:n?"100%":"$container"}},direction:"column",children:[(0,i.jsx)(br,{font:"gray900 displayXs semiBold",children:e.title}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Mb,{children:[(0,i.jsxs)(Pb,{children:[o.map(t=>(0,i.jsx)(Db,{path:e.getTabPath(t.id),children:t.name},t.id)),e.extraTabs]}),e.children]})]})]})}),(0,i.jsx)(Ra,{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)(Ra,{align:"center",css:{width:"100%","@desktop":{width:n?"100%":"$container"}},gap:"4",children:[(0,i.jsx)(jl,{isLoading:e.isLoading,onClick:e.handleSubmit,children:s("mettre_jour_85141")}),(0,i.jsx)(br,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>t.goBack(e.returnPathFallback),children:s("annuler_48254")})]})})]})},Xz=({banner:e,change:t,customFields:n,formIdToInsertedAt:s,forms:o,getEditUserFormPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,showAllAndPrivate:c,showIsFilled:u,userInfo:h,values:m})=>{const{translate:g,params:{organizationId:p}}=cl(),f=Gn(Wc),x=M.useMemo(()=>n.filter(e=>e.isPrivate).map(e=>({id:L(),elementType:Ue.Field,customField:e,hasCondition:!1,conditionValue:!1})),[n]),_=M.useMemo(()=>fz(n),[n]),I=M.useCallback((e,t)=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{font:"gray900 textLg medium",children:e}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Uu,{direction:"horizontal"})]}),[]);return(0,i.jsxs)(Zz,{banner:e,extraTabs:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Db,{path:r("all"),children:g("tous_les_champs_57939")}),(0,i.jsx)(Db,{path:r("private"),children:g("champs_priv_s_84670")})]}):void 0,forms:o,getTabPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,title:g("mise_jour_de_17055",h.nameOrEmail),children:[o.map(e=>{const n=s[e.id];return(0,i.jsxs)(Fb,{path:r(e.id),children:[(0,i.jsx)(Ba,{height:"7"}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textMd semiBold",children:g("statut_du_formu_08195")}),(0,i.jsx)(br,{width:320,children:(0,i.jsxs)(Au,{shouldParseAsBoolean:!0,state:n?"disabled":"active",value:m.filledFormsIds.includes(e.id),onChange:n=>{t("filledFormsIds",no(m.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)(Ba,{height:"6"}),e.areTeamsAllowed&&(0,i.jsx)(Kz,{change:t,form:e})]}),(0,i.jsx)(qE,{change:t,elements:e.elements,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]},e.id)}),c&&(0,i.jsxs)(Fb,{path:r("all"),children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(qE,{change:t,elements:_,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]}),c&&(0,i.jsxs)(Fb,{path:r("private"),children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(qE,{change:t,elements:x,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]})]})},Jz=[Le.Address,Le.Text,Le.Textarea,Le.Time],Qz=({banner:e,customFields:t,country:n,formIdToInsertedAt:s,formIdToTeamCode:o,forms:r,from:a,getEditUserFormPath:l,showAllAndPrivate:d,showIsFilled:c,userInfo:u})=>{const{organizationId:h,eventId:m,delegationId:g}=Zn(),p=Xn(),f=Gn(VE),{mutate:x,isLoading:_}=function(e={}){return Kn("mutation UserInfoUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userId: UserId!\n $userInfo: UsersInfoInput!\n $filledFormsIds: [FormId!]\n $formKeyToTeamCode: JSON\n) {\n userInfoUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n userId: $userId\n userInfo: $userInfo\n filledFormsIds: $filledFormsIds\n formKeyToTeamCode: $formKeyToTeamCode\n ) {\n id\n }\n}\n",e)}(),I=M.useMemo(()=>Object.keys(s).map(e=>parseInt(e,10)),[s]),v=M.useMemo(()=>Object.fromEntries(Object.entries(o).map(([e,t])=>[`f${e}`,t])),[o]);return(0,i.jsx)(fl,{direction:"column",height:1,initialValues:{filledFormsIds:I,formKeyToTeamCode:v,userInfo:f.userInfoUpdateInputDefault(u,t,{checkboxDefaultEmpty:!0,countryCode:n})},render:({form:n,handleSubmit:o,values:p})=>(0,i.jsx)(Xz,{banner:e,change:n.change,customFields:t,formIdToInsertedAt:s,forms:r,getEditUserFormPath:l,handleSubmit:o,isLoading:_,returnPathFallback:"app"===a?m?Os.VOLUNTEERS(h,m):ji.COMMUNITY_USERS({organizationId:h}):g?as.DELEGATION_MEMBERS({organizationId:h,eventId:m,delegationId:g}):BI.MEMBER({organizationId:h,eventId:m,userInfoId:u.id}),showAllAndPrivate:d,showIsFilled:c,userInfo:u,values:p}),width:1,onSubmit:async e=>{const n=e.userInfo.fields;t.forEach(e=>{Jz.includes(e.fieldType)&&!n[e.slug]?n[e.slug]="":e.fieldType!==Le.File||n[e.slug]||(n[e.slug]=null)}),await x({organizationId:h,eventId:m,userId:u.userId,userInfo:{id:u.id,fields:e.userInfo.fields},filledFormsIds:c?e.filledFormsIds:void 0,formKeyToTeamCode:e.formKeyToTeamCode}),p.goBack("app"===a?Os.VOLUNTEERS(h,m):BI.MEMBER({organizationId:h,eventId:m,userInfoId:u.id}))}})},eO=({country:e,data:t,forms:n,getEditFormPath:s})=>{const{params:{organizationId:o,eventId:r,delegationId:a,userInfoId:l}}=cl(),d=(0,M.useMemo)(()=>t.organization?.userInfo.formsUsersInfos??[],[t.organization]),c=(0,M.useMemo)(()=>d.map(e=>e.formId),[d]),u=(0,M.useMemo)(()=>Object.fromEntries(d.map(e=>[e.formId,e.insertedAt])),[d]),h=(0,M.useMemo)(()=>r?Object.fromEntries(d.map(e=>[e.formId,e.teamCode])):{},[r,d]);return(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:[Os.EDIT_USER_FORM(":organizationId",":eventId",":userInfoId",":formId"),Os.EDIT_USER_DELEGATION_FORM(":organizationId",":eventId",":delegationId",":userInfoId",":formId"),Os.COMMUNITY_EDIT_USER_FORM(":organizationId",":userInfoId",":formId"),Os.COMMUNITY_EDIT_USER_DELEGATION_FORM(":organizationId",":delegationId",":userInfoId",":formId")],children:(0,i.jsx)(Qz,{country:e,customFields:t.organization.customFields.nodes,formIdToInsertedAt:u,formIdToTeamCode:h,forms:n,from:"app",getEditUserFormPath:s,showAllAndPrivate:!0,showIsFilled:!0,userInfo:t.organization.userInfo})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:r?a?Os.EDIT_USER_DELEGATION_FORM(o,r,a,l,n.length>0?n[0].id:"all"):Os.EDIT_USER_FORM(o,r,l,c?.[0]??"all"):a?Os.COMMUNITY_EDIT_USER_DELEGATION_FORM(o,a,l,n.length>0?n[0].id:"all"):Os.COMMUNITY_EDIT_USER_FORM(o,l,c?.[0]??"all"),replace:!0})})]})},tO=()=>{const{params:{organizationId:e,eventId:t,delegationId:n,userInfoId:s}}=cl(),o=Xn(),{data:r,loader:a}=Yn("query UpdateUserInfosEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n\n category {\n name\n }\n }\n }\n\n userInfo(id: $userInfoId) {\n id\n isEditable\n userId\n email\n nameOrEmail\n fields\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n formId\n insertedAt\n teamCode\n }\n }\n }\n\n event(id: $eventId) {\n country\n\n forms {\n nodes {\n ...UpdateUserForm\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:s},[Ms.CustomFieldWithConditionFragment,Ms.UpdateUserFormFragment]);return a||(r.organization.userInfo.isEditable??1)||o.push(Os.DASHBOARD(e,t)),a||(0,i.jsx)(eO,{country:r.event.country,data:r,forms:n?r.event.forms.nodes.filter(e=>eo(e.delegationsIds)&&e.delegationsIds.includes(n)):r.event.forms.nodes,getEditFormPath:i=>n?Os.EDIT_USER_DELEGATION_FORM(e,t,n,s,i):Os.EDIT_USER_FORM(e,t,s,i)})},nO=()=>{const{organizationId:e,delegationId:t,userInfoId:n}=Zn(),{data:s,loader:o}=Yn("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},[Ms.CustomFieldWithConditionFragment,Ms.UpdateUserFormFragment]);return o||(0,i.jsx)(eO,{country:s.organization.country,data:s,forms:t?s.organization.forms.nodes.filter(e=>eo(e.delegationsIds)&&e.delegationsIds.includes(t)):s.organization.forms.nodes,getEditFormPath:i=>t?Os.COMMUNITY_EDIT_USER_DELEGATION_FORM(e,t,n,i):Os.COMMUNITY_EDIT_USER_FORM(e,n,i)})};var iO=n(6632),sO=n(4809),oO=n.n(sO);const rO=2e7;let aO=class extends Pl{constructor(e){super(e)}csvDocumentInputDefault(e){return{key:"",name:"",acl:"",formats:{timeFormat:"HH:mm",dateFormat:Vs,datetimeFormat:"yyyy-MM-dd HH:mm",...e}}}schema(){const e=this.t("le_document_est_86403");return d.Ik().shape({acl:d.Yj().required(e),delimiter:d.Yj().optional().test("is-valid-value",this.t("delimiter_value_52108"),e=>!e||!oO().BAD_DELIMITERS.includes(e)),key:d.Yj().required(e).test("is-a-csv",this.t("le_fichier_n_es_33134"),e=>ZI(qI(e).extension)===KI.Csv),name:d.Yj().required(e),newline:d.Yj().optional().test("is-valid-value",this.t("newline_charact_88066"),e=>!e||["\r","\n","\r\n"].includes(e)),quoteChar:d.Yj().optional(),formats:d.Ik().shape({timeFormat:d.Yj().optional(),dateFormat:d.Yj().optional(),datetimeFormat:d.Yj().optional()}),file:d.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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],aO);const lO=({formats:e,file:t,ids:n,localStorageKeyPrefix:s,onChange:o})=>{const{params:{organizationId:r},translate:a}=cl(),{data:l,loader:d}=Do({organizationId:r}),c=(0,M.useMemo)(()=>{const e=localStorage.getItem($l[`${s}_FORMATS`]);return e?JSON.parse(e):e},[s]),u=(0,M.useMemo)(()=>{const t=t=>e?.[t]===l.organization?.[t]?(0,i.jsx)(Jd,{css:{textTransform:"uppercase"},children:a("from_organisati_25675")}):c?.[t]===e?.[t]&&(0,i.jsx)(Jd,{css:{textTransform:"uppercase"},children:a("from_saved_22150")});return{datetime:t("datetimeFormat"),date:t("dateFormat"),timeBadge:t("timeFormat")}},[l.organization,c,e]);return d||(0,i.jsxs)(Rm,{...n,hideToggle:!0,initialIsOpen:!0,subtitle:a("s_lectionnez_vo_125161",iA.bytesToMegabytes(rO)),title:a("votre_fichier_d_51776"),children:[(0,i.jsx)(vj,{...n,accept:lv.Csv,acl:"private",organizationId:r,prefix:"input.csv.",withFileField:!0,onChange:o}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textMd medium",children:a("param_tres_du_f_01675")}),c&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{color:"white",disabled:!c,leftIcon:"arrows-rotate",size:"sm",onClick:()=>{localStorage.removeItem($l[`${s}_FORMATS`]),window.location.reload()}})}),(0,i.jsx)(_m,{placement:"top",children:a("reset_defaults_72577")})]})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsx)(br,{width:1,children:(0,i.jsx)(Rl,{description:a("you_must_set_th_73159"),label:a("set_delimiter_20565"),name:"input.csv.delimiter",state:t?"disabled":void 0})}),(0,i.jsxs)(Ra,{direction:"row",gap:"2",children:[(0,i.jsx)(br,{width:1,children:(0,i.jsx)(Rl,{description:a("leave_blank_if_02058"),label:a("set_quote_chara_43496"),name:"input.csv.quoteChar",state:t?"disabled":void 0})}),(0,i.jsx)(br,{width:1,children:(0,i.jsxs)(yj,{description:a("leave_blank_to_11865"),label:a("set_newline_cha_37738"),name:"input.csv.newline",state:t?"disabled":void 0,children:[(0,i.jsx)("option",{value:void 0,children:"Auto-detect"}),(0,i.jsx)("option",{value:"\r",children:"\\r"}),(0,i.jsx)("option",{value:"\n",children:"\\n"}),(0,i.jsx)("option",{value:"\r\n",children:"\\r\\n"})]})})]}),(0,i.jsxs)(Ra,{direction:"row",gap:"2",children:[(0,i.jsx)(br,{width:1,children:(0,i.jsx)(Rl,{label:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[a("format_d_heure_46798"),u.timeBadge]}),name:"input.csv.formats.timeFormat",state:t?"disabled":void 0})}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)(Rl,{label:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[a("format_de_date_82059"),u.date]}),name:"input.csv.formats.dateFormat",state:t?"disabled":void 0})}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)(Rl,{label:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[a("format_de_date_24474"),u.datetime]}),name:"input.csv.formats.datetimeFormat",state:t?"disabled":void 0})})]})]})]})]})},dO=e=>{const t=Hn(),n=(0,M.useMemo)(()=>[{id:-1,name:t("default_fields_04920"),fields:Object.entries(e.defaultFields).map(([e,n])=>({name:m(t(e))?t(e):e,slug:n,id:Math.random()}))},...e.categories].map(t=>({...t,fields:(0,ic.A)(t.fields,t=>{const n=t.name.toLowerCase(),i=t.slug.toLowerCase(),s=e.column.name.toLowerCase(),o=Math.min(x(n,s),x(i,s));return o{const s=Object.values(e.defaultFields).find(e=>e===t);return s&&e.requiredFieldSlugs.includes(s)?(0,i.jsx)("strong",{children:n}):n},[e.defaultFields,e.requiredFieldSlugs]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ol,{state:"disabled",value:e.column.name,onChange:()=>{}}),(0,i.jsx)(Ya,{icon:"arrow-right"}),(0,i.jsx)(Mm,{isSearchVisible:!0,multiple:!1,name:`input.mappings.${e.column.index}`,placeholder:t("s_lectionnez_un_12007"),renderValue:s,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))})]})},cO=hr("div",{display:"grid",gridTemplateColumns:"[column] 1fr auto [field] 1fr",gap:"$4 $5",alignItems:"center"}),uO=hr("div",{color:"$gray800",gridColumn:"column",fontWeight:"$medium"}),hO=hr("div",{color:"$gray800",gridColumn:"field",fontWeight:"$medium"}),mO=({categories:e,columns:t,defaultFields:n,requiredFieldSlugs:s,values:o})=>{const r=Hn();return(0,i.jsxs)(cO,{children:[(0,i.jsx)(uO,{children:r("titres_de_vos_c_31388")}),(0,i.jsx)(hO,{children:r("champs_de_formu_64126")}),t.map((t,r)=>(0,i.jsx)(dO,{categories:e,column:{name:t,index:r},defaultFields:n,requiredFieldSlugs:s,values:o},r))]})},gO=e=>{const t=Hn();return(0,i.jsxs)(Rm,{hideToggle:!0,initialIsOpen:!0,subtitle:t("_ditez_la_corre_24969"),title:t("liste_des_champ_40104"),children:[e.modeSelection,(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(mO,{...e})]})},pO=({file:e,onToggle:t,...n})=>{const s=Hn();return(0,i.jsx)(Rm,{initialIsOpen:eo(n.values)??!1,subtitle:s("d_finissez_dire_31742"),title:s("attribution_d_u_50979"),onToggle:t,children:(0,i.jsx)(Sj,{name:"input.presets",...n})})},fO=(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 xO({additionalCategories:e,additionalOptions:t,customFields:n,defaultFields:s,file:o,form:r,modeSelection:a,onToggle:l,requiredFieldSlugs:d,values:c}){const{translate:u}=cl(),{isLoading:h,columns:m,errors:g}=((e,t)=>{const[n,i]=(0,M.useReducer)(fO,{isLoading:!0,columns:void 0,errors:void 0});return(0,M.useEffect)(()=>{i({type:"LOADING"}),(0,sO.parse)(e,{preview:1,...t,complete:({data:e,errors:t})=>{t.filter(e=>"UndetectableDelimiter"!==e.code).length?i({type:"ERROR",errors:t}):i({type:"SUCCESS",columns:e[0]})}})},[e]),n})(o,{delimiter:c.input.csv.delimiter??void 0,quoteChar:c.input.csv.quoteChar??void 0,newline:c.input.csv.newline??void 0}),p=M.useMemo(()=>{const t=Object.entries((0,nc.A)(n,e=>e.customFieldCategoryId)).map(([e,t])=>{const n=t[0];return{id:n.customFieldCategoryId,name:n.customFieldCategoryName,fields:t}});return e?t.concat(e):t},[e,n]);return h||g?null:(0,i.jsxs)(i.Fragment,{children:[t&&(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,title:u("param_tres_d_im_18876"),children:t}),(0,i.jsx)(gO,{categories:p,columns:m,defaultFields:s,modeSelection:a,requiredFieldSlugs:d,values:c.input.mappings}),eo(n)&&(0,i.jsx)(pO,{change:r.change,customFields:n,file:o,values:c.input.presets,onToggle:l})]})}const _O=e=>!!e.getFieldState("input.csv.key")?.valid&&!!e.getFieldState("input.csv.file")?.valid,IO=(0,iO.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)),vO=(e,t)=>e.IMPORT_COLUMNS_REQUIRED(t.mode).every(e=>t.mappings.includes(e)),bO=(e,t,n)=>t.formatListValues(e.IMPORT_COLUMNS_REQUIRED(n.mode).filter(e=>!n.mappings.includes(e)),"conjunction"),jO=({ImportInputService:e,additionalCategories:t,additionalOptions:n,centeredContainerRef:s,closePath:o,createUpdateKey:r,customFields:a,form:l,handleSubmit:d,importTagPrefix:c,isTagInputDisabled:u=!1,itemName:h,localStorageKeyPrefix:g,showModeSelection:p=!0,submitting:f,title:x,values:_})=>{const{params:{organizationId:I},translate:v}=cl(),b=Na(),j=Gn(Vn),C=M.useRef(null),y=()=>Bs.c9.now().toFormat(Ws),k=()=>(l.change("input.tag",`${c}-csv-${y()}`),setInterval(()=>l.change("input.tag",`${c}-csv-${y()}`),1e3)),A=()=>clearInterval(C.current);M.useEffect(()=>(C.current=k(),()=>A()),[C]);const w=M.useCallback(t=>{l.change("input.tag",`${c}-csv-${Bs.c9.now().toFormat(Ws)}`),(0,sO.parse)(t,{delimiter:_.input.csv.delimiter,preview:1,newline:_.input.csv.newline,quoteChar:_.input.csv.quoteChar,complete:({data:t,errors:n})=>{let i;if(!n.length){const n=t[0],s=IO({ImportInputService:e,columns:n,customFields:a});try{i=JSON.parse(localStorage.getItem($l[`${g}_MAPPINGS`])??"{}")}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}l.change("input.mappings",n.map((e,t)=>void 0!==i[e]?i[e]:s[t]))}}});try{l.change("input.presets",JSON.parse(localStorage.getItem($l[`${g}_PRESETS`](I))??"[]")),p&&l.change("input.mode",localStorage.getItem($l[`${g}_MODE`])??Ye.CreateUpdate)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}},[a,l,_]);return(0,i.jsx)(zm,{button:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{disabled:!_.input.csv.file||!vO(e,_.input),isLoading:f,onClick:()=>{A(),d()},children:v("importer_la_lis_12866")})}),(!_.input.csv.file||!vO(e,_.input))&&(0,i.jsx)(_m,{placement:"top",children:_.input.csv.file?v("you_have_not_ma_46806",bO(e,j,_.input)):v("the_file_is_emp_77243")})]}),category:x,color:"dark",fallbackClosePath:o,title:v("nouvel_import_48306"),children:(0,i.jsxs)(Em,{ref:s,children:[l.getState().submitSucceeded&&(0,i.jsx)(Xw,{}),(0,i.jsx)(hl,{errorId:b.errorId}),(0,i.jsxs)(Ra,{direction:"column",gap:"5",children:[(0,i.jsx)(lO,{file:_.input.csv.file,formats:_.input.csv.formats,ids:b,localStorageKeyPrefix:g,onChange:w}),_.input.csv?.file&&_O(l)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xO,{additionalCategories:t,additionalOptions:n,customFields:a,defaultFields:e.IMPORT_COLUMNS_DEFAULT,file:_.input.csv.file,form:l,modeSelection:p?(0,i.jsx)(i.Fragment,{children:_.input.mode&&(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:v("que_souhaitez_v_33936")}),(0,i.jsx)(Pv,{name:"input.mode",value:Ye.Create,children:v("add_one_1_per_91911",h?.singular,r?.name)}),(0,i.jsx)(Pv,{name:"input.mode",value:Ye.CreateUpdate,children:v("add_one_1_per_73704",h?.singular,r?.name)}),(0,i.jsx)(Pv,{name:"input.mode",value:Ye.Update,children:v("do_not_add_any_50401",h?.plural)})]})}):void 0,requiredFieldSlugs:e.IMPORT_COLUMNS_REQUIRED(_.input.mode),values:_,onToggle:e=>{if(!_.input.csv.file)throw new Error("No file in input!");try{e?l.change("input.presets",JSON.parse(localStorage.getItem($l[`${g}_PRESETS`](I))??"[]")):l.change("input.presets",[])}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}}),(0,i.jsxs)(Rm,{hideToggle:!0,initialIsOpen:!0,subtitle:v(u?"your_imported_i_20879":"by_default_you_75833"),title:v("identify_your_i_87636"),children:[(0,i.jsx)(Rl,{label:v("your_import_tag_41852"),name:"input.tag",state:"disabled"}),!u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:2}),(0,i.jsx)(Ol,{label:v("specify_an_impo_41868"),onChange:e=>{m(e)?(C.current&&A(),l.change("input.tag",`${c}-csv-${e}`)):(l.change("input.tag",`${c}-csv-${y()}`),C.current=k())}})]})]})]})]})]})})},CO=({checkImport:e,mutate:t,...n})=>{const{params:{organizationId:s,eventId:o,delegationId:r},translate:a}=cl(),l=Gn(Vn),{data:d,loader:c}=Do({organizationId:s}),u=Qn(),h=Gn(n.ImportInputService),g=Gn(Da),p=M.useRef(null),f=M.useMemo(()=>{try{const e={dateFormat:d.organization.dateFormat,datetimeFormat:d.organization.datetimeFormat,timeFormat:d.organization.timeFormat},t=JSON.parse(u.getItem($l[`${n.localStorageKeyPrefix}_FORMATS`])??"{}");return{...e,...t}}catch{return null}},[d.organization]);return c||(0,i.jsx)(fl,{customErrorRef:p,height:1,initialValues:{input:h.default(f).input},mutators:{setValue:([e,t],n,{changeValue:i})=>i(n,e,()=>t)},render:({form:e,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(jO,{centeredContainerRef:p,form:e,handleSubmit:t,submitting:s,values:o,...n}),validate:g.validateForForm(h.schema()),onSubmit:async({input:i})=>{if(!vO(n.ImportInputService,i))return{[$a.Ym]:a("you_have_not_ma_46806",bO(n.ImportInputService,l,i))};(e=>{const t=e.csv.file;if(!t)throw new Error("No file in input!");(0,sO.parse)(t,{delimiter:e.csv.delimiter,preview:1,newline:e.csv.newline,quoteChar:e.csv.quoteChar,complete:({data:t,errors:i})=>{if(!i.length)try{const i=t[0],s=IO({ImportInputService:n.ImportInputService,columns:i,customFields:n.customFields}),o=JSON.parse(u.getItem($l[`${n.localStorageKeyPrefix}_MAPPINGS`])??"{}"),r={};for(const[t,n]of e.mappings.entries()){const e=i[t];n?r[e]=n:delete o[e],m(s[t])&&!r[e]&&(r[e]=null)}u.setItem($l[`${n.localStorageKeyPrefix}_MAPPINGS`],JSON.stringify({...o,...r}))}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}});try{const t=JSON.parse(u.getItem($l[`${n.localStorageKeyPrefix}_PRESETS`](s))??"[]");u.setItem($l[`${n.localStorageKeyPrefix}_PRESETS`](s),JSON.stringify([...new Map([...t,...e.presets].map(e=>[e.customFieldId,e])).values()])),u.setItem($l[`${n.localStorageKeyPrefix}_FORMATS`],JSON.stringify(e.csv.formats?Object.fromEntries(Object.entries(e.csv.formats).filter(([e,t])=>m(t))):{})),n.showModeSelection&&u.setItem($l[`${n.localStorageKeyPrefix}_MODE`],e.mode)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}})(i);const d=(e=>{const t={...e.csv};return delete t.file,{...e,csv:t}})(i);try{const{jobId:n}=await t({organizationId:s,eventId:o,delegationId:r,input:d});p.current&&(p.current.scrollTop=0),e(s,n)}catch{}}})};var yO;let kO=class extends Pl{static{yO=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={Id:"id"};static IMPORT_COLUMNS_REQUIRED=e=>e===Ye.Update?[yO.IMPORT_COLUMNS_DEFAULT.Id]:[];constructor(e,t){super(t),this.csvInputService=e}default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mode:Ye.CreateUpdate}}}schema(){return d.Ik().shape({input:d.Ik().shape({csv:this.csvInputService.schema(),mode:d.Yj().oneOf(gn,this.t("le_mode_d_impor_75706"))})})}};kO=yO=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[aO,Vn])],kO);let AO=class extends kO{csvInputService;default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mappings:[],presets:[],mode:Ye.CreateUpdate,tag:""}}}schema(){return d.Ik().shape({input:d.Ik().shape({csv:this.csvInputService.schema(),mappings:d.YO().of(d.Yj().nullable()),presets:d.YO().of(d.Ik().shape({customFieldId:d.ai().positive(this.t("le_choix_du_typ_07079")),value:d.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:d.Yj().oneOf(gn,this.t("le_mode_d_impor_75706")),tag:d.Yj().required("a_tag_must_be_s_23274")})})}constructor(e,t){super(e,t),this.csvInputService=e}};AO=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[aO,Vn])],AO);var wO;let SO=class extends AO{static{wO=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...AO.IMPORT_COLUMNS_DEFAULT,Email:"email",TicketId:"ticketId"};static IMPORT_COLUMNS_REQUIRED=e=>e===Ye.Update?[wO.IMPORT_COLUMNS_DEFAULT.Id]:[wO.IMPORT_COLUMNS_DEFAULT.Email];constructor(e,t){super(e,t),this.csvInputService=e}};SO=wO=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[aO,Vn])],SO);const EO=({accreditations:e,closePath:t,customFields:n})=>{const s=Hn(),o=Gn(Wc),{mutate:r}=function(e={}){return Kn("mutation VolunteersImport(\n $eventId: EventId\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $input: MappableImportInput!\n) {\n jobId: volunteersImport(\n eventId: $eventId\n organizationId: $organizationId\n delegationId: $delegationId\n input: $input\n )\n}\n",e)}(),{checkVolunteersImport:a}=ib(),l=(0,M.useMemo)(()=>e.map(e=>({...e,fields:e.slots.map(t=>({id:t.id,slug:`accreditation_slot_${t.id}`,name:wh(o,t,e.name,{accreditation:{includeNameAtEnd:!0}})}))})),[e]);return(0,i.jsx)(CO,{ImportInputService:SO,additionalCategories:l,checkImport:a,closePath:t,createUpdateKey:{slug:"email",name:s("email_address_53451")},customFields:n,importTagPrefix:"volunteers",itemName:{singular:s("membre_53723"),plural:s("membres_67337")},localStorageKeyPrefix:"VOLUNTEERS_IMPORT",mutate:r,title:s("import_de_membr_48618")})},TO=()=>{const{params:{organizationId:e}}=cl(),{data:t,loader:n}=Gr({organizationId:e,variety:_e.UserInfo});return n||(0,i.jsx)(EO,{accreditations:[],closePath:ji.COMMUNITY_USERS({organizationId:e}),customFields:t.organization.customFields.nodes})},zO=()=>{const{params:{organizationId:e,eventId:t}}=cl(),{data:n,loader:s}=Yn("query EventVolunteersImportInfos(\n $organizationId: OrganizationId!\n $variety: CustomFieldVariety!\n $eventId: EventId!\n) {\n organization(id: $organizationId) {\n customFields(\n variety: $variety\n fieldTypes: [\n Address\n Checkbox\n Country\n Date\n Datetime\n Language\n Nationality\n Number\n Phone\n Select\n Sex\n Text\n Textarea\n Time\n Validation\n ]\n ) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n\n event(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n }\n}\n",{organizationId:e,variety:_e.UserInfo,eventId:t},[Ms.CustomFieldImportFragment,Ms.AccreditationImportFragment]);return s||(0,i.jsx)(EO,{accreditations:n.event.accreditations.nodes,closePath:Os.VOLUNTEERS(e,t),customFields:n.organization.customFields.nodes})};let OO=class extends Pl{constructor(e){super(e)}workflowInputDefault(e){return{name:e?.name??"",state:e?.state??Nt.Active,frequency:e?.frequency??Pt.Every10Minutes,trigger:e?.trigger??Lt.VolunteersSegment,action:e?.action??Dt.SetCustomField,data:(0,Kv.A)({recipients:Ft.View},e?.data??{})}}workflowInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf(Pn,this.t("le_statut_est_r_13164")),action:d.Yj().required(this.t("l_action_est_re_08934")).oneOf($n,this.t("l_action_est_re_08934")),trigger:d.Yj().required(this.t("le_d_clencheur_32555")).oneOf(Fn,this.t("le_d_clencheur_32555")),data:d.gl().required().test("positions-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==Lt.Assigned||eo(this.parent.data.positionsCategoriesIds)||eo(this.parent.data.positionsIds)||eo(this.parent.data.positionsSlotsIds)||eo(this.parent.data.positionsSegmentsIds)}).test("volunteers-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==Lt.VolunteersSegment||Number.isInteger(this.parent.data.volunteersSegmentId)}).test("form-id-valid",this.t("le_formulaire_e_77404"),function(){return this.parent.trigger!==Lt.FormSubmit||Number.isInteger(this.parent.data.formId)}).test("campaign-id-valid",this.t("la_campagne_est_06708"),function(){return this.parent.trigger!==Lt.VolunteersSegment||this.parent.action!==Dt.SendCampaign||Number.isInteger(this.parent.data.campaignId)}).test("campaign-recipients-valid",this.t(this.t("les_destinatair_82420")),function(){return this.parent.trigger!==Lt.VolunteersSegment||this.parent.action!==Dt.SendCampaign||Dn.includes(this.parent.data.recipients)}).test("campaign-recipients-users-infos",this.t("la_liste_des_me_55886"),function(){return this.parent.trigger!==Lt.VolunteersSegment||this.parent.action!==Dt.SendCampaign||this.parent.data.recipients!==Ft.UsersInfosIds||eo(this.parent.data.usersInfosIds)}).test("custom-field-id-valid",this.t("le_champ_person_80074"),function(){return this.parent.trigger===Lt.VolunteersSegment&&this.parent.action===Dt.SetCustomField?Number.isInteger(this.parent.data.customFieldId):this.parent.trigger!==Lt.FormSubmit||this.parent.action!==Dt.CreateDelegation||Number.isInteger(this.parent.data.customFieldId)}).test("accreditations-valid",this.t("les_accr_ditati_27943"),function(){return this.parent.trigger!==Lt.Assigned&&(this.parent.trigger!==Lt.VolunteersSegment||this.parent.action!==Dt.AddAccreditations&&this.parent.action!==Dt.DeleteAccreditations)||eo(this.parent.data.accreditationsSlotsIds)}).test("delegation-id-valid",this.t("la_d_l_gation_c_71684"),function(){return this.parent.trigger!==Lt.FormSubmit||this.parent.action!==Dt.CreateDelegation||Number.isInteger(this.parent.data.delegationId)}).test("event-id-valid",this.t("l_v_nement_est_88155"),function(){return this.parent.trigger!==Lt.VolunteersSegment||this.parent.action!==Dt.AddEvent||Number.isInteger(this.parent.data.eventId)})})}};OO=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],OO);const RO=e=>(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$4",width:"min($container, 100%)"},direction:"column",gap:"5",children:[(0,i.jsxs)(Ra,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$3"},gap:"3",width:1,children:[(0,i.jsx)(pC,{color:"gray",icon:e.icon}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:e.category}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:e.title})]})]}),(0,i.jsx)(Ra,{direction:"column",gap:"4",width:1,children:e.children})]}),$O=e=>{const{translate:t,params:{eventId:n}}=cl(),{hasFeature:s}=_I(),{event:o}=Jv(),r=(!o||o.useCampaigns)&&e.workflow.trigger===Lt.VolunteersSegment,a=e.workflow.trigger===Lt.VolunteersSegment,l=!!n&&s(Fe.Accreditation)&&(o?.useAccreditations??!1)&&(e.workflow.trigger===Lt.Assigned||e.workflow.trigger===Lt.VolunteersSegment),d=!!n&&s(Fe.Accreditation)&&(o?.useAccreditations??!1)&&e.workflow.trigger===Lt.VolunteersSegment,c=s(Fe.Delegation)&&e.workflow.trigger===Lt.FormSubmit,u=!n&&e.workflow.trigger===Lt.VolunteersSegment,h=!!n&&e.workflow.trigger===Lt.VolunteersSegment;return(0,i.jsx)(RO,{category:t("action_s_lectio_18617"),icon:"lasso-sparkles",title:t("alors_automatiq_16268"),children:(0,i.jsxs)(Mm,{isSearchVisible:!0,name:"workflow.action",placeholder:t("choisir_une_act_51814"),state:e.isEdit?"disabled":"active",children:[r&&(0,i.jsx)("option",{value:Dt.SendCampaign,children:t("SendCampaign")}),a&&(0,i.jsx)("option",{value:Dt.SetCustomField,children:t("SetCustomField")}),l&&(0,i.jsx)("option",{value:Dt.AddAccreditations,children:t("AddAccreditations")}),d&&(0,i.jsx)("option",{value:Dt.DeleteAccreditations,children:t("DeleteAccreditations")}),c&&(0,i.jsx)("option",{value:Dt.CreateDelegation,children:t("cr_er_une_d_l_g_23035")}),u&&(0,i.jsx)("option",{value:Dt.AddEvent,children:t("ajouter_sur_un_56178")}),h&&(0,i.jsx)("option",{value:Dt.DuplicateMember,children:"Dupliquer le membre"})]})})},DO=()=>{const{translate:e,params:{eventId:t}}=cl(),n=Gn(Wc),{data:s}=Yn("query WorkflowAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{eventId:t},[]),o=(0,M.useMemo)(()=>(s.event?.accreditations.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:zh(e.slots).map(t=>{const s=wh(n,t,e.name,{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{value:t.id,children:s},t.id)})},e.id)),[s.event]);return(0,i.jsx)(RO,{category:e("liste_des_accr_02647"),icon:"badge-check",title:e("les_accr_ditati_19289"),children:(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.accreditationsSlotsIds",children:o})})},PO=()=>{const{translate:e,params:{organizationId:t}}=cl(),{data:n}=Yn("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)(RO,{category:e("liste_des_v_ne_29929"),icon:"plus",title:e("l_v_nement_sui_45117"),children:(0,i.jsx)(Mm,{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))})})},FO=e=>{const{translate:t,params:{organizationId:n}}=cl(),[s,o,r]=Pc(""),{usersInfosOptions:a,isLoading:l}=jb({organizationId:n,eventId:null,hasSelected:eo(e.workflow.data.usersInfosIds),nameDebounced:o,userInfoIds:e.workflow.data.usersInfosIds||[]});return(0,i.jsxs)(RO,{category:t("destinataires_19592"),icon:"users",title:t("aux_membres_sui_99877"),children:[(0,i.jsxs)(Mm,{name:"workflow.data.recipients",children:[(0,i.jsx)("option",{value:Ft.View,children:t("aux_membres_de_71046")}),(0,i.jsx)("option",{value:Ft.DelegationsLeaders,children:t("aux_responsable_38147")}),(0,i.jsx)("option",{value:Ft.PositionsLeaders,children:t("aux_responsable_85620")}),(0,i.jsx)("option",{value:Ft.UsersInfosIds,children:t("_certains_memb_91094")})]}),e.workflow.data.recipients===Ft.UsersInfosIds&&(0,i.jsx)(Mm,{isSearchLoading:l,isSearchVisible:!0,label:t("liste_des_membr_89037"),multiple:!0,name:"workflow.data.usersInfosIds",searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",name:s,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:r}),children:a})]})},MO=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{data:o}=Yn("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:s,level:s?tt.Event:tt.Organization,formId:e.workflow.data.formId},[]);const r=(0,M.useMemo)(()=>o.organization?.delegations.nodes??[],[o.organization]),a=(0,M.useMemo)(()=>(o.organization?.form.elements??[]).flatMap(e=>e.customField?.fieldType===Le.Text?[e.customField]:[]),[o.organization]);return(0,i.jsxs)(RO,{category:t("liste_des_d_l_g_86270"),icon:"users",title:t("la_d_l_gation_s_46776"),children:[(0,i.jsx)(Mm,{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)(Mm,{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))})]})},NO=e=>{const{translate:t,params:{organizationId:n}}=cl(),{data:s}=Aa({organizationId:n});return(0,i.jsx)(RO,{category:t("param_tres_du_n_85818"),icon:"user",title:t("on_duplique_le_59761"),children:(0,i.jsx)(Ra,{direction:"column",children:(0,i.jsx)(Sj,{change:e.change,customFields:s.organization?.customFields.nodes??[],name:"workflow.data.customFields",values:e.workflow.data.customFields||[]})})})},LO=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{data:o}=Yn("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:s,level:s?tt.Event:tt.Organization},[]);return(0,i.jsx)(RO,{category:t("liste_des_formu_69259"),icon:"file-lines",title:t("un_formulaire_p_61128"),children:(0,i.jsx)(Mm,{isSearchVisible:!0,name:"workflow.data.formId",placeholder:t("choisir_un_form_18905"),state:e.isEdit?"disabled":"active",children:(o.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},BO=e=>{const{translate:t,params:{eventId:n}}=cl(),s=Gn(ah),{data:o}=Yn("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,M.useMemo)(()=>(0,ic.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o.event]),a=(0,M.useMemo)(()=>(0,ic.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,ic.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o.event]),l=(0,M.useMemo)(()=>(o.event?.positionsCategories??[]).flatMap(e=>(0,ic.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,ic.A)(e.slots,e=>e.range.start.toMillis()).map(t=>{const n=ph(s,t,e.name,{position:{includeNameAtEnd:!0},slot:{includeRange:!0}});return(0,i.jsx)("option",{value:t.id,children:n},t.id)})},e.id))),[o.event]),d=(0,M.useMemo)(()=>(o.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)),[o.event]);return(0,i.jsxs)(RO,{category:t("liste_des_missi_82050"),icon:"sitemap",title:t("une_mission_par_94044"),children:[(0,i.jsx)(Mm,{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)(Mm,{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)(Mm,{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)(Mm,{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})]})},VO=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=cl(),{data:s}=Yn("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?tt.Event:tt.Organization},[]);return(0,i.jsx)(RO,{category:e("liste_des_campa_60034"),icon:"paper-plane",title:e("la_campagne_sui_83193"),children:(0,i.jsx)(Mm,{isSearchVisible:!0,name:"workflow.data.campaignId",placeholder:e("choisir_une_cam_60181"),children:(s.organization?.campaigns.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},UO=e=>{const{translate:t,params:{organizationId:n}}=cl(),{data:s}=Aa({organizationId:n}),o=(0,M.useMemo)(()=>s.organization?.customFields.nodes??[],[s.organization]),r=o.find(t=>t.id===e.workflow.data.customFieldId);return(0,i.jsxs)(RO,{category:t("liste_des_champ_94862"),icon:"text",title:t("le_champ_suivan_27303"),children:[(0,i.jsx)(Mm,{isSearchVisible:!0,label:t("CustomField"),name:"workflow.data.customFieldId",placeholder:t("choisir_un_cham_67587"),children:o.map(e=>(0,i.jsx)("option",{"data-subtext":e.label,value:e.id,children:e.name},e.id))}),r&&(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",r.name)}),(0,i.jsx)(kj,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:r,forms:[],name:"workflow.data.customFieldValue",slug:r.slug,tags:[],traces:[],value:e.workflow.data?.customFieldValue})]})]})},WO=e=>{const{translate:t,params:{eventId:n}}=cl(),{hasFeature:s}=_I(),{event:o}=Jv(),r=!!n&&(o?.usePositions??!1)&&(o?.useAccreditations??!1)&&s(Fe.Accreditation),a=(o?.useForms??!0)&&(o?.useDelegations??!0)&&s(Fe.Delegation);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"workflow.trigger",children:t=>{t===Lt.Assigned?e.change("workflow.action",Dt.AddAccreditations):t===Lt.FormSubmit?e.change("workflow.action",Dt.CreateDelegation):e.change("workflow.action",Dt.SetCustomField)}}),(0,i.jsx)(RO,{category:t("initialisation_38640"),icon:"hand-sparkles",title:t("quand_le_membre_51578"),children:(0,i.jsxs)(Mm,{isSearchVisible:!0,name:"workflow.trigger",placeholder:t("choisir_un_d_cl_85012"),state:e.isEdit?"disabled":"active",children:[r&&(0,i.jsx)("option",{value:Lt.Assigned,children:t("est_affect_93543")}),a&&(0,i.jsx)("option",{value:Lt.FormSubmit,children:t("rempli_un_formu_11513")}),(0,i.jsx)("option",{value:Lt.VolunteersSegment,children:t("VolunteersSegment")})]})})]})},GO=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{data:o}=Yn("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:s,level:s?tt.Event:tt.Organization},[]);return(0,i.jsx)(RO,{category:t("liste_des_membr_89037"),icon:"user-group",title:t("une_vue_parmi_l_98342"),children:(0,i.jsx)(Mm,{isSearchVisible:!0,name:"workflow.data.volunteersSegmentId",placeholder:t("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:(o.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))})})},HO=()=>(0,i.jsx)(Ra,{height:32,justify:"center",width:1,children:(0,i.jsx)(br,{css:{borderRight:"1px solid $gray200"},height:1})}),qO=e=>{const{translate:t}=cl(),n=e.workflow.data,s=e.workflow.trigger===Lt.VolunteersSegment,o=e.workflow.trigger===Lt.Assigned,r=e.workflow.trigger===Lt.FormSubmit,a=e.workflow.trigger===Lt.VolunteersSegment&&"number"==typeof n.volunteersSegmentId||e.workflow.trigger===Lt.Assigned&&(eo(n.positionsCategoriesIds)||eo(n.positionsIds)||eo(n.positionsSlotsIds)||eo(n.positionsSegmentsIds))||e.workflow.trigger===Lt.FormSubmit&&"number"==typeof n.formId,l=a&&e.workflow.trigger===Lt.VolunteersSegment&&e.workflow.action===Dt.SendCampaign,d=l&&"number"==typeof e.workflow.data.campaignId,c=a&&e.workflow.trigger===Lt.VolunteersSegment&&e.workflow.action===Dt.SetCustomField,u=a&&e.workflow.action===Dt.AddAccreditations,h=a&&e.workflow.action===Dt.DeleteAccreditations,m=a&&e.workflow.action===Dt.CreateDelegation,g=a&&e.workflow.action===Dt.AddEvent,p=a&&e.workflow.action===Dt.DuplicateMember,f=l||c||u||m||g;return(0,i.jsxs)(Ra,{align:"center",direction:"column",children:[(0,i.jsx)(hl,{}),e.workflow.state===Nt.Error&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ja,{color:"warning",leftIcon:"circle-exclamation",width:"min($container, 100%)",children:[(0,i.jsx)(br,{children:t("une_erreur_est_38715")}),(0,i.jsx)(br,{fontWeight:"regular",children:e.workflow.data.errorMessage})]}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(Ra,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("d_but_41840")})}),(0,i.jsx)(HO,{}),(0,i.jsx)(WO,{change:e.change,isEdit:e.isEdit}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(GO,{hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(BO,{isEdit:e.isEdit})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(LO,{isEdit:e.isEdit})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)($O,{isEdit:e.isEdit,workflow:e.workflow})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(VO,{})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(FO,{workflow:e.workflow})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(UO,{change:e.change,workflow:e.workflow})]}),(u||h)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(DO,{})]}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(MO,{workflow:e.workflow})]}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(PO,{})]}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(NO,{change:e.change,workflow:e.workflow})]}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HO,{}),(0,i.jsx)(Ra,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("fin_60104")})})]})]})},YO=M.forwardRef((e,t)=>{const{history:n,translate:s,params:{organizationId:o,eventId:r}}=cl(),{user:a}=ni(),l=Rc(),[d,c]=M.useState(!1),u=M.useCallback(()=>{JSON.stringify(e.workflow)===e.initialValuesString?n.goBack(WI.WORKFLOWS({organizationId:o,eventId:r})):c(!0)},[e.workflow,e.initialValuesString,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zm,{button:(0,i.jsx)(Ib,{permissions:xb.WORKFLOW_EDIT,children:(0,i.jsx)(jl,{isLoading:e.submitting,onClick:e.handleSubmit,children:e.isEdit?s("mettre_jour_l_18144"):s("cr_er_l_automat_04638")})}),category:e.category,color:"dark",title:e.isEdit?e.name:s("nouvelle_automa_77863"),onClose:u,children:(0,i.jsxs)(Ra,{height:1,children:[(0,i.jsxs)(Ra,{css:{background:"white",padding:"$6"},direction:"column",gap:"7",width:420,children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:s("param_tres_de_l_25166")}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(Rl,{label:s("nom_de_l_automa_04883"),name:"workflow.name"}),(0,i.jsx)(yj,{label:s("status_06428"),name:"workflow.state",children:l(Pn.filter(e=>e!==Nt.Error))}),Nc(a.email)&&r&&(0,i.jsxs)(yj,{label:s("fr_quence_43547"),name:"workflow.frequency",children:[(0,i.jsx)("option",{value:Pt.Every10Minutes,children:s(Pt.Every10Minutes)}),(0,i.jsx)("option",{value:Pt.Every5Minutes,children:s(Pt.Every5Minutes)}),(0,i.jsx)("option",{value:Pt.Every2Minutes,children:s(Pt.Every2Minutes)}),(0,i.jsx)("option",{value:Pt.EveryMinute,children:s(Pt.EveryMinute)})]})]})]}),(0,i.jsx)(Ra,{ref:t,css:{background:"$gray50",flex:"1",overflowY:"auto",padding:"$8"},direction:"column",height:1,children:(0,i.jsx)(qO,{change:e.change,hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit,workflow:e.workflow})})]})}),(0,i.jsx)(kS,{fallbackPath:WI.WORKFLOWS({organizationId:o,eventId:r}),isOpen:d,onClose:()=>c(!1)})]})});YO.displayName="UpdateWorkflowForm";const KO=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{showNotification:r}=ib(),a=(0,M.useRef)(null),l=Gn(Da),d=Gn(OO),[c,u]=(0,M.useState)(""),h=(0,M.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.name??""):n("cr_ation_d_une_01202"),[e.initialValues]);return Td(h),(0,M.useEffect)(()=>{u(JSON.stringify(e.initialValues))},[e.initialValues]),(0,i.jsx)(fl,{customErrorRef:a,height:1,initialValues:{workflow:e.initialValues},render:({form:t,handleSubmit:n,submitting:s,values:o})=>(0,i.jsx)(YO,{ref:a,category:h,change:t.change,handleSubmit:n,hasBeenExecuted:e.hasBeenExecuted,initialValuesString:c,isEdit:e.isEdit,name:e.initialValues.name,submitting:s,workflow:o.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(WI.WORKFLOWS({organizationId:s,eventId:o}))}})},ZO=()=>{const{params:{organizationId:e,eventId:t}}=cl(),n=Gn(OO),{mutate:s}=function(e={}){return Kn("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)}(),o=(0,M.useMemo)(()=>n.workflowInputDefault(),[]);return(0,i.jsx)(KO,{hasBeenExecuted:!1,initialValues:o,isEdit:!1,mutate:n=>s({organizationId:e,eventId:t,workflow:n})})},XO=()=>{const{params:{organizationId:e,eventId:t,workflowId:n}}=cl(),s=Gn(OO),{mutate:o}=function(e={}){return Kn("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}=Yn("query Workflow($organizationId: OrganizationId!, $workflowId: WorkflowId!) {\n organization(id: $organizationId) {\n workflow(id: $workflowId) {\n id\n name\n frequency\n state\n action\n trigger\n hasBeenExecuted\n\n data {\n accreditationsSlotsIds\n campaignId\n customFieldId\n customFieldValue\n customFields\n delegationId\n errorMessage\n eventId\n formId\n positionsCategoriesIds\n positionsIds\n positionsSegmentsIds\n positionsSlotsIds\n recipients\n usersInfosIds\n volunteersSegmentId\n }\n }\n }\n}\n",{organizationId:e,workflowId:n},[]),l=(0,M.useMemo)(()=>s.workflowInputDefault(r.organization?.workflow),[r.organization]);return a||(0,i.jsx)(KO,{hasBeenExecuted:r.organization?.workflow.hasBeenExecuted,initialValues:l,isEdit:!0,mutate:i=>o({organizationId:e,eventId:t,workflowId:n,workflow:i})})};var JO;function QO(e){return{includeAccreditations:e.includes(JO.Accreditations),includeCampaign:e.includes(JO.Campaign),includeCustomField:e.includes(JO.CustomField)}}!function(e){e.Accreditations="accreditations",e.Action="Action",e.Campaign="campaign",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.CustomField="customField",e.ExecutedAt="executedAt",e.Id="id",e.Name="name",e.State="state",e.Trigger="trigger",e.VolunteersSegment="volunteersSegment"}(JO||(JO={}));class eR extends du{constructor(e,t,n){super(e,t,n)}getWorkflowsFilters(e,t){return[{slug:JO.State,name:this.t("status_06428"),category:this.t("automatisations_60045"),fieldType:Ve.Select,hideEmpty:!0,values:Pn.map(e=>({id:e,name:this.t(e)}))},{slug:JO.Trigger,name:this.t("d_clencheur_73493"),category:this.t("automatisations_60045"),fieldType:Ve.Select,hideEmpty:!0,values:Fn.map(e=>({id:e,name:this.t(e)}))},{slug:JO.Action,name:this.t("action_44224"),category:this.t("automatisations_60045"),fieldType:Ve.Select,hideEmpty:!0,values:$n.map(e=>({id:e,name:this.t(e)}))},{slug:JO.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("automatisations_60045"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:JO.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("automatisations_60045"),fieldType:Ve.Datetime,hideEmpty:!0}]}getWorkflowsPossibleColumns(){return[{slug:JO.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:Mt.Id},{slug:JO.Name,name:this.t("nom_de_l_automa_04883"),isSearchable:!0,isSortable:!0,sortAttribute:Mt.Name,minWidth:240},{slug:JO.State,name:this.t("status_06428"),minWidth:180},{slug:JO.Trigger,name:this.t("d_clencheur_73493"),minWidth:180},{slug:JO.Action,name:this.t("action_44224"),minWidth:180},{slug:JO.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:JO.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Mt.CreatedAt,minWidth:180},{slug:JO.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),isSortable:!0,sortAttribute:Mt.VolunteersSegment,minWidth:320},{slug:JO.ExecutedAt,name:this.t("ex_cut_e_le_99019"),isSortable:!0,sortAttribute:Mt.ExecutedAt,minWidth:180},{slug:JO.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:JO.Campaign,name:this.t("campagne_97871"),minWidth:240},{slug:JO.CustomField,name:this.t("CustomField"),minWidth:240}]}}const tR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{showNotification:o}=ib(),{mutate:r}=function(e={}){return Kn("mutation WorkflowssMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n workflowssMassDelete(organizationId: $organizationId, eventId: $eventId, selecteds: $selecteds)\n}\n",e)}();return(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:(0,Va.A)([t("_tes_vous_s_r_d_94890"),e.workflow.trigger===Lt.Assigned?t("cela_supprimera_60220"):null]),text:t("suppression_de_73669",e.workflow.name),onClose:e.onClose,onDelete:async()=>{await r({organizationId:n,eventId:s,selecteds:{ids:[e.workflow.id]}}),o(t("l_automatisatio_64405",e.workflow.name)),e.onSuccess()}})},nR=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{mutate:r}=function(e={}){return Kn("mutation WorkflowDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflowId: WorkflowId!\n) {\n workflowDuplicate(organizationId: $organizationId, eventId: $eventId, workflowId: $workflowId) {\n id\n }\n}\n",e)}(),{mutate:a}=function(e={}){return Kn("mutation WorkflowExecute(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflowId: WorkflowId!\n) {\n workflowExecute(organizationId: $organizationId, eventId: $eventId, workflowId: $workflowId)\n}\n",e)}(),[l,d]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"play",isDisabled:e.workflow.state===Nt.Paused,onClick:async()=>{await a({organizationId:s,eventId:o,workflowId:e.workflow.id}),e.reload()},children:n("ex_cuter_54158")}),(0,i.jsx)(Ld,{icon:"pen",to:WI.UPDATE({organizationId:s,eventId:o,workflowId:e.workflow.id}),children:n("_diter_62574")}),(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:n}}=await r({organizationId:s,eventId:o,workflowId:e.workflow.id});t.push(WI.UPDATE({organizationId:s,eventId:o,workflowId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{d(!0),$d(e.target)},children:n("supprimer_43083")})]}),l&&(0,i.jsx)(tR,{workflow:e.workflow,onClose:()=>{d(!1)},onSuccess:e.reload})]})},iR=e=>{const t=Gn(Wc);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:t.toLocaleString(e.insertedAt.toLocal(),Zs.DateTime)})},sR=e=>{const t=m(e.createdBy?.name),n=(t?e.createdBy?.name:e.createdBy?.email)||"";return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}),t&&(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},title:e.createdBy?.email||"",width:1,children:e.createdBy?.email||""})]})})};function oR(e){switch(e){case Nt.Active:return{color:"success",leftIcon:"play"};case Nt.Error:return{color:"error",leftIcon:"triangle-exclamation"};case Nt.Paused:return{color:"warning",leftIcon:"pause"};default:return nl()}}const rR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=Gn(Wc),r=(0,M.useMemo)(()=>eo(e.row.accreditationsSlots)?sC(e.row.accreditationsSlots):[],[e.column]);return e.column.slug===JO.Id?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===JO.Name?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Vc,{to:WI.UPDATE({organizationId:n,eventId:s,workflowId:e.row.id}),children:e.row.name})}):e.column.slug===JO.State?(0,i.jsxs)(yc,{align:"start",direction:"column",gap:"1",justify:"center",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(Jd,{...oR(e.row.state),children:t(e.row.state)}),"Error"===e.row.state&&(0,i.jsx)(br,{css:{ellipsis:!0},title:e.row.data.errorMessage||"",width:1,children:e.row.data.errorMessage||""})]}):e.column.slug===JO.Trigger?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.trigger)}):e.column.slug===JO.Action?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.action)}):e.column.slug===JO.CreatedBy?(0,i.jsx)(sR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===JO.CreatedAt?(0,i.jsx)(iR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===JO.VolunteersSegment?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.volunteersSegment?(0,i.jsx)(Vc,{to:Os.VOLUNTEERS_SEGMENT(n,s,e.row.volunteersSegment.id),children:e.row.volunteersSegment.name}):"-"}):e.column.slug===JO.ExecutedAt?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.executedAt?.isValid?o.toLocaleString(e.row.executedAt.toLocal(),Zs.DateTime):"-"}):e.column.slug===JO.Accreditations?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:r,doNotSort:!0})}):e.column.slug===JO.Campaign?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.campaign?(0,i.jsx)(Vc,{to:jI.CAMPAIGN({organizationId:n,eventId:s,campaignId:e.row.campaign.id}),children:e.row.campaign.name}):"-"}):e.column.slug===JO.CustomField?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.customField?e.row.customField.name:"-"}):null},aR=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=cl();return(0,i.jsxs)(Rb,{justify:"between",children:[(0,i.jsx)(br,{font:"gray900 displayXs medium",children:t("automatisations_60045")}),(0,i.jsx)(Ib,{permissions:xb.WORKFLOW_EDIT,children:(0,i.jsx)(jl,{onClick:()=>{e.push(WI.CREATE({organizationId:n,eventId:s}))},children:t("cr_er_une_autom_91246")})})]})},lR=e=>{const{params:{organizationId:t,eventId:n}}=cl(),s=Gn(eR),[o,r,a]=VC(t,"workflows.columns",[JO.Name,JO.State,JO.CreatedBy]),[l,d,c]=VC(t,"workflows.limit",kc),[u,h,m]=VC(t,"workflows.predicates",[]),[g,p,f]=VC(t,"workflows.sort",null),x=(0,M.useMemo)(()=>s.getWorkflowsFilters(t,n),[n,t,s]),_=(0,M.useMemo)(()=>s.getWorkflowsPossibleColumns(),[]),I=a||c||m||f;return(0,i.jsxs)($b,{children:[(0,i.jsx)(aR,{}),(0,i.jsx)(Ob,{children:I?(0,i.jsx)(_l,{}):(0,i.jsx)(lm,{columns:o,columnsSearch:[],columnsToIncludes:QO,eventId:n,filters:x,limit:l,loadDataList:wa,loadDataListParams:{level:n?tt.Event:tt.Organization},loadRow:Sa,organizationId:t,possibleColumns:_,predicates:u,rendering:$h.List,setColumns:r,setLimit:d,setPredicates:h,setSort:p,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:!1,sort:g,children:(0,i.jsx)(bm,{getEditPath:e=>WI.UPDATE({organizationId:t,eventId:n,workflowId:e.id}),renderCell:(e,t)=>(0,i.jsx)(rR,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(nR,{reload:t,workflow:e})})})})]})},dR=()=>{const{translate:e}=cl(),{event:{name:t}}=Jv(),{canWorkflowEdit:n}=lS();return Td(`${t} ${e("automatisations_60045")}`),(0,i.jsx)(lR,{showRowDropdown:n,showRowEdit:n})},cR=()=>{const{translate:e}=cl(),{organization:t}=_I(),{canWorkflowEdit:n}=dS();return Td(`${t.name} ${e("automatisations_60045")}`),(0,i.jsx)(lR,{showRowDropdown:n,showRowEdit:n})};let uR=class extends Pl{translationService;constructor(e){super(e),this.translationService=e}segmentFolderInputDefault(e,t){return{name:t?.name??"",segmentType:e}}};uR=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],uR);const hR=e=>{const t=Hn(),{eventId:n,organizationId:s,segmentType:o,reload:r}=HC(),{mutate:a}=function(e={}){return Kn("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 Kn("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=Gn(uR);return(0,i.jsx)(Tj,{buttonText:e.isEdit?t("mettre_jour_l_05529"):t("cr_er_le_dossie_71150"),icon:"text",initialValues:{segmentFolder:d.segmentFolderInputDefault(o,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:s,eventId:n,segmentFolderId:e.segmentFolder.id,name:t.segmentFolder.name}):await a({organizationId:s,eventId:n,segmentFolder:t.segmentFolder}),r(),e.onClose()},children:(0,i.jsx)(Rl,{label:t("nom_du_dossier_95781"),name:"segmentFolder.name"})})},mR=e=>{const[t,n]=M.useState(!1),s=M.useCallback(t=>{e.setSegmentsFolders((0,cu.jM)(n=>{n[e.segmentFolderIndex].segments[e.index].name=t}))},[e.segmentFolderIndex,e.index,e.setSegmentsFolders]),o=M.useCallback(()=>e.setSegmentsFolders(t=>t.map(t=>({...t,segments:t.segments.filter(t=>t.id!==e.segment.id)}))),[e.segment,e.setSegmentsFolders]);return(0,i.jsx)(uu.sx,{draggableId:`s-${e.segment.id}`,index:e.index,children:r=>(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",...r.draggableProps,ref:r.innerRef,align:"center",children:[(0,i.jsx)(br,{color:"gray300",css:{cursor:"pointer"},...r.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Ol,{value:e.segment.name,onChange:s})}):(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 textSm medium",children:e.segment.name}),(0,i.jsx)(jl,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(jl,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:o})]})})},gR=e=>{const[t,n]=M.useState(!1),s=M.useCallback(t=>{e.setSegmentsFolders((0,cu.jM)(n=>{n[e.index].name=t}))},[e.index,e.setSegmentsFolders]);return(0,i.jsx)(uu.sx,{draggableId:`sf-${e.segmentFolder.id}`,index:e.index,children:o=>(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",...o.draggableProps,ref:o.innerRef,children:[(0,i.jsxs)(Ra,{align:"center",css:{padding:"$4"},gap:"3",children:[(0,i.jsx)(br,{color:"gray300",css:{cursor:"pointer"},fontSize:"textMd",...o.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Ol,{value:e.segmentFolder.name,onChange:s})}):(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textMd medium",children:e.segmentFolder.name}),(0,i.jsx)(jl,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(jl,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:()=>{e.setSegmentsFolders(t=>t.filter(t=>t!==e.segmentFolder))}})]}),(0,i.jsx)(uu.gL,{droppableId:`drop-sf-${e.segmentFolder.id}`,type:"segment",children:t=>(0,i.jsxs)(Ra,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",...t.droppableProps,ref:t.innerRef,children:[e.segmentFolder.segments.map((t,n)=>(0,i.jsx)(mR,{canDelete:e.segmentFolder.segments.length>1,index:n,segment:t,segmentFolderIndex:e.index,setSegmentsFolders:e.setSegmentsFolders},t.id)),t.placeholder]})})]})})},pR=e=>{const t=Hn(),{segmentsFolders:n}=HC(),{mutate:s,isLoading:o}=function(e={}){return Kn("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,M.useState)(n.map(e=>({id:e.id,name:e.name,segments:e.segments.map(e=>({id:e.id,name:e.name}))}))),l=(0,M.useCallback)(async()=>{await s({organizationId:e.organizationId,eventId:e.eventId,segmentType:e.segmentType,segmentsFolders:r.map(e=>({...e,id:!e.id||e.id<0?void 0:e.id}))}),e.onClose(),e.onSuccess()},[e.organizationId,e.eventId,e.segmentType,r]),d=(0,M.useCallback)(({reason:e,source:t,destination:n})=>{if("DROP"===e&&n&&t.index!==n.index&&"main"===t.droppableId&&"main"===n.droppableId)a(so(r,t.index,n.index));else if("DROP"===e&&n&&(t.droppableId!==n.droppableId||t.index!==n.index)&&t.droppableId.startsWith("drop-sf-")&&n.droppableId.startsWith("drop-sf-")){const e=parseInt(t.droppableId.substring(8),10),i=parseInt(n.droppableId.substring(8),10);a(e!==i?(0,cu.jM)(s=>{const o=s.find(t=>t.id===e),r=s.find(e=>e.id===i),a=o.segments.find((e,n)=>n===t.index);o.segments=(0,sc.A)(o.segments,a),r.segments.splice(n.index,0,a)}):(0,cu.jM)(i=>{const s=i.find(t=>t.id===e);s.segments=so(s.segments,t.index,n.index)}))}},[r,a]);return(0,i.jsx)(zm,{button:(0,i.jsx)(jl,{isLoading:o,onClick:l,children:t("enregistrer_06519")}),category:t("vues_personnali_80652"),title:t("param_tres_de_v_66378"),onClose:e.onClose,children:(0,i.jsxs)(Em,{css:{background:"white"},children:[(0,i.jsxs)(Ra,{align:"center",gap:"6",justify:"between",children:[(0,i.jsx)(br,{font:"gray900 textLg semiBold",children:t("organisation_de_95776")}),(0,i.jsx)(jl,{color:"white",leftIcon:"folder-plus",onClick:()=>{const e=Math.min((0,Ju.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)(Wu,{height:"5"}),(0,i.jsx)(uu.JY,{onDragEnd:d,children:(0,i.jsx)(uu.gL,{droppableId:"main",type:"segmentFolder",children:e=>(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,...e.droppableProps,ref:e.innerRef,children:[r.map((e,t)=>(0,i.jsx)(gR,{canDelete:r.length>1,index:t,segmentFolder:e,setSegmentsFolders:a},t)),e.placeholder]})})})]})})},fR=hr("div",{alignItems:"center",borderRadius:"$2",cursor:"pointer",display:"flex",gap:"$4",padding:"$4",userSelect:"none","&:hover":{boxShadow:"$xs"},"& .radio-row-text":{flex:1,fontWeight:"$medium"},"& .radio-row-button":{alignItems:"center",borderRadius:"16px",color:"white",display:"flex",fontSize:"10px",height:"16px",justifyContent:"center",width:"16px"},variants:{state:{unchecked:{background:"white",border:"1px solid $gray200","&:hover":{background:"$gray50"},"& .radio-row-text":{color:"$gray700"},"& .radio-row-button":{background:"white",border:"1px solid $gray300"}},checked:{background:"$primary100",border:"1px solid $primary700",boxShadow:"$xs","& .radio-row-text":{color:"$primary800"},"& .radio-row-button":{background:"$primary700",border:"1px solid $primary700"}}}},defaultVariants:{state:"unchecked"}}),xR=e=>(0,i.jsxs)(fR,{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)(Ya,{icon:"check"})})]}),_R=({description:e,label:t,name:n,value:s})=>{const{inputId:o,descId:r}=Na();return(0,i.jsx)(Fa.D0,{name:n,render:n=>{const a=n.input.checked?"checked":"unchecked";return(0,i.jsx)(xR,{descId:r,inputId:o,state:a,onClick:()=>{n.input.onChange(s)},children:(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(El,{htmlFor:o,children:(0,i.jsx)(br,{children:t})}),e&&(0,i.jsx)(br,{fontWeight:"regular",id:r,children:e})]})})},type:"radio",value:s})},IR=e=>{const t=Hn(),{eventId:n,organizationId:s,segmentsFolders:o,reload:r}=HC(),{mutate:a}=function(e={}){return Kn("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)(Tj,{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:s,eventId:n,segmentId:e.segment.id,segmentFolderId:t.segmentFolderId}),r(),e.onClose()},children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",children:t("vers_quel_dossi_86452")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{css:{overflowY:"auto"},direction:"column",gap:"3",children:o.map(e=>(0,i.jsx)(_R,{label:e.name,name:"segmentFolderId",value:e.id},e.id))})]})},vR=e=>{const{translate:t}=cl(),{eventId:n,organizationId:s,segmentsFolders:o,reload:r}=HC(),{mutate:a,isLoading:l}=function(e={}){return Kn("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,M.useState)(e.segment.name),[u,h]=(0,M.useState)(e.segment.segmentFolderId),[g,p]=(0,M.useState)(e.segment.description||void 0),f=m(d);return(0,i.jsx)(ub,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"gear",subtitle:t("mettez_jour_l_55467"),children:t("mise_jour_de_80873")}),(0,i.jsxs)(lb,{gap:"4",children:[(0,i.jsx)(Ol,{label:t("nom_de_la_vue_66415"),value:d,onChange:c}),(0,i.jsx)(fc,{isSearchVisible:!0,label:t("dossier_00726"),shouldParseAsInt:!0,values:[u],onChange:e=>{eo(e)&&h(e[0])},children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Nm,{label:t("Description"),value:g,onChange:p})]}),(0,i.jsx)(ab,{children:()=>(0,i.jsx)(jl,{disabled:!f,isLoading:l,onClick:async()=>{await a({organizationId:s,eventId:n,description:g,name:d,segmentFolderId:u,segmentId:e.segment.id}),r()},children:t("mettre_jour_85141")})})]})})},bR=hr("div",{alignItems:"center",color:"$gray700",cursor:"pointer",display:"flex",height:"32px",gap:"$space$2",px:"$3",width:"100%","&:hover":{"& .count":{background:"$primary700",color:"white"}},"& .name":{flex:"1",ellipsis:""},"& .count, & .count-admin":{borderRadius:"16px",fontSize:"$textXs",px:"8px",py:"2px"},"& .ellipsis":{display:"none"},"&:hover .count-admin":{display:"none"},"&:hover .ellipsis":{color:"$gray700",display:"block","& .trigger":{alignItems:"center",display:"flex",height:"32px",justifyContent:"end",px:"8px",width:"32px"}},variants:{selected:{true:{background:"$primary200",borderRadius:"$1",color:"$primary700","& .count":{background:"$primary700",color:"white"},"& .count, & .count-admin":{background:"$primary700",color:"white"}},false:{"&:hover":{background:"$gray100",borderRadius:"$1",color:"$gray800"},"& .count, & .count-admin":{background:"$primary50",color:"$primary700"}}}}}),jR=(0,M.memo)(function(e){const{history:t,translate:n}=cl(),{canEditSegments:s,eventId:o,organizationId:r,segmentId:a,getSegmentPath:l,onSegmentClick:d,reload:c}=HC(),{mutate:u}=function(e={}){return Kn("mutation SegmentDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentDelete(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:h}=function(e={}){return Kn("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:m}=function(e={}){return Kn("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 Kn("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,M.useState)(!1),[x,_]=(0,M.useState)(!1),[I,v]=(0,M.useState)(!1);return(0,i.jsxs)(bR,{selected:e.segment.id===a,onClick:()=>{d(e.segment.id),t.push(l(e.segment.id))},onMouseLeave:e=>{$d(e.target)},children:[(0,i.jsx)("div",{className:"name",title:e.segment.name,children:e.segment.name}),(0,i.jsx)("div",{className:s?"count-admin":"count",children:e.segment.count}),s&&(0,i.jsx)("div",{className:"ellipsis",onClick:Al,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)("div",{className:"trigger",children:(0,i.jsx)("i",{className:"fa-regular fa-ellipsis-vertical"})})}),(0,i.jsxs)(Vd,{offset:0,placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{f(!0)},children:n("mettre_jour_85141")}),e.canMoveUpDown&&(0,i.jsx)(Ld,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await g({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_49863")}),e.canMoveUpDown&&(0,i.jsx)(Ld,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await m({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_52432")}),e.canMoveFolder&&(0,i.jsx)(Ld,{icon:"folder",onClick:()=>{_(!0)},children:n("d_placer_de_dos_65513")}),e.canDelete&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>{await h({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{v(!0)},children:n("supprimer_43083")})]})]})]})}),p&&(0,i.jsx)(vR,{segment:e.segment,onClose:()=>{f(!1)}}),x&&(0,i.jsx)(IR,{segment:e.segment,onClose:()=>{_(!1)}}),I&&(0,i.jsx)(Pk,{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:o,segmentId:e.segment.id}),c(),await e.onDelete()},children:e.segment.isUsedInWorkflow&&(0,i.jsx)(Ja,{color:"warning",leftIcon:"circle-exclamation",children:n("cette_vue_est_u_58409")})})]})}),CR=e=>{const t=Hn(),{canEditSegments:n,eventId:s,organizationId:o,reload:r,segmentType:a}=HC(),{mutate:l}=function(e={}){return Kn("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 Kn("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 Kn("mutation SegmentFolderMoveUp(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentFolderMoveUp(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}(),[u,h]=(0,M.useState)(!1),[g,p]=(0,M.useState)(!1),[f,x]=(0,M.useState)(!1),[_,I]=(0,M.useState)(!1),v=(0,M.useCallback)(async()=>{const t=!f;x(t),await rI.segmentsFolders.put({id:e.segmentFolder.id,isOpen:t})},[f,e.segmentFolder.id]),b=(0,M.useMemo)(()=>m(e.search)?e.segmentFolder.segments.filter(t=>t.name.toLowerCase().includes(e.search.toLowerCase())):e.segmentFolder.segments,[e.segmentFolder.segments,e.search]);return(0,M.useEffect)(()=>{(async()=>{x((await rI.segmentsFolders.get(e.segmentFolder.id))?.isOpen??!0)})()},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",userSelect:"none","& .ellipsis":{display:"none"},"&:hover .ellipsis":{display:"block"}},gap:"2",onClick:v,children:[(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:f?"chevron-down":"chevron-right"})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 textXs semiBold",children:e.segmentFolder.name}),n&&(0,i.jsx)(br,{className:"ellipsis",onClick:Al,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Ra,{align:"center",css:{color:"$gray500",px:"$2"},justify:"end",width:24,children:(0,i.jsx)(Ya,{icon:"ellipsis-vertical"})})}),(0,i.jsxs)(Vd,{offset:0,placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{h(!0)},children:t("renommer_42135")}),(0,i.jsx)(Ld,{icon:"gear",onClick:()=>{I(!0)},children:t("r_ordonner_41823")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Ld,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await d({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_52432")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Ld,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await c({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_49863")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:t("supprimer_43083")})]})]})})]}),b.length>0&&f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{direction:"column",gap:"1",children:b.map((t,n)=>(0,i.jsx)(jR,{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)(Ba,{height:"5"})]}),u&&(0,i.jsx)(hR,{isEdit:!0,segmentFolder:e.segmentFolder,onClose:()=>{h(!1)}}),g&&(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_13885"),text:t("suppression_de_73669",e.segmentFolder.name),onClose:()=>{p(!1)},onDelete:async()=>{await l({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()}}),_&&(0,Wt.createPortal)((0,i.jsx)(br,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(pR,{eventId:s,organizationId:o,segmentType:a,onClose:()=>{I(!1)},onSuccess:()=>(r(),e.onSegmentDelete())})}),document.body)]})},yR=e=>{const t=Hn(),{canEditSegments:n,segmentsFolders:s}=HC(),[o,r]=(0,M.useState)(!1),a=(0,M.useMemo)(()=>s.flatMap(e=>e.segments).length>1,[s]),[l,d]=(0,M.useState)(""),c=(0,M.useMemo)(()=>m(l)?s.filter(e=>e.segments.some(e=>e.name.toLowerCase().includes(l.toLowerCase()))):s,[s,l]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(id,{css:{background:"white",borderRight:"1px solid $gray200",overflow:"hidden"},gridtemplaterows:"1fr 48px",height:1,width:1,children:[(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7 $4"},direction:"column",width:1,children:[(0,i.jsx)(Ra,{align:"center",children:(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"textMd",fontWeight:"semiBold",children:t("vues_personnali_80652")})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:d})}),(0,i.jsx)(Ba,{height:"4"}),c.map((t,n)=>(0,i.jsx)(CR,{canDeleteSegment:a,canDeleteSegmentFolder:s.length>1,isFirst:0===n,isLast:n===s.length-1,search:l,segmentFolder:t,onSegmentDelete:e.onSegmentDelete},t.id))]}),n&&(0,i.jsxs)(Ra,{align:"center",css:{borderTop:"1px solid $gray200",cursor:"pointer",padding:"$3 $6"},gap:"4",width:1,onClick:()=>{r(!0)},children:[(0,i.jsx)(Ya,{icon:"plus"}),(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:t("nouveau_dossier_94479")})]})]}),o&&(0,i.jsx)(hR,{isEdit:!1,onClose:()=>{r(!1)}})]})},kR=()=>{const{history:e,translate:t}=cl(),{columns:n,columnsExport:s,columnsSearch:o,eventId:r,getSegmentPath:a,infos:l,organizationId:d,predicates:c,reload:u,rendering:h,segment:g,segmentId:p,segmentType:f,segmentsFolders:x,sort:_,setIsSaveSegmentVisible:I}=HC(),v=(0,M.useCallback)(()=>{I(!1)},[I]),{mutate:b,isLoading:j}=function(e={}){return Kn("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 Kn("mutation SegmentCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n $segment: SegmentInput!\n) {\n segmentCreate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n segment: $segment\n ) {\n id\n }\n}\n",e)}(),[k,A]=(0,M.useState)(!1),[w,S]=(0,M.useState)(""),[E,T]=(0,M.useState)(x.find(e=>e.segments.find(e=>e.id===p))?.id??x[0].id),[z,O]=(0,M.useState)(g.description||void 0),R=!k||m(w);return(0,i.jsx)(ub,{isOpen:!0,onClose:v,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"floppy-disk",subtitle:t("sauvegarder_vos_15289"),children:t("enregistrer_une_52986")}),(0,i.jsxs)(lb,{children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_33936")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(hc,{css:{"& label > div > div":{fontWeight:"$regular"}},state:k?"unchecked":"checked",onClick:()=>{A(!1)},children:t("enregistrer_les_31603").split("{1}").map((e,t)=>1===t?(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(Gm,{fontWeight:"medium",children:g.name}),e]},t):(0,i.jsx)(M.Fragment,{children:e},t))}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(hc,{css:{"& label > div > div":{fontWeight:"$regular"}},state:k?"checked":"unchecked",onClick:()=>{A(!0)},children:t("cr_er_une_nouve_37002")}),k&&(0,i.jsx)(br,{css:{marginLeft:"$6"},children:(0,i.jsx)(Ol,{hint:t("cette_vue_sera_83858"),placeholder:t("nom_de_votre_no_21748"),value:w,onChange:S})})]})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(fc,{isSearchVisible:!0,label:t("dans_quel_dossi_07643"),shouldParseAsInt:!0,values:[E],onChange:e=>{eo(e)&&T(e[0])},children:x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Nm,{label:t("Description"),placeholder:t("entrer_une_desc_74340"),value:z,onChange:O})]}),(0,i.jsx)(ab,{children:()=>(0,i.jsx)(jl,{disabled:!R,isLoading:y||j,onClick:async()=>{const t={segmentType:f,name:w,description:z,predicates:c,columns:n,columnsExport:s,columnsSearch:o,sort:_,rendering:h,infos:l};if(k){const{segmentCreate:{id:n}}=await C({organizationId:d,eventId:r,segmentFolderId:E,segment:t});u(),e.push(a(n))}else await b({organizationId:d,eventId:r,segmentFolderId:E,segmentId:p,segment:t}),u()},children:t("enregistrer_06519")})})]})})},AR=e=>{const t=Hn(),{areColumnsOpen:n,areSegmentsOpen:s,clearNameCursors:o,columns:r,filters:a,hideSegments:l,isFilterOpen:d,isSaveSegmentVisible:c,possibleColumns:u,predicates:h,selectedFilterPredicate:m,setAreColumnsOpen:g,setColumns:p,setIsFilterOpen:f,setPredicates:x}=HC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{height:1,width:1,children:[!0!==l&&s&&(0,i.jsx)(br,{css:{overflow:"hidden"},height:1,width:260,children:(0,i.jsx)(yR,{onSegmentDelete:e.onSegmentDelete})}),(0,i.jsx)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",height:1,children:e.children})]}),d&&(0,i.jsx)(Qh,{buttonText:e.filtersButtonText,possibleFilters:a,predicates:h,selectedFilterPredicate:m,subtitle:e.filtersSubtitle,onClose:()=>{f(!1)},onFilter:e=>{o(),x(e)}}),n&&(0,i.jsx)(_u,{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)(kR,{})]})},wR=e=>{const[t,n]=M.useState(e.segmentsFolders),s=M.useMemo(()=>t.flatMap(e=>e.segments),[t]),o=M.useMemo(()=>s.find(t=>t.id===e.segmentId),[e.segmentId,s]),[r,a]=M.useState(o.predicates),[l,d]=M.useState(o.columns),[c,u]=M.useState(o.columnsExport),[h,m]=M.useState(o.columnsSearch),[g,p]=M.useState(o.rendering),[f,x]=M.useState(o.sort),[_,I]=M.useState(o.infos),v=M.useMemo(()=>JSON.stringify(o.predicates),[o]),b=M.useMemo(()=>JSON.stringify(o.columns),[o]),j=M.useMemo(()=>JSON.stringify(o.columnsExport),[o]),C=M.useMemo(()=>JSON.stringify(o.columnsSearch),[o]),y=M.useMemo(()=>JSON.stringify(o.rendering),[o]),k=M.useMemo(()=>JSON.stringify(o.sort),[o]),A=M.useMemo(()=>JSON.stringify(o.infos),[o]),[w]=M.useMemo(()=>au(r,e.filters),[r,e.filters]),[S,E]=M.useState(!1),[T,z]=M.useState(!1),[O,R]=M.useState(!1),[$,D]=M.useState(null),[P,F]=M.useState(!1),[N,L]=M.useState(e.initialSegmentsOpen??!0),B=M.useCallback(t=>{e.onSegmentsToggle?.(t),L(t)},[L]),V=M.useMemo(()=>JSON.stringify(r)!==v||JSON.stringify(l)!==b||JSON.stringify(g)!==y||JSON.stringify(c)!==j||JSON.stringify(h)!==C||JSON.stringify(f)!==k||JSON.stringify(_)!==A,[v,r,b,l,y,g,j,c,C,h,k,f,_,A]),[U,W]=M.useState(""),[G,H]=M.useState(""),[q,Y]=M.useState(e.initialLimit),[K,Z]=M.useState(0),X=Dc(e=>{H(e),ee()}),[J,Q]=M.useState(1),ee=M.useCallback(()=>{Z(0)},[Z]),te=M.useCallback(t=>{Y(t),e.setLimit(t),ee()},[Y,ee]),ne=M.useCallback(()=>{W(""),H(""),ee()},[W,H,ee]),ie=Iu({}),se=M.useCallback(()=>{ie.toggleSelectAll("unchecked"),Q(J+1)},[ie,J]),oe=M.useMemo(()=>ie.isAllSelected?o.id:null,[ie,o]),re=M.useCallback(e=>{x(e),Z(0)},[x,Z]),ae=M.useCallback((e,i)=>{n((0,cu.jM)(t,t=>{t.forEach(t=>{t.segments.forEach(t=>{t.id===e&&(t.count=i)})})}))},[t,n]);return M.useEffect(()=>{a(o.predicates),d(o.columns),u(o.columnsExport),m(o.columnsSearch),p(o.rendering),x(o.sort),I(o.infos),W(""),H(""),ee(),Q(1)},[o]),M.useEffect(()=>{n(e.segmentsFolders)},[e.segmentsFolders]),(0,i.jsx)(GC.Provider,{value:{areColumnsOpen:O,areSegmentsOpen:N,canEditSegments:e.canEditSegments,clearNameCursors:ne,columns:l,columnsExport:c,columnsSearch:h,eventId:e.eventId,filters:e.filters,filtersPredicates:w,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,infos:_,isEditMode:S,isFilterOpen:T,isSaveSegmentVisible:P,isSaveVisible:V,limit:q,massActions:ie,massEditSegmentId:oe,name:U,nameDebounced:G,offset:K,onMassEditSuccess:se,onSegmentClick:e.onSegmentClick,organizationId:e.organizationId,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:r,reload:e.reload,reloadKey:J,rendering:g,segment:o,segmentId:e.segmentId,segmentType:e.segmentType,segmentsFolders:t,selectedFilterPredicate:$,setAreColumnsOpen:R,setAreSegmentsOpen:B,setColumns:d,setColumnsExport:u,setColumnsSearch:m,setInfos:I,setIsEditMode:E,setIsFilterOpen:z,setIsSaveSegmentVisible:F,setLimit:te,setName:W,setNameDebounced:X,setOffset:Z,setPredicates:a,setReloadKey:Q,setRendering:p,setSegmentCount:ae,setSelectedFilterPredicate:D,setSort:re,sort:f},children:(0,i.jsx)(AR,{filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle,onSegmentDelete:e.onSegmentDelete,children:e.children})})};let SR=class extends du{constructor(e,t,n){super(e,t,n)}getCampaignsFilters(e){return[{slug:"state",name:this.t("status_06428"),category:this.t("Campaigns"),fieldType:Ve.Select,values:Kt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"campaign_type",name:this.t("type_35427"),category:this.t("Campaigns"),fieldType:Ve.Select,values:Zt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"created_by",name:this.t("cr_e_par_30622"),category:this.t("Campaigns"),fieldType:Ve.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:Ve.Date,hideEmpty:!0}]}};SR=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],SR);const ER=e=>{const{translate:t}=cl(),{columnsSearch:n,setColumnsSearch:s}=HC(),[o,r]=(0,M.useState)(""),a=(0,M.useMemo)(()=>m(o)?e.searchableColumns.filter(e=>e.name.toLowerCase().trim().includes(o.toLowerCase().trim())):e.searchableColumns,[e.searchableColumns,o]);return(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(Vd,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Ra,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:o,onChange:r}),(0,i.jsx)(Ra,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(dc,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{s(no(n,e,"checked"===t))},children:t},e))})]})})]})},TR=e=>{const t=Hn(),{canEditSegments:n,isEditMode:s,isSaveVisible:o,massActions:r,name:a,possibleColumns:l,possibleRenderings:d,rendering:c,setAreColumnsOpen:u,setIsEditMode:h,setIsFilterOpen:m,setIsSaveSegmentVisible:g,setName:p,setNameDebounced:f,setRendering:x,setSelectedFilterPredicate:_}=HC(),I=e.showActions&&e.actions&&r.numberOfSelected>0,v=M.useMemo(()=>(0,ic.A)(l.filter(e=>e.isSearchable),e=>e.name),[l]),b=M.useMemo(()=>e.showSearchColumns?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[e.showSearchColumns]);return sm("e",M.useCallback(()=>{h(!s)},[s,h])),(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsxs)(Ra,{width:320,children:[(0,i.jsx)(Ol,{css:b,icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:a,onChange:e=>{p(e),f(e)}}),e.showSearchColumns&&(0,i.jsx)(ER,{searchableColumns:v})]}),n&&(0,i.jsx)(jl,{color:"gray",leftIcon:"bars-filter",onClick:()=>{_(null),m(!0)},children:t("filtres_64574")}),(0,i.jsx)(br,{css:{flex:"1"},children:n&&o&&(0,i.jsx)(jl,{color:"invisible",onClick:()=>{g(!0)},children:t("enregistrer_la_22884")})}),!I&&e.showEditColumns&&(0,i.jsx)(jl,{color:"invisible",css:{color:"$gray800","&:hover":{color:"$gray800"}},leftIcon:"gear",onClick:()=>{u(!0)},children:t("_diter_les_colo_39630")}),!I&&e.showEditMode&&(0,i.jsx)(xu,{value:s,onChange:h,children:t("mode_dition_93778")}),!I&&eo(d)&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:Fh(c),children:Mh(t,c)})}),(0,i.jsx)(Vd,{placement:"bottom-end",children:d.map(e=>(0,i.jsx)(Ld,{icon:Fh(e),onClick:()=>x(e),children:Mh(t,e)},e))})]}),I&&e.actions]})},zR=()=>{const e=Hn(),t=Gn(du),{filtersPredicates:n,clearNameCursors:s,setPredicates:o,setIsFilterOpen:r,setSelectedFilterPredicate:a,predicates:l}=HC(),d=(0,M.useCallback)(()=>{s(),o([])},[s,o]),c=(0,M.useCallback)(e=>{a(e),r(!0)},[r,a]),u=(0,M.useCallback)(e=>{s(),o((0,sc.A)(l,e.predicate))},[l,s,o]);return Kh(n),eo(n)?(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(Jd,{leftIcon:"loader"},n):(0,i.jsx)(Jd,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>{c(e)},onRightIconClick:()=>{u(e)},children:t.filterPredicateToText(e)},n)),(0,i.jsx)(br,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:e("r_initialiser_l_66835")})]}):null},OR=e=>{const{canEditSegments:t,limit:n,massActions:s}=HC(),o=t&&s.numberOfSelected===n;return(0,i.jsxs)(Ra,{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)(zR,{}),o&&e.selectSegment]})},RR=e=>{const{translate:t,params:{organizationId:n,segmentId:s}}=cl(),{areSegmentsOpen:o,hideSegments:r,segment:a,setAreSegmentsOpen:l,setSegmentCount:d}=HC(),{data:c}=Yn("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 M.useEffect(()=>{a.id===s&&d(a.id,c.organization?.segment.count??a.count)},[s,a,c.organization,d]),(0,i.jsx)(Rb,{children:(0,i.jsxs)(Ra,{align:"center",gap:"4",width:1,children:[!r&&(0,i.jsx)(Ra,{css:{cursor:"pointer",padding:"$2"},onClick:()=>l(!o),children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"sidebar"})})}),(0,i.jsx)(_m,{placement:"top",children:t(o?"masquer_la_list_94215":"afficher_la_lis_48771")})]})}),e.name||(0,i.jsxs)(br,{css:{flex:"1"},font:"gray900 displayXs medium",children:[(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsx)(br,{children:a.name}),a.isUsedInWorkflow&&(0,i.jsx)(Jd,{color:"white",leftIcon:"bolt-auto",children:t("utilis_e_dans_u_46582")})]}),a.description&&(0,i.jsx)(br,{css:{whiteSpace:"pre-wrap"},font:"gray500 textXs medium",children:a.description})]}),e.children]})})},$R=()=>{const{translate:e,history:t,params:{organizationId:n}}=cl();return(0,i.jsx)(RR,{children:(0,i.jsx)(Ib,{permissions:xb.CAMPAIGN_SEND,children:(0,i.jsx)(wS,{menu:(0,i.jsx)(Ld,{icon:"paper-plane",onClick:()=>{t.push(jI.CREATE_TEMPLATE({organizationId:n}))},children:e("cr_er_un_mod_le_20298")}),onClick:()=>{t.push(jI.CREATE({organizationId:n}))},children:e("cr_er_une_campa_96023")})})})};function DR(e){switch(e){case de.Draft:return{color:"gray",leftIcon:"pen-ruler"};case de.Done:return{color:"success",leftIcon:"check"};case de.InProgress:return{color:"warning",leftIcon:"hourglass-empty"};case de.Scheduled:return{color:"primary",leftIcon:"calendar"};case de.Template:return{color:"purple",leftIcon:"paper-plane"};default:return nl()}}const PR=e=>{const{history:t,translate:n}=cl(),{showNotification:s}=ib(),{mutate:o}=function(e={}){return Kn("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 Kn("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 Kn("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,M.useState)(!1),c=e.campaign.state===de.Draft||e.campaign.state===de.Scheduled;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{t.push(jI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}))},children:n("_diter_62574")}),c&&(0,i.jsx)(Ld,{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)(Ld,{icon:"clone",onClick:async()=>{const{campaignDuplicate:{id:n}}=await o({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id});t.push(jI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{$d(e.target),d(!0)},children:n("supprimer_43083")})]}),l&&(0,i.jsx)(Pk,{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}),s(n("la_campagne_1_92813",e.campaign.name)),e.reload()}})]})},FR=e=>{const{translate:t}=cl(),n=Gn(Wc),s=e.campaign.sentAt?.setZone(Bs.c9.local().zone);return(0,i.jsxs)(Tc,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{$d(e.target)},children:[(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(Vc,{to:jI.CAMPAIGN_DASHBOARD({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}),children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.campaign.name,children:e.campaign.name})}),e.campaign.state===de.Done&&s&&(0,i.jsx)(br,{color:"gray500",children:t("envoy_e_le_1_90336",n.toLocaleString(s,Zs.DateTime),e.campaign.createdBy?.nameOrEmail??"")}),e.campaign.state===de.Scheduled&&e.campaign.scheduledAt?.isValid&&(0,i.jsx)(br,{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)(yc,{css:{flex:"0 150px"},children:[(0,i.jsx)(br,{width:22,children:e.campaign.campaignType===ce.Email?(0,i.jsx)(Ya,{icon:"at"}):(0,i.jsx)(Ya,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsx)(yc,{css:{flex:"0 200px",justifyContent:"flex-end"},children:e.campaign.numberOfRecipients}),(0,i.jsx)(yc,{css:{flex:"0 150px",justifyContent:"flex-end"},children:e.campaign.campaignType===ce.Email?t("gratuit_13712"):`${e.campaign.cost} €`}),(0,i.jsx)(yc,{css:{flex:"0 150px"},children:(0,i.jsx)(Jd,{...DR(e.campaign.state),children:t(e.campaign.state)})}),(0,i.jsx)(Uc,{justify:"end",children:e.canSendCampaigns&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",to:jI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id})})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(PR,{campaign:e.campaign,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})})]})};function MR(e,t){(0,M.useEffect)(()=>{let n=null;return e.some(e=>e.state===de.InProgress)&&(n=window.setInterval(t,3e4)),()=>{n&&clearInterval(n)}},[e])}const NR=()=>{const{translate:e,params:{organizationId:t}}=cl(),{canCampaignSend:n}=dS(),{limit:s,nameDebounced:o,offset:r,predicates:a,reloadKey:l,setLimit:d,setOffset:c,setSort:u,sort:h}=HC(),{data:g,isLoading:p,reload:f}=Yn("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:m(o)?o:null,limit:s,offset:r,sort:h},[Ms.CampaignListFragment]);const{numberOfPages:x,totalCount:_}=vu(g.organization?.rows);return(0,M.useEffect)(()=>{l>1&&f()},[l]),MR(g.organization?.rows.nodes??[],f),(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":p,headerRow:(0,i.jsxs)(xc,{children:[(0,i.jsx)(mm,{attribute:le.Name,setSort:u,sort:h,children:e("nom_de_la_campa_45063")}),(0,i.jsx)(mm,{attribute:le.Type,setSort:u,sort:h,width:150,children:e("type_35427")}),(0,i.jsx)(Fc,{width:200,children:e("nombre_de_desti_21374")}),(0,i.jsx)(Fc,{width:150,children:e("co_t_68998")}),(0,i.jsx)(mm,{attribute:le.State,css:{flex:"0 150px"},setSort:u,sort:h,children:e("status_06428")}),(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:s,numberOfPages:x,offset:r,setLimit:d,setOffset:c,showLimits:!0,totalCount:_})}),children:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):g.organization.rows.nodes.map(e=>(0,i.jsx)(FR,{campaign:e,canSendCampaigns:n,eventId:null,organizationId:t,reload:f},e.id))})})},LR=()=>{const e=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($R,{}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{searchPlaceholder:e("rechercher_une_69554"),showActions:!1,showEditColumns:!1,showEditMode:!1,showSearchColumns:!1})}),(0,i.jsx)(NR,{})]})]})},BR=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=cl(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=_I(),d=Gn(SR);return(0,i.jsx)(wR,{canEditSegments:r,filters:d.getCampaignsFilters(e.organization.campaignsCreators),filtersButtonText:n("filtrer_les_cam_97457"),filtersSubtitle:n("appliquer_des_f_57442"),getSegmentPath:e=>jI.CAMPAIGNS_SEGMENT({organizationId:s,segmentId:e}),initialLimit:a?.campaignsLimit??kc,initialSegmentsOpen:a?.areCampaignsSegmentsOpen??!0,organizationId:s,possibleColumns:[],possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:_t.Campaigns,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({campaignsLimit:e})},onSegmentClick:e=>{l({campaignsSegmentId:e})},onSegmentDelete:async()=>{await l({campaignsSegmentId:null}),t.replace(jI.CAMPAIGNS({organizationId:s}))},onSegmentsToggle:async e=>{await l({areCampaignsSegmentsOpen:e})},children:(0,i.jsx)(LR,{})})},VR=()=>{const{params:{organizationId:e},translate:t}=cl();Td(`${t("communaut_20896")} ${t("Campaigns")}`);const{localOrganization:n}=_I(),{data:s,loader:o,reload:r}=Yn("query CampaignsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n campaignsCreators {\n userId\n nameOrEmail\n }\n\n segmentsFolders(level: Organization, segmentType: Campaigns) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e},[Ms.SegmentsFoldersSegmentsFragment]),a=(0,M.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:jI.CAMPAIGNS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(BR,{organization:s.organization,reload:r})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:jI.CAMPAIGNS_SEGMENT({organizationId:e,segmentId:n?.campaignsSegmentId&&a.includes(n.campaignsSegmentId)?n?.campaignsSegmentId:a[0]}),replace:!0})})]})},UR=()=>{const{translate:e,params:{organizationId:t}}=cl(),{updateLocalOrganization:n}=_I(),{canCampaignRead:s,canFormRead:o,canDelegationRead:r,canWorkflowRead:a}=dS();return(0,i.jsxs)(vS,{"aria-label":e("menu_communauta_47274"),children:[(0,i.jsx)(IS,{replace:!1,to:ji.COMMUNITY_DASHBOARD({organizationId:t}),children:e("tableau_de_bord_24627")}),(0,i.jsx)(IS,{isActive:e=>e.endsWith("/users")||null!==e.match(/\/users\/\d+/)||null!==e.match(/\/member\/\d+/),replace:!1,to:ji.COMMUNITY_USERS({organizationId:t}),onClick:()=>n({usersSegmentId:null}),children:e("vos_membres_38104")}),s&&(0,i.jsx)(IS,{isActive:e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/community\/campaigns\/\d+/)||null!==e.match(/\/community\/campaign\/\d+/),replace:!1,to:jI.CAMPAIGNS({organizationId:t}),onClick:()=>n({campaignsSegmentId:null}),children:e("Campaigns")}),o&&(0,i.jsx)(IS,{isActive:e=>e.endsWith("/forms")||e.endsWith("/forms/create"),replace:!1,to:Fi.FORMS({organizationId:t}),children:e("Form_plural")}),r&&(0,i.jsx)(IS,{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:Os.COMMUNITY_DELEGATIONS(t),children:e("d_l_gations_78318")}),a&&(0,i.jsx)(IS,{replace:!1,to:WI.WORKFLOWS({organizationId:t}),children:e("automatisations_60045")})]})},WR=e=>(0,i.jsx)(BE,{children:(0,i.jsxs)(id,{gridtemplatecolumns:"auto",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(UR,{}),(0,i.jsx)(br,{css:{overflowY:"auto"},children:e.children})]})}),GR=()=>{const e=Hn(),{organizationId:t}=Zn(),n=Xn(),{data:s,loader:o}=Yn("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=Gn(ah);return o||(0,i.jsxs)(Ra,{css:{margin:"auto"},direction:"column",height:1,width:"$container",children:[(0,i.jsx)(Ba,{height:"9"}),(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("tableau_de_bord_24627")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:e("en_un_coup_d_oe_57288")}),(0,i.jsx)(Ba,{height:"9"}),(0,i.jsxs)(Ra,{gap:"6",width:1,children:[(0,i.jsx)(Fw,{icon:"megaphone",iconColor:"primary",text:e("nombre_d_v_nem_14214"),value:s.organization.events.nodes.length}),(0,i.jsx)(Fw,{icon:"user-group",iconColor:"purple",text:e("nombre_de_membr_08851"),value:s.organization.numberOfUsersInfos})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Fc,{children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(Fc,{width:200,children:e("nombre_de_missi_67304_plural")}),(0,i.jsx)(Fc,{children:e("taux_de_remplis_11913")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:s.organization.events.nodes.map(e=>{const s=(0,mb.A)(e.assignedResources/e.resources*100);return(0,i.jsxs)(Tc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{n.push(Bi.EVENT({organizationId:t,eventId:e.id}))},children:[(0,i.jsx)(yc,{children:e.name}),(0,i.jsx)(yc,{children:e.range?r.toDisplayString(e.range):"-"}),(0,i.jsx)(yc,{width:200,children:e.numberOfPositions}),(0,i.jsx)(yc,{children:e.resources>0?(0,i.jsxs)(Ra,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(ow,{percent:e.assignedResources/e.resources})}),(0,i.jsxs)(br,{color:"gray700",width:40,children:[s," %"]})]}):"-"})]},e.id)})}),setOffset:Hl.A,title:e("liste_des_v_ne_29929"),totalCount:0}),(0,i.jsx)(Ba,{height:"9"})]})};var HR;function qR(e,t){return t===Rh.AccreditationsMatrix?{includeAccreditationsSlots:!0,includeCampaigns:!1,includeChildren:!1,includeCreatedBy:!1,includeDocuments:!1,includeLeaders:!1,includeResources:!1,includeTags:!1,includeUsedCustomFieldsFilled:!1}:{includeAccreditationsSlots:!1,includeCampaigns:e.includes(HR.Campaigns),includeChildren:e.includes(HR.Events),includeCreatedBy:e.includes(HR.CreatedBy),includeDocuments:e.includes(HR.Documents),includeLeaders:e.includes(HR.Leaders),includeResources:e.includes(HR.FillingRate)||e.includes(HR.AssignedResources),includeTags:e.includes(HR.Tags),includeUsedCustomFieldsFilled:e.includes(HR.UsedCustomFieldsFilled)}}!function(e){e.AssignedResources="resources",e.Campaigns="campaigns",e.CanLeadersAddMembers="canLeadersAddMembers",e.CanLeadersDeleteMembers="canLeadersDeleteMembers",e.CanLeadersEditColumns="canLeadersEditColumns",e.CanLeadersEditCustomFields="canLeadersEditCustomFields",e.CanLeadersEditMembers="canLeadersEditMembers",e.CanLeadersImportMembers="canLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="canLeadersSeeHiddenAccreditationsSlots",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.DeadlineDate="deadlineDate",e.DelegationCategory="delegationCategory",e.DelegationSpaceLink="delegationSpaceLink",e.Description="description",e.Documents="documents",e.Events="events",e.FillingRate="fillingRate",e.Form="form",e.FormLink="formLink",e.Id="id",e.IsLocked="isLocked",e.Leaders="leaders",e.MaxResources="maxResources",e.Name="name",e.PrivateNote="privateNote",e.ShowFormLinkInDelegationSpace="showFormLinkInDelegationSpace",e.ShowInDelegation="showInDelegation",e.State="delegationState",e.UsedCustomFieldsFilled="usedCustomFieldsFilled",e.Tags="tags"}(HR||(HR={}));let YR=class extends du{constructor(e,t,n){super(e,t,n)}getDelegationsFilters(e,t,n,i){return(0,Va.A)([{slug:HR.Name,name:this.t("nom_de_la_d_l_g_28087"),category:this.t("d_l_gations_78318"),fieldType:Ve.Text,hideEmpty:!0},{slug:HR.Description,name:this.t("Description"),category:this.t("d_l_gations_78318"),fieldType:Ve.Text},{slug:HR.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("d_l_gations_78318"),fieldType:Ve.Text},eo(i)?{slug:HR.DelegationCategory,name:this.t("cat_gorie_00291"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,values:i,hideEmpty:!0}:null,{slug:"delegationState",name:this.t("status_06428"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,values:nn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:HR.Leaders,name:this.t("reponsable_82458_plural"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"form",name:this.t("Form"),category:this.t("d_l_gations_78318"),fieldType:Ve.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:Ve.Date},{slug:"tag",name:this.t("Tag"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:Ct.Delegations},{slug:"resources",name:this.t("nombre_de_membr_08851"),category:this.t("d_l_gations_78318"),fieldType:Ve.Number,hideEmpty:!0},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("d_l_gations_78318"),fieldType:Ve.Number,hideEmpty:!0},{slug:HR.ShowInDelegation,name:this.t("ShowInDelegationSpace"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:HR.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:HR.CanLeadersDeleteMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:HR.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:HR.CanLeadersEditColumns,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:HR.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:HR.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:HR.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:HR.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},t?{slug:"accreditation",name:this.t("accr_ditations_39450"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,needLoading:!0,eventId:t}:null,{slug:HR.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:HR.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("d_l_gations_78318"),fieldType:Ve.Datetime,hideEmpty:!0},t?null:{slug:"event",name:this.t("_v_nement_22345"),category:this.t("d_l_gations_78318"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:HR.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),category:this.t("d_l_gations_78318"),fieldType:Ve.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(n)])}getDelegationsPossibleColumns(e){return[{slug:HR.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:je.Id,width:100},{slug:HR.Name,name:this.t("nom_de_la_d_l_g_28087"),isSearchable:!0,isSortable:!0,sortAttribute:je.Name,minWidth:240},{slug:HR.DelegationCategory,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:je.Category,minWidth:240},{slug:HR.State,name:this.t("status_06428"),minWidth:180},{slug:HR.Leaders,name:this.t("reponsable_82458_plural"),isSearchable:!0,minWidth:320},{slug:HR.Form,name:this.t("Form"),isSearchable:!0,minWidth:180},{slug:HR.FormLink,name:this.t("FormLink"),minWidth:240},{slug:HR.DelegationSpaceLink,name:this.t("DelegationSpaceLink"),minWidth:240},{slug:HR.DeadlineDate,name:this.t("date_limite_d_i_79779"),minWidth:180},{slug:HR.MaxResources,name:this.t("MaxResources"),minWidth:180},{slug:HR.AssignedResources,name:this.t("membres_11310"),minWidth:240},{slug:HR.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:HR.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:HR.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:HR.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:je.CreatedAt,minWidth:180},{slug:HR.ShowInDelegation,name:this.t("ShowInDelegationSpace"),minWidth:180},{slug:HR.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),minWidth:180},{slug:HR.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),minWidth:180},{slug:HR.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),minWidth:180},{slug:HR.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),minWidth:180},{slug:HR.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),minWidth:180},{slug:HR.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),minWidth:180},{slug:HR.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),minWidth:180},{slug:HR.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),minWidth:180},{slug:HR.IsLocked,name:this.t("IsLocked"),minWidth:180},{slug:HR.Events,name:this.t("_v_nements_53672"),minWidth:320},{slug:HR.Campaigns,name:this.t("campagnes_que_l_81468"),minWidth:320},{slug:HR.Documents,name:this.t("documents_que_l_18755"),minWidth:320},{slug:HR.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),minWidth:180},...this.customFieldsToPossibleColumns(e)]}};function KR(e,t,n){const[i,s]=(0,M.useState)(null);return(0,M.useCallback)(async()=>{if(i)return i;{const i=await e(t,await q()),o=n(i);return s(o),o}},[i,e,t])}YR=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],YR);const ZR=M.createContext({}),XR=e=>{const t=KR(So,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?tt.Event:tt.Organization},e=>e.organization.campaigns.nodes),n=KR(So,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?tt.Event:tt.Organization},e=>e.organization.event?.customDocuments??[]),s=KR(So,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?tt.Event:tt.Organization},e=>e.organization.delegationsCategories.nodes),o=KR(So,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?tt.Event:tt.Organization},e=>e.organization.forms.nodes),r=KR(So,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?tt.Event:tt.Organization},e=>e.organization.tags.nodes);return(0,i.jsx)(ZR.Provider,{value:{getCampaigns:t,getCustomDocuments:n,getDelegationsCategories:s,getEditPath:e.getEditPath,getShowPath:e.getShowPath,getForms:o,getTags:r},children:e.children})};function JR(){return M.useContext(ZR)}const QR=e=>{const t=Hn(),{massActions:n,segment:s}=HC(),o=(0,M.useCallback)(()=>{n.toggleSelectAll("unchecked"),n.setIsAllSelected(!1)},[n]),r=(0,M.useCallback)(()=>{n.setIsAllSelected(!0)},[n]);return(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(br,{fontSize:"textMd",fontWeight:"medium",children:(0,i.jsx)(Ya,{icon:"circle-exclamation"})}),n.isAllSelected?(0,i.jsx)(br,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.segmentSelectedText}):(0,i.jsx)(br,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.pageSelectedText}),n.isAllSelected?(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:o,children:t("effacer_la_s_le_85095")}):(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:r,children:t("s_lectionner_le_71777",s.count,s.name)})]})},e$=e=>{const{translate:t,params:{organizationId:n}}=cl(),[s,o]=(0,M.useState)(!1),[r,a]=(0,M.useState)(Qe.Add),[l,d]=(0,M.useState)([]),[c,u]=(0,M.useState)(e.roles[0]?.id??null),[h,m,g]=Pc(""),{usersInfosOptions:p,isLoading:f}=jb({organizationId:n,eventId:null,hasSelected:eo(l),nameDebounced:m,userInfoIds:l}),x=eo(l);return(0,i.jsx)(ub,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"user-gear",children:t("_diter_les_resp_29588")}),(0,i.jsxs)(lb,{gap:"6",children:[(0,i.jsxs)(Au,{label:t("que_souhaitez_v_87607"),value:r,onChange:a,children:[(0,i.jsx)("option",{value:Qe.Add,children:t("ajouter_des_res_84773")}),(0,i.jsx)("option",{value:Qe.Replace,children:t("remplacer_les_r_60774")}),(0,i.jsx)("option",{value:Qe.Delete,children:t("supprimer_des_r_69379")})]}),(0,i.jsx)(fc,{isSearchLoading:f,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:h,onChange:g}),values:l,onChange:d,children:p}),e.showRoleSelect&&r!==Qe.Delete&&(0,i.jsx)(Au,{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)(ab,{children:(0,i.jsx)(jl,{disabled:!x,isLoading:s,onClick:async()=>{o(!0),await e.onSuccess(r,l.map(e=>({userInfoId:e,roleId:c}))),e.onClose(),o(!1)},children:t("_diter_62574")})})]})})},t$=e=>(0,i.jsx)(uu.JY,{onDragEnd:({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.setSelectedColumns(so(e.selectedColumns,n.index,i.index))},children:(0,i.jsx)(uu.gL,{droppableId:"1",children:t=>(0,i.jsxs)(Ra,{css:{background:"$gray50",bd:"gray200 1",padding:"$4"},direction:"column",...t.droppableProps,ref:t.innerRef,children:[e.selectedColumns.map((e,t)=>(0,i.jsx)(uu.sx,{draggableId:e.slug,index:t,children:t=>(0,i.jsxs)(Ra,{align:"center",css:{background:"white",border:"1px solid $gray200",borderTop:"none",px:"$4","&:first-child":{borderTop:"1px solid $gray200",borderTopLeftRadius:"$1",borderTopRightRadius:"$1"},"&:last-child":{borderBottomLeftRadius:"$1",borderBottomRightRadius:"$1"}},gap:"3",height:40,...t.draggableProps,ref:t.innerRef,children:[(0,i.jsx)(br,{color:"gray300",css:{cursor:"grab"},...t.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(br,{color:"gray800",children:e.name})]})},e.slug)),t.placeholder]})})}),n$=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=Gn(Bh),{data:r}=Yn("query MassColumnsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:n},[Ms.OrganizationCustomFieldsFragment]),{mutate:a,isLoading:l}=wo(),d=(0,M.useMemo)(()=>o.getDelegationMembersPossibleColumns(r.organization?.customFields.nodes??[],{isWeezeventConnected:!0,positionDisplay:mt.Position,slotDisplay:pt.Custom}),[o,r.organization]),[c,u]=(0,M.useState)(""),h=(0,M.useMemo)(()=>d.filter(e=>!m(c)||e.name.trim().toLowerCase().includes(c.trim().toLowerCase())),[d,c]),[g,p]=(0,M.useState)([]);return(0,i.jsx)(ub,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"line-columns",children:t("_diter_les_colo_38837")}),(0,i.jsxs)(lb,{gap:"2",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("quelles_colonne_05047")}),eo(g)&&(0,i.jsx)(t$,{selectedColumns:g,setSelectedColumns:p}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",children:t("ajouter_des_col_04043")})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:400,children:(0,i.jsxs)(Ra,{css:{py:"$3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(br,{css:{px:"$3"},children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:c,onChange:u})}),(0,i.jsx)(br,{css:{maxHeight:"300px",overflowY:"auto",px:"$3"},children:h.map(e=>(0,i.jsx)(mc,{isCheckbox:!0,isRadio:!1,isSelected:g.includes(e),value:e.slug,onClick:()=>{p(t=>no(t,e,!t.includes(e)))},children:e.name},e.slug))})]})})]})]}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{isLoading:l,onClick:async()=>{const i=(await a({organizationId:n,eventId:s,massEdit:{reset:!1,selecteds:e.selecteds,slug:Ie.Columns,strategy:Qe.Replace,value:g.map(e=>e.slug)}})).numberOfEdited;e.onSuccess(t("les_colonnes_de_83023",i)),e.onClose()},children:t("mettre_jour_85141")})})]})})},i$=e=>{const{translate:t}=cl(),{mutate:n,isLoading:s}=function(e={}){return Kn("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)}(),[o,r]=(0,M.useState)([]),[a,l]=(0,M.useState)([]),{data:d}=Yn("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?tt.Organization:tt.Event,eventId:o[0]},[]);const c=(!!e.eventId||eo(o))&&eo(a);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"clone"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",children:t("copier_les_d_l_43406")}),e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("cela_liera_vos_60643")})]}),(0,i.jsx)(Ba,{height:"7"}),!e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fc,{isSearchVisible:!0,label:t("_v_nement_22345"),values:o,onChange:r,children:(d.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ba,{height:"4"})]}),(e.eventId||eo(o))&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fc,{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)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{disabled:!c,isLoading:s,onClick:async()=>{const i=(await n({organizationId:e.organizationId,eventId:e.eventId,massMove:{eventId:e.eventId?null:o[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)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},s$=()=>{const e=Hn(),{isOrganizationAdmin:t}=_I(),{isEventAdmin:n}=Jv(),{eventId:s,massActions:o,onMassEditSuccess:r,organizationId:a,predicates:l,segment:d}=HC(),{showNotification:c}=ib(),{mutate:u}=wo(),{mutate:h}=function(e={}){return Kn("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:g}=Jr(),[p,f]=(0,M.useState)(!1),[x,_]=(0,M.useState)(!1),[I,v]=(0,M.useState)(!1),[b,j]=(0,M.useState)(!1),[C,y]=(0,M.useState)(!1),k=t||n,A=o.getSelectedsInput(l,null),w=o.isAllSelected?d.count:o.numberOfSelected,S=(0,M.useCallback)(e=>{m(e)&&c(e),r()},[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{onClick:()=>{f(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[k&&(0,i.jsx)(Ld,{icon:"clone",onClick:()=>{_(!0)},children:e(s?"copier_dans_la_91936":"copier_dans_un_20230")}),k&&(0,i.jsx)(Ld,{icon:"user-gear",onClick:()=>v(!0),children:e("_diter_les_resp_29588")}),k&&(0,i.jsx)(Ld,{icon:"line-columns",onClick:()=>j(!0),children:e("_diter_les_colo_38837")}),k&&(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{y(!0)},children:e("supprimer_43083")})]})]}),p&&(0,i.jsx)(Gk,{eventId:s,mutate:e=>u({organizationId:a,eventId:s,massEdit:e}),organizationId:a,selecteds:A,onClose:()=>{f(!1)},onSuccess:t=>{S(e("_1_d_l_gations_08105",t))}}),x&&(0,i.jsx)(i$,{eventId:s,organizationId:a,selecteds:A,onClose:()=>{_(!1)},onSuccess:r}),I&&(0,i.jsx)(e$,{roles:[],showRoleSelect:!1,onClose:()=>v(!1),onSuccess:async(t,n)=>{const i=(await h({organizationId:a,eventId:s,massLeaders:{leaders:n,strategy:t,selecteds:A}})).numberOfDelegations;S(e("les_responsable_32087",i))}}),b&&(0,i.jsx)(n$,{selecteds:A,onClose:()=>j(!1),onSuccess:S}),C&&(0,i.jsx)(Pk,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_34990")],text:e("suppression_de_99024",w),onClose:()=>{y(!1)},onDelete:async()=>{const t=(await g({organizationId:a,eventId:s,selecteds:A})).numberOfDelegations;S(e("_1_d_l_gations_40887",t))}})]})},o$=e=>{const t=Hn(),n=Gn(iA);return(0,i.jsxs)(Ra,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(br,{children:t("_1_2_membres_04485",e.assignedResources,n.toNumberOrInfinity(e.resources))}),(0,i.jsx)(ow,{percent:e.assignedResources/(e.resources||e.assignedResources)})]})},r$=e=>{const t=(0,M.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)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},a$=(0,i.jsx)(_l,{});function l$(e){const[t,n]=(0,M.useState)(!0),[i,s]=(0,M.useState)(null);return(0,M.useEffect)(()=>{e().then(e=>{s(e),n(!1)},()=>{n(!1)})},[]),{isLoading:t,loader:t?a$:null,result:i}}const d$=e=>{const{translate:t}=cl(),{getCampaigns:n}=JR(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("tags_79499")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("Campaigns"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},c$=e=>{const{eventId:t,organizationId:n}=HC(),{mutate:s}=wo();return(0,i.jsx)(ZC,{column:e.column,initialValue:e.initialValue,mutate:async i=>s({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:e.property,strategy:Qe.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},u$=e=>{const t=(0,M.useMemo)(()=>e.delegation.campaigns||[],[e.delegation]),n=(0,M.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:Ie.Campaigns,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(d$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ly,{badges:n})})},h$=({children:e,isEditMode:t,title:n,updatable:s})=>t&&s?(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}):(0,i.jsx)(i.Fragment,{children:e}),m$=e=>{const{translate:t}=cl(),{getDelegationsCategories:n}=JR(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("Category")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Au,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},g$=e=>{const{params:{organizationId:t,eventId:n}}=cl(),{isEditMode:s}=HC();return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationCategory.id,property:Ie.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(m$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(h$,{isEditMode:s,title:e.delegation.delegationCategory.name,updatable:!0,children:(0,i.jsx)(Vc,{to:as.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})})},p$=e=>{const t=Hn(),n=Gn(Wc);return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.deadlineDate,property:Ie.DeadlineDate,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Tu,{label:t("date_limite_d_i_79779"),value:e,onChange:n}),renderValue:e.delegation.deadlineDate?n.toLocaleString(e.delegation.deadlineDate,Zs.DateOnly.MonthLong):"-"})},f$=e=>{const{translate:t}=cl(),{getCustomDocuments:n}=JR(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("tags_79499")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("Documents"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})},x$=e=>{const t=(0,M.useMemo)(()=>e.delegation.customDocuments||[],[e.delegation]),n=(0,M.useMemo)(()=>t.map(e=>({id:e.slug,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.slug),property:Ie.Documents,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(f$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ly,{badges:n})})},_$=e=>{const t=Hn(),{getForms:n}=JR(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("Form")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Au,{label:t("Form"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},I$=e=>(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.form.id,property:Ie.Form,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(_$,{setValue:t,value:e}),renderValue:e.delegation.form.name}),v$=e=>{const t=Hn();return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.lockedAt?.isValid??!1,property:Ie.IsLocked,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Au,{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")})},b$=e=>{const t=(0,M.useMemo)(()=>(0,ic.A)(e.delegation.leaders,e=>e.nameOrEmail.toLowerCase()).map(e=>({id:e.id,color:"gray",icon:null,text:e.nameOrEmail})),[e.delegation]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},j$=e=>{const t=Hn(),n=Gn(iA);return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.maxResources||"",property:Ie.MaxResources,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("MaxResources"),shouldParseAsInt:!0,value:e,onChange:n}),renderValue:n.toNumberOrInfinity(e.delegation.maxResources)})},C$=e=>{const{translate:t}=cl(),{isEditMode:n}=HC(),{getShowPath:s}=JR();return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.name,property:Ie.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("nom_de_la_d_l_g_28087"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(h$,{isEditMode:n,title:e.delegation.name,updatable:!0,children:(0,i.jsx)(Vc,{to:s(e.delegation.id),children:e.delegation.name})})})},y$=e=>{const t=Hn();return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:e.value,property:e.property,reload:e.reload,renderInput:(n,s)=>(0,i.jsxs)(Au,{label:e.label,shouldParseAsBoolean:!0,value:n,onChange:s,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")})},k$=e=>{const{translate:t}=cl(),{getTags:n}=JR(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("tags_79499")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},A$=e=>{const t=(0,M.useMemo)(()=>e.delegation.tags||[],[e.delegation]),n=(0,M.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(c$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:Ie.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(k$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ly,{badges:n})})},w$=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{mutate:o}=wo(),r=(0,M.useCallback)((t,n)=>o({organizationId:e.organizationId,eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:Qe.Replace,value:t}}),[e.row,o]),a=(0,M.useMemo)(()=>ng({organizationId:n,eventId:s,delegationId:e.row.id,formId:e.row.form.id}),[e.row]),l=(0,M.useMemo)(()=>tg(n,as.DELEGATION({organizationId:n,eventId:s,delegationId:e.row.id})),[e.row]);return e.column.slug===HR.Id?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===HR.Name?(0,i.jsx)(C$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===HR.DelegationCategory?(0,i.jsx)(g$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===HR.State?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Jd,{...hj(e.row.state),children:t(e.row.state)})}):e.column.slug===HR.Leaders?(0,i.jsx)(b$,{column:e.column,delegation:e.row}):e.column.slug===HR.Form?(0,i.jsx)(I$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===HR.FormLink?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Vc,{to:a,children:a})}):e.column.slug===HR.DelegationSpaceLink?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Vc,{to:l,children:l})}):e.column.slug===HR.DeadlineDate?(0,i.jsx)(p$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===HR.MaxResources?(0,i.jsx)(j$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===HR.AssignedResources?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(o$,{assignedResources:e.row.numberOfResources,resources:e.row.maxResources})}):e.column.slug===HR.Tags?(0,i.jsx)(A$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===HR.FillingRate?(0,i.jsxs)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===HR.CreatedBy?(0,i.jsx)(sR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===HR.ShowInDelegation?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("ShowInDelegationSpace"),property:Ie.ShowInDelegationSpace,reload:e.reloadRow,value:e.row.showInDelegationSpace}):e.column.slug===HR.CanLeadersAddMembers?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("CanLeadersAddMembers"),property:Ie.CanLeadersAddMembers,reload:e.reloadRow,value:e.row.canLeadersAddMembers}):e.column.slug===HR.CanLeadersDeleteMembers?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("CanLeadersDeleteMembers"),property:Ie.CanLeadersDeleteMembers,reload:e.reloadRow,value:e.row.canLeadersDeleteMembers}):e.column.slug===HR.CanLeadersEditColumns?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("CanLeadersEditColumns"),property:Ie.CanLeadersEditColumns,reload:e.reloadRow,value:e.row.canLeadersEditColumns}):e.column.slug===HR.CanLeadersEditMembers?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("CanLeadersEditMembers"),property:Ie.CanLeadersEditMembers,reload:e.reloadRow,value:e.row.canLeadersEditMembers}):e.column.slug===HR.CanLeadersEditCustomFields?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("CanLeadersEditCustomFields"),property:Ie.CanLeadersEditCustomFields,reload:e.reloadRow,value:e.row.canLeadersEditCustomFields}):e.column.slug===HR.CanLeadersImportMembers?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("CanLeadersImportMembers"),property:Ie.CanLeadersImportMembers,reload:e.reloadRow,value:e.row.canLeadersImportMembers}):e.column.slug===HR.CanLeadersSeeHiddenAccreditationsSlots?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("CanLeadersSeeHiddenAccreditationsSlots"),property:Ie.CanLeadersSeeHiddenAccreditationsSlots,reload:e.reloadRow,value:e.row.canLeadersSeeHiddenAccreditationsSlots}):e.column.slug===HR.ShowFormLinkInDelegationSpace?(0,i.jsx)(y$,{column:e.column,delegation:e.row,label:t("afficher_le_lie_05841"),property:Ie.ShowFormLinkInDelegationSpace,reload:e.reloadRow,value:e.row.showFormLinkInDelegationSpace}):e.column.slug===HR.IsLocked?(0,i.jsx)(v$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===HR.CreatedAt?(0,i.jsx)(iR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===HR.Campaigns?(0,i.jsx)(u$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===HR.Documents?(0,i.jsx)(x$,{column:e.column,delegation:e.row,reload:e.reloadRow}):"events"===e.column.slug?(0,i.jsx)(r$,{column:e.column,delegation:e.row}):e.column.slug===HR.UsedCustomFieldsFilled?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.usedCustomFieldsFilled?.toString()||"-")}):(0,i.jsx)(my,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:r,reload:e.reloadRow,updatable:!0})},S$=e=>{const{history:t,translate:n}=cl(),{getEditPath:s}=JR(),{mutate:o}=Zr(),[r,a]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",to:s(e.delegation.id),children:n("_diter_62574")}),(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>{const{delegationDuplicate:n}=await o({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegation.id});t.push(s(n.id))},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:async()=>{a(!0)},children:n("supprimer_43083")})]}),r&&(0,i.jsx)(kw,{delegation:e.delegation,onClose:()=>{a(!1)},onSuccess:e.reload})]})},E$=({columns:e,customFields:t,delegation:n,eventId:s,organizationId:o,state:r,reload:a,reloadDelegation:l,toggleRow:d})=>{const{canDelegationEdit:c}=lS(),{getEditPath:u}=JR(),h=UC(t),m=(0,M.useCallback)(()=>{l(n.id)},[n,l]);return(0,i.jsxs)(Tc,{css:{background:"checked"===r?"$primary100":"white","&:hover":{background:"checked"===r?"$primary100":"$gray100"}},onMouseLeave:e=>{$d(e.target)},children:[c&&(0,i.jsx)(yc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:r,onClick:(e,t)=>{Al(t),d(`d${n.id}`,e)}})}),e.map(e=>{const t=h.get(e.slug);return(0,i.jsx)(w$,{column:e,customField:t,eventId:s,organizationId:o,reloadRow:m,row:n},e.slug)}),c&&(0,i.jsxs)(Uc,{justify:"center",children:[(0,i.jsx)(fm,{children:(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",to:u(n.id)})})})}),(0,i.jsx)(S$,{delegation:n,eventId:s,organizationId:o,reload:a})]})]})},T$=e=>{const{canDelegationEdit:t}=lS(),{columns:n,columnsSearch:s,limit:o,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,rendering:h,setLimit:g,setOffset:p,setSort:f,sort:x}=HC(),_=(0,M.useMemo)(()=>qR(n,h),[n,h]),{data:I,isLoading:v,reload:b}=Xr({..._,organizationId:e.organizationId,level:e.level,eventId:e.eventId,name:m(a)?a:null,columnsSearch:eo(s)?s:null,predicates:c,limit:o,offset:l,sort:x}),j=(0,M.useMemo)(()=>n.flatMap(e=>(0,Va.A)([d.find(t=>t.slug===e)])),[d,n]),{numberOfPages:C,totalCount:y}=vu(I.data?.rows),[k,A]=(0,M.useState)([]),[w,S]=(0,M.useState)({}),E=(0,M.useCallback)(async t=>{S(e=>({...e,[t]:!0}));const{data:{row:n}}=await(i={..._,organizationId:e.organizationId,id:t},s=await q(),co("query DelegationsDelegation(\n $organizationId: OrganizationId!\n $id: DelegationId!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDocuments: Boolean!\n $includeLeaders: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $includeUsedCustomFieldsFilled: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: delegation(id: $id) {\n ...DelegationsDelegation\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Ms.DelegationsDelegationFragment]}));var i,s;A(e=>e.map(e=>e.id===t?n:e)),S(e=>({...e,[t]:!1}))},[_,S,A]);return(0,M.useEffect)(()=>{A(I.data?.rows.nodes??[])},[I.data]),(0,M.useEffect)(()=>{u>1&&b()},[u]),(0,M.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)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":v,headerRow:(0,i.jsxs)(xc,{children:[t&&(0,i.jsx)(Fc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:r.selectAllState,onClick:r.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:f,sort:x,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:o,numberOfPages:C,offset:l,setLimit:g,setOffset:p,showLimits:!0,totalCount:y})}),children:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):k.map(t=>w[t.id]?(0,i.jsx)(Mc,{},t.id):(0,i.jsx)(E$,{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))})})},z$=()=>{const{history:e,translate:t,params:{organizationId:n}}=cl();return(0,i.jsx)(RR,{children:(0,i.jsx)(Ib,{permissions:xb.DELEGATION_EDIT,children:(0,i.jsx)(jl,{onClick:()=>{e.push(Os.COMMUNITY_CREATE_DELEGATION(n))},children:t("cr_er_une_d_l_g_23035")})})})},O$=e=>{const{translate:t,params:{organizationId:n}}=cl(),{canDelegationEdit:s,canSegmentEdit:o}=dS(),{limit:r,segment:a}=HC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(z$,{}),0===e.numberOfDelegations?(0,i.jsx)(Ob,{css:{overflow:"hidden"},children:(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(xk,{title:t("vous_n_avez_pas_32103")})})}):(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{actions:(0,i.jsx)(s$,{}),searchPlaceholder:t("rechercher_une_31213"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:o}),selectSegment:(0,i.jsx)(QR,{pageSelectedText:t("les_1_d_l_gat_27248",r),segmentSelectedText:t("les_1_d_l_gat_04594",a.count,a.name)})}),(0,i.jsx)(T$,{customFields:e.customFields,eventId:null,level:tt.Organization,organizationId:n})]})]})},R$=e=>{const{history:t,params:{organizationId:n,segmentId:s},translate:o}=cl();Td(`${o("communaut_20896")} ${o("d_l_gations_78318")}`);const{localOrganization:r,updateLocalOrganization:a}=_I(),{canSegmentEdit:l}=dS(),d=Gn(YR),c=(0,M.useMemo)(()=>d.getDelegationsFilters(n,null,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.organization,n]),u=(0,M.useMemo)(()=>d.getDelegationsPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(XR,{eventId:null,getEditPath:e=>hi(as.DELEGATION({organizationId:n,delegationId:e})),getShowPath:e=>as.DELEGATION({organizationId:n,delegationId:e}),organizationId:n,children:(0,i.jsx)(wR,{canEditSegments:l,filters:c,filtersButtonText:o("filtrer_les_d_l_04628"),filtersSubtitle:o("appliquer_des_f_65318"),getSegmentPath:e=>Os.COMMUNITY_DELEGATIONS_SEGMENT(n,e),hideSegments:0===e.organization.numberOfDelegations,initialLimit:r?.delegationsLimit??kc,initialSegmentsOpen:r?.areDelegationsSegmentsOpen??!0,organizationId:n,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:_t.Delegations,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({delegationsLimit:e})},onSegmentClick:e=>{a({delegationsSegmentId:e})},onSegmentDelete:async()=>{await a({delegationsSegmentId:null}),t.replace(Os.COMMUNITY_DELEGATIONS(n))},onSegmentsToggle:async e=>{await a({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(O$,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.organization.numberOfDelegations})})})},$$=()=>{const{history:e,params:{organizationId:t}}=cl(),{localOrganization:n}=_I(),{data:s,loader:o,reload:r}=Yn("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},[Ms.SegmentCustomFieldFragment,Ms.SegmentsFoldersSegmentsFragment]),a=(0,M.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_DELEGATIONS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(R$,{organization:s.organization,reload:r})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{onLoad:()=>{const i=n?.delegationsSegmentId&&a.includes(n.delegationsSegmentId)?n?.delegationsSegmentId:a[0];e.replace(Os.COMMUNITY_DELEGATIONS_SEGMENT(t,i))}})})]})},D$=()=>{const{hasFeature:e}=_I();return e(Fe.Delegation)?(0,i.jsx)($$,{}):(0,i.jsx)(Ra,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(II,{icon:"people-group"})})},P$=e=>{const t=Hn(),{isLoading:n,copy:s}=_S();return(0,i.jsxs)(br,{children:[(0,i.jsx)(br,{color:"gray700",css:e.css,children:e.title}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsx)(Ol,{css:{"& .h-styled-input-container":{background:"white"}},hint:e.hint,state:"disabled",value:e.link,onChange:Hl.A}),(0,i.jsx)(jl,{color:e.buttonColor,isLoading:n,leftIcon:"copy",onClick:()=>s(e.link),children:t("copier_75889")})]})]})},F$=hr("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"}}),M$=({isOpen:e,onClose:t,link:n})=>{const s=Hn(),o=qn();return(0,i.jsx)(ub,{isOpen:e,onClose:t,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"plug-circle-bolt",subtitle:s("exporter_votre_81734"),onClose:t,children:s("export_de_votre_02014")}),(0,i.jsx)(lb,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(br,{css:{marginBottom:"$5"},children:(0,i.jsx)(Qa.Root,{color:"warning",children:(0,i.jsxs)(Qa.Titled,{children:[(0,i.jsx)(Qa.Title,{icon:"circle-info",children:s("limites_des_exp_03687")}),(0,i.jsx)(Qa.Text,{children:(0,i.jsxs)(F$,{children:[(0,i.jsx)("dt",{children:s("limite_du_nombr_21498")}),(0,i.jsx)("dd",{children:[...o(s("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:s("dans_google_she_53260")}),(0,i.jsx)("dd",{children:[...o(s("la_limite_de_1_47408",10,15,"{3}"),(0,i.jsx)("code",{children:"#N/A"}))]}),(0,i.jsx)("dd",{children:[...o(s("_1_appelle_le_11127"),(0,i.jsx)("code",{children:"IMPORTDATA"}))]}),(0,i.jsx)("dd",{children:[...o(s("_1_ne_fonction_68410"),(0,i.jsx)("code",{children:"IMPORTDATA"}),(0,i.jsx)("code",{children:"#N/A"}))]}),(0,i.jsx)("dd",{children:[...o(s("si_l_export_est_28345"),(0,i.jsx)("code",{children:"#N/A"}))]})]})})]})})}),(0,i.jsx)(P$,{buttonColor:"primary",css:{fontWeight:500},link:n,title:s("lien_d_api_pour_98778")}),(0,i.jsx)(P$,{buttonColor:"primary",css:{fontWeight:500},link:`=IMPORTDATA("${n}")`,title:s("import_de_la_vu_17175")})]})})]})})},N$=e=>{const t=Hn(),[n,s]=(0,M.useState)(De.Excel),[o,r]=(0,M.useState)("unchecked");return(0,i.jsx)(ub,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"file-xls",subtitle:t("exporter_votre_28801"),children:t("exporter_vos_me_10045")}),(0,i.jsxs)(lb,{gap:"3",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("parameters_de_votre_export")}),(0,i.jsxs)(Ra,{direction:"column",gap:"5",children:[(0,i.jsxs)(Au,{label:t("format_de_lexport"),value:n,onChange:s,children:[(0,i.jsx)("option",{value:De.Excel,children:"Excel (.xslx)"}),(0,i.jsx)("option",{value:De.Csv,children:"CSV (.csv)"})]}),e.showIncludeFiles&&(0,i.jsx)(dc,{state:o,onClick:r,children:t("inclure_dans_l_65554")})]})]}),(0,i.jsx)(ab,{children:()=>(0,i.jsx)(jl,{onClick:()=>{e.requestExport(n,"checked"===o),e.onClose()},children:t("recevoir_l_expo_53392")})})]})})},L$=({organizationKey:e})=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=cl(),{user:r}=ni(),{segment:a,columns:l}=HC(),{mutate:d}=function(e={}){return Kn("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,M.useState)(!1),[h,m]=(0,M.useState)(!1),{checkExport:g}=ib();return(0,i.jsxs)(RR,{children:[(0,i.jsx)(Ib,{permissions:xb.MEMBER_CREATE,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{children:n("ajouter_un_memb_33261")})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"user-plus",onClick:()=>{t.push(BI.CREATE({organizationId:s}))},children:n("ajouter_un_nouv_29283")}),(0,i.jsx)(Ld,{icon:"file-import",onClick:()=>{t.push(Os.COMMUNITY_VOLUNTEERS_IMPORT(s))},children:n("importer_via_un_61623")})]})]})}),(0,i.jsx)(Ib,{rolesTypes:dI,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"merge",onClick:()=>{t.push(Os.COMMUNITY_USERS_DUPLICATES(s))},children:n("g_rer_les_doubl_39469")}),(0,i.jsx)(Ld,{icon:"plug-circle-bolt",onClick:e=>{$d(e.target),u(!0)},children:n("exporter_via_l_09843")}),(0,i.jsx)(Ld,{icon:"file-xls",onClick:e=>{$d(e.target),m(!0)},children:n("exporter_en_exc_51862")}),(0,i.jsx)(Ld,{icon:"file-import",onClick:()=>{t.push(Os.COMMUNITY_FILES_IMPORT(s))},children:n("importer_des_do_55420")})]})]})}),(0,i.jsx)(M$,{isOpen:c,link:og({organizationId:s,eventId:void 0,lang:r?.language,pathComponent:`members/${o}`,key:e}),onClose:()=>{u(!1)}}),(0,i.jsx)(N$,{isOpen:h,requestExport:async(e,t)=>{const{jobId:n}=await d({organizationId:s,segmentId:a.id,format:e,includeFiles:t,columns:l});g(s,void 0,n)},showIncludeFiles:!0,onClose:()=>{m(!1)}})]})},B$=e=>{const{translate:t,params:{organizationId:n}}=cl(),{isOrganizationAdmin:s}=_I(),{canMemberEdit:o}=dS(),r=(0,M.useMemo)(()=>new Map(e.customFields.map(e=>[e.slug,e])),[e.customFields]),a=(0,M.useCallback)(()=>{e.reloadUserInfo(e.userInfo.id)},[e.userInfo,e.reloadUserInfo]);return(0,i.jsxs)(Tc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},children:[s&&(0,i.jsx)(yc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(lc,{state:e.state,onClick:(t,n)=>{Al(n),e.toggleRow(`ui${e.userInfo.id}`,t)}})}),e.columns.map(t=>{const n=r.get(t.slug);return(0,i.jsx)(AA,{canClickMemberName:!0,column:t,customField:n,reloadRow:a,row:e.userInfo,updatable:!0},t.slug)}),o&&(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",to:Os.COMMUNITY_EDIT_USER(n,e.userInfo.id)})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]})})]})},V$=e=>{const{organizationId:t}=Zn(),{isOrganizationAdmin:n}=_I(),{canMemberEdit:s}=dS(),{columns:o,columnsSearch:r,massActions:a,nameDebounced:l,limit:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:x,sort:_}=HC(),I=(0,M.useMemo)(()=>CA(o),[o]),{data:v,isLoading:b,reload:j}=(C={...I,organizationId:t,predicates:h,name:m(l)?l:null,columnsSearch:eo(r)?r:null,limit:d,offset:c,sort:_},Yn(fo,C,[Ms.UserInfoCommunityFragment]));var C;const{numberOfPages:y,totalCount:k}=vu(v.data?.rows);(0,M.useEffect)(()=>{g>1&&j()},[g]);const A=(0,M.useMemo)(()=>o.flatMap(e=>(0,Va.A)([u.find(t=>t.slug===e)])),[u,o]),[w,S]=(0,M.useState)([]),[E,T]=(0,M.useState)({}),z=(0,M.useCallback)(async e=>{T(t=>({...t,[e]:!0}));const{data:{row:n}}=await Lo({...I,organizationId:t,id:e},await q());S(t=>t.map(t=>t.id===e?n:t)),T(t=>({...t,[e]:!1}))},[I,T,S]);return(0,M.useEffect)(()=>{S(v.data?.rows.nodes??[])},[v.data]),(0,M.useEffect)(()=>{a.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(({id:e})=>[`ui${e}`,{id:e,state:"unchecked"}])))},[v.data,a.setStates]),(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":b,headerRow:(0,i.jsxs)(xc,{children:[n&&(0,i.jsx)(Fc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(lc,{state:a.selectAllState,onClick:a.toggleSelectAll})}),A.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:_,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),s&&(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:d,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):w.map(t=>E[t.id]?(0,i.jsx)(Mc,{},t.id):(0,i.jsx)(B$,{columns:A,customFields:e.customFields,reloadUserInfo:z,state:a.states[`ui${t.id}`]?.state??"unchecked",toggleRow:a.toggleRow,userInfo:t},t.id))})})},U$=e=>(0,i.jsx)(br,{css:{padding:"$2 $3"},font:"gray500 textXs semiBold",children:e.children}),W$=e=>{const t=Hn(),{mutate:n,isLoading:s}=Ko(),{mutate:o,isLoading:r}=ya(),[a,l]=(0,M.useState)([]),[d,c]=(0,M.useState)([]);return(0,M.useEffect)(()=>{(async()=>{if(e.eventId){const t=await Jo({eventId:e.eventId},await q());l(t.event.delegations.nodes)}else{const i=await(t={organizationId:e.organizationId},n=await q(),co("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)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_60880")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(fc,{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)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:s||r,onClick:async()=>{if(eo(d)){let i=0;const s=a.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,delegationId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,delegationId:d[0]})).numberOfMembers,e.onSuccess(t("_1_membres_ont_51715",i,s.name)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},G$=e=>{const t=Hn(),{mutate:n,isLoading:s}=function(e={}){return Kn("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:o,isLoading:r}=function(e={}){return Kn("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}=na({organizationId:e.organizationId,level:e.eventId?tt.Event:tt.Organization,eventId:e.eventId}),l=(0,M.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,M.useState)([]),u=eo(d);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_81812")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(fc,{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)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{disabled:!u,isLoading:s||r,onClick:async()=>{if(eo(d)){let i=0;const s=l.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers,e.onSuccess(t("le_formulaire_11679",s.name,i)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},H$=e=>{const t=Hn(),{mutate:n,isLoading:s}=function(e={}){return Kn("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:o,isLoading:r}=function(e={}){return Kn("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}=na({organizationId:e.organizationId,level:e.eventId?tt.Event:tt.Organization,eventId:e.eventId}),l=(0,M.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,M.useState)([]),u=eo(d);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"file-lines"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",children:t("marquer_un_form_10633")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(fc,{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)(Ba,{height:"4"}),(0,i.jsx)(Ja,{color:"error",leftIcon:"triangle-exclamation",children:e.eventId?t("cette_action_su_82938"):t("cette_action_su_88097")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{color:"error",disabled:!u,isLoading:s||r,onClick:async()=>{if(eo(d)){let i=0;const s=l.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers,e.onSuccess(t("le_formulaire_87510",s.name,i)),e.onClose()}},children:t("marquer_comme_n_20227")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let q$=class extends Pl{constructor(e){super(e)}massAddEventInputSchema(){return d.Ik().shape({massAddEvent:d.Ik().shape({eventId:d.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})})}massAddEventSchema(){return d.Ik().shape({eventId:d.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})}};q$=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],q$);const Y$=e=>{const t=Hn(),n=Gn(q$),{mutate:s}=function(e={}){return Kn("mutation UsersInfosMassAddEvent(\n $organizationId: OrganizationId!\n $massAddEvent: MassAddEventInput!\n) {\n numberOfMembers: usersInfosMassAddEvent(\n organizationId: $organizationId\n massAddEvent: $massAddEvent\n )\n}\n",e)}(),{data:o,isLoading:r}=Qr({organizationId:e.organizationId}),[a,l]=(0,M.useState)(""),d=(0,M.useMemo)(()=>m(a)?(o.organization?.events.nodes??[]).filter(e=>e.name.trim().toLowerCase().includes(a.trim().toLowerCase())):o.organization?.events.nodes??[],[o.organization,a]);return(0,i.jsxs)(Tj,{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),o=(await s({organizationId:e.organizationId,massAddEvent:n.massAddEvent})).numberOfMembers;e.onSuccess(t("_1_membres_ont_83814",o,i.name)),e.onClose()},children:[(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_40024"),value:a,onChange:l}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",children:t("sur_quel_v_nem_31606")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{css:{overflowY:"auto"},direction:"column",gap:"3",children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$2",height:54}),(0,i.jsx)(ec,{borderRadius:"$2",height:54})]}):d.map(e=>(0,i.jsx)(_R,{label:e.name,name:"massAddEvent.eventId",value:e.id},e.id))})]})},K$=e=>{const t=Hn(),{data:n,loader:s}=Yn("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:o}=Hr(),[r,a]=(0,M.useState)(null);return(0,i.jsxs)(Tj,{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 o({organizationId:e.organizationId,mainUserInfoId:r,toMergeUsersInfosIds:e.usersInfosIds.filter(e=>e!==r)}),e.onSuccess(t("_1_membres_ont_74574",e.usersInfosIds.length)),e.onClose())},children:[(0,i.jsx)(Ja,{color:"gray",leftIcon:"circle-exclamation",children:t("toutes_les_info_39932",e.numbersOfSelected)}),"number"==typeof n.organization?.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Ja,{color:"warning",leftIcon:"circle-exclamation",children:t("if_you_merge_me_62641")})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray700 textSm medium",children:t("quel_membre_sou_80665")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:s||n.organization.usersInfos.nodes.map((e,n)=>{const s=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)(M.Fragment,{children:[0!==n&&(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{a(e.id)},children:[(0,i.jsx)(uc,{shouldPreventDefault:!1,state:r===e.id?"checked":"unchecked",onClick:Hl.A}),(0,i.jsx)(qg,{email:e.email,image:e.picture?.url,name:e.name,size:48}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:m(e.name)?e.name:"-"}),(0,i.jsx)(br,{color:"gray500",children:e.email}),(0,i.jsx)(Ra,{gap:"2",children:s.map(e=>(0,i.jsxs)(M.Fragment,{children:[e.numberOfAccreditations>0&&(0,i.jsx)(Jd,{css:{height:"fit-content"},leftIcon:"badge-check",children:t("_1_2_accred_26410",e.eventName,e.numberOfAccreditations)}),e.numberOfAssignments>0&&(0,i.jsx)(Jd,{css:{height:"fit-content"},leftIcon:"location-dot",children:t("_1_2_assign_03225",e.eventName,e.numberOfAssignments)})]},e.eventId))})]})]})]},e.id)})})]})},Z$=e=>{const{translate:t,params:{organizationId:n}}=cl(),{showNotification:s}=ib(),{mutate:o}=zo(),{mutate:r}=function(e={}){return Kn("mutation UsersInfosMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassDelete(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{hasFeature:a}=_I(),{data:l}=Yn("query UsersActions($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hasDelegations\n hasEvents\n hasForms\n }\n}\n",{organizationId:n},[]),[d,c]=(0,M.useState)(!1),[u,h]=(0,M.useState)(!1),[g,p]=(0,M.useState)(!1),[f,x]=(0,M.useState)(!1),[_,I]=(0,M.useState)(!1),[v,b]=(0,M.useState)(!1),[j,C]=(0,M.useState)(!1),[y,k]=(0,M.useState)(!1),A=e.massActions.getSelectedsInput(e.predicates,null),w=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,S=(0,M.useCallback)(t=>{m(t)&&s(t),e.onMassEditSuccess()},[e.onMassEditSuccess]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{onClick:()=>{c(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(U$,{children:t("gestion_des_mem_51660")}),(0,i.jsx)(Ld,{icon:"plus",isDisabled:!l.organization?.hasEvents,onClick:()=>{h(!0)},children:t("ajouter_1_membr_25541",w)}),(0,i.jsx)(Ld,{icon:"merge",onClick:()=>{p(!0)},children:t("fusionner_les_m_37150")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(U$,{children:t("accr_ditations_39450")}),a(Fe.Delegation)&&(0,i.jsx)(Ld,{icon:"people-group",isDisabled:!l.organization?.hasDelegations,onClick:()=>{I(!0)},children:l.organization?.hasDelegations?t("ajouter_1_mem_86218",w):t("cette_organisat_48937")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(U$,{children:t("communication_05277")}),(0,i.jsx)(Ld,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>{b(!0)},children:t("ajouter_1_mem_52947",w)}),(0,i.jsx)(Ld,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>{C(!0)},children:t("marquer_un_form_10633")}),(0,i.jsx)(Ld,{icon:"paper-plane",onClick:()=>{k(!0)},children:t("SendCampaign")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{x(!0)},children:t("supprimer_43083")})]})]}),d&&(0,i.jsx)(Hk,{mutate:e=>o({organizationId:n,massEdit:e}),organizationId:n,selecteds:A,onClose:()=>{c(!1)},onSuccess:e=>{S(t("_1_membres_ont_07596",e))}}),u&&(0,i.jsx)(Y$,{numberOfSelected:w,organizationId:n,selecteds:A,onClose:()=>{h(!1)},onSuccess:S}),g&&(0,i.jsx)(K$,{numbersOfSelected:w,organizationId:n,usersInfosIds:e.massActions.selectedsIds,onClose:()=>{p(!1)},onSuccess:S}),f&&(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_65177"),t("cette_action_es_45424")],text:t("suppression_de_57689",w),onClose:()=>{x(!1)},onDelete:async()=>{const e=(await r({organizationId:n,selecteds:A})).numberOfMembers;S(t("_1_membres_ont_13170",e))}}),v&&(0,i.jsx)(G$,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{b(!1)},onSuccess:S}),j&&(0,i.jsx)(H$,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{C(!1)},onSuccess:S}),_&&(0,i.jsx)(W$,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{I(!1)},onSuccess:S}),y&&(0,i.jsx)(hA,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{k(!1)},onSuccess:S})]})},X$=({customFields:e,organizationKey:t})=>{const n=Hn(),{isOrganizationAdmin:s}=_I(),{limit:o,massActions:r,onMassEditSuccess:a,predicates:l,reloadKey:d,segment:c,setReloadKey:u}=HC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(L$,{organizationKey:t,reload:()=>{u(d+1)}}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{actions:(0,i.jsx)(Z$,{massActions:r,predicates:l,showOnlyMassEdit:!1,totalNumberOfMembers:c.count,onMassEditSuccess:a}),searchPlaceholder:n("rechercher_un_m_05904"),showActions:s,showEditColumns:s,showEditMode:s,showSearchColumns:s}),selectSegment:(0,i.jsx)(QR,{pageSelectedText:n("les_1_membres_00895",o),segmentSelectedText:n("les_1_membres_56748",c.count,c.name)})}),(0,i.jsx)(V$,{customFields:e})]})]})},J$=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=cl(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=_I(),d=Gn(yA),c=(0,M.useMemo)(()=>d.getOrganizationUsersFilters(s,o,e.organization),[e.organization]),u=(0,M.useMemo)(()=>d.getOrganizationUsersPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(wR,{canEditSegments:r,filters:c,filtersButtonText:n("filtrer_les_mem_49255"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>Os.COMMUNITY_USERS_SEGMENT(s,e),initialLimit:a?.usersLimit??kc,initialSegmentsOpen:a?.areUsersSegmentsOpen??!0,organizationId:s,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:_t.Volunteers,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({usersLimit:e})},onSegmentClick:e=>{l({usersSegmentId:e})},onSegmentDelete:async()=>{await l({usersSegmentId:null}),t.replace(ji.COMMUNITY_USERS({organizationId:s}))},onSegmentsToggle:async e=>{await l({areUsersSegmentsOpen:e})},children:(0,i.jsx)(X$,{customFields:e.organization.customFields.nodes,organizationKey:e.organization.key})})},Q$=()=>{const{params:{organizationId:e},translate:t}=cl();Td(`${t("communaut_20896")} ${t("membres_11310")}`);const{localOrganization:n}=_I(),{data:s,loader:o,reload:r}=Yn("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:pe.All},[Ms.SegmentCustomFieldFragment,Ms.SegmentsFoldersSegmentsFragment]);const a=(0,M.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_USERS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(J$,{organization:s.organization,reload:r})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.COMMUNITY_USERS_SEGMENT(e,n?.usersSegmentId&&a.includes(n.usersSegmentId)?n?.usersSegmentId:a[0]),replace:!0})})]})},eD=e=>{const{translate:t,params:{organizationId:n}}=cl(),s=Gn(Mj),{mutate:o,isLoading:r}=Hr(),a=(0,M.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)(Oc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(jl,{color:"primary",isLoading:r,size:"sm",onClick:async()=>{await o({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)(Fc,{children:t("nom_du_membre_69353")}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(Fc,{children:t("d_l_gations_78318")},e):n?(0,i.jsx)(Fc,{children:n.name},e):null}),(0,i.jsx)(Fc,{children:t("membre_principa_09597")})]}),numberOfPages:0,offset:0,rows:e.usersInfos.map(t=>(0,i.jsxs)(Tc,{css:{cursor:"pointer"},onClick:()=>{e.onSelect(t.id)},children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Ub,{userInfo:t})}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(yc,{gap:"2",wrap:"wrap",children:t.delegations.map(e=>{const t=e.event?`${e.event.name}`:e.name;return(0,i.jsx)(Jd,{children:t},e.id)})},e):n?(0,i.jsx)(yc,{children:s.getValueString(n,t.fields,{fileReturnValue:"name"})},e):null}),(0,i.jsx)(yc,{children:(0,i.jsx)(uc,{shouldPreventDefault:!1,state:e.selectedId===t.id?"checked":"unchecked",onClick:Hl.A})})]},t.id)),setOffset:Hl.A,title:e.usersInfos[0].name,totalCount:0})},tD=e=>{const{translate:t,params:{organizationId:n}}=cl(),{localOrganization:s,updateLocalOrganization:o}=_I(),r=e.organization.customFields.nodes,[a,l]=(0,M.useState)(e.organization.possibleDuplicates),[d,c]=(0,M.useState)(Object.fromEntries(a.map(({id:e,usersInfos:t})=>[e,t[0].id]))),[u,h]=(0,M.useState)(!1),g=a.length??0,[p,f]=(0,M.useState)(s?.duplicatesColumns||[]),x=(0,M.useMemo)(()=>(0,ic.A)(r.map(e=>({name:e.name,slug:e.slug})).concat([{name:t("d_l_gations_78318"),slug:"delegations"}]),e=>e.name),[r]),_=(0,M.useCallback)(async e=>{f(e),await o({duplicatesColumns:e})},[f]),[I,v]=(0,M.useState)(""),b=(0,M.useMemo)(()=>m(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)(zm,{fallbackClosePath:ji.COMMUNITY_USERS({organizationId:n}),title:t("gestion_des_mem_14016"),children:(0,i.jsxs)(Em,{children:[(0,i.jsx)(Ra,{align:"center",justify:"between",children:(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("liste_des_membr_20115")}),g>0&&(0,i.jsx)(Jd,{color:"warning",size:"sm",children:t("_1_doublon_pot_74382",g)})]}),(0,i.jsx)(br,{color:"gray500",children:t("s_lectionner_le_91896")})]})}),(0,i.jsx)(Ba,{height:"6"}),0===g?(0,i.jsxs)(vc,{children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:t("nom_du_membre_69353")}),(0,i.jsx)(Fc,{children:t("membre_principa_09597")})]}),(0,i.jsx)(Tc,{css:{height:"400px"},children:(0,i.jsx)(yc,{css:{height:"100%"},children:(0,i.jsx)(xk,{subtitle:"",title:t("il_n_y_a_pas_de_78722")})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",justify:"between",children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{placeholder:t("rechercher_un_m_05904"),value:I,onChange:v})}),(0,i.jsx)(jl,{color:"white",leftIcon:"gear",onClick:()=>{h(!0)},children:t("_diter_les_colo_39630")})]}),(0,i.jsx)(Ba,{height:"6"}),b.map(({id:e,usersInfos:t})=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(eD,{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)(Ba,{height:"4"})]},e))]})]})}),u&&(0,i.jsx)(_u,{columns:x,initialSelectedColumns:p,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>{h(!1)},onSave:_})]})},nD=()=>{const{params:{organizationId:e}}=cl(),{data:t,loader:n}=Yn("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},[Ms.CustomFieldWithConditionFragment]);return n||(0,i.jsx)(tD,{organization:t.organization})},iD=()=>{const{translate:e,params:{organizationId:t}}=cl();Td(e("communaut_20896"));const{hasFeature:n}=_I(),{canDelegationEdit:s,canDelegationRead:o,canFormRead:r,canWorkflowEdit:a,canWorkflowRead:l}=dS();return n(Fe.Community)?(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:ji.COMMUNITY_DASHBOARD({organizationId:":organizationId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(GR,{})})}),(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_USERS_DUPLICATES(":organizationId"),children:(0,i.jsx)(nD,{})}),(0,i.jsx)(Cr.qh,{path:[BI.CREATE({organizationId:":organizationId",delegationId:":delegationId"}),BI.CREATE({organizationId:":organizationId"})],children:(0,i.jsx)(zT,{})}),(0,i.jsx)(Cr.qh,{path:ji.COMMUNITY_USERS({organizationId:":organizationId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(Q$,{})})}),(0,i.jsx)(Cr.qh,{path:[Os.COMMUNITY_EDIT_USER(":organizationId",":userInfoId"),Os.COMMUNITY_EDIT_USER_DELEGATION(":organizationId",":delegationId",":userInfoId")],children:(0,i.jsx)(BE,{children:(0,i.jsx)(nO,{})})}),(0,i.jsx)(Cr.qh,{exact:!0,path:jI.CREATE_TEMPLATE({organizationId:":organizationId"}),children:(0,i.jsx)(Eb,{isTemplate:!0})}),(0,i.jsx)(Cr.qh,{exact:!0,path:jI.CREATE({organizationId:":organizationId",options:":options?"}),children:(0,i.jsx)(Eb,{isTemplate:!1})}),(0,i.jsx)(Cr.qh,{path:jI.UPDATE({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(zb,{})}),(0,i.jsx)(Cr.qh,{path:jI.CAMPAIGNS({organizationId:":organizationId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(VR,{})})}),(0,i.jsx)(Cr.qh,{path:jI.CAMPAIGN({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(uj,{})})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(fS,{isCreateOpen:!0})})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORMS({organizationId:":organizationId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(fS,{isCreateOpen:!1})})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_ELEMENTS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(WS,{})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(hE,{})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(lE,{})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(nE,{})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_STATE({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(pE,{})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_INTEGRATION({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(CS,{})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_EMAILS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(YS,{})}),r&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PREVIEW({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(yS,{})}),(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_VOLUNTEERS_IMPORT(":organizationId"),children:(0,i.jsx)(TO,{})}),(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_FILES_IMPORT(":organizationId"),children:(0,i.jsx)(oS,{})}),(0,i.jsx)(Cr.qh,{path:BI.MEMBER({organizationId:":organizationId",userInfoId:":userInfoId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(Vz,{})})}),s&&(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_CREATE_DELEGATION(":organizationId",":options?"),children:(0,i.jsx)(NC,{})}),s&&(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_EDIT_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(BC,{})}),o&&(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_DELEGATIONS(":organizationId"),children:(0,i.jsx)(WR,{children:(0,i.jsx)(D$,{})})}),o&&(0,i.jsx)(Cr.qh,{path:as.DELEGATION_CATEGORY({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(Zw,{isEvent:!1})})}),o&&(0,i.jsx)(Cr.qh,{path:Os.COMMUNITY_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(WR,{children:(0,i.jsx)(Pw,{})})}),a&&(0,i.jsx)(Cr.qh,{path:WI.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(ZO,{})}),l&&(0,i.jsx)(Cr.qh,{path:WI.UPDATE({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(XO,{})}),l&&(0,i.jsx)(Cr.qh,{path:WI.WORKFLOWS({organizationId:":organizationId"}),children:(0,i.jsx)(WR,{children:(0,i.jsx)(cR,{})})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:ji.COMMUNITY_USERS({organizationId:t}),replace:!0})})]}):(0,i.jsx)(WR,{children:(0,i.jsx)(Ra,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(II,{icon:"crown",subtitle:e("contactez_nous_69860"),title:e("pour_en_profite_62789")})})})};let sD=class extends du{constructor(e,t,n){super(e,t,n)}getCustomFieldsFilters(e,t){return[{slug:"name",name:this.t("nom_du_champ_48329"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Text,hideEmpty:!0},{slug:"label",name:this.t("label_08243"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Text},{slug:"customFieldCategory",name:this.t("cat_gorie_00291"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Select,values:t.customFieldsCategories.nodes,hideEmpty:!0},{slug:"fieldType",name:this.t("type_35427"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Select,values:cn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"variety",name:this.t("typologie_34041"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Select,values:(0,ic.A)(en.map(e=>({id:e,name:Mk(this.t.bind(this),e)})),({name:e})=>e),hideEmpty:!0},{slug:"privacy",name:this.t("Privacy"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:"condition",name:this.t("condition_61066"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Select,values:t.customFields.nodes},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Checkbox,hideEmpty:!0},{slug:"createdBy",name:this.t("cr_e_par_30622"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"createdAt",name:this.t("cr_e_le_02658"),category:this.t("champs_de_formu_64126"),fieldType:Ve.Datetime,hideEmpty:!0}]}getCustomFieldsPossibleColumns(){return[{slug:"id",name:this.t("id_51738"),isSortable:!0,sortAttribute:xe.Id,width:100},{slug:"name",name:this.t("nom_du_champ_48329"),isSortable:!0,sortAttribute:xe.Name,minWidth:240},{slug:"label",name:this.t("label_08243"),isSortable:!0,sortAttribute:xe.Label,minWidth:180},{slug:"category",name:this.t("Category"),isSortable:!0,sortAttribute:xe.Category,minWidth:240},{slug:"variety",name:this.t("typologie_34041"),minWidth:180},{slug:"fieldType",name:this.t("type_35427"),isSortable:!0,sortAttribute:xe.Type,width:250},{slug:"numberOfTimesUsed",name:this.t("nombre_d_utilis_58389"),width:200},{slug:"state",name:this.t("Privacy"),isSortable:!0,sortAttribute:xe.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:xe.CreatedAt,minWidth:180}]}};sD=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],sD);const oD=()=>{const{translate:e}=cl(),{massActions:t,onMassEditSuccess:n,organizationId:s,predicates:o,segment:r}=HC(),{showNotification:a}=ib(),{mutate:l}=ko(),{mutate:d}=qr(),[c,u]=(0,M.useState)(!1),[h,g]=(0,M.useState)(!1),p=t.getSelectedsInput(o,null),f=t.isAllSelected?r.count:t.numberOfSelected,x=(0,M.useCallback)(e=>{m(e)&&a(e),n()},[n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{onClick:()=>{u(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Vd,{placement:"bottom-end",children:(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{g(!0)},children:e("supprimer_43083")})})]}),c&&(0,i.jsx)(Wk,{mutate:e=>l({organizationId:s,massEdit:e}),organizationId:s,selecteds:p,onClose:()=>{u(!1)},onSuccess:t=>{x(e("_1_champs_pers_55120",t))}}),h&&(0,i.jsx)(Pk,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_63402")],text:e("suppression_de_98457",f),onClose:()=>{g(!1)},onDelete:async()=>{const t=(await d({organizationId:s,selecteds:p})).numberOfCustomFields;x(e("_1_champs_pers_68086",t))}})]})},rD=()=>{const{history:e,translate:t,params:{organizationId:n}}=cl(),{segment:s}=HC();return(0,i.jsx)(RR,{children:(0,i.jsx)(Ib,{permissions:xb.CUSTOM_FIELD_EDIT,children:(0,i.jsx)(jl,{onClick:()=>{e.push(Os.CREATE_CUSTOM_FIELD(n,s.id))},children:t("cr_er_un_champ_31226")})})})},aD=M.createContext({}),lD=e=>{const t=KR(Ao,{organizationId:e.organizationId},e=>e.organization.customFieldsCategories.nodes);return(0,i.jsx)(aD.Provider,{value:{getCustomFieldsCategories:t},children:e.children})},dD=e=>{const{translate:t}=cl(),{getCustomFieldsCategories:n}=M.useContext(aD),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("Category")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Au,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},cD=e=>{const{params:{organizationId:t}}=cl(),{mutate:n}=ko();return(0,i.jsx)(ZC,{column:e.column,initialValue:e.initialValue,mutate:async i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.customFieldId]},slug:e.property,strategy:Qe.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},uD=e=>(0,i.jsx)(cD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.category.id,property:fe.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(dD,{setValue:t,value:e}),renderValue:e.customField.category.name}),hD=e=>{const{translate:t}=cl();return(0,i.jsx)(cD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.label||"",property:fe.Label,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{name:t("label_08243"),value:e,onChange:n}),renderValue:e.customField.label||""})},mD=e=>{const{translate:t}=cl();return(0,i.jsx)(cD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.name,property:fe.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{name:t("nom_du_champ_48329"),value:e,onChange:n}),renderValue:()=>(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(br,{color:"gray800",css:{ellipsis:!0,width:"100%"},title:e.customField.name,children:e.customField.name}),e.customField.conditionCustomField&&(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0,width:"100%"},title:e.customField.conditionCustomField.name,children:t("d_pend_de_1_52961",e.customField.conditionCustomField.name)})]})})},gD=e=>{const{translate:t}=cl();return(0,i.jsx)(cD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.isPrivate,property:fe.Privacy,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Au,{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)(Jd,{color:"gray",leftIcon:"lock",children:t("Private")}):(0,i.jsx)(Jd,{color:"primary",leftIcon:"globe",children:t("Public")})})},pD=e=>{const{history:t,translate:n}=cl();return"id"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"name"===e.column.slug?(0,i.jsx)(mD,{column:e.column,customField:e.row,reload:e.reloadRow}):"label"===e.column.slug?(0,i.jsx)(hD,{column:e.column,customField:e.row,reload:e.reloadRow}):"category"===e.column.slug?(0,i.jsx)(uD,{column:e.column,customField:e.row,reload:e.reloadRow}):"fieldType"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ra,{children:[(0,i.jsx)(br,{color:"gray800",css:{width:"18px"},children:(0,i.jsx)(Ya,{icon:pz(e.row.fieldType,e.row.fieldProperty)})}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsx)(br,{color:"gray800",children:n(e.row.fieldType)})]})}):"numberOfTimesUsed"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:0===e.row.numberOfTimesUsed?e.row.numberOfTimesUsed:(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(Os.CUSTOM_FIELD_USAGE(e.organizationId,e.segmentId,e.row.id))},children:e.row.numberOfTimesUsed})}):"state"===e.column.slug?(0,i.jsx)(gD,{column:e.column,customField:e.row,reload:e.reloadRow}):"values"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.values.map(({value:e})=>e).join(", ")}):"variable"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.variety===_e.UserInfo?`{user.${e.row.slug}}`:""}):"variety"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:Mk(n,e.row.variety)}):"isEncrypted"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.isEncrypted?n("oui_54361"):n("non_33516")}):"createdBy"===e.column.slug?(0,i.jsx)(sR,{column:e.column,createdBy:e.row.createdBy}):"createdAt"===e.column.slug?(0,i.jsx)(iR,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(yc,{})},fD=e=>{const{history:t,translate:n}=cl(),{showNotification:s}=ib(),[o,r]=(0,M.useState)(!1),{mutate:a}=function(e={}){return Kn("mutation CustomFieldDuplicate($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n customFieldDuplicate(organizationId: $organizationId, customFieldId: $customFieldId) {\n id\n }\n}\n",e)}(),{mutate:l}=qr(),[d,c]=(0,M.useState)(!1),u=e.customField.canDelete&&(e.customField.fieldType!==Le.Select||e.customField.isSelectV2);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{isOpen:o,onStateChange:r,children:[(0,i.jsx)(Nd,{onClick:n=>{$d(n.target),t.push(Os.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,e.customField.id))},children:(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(Ya,{icon:"pen"}),n("_diter_62574")]})}),u&&(0,i.jsx)(Nd,{onClick:async n=>{$d(n.target);const{customFieldDuplicate:{id:i}}=await a({organizationId:e.organizationId,customFieldId:e.customField.id});e.reload(),t.push(Os.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,i))},children:(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(Ya,{icon:"clone"}),n("dupliquer_28256")]})}),e.customField.canDelete&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Nd,{color:"red",onClick:()=>{r(!1),c(!0)},children:(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(Ya,{icon:"trash-can"}),n("supprimer_43083")]})})]})]}),d&&(0,i.jsx)(Pk,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_96670"),text:n("suppression_de_73669",e.customField.name),onClose:()=>{c(!1)},onDelete:async()=>{await l({organizationId:e.organizationId,selecteds:{ids:[e.customField.id]}}),s(n("le_champ_1_43589",e.customField.name)),e.reload()}})]})},xD=e=>{const{history:t,translate:n}=cl(),{canCustomFieldEdit:s}=dS(),o=(0,M.useCallback)(()=>{e.reloadCustomField(e.customField.id)},[e.customField,e.reloadCustomField]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Tc,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{$d(e.target)},children:[s&&(0,i.jsx)(yc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:e.state,onClick:(t,n)=>{Al(n),e.toggleRow(`cf${e.customField.id}`,t)}})}),e.columns.map(t=>(0,i.jsx)(pD,{column:t,organizationId:e.organizationId,reloadRow:o,row:e.customField,segmentId:e.segmentId},t.slug)),s&&(0,i.jsxs)(Uc,{justify:"end",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",onClick:()=>{t.push(Os.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,e.customField.id))}})})}),(0,i.jsx)(_m,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(fD,{customField:e.customField,organizationId:e.organizationId,reload:e.reload,segmentId:e.segmentId})]})]})})},_D=()=>{const{params:{organizationId:e}}=cl(),{canCustomFieldEdit:t}=dS(),{columns:n,limit:s,massActions:o,nameDebounced:r,offset:a,possibleColumns:l,predicates:d,reloadKey:c,segmentId:u,setLimit:h,setOffset:g,setSort:p,sort:f}=HC(),{data:x,isLoading:_,reload:I}=Yn("query CustomFields(\n $organizationId: OrganizationId!\n $name: String\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n $sort: CustomFieldsSort\n) {\n data: organization(id: $organizationId) {\n rows: customFields(\n predicates: $predicates\n name: $name\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...CustomField\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:e,predicates:d,name:m(r)?r:null,limit:s,offset:a,sort:f},[Ms.CustomFieldFragment]);const{numberOfPages:v,totalCount:b}=vu(x.data?.rows),j=(0,M.useMemo)(()=>n.flatMap(e=>(0,Va.A)([l.find(t=>t.slug===e)])),[l,n]),[C,y]=(0,M.useState)([]),[k,A]=(0,M.useState)({}),w=(0,M.useCallback)(async t=>{A(e=>({...e,[t]:!0}));const{data:{row:n}}=await function(e,t){return co("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:[Ms.CustomFieldFragment]})}({organizationId:e,id:t},await q());y(e=>e.map(e=>e.id===t?n:e)),A(e=>({...e,[t]:!1}))},[A,y]);return(0,M.useEffect)(()=>{y(x.data?.rows.nodes??[])},[x.data]),(0,M.useEffect)(()=>{c>1&&I()},[c]),(0,M.useEffect)(()=>{o.setStates(Object.fromEntries((x.data?.rows.nodes??[]).map(e=>[`cf${e.id}`,{id:e.id,state:"unchecked"}])))},[x.data,o.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":_,headerRow:(0,i.jsxs)(xc,{children:[t&&(0,i.jsx)(Fc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:o.selectAllState,onClick:o.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:s,numberOfPages:v,offset:a,setLimit:h,setOffset:g,showLimits:!0,totalCount:b})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Mc,{},t.id):(0,i.jsx)(xD,{columns:j,customField:t,organizationId:e,reload:I,reloadCustomField:w,segmentId:u,state:o.states[`cf${t.id}`]?.state??"unchecked",toggleRow:o.toggleRow},t.id))})})})},ID=()=>{const{history:e,translate:t,params:{organizationId:n,customFieldId:s}}=cl(),{data:o,loader:r}=Yn("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},[]),a=o.organization?.customField;return(0,i.jsx)(hu,{returnToFallback:Os.CUSTOM_FIELDS(n),size:"sm",children:r?(0,i.jsx)(mu,{children:r}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nj,{children:t("nombre_d_utilis_58389")}),(0,i.jsxs)(mu,{children:[(0,i.jsx)(Ba,{height:"9"}),(0,i.jsxs)(Ra,{align:"center",direction:"column",children:[(0,i.jsx)(Ra,{align:"center",css:{background:"$purple100",borderRadius:"24px",color:"$purple700",fontSize:"$textXl"},height:64,justify:"center",width:64,children:(0,i.jsx)(Ya,{icon:pz(a.fieldType,a.fieldProperty)})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:a.name})]}),(0,i.jsx)(Ba,{height:"9"}),a.positions.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_de_missio_27210",a.positions.length)}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{direction:"column",gap:"6",children:a.positions.map(t=>(0,i.jsxs)(br,{css:{cursor:"pointer"},onClick:()=>{e.push(ms.POSITION({organizationId:n,eventId:t.event.id,positionId:t.id}))},children:[(0,i.jsx)(br,{color:"gray800",children:t.event.name}),(0,i.jsx)(br,{color:"gray500",children:t.name})]},t.id))}),(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",height:"1px",marginBottom:"$6",marginTop:"$6",width:"100%"}})]}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_formu_84836",a.forms.length)}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{direction:"column",gap:"6",children:a.forms.map(n=>{const s=n.event?n.event.name:t("communaut_20896");return(0,i.jsxs)(br,{css:{cursor:"pointer"},onClick:()=>{e.push(Fi.FORM({organizationId:n.organization.id,eventId:n.event?.id,formId:n.id}))},children:[(0,i.jsx)(br,{color:"gray800",children:s}),(0,i.jsx)(br,{color:"gray500",children:n.name})]},n.id)})}),(0,i.jsx)(Ba,{height:"9"})]})]})})},vD=()=>{const{history:e,translate:t,params:{organizationId:n}}=cl(),{canCustomFieldEdit:s,canSegmentEdit:o}=dS(),{reloadKey:r,segmentId:a,setReloadKey:l}=HC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rD,{}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{actions:(0,i.jsx)(oD,{}),searchPlaceholder:t("rechercher_un_c_49598"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:!1})}),(0,i.jsx)(_D,{}),(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.CUSTOM_FIELD_USAGE(":organizationId",":segmentId",":customFieldId"),children:(0,i.jsx)(ID,{})}),(0,i.jsx)(Cr.qh,{path:Os.CREATE_CUSTOM_FIELD(":organizationId",":segmentId"),children:(0,i.jsx)(OS,{organizationId:n,onClose:()=>{e.goBack(Os.CUSTOM_FIELDS_SEGMENT(n,a))},onSuccess:()=>{l(r+1)}})}),(0,i.jsx)(Cr.qh,{path:Os.EDIT_CUSTOM_FIELD(":organizationId",":segmentId",":customFieldId"),children:(0,i.jsx)($S,{onClose:()=>{e.goBack(Os.CUSTOM_FIELDS_SEGMENT(n,a))},onSuccess:()=>{l(r+1)}})})]})]})]})},bD=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=cl();Td(n("champs_de_formu_64126"));const{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=_I(),d=Gn(sD),c=(0,M.useMemo)(()=>d.getCustomFieldsFilters(s,e.organization),[e.organization,s]),u=(0,M.useMemo)(()=>d.getCustomFieldsPossibleColumns(),[]);return(0,i.jsx)(lD,{organizationId:s,children:(0,i.jsx)(wR,{canEditSegments:r,filters:c,filtersButtonText:n("filtrer_les_cha_91574"),filtersSubtitle:n("appliquer_des_f_27562"),getSegmentPath:e=>Os.CUSTOM_FIELDS_SEGMENT(s,e),initialLimit:a?.customFieldsLimit??kc,initialSegmentsOpen:a?.areCustomFieldsSegmentsOpen??!0,organizationId:s,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:_t.CustomFields,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({customFieldsLimit:e})},onSegmentClick:e=>{l({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await l({customFieldsSegmentId:null}),t.replace(Os.CUSTOM_FIELDS(s))},onSegmentsToggle:async e=>{await l({areCustomFieldsSegmentsOpen:e})},children:(0,i.jsx)(vD,{})})})},jD=()=>{const{params:{organizationId:e}}=cl(),{localOrganization:t}=_I(),{data:n,loader:s,reload:o}=Yn("query CustomFieldsSegments($organizationId: OrganizationId!, $predicates: [Predicate!]!) {\n organization(id: $organizationId) {\n customFields(predicates: $predicates) {\n nodes {\n id\n name\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(level: Organization, segmentType: CustomFields) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,predicates:[{operator:ct.Is,slug:"condition",value:[]}]},[Ms.SegmentsFoldersSegmentsFragment]);const r=(0,M.useMemo)(()=>(n.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[n.organization]);return s||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.CUSTOM_FIELDS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(bD,{organization:n.organization,reload:o})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.CUSTOM_FIELDS_SEGMENT(e,t?.customFieldsSegmentId&&r.includes(t.customFieldsSegmentId)?t.customFieldsSegmentId:r[0]),replace:!0})})]})},CD=e=>{const{translate:t}=cl();return(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",children:t("lier_un_champ_p_01331")})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(Zj,{customFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})})]})},yD=e=>{const{translate:t}=cl();return(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("aucun_champ_per_72101")}),(0,i.jsx)(CD,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})]})},kD=e=>{const t=(0,M.useMemo)(()=>Object.fromEntries(e.formCustomFields.map(e=>[e.id,e])),[e.formCustomFields]);return(0,i.jsx)(uu.JY,{onDragEnd:e.onDragEnd,children:(0,i.jsx)(uu.gL,{droppableId:"1",children:n=>(0,i.jsxs)(Ra,{css:{bd:!0},direction:"column",width:1,...n.droppableProps,ref:n.innerRef,children:[e.formCustomFieldsValues.map((n,s)=>(0,i.jsx)(FS,{css:{border:"none",borderBottom:"1px solid $gray200",borderRadius:"0",boxShadow:"none","&:last-child":{borderBottom:"none"}},elementId:n.id,field:t[n.customFieldId],index:s,isMandatory:n.isMandatory,showEdit:!1,toggleIsMandatory:e.toggleMandatory,updateCustomField:Hl.A,onDelete:e.onDelete},n.id)),n.placeholder]})})})},AD=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>new Set(e.formCustomFieldsValues.map(({customFieldId:e})=>e)),[e.formCustomFieldsValues]),s=(0,M.useCallback)(t=>{e.change(`${e.prefix}formCustomFields`,t)},[e.prefix,e.change]),o=(0,M.useCallback)(t=>{n.has(t.id)?s(e.formCustomFieldsValues.filter(({customFieldId:e})=>e!==t.id)):s([...e.formCustomFieldsValues,{id:L(),customFieldId:t.id,isMandatory:!0}])},[e.formCustomFieldsValues,n,s]),r=(0,M.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&s(so(e.formCustomFieldsValues,n.index,i.index))},[e.formCustomFieldsValues,s]),a=(0,M.useCallback)((t,n)=>{s((0,cu.jM)(e.formCustomFieldsValues,e=>{e[t].isMandatory=n}))},[e.formCustomFieldsValues,s]),l=(0,M.useCallback)(t=>{s((0,cu.jM)(e.formCustomFieldsValues,e=>{e.splice(t,1)}))},[e.formCustomFieldsValues,s]);return(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(Ra,{width:280,children:(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("champs_personna_17489")})}),(0,i.jsx)(Ra,{css:{flex:"1"},children:eo(e.formCustomFieldsValues)?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(kD,{formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,toggleMandatory:a,onDelete:l,onDragEnd:r}),(0,i.jsx)(CD,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:o})]}):(0,i.jsx)(yD,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:o})})]})},wD=e=>{const{params:{organizationId:t}}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)((0,ch.A)(e.customFields.map(e=>e.category),e=>e.id),e=>e.name.toLowerCase()),[e.customFields]),s=(0,M.useMemo)(()=>(0,nc.A)(e.customFields,e=>e.category.id),[e.customFields]);return(0,i.jsxs)(Ra,{direction:"column",children:[n.map((n,o)=>{const r=s[n.id];return(0,i.jsxs)(M.Fragment,{children:[0!==o&&(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(Ra,{width:280,children:(0,i.jsx)(br,{font:"gray800 textSm medium",children:n.name})}),(0,i.jsx)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:r.map(n=>(0,i.jsx)(Kj,{change:e.change,display:!0,field:n,fileAcl:"public-read",isMandatory:!1,organizationId:t,prefix:`${e.prefix}fields.`},n.id))})]})]},n.id)}),eo(e.customFields)&&e.showFormCustomFields&&(0,i.jsx)(Wu,{height:"5"}),e.showFormCustomFields&&(0,i.jsx)(AD,{change:e.change,formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,prefix:e.prefix})]})},SD=e=>{const{history:t,translate:n,params:{organizationId:s}}=cl(),o=Gn(su),r=(0,M.useMemo)(()=>V_.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)(Mm,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"event.emailSenderId",onCreateClick:()=>{t.push(Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ba,{height:"4"})]}),(0,i.jsx)(Rr.Yr,{name:"event.languages",children:t=>{!e.hasLanguagesFeature&&t.length>1&&e.change("event.languages",[(0,eu.A)(t)])}}),(0,i.jsx)(Mm,{label:n("langues_de_l_v_94191"),multiple:!0,name:"event.languages",children:hd.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Mm,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"event.timeZone",children:r}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(kv,{label:n("heure_laquell_13491"),name:"event.dayStartTime"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Mm,{isSearchVisible:!0,label:n("Country"),name:"event.country",children:o.getCountriesIdName().map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(yj,{label:n("fond_de_carte_43822"),name:"event.layer",children:[(0,i.jsx)("option",{value:Je.Google,children:n("plan_24242")}),(0,i.jsx)("option",{value:Je.GoogleSatellite,children:n("satellite_64364")}),(0,i.jsx)("option",{value:Je.IgnPlan,children:n("plan_ign_03240")})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)(Fm,{label:(0,i.jsx)(_v,{children:n("latitude_par_d_01620")}),name:"event.latitude"}),(0,i.jsx)(Fm,{label:(0,i.jsx)(_v,{children:n("longitude_par_d_28326")}),name:"event.longitude"})]}),e.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Bm,{name:"event.isWeezeventSynchronized",children:n("synchroniser_av_82451")})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:n("modules_activ_s_07626")}),(0,i.jsx)(Bm,{name:"event.usePositions",children:n("missions_63972")}),(0,i.jsx)(Bm,{name:"event.useAccreditations",children:n("accr_ditations_39450")}),(0,i.jsx)(Bm,{name:"event.useDelegations",children:n("d_l_gations_78318")}),(0,i.jsx)(Bm,{name:"event.useForms",children:n("Form_plural")}),(0,i.jsx)(Bm,{name:"event.useCampaigns",children:n("Campaigns")}),(0,i.jsx)(Bm,{name:"event.useDocuments",children:n("Documents")}),(0,i.jsx)(Bm,{name:"event.useWorkflows",children:n("automatisations_60045")})]})]})},ED=e=>{const{history:t,translate:n,params:{organizationId:s}}=cl(),o=Gn(q_),r=Gn(Da),{hasFeature:a,reload:l}=_I(),d=(0,M.useRef)(null),c=(0,M.useMemo)(()=>({event:e.initialValues}),[e.initialValues]),u=(0,M.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),[e.initialValues]),h=(0,M.useMemo)(()=>e.isEdit&&eo(Object.keys(e.initialValues.fields)),[e.isEdit,e.initialValues]),g=(0,M.useMemo)(()=>m(e.initialValues.description),[e.initialValues]),p=(0,M.useMemo)(()=>!!e.isEdit&&eo(e.initialValues.tagsIds),[e.isEdit,e.initialValues]);return(0,i.jsx)(fl,{customErrorRef:d,height:1,initialValues:c,initialValuesEqual:()=>!0,render:({form:t,handleSubmit:o,values:r})=>(0,i.jsx)(zm,{button:e.isEdit&&(0,i.jsx)(jl,{isLoading:e.isMutateLoading,onClick:o,children:n("mettre_jour_l_28846")}),category:e.organization.name,color:"dark",fallbackClosePath:Bi.EVENTS({organizationId:s}),title:e.isEdit?n("mise_jour_de_17055",e.initialValues.name):n("cr_ation_d_un_94106"),children:(0,i.jsxs)(Em,{ref:d,children:[(0,i.jsx)(hl,{}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,subtitle:n("param_trer_votr_94121"),title:n("dites_en_nous_u_13238"),children:(0,i.jsx)(Q_,{form:t,values:r})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Rm,{initialIsOpen:u,subtitle:n("param_trer_l_m_66748"),title:n("options_avanc_e_12396"),children:(0,i.jsx)(SD,{change:t.change,emailsSenders:e.organization.emailsSenders,hasLanguagesFeature:a(Fe.Languages),showEmailSender:!0,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Rm,{initialIsOpen:h,subtitle:n("ajouter_des_inf_87361"),title:n("champs_de_formu_64126"),onToggle:e=>{e||t.change("event.fields",{})},children:(0,i.jsx)(wD,{change:t.change,customFields:e.eventCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"event.",showFormCustomFields:!1})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Rm,{initialIsOpen:g,subtitle:n("ajouter_une_des_44242"),title:n("Description"),onToggle:e=>{e||t.change("event.description","")},children:(0,i.jsx)(Tv,{label:(0,i.jsx)(_v,{children:n("description_58935")}),name:"event.description"})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Rm,{initialIsOpen:p,subtitle:n("ajouter_des_tag_23887"),title:n("tags_79499"),onToggle:e=>{e||t.change("event.tagsIds",[])},children:(0,i.jsx)(Oj,{change:t.change,name:"event.",organizationId:s,tags:e.organization.tags.nodes,tagsIds:r.event.tagsIds})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{isLoading:e.isMutateLoading,textAlign:"center",onClick:o,children:e.isEdit?n("mettre_jour_l_28846"):n("cr_er_l_v_neme_16731")})})]})}),validate:r.validateForForm(o.createUpdateEventSchema()),width:1,onSubmit:async n=>{const i=await e.mutate({organizationId:s,event:n.event});l(),e.isEdit?t.goBack(Bi.EVENT({organizationId:s,eventId:i})):t.replace(Bi.EVENT({organizationId:s,eventId:i}))}})},TD=()=>{const e=Gn(q_),{params:{organizationId:t},translate:n}=cl();Td(n("cr_er_l_v_neme_16731"));const{data:s,loader:o}=Yn("query EventCreateInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n}\n",{organizationId:t},[Ms.CreateUpdateEventInfosFragment]),{mutate:r,isLoading:a}=function(e={}){return Kn("mutation CreateEvent($organizationId: OrganizationId!, $event: EventInput!) {\n eventCreate(organizationId: $organizationId, event: $event) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0});return o||(0,i.jsx)(ED,{eventCustomFields:s.organization?.eventCustomFields.nodes??[],initialValues:e.eventInputDefault(),isEdit:!1,isMutateLoading:a,mutate:async e=>{const{eventCreate:{id:t}}=await r(e);return t},organization:s.organization})},zD=()=>{const e=Gn(q_),{params:{organizationId:t,eventId:n},translate:s}=cl(),{data:o,loader:r}=Yn("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 }\n}\n",{organizationId:t,eventId:n},[Ms.CreateUpdateEventInfosFragment]);Td(`${s("mettre_jour_l_28846")}: ${o.event?.name}`);const{mutate:a,isLoading:l}=function(e={}){return Kn("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)(ED,{eventCustomFields:o.organization?.eventCustomFields.nodes??[],initialValues:e.eventInputDefault(o.event),isEdit:!0,isMutateLoading:l,mutate:async e=>{const{eventUpdate:{id:t}}=await a({...e,eventId:n});return t},organization:o.organization})};var OD;let RD=class extends AO{static{OD=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...AO.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===Ye.Update?[OD.IMPORT_COLUMNS_DEFAULT.Id]:[],OD.IMPORT_COLUMNS_DEFAULT.Name,OD.IMPORT_COLUMNS_DEFAULT.StartAt,OD.IMPORT_COLUMNS_DEFAULT.EndAt];constructor(e,t){super(e,t),this.csvInputService=e}};RD=OD=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[aO,Vn])],RD);const $D=()=>{const{params:{organizationId:e},translate:t}=cl(),{mutate:n}=function(e={}){return Kn("mutation EventsImport($organizationId: OrganizationId!, $input: MappableImportInput!) {\n jobId: eventsImport(organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkEventsImport:s}=ib(),o=(0,M.useCallback)((e,t)=>s(e,t),[s]),{data:r,loader:a}=Gr({organizationId:e,variety:_e.Event});return a||(0,i.jsx)(CO,{ImportInputService:RD,checkImport:o,closePath:Bi.EVENTS({organizationId:e}),customFields:r.organization.customFields.nodes,importTagPrefix:"events",itemName:{singular:t("_v_nement_22345"),plural:t("_v_nements_53672")},localStorageKeyPrefix:"EVENTS_IMPORT",mutate:n,showModeSelection:!1,title:t("import_events_60816")})};var DD;!function(e){e.Description="description",e.EndAt="endAt",e.Id="id",e.Name="name",e.NumberOfMembers="numberOfMembers",e.NumberOfMembersAccredited="numberOfMembersAccredited",e.NumberOfMembersAssigned="numberOfMembersAssigned",e.StartAt="startAt",e.State="state",e.Tags="tags"}(DD||(DD={}));let PD=class extends du{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:Ve.Text,hideEmpty:!0},{slug:DD.Description,name:this.t("Description"),category:this.t("Event"),fieldType:Ve.Text},{slug:"startAt",name:this.t("date_de_d_but_43380"),category:this.t("Event"),fieldType:Ve.Date,hideEmpty:!0},{slug:"endAt",name:this.t("date_de_fin_86920"),category:this.t("Event"),fieldType:Ve.Date,hideEmpty:!0},{slug:"state",name:this.t("status_06428"),category:this.t("Event"),fieldType:Ve.Select,values:[{id:$e.Ongoing,name:this.t($e.Ongoing)},{id:$e.Upcoming,name:this.t($e.Upcoming)},{id:$e.Done,name:this.t($e.Done)}],hideEmpty:!0},{slug:"tag",name:this.t("Tag"),category:this.t("Event"),fieldType:Ve.Select,needLoading:!0,organizationId:e,tagContext:Ct.Events},...this.customFieldsToFilters(t)]}getEventPossibleColumns(e){return[{slug:DD.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Re.Id,width:100},{slug:DD.Name,name:this.t("nom_de_l_v_nem_08711"),isSearchable:!0,isSortable:!0,sortAttribute:Re.Name,minWidth:240},{slug:DD.StartAt,name:this.t("date_de_d_but_43380"),isSortable:!0,sortAttribute:Re.StartAt,minWidth:180},{slug:DD.EndAt,name:this.t("date_de_fin_86920"),isSortable:!0,sortAttribute:Re.EndAt,minWidth:180},{slug:DD.State,name:this.t("status_06428"),minWidth:180},{slug:DD.Tags,name:this.t("tags_79499"),minWidth:320},{slug:DD.NumberOfMembers,name:this.t("nombre_de_membr_08851"),minWidth:180},{slug:DD.NumberOfMembersAssigned,name:this.t("nombre_de_membr_87779_plural"),minWidth:180},{slug:DD.NumberOfMembersAccredited,name:this.t("nombre_de_membr_25913"),minWidth:180}].concat(this.customFieldsToPossibleColumns(e))}};PD=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],PD);const FD=e=>{const t=Hn(),n=Gn(Wc);return(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:t("date_de_l_v_ne_69973")}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:O_(n,e.event.startAt,e.event.endAt)})]})},MD=e=>{const t=Hn();return(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:t("status_06428")}),(0,i.jsx)(Ra,{children:(0,i.jsx)(Jd,{color:R_(e.event.state),children:t(e.event.state)})})]})},ND=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("mutation EventsMassArchive(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n eventsMassArchive(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{reload:s}=_I();return(0,i.jsx)(Pk,{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]}}),s(),e.onSuccess()}})};let LD=class extends Pl{constructor(e){super(e)}eventDuplicateInputDefault(e){return{name:this.t("copie_de_1_62900",e.name),startAt:e.startAt,endAt:e.endAt,eventId:null,includeAccreditations:!0,includeCustomDocuments:!0,includeDelegations:!0,includeForms:!0,includePositions:!0,includeSegments:!0,includeTemplates:!0,includeWorkflows:!0}}eventDuplicateSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),startAt:Vm.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:Vm.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 Bs.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Bs.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),includeAccreditations:d.zM(),includeCustomDocuments:d.zM(),includeDelegations:d.zM(),includeForms:d.zM(),includePositions:d.zM(),includeSegments:d.zM(),includeTemplates:d.zM(),includeWorkflows:d.zM()})}};LD=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],LD);const BD=e=>{const t=Hn(),n=Gn(LD),s=Gn(Da),{mutate:o,isLoading:r}=function(e={}){return Kn("mutation EventDuplicate($eventId: EventId!, $options: EventDuplicateInput!) {\n eventDuplicate(eventId: $eventId, options: $options) {\n id\n }\n}\n",e)}(),{organization:a,reload:l}=_I(),[d,c]=(0,M.useState)(!1),u=(0,M.useMemo)(()=>a.events.nodes.filter(t=>t.id!==e.event.id),[a.events.nodes]),h=e.event.endAt.diff(e.event.startAt,"days").days;return(0,i.jsx)(Fa.lV,{initialValues:{options:n.eventDuplicateInputDefault(e.event)},initialValuesEqual:Or.A,render:({form:n,handleSubmit:s,invalid:o,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"options.startAt",children:e=>{const t=e.plus({days:h});t.equals(a.options.endAt)||n.change("options.endAt",t)}}),(0,i.jsx)(Rr.Yr,{name:"options.endAt",children:e=>{const t=e.minus({days:h});t.equals(a.options.startAt)||n.change("options.startAt",t)}}),(0,i.jsx)(db,{icon:"clone",children:t("dupliquer_l_v_72541",e.event.name)}),(0,i.jsxs)(lb,{css:{overflowY:"auto"},gap:"5",children:[(0,i.jsx)(xu,{value:d,onChange:e=>{c(e),e||n.change("options.eventId",null)},children:t("dupliquer_les_d_77458")}),d?(0,i.jsx)(Mm,{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)(Rl,{label:t("nom_du_nouvel_66511"),name:"options.name"}),(0,i.jsxs)(Ra,{gap:"5",children:[(0,i.jsx)(Dm,{label:t("nouvelle_date_d_75723"),min:Bs.c9.utc(),name:"options.startAt"}),(0,i.jsx)(Dm,{label:t("nouvelle_date_d_93958"),min:Bs.c9.utc(),name:"options.endAt"})]})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",children:t("que_souhaitez_v_40297")}),(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsxs)(Ra,{gap:"5",children:[(0,i.jsx)(br,{width:1,children:(0,i.jsx)($m,{name:"options.includePositions",children:t("missions_63972")})}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)($m,{name:"options.includeAccreditations",children:t("accr_ditations_39450")})})]}),(0,i.jsxs)(Ra,{gap:"5",children:[(0,i.jsx)(br,{width:1,children:(0,i.jsx)($m,{name:"options.includeForms",children:t("Form_plural")})}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)($m,{name:"options.includeDelegations",children:t("d_l_gations_78318")})})]}),(0,i.jsxs)(Ra,{gap:"5",children:[(0,i.jsx)(br,{width:1,children:(0,i.jsx)($m,{name:"options.includeSegments",children:t("vues_personnali_80652")})}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)($m,{name:"options.includeCustomDocuments",children:t("documents_perso_87374")})})]}),(0,i.jsxs)(Ra,{gap:"5",children:[(0,i.jsx)(br,{width:1,children:(0,i.jsx)($m,{name:"options.includeTemplates",children:t("mod_les_de_camp_58182")})}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)($m,{name:"options.includeWorkflows",children:t("automatisations_60045")})})]})]})]})]}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{disabled:o,isLoading:r,onClick:s,children:t("dupliquer_28256")})})]}),validate:e=>s.validateForForm(n.eventDuplicateSchema())(e.options),onSubmit:async t=>{await o({eventId:e.event.id,options:t.options}),l(),e.reload(),e.onClose()}})},VD=e=>{const{params:{organizationId:t},translate:n}=cl(),{canEventEdit:s}=dS(),[o,r]=(0,M.useState)(!1),[a,l]=(0,M.useState)(!1),d=(0,M.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)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Ra,{css:{flex:"1"},children:(0,i.jsx)(Vc,{to:Os.VOLUNTEERS(t,e.event.id),children:e.event.name})}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},gap:"8",children:[(0,i.jsx)(FD,{event:e.event}),(0,i.jsx)(MD,{event:e.event}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:n("tags_79499")}),(0,i.jsx)(ly,{badges:d})]})]}),(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(jl,{to:Os.VOLUNTEERS(t,e.event.id),children:n("voir_l_v_nemen_72358")}),s&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"pen",to:Os.EDIT_EVENT(t,e.event.id),children:n("_diter_62574")}),(0,i.jsx)(Ld,{icon:"clone",onClick:e=>{$d(e.target),r(!0)},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{$d(e.target),l(!0)},children:n("archiver_26131")})]})]})]})]}),(0,i.jsx)(ub,{isOpen:o,onClose:()=>{r(!1)},children:(0,i.jsx)(cb,{children:(0,i.jsx)(BD,{event:e.event,reload:e.reload,onClose:()=>{r(!1)}})})}),a&&(0,i.jsx)(ND,{event:e.event,organizationId:t,onClose:()=>l(!1),onSuccess:e.reload})]})},UD=()=>{const{translate:e}=cl();return(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,minHeight:"75px",padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Ra,{css:{flex:"1"},children:(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1})}),(0,i.jsxs)(Ra,{css:{flex:"1"},gap:"8",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:70,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:e("status_06428")}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:e("tags_79499")}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1})]})]}),(0,i.jsx)(Ra,{width:200})]})},WD=()=>{const{params:{organizationId:e}}=cl(),{nameDebounced:t,predicates:n,limit:s,offset:o,setLimit:r,setOffset:a}=HC(),{data:l,isLoading:d,reload:c}=ea({organizationId:e,name:m(t)?t:null,predicates:n,limit:s,offset:o,sort:{attribute:Re.StartAt,direction:vt.Desc},includeNumberOfMembers:!1}),{numberOfPages:u,totalCount:h}=vu(l.data?.rows);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{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)(UD,{}),(0,i.jsx)(UD,{}),(0,i.jsx)(UD,{})]}):(l.data?.rows.nodes??[]).map(e=>(0,i.jsx)(VD,{event:e,reload:c},e.id))}),(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:s,numberOfPages:u,offset:o,setLimit:r,setOffset:a,showLimits:!0,totalCount:h})})]})},GD=()=>{const{translate:e,params:{organizationId:t}}=cl(),{canEventEdit:n}=dS();return(0,i.jsx)(RR,{children:n&&(0,i.jsx)(wS,{menu:(0,i.jsx)(Ld,{icon:"file-import",to:Bi.EVENTS_IMPORT({organizationId:t}),onClick:e=>$d(e.target),children:e("importer_via_un_61623")}),path:Os.CREATE_EVENT(t),children:e("cr_er_un_v_nem_28126")})})},HD=e=>{const{params:{organizationId:t}}=cl(),{mutate:n}=Eo();return(0,i.jsx)(ZC,{column:e.column,initialValue:e.initialValue,mutate:i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.eventId]},slug:e.property,strategy:Qe.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},qD=e=>{const{translate:t}=cl(),n=Gn(Wc);return(0,i.jsx)(HD,{column:e.column,eventId:e.event.id,initialValue:e.event.endAt,property:ze.EndAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Tu,{label:t("date_de_fin_86920"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.endAt,Zs.DateOnly.WeekdayLongMonthLong),updatable:!0})},YD=e=>{const{translate:t,params:{organizationId:n}}=cl(),{isEditMode:s}=HC();return(0,i.jsx)(HD,{column:e.column,eventId:e.event.id,initialValue:e.event.name,property:ze.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("nom_de_l_v_nem_08711"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(h$,{isEditMode:s,title:e.event.name,updatable:!0,children:(0,i.jsx)(Vc,{to:Bi.EVENT({organizationId:n,eventId:e.event.id}),children:e.event.name})}),updatable:!0})},KD=e=>{const{translate:t}=cl(),n=Gn(Wc);return(0,i.jsx)(HD,{column:e.column,eventId:e.event.id,initialValue:e.event.startAt,property:ze.StartAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Tu,{label:t("date_de_d_but_43380"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.startAt,Zs.DateOnly.WeekdayLongMonthLong),updatable:!0})},ZD=M.createContext({}),XD=e=>{const t=KR(Mo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(ZD.Provider,{value:{getTags:t},children:e.children})},JD=e=>{const{translate:t}=cl(),{getTags:n}=M.useContext(ZD),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("tags_79499")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},QD=e=>{const t=(0,M.useMemo)(()=>e.event.tags||[],[e.event]),n=(0,M.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(HD,{column:e.column,eventId:e.event.id,initialValue:t.map(e=>e.id),property:ze.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(JD,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ly,{badges:n}),updatable:!0})},eP=e=>{const{translate:t}=cl(),{mutate:n}=Eo(),s=(0,M.useCallback)((t,i)=>n({organizationId:e.organizationId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:Qe.Replace,value:t}}),[e.row,n]);return e.column.slug===DD.Id?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===DD.Name?(0,i.jsx)(YD,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===DD.StartAt?(0,i.jsx)(KD,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===DD.EndAt?(0,i.jsx)(qD,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===DD.Tags?(0,i.jsx)(QD,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===DD.State?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Jd,{color:R_(e.row.state),children:t(e.row.state)})}):e.column.slug===DD.NumberOfMembers?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembers}):e.column.slug===DD.NumberOfMembersAccredited?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAccredited}):e.column.slug===DD.NumberOfMembersAssigned?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAssigned}):(0,i.jsx)(my,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:s,reload:e.reloadRow,updatable:!0})},tP=e=>{const{translate:t,params:{organizationId:n}}=cl(),[s,o]=(0,M.useState)(!1),[r,a]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"clone",onClick:e=>{$d(e.target),o(!0)},children:t("dupliquer_28256")}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{$d(e.target),a(!0)},children:t("archiver_26131")})]}),(0,i.jsx)(ub,{isOpen:s,onClose:()=>{o(!1)},children:(0,i.jsx)(cb,{children:(0,i.jsx)(BD,{event:e.event,reload:e.reload,onClose:()=>{o(!1)}})})}),r&&(0,i.jsx)(ND,{event:e.event,organizationId:n,onClose:()=>a(!1),onSuccess:e.reload})]})},nP=e=>{const{translate:t,params:{organizationId:n}}=cl(),{canEventEdit:s}=dS(),o=UC(e.customFields),r=(0,M.useCallback)(()=>{e.reloadEvent(e.event.id)},[e.event,e.reloadEvent]);return(0,i.jsxs)(Tc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{$d(e.target)},children:[e.columns.map(t=>{const s=o.get(t.slug);return(0,i.jsx)(eP,{column:t,customField:s,organizationId:n,reloadRow:r,row:e.event},t.slug)}),s&&(0,i.jsxs)(Uc,{justify:"center",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",to:Os.EDIT_EVENT(n,e.event.id)})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(tP,{event:e.event,reload:e.reload})]})]})},iP=e=>{const{params:{organizationId:t}}=cl(),{canEventEdit:n}=dS(),{columns:s,limit:o,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,setLimit:u,setOffset:h,setSort:g,sort:p}=HC(),f=(0,M.useMemo)(()=>function(e){return{includeNumberOfMembers:e.includes(DD.NumberOfMembers)||e.includes(DD.NumberOfMembersAccredited)||e.includes(DD.NumberOfMembersAssigned)}}(s),[s]),{data:x,isLoading:_,reload:I}=ea({...f,organizationId:t,name:m(a)?a:null,predicates:c,limit:o,offset:l,sort:p}),v=(0,M.useMemo)(()=>s.flatMap(e=>(0,Va.A)([d.find(t=>t.slug===e)])),[d,s]),{numberOfPages:b,totalCount:j}=vu(x.data?.rows),[C,y]=(0,M.useState)([]),[k,A]=(0,M.useState)({}),w=(0,M.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...f,organizationId:t,id:e},s=await q(),co("query EventsEvent(\n $organizationId: OrganizationId!\n $id: EventId!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: event(id: $id) {\n ...EventsEvent\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Ms.EventsEventFragment]}));var i,s;y(t=>t.map(t=>t.id===e?n:t)),A(t=>({...t,[e]:!1}))},[f,A,y]);return(0,M.useEffect)(()=>{y(x.data?.rows.nodes??[])},[x.data]),(0,M.useEffect)(()=>{r.setStates(Object.fromEntries((x.data?.rows.nodes??[]).map(e=>[`e${e.id}`,{id:e.id,state:"unchecked"}])))},[x.data,r.setStates]),(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":_,headerRow:(0,i.jsxs)(xc,{children:[v.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:g,sort:p,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:o,numberOfPages:b,offset:l,setLimit:u,setOffset:h,showLimits:!0,totalCount:j})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Mc,{},t.id):(0,i.jsx)(nP,{columns:v,customFields:e.customFields,event:t,reload:I,reloadEvent:w,state:r.states[`e${t.id}`]?.state??"unchecked"},t.id))})})},sP=e=>{const{translate:t}=cl(),{canEventEdit:n}=dS(),{rendering:s}=HC(),o=n&&s===$h.List,r=n&&s===$h.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(GD,{}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{searchPlaceholder:t("rechercher_un_40024"),showActions:n,showEditColumns:o,showEditMode:r,showSearchColumns:!1})}),s===$h.List?(0,i.jsx)(iP,{customFields:e.customFields}):(0,i.jsx)(WD,{})]})]})},oP=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=cl(),{localOrganization:r,updateLocalOrganization:a}=_I(),{canSegmentEdit:l}=dS(),d=Gn(PD),c=(0,M.useMemo)(()=>e.organization.customFields.nodes,[e.organization]),u=(0,M.useMemo)(()=>d.getEventsFilters(s,c),[s,c]),h=(0,M.useMemo)(()=>d.getEventPossibleColumns(c),[c]);return(0,i.jsx)(XD,{organizationId:s,children:(0,i.jsx)(wR,{canEditSegments:l,filters:u,filtersButtonText:n("filtrer_les_v_48869"),filtersSubtitle:n("appliquer_des_f_84816"),getSegmentPath:e=>Os.EVENTS_SEGMENT(s,e),initialLimit:r?.eventsLimit??kc,initialSegmentsOpen:r?.areEventsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[$h.Card,$h.List],reload:e.reload,segmentId:o,segmentType:_t.Events,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({eventsLimit:e})},onSegmentClick:e=>{a({eventsSegmentId:e})},onSegmentDelete:async()=>{await a({eventsSegmentId:null}),t.replace(Bi.EVENTS({organizationId:s}))},onSegmentsToggle:async e=>{await a({areEventsSegmentsOpen:e})},children:(0,i.jsx)(sP,{customFields:c})})})},rP=()=>{const{params:{organizationId:e},translate:t}=cl();Td(t("events_23531"));const{localOrganization:n}=_I(),{data:s,loader:o,reload:r}=Yn("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},[Ms.SegmentCustomFieldFragment,Ms.SegmentsFoldersSegmentsFragment]),a=(0,M.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.EVENTS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(oP,{organization:s.organization,reload:r})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.EVENTS_SEGMENT(e,n?.eventsSegmentId&&a.includes(n.eventsSegmentId)?n.eventsSegmentId:a[0]),replace:!0})})]})},aP=()=>{const{params:{organizationId:e},translate:t}=cl(),{loader:n,data:s}=Yn("query EventsMobile($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n }\n }\n }\n}\n",{organizationId:e},[]);return n||(eo(s.organization.events.nodes)?(0,i.jsx)(ei,{path:Os.DASHBOARD_EVENT_SWITCH(e,s.organization.events.nodes[0].id)}):(0,i.jsx)(br,{children:t("no_events_found_69870")}))};let lP=class extends Pl{constructor(e){super(e)}accreditationsCustomFieldInputSchema(){return d.Ik().shape({customFieldId:d.ai().required(this.t("le_champ_person_80074")),conditionValue:d.gl().required(this.t("la_condition_es_66568"))})}};lP=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],lP);let dP=class extends Pl{constructor(e){super(e)}accreditationsSlotInputDefault(){return{name:""}}createAccreditationSlotSchema(){return d.Ik().shape({slot:this.accreditationsSlotInputSchema()})}accreditationsSlotInputSchema(){return d.Ik().shape({name:d.Yj(),maxResources:d.ai().nullable(),date:Vm.typeError(this.t("la_date_est_inv_22002")).nullable()})}};dP=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],dP);let cP=class extends Pl{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 d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_acc_82676")),accreditationCategoryId:d.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:d.Yj(),privateNote:d.Yj(),acronym:d.Yj(),color:d.Yj().required(this.t("la_couleur_est_95740")),icon:d.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(mn,this.t("l_ic_ne_est_req_15843")),weezeventIsSynchronized:d.zM().required(),address:d.Yj().nullable(),latitude:d.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:d.ai().nullable().typeError(this.t("la_longitude_do_35170")),zoom:d.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:d.Yj().required(this.t("le_fond_de_cart_48524")).oneOf(xn,this.t("le_fond_de_cart_48524")),slots:d.YO().of(this.accreditationsSlotInput.accreditationsSlotInputSchema()),accreditationDisplay:d.Yj().required(this.t("le_type_d_affic_60154")).oneOf(Ht,this.t("le_type_d_affic_60154")).test("calendar-slots",this.t("tous_les_cr_nea_42033"),(e,t)=>e!==te.Calendar||eo(t.parent.slots)&&t.parent.slots.every(e=>e.date?.isValid)),numberOfDaysLimit:d.ai().notRequired(),accreditationsCustomFields:d.YO().of(this.accreditationsCustomFieldInput.accreditationsCustomFieldInputSchema()),formCustomFields:d.YO(),tagsIds:d.YO().of(d.ai())})}createUpdateAccreditationSchema(){return d.Ik().shape({accreditation:this.accreditationInputSchema()})}accreditationInputDefault(e,t,n){let i=t?.accreditationCategoryId??n;return Number.isInteger(i)||(i=null),{accreditationCategoryId:i,name:t?.name??"",description:t?.description??"",privateNote:t?.privateNote??"",acronym:t?.acronym??"",color:t?.color??mr.colors.primary700.value,icon:t?.icon??qe.BadgeCheck,weezeventIsSynchronized:t?.weezeventIsSynchronized??!0,willAutoAccredit:t?.willAutoAccredit??!1,address:t?.address??null,latitude:t?.latitude??null,longitude:t?.longitude??null,zoom:t?.zoom??Er,layer:t?.layer??e,accreditationDisplay:t?.accreditationDisplay??te.List,numberOfDaysLimit:t?.numberOfDaysLimit??null,slots:(0,ic.A)(t?.slots??[],e=>(0,Va.A)([e.date?.toMillis(),e.name])),conditionsOperator:t?.conditionsOperator??me.And,accreditationsCustomFields:t?.accreditationsCustomFields??[],tagsIds:t?.tagsIds??[],fields:t?.fields??{},formCustomFields:t?.formCustomFields??[]}}};cP=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn,lP,dP])],cP);const uP=e=>{const t=Hn(),n=e.customFields.find(t=>t.id===e.customFieldValue.customFieldId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:`${e.field}customFieldId`,children:t=>{const n=e.customFields.find(e=>e.id===t);e.change(`${e.field}conditionValue`,n?.fieldType===Le.Select?[]:"")}}),(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(br,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("condition_n_1_11603",e.index+1)}),(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsxs)(Mm,{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)(br,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"arrow-right"})}),(0,i.jsxs)(br,{css:{flex:"1"},children:[n?.fieldType===Le.Checkbox&&(0,i.jsxs)(yj,{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===Le.Select&&(0,i.jsx)(Mm,{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)(br,{css:{paddingTop:"$6"},children:(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onRemove})})]})]})]})},hP=e=>{const{history:t,translate:n,params:{organizationId:s}}=cl();return 0===e.customFields.length?(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:n("vous_n_avez_pas_62142")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:n("pour_ajouter_de_74432")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(jl,{color:"white",onClick:()=>{t.push(Os.CUSTOM_FIELDS(s))},children:n("cr_eer_un_champ_08883")})]}):(0,i.jsxs)(Ra,{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,s)=>{const o=s===e.customFieldsValues.length-1,r=`${e.name}[${s}].`;return(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(uP,{change:e.change,customFieldValue:t,customFields:e.customFields,field:r,index:s,onRemove:()=>{e.change(e.name,e.customFieldsValues.filter((e,t)=>t!==s))}}),e.customFieldsValues.length>1&&!o?0===s?(0,i.jsx)(br,{css:{width:"fit-content"},children:(0,i.jsxs)(yj,{name:`${e.prefix}conditionsOperator`,children:[(0,i.jsx)("option",{value:me.And,children:n(me.And)}),(0,i.jsx)("option",{value:me.Or,children:n(me.Or)})]})}):(0,i.jsx)(br,{font:"gray800 textSm medium",children:n(e.conditionsOperator)}):null]},s)}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.name,[...e.customFieldsValues,{customFieldId:-1,conditionValue:""}])},children:n("ajouter_une_con_66324")})})]})},mP=()=>{const{translate:e}=cl();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Bm,{name:"accreditation.willAutoAccredit",subtext:e("si_la_case_est_44018"),children:e("autoriser_l_acc_50624")})})},gP=e=>{const{mutate:t}=function(e={}){return Kn("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)(wC,{initialName:"",isEdit:!1,mutate:async n=>(await t({eventId:e.eventId,accreditationCategory:{name:n}})).accreditationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},pP=e=>{const{mutate:t}=function(e={}){return Kn("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)(wC,{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})},fP=e=>{const{translate:t,params:{eventId:n}}=cl(),[s,o]=(0,M.useState)(!1),[r,a]=(0,M.useState)(AC(e.event.accreditationsCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rl,{label:t("nom_de_votre_ac_85997"),name:"accreditation.name"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Mm,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"accreditation.accreditationCategoryId",onCreateClick:()=>{o(!0)},children:r.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Rl,{label:(0,i.jsx)(_v,{children:t("Acronym")}),name:"accreditation.acronym"})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(_j,{label:t("Color"),name:"accreditation.color"}),(0,i.jsx)(Cj,{label:t("ic_ne_55554"),name:"accreditation.icon"})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Tv,{label:(0,i.jsx)(_v,{children:t("description_58935")}),name:"accreditation.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Bm,{name:"accreditation.weezeventIsSynchronized",children:t("WeezeventIsSynchronized")})]}),s&&(0,i.jsx)(gP,{eventId:n,onClose:()=>{o(!1)},onSuccess:t=>{a(AC([...r,t])),e.change("accreditation.accreditationCategoryId",t.id)}})]})},xP=e=>{const t=Hn(),[n,s]=M.useState(Bs.c9.invalid("Invalid")),[o,r]=M.useState(0),a=M.useMemo(()=>e.slots.map((e,t)=>({...e,index:t})),[e.slots]),l=M.useMemo(()=>{const t=Bs.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=M.useMemo(()=>l.slice(o,10+o),[o,l]),c=M.useMemo(()=>Math.ceil(l.length/10),[l]),u=M.useMemo(()=>l.length,[l]);return(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textMd medium",children:t("liste_de_vos_cr_37612")}),(0,i.jsx)(br,{width:200,children:(0,i.jsx)(Tu,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:e=>{s(e),r(0)}})})]}),(0,i.jsxs)(Ra,{css:{background:"$gray100",bd:!0,padding:"$6"},direction:"column",gap:"3",children:[d.map(t=>e.renderSlot(t)),(0,i.jsx)(Ec,{limit:10,numberOfPages:c,offset:o,setOffset:r,totalCount:u})]}),(0,i.jsxs)(br,{css:{cursor:"pointer"},font:"primary700 textSm medium",onClick:e.onNewSlot,children:["+ ",t("ajouter_un_cr_n_63607")]})]})},_P=e=>{const t=Hn(),{user:n}=ni();return(0,i.jsx)(Tj,{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)(Ra,{align:"center",gap:"3",wrap:"wrap",children:[(0,i.jsxs)(br,{children:[t("r_p_ter_pour_le_06048"),jt.Fr!==n?.language&&" "+t("prochain_e_s_04262")]}),(0,i.jsx)(br,{width:100,children:(0,i.jsx)(yj,{name:"value",shouldParseAsInt:!0,children:(0,wc.A)(1,31).map(e=>(0,i.jsx)("option",{value:e,children:e},e))})}),jt.Fr===n?.language&&(0,i.jsx)(br,{children:t("prochain_e_s_04262")}),(0,i.jsx)(br,{width:120,children:(0,i.jsxs)(yj,{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")})]})})]})})},IP=e=>{const t=Hn(),n=Gn(dP);return(0,i.jsx)(Tj,{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,yr.A)(t.slot,["id","name","date","maxResources"])),e.onClose()},children:({form:n})=>(0,i.jsxs)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Rl,{label:t("nom_du_cr_neau_54351"),name:"slot.name"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("MaxResources"),name:"slot.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Dm,{label:t("Date"),max:e.event.endAt,min:e.event.startAt,name:"slot.date",rightIcon:"xmark",onRightIconClick:()=>{n.change("slot.date",null)}})]})})},vP=e=>{const t=Hn(),n=Gn(Wc),s=(0,M.useMemo)(()=>m(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,M.useMemo)(()=>{const i=e.slot.date?.isValid?n.toLocaleString(e.slot.date,Zs.DateOnly.WeekdayLongMonthLong):"",s=e.slot.maxResources?t("_1_membre_maxi_51489",e.slot.maxResources):"";return(0,Va.A)([s,i]).join(" - ")||"-"},[e.slot.maxResources,e.slot.date]),[r,a]=(0,M.useState)(e.initialIsEditOpen),[l,d]=(0,M.useState)(!1),c=!e.slot.date?.isValid,u=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(br,{color:"gray500",children:o})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"clone",size:"sm",onClick:()=>{e.onDuplicate(e.slot)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("dupliquer_28256")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",disabled:c,leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",disabled:u,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(_m,{placement:"top",children:t(u?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(IP,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(_P,{showHours:!1,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},bP=e=>{const t=Hn(),n=Gn(dP),[s,o]=(0,M.useState)(-1),r=(0,M.useMemo)(()=>e.values.accreditation.slots.some(e=>e.date?.isValid),[e.values.accreditation]),a=(0,M.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,M.useCallback)((e,t)=>!!e.date?.isValid&&e.date.startOf("day")===t.startOf("day"),[]),d=(0,M.useCallback)(()=>{e.change("accreditation.slots",e.values.accreditation.slots.concat([n.accreditationsSlotInputDefault()])),o(e.values.accreditation.slots.length)},[e.values.accreditation.slots,e.change]),c=(0,M.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,M.useCallback)((t,n,i)=>{const s=function(e,t,n){if(e.date?.isValid)return(0,wc.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(s))},[e.values.accreditation.slots,e.change]),h=(0,M.useCallback)(t=>{e.change("accreditation.slots",oo(e.values.accreditation.slots,t))},[e.values.accreditation.slots,e.change]);return(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(xP,{event:e.event,matchDateFilter:l,renderSlot:t=>(0,i.jsx)(vP,{event:e.event,index:t.index,initialIsEditOpen:t.index===s,remove:h,slot:t,updateSlots:a,onDuplicate:c,onRepeat:u},t.index),slots:e.values.accreditation.slots,onNewSlot:d}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("type_d_affichag_09962")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("comment_souhait_62602")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Pv,{name:"accreditation.accreditationDisplay",value:te.List,children:t("afficher_sous_f_71276")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Pv,{name:"accreditation.accreditationDisplay",value:te.Radio,children:t("afficher_sous_f_61997")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Pv,{name:"accreditation.accreditationDisplay",value:te.Calendar,children:t("afficher_sous_f_15380")})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("blocage_de_l_ac_17590")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("est_ce_qu_il_y_67585")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(hc,{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)(Ba,{height:"2"}),(0,i.jsx)(hc,{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)(Ba,{height:"2"}),(0,i.jsxs)(Ra,{align:"center",css:{paddingLeft:"$6"},gap:"2",children:[(0,i.jsx)(br,{width:80,children:(0,i.jsx)(Rl,{min:0,name:"accreditation.numberOfDaysLimit",shouldParseAsInt:!0})}),(0,i.jsx)(br,{children:t("jours_avant_la_74918")})]})]})]})]})]})},jP=e=>(0,i.jsx)(Y_,{names:[`${e.prefix}latitude`,`${e.prefix}longitude`,`${e.prefix}zoom`],render:t=>(0,i.jsx)(Dr,{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})}),CP=e=>{const t=Hn();return(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("apparence_75510")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsxs)(yj,{label:t("fond_de_carte_43822"),name:`${e.name}layer`,children:[(0,i.jsx)("option",{value:Je.Google,children:"Plan"}),(0,i.jsx)("option",{value:Je.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:Je.IgnPlan,children:"IGN Plan"})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(yj,{label:(0,i.jsx)(_v,{children:t("niveau_de_zoom_39369")}),name:`${e.name}zoom`,shouldParseAsInt:!0,children:(0,wc.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)(Ba,{height:"6"}),(0,i.jsx)(Mm,{isSearchVisible:!0,label:(0,i.jsx)(_v,{children:t("trac_s_41454")}),multiple:!0,name:`${e.name}tracesIds`,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("localisation_38416")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Wj,{addressName:`${e.name}address`,label:(0,i.jsx)(_v,{children:t("Address")}),latitudeName:`${e.name}latitude`,longitudeName:`${e.name}longitude`}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Fm,{label:(0,i.jsx)(_v,{children:t("latitude_46176")}),name:`${e.name}latitude`}),(0,i.jsx)(Fm,{label:(0,i.jsx)(_v,{children:t("longitude_01695")}),name:`${e.name}longitude`})]})]}),(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(jP,{center:(n=e.center,"number"==typeof n?.latitude&&"number"==typeof n?.longitude?{latitude:n.latitude,longitude:n.longitude}:void 0),layer:e.layer,point:Tr(e.point),prefix:e.name,traces:e.traces.filter(t=>e.tracesIds.includes(t.id))})})]});var n},yP=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl(),{showNotification:r}=ib(),a=Gn(cP),l=Gn(Da),d=(0,M.useRef)(null),c=(0,M.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.accreditation.name):o("cr_ation_d_une_01473"),[e.isEdit,e.initialValues]);Td(c);const{areSlotsOpen:u,isLocalisationOpen:h,areConditionsOpen:g,areCustomFieldsOpen:p,isPrivateNoteOpen:f,areTagsOpen:x}=(0,M.useMemo)(()=>{const t=e.initialValues.accreditation;return{areSlotsOpen:e.isEdit&&eo(t.slots),isLocalisationOpen:e.isEdit&&(m(t.address)||"number"==typeof t.latitude||"number"==typeof t.longitude),areConditionsOpen:e.isEdit&&eo(t.accreditationsCustomFields),areCustomFieldsOpen:e.isEdit&&(eo(Object.keys(t.fields))||eo(t.formCustomFields)),isPrivateNoteOpen:e.isEdit&&m(t.privateNote),areTagsOpen:e.isEdit&&eo(t.tagsIds)}},[e.initialValues,e.isEdit]);return(0,i.jsx)(fl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(zm,{button:e.isEdit?(0,i.jsx)(jl,{isLoading:a,onClick:r,children:o("mettre_jour_l_92576")}):null,category:c,color:"dark",fallbackClosePath:Ji.ACCREDITATIONS({organizationId:n,eventId:s}),title:e.isEdit?e.initialValues.accreditation.name:o("nouvelle_accr_d_32707"),children:(0,i.jsxs)(Em,{ref:d,children:[(0,i.jsx)(hl,{}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,title:o("informations_su_35382"),children:(0,i.jsx)(fP,{change:t.change,event:e.event})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,subtitle:o("attribuer_autom_55909"),title:o("automatisation_47772"),children:(0,i.jsx)(mP,{})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:u,subtitle:o("ajouter_les_dif_76832"),title:o("cr_neaux_33401"),onToggle:e=>{e||t.change("accreditation.slots",[])},children:(0,i.jsx)(bP,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:h,subtitle:o("indiquez_la_loc_61935"),title:o("localisation_38416"),onToggle:n=>{n||(t.change("accreditation.layer",e.event.layer),t.change("accreditation.zoom",Er),t.change("accreditation.address",null),t.change("accreditation.latitude",null),t.change("accreditation.longitude",null))},children:(0,i.jsx)(CP,{center:null,layer:l.accreditation.layer,name:"accreditation.",point:l.accreditation,traces:[],tracesIds:[]})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:g,subtitle:o("ajoutez_des_con_94296"),title:o("conditions_77756"),onToggle:e=>{e||t.change("accreditation.accreditationsCustomFields",[])},children:(0,i.jsx)(hP,{change:t.change,conditionsOperator:l.accreditation.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.accreditation.accreditationsCustomFields,name:"accreditation.accreditationsCustomFields",prefix:"accreditation."})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:p,subtitle:o("ajouter_des_inf_14221"),title:o("champs_de_formu_64126"),onToggle:e=>{e||(t.change("accreditation.formCustomFields",[]),t.change("accreditation.fields",{}))},children:(0,i.jsx)(wD,{change:t.change,customFields:e.accreditationCustomFields,formCustomFields:e.formCustomFields,formCustomFieldsValues:l.accreditation.formCustomFields,prefix:"accreditation.",showFormCustomFields:!0})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:f,subtitle:o("ajoutez_une_not_89122"),title:o("note_priv_e_06303"),onToggle:e=>{e||t.change("accreditation.privateNote","")},children:(0,i.jsx)(Tv,{label:(0,i.jsx)(_v,{children:o("note_priv_e_06303")}),name:"accreditation.privateNote"})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:x,subtitle:o("ajouter_des_tag_77298"),title:o("tags_79499"),onToggle:e=>{e||t.change("accreditation.tagsIds",[])},children:(0,i.jsx)(Oj,{change:t.change,name:"accreditation.",organizationId:n,tags:e.tags,tagsIds:l.accreditation.tagsIds})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{isLoading:a,onClick:r,children:(0,i.jsx)(br,{textAlign:"center",children:e.isEdit?o("mettre_jour_l_92576"):o("cr_er_l_accr_di_16123")})})})]})}),validate:l.validateForForm(a.createUpdateAccreditationSchema()),width:1,onSubmit:async i=>{const a=await e.mutate({eventId:s,accreditation:{...i.accreditation,slots:i.accreditation.slots.map(e=>(0,rr.A)(e,["index"]))}});r(e.isEdit?o("l_accr_ditation_24401"):o("l_accr_ditation_25694")),e.isEdit?t.goBack(Ji.ACCREDITATION({organizationId:n,eventId:s,accreditationId:a})):t.replace(Ji.ACCREDITATION({organizationId:n,eventId:s,accreditationId:a}))}})},kP=()=>{const{organizationId:e,eventId:t,options:n}=Zn(),s=Gn(cP),{data:o,loader:r}=Yn("query AccreditationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(variety: Accreditation, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n }\n}\n",{organizationId:e,eventId:t},[Ms.ConditionsCustomFieldsFragment,Ms.FormCustomFieldsFragment,Ms.CreatePositionTagsFragment,Ms.AttachCustomFieldFragment,Ms.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return Kn("mutation AccreditationCreate($eventId: EventId!, $accreditation: AccreditationInput!) {\n accreditationCreate(eventId: $eventId, accreditation: $accreditation) {\n id\n }\n}\n",e)}(),l=m(n)?parseInt(n,10):null;return r||(0,i.jsx)(yP,{accreditationCustomFields:o.organization.accreditationCustomFields.nodes,conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,formCustomFields:o.organization.formCustomFields.nodes,initialValues:s.createUpdateAccreditationValuesDefault(o.event.layer,null,l),isEdit:!1,mutate:async e=>(await a(e)).accreditationCreate.id,tags:o.organization.tags.nodes})},AP=()=>{const{organizationId:e,eventId:t,accreditationId:n}=Zn(),s=Gn(cP),{data:o,loader:r}=Yn("query AccreditationToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(variety: Accreditation, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n\n accreditation(id: $accreditationId) {\n name\n accreditationCategoryId\n description\n privateNote\n acronym\n color\n icon\n weezeventIsSynchronized\n willAutoAccredit\n address\n latitude\n longitude\n zoom\n layer\n tagsIds\n accreditationDisplay\n numberOfDaysLimit\n conditionsOperator\n fields\n\n accreditationsCustomFields {\n customFieldId\n conditionValue\n }\n\n formCustomFields {\n id\n customFieldId\n isMandatory\n }\n\n slots {\n id\n name\n date\n maxResources\n assignedResources\n }\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationId:n},[Ms.ConditionsCustomFieldsFragment,Ms.FormCustomFieldsFragment,Ms.CreatePositionTagsFragment,Ms.AttachCustomFieldFragment,Ms.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return Kn("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)(yP,{accreditationCustomFields:o.organization.accreditationCustomFields.nodes,conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,formCustomFields:o.organization.formCustomFields.nodes,initialValues:s.createUpdateAccreditationValuesDefault(o.event.layer,o.event.accreditation,null),isEdit:!0,mutate:async e=>(await a({...e,accreditationId:n})).accreditationUpdate.id,tags:o.organization.tags.nodes})};var wP;!function(e){e.Acronym="acronym",e.Address="address",e.AutoAccredit="autoAccredit",e.Category="category",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Index="index",e.Latitude="latitude",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.Resources="resources",e.SlotDate="slotDate",e.SlotName="slotName",e.Tags="tags",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized"}(wP||(wP={}));let SP=class extends du{constructor(e,t,n){super(e,t,n)}getAccreditationsFilters(e,t){return(0,Va.A)([{slug:"name",name:this.t("nom_de_l_accr_d_11908"),category:this.t("accr_ditations_39450"),fieldType:Ve.Text,hideEmpty:!0},{slug:"accreditation",name:this.t("Accreditation"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:wP.Description,name:this.t("Description"),category:this.t("accr_ditations_39450"),fieldType:Ve.Text},{slug:wP.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("accr_ditations_39450"),fieldType:Ve.Text},eo(e.accreditationsCategories)?{slug:"accreditationCategory",name:this.t("cat_gorie_00291"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,values:e.accreditationsCategories,hideEmpty:!0}:null,{slug:"slotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("accr_ditations_39450"),fieldType:Ve.Text},{slug:"slotDate",name:this.t("Date"),category:this.t("accr_ditations_39450"),fieldType:Ve.Date},{slug:"tag",name:"Tag",category:this.t("accr_ditations_39450"),fieldType:Ve.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:Ct.Accreditations},{slug:"accreditationCustomField",name:this.t("condition_61066"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("accr_ditations_39450"),fieldType:Ve.Text},{slug:"color",name:this.t("Color"),category:this.t("accr_ditations_39450"),fieldType:Ve.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,values:mn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("accr_ditations_39450"),fieldType:Ve.Text},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("accr_ditations_39450"),fieldType:Ve.Number,hideEmpty:!0},{slug:wP.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("accr_ditations_39450"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:wP.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("accr_ditations_39450"),fieldType:Ve.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getAccreditationsPossibleColumns(e,t){const n=[{slug:wP.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:oe.Id,width:100},{slug:wP.Name,name:this.t("nom_de_l_accr_d_11908"),isSearchable:!0,isSortable:!0,sortAttribute:oe.Name,minWidth:240},{slug:wP.Category,name:this.t("nom_de_la_cat_g_03860"),isSearchable:!0,isSortable:!0,sortAttribute:oe.Category,minWidth:240},{slug:wP.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:240},{slug:wP.SlotDate,name:this.t("Date"),minWidth:180,isSortable:!0,sortAttribute:se.Date},{slug:wP.Resources,name:this.t("membres_11310"),minWidth:320},{slug:wP.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:wP.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:wP.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:wP.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:wP.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:wP.Acronym,name:this.t("Acronym"),isSearchable:!0,isSortable:!0,sortAttribute:oe.Acronym,minWidth:180},{slug:wP.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:wP.Icon,name:this.t("ic_ne_55554"),width:80},{slug:wP.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:wP.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:wP.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:wP.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:oe.CreatedAt,minWidth:180},{slug:wP.AutoAccredit,name:this.t("AutoAccredit"),minWidth:180},{slug:wP.Index,name:this.t("Index"),isSortable:!0,sortAttribute:oe.Index,width:200}];return e&&n.push({slug:wP.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:wP.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),n.concat(this.customFieldsToPossibleColumns(t))}};SP=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],SP);const EP=e=>{const{params:{eventId:t}}=cl(),{mutate:n}=yo(),s=M.useCallback(async i=>{const s=Qs(e.property);for(const o of s){const r=1===s.length?i:i[o];await n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.accreditationId]},slug:o,strategy:Qe.Replace,value:r}})}return!0},[e.accreditationId,e.property,n]);return(0,i.jsx)(ZC,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},TP=e=>{const{translate:t}=cl();return(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.acronym||"",property:ne.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.accreditation.acronym||""})},zP=M.createContext({}),OP=e=>{const t=KR(Mr,{eventId:e.eventId},e=>e.event.accreditationsCategories),n=KR(Mo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(zP.Provider,{value:{getAccreditationsCategories:t,getTags:n},children:e.children})};function RP(){return M.useContext(zP)}const $P=e=>{const t=Hn(),{getAccreditationsCategories:n}=RP(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("Category")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Au,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},DP=e=>{const{organizationId:t,eventId:n}=Zn(),{isEditMode:s}=HC(),o=e.accreditationCategory.name;return(0,i.jsx)(EP,{accreditationId:e.accreditationId,column:e.column,initialValue:e.accreditationCategory.id,property:ne.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)($P,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(h$,{isEditMode:s,title:o,updatable:!0,children:(0,i.jsx)(Vc,{to:Ji.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.accreditationCategory.id}),children:o})})})},PP=e=>{const{translate:t}=cl();return(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.color,property:ne.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(xj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ra,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{css:{background:e.accreditation.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{xS(e.accreditation.color)}})}),(0,i.jsx)(_m,{placement:"top",children:e.accreditation.color})]})})})};function FP(e,t,n){return t.fieldType===Le.Select?eo(n)?(0,Va.A)(n.map(e=>t.values.find(t=>t.id===e)?.value)).join(", "):"":e(!0===n?"true":"false")}const MP=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>e.accreditation.accreditationsCustomFields||[],[e.accreditation]),s=(0,M.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${FP(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:s})})},NP=e=>{const{translate:t}=cl();return(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.icon,property:ne.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(jj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ya,{icon:qa(e.accreditation.icon)})})},LP=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>({[ne.Color]:e.accreditation.color,[ne.Icon]:e.accreditation.icon}),[e.accreditation]);return(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:n,property:[ne.Color,ne.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Ra,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(xj,{label:t("Color"),value:e[ne.Color],onChange:t=>{n({...e,[ne.Color]:t})}}),(0,i.jsx)(jj,{label:t("Icon"),renderOnPortal:!0,value:e[ne.Icon],onChange:t=>{n({...e,[ne.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(pC,{color:e.accreditation.color,icon:e.accreditation.icon})})},BP=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{isEditMode:o}=HC(),r=e.accreditation.name;return(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.name,property:ne.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("nom_de_l_accr_d_11908"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(h$,{isEditMode:o,title:r,updatable:!0,children:(0,i.jsx)(Vc,{to:Ji.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.accreditation.id}),children:r})})})},VP=e=>{const{translate:t}=cl(),{getTags:n}=RP(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("tags_79499")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},UP=e=>{const t=(0,M.useMemo)(()=>e.accreditation.tags||[],[e.accreditation]),n=(0,M.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:t.map(e=>e.id),property:ne.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(VP,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ly,{badges:n})})},WP=e=>{const{translate:t,params:{eventId:n}}=cl(),s=Gn(Wc),{mutate:o}=Lr(),r=(0,M.useMemo)(()=>e.accreditationSlot.date?s.toLocaleString(e.accreditationSlot.date,Zs.DateOnly.WeekdayLongMonthLong):"-",[e.accreditationSlot]),a=(0,M.useMemo)(()=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date:Bs.c9.invalid("Invalid"),[e.accreditationSlot]);return(0,i.jsx)(ZC,{column:e.column,initialValue:a,mutate:async t=>o({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,yr.A)(e.accreditationSlot,["id","name","maxResources"]),date:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Tu,{label:t("Date"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(br,{color:"gray900",css:{ellipsis:!0,textTransform:"capitalize"},title:r,width:1,children:r}),updatable:!0})},GP=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{isEditMode:o}=HC(),{mutate:r}=Lr(),a=(0,M.useMemo)(()=>m(e.accreditationSlot.name)?e.accreditationSlot.name:"-",[e.accreditationSlot]);return(0,i.jsx)(ZC,{column:e.column,initialValue:e.accreditationSlot.name,mutate:async t=>r({eventId:s,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,yr.A)(e.accreditationSlot,["id","date","maxResources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(h$,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(Vc,{to:Ji.ACCREDITATION_SLOT({organizationId:n,eventId:s,accreditationId:e.accreditationSlot.accreditation.id,accreditationSlotId:e.accreditationSlot.id}),children:a})}),updatable:!0})},HP=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.accreditationSlot.weezeventChecklistId){const t=ag(e.weezeventOrganizationId,e.accreditationSlot.weezeventChecklistId);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Vc,{to:t,children:e.accreditationSlot.weezeventChecklistId})})}return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},qP=e=>{const{translate:t,params:{eventId:n}}=cl(),{isEventAdmin:s}=Jv(),{mutate:o}=Lr(),r=Gn(Mj),a=UC(e.customFields),l=(0,M.useCallback)(()=>{e.reloadAccreditationSlot(e.accreditationSlot.id)},[e.accreditationSlot,e.reloadAccreditationSlot]),[d,c]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(t=>{const n=a.get(t.slug);return t.slug===wP.Id?(0,i.jsx)(yc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.id},t.slug):t.slug===wP.Category?(0,i.jsx)(DP,{accreditationCategory:e.accreditationSlot.accreditationCategory,accreditationId:e.accreditationSlot.accreditation.id,column:t,reload:l},t.slug):t.slug===wP.Name?(0,i.jsx)(BP,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===wP.SlotName?e.accreditationSlot.isHidden?(0,i.jsx)(yc,{minWidth:t.minWidth,width:t.width,children:"-"},t.slug):(0,i.jsx)(GP,{accreditationSlot:e.accreditationSlot,column:t,reload:l},t.slug):t.slug===wP.SlotDate?e.accreditationSlot.isHidden?(0,i.jsx)(yc,{minWidth:t.minWidth,width:t.width,children:"-"},t.slug):(0,i.jsx)(WP,{accreditationSlot:e.accreditationSlot,column:t,reload:l},t.slug):t.slug===wP.Resources?(0,i.jsx)(yc,{minWidth:t.minWidth,width:t.width,children:(0,i.jsx)(o$,{assignedResources:e.accreditationSlot.assignedResources,resources:e.accreditationSlot.maxResources})},t.slug):t.slug===wP.Tags?(0,i.jsx)(UP,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===wP.Conditions?(0,i.jsx)(MP,{accreditation:e.accreditationSlot.accreditation,column:t},t.slug):t.slug===wP.Address?(0,i.jsx)(yc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.address},t.slug):t.slug===wP.Latitude?(0,i.jsx)(yc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.latitude},t.slug):t.slug===wP.Longitude?(0,i.jsx)(yc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.longitude},t.slug):t.slug===wP.Acronym?(0,i.jsx)(TP,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===wP.Color?(0,i.jsx)(PP,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===wP.Icon?(0,i.jsx)(NP,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===wP.IconColor?(0,i.jsx)(LP,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l}):t.slug===wP.FillingRate?(0,i.jsxs)(yc,{minWidth:t.minWidth,width:t.width,children:[e.accreditationSlot.fillingRate,"%"]},t.slug):t.slug===wP.CreatedBy?(0,i.jsx)(sR,{column:t,createdBy:e.accreditationSlot.accreditation.createdBy},t.slug):t.slug===wP.CreatedAt?(0,i.jsx)(iR,{column:t,insertedAt:e.accreditationSlot.insertedAt},t.slug):t.slug===wP.WeezeventChecklistId?(0,i.jsx)(HP,{accreditationSlot:e.accreditationSlot,column:t,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(yc,{minWidth:t.minWidth,width:t.width,children:n?r.getValueString(n,e.accreditationSlot.accreditation.fields,{fileReturnValue:"name"}):""},t.slug)}),s?e.accreditationSlot.isHidden?(0,i.jsx)(yc,{width:100}):(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",onClick:()=>{c(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]})}):null]}),d&&(0,i.jsx)(IP,{event:e.event,slot:e.accreditationSlot,onClose:()=>{c(!1)},onSuccess:async t=>{await o({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:t}),l()}})]})},YP=e=>{const{params:{eventId:t}}=cl(),{isEventAdmin:n}=Jv(),{columns:s,columnsSearch:o,limit:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,setLimit:h,setOffset:g,setSort:p,sort:f}=HC(),x=(0,M.useMemo)(()=>({includeConditions:s.includes(wP.Conditions),includeCreatedBy:s.includes(wP.CreatedBy),includeTags:s.includes(wP.Tags)}),[s]),{data:_,isLoading:I,reload:v}=Yn("query AccreditationsSlotsList(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSlotsSort\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n accreditationsSlots(\n name: $name\n predicates: $predicates\n includeHidden: true\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsAccreditationSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...x,eventId:t,name:m(a)?a:null,columnsSearch:eo(o)?o:null,predicates:c,limit:r,offset:l,sort:f},[Ms.AccreditationsAccreditationSlotFragment]);const b=(0,M.useMemo)(()=>s.flatMap(e=>(0,Va.A)([d.find(t=>t.slug===e)])),[d,s]),{numberOfPages:j,totalCount:C}=vu(_.event?.accreditationsSlots),[y,k]=(0,M.useState)([]),[A,w]=(0,M.useState)({}),S=(0,M.useCallback)(async e=>{w(t=>({...t,[e]:!0}));const{event:{accreditationSlot:n}}=await function(e,t){return co("query AccreditationsAccreditationSlot(\n $eventId: EventId!\n $id: AccreditationsSlotId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $id) {\n ...AccreditationsAccreditationSlot\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ms.AccreditationsAccreditationSlotFragment]})}({...x,eventId:t,id:e},await q());k(t=>t.map(t=>t.id===e?n:t)),w(t=>({...t,[e]:!1}))},[x,w,k]);return(0,M.useEffect)(()=>{k(_.event?.accreditationsSlots.nodes??[])},[_.event]),(0,M.useEffect)(()=>{u>1&&v()},[u]),(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":I,headerRow:(0,i.jsxs)(xc,{children:[b.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:r,numberOfPages:j,offset:l,setLimit:h,setOffset:g,showLimits:!0,totalCount:C})}),children:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):y.map(t=>A[t.id]?(0,i.jsx)(Mc,{},t.id):(0,i.jsx)(qP,{accreditationSlot:t,columns:b,customFields:e.customFields,event:_.event,reloadAccreditationSlot:S,weezeventOrganizationId:e.weezeventOrganizationId},t.id))})})},KP=()=>{const e=Hn(),{eventId:t,massActions:n,onMassEditSuccess:s,organizationId:o,predicates:r,segment:a}=HC(),{showNotification:l}=ib(),{mutate:d}=yo(),{mutate:c}=Nr(),[u,h]=(0,M.useState)(!1),[g,p]=(0,M.useState)(!1),f=n.getSelectedsInput(r,null),x=n.isAllSelected?a.count:n.numberOfSelected,_=(0,M.useCallback)(e=>{m(e)&&l(e),s()},[s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{onClick:()=>{h(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Vd,{placement:"bottom-end",children:(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:e("supprimer_43083")})})]}),u&&(0,i.jsx)(Uk,{eventId:t,mutate:e=>d({eventId:t,massEdit:e}),organizationId:o,selecteds:f,onClose:()=>{h(!1)},onSuccess:t=>{_(e("_1_accr_ditati_22872",t))}}),g&&(0,i.jsx)(Pk,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_31111")],text:e("suppression_de_42723",x),onClose:()=>{p(!1)},onDelete:async()=>{const n=(await c({eventId:t,selecteds:f})).numberOfAccreditations;_(e("_1_accr_ditati_88237",n))}})]})},ZP=e=>{const{params:{organizationId:t,eventId:n},translate:s}=cl(),{user:o}=ni(),{data:r,isLoading:a}=Yn("query AccreditationsHeader($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:n},[]),[l,d]=(0,M.useState)(!1),[c,u]=(0,M.useState)(!1),[h,m]=(0,M.useState)(!1);return(0,i.jsxs)(RR,{children:[(0,i.jsx)(Ib,{permissions:xb.ACCREDITATION_EDIT,children:(0,i.jsx)(jl,{to:Os.CREATE_ACCREDITATION(t,n),children:s("cr_er_une_accr_33475")})}),(0,i.jsx)(Ib,{permissions:xb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Pd,{isOpen:l,onStateChange:d,children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"plus",onClick:()=>{d(!1),m(!0)},children:s("cr_er_une_cat_g_20051")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{icon:"plug-circle-bolt",onClick:e=>{$d(e.target),u(!0)},children:s("exporter_via_l_09843")})]})]})}),h&&(0,i.jsx)(gP,{eventId:n,onClose:()=>{m(!1)},onSuccess:e.reload}),!a&&(0,i.jsx)(M$,{isOpen:c,link:og({organizationId:t,eventId:n,lang:o?.language,pathComponent:"accreditations",key:r.event.key}),onClose:()=>{u(!1)}})]})};function XP(){const{history:e,params:{organizationId:t,eventId:n}}=cl(),{mutate:i}=function(e={}){return Kn("mutation AccreditationDuplicate($eventId: EventId!, $accreditationId: AccreditationId!) {\n accreditationDuplicate(eventId: $eventId, accreditationId: $accreditationId) {\n id\n }\n}\n",e)}();return(0,M.useCallback)(async s=>{const{accreditationDuplicate:o}=await i({eventId:n,accreditationId:s});e.push(Os.EDIT_ACCREDITATION(t,n,o.id))},[t,n,i])}const JP=e=>{const{translate:t,params:{eventId:n}}=cl(),{showNotification:s}=ib(),{mutate:o}=Nr();return(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:(0,Va.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 o({eventId:n,selecteds:{ids:[e.accreditation.id]}}),s(t("l_accr_ditation_25253",e.accreditation.name)),e.onSuccess()}})},QP=e=>{const t=Hn(),n=XP(),[s,o]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",to:Os.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id),children:t("_diter_62574")}),(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>{await n(e.accreditation.id)},children:t("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{o(!0),$d(e.target)},children:t("supprimer_43083")})]}),s&&(0,i.jsx)(JP,{accreditation:e.accreditation,onClose:()=>{o(!1)},onSuccess:e.reload})]})},eF=e=>{const{translate:t}=cl();return(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.willAutoAccredit,property:ne.AutoAccredit,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(dc,{state:e?"checked":"unchecked",onClick:e=>{n("checked"===e)},children:t("AutoAccredit")}),renderValue:e.accreditation.willAutoAccredit?t("oui_54361"):t("non_33516")})},tF=e=>(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.index??0,property:ne.Index,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Ol,{min:1,shouldParseAsInt:!0,value:e,onChange:t}),renderValue:e.accreditation.index?.toString(10)??"-"}),nF=e=>{const{translate:t}=cl();return(0,i.jsx)(EP,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.weezeventIsSynchronized,property:ne.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Au,{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")})},iF=e=>{const{mutate:t}=yo(),n=(0,M.useCallback)((n,i)=>t({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:Qe.Replace,value:n}}),[e.row,t]);return e.column.slug===wP.Id?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===wP.Category?(0,i.jsx)(DP,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.id,column:e.column,reload:e.reloadRow}):e.column.slug===wP.Name?(0,i.jsx)(BP,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===wP.SlotName||e.column.slug===wP.SlotDate?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===wP.Resources?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(o$,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===wP.Tags?(0,i.jsx)(UP,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===wP.Conditions?(0,i.jsx)(MP,{accreditation:e.row,column:e.column}):e.column.slug===wP.Address?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===wP.Latitude?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===wP.Longitude?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):e.column.slug===wP.Acronym?(0,i.jsx)(TP,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===wP.Color?(0,i.jsx)(PP,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===wP.Icon?(0,i.jsx)(NP,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===wP.IconColor?(0,i.jsx)(LP,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===wP.FillingRate?(0,i.jsxs)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===wP.CreatedBy?(0,i.jsx)(sR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===wP.AutoAccredit?(0,i.jsx)(eF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===wP.WeezeventIsSynchronized?(0,i.jsx)(nF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===wP.WeezeventChecklistId?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===wP.CreatedAt?(0,i.jsx)(iR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===wP.Index?(0,i.jsx)(tF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):(0,i.jsx)(my,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:n,reload:e.reloadRow,updatable:!0})},sF=e=>{const t=Hn(),{canAccreditationEdit:n}=lS(),s=UC(e.customFields),o=(0,M.useCallback)(()=>{e.reloadAccreditation(e.accreditation.id)},[e.accreditation,e.reloadAccreditation]);return(0,i.jsxs)(Tc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{$d(e.target)},children:[n&&(0,i.jsx)(yc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:e.state,onClick:t=>e.toggleRow(`a${e.accreditation.id}`,t)})}),e.columns.map(t=>{const n=s.get(t.slug);return(0,i.jsx)(iF,{column:t,customField:n,eventId:e.eventId,reloadRow:o,row:e.accreditation},t.slug)}),n&&(0,i.jsxs)(Uc,{justify:"center",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",to:Os.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id)})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(QP,{accreditation:e.accreditation,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})]})},oF=e=>{const{params:{organizationId:t,eventId:n}}=cl(),{canAccreditationEdit:s}=lS(),{columns:o,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:x,sort:_}=HC(),I=(0,M.useMemo)(()=>({includeConditions:o.includes(wP.Conditions),includeCreatedBy:o.includes(wP.CreatedBy),includeTags:o.includes(wP.Tags)}),[o]),{data:v,isLoading:b,reload:j}=Yn("query Accreditations(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSort\n $columnsSearch: [String!]\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n rows: accreditations(\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsAccreditation\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...I,eventId:n,name:m(d)?d:void 0,columnsSearch:eo(r)?r:void 0,predicates:h,limit:a,offset:c,sort:_},[Ms.AccreditationsAccreditationFragment]);const C=(0,M.useMemo)(()=>o.flatMap(e=>(0,Va.A)([u.find(t=>t.slug===e)])),[u,o]),{numberOfPages:y,totalCount:k}=vu(v.data?.rows),[A,w]=(0,M.useState)([]),[S,E]=(0,M.useState)({}),T=(0,M.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:t}}=await function(e,t){return co("query AccreditationsAccreditation(\n $eventId: EventId!\n $id: AccreditationId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: accreditation(id: $id) {\n ...AccreditationsAccreditation\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ms.AccreditationsAccreditationFragment]})}({...I,eventId:n,id:e},await q());w(n=>n.map(n=>n.id===e?t:n)),E(t=>({...t,[e]:!1}))},[I,E,w]);return(0,M.useEffect)(()=>{w(v.data?.rows.nodes??[])},[v.data]),(0,M.useEffect)(()=>{g>1&&j()},[g]),(0,M.useEffect)(()=>{l.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(e=>[`a${e.id}`,{id:e.id,state:"unchecked"}])))},[v.data,l.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":b,headerRow:(0,i.jsxs)(xc,{children:[s&&(0,i.jsx)(Fc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:l.selectAllState,onClick:l.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:_,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),s&&(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:a,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):A.map(s=>S[s.id]?(0,i.jsx)(Mc,{},s.id):(0,i.jsx)(sF,{accreditation:s,columns:C,customFields:e.customFields,eventId:n,organizationId:t,reload:j,reloadAccreditation:T,state:l.states[`a${s.id}`]?.state??"unchecked",toggleRow:l.toggleRow},s.id))})})})},rF=e=>{const t=Hn(),{canAccreditationEdit:n,canSegmentEdit:s}=lS(),{limit:o,reloadKey:r,rendering:a,segment:l,setReloadKey:d}=HC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ZP,{reload:()=>{d(r+1)}}),0===e.numberOfAccreditations?(0,i.jsx)(Ob,{css:{overflow:"hidden"},children:(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(xk,{subtitle:"",title:t("vous_n_avez_pas_53408")})})}):(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{actions:(0,i.jsx)(KP,{}),searchPlaceholder:t("rechercher_une_65646"),showActions:n,showEditColumns:s,showEditMode:n,showSearchColumns:s}),selectSegment:(0,i.jsx)(QR,{pageSelectedText:t("les_1_accr_di_60244",o),segmentSelectedText:t("les_1_accr_di_20650",l.count,l.name)})}),a===Oh.SlotsList?(0,i.jsx)(YP,{customFields:e.customFields,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(oF,{customFields:e.customFields})]})]})},aF=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=cl(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=Jv(),c=Gn(SP),u=(0,M.useMemo)(()=>e.organization?.customFields.nodes??[],[e.organization]),h=(0,M.useMemo)(()=>c.getAccreditationsFilters(e.event,u),[u,e.event]),m=(0,M.useMemo)(()=>c.getAccreditationsPossibleColumns(e.event.isWeezeventConnected,u),[u,e.event]);return(0,i.jsx)(OP,{eventId:o,organizationId:s,children:(0,i.jsx)(wR,{canEditSegments:a(xb.SEGMENT_EDIT),eventId:o,filters:h,filtersButtonText:n("filtrer_les_acc_57840"),filtersSubtitle:n("appliquer_des_f_18351"),getSegmentPath:e=>Os.ACCREDITATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfAccreditations,initialLimit:l?.accreditationsLimit??kc,initialSegmentsOpen:l?.areAccreditationsSegmentsOpen??!0,organizationId:s,possibleColumns:m,possibleRenderings:[Oh.List,Oh.SlotsList],reload:e.reload,segmentId:r,segmentType:_t.Accreditations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({accreditationsLimit:e})},onSegmentClick:e=>{d({accreditationsSegmentId:e})},onSegmentDelete:async()=>{await d({accreditationsSegmentId:null}),t.replace(Ji.ACCREDITATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({areAccreditationsSegmentsOpen:e})},children:(0,i.jsx)(rF,{customFields:u,numberOfAccreditations:e.event.numberOfAccreditations,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},lF=()=>{const{params:{organizationId:e,eventId:t},translate:n}=cl(),{event:{name:s},localEvent:o}=Jv();Td(`${s} ${n("accr_ditations_39450")}`);const{data:r,loader:a,reload:l}=Yn("query AccreditationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(variety: Accreditation) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n numberOfAccreditations\n isWeezeventConnected\n\n accreditationsCategories {\n id\n name\n }\n\n segmentsFolders(segmentType: Accreditations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Ms.SegmentCustomFieldFragment,Ms.SegmentsFoldersSegmentsFragment]),d=(0,M.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.ACCREDITATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(aF,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.ACCREDITATIONS_SEGMENT(e,t,o?.accreditationsSegmentId&&d.includes(o.accreditationsSegmentId)?o?.accreditationsSegmentId:d[0]),replace:!0})})]})},dF=()=>{const{hasFeature:e}=_I();return e(Fe.Accreditation)?(0,i.jsx)(lF,{}):(0,i.jsx)(Ra,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(II,{icon:"badge-check"})})},cF=({accreditation:e})=>{const{history:t,params:{organizationId:n,eventId:s,accreditationId:o},translate:r}=cl(),a=XP(),[l,d]=(0,M.useState)(!1);return(0,i.jsxs)(Rb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Qb,{returnPathFallback:Ji.ACCREDITATIONS({organizationId:n,eventId:s})}),(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:tC(e)}),(0,i.jsx)(Ib,{permissions:xb.ACCREDITATION_EDIT,children:(0,i.jsx)(jl,{to:Os.EDIT_ACCREDITATION(n,s,o),children:r("_diter_l_accr_d_26424")})}),(0,i.jsx)(Ib,{permissions:xb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>await a(e.id),children:r("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{$d(e.target),d(!0)},children:r("supprimer_43083")})]})]})}),l&&(0,i.jsx)(JP,{accreditation:e,onClose:()=>d(!1),onSuccess:()=>t.replace(Ji.ACCREDITATIONS({organizationId:n,eventId:s}))})]})},uF=e=>(0,i.jsx)(Uu,{color:e.color,css:{display:"none","@tablet":{display:"block"},...e.css},direction:e.direction}),hF=hr("dt",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular",gridColumn:1}}),mF=({children:e,...t})=>(0,i.jsx)(hF,{...t,children:e}),gF=hr("dd",{color:"$gray500",marginInline:0,"@tablet":{color:"$gray800",gridColumn:2}}),pF=({children:e,...t})=>(0,i.jsx)(gF,{...t,children:e}),fF=hr("div",{display:"grid",gridTemplateColumns:"auto",rowGap:"$1","@tablet":{columnGap:"$3",gridTemplateColumns:"auto auto",justifyContent:"space-between"}}),xF=({children:e,...t})=>(0,i.jsx)(fF,{...t,children:e}),_F=hr("dl",{display:"flex",flexDirection:"column",gap:"$4",marginBlock:0,marginInline:0}),IF=({children:e,...t})=>(0,i.jsx)(_F,{...t,children:e}),vF=({accreditationCategoryId:e,accreditationCategoryName:t,accreditationName:n,color:s,customFields:o,fields:r,icon:a})=>{const{params:{organizationId:l,eventId:d,accreditationId:c},translate:u}=cl();return(0,i.jsx)(tw,{css:{flex:"2 1"},title:u("param_tres_78420"),children:(0,i.jsx)(Ra,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(IF,{children:[(0,i.jsxs)(xF,{children:[(0,i.jsx)(mF,{children:u("cat_gorie_00291")}),(0,i.jsx)(pF,{children:(0,i.jsx)(Vc,{to:Ji.ACCREDITATION_CATEGORY({organizationId:l,eventId:d,accreditationCategoryId:e}),children:t})})]}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(uF,{direction:"horizontal"}),(0,i.jsxs)(xF,{children:[(0,i.jsx)(mF,{children:u("Accreditation")}),(0,i.jsx)(pF,{children:(0,i.jsx)(Vc,{to:Ji.ACCREDITATION({organizationId:l,eventId:d,accreditationId:c}),children:n})})]})]}),(0,i.jsx)(uF,{direction:"horizontal"}),(0,i.jsxs)(xF,{children:[(0,i.jsx)(mF,{children:u("Color")}),(0,i.jsx)(pF,{children:(0,i.jsx)(br,{css:{background:s,borderRadius:"20px",height:"20px",width:"20px"}})})]}),(0,i.jsx)(uF,{direction:"horizontal"}),(0,i.jsxs)(xF,{children:[(0,i.jsx)(mF,{children:u("ic_ne_55554")}),(0,i.jsx)(pF,{children:(0,i.jsx)(Ya,{icon:qa(a)})})]}),o.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Ra,{justify:"end",width:300,children:(0,i.jsx)(JA,{field:e,fields:r})})]})]},e.slug))]})})})},bF=hr("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),jF=hr("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),CF=({customFields:e})=>{const t=jc(),n=Hn();return(0,i.jsx)(tw,{title:n("conditions_77756"),children:eo(e)?e.map(({customField:e,conditionValue:s},o)=>(0,i.jsxs)(M.Fragment,{children:[0!==o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"4"}),!t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ba,{height:"4"})]})]}),(0,i.jsx)(bF,{children:e.name}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(jF,{children:FP(n,e,s)})]},o)):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:n("aucune_conditio_36491")})})},yF=({assignedResources:e,maxResources:t})=>{const n=Hn();return(0,i.jsx)(tw,{css:{flex:"1 1"},title:n("limite_de_membr_42978"),children:(0,i.jsx)(Ra,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:(0,i.jsx)(br,{css:{margin:"auto"},children:(0,i.jsx)(rw,{count:e,total:t??1/0})})})})},kF=({location:e,location:{zoom:t,layer:n,traces:s,address:o}})=>{const r=Hn(),a=kh(e);return(0,i.jsx)(tw,{css:{border:a&&!Ch?"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:[yh(e)&&(0,i.jsx)(br,{height:380,width:1,children:(0,i.jsx)(Dr,{initialZoom:t,layer:n,point:Tr(e),traces:s})}),Ch(e)&&(0,i.jsx)(br,{color:"gray800",css:{padding:"$4","@tablet":{padding:"$7"}},children:o})]}):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:r("aucune_localisa_78216")})})},AF=()=>{const{params:{eventId:e,accreditationId:t}}=cl(),{data:n,loader:s}=Yn("query AccreditationChart($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n ...AccreditationChart\n }\n }\n}\n",{eventId:e,accreditationId:t},[Ms.AccreditationChartFragment]);return s||(0,i.jsx)(tw,{title:"Reporting",children:(0,i.jsx)(br,{height:380,width:1,children:(0,i.jsx)(zw,{accreditation:n.event.accreditation,slots:n.event.accreditation.slots})})})},wF="both",SF="delegationAccreditation",EF="slot",TF=({limitSource:e})=>{const t=Hn();return e===SF?(0,i.jsx)(Ya,{icon:"people-group",title:t("limite_fix_e_po_87265")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{icon:"badge-check",title:t("limite_fix_e_po_40573")}),e===wF&&(0,i.jsxs)(i.Fragment,{children:[" + ",(0,i.jsx)(TF,{limitSource:SF})]})]})},zF=(e,t)=>{const n=t?.assignedResources??0,s=t?.wishedResources??0,o=t?.maxResources??1/0,r=e?.assignedResources??0,a=e?.wishedResources??0,l=e?.maxResources??1/0,d=r>=l||n>=o,c=o-n,u=o-s,h=l-r,m=l-a,g=c===h?wF:c{const{history:s,params:{organizationId:o,eventId:r,accreditationId:a},translate:l}=cl(),d=Gn(Wc),c=Gn(iA),{assignedResources:u,maxResources:h,percent:g}=zF(void 0,t),{mutate:p}=Lr(),{mutate:f}=function(e={}){return Kn("mutation AccreditationSlotDelete($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n accreditationSlotDelete(eventId: $eventId, accreditationSlotId: $accreditationSlotId) {\n id\n }\n}\n",e)}(),[x,_]=(0,M.useState)(!1),[I,v]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>s.push(Ji.ACCREDITATION_SLOT({organizationId:o,eventId:r,accreditationId:a,accreditationSlotId:t.id})),children:[(0,i.jsx)(yc,{children:(0,i.jsx)(br,{font:"gray900 textSm medium",children:m(t.name)?t.name:"-"})}),(0,i.jsx)(yc,{children:t.date?d.toLocaleString(t.date,Zs.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(br,{children:l("_1_2_membres_04485",u,c.toNumberOrInfinity(h))}),h&&(0,i.jsx)(ow,{percent:g})]})}),(0,i.jsx)(Uc,{justify:"end",children:(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{_(!0)},children:l("_diter_62574")}),(0,i.jsx)(Ld,{color:t.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{v(!0)},children:l("supprimer_43083")})]})})]}),x&&(0,i.jsx)(IP,{event:e,slot:t,onClose:()=>{_(!1)},onSuccess:async e=>{await p({eventId:r,accreditationSlotId:t.id,accreditationSlot:e}),n()}}),I&&(0,i.jsx)(Pk,{buttonText:l("supprimer_43083"),subtext:[l("_tes_vous_s_r_d_48876")],text:l("suppression_de_73669",wh(d,t,"")),onClose:()=>{v(!1)},onDelete:async()=>{await f({eventId:r,accreditationSlotId:t.id}),n()}})]})},RF=()=>{const{translate:e,params:{eventId:t,accreditationId:n}}=cl(),[s,o,r]=Pc(""),[a,l]=WT("accreditation.slots.date",Bs.c9.invalid("Invalid"),um),[d,c]=(0,M.useState)(0),[u,h]=WT("accreditation.slots.sort",null),{data:g,isLoading:p,reload:f}=Yn("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:m(o)?o:void 0,date:a?.isValid?a:void 0,offset:d,sort:u},[]);const{numberOfPages:x,totalCount:_}=vu(g.event?.accreditationsSlots),I=(0,M.useCallback)(e=>{h(e),c(0)},[h,c]);return(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(br,{width:200,children:(0,i.jsx)(Tu,{max:g.event?.endAt,min:g.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mm,{attribute:se.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(mm,{attribute:se.Date,setSort:I,sort:u,children:e("Date")}),(0,i.jsx)(Fc,{children:e("remplissage_75916")}),(0,i.jsx)(Fc,{width:100})]}),numberOfPages:x,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):g.event.accreditationsSlots.nodes.map(e=>(0,i.jsx)(OF,{event:g.event,reload:f,slot:e},e.id)),setOffset:c,title:e("liste_des_cr_ne_66393"),totalCount:_})},$F=()=>{const{organizationId:e,eventId:t,accreditationId:n}=Zn(),{isEventAdmin:s}=Jv(),{data:o,loader:r,reload:a}=Yn("query AccreditationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n description\n privateNote\n acronym\n icon\n color\n address\n latitude\n longitude\n layer\n zoom\n assignedResources\n maxResources\n hasSlots\n hiddenSlotId\n fields\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n tags {\n id\n name\n }\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationId:n},[Ms.CustomFieldWithConditionFragment]),{mutate:l}=yo();return r||(0,i.jsx)(Ob,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsx)(AF,{}),o.event.accreditation.hasSlots&&(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(RF,{})}),(0,i.jsxs)(Ra,{gap:"6",width:1,children:[!o.event.accreditation.hasSlots&&(0,i.jsx)(yF,{assignedResources:o.event.accreditation.assignedResources,maxResources:o.event.accreditation.maxResources}),(0,i.jsx)(vF,{accreditationCategoryId:o.event.accreditation.accreditationCategory.id,accreditationCategoryName:o.event.accreditation.accreditationCategory.name,color:o.event.accreditation.color,customFields:o.organization.customFields.nodes,fields:o.event.accreditation.fields,icon:o.event.accreditation.icon})]}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(CF,{customFields:o.event.accreditation.accreditationsCustomFields}),(0,i.jsx)(pw,{...s?{associateTags:e=>l({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:ne.Tag,strategy:Qe.Replace,value:e}}),reload:a}:{},tags:o.event.accreditation.tags}),(0,i.jsx)(uw,{privateNote:o.event.accreditation.privateNote})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(cw,{description:o.event.accreditation.description}),(0,i.jsx)(kF,{location:o.event.accreditation})]})]})]})})},DF=e=>{const{translate:t}=cl(),{user:n}=ni(),{data:s}=Yn("query MassDocumentExportCustomDocuments($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n name\n slug\n }\n }\n}\n",{eventId:e.eventId},[]);const{mutate:o}=Ro(),[r,a]=(0,M.useState)(we.Assignments),[l,d]=(0,M.useState)(Bs.c9.invalid("Invalid")),[c,u]=(0,M.useState)(!1),[h,m]=(0,M.useState)(!1),g=(0,M.useMemo)(()=>(0,ch.A)(s.event?.customDocuments??[],e=>e.slug),[s.event]),p=r===we.Assignments||r===we.UserHours||r===we.UserPlanning||r===we.UserPlanningList;return(0,i.jsx)(ub,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"file",children:t("exporter_un_doc_23130")}),(0,i.jsxs)(lb,{gap:"5",children:[(0,i.jsx)(Ja,{color:"gray",leftIcon:"circle-exclamation",children:t("l_e_mail_peut_m_13253")}),(0,i.jsxs)(fc,{isSearchVisible:!0,label:t("quel_document_v_81798"),renderOnPortal:!0,values:[r],onChange:e=>{eo(e)&&a(e[0])},children:[g.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),(0,i.jsx)("option",{value:we.Assignments,children:t("fiche_d_affecta_91461")}),(0,i.jsx)("option",{value:we.UserPlanning,children:t("UserPlanning")}),(0,i.jsx)("option",{value:we.UserPlanningList,children:t("UserPlanningList")}),(0,i.jsx)("option",{value:we.UserPlanningDays,children:t("UserPlanningDays")}),(0,i.jsx)("option",{value:we.Certificate,children:t("Certificate")}),(0,i.jsx)("option",{value:we.UserHours,children:t("UserHours")})]}),p&&(0,i.jsx)(Tu,{label:t("exportez_vos_do_87332"),value:l,onChange:d}),(0,i.jsx)(dc,{state:c?"checked":"unchecked",onClick:e=>{u("checked"===e)},children:t("fusionner_les_d_64130")})]}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{isLoading:h,onClick:async()=>{m(!0);const t=g.map(e=>e.slug),i=t.includes(r)?we.UserCustomDocument:r,s=t.includes(r)?r:void 0;await o({eventId:e.eventId,documentsExport:{documentType:i,customDocumentSlug:s,segmentsIds:e.selecteds.segmentId?[e.selecteds.segmentId]:[],ids:e.selecteds.ids,language:n.language,oneFile:c,date:l}}),e.onSuccess(),e.onClose()},children:t("exporter_59120")})})]})})},PF=e=>{const t=Hn(),{mutate:n,isLoading:s}=qo(),[o,r]=(0,M.useState)(re.WaitingAccreditation);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",children:t("mettre_jour_l_44471")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Au,{label:t("nouveau_statut_57871"),value:o,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:re.NotApplicable,children:t(re.NotApplicable)}),(0,i.jsx)("option",{value:re.Refused,children:t(re.Refused)}),(0,i.jsx)("option",{value:re.WaitingAccreditation,children:t(re.WaitingAccreditation)})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:s,onClick:async()=>{const i=(await n({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(t("le_statut_d_acc_85658",i,t(o))),e.onClose()},children:t("modifier_le_sta_94473")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let FF=class extends Pl{translationService;constructor(e){super(e),this.translationService=e}massAssignStep1Schema(){return d.Ik().shape({massAssign:d.Ik().shape({...this.massAssignStep1Fields()})})}massAssignStep2Schema(){return d.Ik().shape({massAssign:d.Ik().shape({...this.massAssignStep2Fields()})})}massAssignSchema(){return d.Ik().shape({...this.massAssignStep1Fields(),...this.massAssignStep2Fields()})}massAssignStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(_n,this.t("la_strat_gie_es_82287"))}}massAssignStep2Fields(){return{positionsSlotsIds:d.YO().of(d.ai()).required(this.t("vous_devez_s_le_28976")).min(1,this.t("vous_devez_s_le_28976"))}}};FF=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],FF);const MF=e=>{const t=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massAssign.strategy",value:Qe.Add,children:t("ajouter_des_aff_57793")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massAssign.strategy",value:Qe.Replace,children:t("remplacer_les_a_43030")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massAssign.strategy",value:Qe.Delete,children:t("supprimer_des_a_59880")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:e.handleSubmit,children:t("suivant_affec_68075")})})]})},NF=e=>{const t=Hn(),n=Gn(ah),s=e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Tc,{css:{cursor:"pointer"},onClick:()=>{e.change("massAssign.positionsSlotsIds",no(e.positionsSlotsIds,e.slot.id,"unchecked"===s))},children:[(0,i.jsx)(yc,{justify:"center",width:48,children:(0,i.jsx)(lc,{shouldPreventDefault:!1,state:s,onClick:Hl.A})}),(0,i.jsx)(yc,{css:{textTransform:"capitalize"},children:n.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})}),(0,i.jsx)(yc,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(yc,{children:(0,i.jsx)(Jd,{color:e.slot.assignedResources>=e.slot.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,e.slot.resources)})})]})},LF=e=>{const t=Hn(),n=(0,M.useMemo)(()=>(0,ic.A)(e.slots.filter(t=>t.position.id===e.position.id),e=>e.range.start.toMillis()),[e.slots,e.position]),s=(0,M.useMemo)(()=>n.map(e=>e.id),[n]),o=(0,M.useMemo)(()=>{const t=(0,lh.A)(e.positionsSlotsIds,s);return t.length===s.length?"checked":0===t.length?"unchecked":"indeterminate"},[s,e.positionsSlotsIds]);return(0,i.jsx)(fC,{accreditation:e.position,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:(0,i.jsxs)(vc,{hideBorder:!0,children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:o,onClick:t=>{"checked"===t?e.change("massAssign.positionsSlotsIds",(0,Fs.A)(e.positionsSlotsIds.concat(s))):e.change("massAssign.positionsSlotsIds",(0,oc.A)(e.positionsSlotsIds,s))}})}),(0,i.jsx)(Fc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Fc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Fc,{})]}),n.map(t=>(0,i.jsx)(NF,{change:e.change,positionsSlotsIds:e.positionsSlotsIds,slot:t},t.id))]})})},BF=e=>{const t=(0,M.useMemo)(()=>(0,ic.A)(e.positions.filter(t=>t.positionCategoryId===e.category.id),e=>e.name.toLowerCase()),[e.category,e.positions]);return(0,i.jsx)(mC,{category:e.category,children:t.map(t=>(0,i.jsx)(LF,{change:e.change,position:t,positionsSlotsIds:e.positionsSlotsIds,slots:e.slots},t.id))})},VF=e=>{const t=Hn(),[n,s]=(0,M.useState)(!1),[o,r]=(0,M.useState)(e.segmentId),[a,l]=(0,M.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,M.useState)(e.excludePast?"checked":"unchecked"),[u,h]=(0,M.useState)(e.filterAvailabilities?"checked":"unchecked"),[m,g]=(0,M.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)(Ra,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(eC,{apply:()=>{e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),e.setFilterAvailabilities("checked"===u),e.setFilterWished("checked"===m),e.setSegmentId(o),s(!1)},color:"white",isOpen:n,numberOfAppliedFilters:p,reinit:()=>{e.setExcludeFull(!1),l("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setFilterAvailabilities(!1),h("unchecked"),e.setFilterWished(!1),g("unchecked"),e.setSegmentId(-1),r(-1),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsxs)(Au,{label:"Vues personnalisées",shouldParseAsInt:!0,value:o,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)(dc,{state:a,onClick:l,children:t("masquer_les_cr_14425")}),(0,i.jsx)(dc,{state:d,onClick:c,children:t("masquer_les_cr_05336")}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(br,{font:"gray900 textSm medium",children:t("filtres_sur_les_73833")}),(0,i.jsx)(dc,{state:u,onClick:h,children:t("filtrer_selon_l_74774")}),(0,i.jsx)(dc,{state:m,onClick:g,children:t("filtrer_selon_l_76350")})]})]})},UF=e=>{const t=Hn(),[n,s,o]=Pc(""),[r,a]=WT("massAssign.filters.segmentId",-1),[l,d]=WT("massAssign.filters.excludeFull",!1),[c,u]=WT("massAssign.filters.excludePast",!1),[h,g]=WT("massAssign.filters.filterAvailabilities",!1),[p,f]=WT("massAssign.filters.filterWished",!1),{data:x,loader:_}=Yn("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:m(s)?s:void 0,segmentId:-1===r?void 0:r,excludeFull:l,excludePast:c,selecteds:e.selecteds,filterAvailabilities:h,filterWished:p},[]);const I=(0,M.useMemo)(()=>(0,ic.A)((0,ch.A)((x.event?.positionsSlots.nodes??[]).map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[x.event]),v=(0,M.useMemo)(()=>(0,ch.A)((x.event?.positionsSlots.nodes??[]).map(e=>e.position),e=>e.id),[x.event]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(VF,{excludeFull:l,excludePast:c,filterAvailabilities:h,filterWished:p,name:n,segmentId:r,segments:x.event?.segments??[],setExcludeFull:e=>{d(e)},setExcludePast:u,setFilterAvailabilities:g,setFilterWished:f,setName:o,setSegmentId:e=>{a(e)}}),(0,i.jsx)(Ba,{height:"6"}),_||(0,i.jsx)(hC,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:I.map(t=>(0,i.jsx)(BF,{category:t,change:e.change,positions:v,positionsSlotsIds:e.values.massAssign.positionsSlotsIds,slots:x.event?.positionsSlots.nodes??[]},t.id))}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("affecter_les_1_56142",e.numberOfSelected)})})]})},WF=e=>{const t=Hn(),n=Gn(FF),{mutate:s}=Yo();return(0,i.jsx)(Kk,{children:(0,i.jsx)(zm,{category:t("affectation"),title:t("affecter_les_me_77160"),onClose:e.onClose,children:(0,i.jsx)(Em,{children:(0,i.jsxs)(Bv,{initialValues:{massAssign:{selecteds:e.selecteds,strategy:Qe.Add,positionsSlotsIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await s({eventId:e.eventId,massAssign:n.massAssign})).numberOfMembers;e.onSuccess(t("_1_membres_ont_14333",i)),e.onClose()},children:[(0,i.jsx)(Lv,{render:({handleSubmit:e})=>(0,i.jsx)(MF,{handleSubmit:e}),schema:n.massAssignStep1Schema(),title:t("initialisation_38640")}),(0,i.jsx)(Lv,{render:t=>(0,i.jsx)(UF,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,selecteds:e.selecteds,submitting:t.submitting,values:t.values}),schema:n.massAssignStep2Schema(),title:t("affectation_plural")})]})})})})};let GF=class extends Pl{translationService;constructor(e){super(e),this.translationService=e}massPreAssignStep1Schema(){return d.Ik().shape({massPreAssign:d.Ik().shape({...this.massPreAssignStep1Fields()})})}massPreAssignStep2Schema(){return d.Ik().shape({massPreAssign:d.Ik().shape({...this.massPreAssignStep2Fields()})})}massPreAssignSchema(){return d.Ik().shape({...this.massPreAssignStep1Fields(),...this.massPreAssignStep2Fields()})}massPreAssignStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(_n,this.t("la_strat_gie_es_82287")),level:d.Yj().required(this.t("le_niveau_est_r_81100")).oneOf(In,this.t("le_niveau_est_r_81100"))}}massPreAssignStep2Fields(){return{positionsCategoriesIds:d.YO().of(d.ai()).test("non-empty-categories",this.t("vous_devez_s_le_32044"),function(){return this.parent.level!==et.Categories||this.parent.positionsCategoriesIds.length>0}),positionsIds:d.YO().of(d.ai()).test("non-empty-positions",this.t("vous_devez_s_le_89603"),function(){return this.parent.level!==et.Positions||this.parent.positionsIds.length>0})}}};GF=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],GF);const HF=e=>{const t=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massPreAssign.strategy",value:Qe.Add,children:t("ajouter_des_pr_46968")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massPreAssign.strategy",value:Qe.Replace,children:t("remplacer_les_p_59777")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray900 textSm medium",children:t("_quel_niveau_s_87878")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massPreAssign.level",value:et.Categories,children:t("pr_affecter_su_68204")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"massPreAssign.level",value:et.Positions,children:t("pr_affecter_su_38603")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:e.handleSubmit,children:t("suivant_pr_a_99182")})})]})},qF=e=>{const t=Hn();return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(lc,{state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsCategoriesIds",no(e.positionsCategoriesIds,e.category.id,"checked"===t))}})}),(0,i.jsx)(yc,{children:e.category.name}),(0,i.jsx)(yc,{children:(0,i.jsx)(Jd,{color:e.category.assignedResources>=e.category.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.category.assignedResources,e.category.resources)})})]})},YF=e=>{const t=Hn(),[n,s,o]=Pc(""),{data:r,isLoading:a}=Yn("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,M.useMemo)(()=>m(s)?(r.event?.positionsCategories??[]).filter(e=>e.name.trim().toLowerCase().includes(s.trim().toLowerCase())):r.event?.positionsCategories??[],[r.event?.positionsCategories,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_une_66722"),value:n,onChange:o})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{css:{paddingRight:0},width:48}),(0,i.jsx)(Fc,{children:t("nom_de_la_cat_g_03860")}),(0,i.jsx)(Fc,{})]}),numberOfPages:1,offset:0,rows:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):l.map(t=>(0,i.jsx)(qF,{category:t,change:e.change,positionsCategoriesIds:e.values.massPreAssign.positionsCategoriesIds},t.id)),setOffset:Hl.A,title:(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{children:t("s_lectionner_le_58635")}),(0,i.jsx)(br,{font:"gray500 textSm regular",children:t("les_membres_s_l_66443")})]}),totalCount:l.length??0}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},KF=e=>{const t=Hn();return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(lc,{state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsIds",no(e.positionsIds,e.position.id,"checked"===t))}})}),(0,i.jsxs)(yc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(br,{font:"gray900 textSm medium",children:e.position.name}),(0,i.jsx)(br,{color:"gray500",children:e.position.positionCategoryName})]}),(0,i.jsx)(yc,{children:(0,i.jsx)(Jd,{color:e.position.assignedResources>=e.position.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.position.assignedResources,e.position.resources)})})]})},ZF=e=>{const t=Hn(),[n,s,o]=Pc(""),[r,a]=(0,M.useState)(0),[l,d]=(0,M.useState)(null),{data:c,isLoading:u}=Yn("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:m(s)?s:void 0,offset:r,sort:l},[]);const{numberOfPages:h,totalCount:g}=vu(c.event?.positions);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:n,onChange:e=>{a(0),o(e)}})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{css:{paddingRight:0},width:48}),(0,i.jsx)(mm,{attribute:lt.Name,setSort:e=>{d(e),a(0)},sort:l,children:t("nom_de_la_missi_64605")}),(0,i.jsx)(Fc,{})]}),numberOfPages:h,offset:r,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):c.event.positions.nodes.map(t=>(0,i.jsx)(KF,{change:e.change,position:t,positionsIds:e.values.massPreAssign.positionsIds},t.id)),setOffset:a,title:(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{children:t("s_lectionner_le_26300")}),(0,i.jsx)(br,{font:"gray500 textSm regular",children:t("les_membres_s_l_63510")})]}),totalCount:g}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},XF=e=>{const t=Hn(),n=Gn(GF),{mutate:s}=Ca();return(0,i.jsx)(Kk,{children:(0,i.jsx)(zm,{category:t("pr_affectation_12256"),title:t("pr_affecter_le_71377"),onClose:e.onClose,children:(0,i.jsx)(Em,{children:(0,i.jsxs)(Bv,{initialValues:{massPreAssign:{level:et.Categories,selecteds:e.selecteds,strategy:Qe.Add,positionsIds:[],positionsCategoriesIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await s({eventId:e.eventId,massPreAssign:n.massPreAssign})).numberOfMembers;e.onSuccess(t("_1_membres_ont_49355",i)),e.onClose()},children:[(0,i.jsx)(Lv,{render:({handleSubmit:e})=>(0,i.jsx)(HF,{handleSubmit:e}),schema:n.massPreAssignStep1Schema(),title:t("initialisation_38640")}),(0,i.jsx)(Lv,{render:t=>t.values.massPreAssign.level===et.Categories?(0,i.jsx)(YF,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}):(0,i.jsx)(ZF,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}),schema:n.massPreAssignStep2Schema(),title:t("pr_affectation_68999")})]})})})})},JF=e=>{const t=Hn(),{mutate:n,isLoading:s}=Zo(),[o,r]=(0,M.useState)(Ot.WaitingAssignment);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("mettre_jour_l_82143")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Au,{label:t("nouveau_statut_57871"),value:o,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:Ot.NotApplicable,children:t(Ot.NotApplicable)}),(0,i.jsx)("option",{value:Ot.Refused,children:t(Ot.Refused)}),(0,i.jsx)("option",{value:Ot.WaitingAssignment,children:t(Ot.WaitingAssignment)})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:s,onClick:async()=>{const i=(await n({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(t("le_statut_d_aff_39000",i,t(o))),e.onClose()},children:t("modifier_le_sta_94473")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},QF=e=>{const{translate:t,params:{eventId:n}}=cl(),{organization:s,hasFeature:o}=_I(),{event:r,isEventAdmin:a}=Jv(),{canMemberEdit:l,canMemberAccredit:d,canMemberAssign:c}=lS(),{showNotification:u}=ib(),{mutate:h}=zo(),{mutate:g}=No(),{data:p}=Yn("query VolunteerActions($eventId: EventId!) {\n event(id: $eventId) {\n hasDelegations\n hasForms\n }\n}\n",{eventId:n},[]),[f,x]=(0,M.useState)(!1),[_,I]=(0,M.useState)(!1),[v,b]=(0,M.useState)(!1),[j,C]=(0,M.useState)(!1),[y,k]=(0,M.useState)(!1),[A,w]=(0,M.useState)(!1),[S,E]=(0,M.useState)(!1),[T,z]=(0,M.useState)(!1),[O,R]=(0,M.useState)(!1),[$,D]=(0,M.useState)(!1),[P,F]=(0,M.useState)(!1),[N,L]=(0,M.useState)(!1),[B,V]=(0,M.useState)(!1),U=e.massActions.getSelectedsInput(e.predicates,null),W=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,G=(0,M.useCallback)(t=>{m(t)&&u(t),e.onMassEditSuccess()},[e.onMassEditSuccess]),H=r.usePositions,q=r.useAccreditations&&o(Fe.Accreditation),Y=r.useDelegations&&o(Fe.Delegation),K=r.useCampaigns,Z=r.useDocuments;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{flex:"1"}}),l&&(0,i.jsx)(jl,{onClick:()=>{x(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&H&&c&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"wand-magic-sparkles",onClick:()=>{C(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("affecter_1_me_24704",W)})]}),!e.showOnlyMassEdit&&q&&d&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"badge-check",onClick:()=>{k(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("accr_diter_1_13773",W)})]}),!e.showOnlyMassEdit&&a&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsx)(U$,{children:t("gestion_des_mem_51660")}),(0,i.jsx)(Ld,{icon:"merge",onClick:()=>{I(!0)},children:t("fusionner_les_m_37150")}),H&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(U$,{children:t("affectation_plural")}),(0,i.jsx)(Ld,{icon:"wand-magic-sparkles",onClick:()=>{b(!0)},children:t("changer_le_stat_39694")}),(0,i.jsx)(Ld,{icon:"wand-magic-sparkles",onClick:()=>{E(!0)},children:t("pr_affecter_1_62649",W)})]}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(q||Y)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(U$,{children:t("accr_ditations_39450")}),q&&(0,i.jsx)(Ld,{icon:"badge-check",onClick:()=>{z(!0)},children:t("changer_le_stat_27596")}),Y&&(0,i.jsx)(Ld,{icon:"people-group",isDisabled:!p.event?.hasDelegations,onClick:()=>{R(!0)},children:t("ajouter_1_mem_86218",W)}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"})]}),(0,i.jsx)(U$,{children:t("communication_05277")}),(0,i.jsx)(Ld,{icon:"file-lines",isDisabled:!p.event?.hasForms,onClick:()=>{D(!0)},children:t("ajouter_1_mem_52947",W)}),(0,i.jsx)(Ld,{icon:"file-lines",isDisabled:!p.event?.hasForms,onClick:()=>{F(!0)},children:t("marquer_un_form_10633")}),K&&(0,i.jsx)(Ld,{icon:"paper-plane",onClick:()=>{L(!0)},children:t("SendCampaign")}),Z&&(0,i.jsx)(Ld,{icon:"file",onClick:()=>V(!0),children:t("exporter_un_doc_23130")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{w(!0)},children:t("d_sinscrire_de_06416")})]})]}),f&&(0,i.jsx)(Hk,{mutate:e=>h({organizationId:s.id,eventId:n,massEdit:e}),organizationId:s.id,selecteds:U,onClose:()=>{x(!1)},onSuccess:e=>{G(t("_1_membres_ont_07596",e))}}),_&&(0,i.jsx)(K$,{numbersOfSelected:W,organizationId:s.id,usersInfosIds:U.ids||[],onClose:()=>I(!1),onSuccess:G}),v&&(0,i.jsx)(JF,{eventId:n,selecteds:U,onClose:()=>{b(!1)},onSuccess:G}),j&&(0,i.jsx)(WF,{eventId:n,numberOfSelected:W,selecteds:U,onClose:()=>{C(!1)},onSuccess:G}),y&&(0,i.jsx)(cA,{eventId:n,numberOfSelected:W,selecteds:U,onClose:()=>{k(!1)},onSuccess:G}),S&&(0,i.jsx)(XF,{eventId:n,numberOfSelected:W,selecteds:U,onClose:()=>{E(!1)},onSuccess:G}),A&&(0,i.jsx)(Pk,{buttonText:t("d_sinscrire_27046"),subtext:[t("_tes_vous_s_r_d_46029")],text:t("d_sinscription_66971",W),onClose:()=>{w(!1)},onDelete:async()=>{const e=(await g({eventId:n,selecteds:U})).numberOfMembers;G(t("_1_membres_ont_85190",e))}}),T&&(0,i.jsx)(PF,{eventId:n,selecteds:U,onClose:()=>{z(!1)},onSuccess:G}),$&&(0,i.jsx)(G$,{eventId:n,organizationId:s.id,selecteds:U,onClose:()=>{D(!1)},onSuccess:G}),P&&(0,i.jsx)(H$,{eventId:n,organizationId:s.id,selecteds:U,onClose:()=>{F(!1)},onSuccess:G}),O&&(0,i.jsx)(W$,{eventId:n,organizationId:s.id,selecteds:U,onClose:()=>{R(!1)},onSuccess:G}),N&&(0,i.jsx)(hA,{eventId:n,organizationId:s.id,selecteds:U,onClose:()=>{L(!1)},onSuccess:G}),B&&(0,i.jsx)(DF,{eventId:n,selecteds:U,onClose:()=>V(!1),onSuccess:e.onMassEditSuccess})]})},eM=e=>{const{params:{organizationId:t,eventId:n}}=cl(),{hasFeature:s}=_I(),o=Gn(Bh),{isEventAdmin:r}=Jv(),[a,l]=WT("accreditationMembers.columns",[Nh.Name,Nh.Accreditations]),[d,c]=WT("accreditationMembers.limit",kc),[u,h]=WT("accreditationMembers.predicates",[]),[m,g]=WT("accreditationMembers.sort",null),{data:p}=Xo({organizationId:t,eventId:n,privacy:pe.All,loadForms:!1,loadSegments:!1}),f=(0,M.useMemo)(()=>p.organization?.customFields.nodes??[],[p.organization]),x=UC(f),_=(0,M.useMemo)(()=>p.event?o.getAccreditationMembersFilters(t,n,f,p.event,{hasDelegations:s(Fe.Delegation)}):[],[n,f,p.event]),I=(0,M.useMemo)(()=>o.getAccreditationMembersPossibleColumns(f),[f]);return(0,i.jsx)(Ob,{children:(0,i.jsx)(lm,{columns:a,columnsSearch:[],columnsToIncludes:Lh,eventId:n,filters:_,getMassActionId:e=>e.userInfo.id,limit:d,loadDataList:nr,loadDataListParams:{accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,accreditationSlotId:e.accreditationSlotId,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:er,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:I,predicates:u,renderActions:(e,t,n)=>(0,i.jsx)(QF,{massActions:e,predicates:null,showOnlyMassEdit:!0,totalNumberOfMembers:t,onMassEditSuccess:n}),rendering:Ph.List,setColumns:l,setLimit:c,setPredicates:h,setSort:g,showEditColumns:!0,showEditMode:r,showFilters:!0,showMassActions:r,showRowDropdown:r,showRowEdit:r,showSearchColumns:!1,sort:m,children:(0,i.jsx)(bm,{renderCell:(e,t,s)=>(0,i.jsx)(Qy,{canAccredit:!0,canAssign:!0,canChangeDelegation:!0,canClickMemberName:!0,column:e,customField:x.get(e.slug),eventId:n,reloadRow:s,row:t})})})})},tM=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s},translate:o}=cl();Td(e.event.accreditation.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":s});return(0,i.jsxs)($b,{children:[(0,i.jsx)(cF,{accreditation:e.event.accreditation}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:Ji.ACCREDITATION_DASHBOARD(r(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(Db,{path:Ji.ACCREDITATION_MEMBERS(r(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(Fb,{path:Ji.ACCREDITATION_DASHBOARD(r(!0)),children:(0,i.jsx)($F,{})}),(0,i.jsx)(Fb,{path:Ji.ACCREDITATION_MEMBERS(r(!0)),children:(0,i.jsx)(eM,{accreditationId:s})})]})]})},nM=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n}}=cl(),{data:s,loader:o}=Yn("query Accreditation($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n assignedResources\n hasSlots\n acronym\n }\n\n volunteersRegistrations(accreditationId: $accreditationId) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationId:n},[]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:Ji.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(ei,{path:Ji.ACCREDITATION_DASHBOARD({organizationId:e,eventId:t,accreditationId:n}),replace:!0})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(tM,{event:s.event})})]})},iM=e=>{const t=Hn(),n=e.isEdit?"0px":e.isLeftPanelOpen?"280px":"68px",s=e.isRightPanelOpen?"360px":"68px";return(0,i.jsxs)(id,{css:{overflow:"hidden"},gridtemplatecolumns:`${n} 1fr ${s}`,gridtemplaterows:"88px 1fr 72px",height:1,width:1,children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{borderRight:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"1 / 3"},children:e.isLeftPanelOpen&&e.leftPanel}),(0,i.jsx)(Ra,{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)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"sidebar",onClick:()=>{e.setIsLeftPanelOpen(!e.isLeftPanelOpen)}})})}),(0,i.jsx)(_m,{placement:"top",children:e.isLeftPanelOpen?t("cacher_la_liste_66205"):t("afficher_la_lis_14277")})]})})]}),(0,i.jsx)(br,{css:{gridColumn:"2 / 4",gridRow:"1 / 2"},children:e.header}),(0,i.jsx)(br,{css:{borderTop:"1px solid $gray200",gridColumn:"2 / 3",gridRow:"2 / 3",overflowY:"auto"},children:e.children}),(0,i.jsx)(br,{css:{gridColumn:"2 / 3",gridRow:"3 / 4"},children:e.buttons}),(0,i.jsx)(br,{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)(Ra,{css:{paddingTop:"$6"},height:1,justify:"center",width:1,children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:()=>{e.setIsRightPanelOpen(!0)},children:(0,i.jsx)(Ya,{icon:"sidebar"})})}),(0,i.jsx)(_m,{placement:"top",children:t("afficher_les_in_82197")})]})})})]})},sM=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=cl(),a=Gn(Wc),l=(0,M.useMemo)(()=>e.teams.find(t=>t.leaderUserInfoId===e.userInfo.id),[e.teams,e.userInfo]),d=(0,M.useMemo)(()=>e.teams.flatMap(e=>e.members.flatMap(e=>e.userInfo.id===r?[]:[e.userInfo])),[e.teams]);return(0,i.jsxs)(Ra,{align:"center",css:{padding:"$5 $6"},gap:"4",children:[(0,i.jsxs)(br,{css:{position:"relative"},children:[(0,i.jsx)(qg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:32}),(0,i.jsx)(Ra,{align:"center",css:{background:mr.colors[`${e.badgeColorIcon.color}100`].value,border:"2px solid white",borderRadius:"16px",bottom:"-6px",color:mr.colors[`${e.badgeColorIcon.color}700`].value,fontSize:"8px",position:"absolute",right:"-6px"},height:16,justify:"center",width:16,children:(0,i.jsx)(Ya,{icon:e.badgeColorIcon.leftIcon})})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(Ha,{to:BI.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:r}),children:(0,i.jsx)(br,{css:{cursor:"pointer","&:hover":{textDecoration:"underline"}},font:"gray900 textXl medium",children:e.userInfo.name})}),(0,i.jsxs)(br,{color:"gray500",children:["(",e.userInfo.email,")"]}),e.showTeam&&l&&(0,i.jsx)(Jd,{leftIcon:"shield",children:n("chef_d_quipe_20641")})]}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{color:"gray500",children:a.toLocaleString(e.insertedAt,Zs.DateOnly.MonthLong)}),e.showTeam&&eo(e.teams)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray500",children:"•"}),(0,i.jsx)(br,{color:"gray500",children:n("_quipe_1_07445",e.teams[0].teamCode)}),(0,i.jsx)(br,{color:"gray500",children:"•"}),(0,i.jsx)(Yy,{teamMembers:d})]})]})]}),e.showTabs&&(0,i.jsx)(br,{width:320,children:(0,i.jsxs)(jv,{selectedItem:e.isPreAssign?"preassign":"affect",onChange:n=>{"preassign"!==n||e.isPreAssign?"affect"===n&&e.isPreAssign&&t.replace(Os.ASSIGNMENT(s,o,r)):t.replace(Os.PRE_ASSIGNMENT(s,o,r))},children:[(0,i.jsx)(Cv,{item:"affect",children:n("affecter_94255")}),(0,i.jsx)(Cv,{item:"preassign",children:n("pr_affecter_17434")})]})})]})},oM=e=>{const t=Hn(),n=Gn(Wc);return(0,i.jsxs)(Ra,{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)(qg,{email:e.vr.userInfo.email,image:e.vr.userInfo.picture?.url,name:e.vr.userInfo.name,size:40}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:e.vr.userInfo.name}),(0,i.jsx)(br,{children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt,Zs.DateOnly.MonthLong))})]})]})},rM=()=>(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"3",children:[(0,i.jsx)(ec,{size:40,variant:"circular"}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1})]})]}),aM=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl(),r=e.event?.delegations?.nodes??[],a=e.event?.segmentsFolders??[],l=e.event?.volunteersRegistrations.totalCount??0,d=e.event?.volunteersRegistrations.nodes??[];return(0,i.jsxs)(Ra,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ra,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Qb,{color:"primary",returnPathFallback:Ji.ACCREDITATIONS({organizationId:n,eventId:s}),children:o("retour_92202")}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(Jd,{color:"error",size:"sm",children:o("profil_restant",l)})]})]}),(0,i.jsxs)(Ra,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:o("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(Pd,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"bottom",children:(0,i.jsxs)(Ra,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsxs)(Au,{label:o("date_d_inscript_31369"),value:e.direction,onChange:e.setDirection,children:[(0,i.jsx)("option",{value:vt.Desc,children:o("du_plus_r_cent_76468")}),(0,i.jsx)("option",{value:vt.Asc,children:o("du_plus_ancien_08999")})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:o("vue_personnalis_97654")}),e.isLoading?(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:[e.segmentId],onChange:t=>{eo(t)?e.setSegmentId((0,eu.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)(fc,{isSelectAllVisible:!0,label:o("status_d_affect_75769"),multiple:!0,values:e.states,onChange:e.setStates,children:[(0,i.jsx)("option",{value:Ot.WaitingAssignment,children:o(Ot.WaitingAssignment)}),(0,i.jsx)("option",{value:Ot.PreAssigned,children:o(Ot.PreAssigned)}),(0,i.jsx)("option",{value:Ot.Assigned,children:o(Ot.Assigned)})]}),e.showAccreditationStates&&(0,i.jsxs)(fc,{isSelectAllVisible:!0,label:o("statut_d_accr_d_75527"),multiple:!0,values:e.accreditationStates,onChange:e.setAccreditationStates,children:[(0,i.jsx)("option",{value:re.WaitingAccreditation,children:o(re.WaitingAccreditation)}),(0,i.jsx)("option",{value:re.AutoAccredited,children:o(re.AutoAccredited)}),(0,i.jsx)("option",{value:re.Accredited,children:o(re.Accredited)})]}),e.loadDelegations&&(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:o("Delegation")}),e.isLoading?(0,i.jsx)(ec,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:e.delegationId?[e.delegationId]:[],onChange:t=>{eo(t)?e.setDelegationId((0,eu.A)(t)):e.setDelegationId(null)},children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})})]})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rM,{}),(0,i.jsx)(rM,{}),(0,i.jsx)(rM,{})]}):d.map(n=>(0,i.jsx)(oM,{displayBorder:!0,isSelected:n.userInfo.id===e.userInfoId,vr:n,onClick:()=>{t.push(e.getPath(n.userInfo.id))}},n.userInfo.id))})]})},lM=e=>{const[t,n]=M.useState(e.isOpen??!0),s=M.useCallback(t=>{e.setIsOpen?.(t),n(t)},[e.setIsOpen,n]);return M.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsxs)(Ra,{css:{borderTop:"1px solid $gray200",padding:"$6",...e.css},direction:"column",gap:"4",children:[(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",userSelect:"none",...e.titleCss},gap:"4",onClick:()=>{s(!t)},children:[(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:t?"chevron-down":"chevron-right"})}),(0,i.jsx)(Ra,{css:{color:"$gray800",flex:"1",fontWeight:"$semiBold"},children:e.title})]}),t&&e.children]})},dM=e=>{const t=Hn(),n=Gn(Wc),[s,o]=WT("assignment.rightPanel.areAccreditationsOpen",!0),r=(0,M.useMemo)(()=>function(e,t,n,i){return e.flatMap(e=>e.accreditationsSlots.map(e=>{const s=wh(t,e,e.accreditation.name,{defaultName:"-"});return{name:e.accreditation.name,subtitle:s,path:Ji.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)(lM,{isOpen:s,setIsOpen:o,title:t("accr_ditations_74375"),children:(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Fc,{children:t("accr_ditation_s_00595")})}),r.map((e,t)=>(0,i.jsx)(Tc,{children:(0,i.jsxs)(yc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",children:e.name}),(0,i.jsx)(br,{color:"gray500",children:e.subtitle})]})},t))]})})},cM=e=>{const t=Gn(Wc);return(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ra,{justify:"between",children:[(0,i.jsx)(br,{font:"gray800 textXs medium",children:e.comment.writtenBy.userInfo.name}),(0,i.jsx)(br,{font:"gray500 textXs regular",children:t.toLocaleString(e.comment.insertedAt,{...Zs.DateTime,month:"numeric"})})]}),(0,i.jsx)(Ra,{css:{background:"$gray100",bd:!0,borderTopLeftRadius:"0",padding:"$2 $3",whiteSpace:"pre-wrap"},children:e.comment.content})]})},uM=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{data:o,isLoading:r,reload:a}=va({organizationId:t,userInfoId:s}),{mutate:l,isLoading:d}=Ia(),[c,u]=(0,M.useState)(""),{permissions:[h]}=Vy(Dy({organizationId:t,eventId:n,userInfoId:s}));return(0,i.jsxs)(Ra,{css:{padding:"0 $6 $4 $6"},direction:"column",gap:"3",children:[r?(0,i.jsx)(ec,{borderRadius:"$1",height:40,variant:"rectangular",width:1}):o.organization.userInfo.comments.map(e=>(0,i.jsx)(cM,{comment:e},e.id)),h&&(0,i.jsxs)(ub,{children:[(0,i.jsx)(hb,{children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",children:e("ajouter_un_comm_27671")})}),(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"message",children:e("ajouter_un_comm_27671")}),(0,i.jsx)(lb,{children:(0,i.jsx)(Nm,{label:e("commentaire_08754"),value:c,onChange:u})}),(0,i.jsx)(ab,{children:o=>(0,i.jsx)(jl,{disabled:g(c),isLoading:d,onClick:async()=>{await l({organizationId:t,eventId:n,userInfoId:s,comment:{content:c}}),a(),o()},children:e("ajouter_97327")})})]})]})]})},hM=e=>{const t=Hn(),[n,s]=WT("assignment.rightPanel.areInformationsOpen",!0);return(0,i.jsxs)(lM,{isOpen:n,setIsOpen:s,title:e.title,children:[(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(uz,{children:t("Email")}),(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0,fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.userInfo.email})]}),e.customFields.map(t=>(0,i.jsx)(hz,{field:t,fields:e.userInfo.fields},t.id)),e.formsIds.map(n=>{const s=mz(n,t);return m(e.userInfo.fields[s.slug])?(0,i.jsx)(hz,{field:s,fields:e.userInfo.fields},s.slug):null})]})},mM=e=>{const t=Hn(),n=Gn(ah),[s,o]=WT("assignment.rightPanel.arePositionsOpen",!0),r=(0,M.useMemo)(()=>_k(e.formsUsersInfos,n,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(lM,{isOpen:s,setIsOpen:o,title:t("missions_souhai_23225"),children:(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Fc,{children:t("mission_souhait_49168")})}),r.map((e,n)=>(0,i.jsx)(Tc,{children:(0,i.jsxs)(yc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",children:e.name}),e.form.positionRanking===We.Ranked&&(0,i.jsx)(Jd,{children:t("choix_n_1_00613",e.rank)})]}),(0,i.jsx)(br,{color:"gray500",children:e.range})]})},n))]})})},gM=e=>{const t=Hn(),n=Gn(Wc),s=Gn(ah),[o,r]=WT("assignment.rightPanel.areAvailabilitiesOpen",!0),a=(0,M.useMemo)(()=>(0,ic.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===pt.Calendar||e===pt.DisplayDays?n.toLocaleString(t.range.start,Zs.DateOnly.MonthLong):s.toDisplayString(t.range)),[n,s,e.formsUsersInfos]);return(0,i.jsx)(lM,{isOpen:o,setIsOpen:r,title:t("disponibilit_s_49923"),children:(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Fc,{children:t("disponibilit_92461")})}),a.map((e,t)=>(0,i.jsx)(Tc,{children:(0,i.jsx)(yc,{children:(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",children:e})})},t))]})})},pM=e=>{const t=Hn(),n=(0,M.useMemo)(()=>e.formsUsersInfos.map(e=>e.form.id),[e.formsUsersInfos]);return(0,i.jsxs)(Ra,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ra,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(Ya,{icon:"sidebar"})})}),(0,i.jsx)(_m,{placement:"top",children:t("cacher_les_info_51832")})]}),(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:t("_propos_de_1_50761",e.userInfo.name)})]}),(0,i.jsx)(uM,{}),(0,i.jsx)(hM,{customFields:e.customFields,formsIds:n,title:t("informations_22954"),userInfo:e.userInfo}),(0,i.jsx)(gM,{formsUsersInfos:e.formsUsersInfos}),e.showWishedPositions&&(0,i.jsx)(mM,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId}),e.showWishedAccreditations&&(0,i.jsx)(dM,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId})]})},fM=M.createContext({}),xM=e=>{const[t,n]=M.useState(e.accreditationsSlotsIds);return(0,i.jsx)(fM.Provider,{value:{accreditationsSlotsIds:t,isEdit:e.isEdit,showNextMember:e.showNextMember,setAccreditationsSlotsIds:n},children:e.children})};function _M(){return M.useContext(fM)}const IM=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl(),{accreditationsSlotsIds:r,showNextMember:a}=_M(),{mutate:l,isLoading:d}=qo(),{mutate:c,isLoading:u}=vo(),h=(0,M.useCallback)(()=>{e.isEdit?t.goBack(Os.VOLUNTEERS(n,s)):a()},[e.isEdit,a]);return(0,i.jsxs)(Ra,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,justify:"end",width:1,children:[(0,i.jsx)(br,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{u||d||(await l({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:re.Refused}}),h())},children:o("refuser_92819")}),(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsx)(jl,{color:"primary",isLoading:u,onClick:async()=>{u||d||(eo(r)?await c({eventId:s,massAccredit:{accreditationsSlotsIds:r,selecteds:{ids:[e.userInfoId]},strategy:Qe.Replace}}):await l({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:re.WaitingAccreditation}}),h())},children:e.isEdit?o("mettre_jour_l_11622"):o("accr_diter_70543")}),(0,i.jsx)(jl,{color:"white",onClick:h,children:e.isEdit?o("annuler_48254"):o("accr_diter_plus_19053")})]})},vM=({slots:e})=>{const{accreditationsSlotsIds:t,setAccreditationsSlotsIds:n}=_M(),{minDate:s,maxDate:o,numberOfMonths:r}=(0,M.useMemo)(()=>Eh(e),[e]),a=(0,M.useMemo)(()=>e.flatMap(e=>e.date?.isValid&&t.includes(e.id)?[e.date]:[]),[e,t]),l=(0,M.useMemo)(()=>e.flatMap(e=>e.isBlocked?[e.date]:[]),[e]);return(0,i.jsx)(Ra,{css:{background:"$gray50",borderTop:"1px solid $gray200",padding:"$4"},gap:"4",wrap:"wrap",children:(0,wc.A)(0,r).map(d=>{const c=s.plus({month:d}).startOf("month"),u=0===d?s:c,h=d===r-1?o:c.endOf("month"),m=a.filter(e=>e.startOf("month").equals(c));return(0,i.jsx)(eA,{disabledDates:l,firstDayOfMonth:c,max:h,min:u,values:m,onChange:i=>{n(Th(t,e,c,i))}},d)})})},bM=e=>{const t=Gn(Wc),n=Gn(iA),{accreditationsSlotsIds:s,setAccreditationsSlotsIds:o}=_M(),r=(0,M.useMemo)(()=>zh(e.slots),[e.slots]),a=(0,M.useCallback)(t=>{e.isRadio?o([...(0,sc.A)(s,...r.map(e=>e.id)),t]):o(io(s,t))},[e.isRadio,r,s,o]);return(0,i.jsx)(Ra,{direction:"column",children:r.map(o=>{const r=s.includes(o.id)?"checked":"unchecked",l=e.delegationAccreditations?.find(e=>e.accreditationSlotId===o.id),{assignedResources:d,isMaxedOut:c,limitIcon:u,maxResources:h,percent:m}=zF(l,o),g=void 0!==m?(d+(s.includes(o.id)?1:0))/h:void 0;return(0,i.jsxs)(Ra,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},children:[(0,i.jsx)(br,{css:{flex:"1"},children:e.isRadio?(0,i.jsx)(hc,{disabled:c&&"unchecked"===r,state:r,onClick:()=>{a(o.id)},children:(0,i.jsx)(br,{css:{textTransform:"capitalize"},children:wh(t,o,"",{date:{localeFormat:Zs.DateOnly.WeekdayLongMonthLong}})})}):(0,i.jsx)(dc,{disabled:o.isBlocked||c&&"unchecked"===r,state:r,onClick:()=>{a(o.id)},children:(0,i.jsx)(br,{css:{textTransform:"capitalize"},children:wh(t,o,"",{date:{localeFormat:Zs.DateOnly.WeekdayLongMonthLong}})})})}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsx)(br,{color:"gray700",css:{marginBlockStart:"2px"},fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:"user-group"})}),(0,i.jsx)(Ba,{width:"1"}),(0,i.jsxs)(br,{color:"gray700",children:[d+(s.includes(o.id)?1:0),"/",n.toNumberOrInfinity(h)]}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsx)(br,{color:"gray400",textAlign:"center",children:h!==1/0&&(0,i.jsxs)(i.Fragment,{children:["[",u,"]"]})}),(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(br,{css:{marginTop:"auto",marginBottom:"auto"},width:120,children:void 0!==m&&(0,i.jsx)(ow,{percent:m,prospectivePercent:g})}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(br,{color:"gray700",textAlign:"end",width:36,children:void 0!==(g??m)&&(0,i.jsxs)(i.Fragment,{children:[Math.min(100,Math.round(100*(g??m))),"%"]})})]},o.id)})})},jM=({accreditation:e,delegationAccreditations:t,slots:n})=>{const{translate:s}=cl(),o=Gn(iA),{accreditationsSlotsIds:r,setAccreditationsSlotsIds:a}=_M(),[l,d]=M.useState(!0),c=M.useMemo(()=>n.map(e=>e.id),[n]),u=M.useMemo(()=>n.every(e=>r.includes(e.id)),[n,r]),h=e.accreditationDisplay,m=e.hasSlots,g=n[0],p=M.useMemo(()=>t?.find(e=>e.accreditationSlotId===g.id),[e,t,g]),{assignedResources:f,isMaxedOut:x,limitIcon:_,maxResources:I,percent:v}=zF(p,g),b=I!==1/0?r.length/I:void 0,j=r.includes(g.id)?"checked":"unchecked",C=M.useCallback(e=>{Al(e),a(u?(0,oc.A)(r,c):(0,Fs.A)(r.concat(c)))},[c,r,u,a]),y=M.useCallback(e=>{Al(e),a((0,oc.A)(r,c))},[c,r,a]);return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",padding:"$4 $6",userSelect:"none"},width:1,onClick:()=>{x||(m?d(!l):a(io(r,g.id)))},children:[m?(0,i.jsx)(Ya,{icon:l?"chevron-down":"chevron-right"}):(0,i.jsx)(lc,{disabled:x,shouldPreventDefault:!1,state:j,onClick:Hl.A}),(0,i.jsx)(Ba,{width:"4"}),(0,i.jsx)(pC,{color:e.color,icon:e.icon}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:e.name}),m&&(0,i.jsx)(br,{color:"gray500",children:s("creneau",n.length)})]}),m?h===te.List?(0,i.jsx)(jl,{color:"invisible",onClick:C,children:s(u?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")}):h===te.Radio?(0,i.jsx)(jl,{color:"invisible",onClick:y,children:s("r_initialiser_77538")}):null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{width:"2"}),(0,i.jsx)(br,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:"user-group"})}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsxs)(br,{color:"gray700",children:[f+(r.includes(n[0].id)?1:0),"/",o.toNumberOrInfinity(I)]}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsx)(br,{color:"gray400",textAlign:"center",children:I!==1/0&&(0,i.jsxs)(i.Fragment,{children:["[",_,"]"]})}),(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(br,{css:{marginBlock:"auto"},width:120,children:void 0!==v&&(0,i.jsx)(ow,{percent:v||0,prospectivePercent:b})}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(br,{color:"gray700",textAlign:"end",width:36,children:void 0!==v&&(0,i.jsxs)(i.Fragment,{children:[Math.min(100,Math.round(100*v)),"%"]})})]})]}),m&&l?e.accreditationDisplay===te.Calendar?(0,i.jsx)(vM,{slots:n}):(0,i.jsx)(bM,{delegationAccreditations:t?.filter(t=>t.accreditationId===e.id),isRadio:h===te.Radio,slots:n}):null]})},CM=({delegation:e,slots:t})=>{const n=(0,M.useMemo)(()=>(0,ic.A)(Object.values((0,nc.A)(t,e=>e.accreditation.id)),e=>[oC(e[0].accreditation.index),e[0].accreditation.name.toLowerCase()]),[t]);return(0,i.jsx)(Ra,{css:{background:"$gray100",borderTop:"1px solid ^$gray200",padding:"$4"},direction:"column",gap:"2",children:n.map(t=>{const n=t[0].accreditation,s=e?.accreditationsSlots.filter(e=>e.accreditationSlot.accreditation.id===n.id&&void 0!==e.maxResources);return(0,i.jsx)(jM,{accreditation:n,delegationAccreditations:eo(s)?s:void 0,slots:t},n.id)})})},yM=({category:e,delegation:t,slots:n})=>{const[s,o]=(0,M.useState)(!0);return(0,i.jsxs)(Ra,{css:{bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ra,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"1",onClick:()=>{o(!s)},children:[(0,i.jsx)(Ra,{align:"center",css:{fontSize:"$textXs"},height:32,justify:"center",width:32,children:(0,i.jsx)(Ya,{icon:s?"chevron-down":"chevron-right"})}),(0,i.jsx)(br,{font:"gray800 textMd medium",children:e.name})]}),s&&(0,i.jsx)(CM,{delegation:t,slots:n})]})},kM=({accreditationsSlots:e,delegation:t})=>{const n=(0,M.useMemo)(()=>(0,ic.A)(Object.values((0,nc.A)(e,e=>e.accreditationCategory.id)),e=>e[0].accreditationCategory.name.toLowerCase()),[e]);return(0,i.jsx)(Ra,{direction:"column",gap:"4",width:1,children:n.map(e=>{const n=e[0].accreditationCategory;return(0,i.jsx)(yM,{category:n,delegation:t,slots:e},n.id)})})},AM=e=>{const t=Hn(),n=Gn(Wc),s=(0,M.useMemo)(()=>(e.accreditationsCategoriesIds||[]).map(t=>e.event.accreditationsCategories.find(e=>e.id===t).name).join(", "),[e.accreditationsCategoriesIds,e.event]),o=(0,M.useMemo)(()=>(e.accreditationsIds||[]).map(t=>e.event.accreditations.nodes.find(e=>e.id===t).name).join(", "),[e.accreditationsIds,e.event]),r=(0,M.useMemo)(()=>e.date?n.toLocaleString(e.date,Zs.DateOnly.MonthLong):"",[e.date]),a=(0,M.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,M.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return m(s)||m(o)||m(r)||m(a)||m(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(Ra,{align:"center",gap:"3",wrap:"wrap",children:[m(s)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setAccreditationsCategoriesIds([])},children:t("cat_gories_1_42029",s)}),m(o)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setAccreditationsIds([])},children:t("accr_ditations_30765",o)}),m(r)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),m(a)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),m(l)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds([])},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},wM=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.accreditationsCategoriesIds),[o,r]=(0,M.useState)(e.accreditationsIds),[a,l]=(0,M.useState)(e.date),[d,c]=(0,M.useState)(e.tagsIds),[u,h]=(0,M.useState)(e.segmentId?[e.segmentId]:[]),[m,g]=(0,M.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,M.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Ra,{direction:"column",onChange:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,i.jsxs)(Ra,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:s,children:e.event.accreditationsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_92029"),renderOnPortal:!0,values:o||[],onChange:r,children:e.event.accreditations.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Tu,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(fc,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:u,onChange:e=>{eo(e)?h([(0,eu.A)(e)]):h([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_73255"),renderOnPortal:!0,values:d||[],onChange:c,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(dc,{state:m,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(dc,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(Ra,{align:"center",css:{brderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(jl,{size:"sm",onClick:()=>{e.setAccreditationsCategoriesIds(n),e.setAccreditationsIds(o),e.setDate(a),e.setExcludeFull("checked"===m),e.setExcludePast("checked"===p),e.setSegmentId(eo(u)?u[0]:null),e.setTagsIds(d),e.close()},children:t("appliquer_05753")})]})]})},SM=e=>{const t=Hn(),[n,s]=(0,M.useState)(!1),o=(0,M.useCallback)(()=>{e.setAccreditationsCategoriesIds([]),e.setAccreditationsIds([]),e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setSegmentId(null),e.setTagsIds([])},[e.setAccreditationsCategoriesIds,e.setAccreditationsIds,e.setDate,e.setExcludeFull,e.setExcludePast,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Ra,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Pd,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:s,children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(Vd,{placement:"bottom-end",width:385,children:(0,i.jsx)(wM,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(AM,{...e,reset:o})]})},EM=({event:e,organization:t})=>{const{eventId:n}=Zn(),[s,o,r]=Pc(""),[a,l]=WT("accredit.filters.accreditationsCategoriesIds",null),[d,c]=WT("accredit.filters.accreditationsIds",null),[u,h]=WT("accredit.filters.date",null),[g,p]=WT("accredit.filters.tagsIds",null),[f,x]=WT("accredit.filters.segmentId",null),[_,I]=WT("accredit.filters.excludeFull",!1),[v,b]=WT("accredit.filters.excludePast",!1),{data:j,loader:C}=Yn("query AccreditSlots(\n $eventId: EventId!\n $name: String\n $accreditationCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n accreditationsSlots(\n includeHidden: true\n accreditationName: $name\n accreditationsCategoriesIds: $accreditationCategoriesIds\n accreditationsIds: $accreditationsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n ) {\n nodes {\n ...AccreditationsSlot\n }\n }\n }\n}\n",{eventId:n,name:m(o)?o:void 0,accreditationCategoriesIds:eo(a)?a:void 0,accreditationsIds:eo(d)?d:void 0,date:u,tagsIds:eo(g)?g:void 0,segmentId:f,excludeFull:_,excludePast:v},[Ms.AccreditationsSlotFragment]);return(0,i.jsxs)(Ra,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(SM,{accreditationsCategoriesIds:a,accreditationsIds:d,date:u,event:e,excludeFull:_,excludePast:v,name:s,organization:t,segmentId:f,setAccreditationsCategoriesIds:l,setAccreditationsIds:c,setDate:h,setExcludeFull:I,setExcludePast:b,setName:r,setSegmentId:x,setTagsIds:p,tagsIds:g}),(0,i.jsx)(Ba,{height:"7"}),C||(0,i.jsx)(kM,{accreditationsSlots:j.event.accreditationsSlots.nodes,delegation:e.volunteerRegistration.delegation})]})},TM=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=cl();Td(n("accr_ditations_79986",e.event.volunteerRegistration.userInfo.name));const[a,l]=WT("accredit.isLeftPanelOpen",!0),[d,c]=WT("accredit.isRightPanelOpen",!0),[u,h,g]=Pc(""),[p,f]=WT("accredit.leftPanelDirection",vt.Desc),[x,_]=WT("accredit.leftPanelSegmentId",-1),[I,v]=WT("accredit.leftPanelDelegationId",null),[b,j]=WT("accredit.leftPanelStates",[re.AutoAccredited,re.WaitingAccreditation]),{data:C,isLoading:y}=Io({eventId:o,accreditationStates:b,name:m(h)?h:void 0,segmentId:-1===x?void 0:x,delegationId:I||void 0,direction:p,loadDelegations:!0}),k=(0,M.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(Os.ACCREDIT(s,o,r)):t.replace(Os.ACCREDIT(s,o,i))},[s,o,r,C.event]),A=e.event.volunteerRegistration,w=(0,M.useMemo)(()=>[...A.accreditationsUsersInfos.map(({accreditationSlotId:e})=>e),...e.isEdit?[]:A.accreditationsSlots.flatMap(e=>{const t=A.delegation?.accreditationsSlots.find(t=>t.accreditationSlotId===e.id),n=t?.maxResources&&t?.assignedResources>=t?.maxResources;return e?.maxResources&&e?.assignedResources>=e?.maxResources||n?[]:[e.id]})],[A,e.isEdit]);return(0,i.jsx)(xM,{accreditationsSlotsIds:w,isEdit:e.isEdit,showNextMember:k,children:(0,i.jsx)(iM,{buttons:(0,i.jsx)(IM,{isEdit:e.isEdit,userInfoId:A.userInfo.id}),header:(0,i.jsx)(sM,{badgeColorIcon:Kb(A.accreditationState),insertedAt:A.insertedAt,isPreAssign:!1,showTabs:!1,showTeam:!1,teams:[],userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:a,isRightPanelOpen:d,leftPanel:(0,i.jsx)(aM,{accreditationStates:b,delegationId:I,direction:p,event:C.event,getPath:e=>Os.ACCREDIT(s,o,e),isLoading:y,loadDelegations:!0,name:u,segmentId:x,setAccreditationStates:j,setDelegationId:v,setDirection:f,setName:g,setSegmentId:_,setStates:Hl.A,showAccreditationStates:!0,showStates:!1,states:[],userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(pM,{customFields:e.event.formsCustomsFields,eventId:o,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:s,showWishedAccreditations:!0,showWishedPositions:!1,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{c(!1)}}),setIsLeftPanelOpen:l,setIsRightPanelOpen:c,children:(0,i.jsx)(EM,{event:e.event,organization:e.organization})})})},zM=e=>{const{organizationId:t,eventId:n,userInfoId:s}=Zn(),{data:o,loader:r}=Yn("query AccreditInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n accreditationsCategories {\n id\n name\n }\n\n accreditations {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Accreditations) {\n id\n name\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n userInfoId\n accreditationState\n insertedAt\n\n accreditationsSlots {\n id\n maxResources\n assignedResources\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n delegation {\n ...DelegationAccreditationsSlots\n }\n\n userInfo {\n id\n name\n email\n fields\n picture {\n url\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Ms.FormsUsersInfosWishedFragment,Ms.CustomFieldWithConditionFragment,Ms.DelegationAccreditationsSlotsFragment]);return r||(0,i.jsx)(TM,{event:o.event,isEdit:e.isEdit,organization:o.organization})},OM=e=>(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,flex:"1",...e.css},direction:"column",children:[(0,i.jsx)(Ra,{css:{flex:"1",padding:"$6"},direction:"column",gap:"2",children:e.children}),e.button&&(0,i.jsx)(Ra,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},justify:"end",children:e.button})]}),RM=()=>{const{translate:e,params:{eventId:t}}=cl(),[n,s,o]=Pc(""),[r,a]=(0,M.useState)(""),[l,d]=(0,M.useState)(0),{data:c,isLoading:u,reload:h}=Yn("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:m(s)?s:void 0,state:""!==r?r:void 0,offset:l},[Ms.EmailRecipientFragment]);const g=Rc(),{numberOfPages:p,totalCount:f}=vu(c.event?.emails);return(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{value:r,onChange:e=>{a(e),d(0)},children:[(0,i.jsx)("option",{value:"",children:e("tous_les_status_67644")}),g(on.filter(e=>e!==Se.Queued))]})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_un_d_02329"),value:n,onChange:e=>{o(e),d(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("nom_du_membre_69353")}),(0,i.jsx)(Fc,{children:e("date_d_envoi_74668")}),(0,i.jsx)(Fc,{children:e("status_06428")}),(0,i.jsx)(Fc,{width:100})]}),numberOfPages:p,offset:l,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):c.event.emails.nodes.map(e=>(0,i.jsx)(Gb,{email:e,emailType:Te.Accreditations,reload:h},e.id)),setOffset:d,title:e("liste_des_envoi_14764"),totalCount:f})},$M=e=>{const t=Hn(),{mutate:n,isLoading:s}=function(e={}){return Kn("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)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ej,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("les_membres_pr_09143")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:s,onClick:async()=>{await n({eventId:e.eventId,sendAccreditationsEmails:e.sendAccreditationsEmails}),e.reload(),e.onClose()},children:t("confirmer_l_env_08749")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},DM=e=>{const t=Hn(),[n,s,o]=Pc(""),[r,a]=(0,M.useState)([]),{data:l}=Br({eventId:e.eventId,usersInfosIds:r,name:m(s)?s:void 0}),d=(0,M.useMemo)(()=>(0,ch.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),{mutate:c,isLoading:u}=function(e={}){return Kn("mutation AccreditationsEmailsEstimate(\n $eventId: EventId!\n $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n eventAccreditationsEmailsEstimate(\n eventId: $eventId\n sendAccreditationsEmails: $sendAccreditationsEmails\n )\n}\n",e)}(),[h,g]=(0,M.useState)(ie.Everyone),[p,f]=(0,M.useState)([]),x=h===ie.Everyone||h===ie.Accredited||h===ie.Refused||h===ie.Members&&eo(r)||h===ie.Segments&&eo(p),_=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ej,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_83224")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(Ba,{height:"7"}),_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ja,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_69435")}),(0,i.jsx)(Ba,{height:"4"})]}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(hc,{state:h===ie.Everyone?"checked":"unchecked",onClick:()=>{g(ie.Everyone)},children:t("tous_les_e_mail_50843")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:h===ie.Accredited?"checked":"unchecked",onClick:()=>{g(ie.Accredited)},children:t("tous_les_e_mail_02185")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:h===ie.Refused?"checked":"unchecked",onClick:()=>{g(ie.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:h===ie.Members?"checked":"unchecked",onClick:()=>{g(ie.Members)},children:t("_certains_memb_91094")}),h===ie.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{paddingLeft:"$6"},children:(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:o}),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)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:h===ie.Segments?"checked":"unchecked",onClick:()=>{g(ie.Segments)},children:t("uniquement_ce_54026")}),h===ie.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{paddingLeft:"$6"},children:(0,i.jsx)(fc,{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)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{disabled:_,isLoading:u,onClick:async()=>{if(x){const t={recipients:h,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)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},PM=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl(),{setNumberOfWaitingAccreditations:r}=Jv(),[a,l]=(0,M.useState)(!1),[d,c]=(0,M.useState)(null),[u,h]=(0,M.useState)(0),[m,g]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{r(e.event.waitingAccreditation.totalCount)},[e.event]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ob,{children:[(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsxs)(OM,{button:(0,i.jsx)(jl,{disabled:0===e.event.waitingAccreditation.totalCount,onClick:()=>{e.event.waitingAccreditation.totalCount>0&&t.push(Os.ACCREDIT(n,s,e.event.waitingAccreditation.nodes[0].userInfoId))},children:o("accr_diter_les_48281")}),children:[(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:o("membres_en_atte_52995")}),(0,i.jsx)(br,{font:"gray900 displayMd medium",children:e.event.waitingAccreditation.totalCount})]}),(0,i.jsxs)(OM,{button:(0,i.jsx)(jl,{onClick:()=>{l(!0)},children:o("param_trer_et_e_31095")}),children:[(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:o("e_mail_de_confi_84099_plural")}),(0,i.jsx)(br,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfWaiting})]})]}),(0,i.jsx)(Ba,{height:"9"}),(0,i.jsx)(br,{font:"gray900 textLg medium",children:o("historique_des_71419")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsxs)(OM,{children:[(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:o("nombre_d_envois_95106")}),(0,i.jsx)(br,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfSent})]}),(0,i.jsxs)(OM,{children:[(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:o("nombre_d_ouvert_84187")}),(0,i.jsx)(br,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfOpen})]}),(0,i.jsxs)(OM,{children:[(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:o("nombre_de_clics_64232")}),(0,i.jsx)(br,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfClick})]})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(RM,{})]}),a&&(0,i.jsx)(DM,{emailSender:e.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{l(!1)},onSuccess:(e,t)=>{h(e),c(t),g(!0)}}),m&&(0,i.jsx)($M,{eventId:s,numberOfEmails:u,reload:e.reload,sendAccreditationsEmails:d,onClose:()=>{g(!1)}})]})},FM=()=>{const e=Hn();return(0,i.jsxs)(Rb,{direction:"column",children:[(0,i.jsx)(br,{font:"blueGray900 textXl medium",children:e("accr_ditations_39450")}),(0,i.jsx)(br,{color:"gray500",children:e("accr_diter_vos_35773")})]})},MM=()=>{const{params:{organizationId:e,eventId:t},translate:n}=cl(),{event:{name:s},localEvent:o,updateLocalEvent:r}=Jv();Td(`${s} ${n("accr_ditations_39450")}`);const{data:a,loader:l,reload:d}=Yn('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:o?.["accredit.leftPanelDirection"]??vt.Desc},[]);return(0,M.useEffect)(()=>{(async()=>{await Promise.all([r({"accredit.filters.accreditationsCategoriesIds":null}),r({"accredit.filters.accreditationsIds":null}),r({"accredit.filters.date":null}),r({"accredit.filters.tagsIds":null}),r({"accredit.filters.segmentId":null}),r({"accredit.filters.excludeFull":!1})])})()},[]),l||(0,i.jsxs)($b,{children:[(0,i.jsx)(FM,{}),(0,i.jsx)(PM,{event:a.event,organization:a.organization,reload:d})]})},NM=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("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)(Pk,{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()}})},LM=({category:e,reload:t})=>{const{history:n,params:{organizationId:s,eventId:o},translate:r}=cl(),{mutate:a}=function(e={}){return Kn("mutation AccreditationCategoryDuplicate(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n accreditationCategoryDuplicate(\n eventId: $eventId\n accreditationCategoryId: $accreditationCategoryId\n ) {\n id\n }\n}\n",e)}(),[l,d]=(0,M.useState)(!1),[c,u]=(0,M.useState)(!1);return(0,i.jsxs)(Rb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Qb,{returnPathFallback:Ji.ACCREDITATIONS({organizationId:s,eventId:o})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.name}),(0,i.jsx)(Ib,{permissions:xb.ACCREDITATION_EDIT,children:(0,i.jsx)(jl,{color:"white",onClick:()=>u(!0),children:r("_diter_62574")})}),(0,i.jsx)(Ib,{permissions:xb.ACCREDITATION_EDIT,children:(0,i.jsx)(jl,{onClick:()=>{n.push(Os.CREATE_ACCREDITATION(s,o,e.id))},children:r("add_accreditation")})}),(0,i.jsx)(Ib,{permissions:xb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"copy",onClick:async()=>{const{accreditationCategoryDuplicate:{id:t}}=await a({eventId:o,accreditationCategoryId:e.id});n.push(Ji.ACCREDITATION_CATEGORY({organizationId:s,eventId:o,accreditationCategoryId:t}))},children:r("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{d(!0)},children:r("supprimer_43083")})]})]})}),c&&(0,i.jsx)(pP,{accreditationCategory:e,eventId:o,onClose:()=>{u(!1)},onSuccess:t}),l&&(0,i.jsx)(NM,{accreditationCategory:e,eventId:o,onClose:()=>{d(!1)},onSuccess:()=>{n.replace(Ji.ACCREDITATIONS({organizationId:s,eventId:o}))}})]})},BM=e=>{const{translate:t,params:{eventId:n,accreditationCategoryId:s}}=cl(),{data:o,loader:r}=Yn("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:s},[]),{mutate:a}=yo(),[l,d]=(0,M.useState)([]),[c,u]=(0,M.useState)(!1),h=(0,M.useCallback)(async()=>{u(!0),await Promise.all(l.map((e,t)=>a({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:ne.Index,strategy:Qe.Replace,value:t}}))),e.onClose(),e.onSuccess(),u(!1)},[n,l,u,a,e.onClose,e.onSuccess]),m=(0,M.useCallback)(({reason:e,source:t,destination:n})=>{"DROP"===e&&n&&t.index!==n.index&&d(so(l,t.index,n.index))},[l,d]);return(0,M.useEffect)(()=>{d(rC(o.event?.accreditationCategory.accreditations??[]))},[o.event,d]),(0,i.jsx)(zm,{button:(0,i.jsx)(jl,{isLoading:c,onClick:h,children:t("enregistrer_06519")}),category:t("liste_des_accr_02647"),title:t("changer_l_ordre_11550"),onClose:e.onClose,children:r||(0,i.jsxs)(Em,{css:{background:"white "},children:[(0,i.jsx)(br,{font:"gray900 textLg semiBold",children:t("organisation_de_45058")}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(uu.JY,{onDragEnd:m,children:(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Ra,{align:"center",css:{padding:"$4"},gap:"3",children:(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textMd medium",children:o.event.accreditationCategory.name})}),(0,i.jsx)(uu.gL,{droppableId:"main",type:"accreditation",children:e=>(0,i.jsxs)(Ra,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",...e.droppableProps,ref:e.innerRef,children:[l.map((e,t)=>(0,i.jsx)(uu.sx,{draggableId:`a-${e.id}`,index:t,children:t=>(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",...t.draggableProps,ref:t.innerRef,align:"center",children:[(0,i.jsx)(br,{color:"gray300",css:{cursor:"pointer"},...t.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 textSm medium",children:e.name})]})},e.id)),e.placeholder]})})]})})]})})},VM=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n},translate:s}=cl(),[o,r,a]=Pc(""),[l,d]=(0,M.useState)(0),[c,u]=(0,M.useState)({direction:vt.Asc,attribute:oe.Index}),{data:h,isLoading:g,reload:p}=Yn("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:m(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:x}=vu(h.event?.accreditations),[_,I]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Oc,{filters:(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:s("rechercher_une_65646"),value:o,onChange:a})}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"gear",onClick:()=>I(!0)})}),(0,i.jsx)(_m,{placement:"top",children:s("changer_l_ordre_11550")})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mm,{attribute:oe.Name,setSort:u,sort:c,children:s("nom_de_l_accr_d_11908")}),(0,i.jsx)(mm,{attribute:oe.Index,setSort:u,sort:c,children:s("Index")}),(0,i.jsx)(Fc,{children:s("number_of_slots_92461")}),(0,i.jsx)(Fc,{children:s("type_d_affichag_55093")})]}),numberOfPages:f,offset:l,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):0===h.event.accreditations.totalCount?(0,i.jsxs)(Ra,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(Ej,{color:"primary",icon:"user-group"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:s("no_accreditations")})]}):h.event.accreditations.nodes.map(n=>(0,i.jsxs)(Tc,{css:{userSelect:"none"},children:[(0,i.jsx)(yc,{css:{fontWeight:"$medium"},children:(0,i.jsx)(Vc,{to:Ji.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n.id}),children:tC(n)})}),(0,i.jsx)(yc,{children:n.index??"-"}),(0,i.jsx)(yc,{children:n.numberOfSlots}),(0,i.jsx)(yc,{children:s(n.accreditationDisplay)})]},n.id)),setOffset:d,title:s("liste_des_accr_02647"),totalCount:x}),_&&(0,Wt.createPortal)((0,i.jsx)(br,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(BM,{onClose:()=>I(!1),onSuccess:p})}),document.body)]})},UM=()=>{const{translate:e,params:{eventId:t,accreditationCategoryId:n}}=cl(),{data:s,loader:o}=Yn("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},[Ms.AccreditationChartFragment]),[r,a]=(0,M.useState)(),l=(0,M.useMemo)(()=>s.event?.accreditations?.nodes.find(e=>e.id==r),[r]);return o||(0,i.jsx)(tw,{select:(0,i.jsx)(Ra,{width:.5,children:(0,i.jsxs)(Au,{value:r??-1,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{disabled:!0,value:-1,children:e("s_lectionner_un_96571")}),s.event.accreditations.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:tC(e)},e.id))]})}),title:e("r_partition_du_55091"),children:(0,i.jsx)(Ra,{gap:"4",width:1,children:(0,i.jsx)(br,{height:380,width:1,children:r&&l?(0,i.jsx)(zw,{accreditation:l,slots:l.slots}):(0,i.jsx)(xk,{title:e("vous_allez_retr_26787")})})})})},WM=()=>(0,i.jsx)(Ob,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsx)(Ra,{width:1,children:(0,i.jsx)(UM,{})}),(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(VM,{})})]})}),GM=({event:e,reload:t})=>{const{params:{organizationId:n,eventId:s,accreditationCategoryId:o},translate:r}=cl();Td(e.accreditationCategory.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":s,accreditationCategoryId:e?":accreditationCategoryId":o});return(0,i.jsxs)($b,{children:[(0,i.jsx)(LM,{category:e.accreditationCategory,reload:t}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:Ji.ACCREDITATION_CATEGORY_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(Db,{path:Ji.ACCREDITATION_CATEGORY_MEMBERS(a(!1)),children:r("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(Fb,{path:Ji.ACCREDITATION_CATEGORY_DASHBOARD(a(!0)),children:(0,i.jsx)(WM,{})}),(0,i.jsx)(Fb,{path:Ji.ACCREDITATION_CATEGORY_MEMBERS(a(!0)),children:(0,i.jsx)(eM,{accreditationCategoryId:o})})]})]})},HM=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n}}=cl(),{data:s,loader:o,reload:r}=Yn("query AccreditationsCategory(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditationCategory(id: $accreditationCategoryId) {\n id\n name\n assignedResources\n }\n\n volunteersRegistrations(accreditationCategoryId: $accreditationCategoryId) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationCategoryId:n},[]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:Ji.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(ei,{path:Ji.ACCREDITATION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,accreditationCategoryId:n}),replace:!0})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(GM,{event:s.event,reload:r})})]})},qM=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s},translate:o}=cl(),r=Gn(Wc),a=(0,M.useMemo)(()=>wh(r,e.slot,e.slot.accreditation.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:Zs.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsxs)(Rb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Qb,{returnPathFallback:Ji.ACCREDITATIONS({organizationId:t,eventId:n})}),(0,i.jsxs)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:[a,m(e.slot.accreditation.acronym)&&` (${e.slot.accreditation.acronym})`]}),(0,i.jsx)(jl,{to:Os.EDIT_ACCREDITATION(t,n,s),children:o("_diter_62574")})]})},YM=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s,accreditationSlotId:o},translate:r}=cl();Td(wh(Gn(Wc),e.event.accreditationSlot,e.event.accreditationSlot.name));const a=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":s,accreditationSlotId:e?":accreditationSlotId":o});return(0,i.jsxs)($b,{children:[(0,i.jsx)(qM,{slot:e.event.accreditationSlot}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:Ji.ACCREDITATION_SLOT_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(Db,{path:Ji.ACCREDITATION_SLOT_MEMBERS(a(!1)),children:r("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(Fb,{path:Ji.ACCREDITATION_SLOT_DASHBOARD(a(!0)),children:(0,i.jsx)(Ob,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ra,{gap:"6",width:1,children:[(0,i.jsx)(yF,{assignedResources:e.event.accreditationSlot.assignedResources,maxResources:e.event.accreditationSlot.maxResources}),(0,i.jsx)(vF,{accreditationCategoryId:e.event.accreditationSlot.accreditation.accreditationCategoryId,accreditationCategoryName:e.event.accreditationSlot.accreditation.accreditationCategoryName,accreditationName:e.event.accreditationSlot.accreditation.name,color:e.event.accreditationSlot.accreditation.color,customFields:e.organization.customFields.nodes,fields:e.event.accreditationSlot.accreditation.fields,icon:e.event.accreditationSlot.accreditation.icon})]}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(CF,{customFields:e.event.accreditationSlot.accreditation.accreditationsCustomFields}),(0,i.jsx)(pw,{tags:e.event.accreditationSlot.accreditation.tags}),(0,i.jsx)(uw,{privateNote:e.event.accreditationSlot.accreditation.privateNote})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(cw,{description:e.event.accreditationSlot.accreditation.description}),(0,i.jsx)(kF,{location:e.event.accreditationSlot.accreditation})]})]})]})})}),(0,i.jsx)(Fb,{path:Ji.ACCREDITATION_SLOT_MEMBERS(a(!0)),children:(0,i.jsx)(eM,{accreditationSlotId:o})})]})]})},KM=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:s}}=cl(),{data:o,loader:r}=Yn("query AccreditationsSlot(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n id\n name\n date\n assignedResources\n maxResources\n\n accreditation {\n name\n description\n privateNote\n acronym\n icon\n color\n address\n latitude\n longitude\n layer\n zoom\n accreditationCategoryId\n accreditationCategoryName\n fields\n\n accreditationsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n tags {\n id\n name\n }\n }\n }\n\n volunteersRegistrations(accreditationSlotId: $accreditationSlotId) {\n totalCount\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationSlotId:s},[Ms.CustomFieldWithConditionFragment]);return r||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:Ji.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(ei,{path:Ji.ACCREDITATION_SLOT_DASHBOARD({organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:s}),replace:!0})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(YM,{event:o.event,organization:o.organization})})]})},ZM=M.createContext({}),XM=e=>{const t=Jn(),[n,s]=M.useState(e.positionsIds),[o,r]=M.useState(e.positionsCategoriesIds),[a,l]=M.useState(e.positionsSlotsIds);return(0,i.jsx)(ZM.Provider,{value:{isEdit:e.isEdit,isPreAssign:t.pathname.includes("pre-assignment"),positionsIds:n,positionsCategoriesIds:o,positionsSlotsIds:a,showNextVolunteer:e.showNextVolunteer,setPositionsIds:s,setPositionsCategoriesIds:r,setPositionsSlotsIds:l,teams:e.teams},children:e.children})};function JM(){return M.useContext(ZM)}const QM=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl(),{isPreAssign:r,positionsIds:a,positionsCategoriesIds:l,positionsSlotsIds:d,showNextVolunteer:c}=JM(),{mutate:u,isLoading:h}=Yo(),{mutate:m,isLoading:g}=Ca(),{mutate:p,isLoading:f}=function(e={}){return Kn("mutation VolunteerRegistrationAssignmentRefuse(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n volunteerRegistrationAssignmentRefuse(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n ) {\n id\n }\n}\n",e)}(),{mutate:x,isLoading:_}=Zo(),I=(0,M.useCallback)(()=>{e.isEdit?t.goBack(Os.ASSIGNMENTS(n,s)):c()},[e.isEdit,c]);return(0,i.jsxs)(Ra,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(br,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{h||g||f||_||(await p({eventId:s,volunteerRegistrationId:e.volunteerRegistrationId}),I())},children:o("refuser_92819")}),(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsx)(jl,{color:"primary",isLoading:h||g,onClick:async()=>{r?(!eo(a)||h||g||f||_||(await m({eventId:s,massPreAssign:{level:et.Positions,positionsIds:a,positionsCategoriesIds:[],selecteds:{ids:[e.userInfoId]},strategy:Qe.Replace}}),I()),!eo(l)||h||g||f||_||(await m({eventId:s,massPreAssign:{level:et.Categories,positionsIds:[],positionsCategoriesIds:l,selecteds:{ids:[e.userInfoId]},strategy:Qe.Replace}}),I())):h||g||f||_||(eo(d)?await u({eventId:s,massAssign:{positionsSlotsIds:d,selecteds:{ids:[e.userInfoId]},strategy:Qe.Replace}}):await x({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:Ot.WaitingAssignment}}),I())},children:e.isEdit?o("mettre_jour_l_30423"):o(r?"pr_affecter_17434":"affecter_94255")}),(0,i.jsx)(jl,{color:"white",onClick:I,children:e.isEdit?o("annuler_48254"):o("affecter_plus_t_97778")})]})},eN=e=>{const[t,n]=M.useState(e.initialIsOpen);return(0,i.jsxs)(Ra,{css:{bd:!0,userSelect:"none",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Ra,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsx)(br,{css:{flex:"1"},children:e.header}),(0,i.jsx)(jl,{color:"white",leftIcon:t?"chevron-up":"chevron-down",size:"sm",onClick:()=>{n(!t)}})]}),t&&(0,i.jsx)(Ra,{css:{background:"$gray100",padding:"$6"},direction:"column",children:e.children})]})},tN=e=>{const t=Hn(),n=e.assignedResources/e.neededResources;return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,cursor:"pointer",userSelect:"none"},direction:"column",width:1,onClick:e.onClick,children:[(0,i.jsxs)(Ra,{align:"center",css:{padding:"$3 $5"},width:1,children:[(0,i.jsx)(lc,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:Hl.A}),(0,i.jsx)(Ba,{width:"4"}),(0,i.jsx)(pC,{color:e.color,icon:e.icon}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[m(e.category)&&(0,i.jsx)(br,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(br,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsx)(br,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:"user-group"})}),(0,i.jsx)(Ba,{width:"2"}),(0,i.jsxs)(br,{color:"gray700",children:[e.assignedResources,"/",e.neededResources]}),(0,i.jsx)(Ba,{width:"6"}),(0,i.jsx)(br,{width:120,children:(0,i.jsx)(ow,{percent:n})}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsxs)(br,{color:"gray700",textAlign:"end",width:36,children:[Math.min(100,Math.round(100*n)),"%"]})]}),(0,i.jsxs)(Ra,{css:{borderTop:"1px solid $gray200",padding:"$3 $6","&:empty":{display:"none"}},children:[e.overlaps&&(0,i.jsx)(Jd,{color:"warning",leftIcon:"triangle-exclamation",children:t("ce_cr_neau_en_c_55775")}),e.teamMembers]})]})},nN=e=>{const t=Hn(),n=Gn(ah),{positionsIds:s,positionsCategoriesIds:o,setPositionsIds:r,setPositionsCategoriesIds:a}=JM(),l=()=>{a(io(o,e.category.id))};return(0,i.jsx)(eN,{css:{background:"white"},header:(0,i.jsxs)(Ra,{align:"center",children:[(0,i.jsx)(lc,{state:o.includes(e.category.id)?"checked":"unchecked",onClick:l}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(br,{color:"gray800",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"medium",onClick:l,children:e.category.name}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(Jd,{color:"warning",size:"md",children:t("_1_membre_manq_31014",e.category.resources)}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(br,{css:{flex:"1"}})]}),initialIsOpen:!0,children:(0,i.jsx)(Ra,{css:{background:"$gray100"},direction:"column",gap:"2",children:e.category.positions.map(e=>(0,i.jsx)(tN,{assignedResources:e.assignedResources,color:e.color,icon:e.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:!1,subtitle:e.range?n.toDisplayString(e.range):"-",title:e.name,onClick:()=>{r(io(s,e.id))}},e.id))})})},iN=e=>{const t=Hn(),n=(0,M.useMemo)(()=>function(e,t,n,i,s,o){const{wishedPositionsSlots:r,possiblePositionsSlots:a,otherPositionsSlots:l}=Ih(e,t,n,i,s,o),d=new Set,c=e=>Object.values((0,nc.A)(e,e=>e.positionCategory.id)).flatMap(e=>{const t=Object.values((0,nc.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)(br,{font:"gray900 textMd medium",children:t("cat_gorie_mis_36044",n.wishedPositionsCategories.length)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("cat_gories_ou_m_71206")}),(0,i.jsx)(Ba,{height:"3"}),n.wishedPositionsCategories.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(nN,{category:e}),(0,i.jsx)(Ba,{height:"3"})]},e.id)),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("autre_cat_gorie_21569",n.possiblePositionsCategories.length)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("cat_gories_ou_m_50063")}),(0,i.jsx)(Ba,{height:"3"}),n.possiblePositionsCategories.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(nN,{category:e}),(0,i.jsx)(Ba,{height:"3"})]},e.id)),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("autre_cat_gorie_64824",n.otherPositionsCategories.length)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("cat_gories_ou_m_74482")}),(0,i.jsx)(Ba,{height:"3"}),n.otherPositionsCategories.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(nN,{category:e}),(0,i.jsx)(Ba,{height:"3"})]},e.id))]})},sN=e=>{const{translate:t}=cl(),{isPreAssign:n,teams:s}=JM(),o=(0,M.useMemo)(()=>!n&&eo(s)?s.flatMap(t=>t.members.flatMap(t=>t.positionsSlotsUsersInfos.map(e=>e.positionSlotId).includes(e.positionSlotId)?[t.userInfo]:[])):[],[n,s,e.positionSlotId]);return eo(o)?(0,i.jsxs)(Ra,{align:"center",css:{marginLeft:"auto"},gap:"1",children:[(0,i.jsx)(Yy,{teamMembers:o}),(0,i.jsx)(br,{font:"gray800 textXs regular",children:t("_1_quipier_es_00024",o.length)})]}):null},oN=(e,t)=>{const n={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return m(t.name)?`${t.name} - ${e.toLocaleString(t.range,void 0,n)}`:e.toLocaleString(t.range,void 0,n)},rN=e=>{const t=Hn(),n=Gn(ah),{positionsSlotsIds:s,setPositionsSlotsIds:o}=JM(),r=(0,M.useMemo)(()=>e.positionsSlots.filter(t=>e.state===Ot.Assigned&&s.includes(t.id)),[e.state]),{wishedPositionsSlots:a,possiblePositionsSlots:l,otherPositionsSlots:d}=(0,M.useMemo)(()=>{const t=Ih(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,M.useMemo)(()=>{const e=a.concat(l).concat(d);return s.flatMap(t=>{const n=e.find(e=>e.id===t);return n?[n]:[]})},[a,l,d,s]);return(0,i.jsxs)(i.Fragment,{children:[e.state===Ot.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("cr_neau_affect_50400",r.length)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("cr_neaux_sur_le_05515",e.userInfo.name)}),(0,i.jsx)(Ba,{height:"3"}),r.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(tN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:fh(e,c),subtitle:oN(n,e),teamMembers:(0,i.jsx)(sN,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(io(s,e.id))}}),(0,i.jsx)(Ba,{height:"3"})]},e.id)),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("creneau_souhaite",a.length)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("cr_neaux_dont_l_10130")}),(0,i.jsx)(Ba,{height:"3"}),a.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(tN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:fh(e,c),subtitle:oN(n,e),teamMembers:(0,i.jsx)(sN,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(io(s,e.id))}}),(0,i.jsx)(Ba,{height:"3"})]},e.id)),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("autre_creneau_possible",l.length)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("cr_neaux_dont_l_99850")}),(0,i.jsx)(Ba,{height:"3"}),l.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(tN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:fh(e,c),subtitle:oN(n,e),teamMembers:(0,i.jsx)(sN,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(io(s,e.id))}}),(0,i.jsx)(Ba,{height:"3"})]},e.id)),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray900 textMd medium",children:t("autre_creneau",d.length)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("cr_neaux_dont_l_25685")}),(0,i.jsx)(Ba,{height:"3"}),d.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(tN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:fh(e,c),subtitle:oN(n,e),teamMembers:(0,i.jsx)(sN,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(io(s,e.id))}}),(0,i.jsx)(Ba,{height:"3"})]},e.id))]})},aN=e=>{const t=Hn(),n=Gn(Wc),s=(0,M.useMemo)(()=>(e.positionsCategoriesIds||[]).map(t=>e.event.positionsCategories.find(e=>e.id===t).name).join(", "),[e.positionsCategoriesIds,e.event]),o=(0,M.useMemo)(()=>(e.positionsIds||[]).map(t=>e.event.positions.nodes.find(e=>e.id===t).name).join(", "),[e.positionsIds,e.event]),r=(0,M.useMemo)(()=>e.date?n.toLocaleString(e.date,Zs.DateOnly.MonthLong):"",[e.date]),a=(0,M.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,M.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return m(s)||m(o)||m(r)||m(a)||m(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(Ra,{align:"center",gap:"3",wrap:"wrap",children:[m(s)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsCategoriesIds(null)},children:t("cat_gories_1_42029",s)}),m(o)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsIds(null)},children:t("missions_1_62834",o)}),m(r)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),m(a)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),m(l)&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds(null)},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(Jd,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},lN=e=>{const t=Hn(),[n,s]=(0,M.useState)(e.positionsCategoriesIds),[o,r]=(0,M.useState)(e.positionsIds),[a,l]=(0,M.useState)(e.date),[d,c]=(0,M.useState)(e.segmentId?[e.segmentId]:[]),[u,h]=(0,M.useState)(e.tagsIds),[m,g]=(0,M.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,M.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Ra,{direction:"column",onChange:Al,children:[(0,i.jsxs)(Ra,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:s,children:e.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_71859"),renderOnPortal:!0,values:o||[],onChange:r,children:e.event.positions.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Tu,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(fc,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:d,onChange:e=>{eo(e)?c([(0,eu.A)(e)]):c([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(fc,{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)(dc,{state:m,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(dc,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(Ra,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(jl,{size:"sm",onClick:()=>{e.setDate(a),e.setExcludeFull("checked"===m),e.setExcludePast("checked"===p),e.setPositionsCategoriesIds(n),e.setPositionsIds(o),e.setSegmentId(eo(d)?d[0]:null),e.setTagsIds(u),e.close()},children:t("appliquer_05753")})]})]})},dN=e=>{const t=Hn(),[n,s]=(0,M.useState)(!1),o=(0,M.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)(Ra,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_p_70410"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Pd,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:s,children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(Vd,{placement:"bottom-end",width:385,children:(0,i.jsx)(lN,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(aN,{...e,reset:o})]})},cN=e=>{const{eventId:t}=Zn(),{isPreAssign:n}=JM(),[s,o,r]=Pc(""),[a,l]=WT("assignment.filters.positionsCategoriesIds",null),[d,c]=WT("assignment.filters.positionsIds",null),[u,h]=WT("assignment.filters.date",null),[g,p]=WT("assignment.filters.tagsIds",null),[f,x]=WT("assignment.filters.segmentId",null),[_,I]=WT("assignment.filters.excludeFull",!1),[v,b]=WT("assignment.filters.excludePast",!1),{data:j,loader:C}=Yn("query AssignmentSlots(\n $eventId: EventId!\n $name: String\n $positionsCategoriesIds: [PositionsCategoryId!]\n $positionsIds: [PositionId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n positionsSlots(\n positionName: $name\n positionsCategoriesIds: $positionsCategoriesIds\n positionsIds: $positionsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n ) {\n nodes {\n id\n name\n range\n assignedResources\n resources\n\n positionCategory {\n id\n name\n resources\n }\n\n position {\n id\n name\n color\n icon\n assignedResources\n resources\n range\n\n ...PositionPositionsCustomFields\n }\n }\n }\n }\n}\n",{eventId:t,name:m(o)?o:void 0,positionsCategoriesIds:eo(a)?a:void 0,positionsIds:eo(d)?d:void 0,date:u,tagsIds:eo(g)?g:void 0,segmentId:f,excludeFull:_,excludePast:v},[Ms.PositionPositionsCustomFieldsFragment]);return(0,i.jsxs)(Ra,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(dN,{date:u,event:e.event,excludeFull:_,excludePast:v,name:s,organization:e.organization,positionsCategoriesIds:a,positionsIds:d,segmentId:f,setDate:h,setExcludeFull:I,setExcludePast:b,setName:r,setPositionsCategoriesIds:l,setPositionsIds:c,setSegmentId:x,setTagsIds:p,tagsIds:g}),(0,i.jsx)(Ba,{height:"7"}),C||(n?(0,i.jsx)(iN,{positionsSlots:j.event?.positionsSlots.nodes??[],userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}):(0,i.jsx)(rN,{positionsSlots:j.event?.positionsSlots.nodes??[],state:e.state,userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}))]})},uN=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=cl(),a=Jn().pathname.includes("pre-assignment"),{isEventAdmin:l}=Jv();Td(n("affectations_1_71402",e.event.volunteerRegistration.userInfo.name));const[d,c]=WT("assignment.isLeftPanelOpen",!0),[u,h]=WT("assignment.isRightPanelOpen",!0),[g,p,f]=Pc(""),[x,_]=WT("assignment.leftPanelDirection",vt.Desc),[I,v]=WT("assignment.leftPanelSegmentId",-1),[b,j]=WT("assignment.leftPanelStates",[Ot.WaitingAssignment,Ot.PreAssigned]),{data:C,isLoading:y}=Io({eventId:o,states:b,name:m(p)?p:void 0,segmentId:-1===I?void 0:I,direction:x,loadDelegations:!1}),k=(0,M.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(Os.ASSIGNMENTS(s,o)):a?t.replace(Os.PRE_ASSIGNMENT(s,o,i)):t.replace(Os.ASSIGNMENT(s,o,i))},[a,s,o,r,C.event]),A=e.event.volunteerRegistration,w=(0,M.useMemo)(()=>A.positionsSlotsUsersInfos.map(({positionSlotId:e})=>e),[A]),S=(0,M.useMemo)(()=>({wishedPositionsCategoriesIds:A.positionsCategories.map(({id:e})=>e),wishedPositionsIds:A.positions.map(({id:e})=>e),wishedPositionsSlotsIds:A.positionsSlots.map(({id:e})=>e),wishedRanges:A.slots.map(({range:e})=>e)}),[A]);return(0,i.jsx)(XM,{isEdit:e.isEdit,positionsCategoriesIds:A.preassignPositionsCategoriesIds,positionsIds:A.preassignPositionsIds,positionsSlotsIds:w,showNextVolunteer:k,teams:A.teams,children:(0,i.jsx)(iM,{buttons:(0,i.jsx)(QM,{isEdit:e.isEdit,userInfoId:A.userInfo.id,volunteerRegistrationId:A.id}),header:(0,i.jsx)(sM,{badgeColorIcon:Yb(A.state),insertedAt:A.insertedAt,isPreAssign:a,showTabs:l,showTeam:!0,teams:A.teams,userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:d,isRightPanelOpen:u,leftPanel:(0,i.jsx)(aM,{accreditationStates:[],delegationId:null,direction:x,event:C.event,getPath:e=>a?Os.PRE_ASSIGNMENT(s,o,e):Os.ASSIGNMENT(s,o,e),isLoading:y,loadDelegations:!1,name:g,segmentId:I,setAccreditationStates:Hl.A,setDelegationId:Hl.A,setDirection:_,setName:f,setSegmentId:v,setStates:j,showAccreditationStates:!1,showStates:!0,states:b,userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(pM,{customFields:e.event.formsCustomsFields,eventId:o,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:s,showWishedAccreditations:!1,showWishedPositions:!0,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{h(!1)}}),setIsLeftPanelOpen:c,setIsRightPanelOpen:h,children:(0,i.jsx)(cN,{event:e.event,organization:e.organization,state:A.state,userInfo:A.userInfo,...S})})})},hN=e=>{const{organizationId:t,eventId:n,userInfoId:s}=Zn(),{data:o,loader:r}=Yn("query AssignmentInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n positionsCategories {\n id\n name\n }\n\n positions {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Positions) {\n id\n name\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n userInfoId\n state\n preassignPositionsIds\n preassignPositionsCategoriesIds\n isTeamMember\n insertedAt\n\n teams {\n leaderUserInfoId\n teamCode\n\n members {\n positionsSlotsUsersInfos {\n positionSlotId\n }\n\n userInfo {\n ...UserInfoTeamMember\n }\n }\n }\n\n userInfo {\n id\n name\n email\n fields\n picture {\n url\n }\n }\n\n positionsCategories {\n id\n }\n\n positions {\n id\n }\n\n positionsSlots {\n id\n }\n\n slots: slotsMerged {\n range\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Ms.FormsUsersInfosWishedFragment,Ms.CustomFieldWithConditionFragment,Ms.UserInfoTeamMemberFragment]);return r||(0,i.jsx)(uN,{event:o.event,isEdit:e.isEdit,organization:o.organization})},mN=e=>{const t=Hn(),{mutate:n,isLoading:s}=function(e={}){return Kn("mutation SendAssignmentsEmails(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsSend(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}();return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ej,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("les_membres_pr_53976")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:s,onClick:async()=>{await n({eventId:e.eventId,sendAssignmentsEmails:e.sendAssignmentsEmails}),e.reload(),e.onClose()},children:t("confirmer_l_env_08749")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},gN=e=>{const t=Hn(),[n,s,o]=Pc(""),[r,a]=(0,M.useState)([]),{data:l}=Br({eventId:e.eventId,usersInfosIds:r,name:m(s)?s:void 0}),{mutate:d,isLoading:c}=function(e={}){return Kn("mutation AssignmentsEmailsEstimate(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsEstimate(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}(),[u,h]=(0,M.useState)(ae.Everyone),g=(0,M.useMemo)(()=>(0,ch.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),[p,f]=(0,M.useState)([]),x=u===ae.Everyone||u===ae.Assigned||u===ae.Refused||u===ae.Members&&eo(r)||u===ae.Segments&&eo(p),_=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ej,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_81363")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(Ba,{height:"7"}),_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ja,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_69435")}),(0,i.jsx)(Ba,{height:"4"})]}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(hc,{state:u===ae.Everyone?"checked":"unchecked",onClick:()=>{h(ae.Everyone)},children:t("tous_les_e_mail_39319")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:u===ae.Assigned?"checked":"unchecked",onClick:()=>{h(ae.Assigned)},children:t("tous_les_e_mail_42685")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:u===ae.Refused?"checked":"unchecked",onClick:()=>{h(ae.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:u===ae.Members?"checked":"unchecked",onClick:()=>{h(ae.Members)},children:t("_certains_memb_91094")}),u===ae.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{paddingLeft:"$6"},children:(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:o}),values:r,onChange:a,children:g.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:u===ae.Segments?"checked":"unchecked",onClick:()=>{h(ae.Segments)},children:t("uniquement_ce_54026")}),u===ae.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(br,{css:{paddingLeft:"$6"},children:(0,i.jsx)(fc,{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)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{disabled:_,isLoading:c,onClick:async()=>{if(x){const t={recipients:u,segmentsIds:p,usersInfosIds:r},{eventAssignmentsEmailsEstimate:n}=await d({eventId:e.eventId,sendAssignmentsEmails:t});e.onSuccess(n,t),e.onClose()}},children:t("envoyer_les_e_m_37846")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},pN=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=cl(),{localEvent:o,setNumberOfWaitingAssigments:r}=Jv(),{data:a,loader:l,reload:d}=Yn('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:s,direction:o?.["assignment.leftPanelDirection"]??vt.Desc},[]);const c=Rc(),[u,h,g]=Pc(""),[p,f]=(0,M.useState)(""),[x,_]=(0,M.useState)(0),{data:I,isLoading:v,reload:b}=function(e){return Yn("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,[Ms.EmailRecipientFragment])}({eventId:s,name:m(h)?h:void 0,state:""!==p?p:void 0,offset:x}),[j,C]=(0,M.useState)(!1),[y,k]=(0,M.useState)(null),[A,w]=(0,M.useState)(0),[S,E]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{a.event?.waitingAssignment&&r(a.event.waitingAssignment.totalCount)},[a]),l||(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)(Fw,{button:(0,i.jsxs)(i.Fragment,{children:[a.event.hasFormWithTeamsAllowed&&(0,i.jsx)(jl,{color:"invisible",disabled:0===a.event.waitingTeams.totalCount,onClick:()=>{e.push(Os.TEAM_ASSIGNMENT(n,s,a.event.waitingTeams.nodes[0].teamCode))},children:t("affecter_les_q_17322")}),(0,i.jsx)(jl,{disabled:0===a.event.waitingAssignment.totalCount,onClick:()=>{e.push(Os.ASSIGNMENT(n,s,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)(Fw,{button:(0,i.jsx)(jl,{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)(Fw,{button:(0,i.jsx)(jl,{onClick:()=>{e.push(Os.VOLUNTEERS(n,s))},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)(Ba,{height:"9"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("historique_des_68195")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)(Fw,{icon:"paper-plane",iconColor:"purple",text:t("nombre_d_envois_95106"),value:a.event.emailsStats.numberOfSent??0}),(0,i.jsx)(Fw,{icon:"eye",iconColor:"success",text:t("nombre_d_ouvert_84187"),value:a.event.emailsStats.numberOfOpen??0}),(0,i.jsx)(Fw,{icon:"hand-pointer",iconColor:"primary",text:t("nombre_de_clics_64232"),value:a.event.emailsStats.numberOfClick??0})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{value:p,onChange:e=>{f(e),_(0)},children:[(0,i.jsx)("option",{value:"",children:t("tous_les_status_67644")}),c(on.filter(e=>e!==Se.Queued))]})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_d_02329"),value:u,onChange:e=>{g(e),_(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:t("nom_du_membre_69353")}),(0,i.jsx)(Fc,{children:t("date_d_envoi_74668")}),(0,i.jsx)(Fc,{children:t("status_06428")}),(0,i.jsx)(Fc,{width:100})]}),numberOfPages:I.event?.emails.numberOfPages??0,offset:x,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):eo(I.event.emails.nodes)?(0,i.jsx)(i.Fragment,{children:I.event.emails.nodes.map(e=>(0,i.jsx)(Gb,{email:e,emailType:Te.Assignments,reload:b},e.id))}):(0,i.jsx)(ek,{subtitle:t("vous_n_avez_pas_92612"),title:t("aucun_courriel_12121")}),setOffset:_,title:t("liste_des_envoi_52697"),totalCount:I.event?.emails.totalCount??0}),j&&(0,i.jsx)(gN,{emailSender:a.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{C(!1)},onSuccess:(e,t)=>{w(e),k(t),E(!0)}}),S&&(0,i.jsx)(mN,{eventId:s,numberOfEmails:A,reload:d,sendAssignmentsEmails:y,onClose:()=>{E(!1)}})]})},fN=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=cl(),{localEvent:o}=Jv(),{data:r,loader:a}=Yn('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:s,direction:o?.["assignment.leftPanelDirection"]??vt.Desc},[]);return a||(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{gap:"6",children:(0,i.jsx)(Fw,{button:(0,i.jsx)(jl,{disabled:0===r.event.preAssigneds.totalCount,onClick:()=>{e.push(Os.ASSIGNMENT(n,s,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})})]})},xN=()=>{const{translate:e,params:{eventId:t}}=cl(),{event:{name:n},hasPermission:s,updateLocalEvent:o}=Jv(),r=s(xb.MEMBER_ASSIGN,{eventId:t});return Td(`${n} ${e("mes_affectation_73224")}`),(0,M.useEffect)(()=>{(async()=>{await Promise.all([o({"assignment.filters.positionsCategoriesIds":null}),o({"assignment.filters.positionsIds":null}),o({"assignment.filters.date":null}),o({"assignment.filters.tagsIds":null}),o({"assignment.filters.segmentId":null}),o({"assignment.filters.excludeFull":!1})])})()},[]),r?(0,i.jsx)(pN,{}):(0,i.jsx)(fN,{})},_N=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,teamCode:r}}=cl(),a=r===e.team.teamCode,[l,d]=(0,M.useState)(a);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{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(Os.TEAM_ASSIGNMENT(s,o,e.team.teamCode))},children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:e.team.teamCode}),(0,i.jsx)(br,{color:"gray500",children:n("_1_membre_49737",e.team.members.length)})]}),(0,i.jsx)(br,{color:"gray900",css:{cursor:"pointer",padding:"$2"},fontSize:"textMd",onClick:e=>{Al(e),d(!l)},children:(0,i.jsx)(Ya,{icon:l?"chevron-down":"chevron-right"})})]}),l&&e.team.members.map((n,r)=>(0,i.jsx)(oM,{displayBorder:r===e.team.members.length-1,isSelected:a,vr:n,onClick:()=>{t.push(Os.TEAM_ASSIGNMENT(s,o,e.team.teamCode))}},n.userInfo.id))]})},IN=e=>{const{params:{organizationId:t,eventId:n,teamCode:s},translate:o}=cl(),r=e.event?.teams.totalCount??0,a=e.event?.teams.nodes??[];return(0,i.jsxs)(Ra,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ra,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Qb,{color:"primary",returnPathFallback:Os.TEAM_ASSIGNMENT(t,n,s),children:o("retour_92202")}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(Jd,{color:"error",size:"sm",children:o("_1_quipe_rest_49090",r)})]})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rM,{}),(0,i.jsx)(rM,{}),(0,i.jsx)(rM,{})]}):a.map(e=>(0,i.jsx)(_N,{team:e},e.teamCode))})]})},vN=()=>{const{translate:e,params:{eventId:t,teamCode:n}}=cl(),{positionsSlotsIds:s,showNextVolunteer:o}=JM(),{mutate:r,isLoading:a}=function(e={}){return Kn("mutation TeamAssignmentRefuse($eventId: EventId!, $teamCode: TeamCode!) {\n teamAssignmentRefuse(eventId: $eventId, teamCode: $teamCode)\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return Kn("mutation TeamAssign($eventId: EventId!, $teamCode: TeamCode!, $assignment: AssignmentInput!) {\n teamAssign(eventId: $eventId, teamCode: $teamCode, assignment: $assignment)\n}\n",e)}();return(0,i.jsxs)(Ra,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(br,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{d||a||(await r({eventId:t,teamCode:n}),o())},children:e("refuser_l_quip_29246")}),(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsx)(jl,{color:"primary",isLoading:d,onClick:async()=>{d||a||(await l({eventId:t,teamCode:n,assignment:{positionsSlotsIds:s}}),o())},children:e("affecter_l_qui_23291")}),(0,i.jsx)(jl,{color:"white",onClick:o,children:e("affecter_l_qui_37763")})]})},bN=e=>{const t=Hn();return(0,i.jsx)(Ra,{align:"center",css:{padding:"$5 $6"},gap:"4",children:(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{font:"gray900 textXl medium",children:e.team.teamCode}),(0,i.jsx)(br,{color:"gray500",children:t("_1_membre_49737",e.team.members.length)})]})})},jN=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=(0,M.useMemo)(()=>e.team.leaderUserInfo.formsUsersInfos.filter(t=>t.form.id===e.team.formId),[e.team]);return(0,i.jsxs)(Ra,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ra,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(Ya,{icon:"sidebar"})})}),(0,i.jsx)(_m,{placement:"top",children:t("cacher_les_info_67266")})]}),(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:t("_propos_de_l_47506")})]}),e.team.members.map(n=>(0,i.jsx)(hM,{customFields:e.customFields,formsIds:[e.team.formId],title:t("informations_de_63884",n.userInfo.nameOrEmail),userInfo:n.userInfo},n.id)),(0,i.jsx)(mM,{eventId:s,formsUsersInfos:o,organizationId:n}),(0,i.jsx)(gM,{formsUsersInfos:o})]})},CN=e=>{const{history:t,params:{organizationId:n,eventId:s,teamCode:o}}=cl(),[r,a]=WT("assignment.isLeftPanelOpen",!0),[l,d]=WT("assignment.isRightPanelOpen",!0),{data:c,isLoading:u}=Yn("query TeamAssignmentWaitingTeams($eventId: EventId!) {\n event(id: $eventId) {\n teams(state: WaitingAssignment) {\n nodes {\n teamCode\n\n members {\n ...VolunteerRegistrationWaitingAssignment\n }\n }\n\n totalCount\n }\n }\n}\n",{eventId:s},[Ms.VolunteerRegistrationWaitingAssignmentFragment]),h=(0,M.useCallback)(()=>{const e=c.event?.teams.nodes??[],i=e.findIndex(e=>e.teamCode===o),r=e[i+1]?.teamCode??e[0].teamCode;r===o?t.goBack(Os.ASSIGNMENTS(n,s)):t.replace(Os.TEAM_ASSIGNMENT(n,s,r))},[n,s,o,c.event]),m=e.event.team,g=(0,M.useMemo)(()=>({wishedPositionsCategoriesIds:m.positionsCategoriesIds,wishedPositionsIds:m.positionsIds,wishedPositionsSlotsIds:m.positionsSlotsIds,wishedRanges:m.slots.map(({range:e})=>e)}),[m]);return(0,i.jsx)(XM,{isEdit:!1,positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[],showNextVolunteer:h,teams:[],children:(0,i.jsx)(iM,{buttons:(0,i.jsx)(vN,{}),header:(0,i.jsx)(bN,{team:m}),isEdit:!1,isLeftPanelOpen:r,isRightPanelOpen:l,leftPanel:(0,i.jsx)(IN,{event:c.event,isLoading:u}),rightPanel:(0,i.jsx)(jN,{customFields:e.event.formsCustomsFields,team:m,onCollapse:()=>{d(!1)}}),setIsLeftPanelOpen:a,setIsRightPanelOpen:d,children:(0,i.jsx)(cN,{event:e.event,organization:e.organization,state:Ot.NotApplicable,userInfo:m.leaderUserInfo,...g})})})},yN=()=>{const{params:{organizationId:e,eventId:t,teamCode:n}}=cl(),{data:s,loader:o}=Yn("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},[Ms.CustomFieldWithConditionFragment,Ms.FormsUsersInfosWishedFragment]);return o||(0,i.jsx)(CN,{event:s.event,organization:s.organization})},kN=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:s}=cl(),{event:{name:o},isEventAdmin:r}=Jv(),{canCampaignSend:a}=lS();Td(`${o} ${s("Campaigns")}`);const l=Rc(),[d,c]=(0,M.useState)(""),[u,h]=(0,M.useState)(""),g=Dc(e=>{h(e),b()}),[p,f]=(0,M.useState)(""),[x,_]=(0,M.useState)(""),[I,v]=(0,M.useState)(0),b=()=>{v(0)},[j,C]=(0,M.useState)(null),{data:y,isLoading:k,reload:A}=Yn("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:m(u)?u:void 0,states:""!==p?[p]:void 0,campaignType:""!==x?x:void 0,offset:I,sort:j},[Ms.CampaignListFragment]);return MR(y.event?.campaigns.nodes??[],A),(0,i.jsxs)($b,{children:[(0,i.jsxs)(Rb,{children:[(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:s("Campaigns")}),r?(0,i.jsx)(wS,{menu:(0,i.jsx)(Ld,{icon:"paper-plane",onClick:()=>{e.push(jI.CREATE_TEMPLATE({organizationId:t,eventId:n}))},children:s("cr_er_un_mod_le_20298")}),onClick:()=>{e.push(jI.CREATE({organizationId:t,eventId:n}))},children:s("cr_er_une_campa_96023")}):a?(0,i.jsx)(jl,{to:jI.CREATE({organizationId:t,eventId:n}),children:s("cr_er_une_campa_96023")}):null]}),(0,i.jsxs)(Ob,{children:[(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Bb,{content:y.event?.doneCampaigns.totalCount??"-",title:s("nombre_de_campa_52133")}),(0,i.jsx)(Bb,{content:y.event?.campaignsCost??"-",title:s("co_t_des_campag_08459")})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Ra,{css:{boxShadow:"$xs"},direction:"column",children:(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{value:p,onChange:e=>{f(e),b()},children:[(0,i.jsx)("option",{value:"",children:s("toutes_les_camp_81617")}),l(Kt)]})}),(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{value:x,onChange:e=>{_(e),b()},children:[(0,i.jsx)("option",{value:"",children:s("sms_et_e_mail_94587")}),l(Zt)]})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:s("rechercher_une_69554"),value:d,onChange:e=>{c(e),g(e)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mm,{attribute:le.Name,setSort:C,sort:j,children:s("nom_de_la_campa_45063")}),(0,i.jsx)(mm,{attribute:le.Type,css:{flex:"0 150px"},setSort:C,sort:j,children:s("type_35427")}),(0,i.jsx)(Fc,{css:{flex:"0 200px"},children:s("nombre_de_desti_21374")}),(0,i.jsx)(Fc,{css:{flex:"0 150px"},children:s("co_t_68998")}),(0,i.jsx)(mm,{attribute:le.State,css:{flex:"0 150px"},setSort:C,sort:j,children:s("status_06428")}),(0,i.jsx)(Fc,{css:{flex:"0 100px"}})]}),numberOfPages:y.event?.campaigns.numberOfPages??0,offset:I,rows:k?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:eo(y.event.campaigns.nodes)?(0,i.jsx)(i.Fragment,{children:y.event.campaigns.nodes.map(e=>(0,i.jsx)(FR,{campaign:e,canSendCampaigns:a,eventId:n,organizationId:t,reload:A},e.id))}):(0,i.jsx)(ek,{title:s("no_campaigns")})}),setOffset:v,title:s("liste_des_campa_60034"),totalCount:y.event?.campaigns.totalCount??0})})]})]})},AN=({organizationId:e,eventId:t,category:n,clickable:s})=>{const o=Hn();return(0,i.jsx)(Tc,{children:(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Ra,{gap:"3",justify:"between",children:[s?(0,i.jsx)(Vc,{to:ms.POSITION_CATEGORY({organizationId:e,eventId:t,positionCategoryId:n.id}),children:n.name}):(0,i.jsx)(br,{color:"gray700",children:n.name}),(0,i.jsx)(br,{color:"gray700",children:o("_1_2_membres_04485",n.assignedResources,n.resources)})]}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)(ow,{percent:n.assignedResources/n.resources})})]})})},n.id)},wN=e=>(0,i.jsx)(Ra,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",padding:"$3 $4"},gap:"3",width:1,children:(0,i.jsxs)(Ha,{to:e.path,width:1,children:[(0,i.jsx)(Ra,{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)(Ya,{icon:"check"})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray800",css:{textDecoration:e.isDone?"line-through":""},fontWeight:"medium",children:e.title}),(0,i.jsx)(br,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(br,{color:"gray900",css:{cursor:"pointer"},children:(0,i.jsx)(Ya,{icon:"arrow-right"})})]})}),SN=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=cl(),o=Gn(Kg),{isEventAdmin:r}=Jv(),{data:a,loader:l}=Yn("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:s},[]),d=(0,M.useMemo)(()=>a.event?(0,ic.A)(a.event.positionsCategories,e=>e.name.toLowerCase()):[],[a.event]),c=!(!r||!a.event||a.event.onboarding.isFirstCampaignCreated&&a.event.onboarding.isFirstFormCreated&&a.event.onboarding.isFirstPositionCreated);return l||(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:t("tableau_de_bord_24627")}),(0,i.jsx)(Ba,{height:"7"}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eN,{header:(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("vos_premiers_pa_81169")}),(0,i.jsx)(br,{color:"gray500",children:t("pour_bien_d_mar_03933")})]}),initialIsOpen:!0,children:(0,i.jsxs)(Ra,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(wN,{isDone:a.event.onboarding.isFirstPositionCreated,path:Os.CREATE_POSITION(n,s),subtitle:t("cr_er_une_nouve_43436"),title:t("cr_er_votre_pre_70209")}),(0,i.jsx)(wN,{isDone:a.event.onboarding.isFirstFormCreated,path:Fi.FORMS({organizationId:n,eventId:s}),subtitle:t("cr_er_un_formul_31199"),title:t("cr_er_votre_pre_76199")}),(0,i.jsx)(wN,{isDone:a.event.onboarding.isFirstCampaignCreated,path:jI.CREATE({organizationId:n,eventId:s}),subtitle:t("communiquer_fac_26569"),title:t("envoyer_votre_p_47899")})]})}),(0,i.jsx)(Ba,{height:"8"})]}),(0,i.jsxs)(id,{gap:"6",gridtemplatecolumns:"1fr 1fr 350px",gridtemplaterows:"1fr 1fr",children:[(0,i.jsx)(br,{css:{gridColumn:"1 / 2",gridRow:"1 / 2"},children:(0,i.jsx)(Fw,{button:(0,i.jsx)(jl,{to:ms.POSITIONS({organizationId:n,eventId:s}),children:t("voir_les_missio_71964")}),icon:"user-group",iconColor:"primary",text:t("nombre_de_membr_60320",a.event.resources),value:a.event.resources})}),(0,i.jsx)(br,{css:{gridColumn:"2 / 3",gridRow:"1 / 2"},children:(0,i.jsx)(Fw,{button:(0,i.jsx)(jl,{to:ms.POSITIONS({organizationId:n,eventId:s}),children:t("voir_les_missio_71964")}),icon:"sitemap",iconColor:"purple",text:t("nombre_de_missi_67304",a.event.numberOfPositions),value:a.event.numberOfPositions})}),(0,i.jsx)(br,{css:{gridColumn:"1 / 2",gridRow:"2 / 3"},children:(0,i.jsx)(Fw,{button:(0,i.jsx)(jl,{onClick:()=>{e.push(Os.VOLUNTEERS(n,s))},children:t("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:t("nombre_de_membr_87779",a.event.assignmentsStats.numberOfAssigned),value:a.event.assignmentsStats.numberOfAssigned})}),(0,i.jsx)(br,{css:{gridColumn:"2 / 3",gridRow:"2 / 3"},children:(0,i.jsx)(Fw,{button:(0,i.jsx)(jl,{onClick:()=>{e.push(Os.ASSIGNMENTS(n,s))},children:t("voir_mes_affect_10965")}),icon:"wand-magic-sparkles",iconColor:"warning",text:t("nombre_de_membr_63555",a.event.assignmentsStats.numberOfWaitingAssignment),value:a.event.assignmentsStats.numberOfWaitingAssignment})}),(0,i.jsxs)(Ra,{css:{bd:!0,gridColumn:"3 / 4",gridRow:"1 / 3",padding:"$6"},direction:"column",justify:"between",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{color:"gray500",children:t("taux_de_remplis_11913")}),(0,i.jsxs)(br,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:[0===a.event.resources?"0":Math.round(a.event.assignedResources/a.event.resources*100),"%"]})]}),(0,i.jsx)(br,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{color:"gray500",children:t("temps_de_b_n_vo_87924")}),(0,i.jsx)(br,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(a.event.volunteerMinutesNeeded)})]}),(0,i.jsx)(br,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{color:"gray500",children:t("temps_de_b_n_vo_60725")}),(0,i.jsx)(br,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(a.event.volunteerMinutesAssigned)})]})]})]}),(0,i.jsx)(Ba,{height:"8"}),r&&(0,i.jsx)(br,{css:{boxShadow:"$xs"},children:(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Fc,{children:t("cat_gories_24533")})}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:d.length>0?d.map(e=>(0,i.jsx)(AN,{category:e,clickable:!0,eventId:s,organizationId:n},e.id)):(0,i.jsx)(ek,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:Hl.A,title:t("liste_des_membr_59735"),totalCount:0})})]})};var EN;let TN=class extends AO{static{EN=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...AO.IMPORT_COLUMNS_DEFAULT,CategoryName:"categoryName",Name:"name",FormId:"formId",Deadline:"deadline",MaxResources:"maxResources",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===Ye.Update?[EN.IMPORT_COLUMNS_DEFAULT.Id]:[],EN.IMPORT_COLUMNS_DEFAULT.Name,EN.IMPORT_COLUMNS_DEFAULT.FormId];default(e){const t=super.default(e);return t.input={...t.input,notifyLeaders:!1},t}constructor(e,t){super(e,t),this.csvInputService=e}};TN=EN=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[aO,Vn])],TN);const zN=()=>{const{params:{organizationId:e,eventId:t},translate:n}=cl(),{mutate:s}=function(e={}){return Kn("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:o}=ib(),r=(0,M.useCallback)((e,n)=>o(e,t,n),[o,t]),{data:a,loader:l}=Gr({organizationId:e,variety:_e.Delegation});return l||(0,i.jsx)(CO,{ImportInputService:TN,additionalOptions:(0,i.jsx)(Bm,{name:"input.notifyLeaders",children:n("informer_les_re_38743")}),checkImport:r,closePath:as.DELEGATIONS({organizationId:e,eventId:t}),customFields:a.organization.customFields.nodes,importTagPrefix:"delegations",itemName:{singular:n("team_33516"),plural:n("teams_75559")},localStorageKeyPrefix:"DELEGATIONS_IMPORT",mutate:s,showModeSelection:!1,title:n("import_de_d_l_g_69356")})},ON=e=>{const{translate:t,params:{eventId:n}}=cl(),{isEventAdmin:s}=Jv(),[o,r]=(0,M.useState)(e.delegationAccreditationSlot),a=(0,M.useMemo)(()=>Kd(e.accreditationSlot.accreditation.color),[e.accreditationSlot]),l=(0,M.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,M.useCallback)(async()=>{const{event:{delegation:t}}=await Oo({eventId:n,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlot.id},await q());r(t.accreditationSlot)},[e.accreditationSlot,e.delegationId,r]),[c,u]=(0,M.useState)(!1),h=o.maxResources?`/${o.maxResources}`:"",m=`${o.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{...l,borderRadius:"$1",cursor:s?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,width:1,onClick:()=>{s&&u(!0)},children:[(0,i.jsx)(FA,{background:a[100],count:m,display:"vertical",icon:"badge-check",text:t("attribu_es_48167")}),(0,i.jsx)(FA,{background:a[100],count:o.wishedResources,display:"vertical",icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(FA,{background:a[100],count:o.scannedResources,display:"vertical",icon:"scanner-gun",text:t("scann_es_13169")})]}),s&&c&&(0,i.jsx)(PA,{accreditationSlotId:e.accreditationSlot.id,delegationId:e.delegationId,eventId:n,onClose:()=>(u(!1),d())})]})},RN=e=>{const t=(0,M.useMemo)(()=>(e.delegation.accreditationsSlots||[]).find(t=>t.accreditationSlotId===e.accreditationSlot.id),[e.delegation,e.accreditationSlot]);return t?(0,i.jsx)(ON,{accreditationSlot:e.accreditationSlot,delegationAccreditationSlot:t,delegationId:e.delegation.id}):null},$N=e=>(0,i.jsx)(Ra,{css:{borderTop:"1px solid $gray200",height:"$cellHeightXl"},children:e.accreditationsSlots.map(t=>(0,i.jsx)(Ra,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(RN,{accreditationSlot:t,delegation:e.delegation})},t.id))}),DN=e=>{const{params:{organizationId:t,eventId:n}}=cl(),s=(0,M.useMemo)(()=>pA(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,M.useMemo)(()=>fA(s,e.selectedSlotsIds),[s,e.selectedSlotsIds]),r=(0,M.useMemo)(()=>xA(o,e.selectedSlotsIds),[o,e.selectedSlotsIds]),a=(0,M.useMemo)(()=>r.map(e=>e.id),[r]),l=(0,M.useCallback)(e=>(0,i.jsx)(Ra,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightXl",px:"$4"},width:1,children:(0,i.jsx)(Vc,{to:as.DELEGATION({organizationId:t,eventId:n,delegationId:e.id}),children:e.name})},e.id),[t,n]),d=(0,M.useCallback)(e=>(0,i.jsx)($N,{accreditationsSlots:r,delegation:e},e.id),[r,a]);return(0,i.jsx)(Ra,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(_l,{}):(0,i.jsx)(_A,{allAccreditations:s,cellWidth:200,data:e.delegations,filteredAccreditations:o,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:l,renderRow:d,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setSelectedSlotsIds:e.setSelectedSlotsIds,slots:r,totalCount:e.totalCount})})},PN=()=>{const{params:{organizationId:e,eventId:t}}=cl(),{columns:n,infos:s,limit:o,nameDebounced:r,offset:a,predicates:l,rendering:d,setInfos:c,setLimit:u,setOffset:h}=HC(),g=(0,M.useMemo)(()=>qR(n,d),[n,d]),{data:p,isLoading:f}=Yn("query DelegationsAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true, usedInDelegations: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:t},[Ms.AccreditationSlotMatrixFragment]),{data:x,isLoading:_}=Xr({...g,organizationId:e,eventId:t,level:tt.Event,predicates:l,name:m(r)?r:null,limit:o,offset:a}),{numberOfPages:I,totalCount:v}=vu(x.data?.rows),b=(0,M.useMemo)(()=>s.delegationsMatrixSelectedSlotsIds||[],[s]),j=(0,M.useCallback)(e=>c({...s,delegationsMatrixSelectedSlotsIds:e}),[s,c]);return(0,i.jsx)(DN,{allAccreditationsSlots:p.event?.accreditationsSlots.nodes??[],delegations:x.data?.rows.nodes??[],isLoading:_||f,limit:o,numberOfPages:I,offset:a,selectedSlotsIds:b,setLimit:u,setOffset:h,setSelectedSlotsIds:j,totalCount:v})},FN=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:r}=cl(),{mutate:a,isLoading:l}=ja(),[d,c]=(0,M.useState)(!1),[u,h]=(0,M.useState)([]),[m,g]=(0,M.useState)(!0),p=!d||eo(u);return(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"user-group",subtitle:r("ajoutez_une_d_l_54234"),children:r("cr_ation_d_une_07120")}),(0,i.jsxs)(lb,{children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:r("que_souhaitez_v_87607")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(xR,{state:d?"unchecked":"checked",onClick:()=>c(!1),children:r("cr_er_une_nouve_45377")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(xR,{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)(Ba,{height:"7"}),(0,i.jsx)(fc,{isSearchVisible:!0,label:r("_quelle_d_l_ga_55758"),multiple:!1,renderOnPortal:!0,values:u,onChange:h,children:e.parentDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(xu,{value:m,onChange:g,children:r("je_souhaite_app_69393")})]})]}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{disabled:!p,isLoading:l,onClick:async()=>{let i;if(d&&eo(u)){const t=u[0],n=e.parentDelegations.find(e=>e.id===t);eo(n.leadersIds)&&await a({eventId:s,usersInfosIds:n.leadersIds,sendVolunteerRegistrationEmail:!1}),i=o(JSON.stringify({parentId:t,applyParentSettings:m}))}t.push(Os.CREATE_DELEGATION(n,s,i))},children:r("suivant_62774")})})]})},MN=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:s}=cl(),{segment:o,columns:r}=HC(),{data:a}=Yn("query ParentDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization) {\n nodes {\n id\n name\n leadersIds\n }\n }\n }\n}\n",{organizationId:t},[]),{mutate:l}=function(e={}){return Kn("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,M.useState)(!1),[u,h]=(0,M.useState)(!1),m=eo(a.organization?.delegations.nodes),{checkExport:g}=ib();return(0,i.jsxs)(RR,{children:[(0,i.jsx)(Ib,{permissions:xb.DELEGATION_EDIT,children:m?(0,i.jsxs)(ub,{children:[(0,i.jsx)(hb,{children:(0,i.jsx)(wS,{menu:(0,i.jsx)(Ld,{icon:"file-import",to:Os.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>$d(e.target),children:s("importer_des_d_05454")}),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsx)(FN,{parentDelegations:a.organization.delegations.nodes})]}):(0,i.jsx)(wS,{menu:(0,i.jsx)(Ld,{icon:"file-import",to:Os.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>$d(e.target),children:s("importer_des_d_05454")}),path:Os.CREATE_DELEGATION(t,n),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsxs)(Ib,{permissions:xb.DELEGATION_EDIT,children:[(0,i.jsx)(Ld,{icon:"plus",onClick:()=>{c(!0)},children:s("cr_er_une_cat_g_20051")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"})]}),(0,i.jsx)(Ld,{icon:"file-xls",onClick:e=>{$d(e.target),h(!0)},children:s("exporter_en_exc_51862")})]})]}),(0,i.jsx)(N$,{isOpen:u,requestExport:async e=>{const{jobId:i}=await l({organizationId:t,eventId:n,segmentId:o.id,format:e,columns:r});g(t,n,i)},showIncludeFiles:!1,onClose:()=>{h(!1)}}),d&&(0,i.jsx)(SC,{eventId:n,organizationId:t,onClose:()=>c(!1),onSuccess:i=>{e.push(as.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:i.id}))}})]})},NN=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{canDelegationEdit:o,canSegmentEdit:r}=lS(),{limit:a,rendering:l,segment:d}=HC(),c=r&&l===Rh.List,u=o&&l===Rh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(MN,{}),0===e.numberOfDelegations?(0,i.jsx)(Ob,{css:{overflow:"hidden"},children:(0,i.jsx)(br,{css:{overflow:"hidden"},width:1,children:(0,i.jsx)(xk,{title:t("vous_n_avez_pas_58215")})})}):(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{actions:(0,i.jsx)(s$,{}),searchPlaceholder:t("rechercher_une_31213"),showActions:o,showEditColumns:c,showEditMode:u,showSearchColumns:r}),selectSegment:(0,i.jsx)(QR,{pageSelectedText:t("les_1_d_l_gat_27248",a),segmentSelectedText:t("les_1_d_l_gat_04594",d.count,d.name)})}),l===Rh.AccreditationsMatrix?(0,i.jsx)(PN,{}):(0,i.jsx)(T$,{customFields:e.customFields,eventId:s,level:tt.Event,organizationId:n})]})]})},LN=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=cl(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=Jv(),c=Gn(YR),u=(0,M.useMemo)(()=>c.getDelegationsFilters(e.event.organizationId,o,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.event,e.organization,o]),h=(0,M.useMemo)(()=>c.getDelegationsPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(XR,{eventId:o,getEditPath:e=>hi(as.DELEGATION({organizationId:s,eventId:o,delegationId:e})),getShowPath:e=>as.DELEGATION({organizationId:s,eventId:o,delegationId:e}),organizationId:s,children:(0,i.jsx)(wR,{canEditSegments:a(xb.SEGMENT_EDIT),eventId:o,filters:u,filtersButtonText:n("filtrer_les_d_l_04628"),filtersSubtitle:n("appliquer_des_f_65318"),getSegmentPath:e=>Os.DELEGATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfDelegations,initialLimit:l?.delegationsLimit??kc,initialSegmentsOpen:l?.areDelegationsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[Rh.List,Rh.AccreditationsMatrix],reload:e.reload,segmentId:r,segmentType:_t.Delegations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({delegationsLimit:e})},onSegmentClick:e=>{d({delegationsSegmentId:e})},onSegmentDelete:async()=>{await d({delegationsSegmentId:null}),t.replace(as.DELEGATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(NN,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.event.numberOfDelegations})})})},BN=()=>{const{params:{organizationId:e,eventId:t},translate:n}=cl(),{event:{name:s},localEvent:o}=Jv();Td(`${s} ${n("d_l_gations_78318")}`);const{data:r,loader:a,reload:l}=Yn("query DelegationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Delegation) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n organizationId\n numberOfDelegations\n\n segmentsFolders(segmentType: Delegations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Ms.SegmentCustomFieldFragment,Ms.SegmentsFoldersSegmentsFragment]),d=(0,M.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.DELEGATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(LN,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.DELEGATIONS_SEGMENT(e,t,o?.delegationsSegmentId&&d.includes(o.delegationsSegmentId)?o.delegationsSegmentId:d[0]),replace:!0})})]})},VN=()=>{const{hasFeature:e}=_I();return e(Fe.Delegation)?(0,i.jsx)(BN,{}):(0,i.jsx)(Ra,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(II,{icon:"people-group"})})};let UN=class extends Pl{constructor(e){super(e)}customDocumentInputDefault(e){return{name:e?.name??"",slug:e?.slug??"",populationsIds:e?.populationsIds??[],configuration:e?.configuration??this.getConfigurationDefault()}}customDocumentInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),slug:d.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:Hm,pages:[this.getPageDefault()],width:qm}}getPageDefault(){return{id:L(),accreditationsSlotsIds:[],accreditationAcronym:"",conditionsCustomFields:[],elements:[],hasConditions:!1,positionsSlotsIds:[]}}getContainerElementDefault(e,t,n){return{type:"container",id:e,inContainer:t,backgroundColor:"",accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],direction:"row",elements:[],gap:0,hasBackground:!1,hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,justify:"start",left:0,name:this.t("conteneur_1_03989",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,top:0,width:100,zIndex:1}}getImageElementDefault(e,t,n){return{type:"image",id:e,inContainer:t,accreditationsSlotsIds:[],accreditationAcronym:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,left:0,name:this.t("image_1_30956",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,top:0,width:100,zIndex:1}}getTextElementDefault(e,t,n){return{type:"text",id:e,inContainer:t,accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",hasBackground:!1,backgroundColor:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:20,isRatioLocked:!1,left:0,name:this.t("texte_1_59540",n+1),text:"",color:"#1d2939",fontFamily:"Open Sans",fontSize:14,fontWeight:400,justify:"start",lineHeight:1.4,positionsSlotsIds:[],px:0,py:0,rotateDegree:0,textTransform:"none",top:0,width:100,zIndex:1}}};function WN(e){const t=e=>e.flatMap(e=>"container"===e.type?[e].concat(t(e.elements)):[e]);return e.configuration.pages.flatMap(e=>t(e.elements))}function GN(e,t,n){const i={...e,id:t,name:n};if("container"===i.type){const e=i.elements.map(e=>GN(e,L(),e.name));return{...i,elements:e}}return i}function HN(e,t){return e===Hm&&t===qm?"a4":e===Ym&&t===Km?"a6":e===Jm&&t===Qm?"cb":"custom"}function qN(e,t,n,i,s){return!e.hasConditions||(eo(e.accreditationsSlotsIds)?eo((0,lh.A)(e.accreditationsSlotsIds,t)):m(e.accreditationAcronym)?n.some(t=>e.accreditationAcronym===t):eo(e.positionsSlotsIds)?eo((0,lh.A)(e.positionsSlotsIds,i)):!eo(e.conditionsCustomFields)||e.conditionsCustomFields.every(({slug:e,value:t})=>"isEmpty"===t?g(s[e]?.rawValue):"isNotEmpty"===t?m(s[e]?.rawValue):"boolean"==typeof t?s[e]?.rawValue===t:!!Array.isArray(t)&&eo((0,lh.A)(Qs(s[e]?.rawValue),t))))}UN=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],UN);const YN=M.createContext({}),KN=e=>{const{translate:t,params:{eventId:n}}=cl(),s=Gn(Wc),o=Gn(ah),r=Gn(UN),[a,d]=M.useState(e.initialCustomDocument),[c,u]=M.useState(null),[g,p]=M.useState(null),[f,x]=M.useState("parameters"),_=M.useCallback(e=>{d((0,cu.jM)(t=>{t.name=e}))},[a,d]),I=M.useCallback((e,t)=>{d((0,cu.jM)(n=>{n.configuration.pages.forEach(n=>{n.id===g&&(n[e]=t)})}))},[g,d]),v=M.useCallback(e=>{d((0,cu.jM)(t=>{t.populationsIds=e}))},[d]),b=M.useCallback(e=>{d((0,cu.jM)(t=>{t.slug=h(e,{replacer:l.Empty})}))},[d]),j=M.useCallback(e=>{d((0,cu.jM)(t=>{t.configuration.bleed=e}))},[a,d]),C=M.useCallback((e,t)=>{d((0,cu.jM)(n=>{n.configuration.height=e,n.configuration.width=t}))},[a,d]),y=M.useCallback(()=>{u(null),p(null)},[u,p]),k=M.useCallback(()=>WN(a).find(e=>e.id===c)||null,[a,c]),A=M.useCallback(()=>a.configuration.pages.find(e=>e.id===g)||null,[a,g]),w=M.useCallback(()=>{d((0,cu.jM)(e=>{e.configuration.pages.push(r.getPageDefault())}))},[d]),S=M.useCallback(e=>{d((0,cu.jM)(t=>{t.configuration.pages=t.configuration.pages.filter(t=>t.id!==e)}))},[d]),E=M.useCallback(e=>{const t=L();d((0,cu.jM)(n=>{e?WN(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getContainerElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getContainerElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d]),T=M.useCallback(e=>{const t=L();d((0,cu.jM)(n=>{e?WN(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getTextElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getTextElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d]),z=M.useCallback(e=>{const t=L();d((0,cu.jM)(n=>{e?WN(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getImageElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getImageElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d,u]),O=M.useCallback(e=>{d((0,cu.jM)(t=>{t.configuration.pages.forEach(t=>{t.elements=t.elements.filter(t=>t.id!==e)}),WN(t).forEach(t=>{"container"===t.type&&(t.elements=t.elements.filter(t=>t.id!==e))})})),u(null)},[a,d,u]),R=M.useCallback(e=>{const n=L();d((0,cu.jM)(i=>{WN(i).forEach(i=>{if("container"===i.type){const s=i.elements.find(t=>t.id===e);s&&i.elements.push(GN(s,n,t("copie_de_1_62900",s.name)))}}),i.configuration.pages.forEach(i=>{const s=i.elements.find(t=>t.id===e);s&&i.elements.push(GN(s,n,t("copie_de_1_62900",s.name)))})})),u(n)},[a,d,u]),$=M.useCallback(e=>{const n=L();d((0,cu.jM)(i=>{const s=i.configuration.pages.find(t=>t.id===e);s&&i.configuration.pages.push(function(e,t,n){return{...e,id:t,name:n,elements:e.elements.map(e=>GN(e,L(),e.name))}}(s,n,m(s.name)?t("copie_de_1_62900",s.name):""))}))},[]),D=M.useCallback((e,t)=>{u(e),p(t)},[a,u,p]),P=M.useCallback(e=>{p(e),u(null),x("design")},[u,p,x]),F=M.useCallback((e,t,n)=>{d((0,cu.jM)(i=>{const s=WN(i).find(t=>t.id===e);s&&(s[t]=n)}))},[a]),{data:N}=Yn("query CustomDocumentConditions($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n id\n name\n date\n\n accreditation {\n name\n }\n }\n }\n\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{eventId:n},[]),B=M.useMemo(()=>qh(s,N.event?.accreditationsSlots.nodes??[]).map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},n)),[N.event]),V=M.useMemo(()=>Hh(o,N.event?.positionsSlots.nodes??[]).map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},n)),[N.event]);return(0,i.jsx)(YN.Provider,{value:{accreditationsOptions:B,addContainerElement:E,addImageElement:z,addPage:w,addTextElement:T,cleanSelecteds:y,customDocument:a,customFields:e.customFields,deleteElement:O,duplicateElement:R,duplicatePage:$,getSelectedElement:k,getSelectedPage:A,population:e.population,positionsOptions:V,removePage:S,selectElement:D,selectPage:P,selectedElementId:c,selectedPageId:g,setBleed:j,setDimensions:C,setName:_,setPopulations:v,setSlug:b,setTab:x,tab:f,updateElementProperty:F,updatePageProperty:I},children:e.children})};function ZN(){return M.useContext(YN)}const XN=e=>{const{translate:t}=cl(),{addContainerElement:n,addImageElement:s,addTextElement:o}=ZN();return(0,i.jsxs)(Ra,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{o(e.container)},children:[(0,i.jsx)(Ra,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Ya,{icon:"text"})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textSm medium",children:t("Text")}),(0,i.jsx)(jl,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{s(e.container)},children:[(0,i.jsx)(Ra,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Ya,{icon:"image"})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textSm medium",children:t("image_40624")}),(0,i.jsx)(jl,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{n(e.container)},children:[(0,i.jsx)(Ra,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Ya,{icon:"chart-simple"})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textSm medium",children:t("conteneur_33078")}),(0,i.jsx)(jl,{color:"white",leftIcon:"plus",size:"sm"})]})]})},JN=e=>{const{translate:t}=cl(),{accreditationsOptions:n,customFields:s,positionsOptions:o}=ZN(),r=(0,M.useMemo)(()=>s.filter(e=>e.fieldType===Le.Checkbox||e.fieldType===Le.Select||e.fieldType===Le.Text||e.fieldType===Le.Validation).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[s]),a=e.element.conditionsCustomFields||[],l=a.map(e=>e.slug),d=(t,n)=>{const i=(0,cu.jM)(a,e=>{e[n].value=t});e.updateProperty(e.elementId,"conditionsCustomFields",i)},c=s.filter(e=>l.includes(e.slug));return(0,i.jsx)(lM,{css:{padding:"$4 $6"},title:t("condition_d_aff_68185"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(xu,{value:e.element.hasConditions,onChange:t=>{t||(e.updateProperty(e.elementId,"accreditationsSlotsIds",[]),e.updateProperty(e.elementId,"accreditationAcronym",""),e.updateProperty(e.elementId,"positionsSlotsIds",[]),e.updateProperty(e.elementId,"conditionsCustomFields",[])),e.updateProperty(e.elementId,"hasConditions",t)},children:t("afficher_en_fon_47208")}),e.element.hasConditions&&(0,i.jsxs)(Ra,{css:{background:"$gray100",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$3 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(fc,{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)(Ol,{label:t("afficher_en_fon_78748"),value:e.element.accreditationAcronym||"",onChange:t=>{e.updateProperty(e.elementId,"accreditationAcronym",t)}}),(0,i.jsx)(fc,{isSearchVisible:!0,label:t("afficher_en_fon_19925"),multiple:!0,values:e.element.positionsSlotsIds||[],onChange:t=>{e.updateProperty(e.elementId,"positionsSlotsIds",t)},children:o}),(0,i.jsx)(fc,{isSearchVisible:!0,label:t("afficher_en_fon_56078"),multiple:!0,values:l,onChange:t=>{const n=(0,oc.A)(t,l),i=s.filter(e=>n.includes(e.slug)),o=(0,oc.A)(l,t),r=a.filter(e=>!o.includes(e.slug)).concat(i.map(e=>({slug:e.slug,value:e.fieldType===Le.Checkbox||e.fieldType===Le.Validation||(e.fieldType===Le.Text?"isNotEmpty":[])})));e.updateProperty(e.elementId,"conditionsCustomFields",r)},children:r}),c.map((e,n)=>e.fieldType===Le.Checkbox||e.fieldType===Le.Validation?(0,i.jsxs)(Au,{label:t("afficher_si_la_42654",e.name),shouldParseAsBoolean:!0,value:a[n].value,onChange:e=>{d(e,n)},children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]},e.id):e.fieldType===Le.Text?(0,i.jsxs)(Au,{label:t("afficher_si_la_42654",e.name),value:a[n].value,onChange:e=>{d(e,n)},children:[(0,i.jsx)("option",{value:"isEmpty",children:t("est_vide_96759")}),(0,i.jsx)("option",{value:"isNotEmpty",children:t("n_est_pas_vide_45804")})]},e.id):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("afficher_si_la_42654",e.name),multiple:!0,values:a[n].value||[],onChange:e=>{d(e,n)},children:e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))]})]})})},QN=e=>{const{translate:t}=cl(),{updateElementProperty:n}=ZN();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lM,{css:{padding:"$4 $6"},title:t("apparence_75510"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Ol,{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)(Ol,{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)(br,{css:{alignSelf:"end"},width:40,children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{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)(_m,{placement:"top",children:e.element.isRatioLocked?t("ne_pas_pr_serve_68003"):t("pr_server_le_ra_39750")})]})})]}),!e.element.inContainer&&(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Ol,{label:"X",rightText:"px",shouldParseAsInt:!0,value:e.element.left,onChange:t=>{n(e.element.id,"left",t)}}),(0,i.jsx)(Ol,{label:"Y",rightText:"px",shouldParseAsInt:!0,value:e.element.top,onChange:t=>{n(e.element.id,"top",t)}})]}),!e.element.inContainer&&(0,i.jsx)(Ol,{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)(xu,{value:e.element.hasRotate,onChange:t=>{n(e.element.id,"hasRotate",t)},children:t("faire_pivoter_06431")}),e.element.hasRotate&&(0,i.jsx)(Ol,{label:t("degr_79492"),rightText:"deg",shouldParseAsInt:!0,value:e.element.rotateDegree,onChange:t=>{n(e.element.id,"rotateDegree",t)}})]}),("container"===e.element.type||"text"===e.element.type)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xu,{value:e.element.hasBackground,onChange:t=>{n(e.element.id,"hasBackground",t)},children:t("afficher_un_arr_96006")}),e.element.hasBackground&&(0,i.jsx)(xj,{label:t("couleur_de_fond_75677"),value:e.element.backgroundColor,onChange:t=>{n(e.element.id,"backgroundColor",t)}})]}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Ol,{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)(xj,{label:t("couleur_de_la_b_84227"),value:e.element.borderColor,onChange:t=>{n(e.element.id,"borderColor",t)}})]}),(0,i.jsx)(Ol,{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)(Ra,{gap:"4",children:[(0,i.jsx)(Ol,{label:t("padding_horizon_14268"),rightText:"px",shouldParseAsInt:!0,value:e.element.px,onChange:t=>{n(e.element.id,"px",t)}}),(0,i.jsx)(Ol,{label:t("padding_vertica_78457"),rightText:"px",shouldParseAsInt:!0,value:e.element.py,onChange:t=>{n(e.element.id,"py",t)}})]})]})}),(0,i.jsx)(JN,{element:e.element,elementId:e.element.id,updateProperty:n})]})},eL=e=>{const{translate:t}=cl(),{getSelectedPage:n,selectPage:s,updateElementProperty:o}=ZN();return(0,i.jsxs)(Ra,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ra,{css:{padding:"$2 $6"},children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(n().id)},children:t("retour_92202")})}),(0,i.jsxs)(lM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Ol,{label:t("nom_08311"),value:e.container.name,onChange:t=>{o(e.container.id,"name",t)}}),(0,i.jsx)(XN,{container:e.container})]}),(0,i.jsxs)(lM,{css:{padding:"$4 $6"},title:t("conteneur_33078"),children:[(0,i.jsxs)(Au,{label:t("direction_39738"),value:e.container.direction,onChange:t=>{o(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)(Ol,{label:t("_cart_entre_les_62547"),rightText:"px",shouldParseAsInt:!0,value:e.container.gap,onChange:t=>{o(e.container.id,"gap",t)}}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsxs)(Ra,{children:[(0,i.jsx)(jl,{color:"start"===e.container.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{o(e.container.id,"justify","start")}}),(0,i.jsx)(jl,{color:"center"===e.container.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{o(e.container.id,"justify","center")}}),(0,i.jsx)(jl,{color:"end"===e.container.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{o(e.container.id,"justify","end")}})]}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(jl,{color:"start"===e.container.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{o(e.container.id,"align","start")}}),(0,i.jsx)(jl,{color:"center"===e.container.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{o(e.container.id,"align","center")}}),(0,i.jsx)(jl,{color:"end"===e.container.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{o(e.container.id,"align","end")}})]})]})]})]}),(0,i.jsx)(QN,{element:e.container})]})},tL=()=>{const{translate:e}=cl(),{getSelectedPage:t,updatePageProperty:n}=ZN(),s=t();return(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsxs)(lM,{css:{padding:"$4 $6"},title:e("initialisation_38640"),children:[(0,i.jsx)(Ol,{label:e("nom_de_la_page_82146"),value:s.name||"",onChange:e=>{n("name",e)}}),(0,i.jsx)(XN,{container:null})]}),(0,i.jsx)(JN,{element:s,elementId:s.id,updateProperty:(e,t,i)=>{n(t,i)}})]})},nL=()=>{const{translate:e}=cl(),{getSelectedPage:t}=ZN();return t()?(0,i.jsx)(tL,{}):(0,i.jsx)(Ra,{css:{px:"$4"},height:1,width:1,children:(0,i.jsxs)(Ra,{align:"center",css:{bd:!0,px:"$9"},direction:"column",gap:"4",height:1,justify:"center",width:1,children:[(0,i.jsx)(Ra,{css:{border:"1px solid $gray200",borderRadius:"10px",padding:"$3"},children:(0,i.jsx)(Ya,{icon:"hand-pointer"})}),(0,i.jsx)(br,{font:"gray800 textMd medium",textAlign:"center",children:e("pour_ajouter_de_11528")})]})})},iL=e=>{const{translate:t,params:{organizationId:n}}=cl(),{getSelectedPage:s,selectPage:o,updateElementProperty:r}=ZN();return(0,i.jsxs)(Ra,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ra,{css:{padding:"$2 $6"},children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(s().id)},children:t("retour_92202")})}),(0,i.jsxs)(lM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Ol,{label:t("nom_08311"),value:e.image.name,onChange:t=>{r(e.image.id,"name",t)}}),(0,i.jsx)(Ol,{hint:t("utilisez_user_81685"),label:t("source_16397"),value:e.image.source||"",onChange:t=>{r(e.image.id,"source",t)}}),(0,i.jsx)(xv,{accept:lv.Images,acl:"public-read",label:t("File"),organizationId:n,value:null,onChange:t=>{if(t){const n=`https://${D.HEAVENT_AWS_UPLOADS_BUCKET}.s3.eu-west-1.amazonaws.com/${t.key}`;r(e.image.id,"source",n)}}}),(0,i.jsx)(Ol,{label:t("lien_68557"),value:e.image.link||"",onChange:t=>{r(e.image.id,"link",t)}})]}),(0,i.jsx)(QN,{element:e.image})]})},sL=()=>{const{translate:e}=cl(),{customDocument:t,population:n,setBleed:s,setDimensions:o,setName:r,setPopulations:a,setSlug:l}=ZN(),d=t.configuration.height,c=t.configuration.width,u=HN(d,c),h=(0,M.useMemo)(()=>(0,ic.A)(n.values,e=>e.value.toLowerCase()),[n]);return(0,i.jsxs)(Ra,{css:{px:"$4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Ol,{label:e("nom_du_document_73868"),value:t.name,onChange:r}),(0,i.jsxs)(Au,{label:e("format_du_docum_28991"),value:u,onChange:e=>{"a4"===e?o(Hm,qm):"a6"===e?o(Ym,Km):"cb"===e?o(Jm,Qm):o(0,0)},children:[(0,i.jsx)("option",{value:"a4",children:"A4 (794 * 1123 px) (210 * 297 mm)"}),(0,i.jsx)("option",{value:"a6",children:"A6 (397 * 561 px) (105 * 148 mm)"}),(0,i.jsx)("option",{value:"cb",children:"CB (204 * 325 px) (54 * 86 mm)"}),(0,i.jsx)("option",{value:"custom",children:e("personnalis_40360")})]}),"custom"===u&&(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Ol,{hint:`${Ar(t.configuration.width)}mm`,label:e("largeur_54184"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.width,onChange:e=>{o(d,e)}}),(0,i.jsx)(Ol,{hint:`${Ar(t.configuration.height)}mm`,label:e("hauteur_56576"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.height,onChange:e=>{o(e,c)}})]}),(0,i.jsx)(dc,{state:t.configuration.bleed?"checked":"unchecked",onClick:e=>{s("checked"===e)},children:e("ajouter_des_fon_73494")}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ol,{hint:e("ne_doit_conteni_53122"),label:e("nom_de_la_varia_81999"),value:t.slug,onChange:l}),(0,i.jsx)(fc,{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))})]})},oL=["Anton","Archivo","Arial","Arimo","Asap","Barlow","Be Vietnam Pro","Bebas Neue","Bricolage Grotesque","Chivo","Fira Sans","Georgia","IBM Plex Sans","Inter","Lato","League Gothic","Merriweather","Montserrat","Noto Sans","Nunito","Open Sans","Oswald","Oxanium","PT Sans","Playfair Display","Poppins","Raleway","Roboto","Rubik","Ubuntu"];function rL(){return(0,M.useMemo)(()=>oL.map(e=>(0,i.jsx)("option",{value:e,children:e},e)),[])}const aL=e=>{const{translate:t}=cl(),{customFields:n,getSelectedPage:s,selectPage:o,updateElementProperty:r}=ZN(),a=rL(),l=(0,M.useMemo)(()=>(0,ic.A)(n.concat([{slug:"id",name:t("id_51738")},{slug:"localId",name:t("id_sur_l_v_nem_01171")},{slug:"email",name:t("Email")},{slug:"delegation.name",name:t("nom_de_la_d_l_g_28087")},{slug:"delegation.leader.firstName",name:t("pr_nom_du_respo_22241")},{slug:"delegation.leader.lastName",name:t("nom_du_responsa_44761")},{slug:"delegation.leader.phone",name:t("t_l_hpone_du_re_85143")},{slug:"name",name:t("full_name")},{slug:"ticketId",name:t("TicketId")}]),e=>e.name.toLowerCase()).map(e=>{const t=`{user.${e.slug}}`,n=`${e.name} {user.${e.slug}}`;return(0,i.jsx)("option",{value:t,children:n},e.slug)}),[n]),d=e.text.lineHeight||1.4,c=(0,mb.A)(e.text.fontSize*d,2);return(0,i.jsxs)(Ra,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ra,{css:{padding:"$2 $6"},children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(s().id)},children:t("retour_92202")})}),(0,i.jsx)(lM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(Ol,{label:t("nom_du_calque_77484"),value:e.text.name,onChange:t=>{r(e.text.id,"name",t)}}),(0,i.jsx)(Nm,{label:t("contenu_29668"),value:e.text.text,onChange:t=>{r(e.text.id,"text",t)}}),(0,i.jsx)(fc,{isSearchVisible:!0,label:t("ajouter_une_var_79098"),values:[],onChange:t=>{eo(t)&&r(e.text.id,"text",`${e.text.text} ${t[0]}`.trim())},children:l})]})}),(0,i.jsx)(lM,{css:{padding:"$4 $6"},title:t("typographie_11343"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(fc,{isSearchVisible:!0,label:"Police",values:[e.text.fontFamily],onChange:t=>{r(e.text.id,"fontFamily",t[0]||"Open Sans")},children:a}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Ol,{label:t("taille_de_la_po_58427"),shouldParseAsInt:!0,value:e.text.fontSize,onChange:t=>{r(e.text.id,"fontSize",t)}}),(0,i.jsx)(Pm,{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)(Ra,{gap:"4",children:[(0,i.jsx)(xj,{label:t("couleur_du_text_32021"),value:e.text.color,onChange:t=>{r(e.text.id,"color",t)}}),(0,i.jsxs)(Au,{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)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsxs)(Ra,{children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{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)(_m,{placement:"top",children:t("aligner_gauch_04681")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{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)(_m,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{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)(_m,{placement:"top",children:t("aligner_droit_73883")})]})]}),(0,i.jsxs)(Ra,{children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{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)(_m,{placement:"top",children:t("aligner_en_haut_69916")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{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)(_m,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{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)(_m,{placement:"top",children:t("aligner_en_bas_42956")})]})]})]})]}),(0,i.jsxs)(Au,{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)(QN,{element:e.text})]})},lL=()=>{const{translate:e}=cl(),{getSelectedElement:t,tab:n,setTab:s}=ZN(),o=t();return"container"===o?.type?(0,i.jsx)(eL,{container:o}):"image"===o?.type?(0,i.jsx)(iL,{image:o}):"text"===o?.type?(0,i.jsx)(aL,{text:o}):(0,i.jsxs)(Ra,{css:{boxShadow:"$sm",overflow:"hidden auto",py:"$6",paddingBottom:"$11"},direction:"column",gap:"6",height:1,width:1,children:[(0,i.jsx)(Ra,{css:{px:"$4"},children:(0,i.jsxs)(jv,{selectedItem:n,onChange:s,children:[(0,i.jsx)(Cv,{item:"parameters",children:e("param_tres_78420")}),(0,i.jsx)(Cv,{item:"design",children:e("design_15043")})]})}),"parameters"===n&&(0,i.jsx)(sL,{}),"design"===n&&(0,i.jsx)(nL,{})]})},dL=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{borderTop:"1px solid black",height:"1px",left:"0",position:"absolute",top:"19px",width:"11px"}}),(0,i.jsx)(br,{css:{borderRight:"1px solid black",height:"11px",left:"19px",position:"absolute",top:"0",width:"1px"}}),(0,i.jsx)(br,{css:{borderTop:"1px solid black",height:"1px",position:"absolute",right:"0",top:"19px",width:"11px"}}),(0,i.jsx)(br,{css:{borderRight:"1px solid black",height:"11px",position:"absolute",right:"19px",top:"0",width:"1px"}}),(0,i.jsx)(br,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",left:"0",position:"absolute",width:"11px"}}),(0,i.jsx)(br,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",left:"19px",position:"absolute",width:"1px"}}),(0,i.jsx)(br,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",position:"absolute",right:"0",width:"11px"}}),(0,i.jsx)(br,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",position:"absolute",right:"19px",width:"1px"}})]}),cL=e=>{const{selectedElementId:t,selectElement:n}=ZN();return(0,i.jsx)(Ra,{align:e.container.align,css:{backgroundColor:e.container.hasBackground?e.container.backgroundColor:"none",border:e.container.borderSize>0?`${e.container.borderSize}px solid ${e.container.borderColor}`:"",borderRadius:e.container.borderRadius>0?`${e.container.borderRadius}px`:"0",gap:`${e.container.gap}px`,left:`${e.container.left}px`,outline:t===e.container.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.container.py||0}px`,paddingLeft:`${e.container.px||0}px`,paddingRight:`${e.container.px||0}px`,paddingTop:`${e.container.py||0}px`,position:e.container.inContainer?"static":"absolute",top:`${e.container.top}px`,zIndex:e.container.zIndex},direction:e.container.direction,height:e.container.height,justify:e.container.justify,width:e.container.width,onClick:t=>{Al(t),n(e.container.id,e.pageId)},children:e.container.elements.map(t=>(0,i.jsx)(mL,{element:t,pageId:e.pageId},t.id))})},uL=e=>{const{selectedElementId:t,selectElement:n}=ZN();return(0,i.jsx)(br,{css:{border:e.image.borderSize>0?`${e.image.borderSize}px solid ${e.image.borderColor}`:"",borderRadius:e.image.borderRadius>0?`${e.image.borderRadius}px`:"0",left:`${e.image.left}px`,outline:t===e.image.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.image.py||0}px`,paddingLeft:`${e.image.px||0}px`,paddingRight:`${e.image.px||0}px`,paddingTop:`${e.image.py||0}px`,position:e.image.inContainer?"static":"absolute",top:`${e.image.top}px`,transform:e.image.hasRotate?`rotate(${e.image.rotateDegree}deg)`:void 0,transformOrigin:e.image.hasRotate?"top left":void 0,zIndex:e.image.zIndex},height:e.image.height,width:e.image.width,onClick:t=>{Al(t),n(e.image.id,e.pageId)},children:m(e.image.source)&&(0,i.jsx)("img",{height:"100%",src:(s=e.image.source,"{user.picture}"===s?`${D.HEAVENT_ASSETS_URL}/badges/profile.jpg`:"{user.qrcode}"===s||"{user.skidata}"===s?sg("https://weezevent.com",{height:360,width:360}):"{user.code39}"===s?sg("12345678",{barcodeType:ig.Code39,height:28,width:234}):s),width:"100%"})});var s},hL=e=>{const{selectedElementId:t,selectElement:n}=ZN(),s=RT(e.text.text);return(0,i.jsx)(Ra,{align:e.text.align,css:{backgroundColor:e.text.hasBackground?e.text.backgroundColor:"none",border:e.text.borderSize>0?`${e.text.borderSize}px solid ${e.text.borderColor}`:"",borderRadius:e.text.borderRadius>0?`${e.text.borderRadius}px`:"0",color:e.text.color,fontFamily:e.text.fontFamily,fontSize:`${e.text.fontSize}px`,fontWeight:e.text.fontWeight,left:`${e.text.left}px`,lineHeight:e.text.lineHeight||1.4,outline:t===e.text.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.text.py||0}px`,paddingLeft:`${e.text.px||0}px`,paddingRight:`${e.text.px||0}px`,paddingTop:`${e.text.py||0}px`,position:e.text.inContainer?"static":"absolute",textAlign:e.text.justify,textTransform:e.text.textTransform,top:`${e.text.top}px`,transform:e.text.hasRotate?`rotate(${e.text.rotateDegree}deg)`:void 0,transformOrigin:e.text.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.text.zIndex,"& em":{fontStyle:"italic"},"& s":{textDecoration:"line-through"},"& strong":{fontWeight:700},"& u":{textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:s},height:e.text.height,justify:e.text.justify,width:e.text.width,onClick:t=>{Al(t),n(e.text.id,e.pageId)}})},mL=e=>"container"===e.element.type?(0,i.jsx)(cL,{container:e.element,pageId:e.pageId}):"image"===e.element.type?(0,i.jsx)(uL,{image:e.element,pageId:e.pageId}):"text"===e.element.type?(0,i.jsx)(hL,{pageId:e.pageId,text:e.element}):null,gL=e=>{const{translate:t}=cl(),{customDocument:n,addPage:s,removePage:o,selectedPageId:r,selectPage:a}=ZN(),l=n.configuration.pages.length>1,d=n.configuration.bleed?19:0;return(0,i.jsxs)(Ra,{css:{height:"fit-content",width:"fit-content"},direction:"column",gap:"2",children:[(0,i.jsxs)(Ra,{align:"center",children:[(0,i.jsx)(br,{css:{cursor:"pointer",flex:"1"},fontWeight:"semiBold",onClick:t=>{Al(t),a(e.page.id)},children:m(e.page.name)?e.page.name:t("page_1_33637",e.index+1)}),(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsx)(jl,{color:"white",leftIcon:"plus",size:"sm",onClick:s}),(0,i.jsx)(jl,{color:"white",disabled:!l,leftIcon:"trash-can",size:"sm",onClick:()=>{o(e.page.id)}})]})]}),(0,i.jsxs)(Ra,{css:{background:"white",padding:`${d}px`,position:"relative"},height:2*d+n.configuration.height,width:2*d+n.configuration.width,children:[n.configuration.bleed&&(0,i.jsx)(dL,{}),(0,i.jsx)(Ra,{css:{background:"white",outline:r===e.page.id?"2px solid $primary700":"",position:"relative"},height:n.configuration.height,width:n.configuration.width,onClick:t=>{Al(t),a(e.page.id)},children:e.page.elements.map(t=>(0,i.jsx)(mL,{element:t,pageId:e.page.id},t.id))})]})]})},pL=()=>{const{customDocument:e,cleanSelecteds:t}=ZN(),[n,s]=(0,M.useState)(100);return(0,i.jsxs)(br,{css:{background:"$gray100",position:"relative"},height:1,width:1,children:[(0,i.jsx)(Ra,{align:"center",css:{overflow:"auto",padding:"$9",zoom:`${n}%`},direction:"column",gap:"7",height:1,width:1,onClick:t,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(gL,{index:t,page:e},e.id))}),(0,i.jsx)(br,{css:{bottom:"24px",position:"absolute",right:"24px",zIndex:1e3},width:140,children:(0,i.jsxs)(Au,{shouldParseAsInt:!0,value:n,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%)"})]})})]})},fL=e=>{const{deleteElement:t,duplicateElement:n,selectedElementId:s,selectElement:o}=ZN();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{background:s===e.element.id?"$primary300":"none",borderRadius:"$1",color:s===e.element.id?"$primary700":"$gray800",cursor:"pointer",padding:"$2","& .h-duplicate, & .h-delete":{display:"none"},"&:hover":{background:"$primary300",color:"$primary700","& .h-duplicate, & .h-delete":{display:"block"}}},gap:"3",width:250,onClick:()=>{o(e.element.id,e.pageId)},children:[(0,i.jsx)(br,{fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:(r=e.element,"container"===r.type?"column"===r.direction?"chart-simple-horizontal":"chart-simple":"image"===r.type?"image":"text")})}),(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(br,{css:{ellipsis:!0},fontSize:"textSm",fontWeight:"medium",title:e.element.name,width:1,children:e.element.name})}),(0,i.jsx)(br,{className:"h-duplicate",onClick:t=>{Al(t),n(e.element.id)},children:(0,i.jsx)(Ya,{icon:"copy"})}),(0,i.jsx)(br,{className:"h-delete",onClick:n=>{Al(n),t(e.element.id)},children:(0,i.jsx)(Ya,{icon:"trash-can"})})]}),"container"===e.element.type&&(0,i.jsx)(Ra,{css:{paddingLeft:"$8"},direction:"column",children:e.element.elements.map(t=>(0,i.jsx)(fL,{element:t,pageId:e.pageId},t.id))})]});var r},xL=e=>{const{translate:t}=cl(),{duplicatePage:n,selectedPageId:s,selectPage:o}=ZN(),r=m(e.page.name)?e.page.name:t("page_1_33637",e.index+1);return(0,i.jsx)(lM,{css:{gap:"0",width:"fit-content"},title:(0,i.jsxs)(Ra,{align:"center",css:{background:s===e.page.id?"$primary300":"",borderRadius:"$1",color:"$gray800",fontWeight:"$medium",padding:"$2","& .h-duplicate":{display:"none"},"&:hover":{background:"$primary300","& .h-duplicate":{display:"block"}}},gap:"3",width:250,onClick:t=>{Al(t),o(e.page.id)},children:[(0,i.jsx)(br,{fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"frame"})}),(0,i.jsx)(br,{css:{flex:"1"},children:r}),(0,i.jsx)(br,{className:"h-duplicate",onClick:t=>{Al(t),n(e.page.id)},children:(0,i.jsx)(Ya,{icon:"copy"})})]}),titleCss:{gap:"$2"},children:(0,i.jsx)(Ra,{css:{paddingLeft:"$8"},direction:"column",children:e.page.elements.map(t=>(0,i.jsx)(fL,{element:t,pageId:e.page.id},t.id))})})},_L=()=>{const{customDocument:e}=ZN();return(0,i.jsx)(Ra,{css:{overflowY:"auto"},direction:"column",height:1,width:1,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(xL,{index:t,page:e},e.id))})},IL=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:s},translate:o}=cl(),{mutate:r,isLoading:a}=function(e={}){return Kn("mutation CustomDocumentUpdate(\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n $customDocument: CustomDocumentInput!\n) {\n customDocumentUpdate(\n eventId: $eventId\n customDocumentId: $customDocumentId\n customDocument: $customDocument\n ) {\n id\n }\n}\n",e)}(),{customDocument:l}=ZN(),d=(0,M.useMemo)(()=>JSON.stringify(l),[a]),[c,u]=(0,M.useState)(!1),h=(0,M.useCallback)(()=>{JSON.stringify(l)===d?e.goBack(Os.DOCUMENTS(t,n)):u(!0)},[l,d]);return Td(o("mise_jour_de_17055",l.name)),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zm,{button:(0,i.jsx)(jl,{isLoading:a,onClick:async()=>{await r({eventId:n,customDocumentId:s,customDocument:l})},children:o("enregistrer_06519")}),category:o("document_person_69340"),color:"dark",title:l.name,onClose:h,children:(0,i.jsxs)(Ra,{height:1,width:1,children:[(0,i.jsx)(br,{height:1,width:420,children:(0,i.jsx)(lL,{})}),(0,i.jsx)(br,{css:{flex:"1"},height:1,children:(0,i.jsx)(pL,{})}),(0,i.jsx)(br,{height:1,width:340,children:(0,i.jsx)(_L,{})})]})}),(0,i.jsx)(kS,{fallbackPath:Os.DOCUMENTS(t,n),isOpen:c,onClose:()=>u(!1)})]})},vL=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:s}}=cl(),{data:o,loader:r}=Yn('query CustomDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n population: customFieldBySlug(slug: "population") {\n values {\n id\n value\n }\n }\n\n customFields(variety: UserInfo, privacy: All, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n customDocument(customDocumentId: $customDocumentId) {\n name\n slug\n populationsIds\n configuration\n }\n }\n}\n',{organizationId:t,eventId:n,customDocumentId:s},[Ms.ConditionCustomFieldFragment]),a=Gn(UN);return r||o.event?.customDocument||e.replace(Os.DOCUMENTS(t,n)),r||(0,i.jsx)(KN,{customFields:o.organization.customFields.nodes,initialCustomDocument:a.customDocumentInputDefault(o.event.customDocument),population:o.organization.population,children:(0,i.jsx)(IL,{})})},bL=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=cl(),{mutate:o}=function(e={}){return Kn("mutation CustomDocumentCreate($eventId :EventId!, $customDocument: CustomDocumentInput!){\n customDocumentCreate(eventId: $eventId, customDocument: $customDocument){\n id\n }\n}\n",e)}(),r=Gn(UN),[a,d]=(0,M.useState)(""),[c,u]=(0,M.useState)(""),[g,p]=(0,M.useState)(!1),f=(0,M.useCallback)(e=>{d(e),g||u(h(e,{replacer:l.Empty}))},[g,d,u]),x=(0,M.useCallback)(e=>{m(e)?(u(h(e,{replacer:l.Empty})),p(!0)):(u(""),p(!1))},[u,p]);return(0,i.jsxs)(ub,{children:[(0,i.jsx)(hb,{children:(0,i.jsx)(jl,{children:t("cr_er_un_docume_92512")})}),(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"file",children:t("nouveau_documen_36722")}),(0,i.jsxs)(lb,{gap:"5",children:[(0,i.jsx)(Ol,{label:t("nom_du_document_22604"),value:a,onChange:f}),(0,i.jsx)(Ol,{hint:t("ne_doit_conteni_53122"),label:t("nom_de_la_varia_81999"),value:c,onChange:x})]}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{onClick:async()=>{const{customDocumentCreate:t}=await o({eventId:s,customDocument:{name:a,slug:c,populationsIds:[],configuration:r.getConfigurationDefault()}});e.push(Os.EDIT_CUSTOM_DOCUMENT(n,s,t.id))},children:t("cr_er_le_docume_02657")})})]})]})},jL=e=>(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textLg medium",children:e.title}),(0,i.jsx)(Ra,{css:{background:"white",bd:!0,"& > div:last-child":{borderBottom:"none"}},direction:"column",children:e.children})]}),CL=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{showNotification:r}=ib(),{mutate:a}=function(e={}){return Kn("mutation CustomDocumentDuplicate($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDuplicate(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),{mutate:l}=function(e={}){return Kn("mutation CustomDocumentDelete($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDelete(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),[d,c]=(0,M.useState)(!1),u=HN(e.customDocument.configuration.height,e.customDocument.configuration.width),h=e.customDocument.populations.join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Ra,{align:"center",css:{background:"$success100",borderRadius:"$3",color:"$success700",fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(Ya,{icon:"pen-ruler"})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[e.disabled?(0,i.jsx)(br,{font:"gray800 textMd medium",children:e.customDocument.name}):(0,i.jsx)(Vc,{css:{fontSize:"$textMd"},to:Os.DOCUMENTS_USER_CUSTOM_DOCUMENT(s,o,e.userInfoId,e.customDocument.id),children:e.customDocument.name}),(0,i.jsx)(br,{color:"gray500",children:n("cr_par_1_69201",e.customDocument.createdBy.nameOrEmail)})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:n("populations_48141")}),(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray800 textSm medium",title:h,width:1,children:m(h)?h:"-"})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:85,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:n("format_54368")}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:"custom"===u?n("personnalis_40360"):u.toUpperCase()})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:n("nom_de_la_varia_81999")}),(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray800 textSm medium",title:`{user.documents.${e.customDocument.slug}}`,width:1,children:`{user.documents.${e.customDocument.slug}}`})]}),(0,i.jsx)(Ib,{permissions:xb.DOCUMENT_EDIT,children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{t.push(Os.EDIT_CUSTOM_DOCUMENT(s,o,e.customDocument.id))}})}),(0,i.jsx)(_m,{placement:"top",children:n("_diter_62574")})]})}),(0,i.jsx)(Ib,{permissions:xb.DOCUMENT_EDIT,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>{await a({eventId:o,customDocumentId:e.customDocument.id}),e.reload()},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})]})]})})]}),d&&(0,i.jsx)(Pk,{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:o,customDocumentId:e.customDocument.id}),r(n("le_document_1_14516",e.customDocument.name)),e.reload()}})]})},yL=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>(0,ic.A)(e.customDocuments,e=>e.name.toLowerCase()),[e.customDocuments]);return(0,i.jsx)(jL,{title:t("documents_perso_87374"),children:n.map(t=>(0,i.jsx)(CL,{customDocument:t,disabled:0===e.numberOfVolunteersRegistrations,reload:e.reload,userInfoId:e.userInfoId},t.id))})},kL=e=>{const{translate:t}=cl();return(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Ra,{align:"center",css:{background:mr.colors[`${e.color}100`],borderRadius:"$3",color:mr.colors[`${e.color}700`],fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(Ya,{icon:e.icon})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[e.disabled?(0,i.jsx)(br,{font:"gray800 textMd medium",children:e.title}):(0,i.jsx)(Vc,{css:{fontSize:"$textMd"},to:e.path,children:e.title}),e.disabled&&(0,i.jsx)(Jd,{color:"warning",size:"sm",children:t("le_document_n_e_47973")})]}),(0,i.jsx)(br,{color:"gray500",children:t("cr_par_1_69201","WeezCrew")})]}),m(e.variable)&&(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:t("nom_de_la_varia_81999")}),(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray800 textSm medium",title:"",width:1,children:`{user.documents.${e.variable}}`})]}),void 0!==e.count&&!e.disabled&&(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:150,children:[(0,i.jsx)(br,{font:"gray500 textXs regular",children:e.text}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:e.count})]})]})},AL=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl();return(0,i.jsxs)(jL,{title:t("_v_nement_22345"),children:[(0,i.jsx)(kL,{color:"pink",icon:"list-ul",path:Os.DOCUMENTS_VOLUNTEERS_LISTING(n,s,e.volunteersSegmentId),text:t("nombre_de_membr_87049"),title:t("liste_des_membr_89037")}),(0,i.jsx)(kL,{color:"purple",icon:"calendar-day",path:Os.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(n,s,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_d_un_g_23684")}),(0,i.jsx)(kL,{color:"purple",icon:"calendar-day",path:Os.DOCUMENTS_PLANNING(n,s,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_de_l_96909")}),(0,i.jsx)(kL,{color:"purple",icon:"image",path:Os.DOCUMENTS_USERS_PICTURES(n,s,e.volunteersSegmentId),text:"",title:t("trombinoscope_11316")})]})},wL=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{organization:o}=_I();return(0,i.jsxs)(jL,{title:t("membres_11310"),children:[(0,i.jsx)(kL,{color:"pink",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"user",path:Os.DOCUMENTS_ASSIGNMENTS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("fiche_d_affecta_91461"),variable:"assignments"}),(0,i.jsx)(kL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:Os.DOCUMENTS_USER_PLANNING(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanning"),variable:"planning"}),(0,i.jsx)(kL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:Os.DOCUMENTS_USER_PLANNING_LIST(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningList"),variable:"planningList"}),(0,i.jsx)(kL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:Os.DOCUMENTS_USER_PLANNING_DAYS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningDays"),variable:"planningDays"}),(0,i.jsx)(kL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"certificate",path:Os.DOCUMENTS_CERTIFICATE(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("Certificate"),variable:"certificate"}),(0,i.jsx)(kL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"id-card",path:Os.DOCUMENTS_BADGE(n,s,e.assignedUserInfoId,"generic"),text:t("nombre_de_membr_87049"),title:t("BadgeCheck"),variable:"badge"}),(0,i.jsx)(kL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"clock",path:Os.DOCUMENTS_HOURS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserHours"),variable:"hours"}),o.customBadges.map(o=>(0,i.jsx)(kL,{color:"success",count:e.numberOfVolunteersRegistrations,disabled:!1,icon:"id-card",path:Os.DOCUMENTS_BADGE(n,s,e.userInfoId,o),text:t("nombre_de_membr_87049"),title:z_(o),variable:o.toLowerCase()},o))]})},SL=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl();return(0,i.jsxs)(jL,{title:t("missions_63972"),children:[(0,i.jsx)(kL,{color:"blueGray",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"sitemap",path:Os.DOCUMENTS_POSITION(n,s,e.positionId),text:t("nombre_de_fiche_03009"),title:t("fiche_de_missio_00324")}),(0,i.jsx)(kL,{color:"purple",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"calendar-day",path:Os.DOCUMENTS_POSITION_PLANNING(n,s,e.positionId),text:t("nombre_de_missi_56719"),title:t("planning_d_une_64581")})]})},EL=e=>{const{hasFeature:t}=_I(),n=e.event.volunteersRegistrations.nodes[0]?.userInfoId??-1;return(0,i.jsxs)(Ra,{direction:"column",gap:"7",children:[t(Fe.CustomDocument)&&eo(e.event.customDocuments)&&(0,i.jsx)(yL,{customDocuments:e.event.customDocuments,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,reload:e.reload,userInfoId:n}),(0,i.jsx)(wL,{assignedUserInfoId:e.event.assignedVolunteersRegistrations.nodes[0]?.userInfoId??-1,numberOfAssignedVolunteersRegistrations:e.event.assignedVolunteersRegistrations.totalCount,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,userInfoId:n}),(0,i.jsx)(SL,{numberOfPositions:e.event.positions.totalCount,positionId:e.event.positions.nodes[0]?.id??-1}),(0,i.jsx)(AL,{positionsSegmentId:e.event.positionsSegments[0].id,volunteersSegmentId:e.event.volunteersSegments[0].id})]})},TL=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(ec,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(ec,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(ec,{borderRadius:"$2",height:74,width:1})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(ec,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(ec,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(ec,{borderRadius:"$2",height:74,width:1})]})]}),zL=()=>{const{translate:e,params:{eventId:t}}=cl(),{hasFeature:n}=_I(),{event:{name:s}}=Jv(),{canDocumentEdit:o}=lS();Td(`${s} ${e("Documents")}`);const{data:r,isLoading:a,reload:l}=Yn('query Documents($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n id\n name\n slug\n configuration\n populations\n\n createdBy {\n nameOrEmail\n }\n }\n\n positions(limit: 1) {\n nodes {\n id\n }\n\n totalCount\n }\n\n volunteersRegistrations(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n assignedVolunteersRegistrations: volunteersRegistrations(\n states: [Assigned]\n limit: 1\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n volunteersSegments: segments(segmentType: Volunteers) {\n id\n }\n\n positionsSegments: segments(segmentType: Positions) {\n id\n }\n }\n}\n',{eventId:t},[]);return(0,i.jsxs)($b,{children:[(0,i.jsxs)(Rb,{gap:"3",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray900 displayXs semiBold",children:e("Documents")}),(0,i.jsx)(br,{color:"gray500",children:e("retrouver_et_pe_99652")})]}),o&&(0,i.jsx)(bL,{})]}),(0,i.jsx)(Ob,{children:n(Fe.Documents)?a?(0,i.jsx)(TL,{}):(0,i.jsx)(EL,{event:r.event,reload:l}):(0,i.jsx)(Ra,{align:"center",css:{flex:"1"},direction:"column",justify:"center",children:(0,i.jsx)(II,{icon:"folders"})})})]})};var OL;function RL(){return RL=Object.assign?Object.assign.bind():function(e){for(var t=1;t div":{alignItems:"center",background:"$success400",borderRadius:"$1",display:"flex",height:"100%",justifyContent:"center",width:"100%","& svg":{height:"50%"}}}),NL=hr(br,{background:`url(${DL}) no-repeat`,borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",height:"48px",width:"100px"}),LL=hr(br,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray800",display:"flex",height:"48px",padding:"$2",width:"100px","& > div":{alignItems:"center",border:"1px dashed $gray300",borderRadius:"$1",display:"flex",fontSize:"$textXs",height:"100%",justifyContent:"center",width:"100%"}}),BL=e=>{const t=Hn(),n=Gn(Wc),s=(0,M.useMemo)(()=>nh(e.slots.map(({range:e})=>e).reduce((e,t)=>e.union(t),e.slots[0].range)),[e.slots]),o=e.slots[0].range.start;return console.log("ok !!!"),(0,i.jsxs)(Ra,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(Ra,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(br,{font:"gray900 textXl medium",children:t("planning_1_14391",e.position.name)})}),(0,i.jsxs)(Ra,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Ra,{children:[(0,i.jsx)(PL,{width:200,children:t("jours_88317")}),(0,wc.A)(0,s).map(t=>{const s=o.plus({days:t}),r=xh(s,e.slots);return(0,i.jsx)(PL,{width:100*(r.length||1),children:n.toLocaleString(s,Zs.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(PL,{width:200,children:t("cr_neaux_33401")}),(0,wc.A)(0,s).map(t=>{const n=xh(o.plus({days:t}),e.slots);return 0===n.length||n[0].isAddedSlot?(0,i.jsx)(NL,{},`${t}`):n.map(e=>(0,i.jsx)(PL,{width:100,children:e.range.toFormat("HH:mm",{separator:"-"})},`${t}-${e.id}`))})]}),e.volunteersRegistrations.map(n=>{const r=n.userInfo;return(0,i.jsxs)(Ra,{children:[(0,i.jsxs)(FL,{children:[(0,i.jsx)(qg,{email:r.email,image:r.picture?.url,name:r.name,size:24}),(0,i.jsx)(br,{css:{flex:"1",ellipsis:""},title:r.name,children:r.name})]}),(0,wc.A)(0,s).map(s=>{const r=xh(o.plus({days:s}),e.slots);return 0===r.length||r[0].isAddedSlot?(0,i.jsx)(NL,{},`${s}`):r.map(e=>{const o=`${s}-${e.id}`,r=void 0!==n.positionsSlotsUsersInfos.find(({positionSlotId:t})=>t===e.id),a=n.positionsSlotsUsersInfos.some(({positionSlot:t})=>t.range.overlaps(e.range)),l=n.slots.some(t=>t.range.engulfs(e.range));return r?(0,i.jsx)(ML,{children:(0,i.jsx)(br,{children:(0,i.jsx)($L,{})})},o):l&&!a?(0,i.jsx)(LL,{children:(0,i.jsx)(br,{children:t("disponible_69523")})},o):(0,i.jsx)(NL,{},o)})})]},n.id)})]})]})},VL=e=>{const t=Hn(),n=(0,M.useMemo)(()=>(0,ic.A)(ih(e.event.position.slots),e=>e.range.start).filter(t=>{if(e.date?.isValid&&e.endDate?.isValid){const n=Bs.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return t.range.overlaps(n)}return!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day"))}),[e.event,e.date,e.endDate]),s=(0,M.useMemo)(()=>{if(eo(n)){const e=nh(n.map(({range:e})=>e).reduce((e,t)=>e.union(t),n[0].range)),t=n[0].range.start;return(0,wc.A)(0,e).flatMap(e=>{const i=t.plus({days:e}),s=xh(i,n);return eo(s)?s:[{id:i.toMillis(),range:Bs.IX.fromDateTimes(i.startOf("day"),i.endOf("day")),isAddedSlot:!0}]})}return[]},[n]);return eo(s)?(0,i.jsx)(i.Fragment,{children:(0,Ug.A)(s,8).map((t,n)=>(0,Ug.A)(e.event.volunteersRegistrations.nodes,11).map((s,o)=>(0,i.jsx)(BL,{position:e.event.position,slots:t,volunteersRegistrations:s},`${n}-${o}`)))}):(0,i.jsx)(Ra,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:(0,i.jsx)(Ra,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(br,{font:"gray900 textXl medium",children:t("planning_1_14391",e.event.position.name)})})})},UL=e=>{const{translate:t,params:{eventId:n}}=cl(),{user:s}=ni(),{checkDocumentsExport:o}=ib(),[r,a]=(0,M.useState)([e.segmentsFolders[0].segments[0].id]),[l,d]=(0,M.useState)(e.languages[0]),[c,u]=(0,M.useState)(Bs.c9.invalid("Invalid")),[h,m]=(0,M.useState)(ke.OnePerPage),[g,p]=(0,M.useState)(!1),f=(0,M.useMemo)(()=>e.showStrategy&&(!e.badgeType||function(e){try{return function(e,t){switch(e){case ge.Animajeconvention:case ge.Asoassignment:case ge.Cerclestaff:case ge.Cerclelivraison:case ge.Cerclepressandpartenaire:case ge.Cercleopcom:case ge.Delta:case ge.Dfcoa4:case ge.Dfcosmall:throw new Error("Not implemented");case ge.Eurockeennes:return(0,i.jsx)(Jg,{event:t});case ge.Fcg:return(0,i.jsx)(np,{event:t});case ge.Garorockplanning:case ge.Goldencoast:case ge.Hbcldc:case ge.Hbclnh:case ge.Lnh:case ge.Moorea:case ge.Nuitssecretes:case ge.Openbrest:case ge.P2nassignment:case ge.P2nassignmentmontagedemontage:case ge.P2nbadge:case ge.Paris20km:case ge.Paris20kmassignment:case ge.Paris20kmcontremarque:case ge.Pastourelle:case ge.Pastourelleexposant:case ge.Pec:case ge.Playground:case ge.Roiarthur:case ge.Rose:case ge.Roseparking:throw new Error("Not implemented");case ge.Salamandre:return(0,i.jsx)(qx,{event:t});case ge.T24assignment:case ge.Triathlonlarochellebadge:case ge.Utopialesimprimeur:case ge.Utopialesa4:case ge.Vandbcontremarque:case ge.Vannes:case ge.Vannesassignment:case ge.Vendanges:case ge.Vendeeglobebadge:case ge.Vendeeglobecontremarque:throw new Error("Not implemented");default:nl()}}(e,{}),!0}catch(e){return"Not implemented"!==e.message}}(e.badgeType)),[e.badgeType,e.showStrategy]);return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ra,{align:"center",css:{background:"$primary50",borderRadius:"48px",color:"$primary700",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(Ya,{icon:"envelope"})})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",textAlign:"center",children:e.title}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",dangerouslySetInnerHTML:{__html:t("en_2_clics_rec_97175")},textAlign:"center"}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ja,{color:"gray",leftIcon:"circle-exclamation",children:t("l_e_mail_peut_m_13253")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:[(0,i.jsx)(fc,{isSearchVisible:!0,label:t("vue_s_personna_35768"),multiple:!0,placeholder:t("s_lectionnez_un_53633"),values:r,onChange:a,children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))}),e.languages.length>1&&(0,i.jsx)(Au,{label:t("Language"),placeholder:t("Language"),value:l,onChange:e=>{d(e)},children:e.languages.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.showDate&&(0,i.jsx)(Tu,{label:t("exportez_vos_do_87332"),max:e.endAt,min:e.startAt,value:c,onChange:u}),f&&(0,i.jsx)(Au,{label:t("strat_gie_44389"),value:h,onChange:e=>m(e),children:sn.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}),(0,i.jsx)(dc,{state:g?"checked":"unchecked",onClick:e=>{p("checked"===e)},children:t("fusionner_les_d_64130")}),(0,i.jsx)(Ol,{label:t("Email"),state:"disabled",value:s?.email??"",onChange:Hl.A})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:e.isSendLoading,onClick:async()=>{const t=await e.onSend(r,l,g,h,c.isValid?c:void 0);o(n,t),e.onClose()},children:t("envoyer_26609")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},WL=e=>{const t=Hn(),{mutate:n,isLoading:s}=Ro(),[o,r]=M.useState(!1);return(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(Qb,{returnPathFallback:Os.DOCUMENTS(e.organizationId,e.eventId)}),(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:e.title}),(0,i.jsx)(Ib,{rolesTypes:cI,children:e.extraButton}),(0,i.jsx)(Ib,{rolesTypes:cI,children:(0,i.jsx)(jl,{isLoading:s,onClick:()=>{r(!0)},children:t("param_trer_l_ex_83342")})}),o&&(0,i.jsx)(UL,{badgeType:e.badgeType,endAt:e.endAt,isSendLoading:s,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,s,o,r)=>{const{eventDocumentsExport:a}=await n({eventId:e.eventId,documentsExport:{documentType:e.documentType,badgeType:e.badgeType,customDocumentSlug:e.customDocumentSlug,segmentsIds:t,language:i,oneFile:s,strategy:o,date:r}});return a}})]})},GL=e=>(0,i.jsx)(Ra,{css:{background:"$gray50",border:"1px solid $gray200",flex:"1",padding:"$7",overflowX:"hidden",overflowY:"auto"},height:1,justify:"center",children:(0,i.jsx)(Ra,{css:{boxShadow:"$md",borderRadius:"$2",height:"fit-content",overflow:"hidden"},direction:"column",width:e.width,children:e.children})});const HL=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,positionId:r}}=cl(),[a,l,d]=Pc(""),{positionsOptions:c,isLoading:u}=function({eventId:e,hasSelected:t,nameDebounced:n,organizationId:s,positionsIds:o}){const{data:r,isLoading:a}=(l={organizationId:s,eventId:e,hasSelected:t,name:m(n)?n:void 0,ids:o},Yn(go,l,[]));var l;const d=M.useMemo(()=>(0,ic.A)((0,ch.A)((r.organization?.list.nodes??[]).concat(r.organization?.selected.nodes??[]),e=>e.id),e=>e.name.toLowerCase()),[r.organization]);return{positionsOptions:M.useMemo(()=>d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[d]),isLoading:a}}({organizationId:s,eventId:o,hasSelected:!0,positionsIds:[r],nameDebounced:l});return(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_94895")}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(fc,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),state:"search",value:a,onChange:d}),values:[r],onChange:n=>{eo(n)&&t.replace(e.getPath(n[0]))},children:c})})]})},qL=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("query PositionPlanningDocument($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n ...DocumentPositionPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,positionId:s},[Ms.DocumentPositionPlanningFragment,Ms.EventPositionsExportFragment]);return Td(`${o.name} ${e("planning_d_une_64581")}`),(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.PositionPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("planning_d_une_64581")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(HL,{getPath:e=>Os.DOCUMENTS_POSITION_PLANNING(t,n,e)}),(0,i.jsx)(GL,{children:(0,i.jsx)(VL,{event:r.event})})]})]})},YL=e=>{const t=Hn(),n=m(e.acronym)?`${e.name} (${e.acronym})`:e.name;return(0,i.jsxs)(Ra,{css:{background:"$gray100",padding:"$7 56px"},direction:"column",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"medium",children:n}),(0,i.jsx)(br,{color:"gray800",children:t("fiche_de_missio_00324")})]})},KL=e=>{const t=Hn(),n=Gn(Mj),s=(0,M.useMemo)(()=>e.slugsToDisplay||[],[e.slugsToDisplay]),o=(0,M.useMemo)(()=>Object.fromEntries(s.flatMap(t=>{const n=e.customFields.find(e=>e.slug===t);return n?[[t,n]]:[]})),[s,e.customFields]),r=(0,M.useMemo)(()=>(0,ic.A)(e.volunteers,e=>e.userInfo.name),[e.volunteers]);return(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{css:{height:"32px"},children:s.map(e=>{const n=o[e];return"email"===e?(0,i.jsx)(Fc,{children:t("Email")},e):"fullName"===e?(0,i.jsx)(Fc,{children:t("full_name")},e):"picture"===e&&n?(0,i.jsx)(Fc,{width:80,children:n.name},e):"teamCode"===e?(0,i.jsx)(Fc,{children:t("code_quipe_14296")},e):n?(0,i.jsx)(Fc,{children:n.name},e):(0,i.jsx)(Fc,{},e)})}),r.map(e=>{const t=e.userInfo;return(0,i.jsx)(Tc,{css:{height:"28px"},children:s.map(s=>{const r=o[s];return"email"===s?(0,i.jsx)(yc,{children:t.email},s):"fullName"===s?(0,i.jsx)(Fc,{css:{color:"$gray800"},children:t.name},s):"picture"===s&&r?(0,i.jsx)(yc,{width:80,children:(0,i.jsx)(qg,{email:t.email,image:t.picture?.url,name:t.name,size:32})},s):"teamCode"===s?(0,i.jsx)(yc,{children:e.teams.map(e=>e.teamCode).join(", ")},s):r?(0,i.jsx)(yc,{children:n.getValueString(r,t.fields)},s):(0,i.jsx)(yc,{},s)})},t.id)})]})},ZL=e=>{const t=Hn(),{isRenamed:n,finalName:s,rangeString:o}=dT(e.slot);return(0,i.jsx)(i.Fragment,{children:(0,Ug.A)(e.volunteers,30).map((r,a)=>(0,i.jsxs)(Ra,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(YL,{acronym:e.positionAcronym,name:e.positionName}),(0,i.jsxs)(Ra,{css:{padding:"$7 56px"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsxs)(br,{font:"gray800 textSm medium",children:[t("membres_pour_le_20317",s)," (",e.volunteers.length,")"]}),n&&(0,i.jsx)(br,{font:"gray800 textXs medium",children:o})]}),(0,i.jsx)(KL,{customFields:e.customFields,slugsToDisplay:e.slugsToDisplay,volunteers:r})]})]},a))})};function XL(e,t){const n=[];return"both"!==t&&"email"!==t||n.push(e.userInfo.email),m(e.userInfo.name)&&n.unshift(e.userInfo.name),!e.userInfo.phone||"both"!==t&&"phone"!==t||n.push(`${e.userInfo.phone.internationalFormat}`),n.join("
")}const JL=e=>{const t=Hn(),n=Gn(ah),s=(0,M.useMemo)(()=>(0,ic.A)(e.ranges,e=>e.range.start.toMillis()).map(({name:e,range:t})=>(0,Va.A)([m(e)?e:null,n.toDisplayString(t,{formats:{displayWeekday:!0}})]).join(" - ")),[e.ranges]),o=(0,ch.A)(e.position.leaders.concat(e.position.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Ra,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"6",children:[e.displayPositionName&&(0,i.jsxs)(br,{color:"gray800",fontSize:"textMd",fontWeight:"medium",children:[e.position.category.name," | ",e.position.name]}),(0,i.jsxs)(Ra,{gap:"9",children:[(0,i.jsx)(br,{color:"gray500",width:150,children:t("date_de_la_miss_70346")}),(0,i.jsx)(Ra,{css:{flex:"1"},direction:"column",children:s.map((e,t)=>(0,i.jsx)(br,{color:"gray800",css:{textTransform:"capitalize"},children:e},t))})]}),o.map((n,s)=>(0,i.jsxs)(Ra,{gap:"9",children:[(0,i.jsx)(br,{color:"gray500",width:150,children:t("reponsable_82458")}),(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},dangerouslySetInnerHTML:{__html:XL(n,e.leadersData)}})]},s)),m(e.position.description)&&(0,i.jsxs)(Ra,{gap:"9",children:[(0,i.jsx)(br,{color:"gray500",width:150,children:t("description_58935")}),(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(hg,{text:e.position.description})})]}),kh(e.position)&&(0,i.jsxs)(Ra,{gap:"9",children:[(0,i.jsx)(br,{color:"gray500",width:150,children:t("localisation_38416")}),(0,i.jsxs)(br,{color:"gray800",css:{flex:"1"},children:[Ch(e.position)&&e.position.address,yh(e.position)&&(0,i.jsx)("a",{href:mg(e.position.latitude,e.position.longitude),children:(0,i.jsx)("img",{alt:"Position map",src:`${D.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)(Ra,{gap:"9",children:[(0,i.jsx)(br,{color:"gray500",width:150,children:t("nombre_de_cr_ne_40593")}),(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},children:e.position.numberOfSlots})]}),(0,i.jsxs)(Ra,{gap:"9",children:[(0,i.jsx)(br,{color:"gray500",width:150,children:t("nombre_de_membr_08851")}),(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},children:e.position.assignedResources})]})]})]})},QL=e=>{const{organization:t,event:n}=e.positionDocumentFragment,s=n.position,o=(0,M.useMemo)(()=>s.slots.filter(t=>!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day"))),[s,e.date]);return(0,i.jsxs)(br,{css:{background:"white"},width:1,children:[e.options.showPositionData&&(0,i.jsxs)(Ra,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(YL,{acronym:s.acronym,name:s.name}),(0,i.jsx)(JL,{displayPositionName:!1,leadersData:"both",position:s,ranges:s.range?[{name:null,range:s.range}]:[],showResourcesInfos:!0})]}),e.options.showVolunteersLists&&o.map(o=>{const r=(0,ic.A)(n.volunteersRegistrations.nodes.filter(({positionsSlotsUsersInfos:e})=>e.map(({positionSlotId:e})=>e).includes(o.id)),e=>e.userInfo.name);return(0,i.jsx)(ZL,{customFields:t.customFields.nodes,positionAcronym:s.acronym,positionName:s.name,slot:o,slugsToDisplay:e.options.slugsToDisplay,volunteers:r},o.id)})]})},eB=e=>{const t=Hn();return(0,i.jsx)(Ib,{permissions:xb.DOCUMENT_EDIT,children:(0,i.jsxs)(Ra,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$6",overflowY:"auto",minWidth:"320px"},direction:"column",width:420,children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("param_tres_de_l_11729")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("s_lectionnez_le_59909")}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Ra,{direction:"column",gap:"3",width:1,children:e.children})]})})};function tB(e,t,n,i){const{canDocumentEdit:s}=lS(),{mutate:o}=function(e={}){return Kn("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]=M.useState({...t,...e}),[l,d]=M.useState(i.informations2Content||""),[c,u]=M.useState(i.informations2Title||""),[h,m]=M.useState(i.informationsContent||""),[g,p]=M.useState(i.informationsTitle||""),[f,x]=M.useState(i.signature||""),[_,I]=M.useState(i.title||""),v=M.useCallback((0,$c.A)(async(e,t,r,a,l,d,c)=>{s&&await o({eventId:n,id:i.id,eventDocument:{options:e,informations2Content:t,informations2Title:r,informationsContent:a,informationsTitle:l,signature:d,title:c}})},200),[n,i.id,s]);return{eventDocument:{options:e,informations2Content:l,informations2Title:c,informationsContent:h,informationsTitle:g,signature:f,title:_},informations2Content:l,informations2Title:c,informationsContent:h,informationsTitle:g,options:r,signature:f,title:_,setInformations2Content:async t=>{d(t),await v(e,t,c,h,g,f,_)},setInformations2Title:async t=>{u(t),await v(e,l,t,h,g,f,_)},setInformationsContent:async t=>{m(t),await v(e,l,c,t,g,f,_)},setInformationsTitle:async t=>{p(t),await v(e,l,c,h,t,f,_)},setOptions:async e=>{const t={...r,...e};a(t),await v(t,l,c,h,g,f,_)},setSignature:async t=>{x(t),await v(e,l,c,h,g,t,_)},setTitle:async t=>{I(t),await v(e,l,c,h,g,f,t)}}}const nB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{event:o}=Jv(),{options:r,setOptions:a}=tB(e.data.event.document.options,{format:it.A4Portrait,showPositionData:!0,showVolunteersLists:!0,slugsToDisplay:["fullName","phone"]},s,{id:e.data.event.document.id});return Td(`${o.name} ${t("fiche_de_missio_00324")}`),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(eB,{children:[(0,i.jsxs)(Au,{value:r.format,onChange:e=>{a({format:e})},children:[(0,i.jsx)("option",{value:it.A4Portrait,children:t("a4_portrait_92125")}),(0,i.jsx)("option",{value:it.A4Landscape,children:t("a4_paysage_24039")})]}),(0,i.jsx)(dc,{state:r.showPositionData?"checked":"unchecked",onClick:e=>{a({showPositionData:"checked"===e})},children:t("afficher_les_do_85282")}),(0,i.jsx)(dc,{state:r.showVolunteersLists?"checked":"unchecked",onClick:e=>{a({showVolunteersLists:"checked"===e})},children:t("afficher_les_li_18523")}),(0,i.jsxs)(fc,{isSearchVisible:!0,multiple:!0,placeholder:t("champs_affich_17945"),values:r.slugsToDisplay,onChange:e=>{a({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:t("Email")}),(0,i.jsx)("option",{value:"fullName",children:t("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:t("code_quipe_14296")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(HL,{getPath:e=>Os.DOCUMENTS_POSITION(n,s,e)}),(0,i.jsx)(GL,{width:1,children:(0,i.jsx)(QL,{options:r,positionDocumentFragment:e.data})})]})]})},iB=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:s}}=cl(),{data:o,loader:r}=Yn("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:s},[Ms.DocumentPositionSheetFragment,Ms.EventPositionsExportFragment]);return(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.Position,eventId:n,languages:o.event?.languages??[],organizationId:t,segmentsFolders:o.event?.segmentsFolders??[],showDate:!0,title:e("fiche_de_missio_61604")}),(0,i.jsx)(Ba,{height:"7"}),r||(0,i.jsx)(nB,{data:o})]})},sB=e=>{const t=Hn();return(0,i.jsx)(Ra,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(br,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:t("planning_1_14391",`${e.eventName} - ${e.segmentName}`)})})},oB=e=>{const t=Hn(),n=Gn(Wc),s=(0,nc.A)(e.slots,e=>e.positionId);return(0,i.jsxs)(Ra,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[!0!==e.hideHeader&&(0,i.jsx)(sB,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Ra,{css:{background:"white",padding:"$6",position:"relative"},direction:"column",width:1,children:[(0,i.jsxs)(Ra,{children:[(0,i.jsx)(PL,{width:240,children:t("jour_87026")}),(0,i.jsx)(PL,{width:720,children:n.toLocaleString(e.startDate,Zs.DateOnly.WeekdayLongMonthLong)})]}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(PL,{width:240,children:t("cr_neaux_33401")}),(0,wc.A)(0,6).map(t=>{const n=e.startDate.plus({hour:2*t}),s=n.plus({hour:2}),o=Bs.IX.fromDateTimes(n,s);return(0,i.jsx)(PL,{width:120,children:o.toFormat("HH:mm")},t)})]}),e.positions.map((t,n)=>{const o=s[t.id];return(0,i.jsxs)(M.Fragment,{children:[(0,i.jsxs)(Ra,{children:[(0,i.jsx)(PL,{css:{color:"$gray700",height:"48px"},width:240,children:(0,i.jsx)(br,{css:{ellipsis:!0},textAlign:"start",width:1,children:t.name})}),(0,wc.A)(0,6).map(e=>(0,i.jsx)(PL,{css:{height:"48px"},width:120},e))]}),o.map(t=>{const s=t.range.start.diff(e.startDate).shiftTo("hours","minutes"),o=t.range.end.diff(t.range.start).shiftTo("hours","minutes"),r=264+60*s.hours+s.minutes,a=112+48*n,l=60*o.hours+o.minutes,d=`${m(t.name)?`${t.name} - `:""}${t.range.toFormat("HH:mm")}`;return(0,i.jsx)(Ra,{align:"center",css:{background:t.position.color,borderRadius:"$1",color:Gd(t.position.color),fontSize:"$textXs",height:"32px",left:`${r}px`,position:"absolute",top:`${a}px`,width:`${l}px`},children:(0,i.jsx)(br,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:d,width:1,children:d})},t.id)})]},t.id)})]})]})},rB=e=>{const t=(0,M.useMemo)(()=>{const t=ih(e.event.positionsSlots.nodes);if(eo(t)){const n=rh(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:Bs.IX.fromDateTimes(t.start,t.start.set({hour:12,minute:0}))},{...e,range:Bs.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,M.useMemo)(()=>eo(t)?rh(t.map(e=>e.range)):null,[t]),s=n&&(8!==n.startHour||20!==n.endHour);return(0,i.jsx)(i.Fragment,{children:n?(0,wc.A)(0,n.numberOfDays).map((o,r)=>(0,wc.A)(0,s?2:1).map((a,l)=>{const d=n.startDate.plus({day:o}).set({hour:s?0===l?0:12:8}),c=s?0===l?d.set({hour:12}):d.plus({day:1}).startOf("day"):d.set({hour:20}),u=Bs.IX.fromDateTimes(d,c),h=t.filter(e=>e.range.overlaps(u)),m=(0,ic.A)((0,ch.A)(h.map(e=>e.position),e=>e.id),e=>e.name);return eo(h)?(0,Ug.A)(m,11).map((t,n)=>(0,i.jsx)(oB,{eventName:e.event.name,hideHeader:e.hideHeader,positions:t,segmentName:e.event.segment.name,slots:h,startDate:d},`${r}-${l}-${n}`)):null})):!0!==e.hideHeader?(0,i.jsx)(sB,{eventName:e.event.name,segmentName:e.event.segment.name}):null})},aB=e=>{const{history:t,translate:n,params:{segmentId:s}}=cl();return(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_43833")}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(fc,{isSearchVisible:!0,values:[s],onChange:n=>{eo(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))})}),m(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})},lB=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("query PlanningDocument($eventId: EventId!, $segmentId: SegmentId!, $date: Date) {\n event(id: $eventId) {\n ...DocumentPositionsPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,segmentId:s},[Ms.DocumentPositionsPlanningFragment,Ms.EventPositionsExportFragment]);return Td(`${o.name} ${e("planning_de_l_96909")}`),(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.Planning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_de_l_96909")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(aB,{getPath:e=>Os.DOCUMENTS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(GL,{width:1,children:(0,i.jsx)(br,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(rB,{event:r.event})})})]})]})},dB=100,cB=e=>{const t=Hn(),n=Gn(Wc),s=(0,M.useMemo)(()=>nh(e.slots.map(({range:e})=>e).reduce((e,t)=>e.union(t),e.slots[0].range)),[e.slots]),o=e.slots[0].range.start,r=t=>(0,ic.A)(xh(t,e.slots),[e=>e.position.name.toLowerCase(),e=>e.range.start.toMillis()]);return(0,i.jsxs)(Ra,{css:{background:"white",fontSize:"12px",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(sB,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Ra,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Ra,{children:[(0,i.jsx)(PL,{width:200,children:t("jours_88317")}),(0,wc.A)(0,s).map(t=>{const s=o.plus({days:t}),r=xh(s,e.slots);return(0,i.jsx)(PL,{width:(r.length||1)*dB,children:n.toLocaleString(s,Zs.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(PL,{width:200,children:t("missions_63972")}),(0,wc.A)(0,s).map(t=>{const n=o.plus({days:t}),s=(0,ic.A)(Object.values((0,nc.A)(xh(n,e.slots),e=>e.position.id)).map(e=>({position:e[0].position,numberOfSlots:e.length})),({position:e})=>e.name.toLowerCase());return 0===s.length?(0,i.jsx)(NL,{css:{height:"40px"},width:dB},t):s.map(({position:e,numberOfSlots:n})=>{const s=m(e.acronym)?e.acronym:e.name;return(0,i.jsx)(PL,{width:n*dB,children:(0,i.jsx)(br,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:s,width:1,children:s})},`${t}-${e.id}`)})})]}),(0,i.jsxs)(Ra,{children:[(0,i.jsx)(PL,{width:200,children:t("cr_neaux_33401")}),(0,wc.A)(0,s).map(e=>{const t=o.plus({days:e}),n=r(t);return 0===n.length?(0,i.jsx)(NL,{css:{height:"40px"},width:dB},e):n.map(t=>(0,i.jsx)(PL,{width:dB,children:t.range.toFormat("HH:mm",{separator:"-"})},`${e}-${t.id}`))})]}),e.volunteersRegistrations.map(e=>{const t=e.userInfo;return(0,i.jsxs)(Ra,{children:[(0,i.jsxs)(FL,{width:200,children:[(0,i.jsx)(qg,{email:t.email,image:t.picture?.url,name:t.name,size:24}),(0,i.jsx)(br,{css:{flex:"1",ellipsis:""},title:t.name,children:t.name})]}),(0,wc.A)(0,s).map(t=>{const n=o.plus({days:t}),s=r(n);return 0===s.length?(0,i.jsx)(NL,{width:dB},t):s.map(n=>{const s=`${t}-${n.id}`;return void 0!==e.positionsSlotsUsersInfos.find(({positionSlotId:e})=>e===n.id)?(0,i.jsx)(ML,{width:dB,children:(0,i.jsx)(br,{children:(0,i.jsx)($L,{})})},s):(0,i.jsx)(NL,{width:dB},s)})})]},e.id)})]})]})},uB=e=>{const t=(0,ic.A)(ih(e.event.positionsSlots.nodes),e=>e.range.start),n=e.event.volunteersRegistrations.nodes;return(0,i.jsx)(i.Fragment,{children:(0,Ug.A)(t,8).map((t,s)=>{const o=t.map(e=>e.id),r=n.filter(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return(0,lh.A)(o,t).length>0});return(0,Ug.A)(r,10).map((n,o)=>(0,i.jsx)(cB,{eventName:e.event.name,segmentName:e.event.segment.name,slots:t,volunteersRegistrations:n},`${s}-${o}`))})})},hB=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("query PositionsVolunteersPlanningDocument($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n ...DocumentPositionsVolunteersPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,segmentId:s},[Ms.DocumentPositionsVolunteersPlanningFragment,Ms.EventPositionsExportFragment]);return Td(`${o.name} ${e("planning_d_un_g_23684")}`),(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.PositionsVolunteersPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_d_un_g_23684")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(aB,{getPath:e=>Os.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(GL,{children:(0,i.jsx)(br,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(uB,{event:r.event})})})]})]})};var mB=n(8962),gB=n.n(mB);const pB=(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(gB().detect(e)||"UTF-8")},i.onerror=n,i.readAsArrayBuffer(e)}).then(t=>new Promise((n,i)=>{const s=new FileReader;s.onload=()=>n(s.result?.toString()??""),s.onerror=i,s.readAsText(e,t)})),fB=({css:e,label:t,description:n,icon:s,hint:o,state:r,value:a,placeholder:l,accept:d,format:c,onChange:u,...h})=>{const g=(0,M.useRef)(null),{inputId:p,descId:f,errorId:x}=Na();return(0,i.jsxs)(Ra,{css:e,direction:"column",width:1,children:[(0,i.jsx)(El,{htmlFor:p,isClickable:!1,children:t}),(0,i.jsx)(wl,{id:f,children:n}),(t||n)&&(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(zl,{cursor:"pointer",icon:s,rightIcon:"file",state:r,onClick:()=>{g.current?.click()},children:(0,i.jsxs)(br,{color:m(a?.name)?"gray800":"gray500",css:{flex:"1","& input":{display:"none"}},children:[m(a?.name)?a.name:l,(0,i.jsx)("input",{ref:g,accept:uv(d),"aria-describedby":n?f:void 0,"aria-errormessage":"error"===r?x:void 0,"aria-invalid":"error"===r,id:p,type:"file",onChange:async e=>{const t=e.target.files?.[0];t&&u({name:t.name,content:await pB(t,c)})},...h})]})}),(0,i.jsx)(Sl,{id:x,state:r,children:o})]})};function xB(e){return{color:Zd(e.subtitleColor)?e.subtitleColor:"$gray800",fontFamily:e.titleFontFamily||"Open Sans",fontSize:"14px",fontWeight:"700",textTransform:"uppercase"}}const _B=e=>{const t=Hn();return e.options.showInformations?(0,i.jsxs)(Ra,{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)(br,{css:{...xB(e.options),textAlign:"center"},width:1,children:m(e.informationsTitle)?e.informationsTitle:t("informations_22954")}),m(e.informationsContent)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(hg,{text:e.renderText(e.informationsContent)})})})]}):null},IB=e=>(0,i.jsx)(Ra,{css:{paddingTop:e.isAso?"180px":"73px",position:"relative"},direction:"column",gap:"5",width:e.isAso?157:178,children:e.children}),vB=e=>e.options.showQrCode?(0,i.jsxs)(Ra,{align:"center",css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(br,{css:{...xB(e.options),textAlign:"center"},width:1,children:"QR Code"}),(0,i.jsx)(br,{height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:sg(e.ticketId,{height:90,width:90}),width:"100%"})})]}):null,bB=e=>{const t=Hn(),n=e.psuis[0].position,s=e.userInfo,o=168===e.organizationId,r=573===e.organizationId,a=858===e.organizationId,l=306===e.organizationId,d=Zd(e.options.headerColor)?e.options.headerColor:"white",c={color:Zd(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:o?"$moonstruck":e.options.titleFontFamily||"Open Sans",fontSize:o?"64px":"24px",fontWeight:o?"500":"800",lineHeight:o?"48px":void 0,textAlign:"center"},u=xB(e.options),h=e.options.showInformations||e.options.showInformations2||e.options.showQrCode,g=(0,ch.A)(n.leaders.concat(n.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Ra,{css:{color:Zd(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:m(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"repeat-y",backgroundSize:"100% auto",height:`calc-size(auto, round(up, size, ${Hm}px))`,width:`${qm}px`},"@page":{size:"A4 portrait"}},direction:"column",children:[(0,i.jsx)(br,{css:{backgroundAttachment:"fixed",backgroundColor:n.color,backgroundImage:m(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)(Ra,{align:"center",css:{marginLeft:"210px",marginTop:"51px"},gap:"4",justify:l?"end":"center",width:568,children:[(0,i.jsxs)(Ra,{align:l?"end":"center",css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(br,{css:{color:d,fontSize:"14px",fontWeight:"700",lineHeight:"18px"},children:m(e.document.title)?e.document.title:t("Assignments")}),(0,i.jsx)(br,{css:{color:d,fontSize:"28px",fontWeight:"700",lineHeight:"38px"},children:s.name})]}),l&&(0,i.jsx)(br,{css:{background:`url(${e.userInfo.picture?.url}) no-repeat`,backgroundSize:"contain",borderRadius:"$1",overflowX:"hidden"},height:74,width:74})]}),(0,i.jsx)(Ba,{height:l?"4":"7"}),(0,i.jsxs)(Ra,{css:{paddingLeft:a?"46px":"$4",paddingRight:"$4"},gap:"4",width:1,children:[h&&(0,i.jsxs)(IB,{isAso:a,children:[(0,i.jsx)(_B,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,isAso:a,options:e.options,renderText:e.renderText}),e.options.showInformations2&&(0,i.jsxs)(Ra,{css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(br,{css:{...u,textAlign:"center"},width:1,children:m(e.document.informations2Title)?e.document.informations2Title:t("informations_se_69499")}),m(e.document.informations2Content)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(hg,{text:e.renderText(e.document.informations2Content)})})})]}),(0,i.jsx)(vB,{options:e.options,ticketId:e.volunteerRegistration.ticketId}),a&&e.options.showLeaders&&g[0]&&(0,i.jsxs)(br,{css:{position:"absolute",top:"450px"},width:1,children:[g[0].userInfo.name,(0,i.jsx)("br",{}),g[0].userInfo.phone?.internationalFormat]})]}),(0,i.jsxs)(Ra,{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)(br,{css:{...c,fontSize:"12px",fontWeight:"700"},children:n.category.name}),(0,i.jsx)(Ba,{height:"1"})]}),(0,i.jsx)(br,{css:c,width:1,children:n.name}),e.children]})]})]})},jB=e=>{const t=Hn(),n=Gn(Mj),s=Gn(dw),o=Gn(Vn),r=e.psuis[0].position,a=(0,ic.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,h=426===e.organizationId,g=xB(e.options),p=(0,ch.A)(r.leaders.concat(r.category.leaders),e=>e.userInfo.id),f="both"===e.options.leadersData||"email"===e.options.leadersData,x="both"===e.options.leadersData||"phone"===e.options.leadersData,_=t=>s.renderText(t,{userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(bB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[e.options.showLeaders&&!d&&!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(br,{css:{color:Zd(e.options.subtitleColor)?e.options.subtitleColor:"$gray800",fontSize:"14px",fontWeight:"700"},textAlign:"center",width:1,children:[t("ton_responsable_16222")," ",p.map(e=>(0,Va.A)([e.userInfo.name,f?e.userInfo.email:"",x?e.userInfo.phone?.internationalFormat??"":""]).join(" ")).join(", ")]})]}),(0,i.jsx)(Ba,{height:"7"}),!c&&(0,i.jsxs)(Ra,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(br,{css:g,children:u?"Horaire":t("date_de_ta_miss_18706")}),(0,i.jsx)(Ra,{direction:"column",gap:"1",children:a.map((e,t)=>{const n=e.range.start,s=e.range.end,r=n.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(br,{children:[m(e.name)?`${e.name} | `:"",(0,i.jsx)(Gm,{css:{textTransform:"capitalize"},children:n.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})," ","-"," ",(0,i.jsx)(Gm,{css:{textTransform:"capitalize"},children:r?s.toFormat("HH:mm"):s.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})]},t)})})]}),c&&(0,i.jsxs)(Ra,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(br,{css:g,children:"Rendez-vous"}),(0,i.jsx)(Ra,{direction:"column",gap:"1",children:a.map((e,t)=>(0,i.jsxs)(br,{children:[(0,i.jsx)(Gm,{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)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(br,{css:g,children:u?"Consignes du poste":t("description_de_15187")}),(0,i.jsxs)(Ra,{direction:"column",children:[m(r.description)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{"& .h-rich-text > p":{margin:"0"},"& .h-rich-text figure, & .h-rich-text img":{maxWidth:"100%"}},children:(0,i.jsx)(hg,{text:r.description})}),(0,i.jsx)(Ba,{height:"1"})]}),kh(r)&&(0,i.jsxs)(Ra,{css:{"@media print":{breakInside:"avoid",display:"block",overflow:"visible"}},direction:"column",children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{css:g,children:d?"Point de rendez-vous":h?"Lieu du poste":t("lieu_de_rendez_30016")}),Ch(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{children:r.address})]}),yh(r)&&(d||u)&&(0,i.jsxs)(br,{children:["Point GPS : ",r.latitude,", ",r.longitude]}),yh(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{gap:"3",width:1,children:[(0,i.jsx)(br,{css:{width:"100%"},height:u?270:180,children:(0,i.jsx)("a",{href:mg(r.latitude,r.longitude),style:{background:`url(${D.HEAVENT_API_URL}/image/event/${e.eventId}/position/${r.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),l&&m(r.fields?.cf44697?.url)&&(0,i.jsx)(br,{css:{background:`url(${r.fields.cf44697.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204}),d&&m(r.fields?.cf46814?.url)&&(0,i.jsx)(br,{css:{background:`url(${r.fields.cf46814.url}) no-repeat`,backgroundSize:"contain"},height:180,width:1}),c&&m(r.fields?.cf45815?.url)&&(0,i.jsx)(br,{css:{background:`url(${r.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]})]}),d&&m(r.fields?.cf46813)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{children:r.fields.cf46813})]})]})]})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(br,{css:g,children:"UNE QUESTION OU UN PROBLÈME ?"}),(0,i.jsxs)(br,{children:["Nous sommes là pour vous aider. Contactez votre responsable de secteur :"," ",(0,i.jsxs)(Gm,{fontWeight:"bold",children:[p[0]?.userInfo.name," :"," ",p[0]?.userInfo.phone?.internationalFormat]})]})]})]}),e.customFields.map(t=>{const s=n.getValueString(t,r.fields,{fileReturnValue:"url"});return e.options.positionCustomFields?.includes(t.id)&&m(s)?(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(br,{css:g,children:t.name}),t.fieldType===Le.File?function(e){const{extension:t}=qI(e);return YI.includes(t)}(n.getValueString(t,r.fields,{fileReturnValue:"name"}))?(0,i.jsx)(br,{css:{background:`url(${s}) no-repeat`,backgroundPosition:"center",backgroundSize:"cover"},height:180,width:1}):(0,i.jsx)(br,{css:{wordBreak:"break-word","& > a":{color:"inherit"}},children:(0,i.jsx)("a",{href:s,rel:"noreferrer",target:"_blank",children:s})}):(0,i.jsx)(br,{dangerouslySetInnerHTML:{__html:s.replace(/\n/g,"
")}})]})]},t.id):null}),m(e.options.signature)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(hg,{text:_(e.options.signature)})})})]}),c&&m(r.fields?.cf24781?.url)&&(0,i.jsxs)(bB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{color:Zd(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Annexe)"}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{css:{background:`url(${r.fields.cf24781.url}) no-repeat`,backgroundSize:"contain"},height:1,width:1})]}),u&&(0,i.jsx)(bB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsx)(br,{css:{background:`url(${D.HEAVENT_ASSETS_URL}/badges/velotour/condition.png) no-repeat`,backgroundSize:"cover"},height:601,width:533})})]})},CB=e=>{const t=e.assignmentsInfos.event.volunteerRegistration,n=(0,M.useMemo)(()=>dg(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]),s=(0,M.useMemo)(()=>(0,ic.A)(Object.entries((0,nc.A)(n,e=>e.position.id)),([e,t])=>(0,dh.A)(t.map(e=>e.positionSlot.range.start.toMillis()))),[n]);return(0,i.jsx)(i.Fragment,{children:s.map(([n,s],o)=>(0,i.jsx)(jB,{customFields:e.assignmentsInfos.organization.customFields.nodes,document:e.eventDocument,eventId:e.assignmentsInfos.event.id,options:e.options,organizationId:e.assignmentsInfos.organization.id,psuis:s,userInfo:e.assignmentsInfos.organization.userInfo,volunteerRegistration:t},o))})},yB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{eventDocument:o,informations2Content:r,informations2Title:a,informationsContent:l,informationsTitle:d,options:c,signature:u,title:h,setInformations2Content:g,setInformations2Title:p,setInformationsContent:f,setInformationsTitle:x,setOptions:_,setSignature:I,setTitle:v}=tB(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"},s,{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=rL(),j=(0,M.useMemo)(()=>(0,ic.A)(e.data.organization.customFields.nodes,e=>e.name.toLowerCase()),[e.data]),C=e.data.organization.userInfo;return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(eB,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:c.background,onChange:e=>{_({background:e})}}),m(c.background?.name)&&(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{_({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Ol,{label:t("titre_du_docume_33508"),value:h,onChange:e=>{v(e)}}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Au,{label:"Police",value:c.fontFamily,onChange:e=>{_({fontFamily:e})},children:b}),(0,i.jsx)(Au,{label:t("police_des_titr_37497"),value:c.titleFontFamily,onChange:e=>{_({titleFontFamily:e})},children:b}),(0,i.jsx)(xj,{label:t("couleur_du_titr_08509"),value:c.titleColor,onChange:e=>{_({titleColor:e})}}),(0,i.jsx)(xj,{label:t("couleur_des_sou_18968"),value:c.subtitleColor,onChange:e=>{_({subtitleColor:e})}}),(0,i.jsx)(xj,{label:t("couleur_du_text_32021"),value:c.textColor,onChange:e=>{_({textColor:e})}}),(0,i.jsx)(xj,{label:t("couleur_du_cont_17150"),value:c.headerColor,onChange:e=>{_({headerColor:e})}}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(xu,{value:c.showInformations,onChange:e=>{_({showInformations:e})},children:t("afficher_la_sec_84744")}),c.showInformations&&(0,i.jsxs)(Ra,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Ol,{label:t("titre_de_la_sec_41575"),value:d,onChange:e=>{x(e)}}),(0,i.jsx)(Ev,{initialValue:l,label:t("contenu_de_la_s_43102"),onChange:e=>{f(e)}})]}),(0,i.jsx)(xu,{value:c.showInformations2,onChange:e=>{_({showInformations2:e})},children:t("afficher_la_sec_67554")}),c.showInformations2&&(0,i.jsxs)(Ra,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Ol,{label:t("titre_de_la_sec_41575"),value:a,onChange:e=>{p(e)}}),(0,i.jsx)(Ev,{initialValue:r,label:t("contenu_de_la_s_43102"),onChange:e=>{g(e)}})]}),(0,i.jsx)(xu,{value:c.showQrCode,onChange:e=>{_({showQrCode:e})},children:t("afficher_le_qr_15635")}),(0,i.jsx)(xu,{value:c.showLeaders,onChange:e=>{_({showLeaders:e})},children:t("afficher_les_re_08705")}),c.showLeaders&&(0,i.jsx)(Ra,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsxs)(Au,{label:t("donn_es_des_res_45809"),value:c.leadersData,onChange:e=>{_({leadersData:e})},children:[(0,i.jsx)("option",{value:"both",children:t("afficher_le_num_37296")}),(0,i.jsx)("option",{value:"phone",children:t("afficher_unique_41829")}),(0,i.jsx)("option",{value:"email",children:t("afficher_unique_97964")}),(0,i.jsx)("option",{value:"none",children:t("afficher_aucune_38167")})]})}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ev,{initialValue:u,label:t("signature_67521"),onChange:e=>{I(e)}}),eo(j)&&(0,i.jsx)(fc,{label:t("liste_des_champ_40847"),multiple:!0,values:c.positionCustomFields,onChange:e=>{_({positionCustomFields:e})},children:j.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:rg(C.links?.userAssignmentsLink??"","pdf",{lang:C.language}),getPath:e=>Os.DOCUMENTS_ASSIGNMENTS(n,s,e)}),(0,i.jsx)(GL,{children:(0,i.jsx)(CB,{assignmentsInfos:e.data,eventDocument:o,options:c})})]})]})},kB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("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:s},[Ms.DocumentUserAssignmentsFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("fiche_d_affecta_91461")}`),(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.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)(Ba,{height:"7"}),a||(0,i.jsx)(yB,{data:r})]})},AB=e=>{const t=Hn(),n=Gn(ah),s=e.options.format===it.A4Portrait?eg.A4:e.options.format===it.A5Portrait?eg.A5:eg.A6,o=e.badgeDocumentFragment.volunteerRegistration;return(0,i.jsxs)(br,{width:s.width,children:[(0,i.jsxs)(Ra,{css:{background:`linear-gradient(190deg, ${e.options.color} 40%, white 40%)`},direction:"column",height:s.height,width:1,children:[(0,i.jsx)(br,{css:{height:"calc(40% - 40px)"}}),(0,i.jsxs)(Ra,{align:"center",direction:"column",width:1,children:[(0,i.jsx)(qg,{email:o.userInfo.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:96}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:o.userInfo.nameOrEmail}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textLg",children:m(e.options.name)?e.options.name:t("membre_45658")})]}),(0,i.jsx)(br,{css:{flex:"1"}}),m(e.options.logo?.content)&&(0,i.jsx)(Ra,{height:96,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(Ba,{height:"6"})]}),e.showPageSeparator&&(0,i.jsx)(br,{css:{background:"transparent",height:"$space$6"}}),(0,i.jsxs)(Ra,{css:{background:"white",pageBreakBefore:"always",padding:"$4 $6"},direction:"column",height:s.height,width:1,children:[m(e.options.logo?.content)&&(0,i.jsx)(Ra,{height:32,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(Ba,{height:"6"}),!1!==e.options.showAssignments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",children:t("affectation_plural")}),(0,i.jsx)(Ba,{height:"2"}),o.positionsSlotsUsersInfos.map(({position:e,positionSlot:s},o)=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",children:t("affectation_n_78121",o+1)}),(0,i.jsxs)(br,{color:"gray800",children:[e.name," :"," ",n.toDisplayString(s.range)]}),(0,i.jsx)(Ba,{height:"2"})]},o))]}),m(e.options.infos)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",children:t("renseigements_c_00093")}),(0,i.jsx)(br,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]})]})]})},wB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{options:o,setOptions:r}=tB(e.data.event.document.options,{format:it.A6Portrait,logo:{name:"",content:""},color:mr.colors.gray900.value,name:"",infos:"",showAssignments:!0},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(eB,{children:[(0,i.jsxs)(Au,{label:"Format",value:o.format,onChange:e=>{r({format:e})},children:[(0,i.jsx)("option",{value:it.A4Portrait,children:"A4"}),(0,i.jsx)("option",{value:it.A5Portrait,children:"A5"}),(0,i.jsx)("option",{value:it.A6Portrait,children:"A6"})]}),(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:o.logo,onChange:e=>{r({logo:e})}}),m(o.logo?.name)&&(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({logo:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(xj,{label:t("couleur_de_fond_75677"),value:o.color,onChange:e=>{r({color:e})}}),(0,i.jsx)(Ol,{hint:t("ce_nom_sera_sit_11616"),label:t("nom_du_badge_36141"),placeholder:t("membre_45658"),value:o.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(Nm,{label:t("renseigements_c_00093"),placeholder:t("ex_contact_d_11070"),value:o.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(dc,{state:o.showAssignments?"checked":"unchecked",onClick:e=>{r({showAssignments:"checked"===e})},children:t("afficher_les_af_46643")})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:rg(a.links?.userBadgeLink??"","pdf",{lang:a.language}),getPath:e=>Os.DOCUMENTS_BADGE(n,s,e,"generic")}),(0,i.jsx)(GL,{children:(0,i.jsx)(AB,{badgeDocumentFragment:e.data.event,options:o,showPageSeparator:!0})})]})]})},SB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("query UserBadgeDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Ms.DocumentUserBadgeFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("BadgeCheck")}`),(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.Badge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("badges_37586")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsx)(wB,{data:r})]})},EB=e=>{const t=Hn(),n=Gn(Wc),s=Gn(ah),o=(0,M.useMemo)(()=>(0,ic.A)(e.certificateDocumentFragment.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.certificateDocumentFragment.volunteerRegistration]),r=Bs.c9.local(),a=e.certificateDocumentFragment.volunteerRegistration.userInfo;return(0,i.jsxs)(Ra,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"5",width:1,children:[m(e.options.header.content)&&(0,i.jsx)(br,{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)(br,{color:"gray900",fontSize:"textXl",fontWeight:"semiBold",textAlign:"center",children:t("attestation_de_92734")}),(0,i.jsxs)(Ra,{css:{bd:!0,padding:"$4"},direction:"column",gap:"6",children:[(0,i.jsxs)(br,{color:"gray800",fontWeight:"semiBold",children:[t("je_soussign_e_04371",e.options.name)," ",(0,i.jsx)("br",{}),e.options.title]}),(0,i.jsxs)(br,{css:{"& > span":{fontWeight:"$semiBold"}},children:[t("certifie_que_13123")," ",(0,i.jsx)("span",{children:a.name}),(0,i.jsx)("br",{}),t("n_e_le_14393")," ",(0,i.jsx)("span",{children:m(a.dateOfBirth)?n.toLocaleString(Bs.c9.fromISO(a.dateOfBirth),Zs.DateOnly.MonthLong):""}),(0,i.jsx)("br",{}),t("demeurant_78485")," ",(0,i.jsx)("span",{children:m(a.street)?a.street:""}),(0,i.jsx)("br",{}),t("commune_48881")," ",(0,i.jsx)("span",{children:m(a.city)?a.city:""}),(0,i.jsx)("br",{}),t("code_postal_74563")," ",(0,i.jsx)("span",{children:m(a.postalCode)?a.postalCode:""})]}),(0,i.jsx)(br,{color:"gray800",fontWeight:"semiBold",children:t("a_t_b_n_vole_58773")}),(0,i.jsx)(br,{dangerouslySetInnerHTML:{__html:o.map(({position:e,positionSlot:t})=>`${e.name} : ${s.toDisplayString(t.range)}`).join("
")}}),(0,i.jsxs)(br,{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]}),m(e.options.infos)&&(0,i.jsx)(br,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]}),(0,i.jsx)(br,{color:"gray800",children:t("atteste_sur_l_h_37408")}),(0,i.jsxs)(id,{gap:"6",gridtemplatecolumns:"repeat(3, 1fr)",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray800",children:t("signature_67521")}),m(e.options.signature.content)&&(0,i.jsx)(br,{width:1,children:(0,i.jsx)("img",{src:e.options.signature.content,width:"100%"})})]}),(0,i.jsx)(br,{color:"gray800",children:t("fait_1_39349",e.options.place)}),(0,i.jsx)(br,{color:"gray800",children:n.toLocaleString(r,Zs.DateOnly.MonthLong)})]})]})},TB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{options:o,setOptions:r}=tB(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),s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(eB,{children:[(0,i.jsx)(Ol,{label:t("full_name"),placeholder:"Antoine Dupont",value:o.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(Ol,{label:t("fonction_68322"),placeholder:t("pr_sident_30600"),value:o.title,onChange:e=>{r({title:e})}}),(0,i.jsx)(Nm,{label:t("nom_et_adresse_81953"),value:o.address,onChange:e=>{r({address:e})}}),(0,i.jsx)(Nm,{label:t("informations_su_09057"),value:o.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(Ol,{label:t("lieu_de_l_attes_84804"),placeholder:"Montpellier",value:o.place,onChange:e=>{r({place:e})}}),(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(fB,{accept:lv.Images,format:"base64",hint:t("taille_de_l_ima_12660","682x260px"),label:t("en_t_te_11987"),placeholder:t("en_t_te_11987"),value:o.header,onChange:e=>{r({header:e})}}),m(o.header?.name)&&(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({header:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("signature_67521"),placeholder:t("signature_67521"),value:o.signature,onChange:e=>{r({signature:e})}}),m(o.signature?.name)&&(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({signature:{name:"",content:""}})},children:t("r_initialiser_77538")})]})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:rg(a.links?.userCertificateLink??"","pdf",{lang:a.language}),getPath:e=>Os.DOCUMENTS_CERTIFICATE(n,s,e)}),(0,i.jsx)(GL,{children:(0,i.jsx)(EB,{certificateDocumentFragment:e.data.event,options:o})})]})]})},zB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("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:s},[Ms.OrganizationCertificateDefaultFragment,Ms.DocumentUserCertificateFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("Certificate")}`),(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.Certificate,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("attestations_98371")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsx)(TB,{data:r})]})},OB=e=>{const{translate:t,params:{organizationId:n,eventId:s,badgeType:o}}=cl(),{options:r,setOptions:a}=tB(e.event.document.options,o===ge.Pec?{header:{name:"",content:""}}:o===ge.T24assignment?{logo:{name:"",content:""}}:{habits:""},s,{id:e.event.document.id}),l=e.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[o===ge.Asoassignment&&(0,i.jsx)(eB,{children:(0,i.jsx)(Ev,{initialValue:r.habits,label:"Habitudes",onChange:e=>{a({habits:e})}})}),o===ge.Pec&&(0,i.jsx)(eB,{children:(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("banni_re_86634"),placeholder:t("banni_re_86634"),value:r.header,onChange:e=>{a({header:e})}})}),o===ge.T24assignment&&(0,i.jsx)(eB,{children:(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:r.logo,onChange:e=>{a({logo:e})}})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:rg(l.links?.userCustomBadgeLinks?.[o]||"","pdf",{lang:l.fields?.language?.rawValue}),getPath:e=>Os.DOCUMENTS_BADGE(n,s,e,o)}),(0,i.jsx)(GL,{children:T_(o,e.event,r,null)})]})]})},RB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s,badgeType:o}}=cl(),{data:r,loader:a}=Yn("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:s,customBadge:o},[Ms.DocumentUserCustomBadgeFragment,Ms.EventVolunteersExportFragment]);return(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{badgeType:o,documentType:we.CustomBadge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:o===ge.Paris20kmassignment,showStrategy:!0,title:e("badge_1_89709",z_(o))}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsx)(OB,{event:r.event})]})},$B=(e,t)=>{if("{user.picture}"===e)return t.userInfo.fields?.picture?.url||"";if("{user.skidata}"===e){const e=t.utid||"";return sg(e,{height:100,width:100})}if("{user.qrcode}"===e){const e=t.ticketId;return sg(e,{height:100,width:100})}if("{user.code39}"===e){const e=t.ticketId;return sg(e,{barcodeType:ig.Code39,height:28,width:234})}return e},DB=e=>{const t=m(e.element.source)&&m($B(e.element.source,e.vr))?(0,i.jsx)("img",{height:"100%",src:$B(e.element.source,e.vr),width:"100%"}):null;return(0,i.jsx)(br,{css:{border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,zIndex:e.element.zIndex},height:e.element.height,width:e.element.width,children:m(e.element.link)?(0,i.jsx)("a",{href:e.element.link,rel:"noreferrer",target:"_blank",children:t}):t})};var PB=n(1184);const FB=e=>{const t=Gn(Wc),n=Gn(dw),s=RT((0,PB.A)(n.renderText(e.element.text,{userInfo:e.vr.userInfo,event:e.event,customFields:e.customFields,volunteerRegistration:e.vr,extraInfos:{...cg(t,e.vr.positionsSlotsUsersInfos)}}),{target:"_blank"}));return(0,i.jsx)(Ra,{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:s},height:e.element.height,justify:e.element.justify,width:e.element.width})},MB=e=>qN(e.element,e.accreditationsSlotsIds,e.accreditationsAcronyms,e.positionsSlotsIds,e.vr.userInfo.fields)?"container"===e.element.type?(0,i.jsx)(Ra,{align:e.element.align,css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",gap:`${e.element.gap}px`,left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.element.zIndex},direction:e.element.direction,height:e.element.height,justify:e.element.justify,width:e.element.width,children:e.element.elements.map(t=>(0,i.jsx)(MB,{accreditationsAcronyms:e.accreditationsAcronyms,accreditationsSlotsIds:e.accreditationsSlotsIds,customFields:e.customFields,element:t,event:e.event,positionsSlotsIds:e.positionsSlotsIds,vr:e.vr},t.id))}):"image"===e.element.type?(0,i.jsx)(DB,{element:e.element,vr:e.vr}):"text"===e.element.type?(0,i.jsx)(FB,{customFields:e.customFields,element:e.element,event:e.event,vr:e.vr}):null:null,NB=e=>{const t=e.customDocument.configuration,n=e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot.id),s=e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>m(e.accreditation.acronym)?[e.accreditation.acronym]:[]),o=e.volunteerRegistration.positionsSlotsUsersInfos.map(e=>e.positionSlot.id),r=t.bleed?19:0;return(0,i.jsx)(i.Fragment,{children:t.pages.map(a=>qN(a,n,s,o,e.volunteerRegistration.userInfo.fields)?(0,i.jsxs)(Ra,{css:{background:"white",padding:`${r}px`,position:"relative"},height:2*r+t.height,width:2*r+t.width,children:[t.bleed&&(0,i.jsx)(dL,{}),(0,i.jsx)(Ra,{css:{background:"white",pageBreakBefore:"always",position:"relative"},height:t.height,width:t.width,children:a.elements.map(t=>(0,i.jsx)(MB,{accreditationsAcronyms:s,accreditationsSlotsIds:n,customFields:e.customFields,element:t,event:e.event,positionsSlotsIds:o,vr:e.volunteerRegistration},t.id))})]},a.id):null)})},LB=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,userInfoId:o,customDocumentId:r}}=cl(),{event:a}=Jv(),{data:l,loader:d}=Yn("query UserCustomDocumentExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n customFields {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n ...EventVolunteersExport\n\n id\n name\n organizationId\n startAt\n endAt\n\n customDocument(customDocumentId: $customDocumentId) {\n name\n slug\n configuration\n populationsIds\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...CustomBadgeVolunteerRegistration\n }\n }\n}\n",{organizationId:n,eventId:s,userInfoId:o,customDocumentId:r},[Ms.CustomFieldWithConditionFragment,Ms.EventVolunteersExportFragment,Ms.CustomBadgeVolunteerRegistrationFragment]),c=(0,M.useMemo)(()=>{if(l.event){const e=l.event.customDocument,t=l.event.volunteerRegistration.userInfo.links;return rg(t?.userCustomDocumentLinks[e?.slug||""]||"","pdf",{lang:l.event.volunteerRegistration.userInfo.fields?.language?.rawValue})}return""},[l.event]);return Td(`${a.name} ${l.event?.customDocument?.name??""}`),(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{customDocumentSlug:l.event?.customDocument?.slug,documentType:we.UserCustomDocument,eventId:s,extraButton:(0,i.jsx)(jl,{color:"white",onClick:()=>{e.push(Os.EDIT_CUSTOM_DOCUMENT(n,s,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)(Ba,{height:"7"}),d||(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:c,getPath:e=>Os.DOCUMENTS_USER_CUSTOM_DOCUMENT(n,s,e,r),populationsIds:eo(l.event?.customDocument?.populationsIds)?l.event.customDocument.populationsIds:void 0}),(0,i.jsx)(GL,{children:(0,i.jsx)(NB,{customDocument:l.event.customDocument,customFields:l.organization.customFields.nodes,event:l.event,volunteerRegistration:l.event.volunteerRegistration})})]})]})},BB=e=>{const t=Zd(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(Ra,{css:{color:Zd(e.options.textColor)?e.options.textColor:"$gray800",background:m(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",minHeight:`${Hm}px`,pageBreakBefore:"always"},direction:"column",width:qm,children:[(0,i.jsxs)(Ra,{align:"end",css:{marginTop:"51px",px:"16px"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{css:{color:t,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:e.headerTitle1}),(0,i.jsx)(br,{css:{color:t,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:e.headerTitle2})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{css:{minHeight:"971px",paddingBottom:"$6",paddingLeft:"$4",paddingRight:"$4"},gap:"4",width:1,children:(0,i.jsx)(Ra,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"$4"},direction:"column",children:e.children})})]})},VB=e=>{const t=Hn(),n=Gn(Wc),s=Gn(Kg),o=(0,M.useMemo)(()=>e.psuis.filter(t=>t.positionSlot.range.start.startOf("day").toMillis()===e.day.toMillis()),[e.day,e.psuis]),r=(0,M.useMemo)(()=>(0,Vv.A)(o,e=>e.timeDifferenceMinutes),[o]);return(0,i.jsxs)(Ra,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(br,{css:{padding:"$3 $4",textTransform:"capitalize"},font:"gray800 textSm semiBold",children:n.toLocaleString(e.day,Zs.DateOnly.WeekdayLongMonthLong)}),(0,i.jsxs)(vc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(xc,{css:{height:"32px"},children:[(0,i.jsx)(Fc,{children:t("nom_de_la_missi_64605")}),(0,i.jsxs)(Fc,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(br,{children:t("d_but_41840")}),(0,i.jsx)(br,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsxs)(Fc,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(br,{children:t("fin_60104")}),(0,i.jsx)(br,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsx)(Fc,{width:120,children:t("pause_46709")}),(0,i.jsx)(Fc,{width:120,children:t("total_07173")})]}),o.map((t,o)=>(0,i.jsxs)(Tc,{css:{height:"32px"},children:[(0,i.jsx)(yc,{children:(0,i.jsx)(br,{font:"gray800 textXs medium",children:t.position.name})}),(0,i.jsxs)(yc,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(br,{children:t.checkInAt?.isValid?n.toLocaleString(t.checkInAt.setZone(e.timeZone),Zs.TimeOnly):"-"}),(0,i.jsx)(br,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.start,Zs.TimeOnly)})]}),(0,i.jsxs)(yc,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(br,{children:t.checkOutAt?.isValid?n.toLocaleString(t.checkOutAt.setZone(e.timeZone),Zs.TimeOnly):"-"}),(0,i.jsx)(br,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.end,Zs.TimeOnly)})]}),(0,i.jsx)(yc,{css:{color:"$gray500"},width:120,children:t.breakTime>0?s.minutesToHoursMinutesString(t.breakTime):"-"}),(0,i.jsx)(yc,{css:{color:"$gray500"},justify:"end",width:120,children:s.minutesToHoursMinutesString(t.timeDifferenceMinutes)})]},o)),(0,i.jsxs)(xc,{css:{borderBottom:"none",height:"32px"},children:[(0,i.jsx)(Fc,{children:(0,i.jsx)(br,{font:"gray800 textXs semiBold",children:t("total_de_la_jou_73634")})}),(0,i.jsx)(Fc,{justify:"end",width:120,children:(0,i.jsx)(br,{font:"gray800 textXs semiBold",children:s.minutesToHoursMinutesString(r)})})]})]})]})},UB=e=>{const t=Hn(),n=Gn(Kg),s=e.event.volunteerRegistration,o=s.userInfo,r=(0,M.useMemo)(()=>dg(s.positionsSlotsUsersInfos,e.date,null),[s.positionsSlotsUsersInfos]),a=(0,M.useMemo)(()=>(0,ic.A)((0,ch.A)(r.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),[r]),l=(0,M.useMemo)(()=>(0,Vv.A)(r,e=>e.timeDifferenceMinutes),[r]);return(0,i.jsx)(BB,{headerTitle1:`${m(e.eventDocument.title)?e.eventDocument.title:t("UserHours")} ${o.name}`,headerTitle2:t("total_d_heures_11826",n.minutesToHoursMinutesString(l)),options:e.options,children:(0,i.jsx)(Ra,{direction:"column",gap:"4",width:1,children:a.map(t=>(0,i.jsx)(VB,{day:t,psuis:r,timeZone:e.event.timeZone},t.toMillis()))})})},WB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{eventDocument:o,options:r,title:a,setOptions:l,setTitle:d}=tB(e.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",textColor:"#1d2939",title:""},s,{id:e.event.document.id}),c=rL(),u=e.event.volunteerRegistration.userInfo,h=u.links?.userHoursLink??"";return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(eB,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),m(r.background?.name)&&(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Ol,{label:t("titre_du_docume_33508"),value:a,onChange:e=>{d(e)}}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Au,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:c}),(0,i.jsx)(xj,{label:t("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:rg(h,"pdf",{lang:u.language}),getPath:e=>Os.DOCUMENTS_HOURS(n,s,e)}),(0,i.jsx)(GL,{children:(0,i.jsx)(UB,{event:e.event,eventDocument:o,options:r})})]})]})},GB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("query UserHoursDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUsersHours\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Ms.DocumentUsersHoursFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("UserHours")}`),(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.UserHours,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("UserHours")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsx)(WB,{event:r.event})]})},HB=e=>{const t=Hn(),n=Gn(Wc),s=e.event.volunteerRegistration,o=s.userInfo,r=(0,M.useMemo)(()=>(0,Ju.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start)),[s.positionsSlotsUsersInfos]),a=(0,M.useMemo)(()=>(0,Qu.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.end)),[s.positionsSlotsUsersInfos]),l=(0,M.useMemo)(()=>(0,ic.A)(Object.entries((0,nc.A)(s.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],s=(0,ic.A)(Object.values((0,nc.A)(t,e=>e.position.id)),e=>(0,dh.A)(e.map(e=>e.positionSlot.range.start.toMillis()))).map(e=>{const t=e[0].position,n=(0,ic.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&&m(t.address)?` (${t.address})`:"";return`${t.name} : ${n}${i}`});return[n.toLocaleString(i.positionSlot.range.start.startOf("day"),Zs.DateOnly.WeekdayLongMonthLong),s]}),[s.positionsSlotsUsersInfos]);return(0,i.jsxs)(Ra,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[m(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(Ba,{height:"7"})]}),(0,i.jsxs)(Ra,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(br,{font:"primary800 displayXs semiBold",children:o.nameOrEmail}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray800",children:t("p_riode_du_1_89633",n.toLocaleString(r,Zs.DateTime),n.toLocaleString(a,Zs.DateTime))}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Ra,{direction:"column",gap:"4",children:l.map(([e,t],n)=>(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{css:{textTransform:"capitalize"},font:"gray800 textSm bold",children:e}),(0,i.jsx)(Ra,{direction:"column",children:t.map((e,t)=>(0,i.jsx)(br,{children:e},t))})]},n))})]})]})},qB=e=>{const t=Hn(),n=e.event.volunteerRegistration,s=n.userInfo;return eo(n.positionsSlotsUsersInfos)?(0,i.jsx)(HB,{...e}):(0,i.jsxs)(Ra,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[m(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(Ba,{height:"7"})]}),(0,i.jsxs)(Ra,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(br,{font:"primary800 displayXs semiBold",children:s.nameOrEmail}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray800",children:t("aucune_affectat_04761")})]})]})},YB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{options:o,setOptions:r}=tB(e.data.event.document.options,{logo:{name:"",content:""}},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(eB,{children:(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:o.logo,onChange:e=>{r({logo:e})}})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:rg(a.links?.userPlanningDaysLink??"","pdf",{lang:a.language}),getPath:e=>Os.DOCUMENTS_USER_PLANNING_DAYS(n,s,e)}),(0,i.jsx)(GL,{children:(0,i.jsx)(qB,{event:e.data.event,options:o})})]})]})},KB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("query UserPlanningDaysDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningDays\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Ms.DocumentUserPlanningDaysFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("UserPlanningDays")}`),(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.UserPlanningDays,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("plannings_indiv_39650")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsx)(YB,{data:r})]})};var ZB=n(3514);const XB=e=>{const t=Hn(),n=Gn(Wc),s=e.event.volunteerRegistration,o=s.userInfo,r=e.startDate?Bs.c9.max(e.startDate,e.event.startAt):e.event.startAt,a=e.startDate?Bs.c9.min(e.startDate.plus({week:1}).minus({day:1}),e.event.endAt):e.event.endAt,l=Zd(e.options.headerColor)?e.options.headerColor:"white",d=e.options.showInformations||e.options.showQrCode;return(0,i.jsxs)(Ra,{css:{color:Zd(e.options.textColor)?e.options.textColor:"$gray800",background:m(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:qm,width:Hm,children:[(0,i.jsxs)(Ra,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{css:{color:l,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:t("planning_indivi_05075",o.nameOrEmail)}),(0,i.jsx)(br,{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)(Ra,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[d&&(0,i.jsxs)(IB,{children:[(0,i.jsx)(_B,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText}),(0,i.jsx)(vB,{options:e.options,ticketId:s.ticketId})]}),(0,i.jsx)(Ra,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(br,{width:1,children:e.children})})]})]})},JB=e=>{const t=Hn(),n=Gn(ah),s=(0,M.useMemo)(()=>{const t=Kd(e.psui.position.color);return{background:t[50],color:t[700]}},[e.psui]),o=(0,M.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,s=ph(n,e.psui.positionSlot,"",{interval:{options:i?{hideDate:!0}:{formats:{localeFormat:{day:"numeric",month:"numeric"}}}},slot:{includeRange:!0}});return o?`${s} ${t("j_1_51317")}`:s},[e.psui,o]);return(0,i.jsxs)(Ra,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(br,{css:{fontSize:"10px"},children:r}),(0,i.jsx)(br,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]})},QB=e=>(0,i.jsx)(XB,{document:e.document,event:e.event,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(OA,{css:{border:"1px solid $gray200",borderRadius:"$2",height:"100%",overflow:"hidden","& .h-calendar-events-container":{height:"100% !important"}},date:e.startDate,display:"week",maxDate:e.event.endAt,minDate:e.event.startAt,children:e.assignments.map(t=>(0,i.jsx)(zA,{endAt:t.range.start,startAt:t.range.start,startHour:e.startHour,children:(0,i.jsx)(JB,{psui:t,startHour:e.startHour})},t.id))})}),eV=e=>{const{minDate:t,numberOfWeeks:n}=(0,M.useMemo)(()=>{const t=(0,dh.A)(e.assignments.map(e=>e.positionSlot.range.start)).startOf("week"),n=(0,ZB.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,wc.A)(0,n).map(n=>(0,i.jsx)(QB,{assignments:e.assignments,document:e.eventDocument,event:e.event,options:e.options,renderText:e.renderText,startDate:t.plus({week:n}),startHour:e.startHour},n))})},tV=e=>{const t=Gn(dw),[n]=(0,M.useMemo)(()=>gh(e.event.dayStartTime),[e.event.dayStartTime]),s=(0,M.useMemo)(()=>{const t=sh(e.event.volunteerRegistration.positionsSlotsUsersInfos.map(e=>({...e,range:e.positionSlot.range})),e.event.startAt,e.event.endAt,n);return(0,ic.A)(dg(t,e.date,e.endDate),e=>e.positionSlot.range.start.toMillis())},[e.event,n]),o=n=>t.renderText(n,{userInfo:e.event.volunteerRegistration.userInfo,volunteerRegistration:e.event.volunteerRegistration});return to(s)?(0,i.jsx)(XB,{document:e.eventDocument,event:e.event,options:e.options,renderText:o}):(0,i.jsx)(eV,{assignments:s,event:e.event,eventDocument:e.eventDocument,options:e.options,renderText:o,startHour:n})},nV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{eventDocument:o,informationsTitle:r,informationsContent:a,options:l,setOptions:d,setInformationsTitle:c,setInformationsContent:u}=tB(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"},s,{id:e.data.event.document.id,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent}),h=rL(),g=e.data.event?.volunteerRegistration.userInfo,p=g.links?.userPlanningLink??"";return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(eB,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:l.background,onChange:e=>{d({background:e})}}),m(l.background?.name)&&(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Au,{label:"Police",value:l.fontFamily,onChange:e=>{d({fontFamily:e})},children:h}),(0,i.jsx)(Au,{label:t("police_des_titr_37497"),value:l.titleFontFamily,onChange:e=>{d({titleFontFamily:e})},children:h}),(0,i.jsx)(xj,{label:t("couleur_des_sou_18968"),value:l.subtitleColor,onChange:e=>{d({subtitleColor:e})}}),(0,i.jsx)(xj,{label:t("couleur_du_text_32021"),value:l.textColor,onChange:e=>{d({textColor:e})}}),(0,i.jsx)(xj,{label:t("couleur_du_cont_17150"),value:l.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(xu,{value:l.showInformations,onChange:e=>{d({showInformations:e})},children:t("afficher_la_sec_84744")}),l.showInformations&&(0,i.jsxs)(Ra,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Ol,{label:t("titre_de_la_sec_41575"),value:r,onChange:e=>{c(e)}}),(0,i.jsx)(Ev,{initialValue:a,label:t("contenu_de_la_s_43102"),onChange:e=>{u(e)}})]}),(0,i.jsx)(xu,{value:l.showQrCode,onChange:e=>{d({showQrCode:e})},children:t("afficher_le_qr_15635")})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:rg(p,"pdf",{lang:g?.language}),getPath:e=>Os.DOCUMENTS_USER_PLANNING(n,s,e)}),(0,i.jsx)(GL,{children:(0,i.jsx)(tV,{event:e.data.event,eventDocument:o,options:l})})]})]})},iV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("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:s},[Ms.DocumentUserPlanningFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("UserPlanning")}`),(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.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)(Ba,{height:"7"}),a||(0,i.jsx)(nV,{data:r})]})},sV=e=>{const t=Hn(),n=Gn(ah);return(0,i.jsxs)(Ra,{css:{background:"$gray100",padding:"$4 56px"},direction:"column",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textXl semiBold",children:t("planning_1_14391",e.nameOrEmail)}),e.interval&&(0,i.jsxs)(Ra,{gap:"1",children:[(0,i.jsx)(br,{color:"gray800",children:t("plage_de_dates_08875")}),(0,i.jsx)(br,{color:"gray500",children:n.toDisplayString(e.interval,{formats:{displayWeekday:!0},hideTime:!0})})]}),(0,i.jsxs)(Ra,{gap:"1",children:[(0,i.jsx)(br,{color:"gray800",children:t("nombre_d_affect_01587")}),(0,i.jsx)(br,{color:"gray500",children:e.numberOfAssignments})]})]})},oV=e=>{const t=Hn(),n=Gn(Wc),s=Gn(Kg);return(0,i.jsx)(Ra,{css:{padding:"$6 $8"},children:(0,i.jsxs)(vc,{children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{css:{px:"$3"},children:t("nom_de_la_missi_64605")}),(0,i.jsx)(Fc,{css:{px:"$3"},width:380,children:t("Date")}),e.showHours&&(0,i.jsx)(Fc,{css:{px:"$3"},width:120,children:t("total_07173")})]}),e.assignments.map((t,o)=>{const r=eo(t.slotsNames),a=(0,Gg.A)(t.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Tc,{css:{height:r?"54px":"44px"},children:[(0,i.jsx)(yc,{align:"center",css:{px:"$3"},children:(0,i.jsx)(br,{css:{clamp:"2"},font:"gray900 textSm medium",title:t.name,width:1,children:t.name})}),(0,i.jsxs)(yc,{css:{px:"$3"},direction:"column",gap:"1",justify:"center",width:380,children:[r&&(0,i.jsx)(br,{color:"gray900",width:1,children:t.slotsNames.join(", ")}),(0,i.jsxs)(br,{width:1,children:[(0,ud.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)(yc,{css:{px:"$3"},width:120,children:s.minutesToHoursMinutesString(a)})]},o)})]})})},rV=e=>{const t=(0,M.useMemo)(()=>Wg(dg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,e.endDate)),[e.event.volunteerRegistration,e.date]);return(0,i.jsx)(i.Fragment,{children:(0,Ug.A)(t,20).map((t,n)=>{const s=t.flatMap(e=>e.ranges),o=(0,Ju.A)(s.map(e=>e.start),e=>e.toMillis()),r=(0,Qu.A)(s.map(e=>e.end),e=>e.toMillis()),a=Bs.IX.fromDateTimes(o,r);return(0,i.jsxs)(Ra,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(sV,{interval:a,nameOrEmail:e.event.volunteerRegistration.userInfo.nameOrEmail,numberOfAssignments:t.flatMap(e=>e.ranges).length}),(0,i.jsx)(oV,{assignments:t,showHours:e.options.showHours})]},n)})})},aV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{options:o,setOptions:r}=tB(e.data.event.document.options,{showHours:!0},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(eB,{children:(0,i.jsx)(dc,{state:o.showHours?"checked":"unchecked",onClick:e=>{r({showHours:"checked"===e})},children:t("afficher_le_tot_23855")})}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qb,{downloadPath:rg(a.links?.userPlanningListLink??"","pdf",{lang:a.language}),getPath:e=>Os.DOCUMENTS_USER_PLANNING_LIST(n,s,e)}),(0,i.jsx)(GL,{width:1,children:(0,i.jsx)(rV,{event:e.data.event,options:o})})]})]})},lV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("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:s},[Ms.DocumentUserPlanningListFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("UserPlanningList")}`),(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.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)(Ba,{height:"7"}),a||(0,i.jsx)(aV,{data:r})]})},dV=e=>{const t=Hn(),n=e.documentUsersListing.organization.customFields.nodes,s=(0,M.useMemo)(()=>(0,ic.A)(e.documentUsersListing.event.volunteersRegistrations.nodes,e=>e.userInfo.name),[e.documentUsersListing.event.volunteersRegistrations.nodes]),o=(0,M.useMemo)(()=>(0,Ug.A)(s,30),[s]),r=e.documentUsersListing.event.segment;return eo(s)?(0,i.jsx)(i.Fragment,{children:o.map((o,a)=>(0,i.jsx)(BB,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:`${r.name} (${s.length})`,options:e.options,children:(0,i.jsx)(Ra,{css:{background:"white"},direction:"column",width:1,children:(0,i.jsx)(KL,{customFields:n,slugsToDisplay:e.options.slugsToDisplay,volunteers:o})})},a))}):(0,i.jsx)(BB,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:r.name,options:e.options})},cV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{user:o}=ni(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=tB(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=rL();return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(eB,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),m(a.background?.name)&&(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Ol,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Au,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(xj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsxs)(fc,{isSearchVisible:!0,label:t("champs_affich_17945"),multiple:!0,placeholder:t("champs_affich_17945"),values:a.slugsToDisplay,onChange:e=>{d({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:t("Email")}),(0,i.jsx)("option",{value:"fullName",children:t("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:t("code_quipe_14296")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(aB,{downloadPath:rg(e.data.event.segment.links.usersListingLink,"pdf",{lang:o?.language}),getPath:e=>Os.DOCUMENTS_VOLUNTEERS_LISTING(n,s,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(GL,{width:1,children:(0,i.jsx)(dV,{documentUsersListing:e.data,eventDocument:r,options:a})})]})]})},uV=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("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:s},[Ms.DocumentUsersListingFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("liste_des_membr_89037")}`),(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.VolunteersListing,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("liste_des_membr_89037")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsx)(cV,{data:r,eventId:n})]})},hV=e=>{const t=Gn(Mj),n=(0,M.useMemo)(()=>e.customFields.find(t=>t.slug===e.options.customFieldSlug),[e.customFields,e.options.customFieldSlug]);return(0,i.jsx)(Ra,{css:{columnGap:"$2",rowGap:"$3"},wrap:"wrap",children:e.vrs.map(s=>{const o=s.userInfo,r=yg(o.name,o.email);return(0,i.jsxs)(Ra,{direction:"column",gap:"2",width:84,children:[(0,i.jsx)(br,{css:{borderRadius:"$1",overflow:"hidden"},height:84,width:84,children:m(o.picture?.url)?(0,i.jsx)("img",{height:"100%",src:o.picture.url,width:"100%"}):(0,i.jsx)(Ra,{align:"center",css:{background:Ag(r)},height:1,justify:"center",width:1,children:(0,i.jsx)(br,{font:"white displaySm medium",children:r})})}),(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.lastName,children:(o.lastName||"-").toUpperCase()}),(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.firstName,children:o.firstName||"-"}),n&&(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0,fontSize:"10px"},title:"",children:t.getValueString(n,o.fields)||"-"}),e.options.showPhone&&(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0,fontSize:"10px"},title:o.phone?.internationalFormat||"-",children:o.phone?.internationalFormat||"-"})]})]},o.id)})})},mV=e=>{const t=Hn(),n=e.documentUsersPictures.event.volunteersRegistrations.nodes,s=(0,M.useMemo)(()=>(0,Ug.A)(n,48),[n]),o=e.documentUsersPictures.event.segment;return eo(n)?(0,i.jsx)(i.Fragment,{children:s.map((s,r)=>(0,i.jsx)(BB,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:`${o.name} (${n.length})`,options:e.options,children:(0,i.jsx)(hV,{customFields:e.documentUsersPictures.organization.customFields.nodes,options:e.options,vrs:s})},r))}):(0,i.jsx)(BB,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:o.name,options:e.options})},gV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{user:o}=ni(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=tB(e.data.event.document.options,{background:{name:"",content:""},customFieldSlug:null,fontFamily:"Open Sans",headerColor:"#ffffff",showPhone:!0,textColor:"#1d2939",title:""},s,{id:e.data.event.document.id,title:e.data.event.document.title}),u=rL();return(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(eB,{children:[(0,i.jsxs)(Ra,{align:"center",gap:"3",children:[(0,i.jsx)(fB,{accept:lv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),m(a.background?.name)&&(0,i.jsx)(br,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Ol,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Au,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(xj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(fc,{isSearchVisible:!0,label:t("champ_suppl_men_12652"),placeholder:t("champ_suppl_men_12652"),values:a.customFieldSlug?[a.customFieldSlug]:[],onChange:e=>{eo(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)(xu,{value:a.showPhone,onChange:e=>{d({showPhone:e})},children:t("afficher_le_num_37843")})]}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(aB,{downloadPath:rg(e.data.event.segment.links.usersPicturesLink,"pdf",{lang:o?.language}),getPath:e=>Os.DOCUMENTS_USERS_PICTURES(n,s,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(GL,{children:(0,i.jsx)(mV,{documentUsersPictures:e.data,eventDocument:r,options:a})})]})]})},pV=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=cl(),{event:o}=Jv(),{data:r,loader:a}=Yn("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:s},[Ms.DocumentUsersPicturesFragment,Ms.EventVolunteersExportFragment]);return Td(`${o.name} ${e("trombinoscope_11316")}`),(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(WL,{documentType:we.UsersPictures,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("trombinoscope_11316")}),(0,i.jsx)(Ba,{height:"7"}),a||(0,i.jsx)(gV,{data:r})]})},fV=e=>{const{history:t,translate:n}=cl(),{data:s,loader:o}=Yn("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,M.useState)(Te.Assignments);return o||(0,i.jsxs)(i.Fragment,{children:[(!s.event.emailSender||s.event.emailSender.domainStatus!==ye.Success)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{gap:"4",width:1,children:[s.event.emailSender&&s.event.emailSender.domainStatus!==ye.Success&&(0,i.jsx)(Ja,{color:"error",leftIcon:"circle-exclamation",width:1,children:(0,i.jsxs)(Ra,{css:{fontWeight:"$medium"},direction:"column",gap:"3",children:[(0,i.jsx)(br,{children:n("vos_entr_es_dns_68834")}),(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{t.push(Os.ORGANIZATION_PARAMETERS_EMAILS_DNS(e.organizationId))},children:[(0,i.jsx)(br,{children:n("configurer_les_65453")}),(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"arrow-right"})})]})]})}),!s.event.emailSender&&(0,i.jsx)(Ja,{color:"warning",leftIcon:"triangle-exclamation",width:1,children:(0,i.jsxs)(Ra,{css:{fontWeight:"$medium"},direction:"column",gap:"3",children:[(0,i.jsx)(br,{children:n("aucun_metteur_26635",D.EMAIL_FROM)}),(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{t.push(Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:[(0,i.jsx)(br,{children:n("configurer_les_56837")}),(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"arrow-right"})})]})]})})]}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsxs)(Ra,{css:{flex:"1",py:"$3"},direction:"column",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("liste_des_e_mai_73508")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Fc,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(GS,{isSelected:r===Te.VolunteerRegistration,subtitle:n("cet_e_mail_est_75023"),title:n("UserInfoAdminCreate"),onClick:()=>a(Te.VolunteerRegistration)}),(0,i.jsx)(GS,{isSelected:r===Te.Assignments,subtitle:n("cet_e_mail_cont_98777"),title:n("affectation_u_11128"),onClick:()=>a(Te.Assignments)}),(0,i.jsx)(GS,{isSelected:r===Te.Refused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_affecta_71455"),onClick:()=>a(Te.Refused)}),(0,i.jsx)(GS,{isSelected:r===Te.Accreditations,subtitle:n("cet_e_mail_cont_75798"),title:n("affectation_u_39802"),onClick:()=>a(Te.Accreditations)}),(0,i.jsx)(GS,{isSelected:r===Te.AccreditationsRefused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_accr_di_89997"),onClick:()=>a(Te.AccreditationsRefused)}),(0,i.jsx)(GS,{isSelected:r===Te.DelegationCategoryLeaderAssign,subtitle:n("cet_e_mail_est_67392"),title:n("nomination_en_t_77654"),onClick:()=>a(Te.DelegationCategoryLeaderAssign)}),(0,i.jsx)(GS,{isSelected:r===Te.DelegationLeaderAssign,subtitle:n("email_sent_when_appointing_team_manager"),title:n("appointment_as_team_manager"),onClick:()=>a(Te.DelegationLeaderAssign)}),(0,i.jsx)(GS,{isSelected:r===Te.DelegationFormInvite,subtitle:n("cet_e_mail_est_19547"),title:n("envoi_du_formul_09434"),onClick:()=>a(Te.DelegationFormInvite)}),(0,i.jsx)(GS,{isSelected:r===Te.PositionLeaderAssign,subtitle:n("cet_e_mail_est_82173"),title:n("nomination_en_t_06971"),onClick:()=>a(Te.PositionLeaderAssign)}),(0,i.jsx)(GS,{isSelected:r===Te.PositionCategoryLeaderAssign,subtitle:n("cet_e_mail_est_70420"),title:n("nomination_en_t_02948"),onClick:()=>a(Te.PositionCategoryLeaderAssign)}),(0,i.jsx)(GS,{isSelected:r===Te.NotifyLeaders,subtitle:n("cet_e_mail_est_90425"),title:n("un_responsable_88525"),onClick:()=>a(Te.NotifyLeaders)}),(0,i.jsx)(GS,{isSelected:r===Te.Code,subtitle:n("cet_e_mail_est_49663"),title:n("code_20843"),onClick:()=>a(Te.Code)})]})]}),(0,i.jsx)(br,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ra,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(qS,{emailType:r,eventId:e.eventId,formId:null,organizationId:e.organizationId,source:null})})]})]})},xV=()=>{const e=Hn(),{event:{name:t}}=Jv();Td(`${t} ${e("e_mails_09850")}`);const{organizationId:n,eventId:s}=Zn();return(0,i.jsxs)(Ra,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(fV,{eventId:s,organizationId:n})]})};let _V=class extends Pl{constructor(e){super(e)}formParametersAccreditationsInputDefault(e){return{accreditationDisplay:e?.accreditationDisplay||ut.None,accreditationFilter:e?.accreditationFilter||gt.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 d.Ik().shape({accreditationDisplay:d.Yj().required(this.t("la_strat_gie_d_70458")).oneOf(jn,this.t("la_strat_gie_d_70458")),accreditationFilter:d.Yj().required(this.t("la_strat_gie_de_28051")).oneOf(kn,this.t("la_strat_gie_de_28051")),hiddenAccreditationsIds:d.YO().of(d.ai()),showFullAccreditation:d.zM().required(),showAccreditationDescription:d.zM().required(),accreditationTitle:d.Yj(),accreditationSubtitle:d.Yj()})}updateFormParametersAccreditationsSchema(){return d.Ik().shape({form:this.formParametersAccreditationsInputSchema()})}};_V=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],_V);const IV=e=>{const t=Hn(),{data:n,loader:s}=Yn("query FormParametersAccreditationsHiddenDisplayed($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const o=Gn(Wc),[r,a]=(0,M.useState)(eo(e.values.form.hiddenAccreditationsCategoriesIds)||eo(e.values.form.hiddenAccreditationsIds)||eo(e.values.form.hiddenAccreditationsSlotsIds)?"hidden":"displayed"),[l,d]=(0,M.useState)(eo(e.values.form.hiddenAccreditationsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,M.useState)(eo(e.values.form.hiddenAccreditationsIds)?"checked":"unchecked"),[h,m]=(0,M.useState)(eo(e.values.form.hiddenAccreditationsSlotsIds)?"checked":"unchecked"),[g,p]=(0,M.useState)(eo(e.values.form.displayedAccreditationsCategoriesIds)?"checked":"unchecked"),[f,x]=(0,M.useState)(eo(e.values.form.displayedAccreditationsIds)?"checked":"unchecked"),[_,I]=(0,M.useState)(eo(e.values.form.displayedAccreditationsSlotsIds)?"checked":"unchecked"),v=(0,M.useMemo)(()=>(0,ic.A)(n.event?.accreditationsCategories??[],e=>e.name.toLowerCase()),[n.event]),b=(0,M.useMemo)(()=>v.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[v]),j=(0,M.useMemo)(()=>v.map(e=>{const t=rC(e.accreditations);return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[n.event]),C=(0,M.useMemo)(()=>v.flatMap(e=>rC(e.accreditations).map(e=>{const t=zh(e.slots).map(t=>({id:t.id,name:wh(o,t,e.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:Zs.DateOnly.MonthLong}})}));return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)})),[v]);return(0,i.jsx)(Ra,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{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)(Ba,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(dc,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenAccreditationsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsCategoriesIds",children:b})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:c,onClick:t=>{u(t),"unchecked"===t&&e.change("form.hiddenAccreditationsIds",[])},children:t("cacher_certaine_08734")}),"checked"===c&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsIds",children:j})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:h,onClick:t=>{m(t),"unchecked"===t&&e.change("form.hiddenAccreditationsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===h&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsSlotsIds",children:C})]})]}),(0,i.jsx)(Ba,{height:"5"})]}),(0,i.jsx)(hc,{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)(Ba,{height:"3"}),"displayed"===r&&(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(dc,{state:g,onClick:t=>{p(t),"unchecked"===t&&e.change("form.displayedAccreditationsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===g&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsCategoriesIds",children:b})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:f,onClick:t=>{x(t),"unchecked"===t&&e.change("form.displayedAccreditationsIds",[])},children:t("afficher_certai_29161")}),"checked"===f&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsIds",children:j})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:_,onClick:t=>{I(t),"unchecked"===t&&e.change("form.displayedAccreditationsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===_&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsSlotsIds",children:C})]})]})]})})},vV=e=>{const t=Hn(),[n,s]=(0,M.useState)(eo(e.values.form.hiddenAccreditationsCategoriesIds)||eo(e.values.form.hiddenAccreditationsIds)||eo(e.values.form.hiddenAccreditationsSlotsIds)||eo(e.values.form.displayedAccreditationsCategoriesIds)||eo(e.values.form.displayedAccreditationsIds)||eo(e.values.form.displayedAccreditationsSlotsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xu,{value:n,onChange:t=>{s(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)(Ba,{height:"4"}),(0,i.jsx)(IV,{change:e.change,eventId:e.eventId,values:e.values})]})]})},bV=e=>{const t=Hn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=QS(e.initialValues,e.values,e.handleSubmit),a=e.slotDisplay!==pt.Hide;return(0,i.jsx)(jS,{button:(0,i.jsx)(jl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(JS,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray800 textMd semiBold",children:t("param_tres_des_90955")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_18471")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Pv,{name:"form.accreditationDisplay",value:ut.Accreditation,children:t("afficher_les_ac_56952")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.accreditationDisplay",value:ut.None,children:t("ne_rien_affiche_81467")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_86385")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Bm,{name:"form.showFullAccreditation",children:t("afficher_les_ac_56062")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(vV,{change:e.change,eventId:e.eventId,values:e.values}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)($m,{name:"form.showAccreditationDescription",children:t("afficher_la_des_94587")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"7"}),(0,i.jsx)(br,{font:"gray800 textMd semiBold",children:t("filtrer_les_acc_57840")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("d_cider_si_le_c_31187")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Pv,{name:"form.accreditationFilter",value:gt.FilterWithSlots,children:t("filtrer_les_acc_66152")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.accreditationFilter",value:gt.None,children:t("ne_pas_filtrer_97321")})]}),(0,i.jsx)(Wu,{height:"7"}),(0,i.jsx)(br,{font:"gray800 textMd semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("nom_de_l_tape_85862"),name:"form.accreditationTitle"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Tv,{label:t("description_58935"),name:"form.accreditationSubtitle"})]})})})},jV=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=cl(),{data:s,loader:o}=Yn("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},[]);Td(s.organization?.form.name??"");const r=Gn(Da),a=Gn(_V),{mutate:l,isLoading:d}=function(e={}){return Kn("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=M.useMemo(()=>({form:a.formParametersAccreditationsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(fl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:r})=>(0,i.jsx)(bV,{change:e.change,eventId:t,handleSubmit:n,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay||pt.Hide,values:r}),validate:r.validateForForm(a.updateFormParametersAccreditationsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})},CV=({children:e,description:t,role:n,title:s})=>{const{descId:o}=Na();return(0,i.jsxs)(Ra,{"aria-describedby":o,as:"fieldset",direction:"column",role:n,style:{border:"inherit",margin:"inherit"},children:[(0,i.jsx)(br,{as:"legend",color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",id:o,children:t}),(0,i.jsx)(br,{css:{paddingBlockStart:"$5"},children:e})]})};class yV extends Pl{constructor(e){super(e)}customSlotInputDefault(){return{name:"",startTime:"",endTime:""}}customSlotInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_cr_ne_97703")),startTime:d.Yj().required(this.t("le_d_but_du_cr_40745")),endTime:d.Yj().required(this.t("la_fin_du_cr_ne_90351"))})}}let kV=class extends Pl{customSlotInputService;constructor(e,t){super(e),this.customSlotInputService=t}customSlotPeriodInputDefault(){return{name:"",customSlots:[this.customSlotInputService.customSlotInputDefault()],hideNameDates:!1,displayAsCalendar:!1}}};kV=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn,yV])],kV);let AV=class extends Pl{constructor(e){super(e)}formParametersAvailabilitiesInputDefault(e){return{slotDisplay:e?.slotDisplay||pt.Hide,daysDisplay:e?.daysDisplay||ht.AllDays,customSlotsPeriods:e?.customSlotsPeriods??[],slotTitle:e?.slotTitle||"",slotSubtitle:e?.slotSubtitle||""}}formParametersAvailabilitiesInputSchema(){return d.Ik().shape({slotDisplay:d.Yj().required(this.t("la_strat_gie_d_34961")).oneOf(An,this.t("la_strat_gie_d_34961")),daysDisplay:d.Yj().required(this.t("la_strat_gie_de_56435")).oneOf(Cn,this.t("la_strat_gie_de_56435"))})}updateFormParametersAvailabilitiesSchema(){return d.Ik().shape({form:this.formParametersAvailabilitiesInputSchema()})}};AV=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],AV);const wV=e=>{const t=Hn(),n=Gn(yV);return(0,i.jsx)(Tj,{buttonText:t("mettre_jour_l_81276"),icon:"sliders",initialValues:{customSlotPeriod:e.customSlotPeriod},size:"md",subtitle:t("param_trer_les_33935"),title:t("mise_jour_de_14984"),onClose:e.onClose,onSubmit:async t=>{await e.onSuccess(t.customSlotPeriod),e.onClose()},children:({form:s,values:o})=>(0,i.jsxs)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Rl,{hint:t("le_nom_de_la_p_49293"),label:(0,i.jsx)(_v,{children:t("nom_de_la_p_rio_89140")}),name:"customSlotPeriod.name"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Dm,{label:(0,i.jsx)(_v,{children:t("date_de_d_but_43380")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.startDate"}),(0,i.jsx)(Dm,{label:(0,i.jsx)(_v,{children:t("date_de_fin_86920")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.endDate"})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:t("param_trer_les_28991")}),(0,i.jsx)(Ba,{height:"4"}),o.customSlotPeriod.customSlots.map((e,n)=>{const r=`customSlotPeriod.customSlots[${n}].`;return(0,i.jsxs)(M.Fragment,{children:[(0,i.jsxs)(Ra,{align:"end",gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(Rl,{label:t("nom_du_cr_neau_54351"),name:`${r}name`})}),(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(kv,{label:t("SlotStart"),name:`${r}startTime`})}),(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(kv,{label:t("SlotEnd"),name:`${r}endTime`})}),(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",onClick:()=>{s.change("customSlotPeriod.customSlots",oo(o.customSlotPeriod.customSlots,n))}})]}),(0,i.jsx)(Ba,{height:"4"})]},n)}),(0,i.jsxs)(br,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{s.change("customSlotPeriod.customSlots",[...o.customSlotPeriod.customSlots,n.customSlotInputDefault()])},children:["+ ",t("ajouter_un_cr_n_63607")]}),o.customSlotPeriod.customSlots.length<2&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("options_d_affic_10797")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Bm,{name:"customSlotPeriod.hideNameDates",children:t("masquer_les_inf_78021")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Bm,{name:"customSlotPeriod.displayAsCalendar",children:t("afficher_les_di_90328")})]})]})})},SV=e=>{const t=Hn(),n=Gn(Wc),[s,o]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray900 textSm semiBold",children:m(e.customSlotPeriod.name)?e.customSlotPeriod.name:t("p_riode_de_l_v_78032")}),(0,i.jsxs)(br,{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)(jl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{o(!0)}}),(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})]}),s&&(0,i.jsx)(wV,{customSlotPeriod:e.customSlotPeriod,event:e.event,onClose:()=>{o(!1)},onSuccess:async t=>{e.updateCustomSlotPeriod(t,e.index)}})]})},EV=e=>{const t=Hn();return(0,i.jsxs)(Ra,{css:{background:"$gray50",borderRadius:"$1",marginLeft:"$6",padding:"$6"},direction:"column",gap:"3",width:1,children:[e.customSlotsPeriods.map((t,n)=>(0,i.jsx)(SV,{customSlotPeriod:t,event:e.event,index:n,remove:()=>{e.remove(n)},updateCustomSlotPeriod:e.updateCustomSlotPeriod},n)),(0,i.jsxs)(Ra,{align:"center",css:{color:"$primary700",cursor:"pointer"},gap:"3",onClick:e.add,children:[(0,i.jsx)(Ya,{icon:"plus"}),(0,i.jsx)(br,{children:t("ajouter_une_p_r_04249")})]})]})},TV=e=>{const t=Hn(),n=Gn(kV),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=QS(e.initialValues,e.values,e.handleSubmit),l=M.useCallback(()=>{e.form.change("form.customSlotsPeriods",[...e.values.form.customSlotsPeriods,n.customSlotPeriodInputDefault()])},[e.values.form.customSlotsPeriods,e.form.change]),d=M.useCallback(t=>{e.form.change("form.customSlotsPeriods",oo(e.values.form.customSlotsPeriods,t))},[e.values.form.customSlotsPeriods,e.form.change]),c=M.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===pt.Custom,h=e.values.form.slotDisplay===pt.DisplayDays||e.values.form.slotDisplay===pt.Calendar||e.values.form.slotDisplay===pt.Custom;return(0,i.jsx)(jS,{button:(0,i.jsx)(jl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(JS,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(CV,{description:t("personnaliser_l_64536"),role:"radiogroup",title:t("affichage_des_d_20852"),children:[(0,i.jsx)(Pv,{name:"form.slotDisplay",value:pt.Display,children:t("demander_au_mem_07520")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.slotDisplay",value:pt.DisplayDays,children:t("demander_au_mem_50067")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.slotDisplay",value:pt.Calendar,children:t("demander_au_mem_60083")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.slotDisplay",value:pt.Custom,children:t("demander_au_mem_31132")}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(EV,{add:l,customSlotsPeriods:e.values.form.customSlotsPeriods,event:e.event,remove:d,updateCustomSlotPeriod:c})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.slotDisplay",value:pt.Hide,children:t("ne_pas_demander_46686")})]}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"7"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_dis_80634")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("d_cider_de_filt_81078")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Pv,{name:"form.daysDisplay",value:ht.AllDays,children:t("afficher_l_ense_11531")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.daysDisplay",value:ht.DaysWithSlots,children:t("filtrer_les_jou_51154")})]}),e.values.form.slotDisplay!==pt.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"7"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("nom_de_l_tape_85862"),name:"form.slotTitle"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Tv,{label:t("description_58935"),name:"form.slotSubtitle"})]})]})})})},zV=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=cl(),{data:s,loader:o}=Yn("query FormParametersAvailabilities(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n ...FormSlotsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n }\n}\n",{organizationId:e,eventId:t,formId:n},[Ms.FormSlotsOptionsFragment,Ms.FormRegisterCustomSlotPeriodFragment]);Td(s.organization?.form.name??"");const r=Gn(Da),a=Gn(AV),{mutate:l,isLoading:d}=function(e={}){return Kn("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=M.useMemo(()=>({form:a.formParametersAvailabilitiesInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(fl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(TV,{event:s.event,form:e,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.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 OV=class extends Pl{constructor(e){super(e)}formParametersMissionsInputDefault(e){return{positionDisplay:e?.positionDisplay||mt.None,positionFilter:e?.positionFilter||gt.FilterWithSlots,positionRanking:e?.positionRanking||We.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 d.Ik().shape({positionDisplay:d.Yj().required(this.t("la_strat_gie_d_44170")).oneOf(yn,this.t("la_strat_gie_d_44170")),positionFilter:d.Yj().required(this.t("la_strat_gie_de_13294")).oneOf(kn,this.t("la_strat_gie_de_13294")),positionRanking:d.Yj().required(this.t("le_type_de_clas_66819")).oneOf(un,this.t("le_type_de_clas_66819")),positionLimit:d.ai().required(this.t("le_nombre_maxim_38249")).min(1,this.t("le_nombre_de_ch_27910")),hiddenPositionsCategoriesIds:d.YO().of(d.ai()),hiddenPositionsIds:d.YO().of(d.ai()),hiddenPositionsSlotsIds:d.YO().of(d.ai()),hiddenPositionsTagsIds:d.YO().of(d.ai()),displayedPositionsCategoriesIds:d.YO().of(d.ai()),displayedPositionsIds:d.YO().of(d.ai()),displayedPositionsSlotsIds:d.YO().of(d.ai()),displayedPositionsTagsIds:d.YO().of(d.ai()),showFullPosition:d.zM().required(),showPositionCategoryDescription:d.zM().required(),showPositionDescription:d.zM().required(),positionTitle:d.Yj(),positionSubtitle:d.Yj(),willAutoAssign:d.zM().required()})}updateFormParametersMissionsSchema(){return d.Ik().shape({form:this.formParametersMissionsInputSchema()})}};OV=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],OV);const RV=e=>(0,i.jsxs)(Ra,{css:{cursor:"pointer",position:"relative"},direction:"column",gap:"1",onClick:e.onSelect,children:[e.isSelected&&(0,i.jsx)(Ra,{align:"center",css:{background:"$primary700",borderRadius:"20px",color:"white",fontSize:"$textMd",position:"absolute",right:"-10px",top:"-10px"},height:20,justify:"center",width:20,children:(0,i.jsx)(Ya,{icon:"check"})}),(0,i.jsx)(br,{css:{background:"$gray100",border:e.isSelected?"2px solid $primary700":"2px solid $gray100",borderRadius:"$1",padding:"$6",paddingBottom:"0"},height:135,width:240,children:(0,i.jsx)("img",{height:"107px",src:e.src,width:"188px"})}),(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:e.name})]}),$V=e=>{const t=Hn(),{data:n,loader:s}=Yn("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 o=Gn(ah),[r,a]=(0,M.useState)(eo(e.values.form.hiddenPositionsCategoriesIds)||eo(e.values.form.hiddenPositionsIds)||eo(e.values.form.hiddenPositionsSlotsIds)||eo(e.values.form.hiddenPositionsTagsIds)?"hidden":"displayed"),[l,d]=(0,M.useState)(eo(e.values.form.hiddenPositionsCategoriesIds)?"checked":"unchecked"),[c,h]=(0,M.useState)(eo(e.values.form.hiddenPositionsIds)?"checked":"unchecked"),[g,p]=(0,M.useState)(eo(e.values.form.hiddenPositionsSlotsIds)?"checked":"unchecked"),[f,x]=(0,M.useState)(eo(e.values.form.hiddenPositionsTagsIds)?"checked":"unchecked"),[_,I]=(0,M.useState)(eo(e.values.form.displayedPositionsCategoriesIds)?"checked":"unchecked"),[v,b]=(0,M.useState)(eo(e.values.form.displayedPositionsIds)?"checked":"unchecked"),[j,C]=(0,M.useState)(eo(e.values.form.displayedPositionsSlotsIds)?"checked":"unchecked"),[y,k]=(0,M.useState)(eo(e.values.form.displayedPositionsTagsIds)?"checked":"unchecked"),A=(0,M.useMemo)(()=>(0,ic.A)(n.event?.positionsCategories??[],e=>u(e.name)),[n.event]),w=(0,M.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]),S=(0,M.useMemo)(()=>(0,ic.A)(A.flatMap(e=>e.positions),e=>u(e.name)).map(e=>{const t=(0,ic.A)(e.slots.map(t=>{const n=m(t.name)?`${t.name} - `:"",i=o.toDisplayString(t.range,{formats:{displayWeekday:!0}});return{id:t.id,name:`${n}${i} - ${e.name}`,startTime:t.range.start.toMillis()}}),e=>e.startTime);return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[A]),E=(0,M.useMemo)(()=>(0,ic.A)(n.organization?.tags.nodes??[],e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[n.organization]);return(0,i.jsx)(Ra,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{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)(Ba,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(dc,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenPositionsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{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)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:c,onClick:t=>{h(t),"unchecked"===t&&e.change("form.hiddenPositionsIds",[])},children:t("cacher_certaine_19933")}),"checked"===c&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsIds",children:w})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:g,onClick:t=>{p(t),"unchecked"===t&&e.change("form.hiddenPositionsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===g&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsSlotsIds",children:S})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:f,onClick:t=>{x(t),"unchecked"===t&&e.change("form.hiddenPositionsTagsIds",[])},children:t("cacher_certains_66424")}),"checked"===f&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsTagsIds",children:E})]})]}),(0,i.jsx)(Ba,{height:"5"})]}),(0,i.jsx)(hc,{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)(Ba,{height:"3"}),"displayed"===r&&(0,i.jsxs)(Ra,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(dc,{state:_,onClick:t=>{I(t),"unchecked"===t&&e.change("form.displayedPositionsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===_&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{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)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:v,onClick:t=>{b(t),"unchecked"===t&&e.change("form.displayedPositionsIds",[])},children:t("affficher_certa_32341")}),"checked"===v&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsIds",children:w})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:j,onClick:t=>{C(t),"unchecked"===t&&e.change("form.displayedPositionsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===j&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsSlotsIds",children:S})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(dc,{state:y,onClick:t=>{k(t),"unchecked"===t&&e.change("form.displayedPositionsTagsIds",[])},children:t("afficher_certai_47793")}),"checked"===y&&(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Mm,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsTagsIds",children:E})]})]})]})})},DV=e=>{const t=Hn(),[n,s]=(0,M.useState)(eo(e.values.form.hiddenPositionsCategoriesIds)||eo(e.values.form.hiddenPositionsIds)||eo(e.values.form.hiddenPositionsSlotsIds)||eo(e.values.form.hiddenPositionsTagsIds)||eo(e.values.form.displayedPositionsCategoriesIds)||eo(e.values.form.displayedPositionsIds)||eo(e.values.form.displayedPositionsSlotsIds)||eo(e.values.form.displayedPositionsTagsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xu,{value:n,onChange:t=>{s(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)(Ba,{height:"4"}),(0,i.jsx)($V,{change:e.change,eventId:e.eventId,organizationId:e.organizationId,values:e.values})]})]})},PV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{isNotSavedModalOpen:o,onClose:r,onNotSavedClose:a,onSave:l}=QS(e.initialValues,e.values,e.handleSubmit),d=e.slotDisplay!==pt.Hide&&e.values.form.positionDisplay!==mt.None;return(0,i.jsx)(jS,{button:(0,i.jsx)(jl,{isLoading:e.isMutateLoading,onClick:l,children:t("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(JS,{isNotSavedOpen:o,onNotSavedClose:a,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_tres_des_93365")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("d_cider_du_type_01830")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"8",children:[(0,i.jsx)(RV,{isSelected:e.values.form.positionRanking===We.Unranked,name:t("choix_illimit_s_72460"),src:dd.FormPositionUnranked,onSelect:()=>{e.change("form.positionRanking",We.Unranked)}}),(0,i.jsx)(RV,{isSelected:e.values.form.positionRanking===We.Ranked,name:t("classement_des_43897"),src:dd.FormPositionRanked,onSelect:()=>{e.change("form.positionRanking",We.Ranked),e.values.form.positionDisplay!==mt.None&&e.values.form.positionDisplay!==mt.Slot||e.change("form.positionDisplay",mt.Position)}})]}),e.values.form.positionRanking===We.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Rl,{label:t("nombre_de_choix_19811"),name:"form.positionLimit",shouldParseAsInt:!0})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("affichage_des_m_65982")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_26207")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_23788")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Pv,{name:"form.positionDisplay",value:mt.Category,children:t("afficher_les_ca_26287")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.positionDisplay",value:mt.Position,children:t("afficher_les_mi_31841")}),e.values.form.positionRanking===We.Unranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.positionDisplay",value:mt.Slot,children:t("afficher_les_cr_32311")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.positionDisplay",value:mt.None,children:t("ne_rien_affiche_81467")})]}),e.values.form.positionDisplay!==mt.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_94071")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Bm,{name:"form.showFullPosition",children:t("afficher_les_mi_35510")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(DV,{change:e.change,eventId:s,organizationId:n,values:e.values}),e.values.form.positionRanking!==We.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)($m,{name:"form.showPositionCategoryDescription",children:t("afficher_la_des_67852")}),e.values.form.positionDisplay!==mt.Category&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)($m,{name:"form.showPositionDescription",children:t("afficher_la_des_21998")})]})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("automatisation_49411")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("d_cider_si_l_af_60345")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Bm,{name:"form.willAutoAssign",children:e.values.form.positionDisplay===mt.Category?t("la_pr_affectat_61978"):e.values.form.positionDisplay===mt.Position?t("la_pr_affectat_20431"):t("l_affectation_s_68435")})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_cat_63783")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("d_cider_si_le_c_98644")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Pv,{name:"form.positionFilter",value:gt.FilterWithSlots,children:t("filtrer_les_cat_52780")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Pv,{name:"form.positionFilter",value:gt.None,children:t("ne_pas_filtrer_73952")})]}),e.values.form.positionDisplay!==mt.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("nom_de_l_tape_85862"),name:"form.positionTitle"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Tv,{label:t("description_58935"),name:"form.positionSubtitle"})]})]})})})},FV=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=cl(),{data:s,loader:o}=Yn("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},[]);Td(s.organization?.form.name??"");const r=Gn(Da),a=Gn(OV),{mutate:l,isLoading:d}=function(e={}){return Kn("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=M.useMemo(()=>({form:a.formParametersMissionsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(fl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(PV,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay??pt.Hide,values:n}),validate:r.validateForForm(a.updateFormParametersMissionsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})},MV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{hasFeature:o}=_I(),{user:r}=ni(),a=t=>og({organizationId:n,eventId:s,lang:r?.language,pathComponent:t,key:e.eventKey});return(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_api_d_94349")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(P$,{hint:t("param_tres_disp_37413"),link:a("assignments"),title:t("api_pour_les_af_45788")}),(0,i.jsx)(Ba,{height:"6"}),o(Fe.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P$,{hint:t("param_tres_disp_76489"),link:a("accreditations"),title:t("api_pour_les_ac_97802")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(P$,{hint:t("param_tres_disp_49170"),link:a("accreditations-matrix"),title:t("api_pour_les_ac_69006")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(P$,{hint:t("param_tres_disp_45950"),link:a("accreditations-slots"),title:t("api_pour_les_cr_99061")}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(P$,{hint:t("param_tres_disp_45950"),link:a("positions"),title:t("api_pour_la_lis_89027")}),(0,i.jsx)(Ba,{height:"6"}),o(Fe.Delegation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P$,{hint:t("param_tres_disp_83198"),link:a("delegations-matrix"),title:t("api_pour_les_d_32713")}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(P$,{link:`=IMPORTDATA("${a("assignments")}")`,title:t("import_des_affe_58949")}),(0,i.jsx)(Ba,{height:"6"}),o(Fe.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P$,{link:`=IMPORTDATA("${a("accreditations")}")`,title:t("import_des_accr_52173")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(P$,{link:`=IMPORTDATA("${a("accreditations-matrix")}")`,title:t("import_des_accr_49559")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(P$,{link:`=IMPORTDATA("${a("accreditations-slots")}")`,title:t("import_des_cr_n_78532")}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(P$,{link:`=IMPORTDATA("${a("positions")}")`,title:t("import_de_la_li_00747")}),(0,i.jsx)(Ba,{height:"6"}),o(Fe.Delegation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P$,{link:`=IMPORTDATA("${a("delegations-matrix")}")`,title:t("api_pour_les_d_32713")}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(Ba,{height:"1"})]})},NV=()=>{const{translate:e,params:{eventId:t}}=cl(),{event:{name:n}}=Jv();Td(`${n} API`);const{hasFeature:s}=_I(),{data:o,loader:r}=Yn("query EventKey($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:t},[]);return r||(0,i.jsxs)($b,{children:[(0,i.jsx)(Rb,{children:(0,i.jsx)(br,{font:"gray900 displayXs medium",children:"API"})}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(Ja,{leftIcon:"circle-exclamation",children:e("l_api_permet_de_66672",pd)}),(0,i.jsx)(Ba,{height:"7"}),s(Fe.Api)?(0,i.jsx)(MV,{eventKey:o.event.key}):(0,i.jsx)(Ra,{align:"center",css:{flex:"1"},height:1,justify:"center",width:1,children:(0,i.jsx)(II,{icon:"code-branch"})})]})]})},LV=[Me.Eid,Me.FirstName,Me.LastName,Me.Picture,Me.Population],BV=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=cl(),{event:s}=Jv();Td(`${s.name} Weezevent`);const{data:o}=Yn("query WeezeventV2Infos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(privacy: All, variety: UserInfo) {\n nodes {\n slug\n name\n }\n }\n }\n\n event(id: $eventId) {\n weezevent\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:n},[]),{mutate:r}=function(e={}){return Kn("mutation EventWeezeventUpdate($eventId: EventId!, $weezevent: EventWeezeventInput!) {\n eventWeezeventUpdate(eventId: $eventId, weezevent: $weezevent) {\n id\n }\n}\n",e)}(),a=(0,M.useMemo)(()=>(0,ic.A)(o.organization?.customFields.nodes??[],e=>e.name).filter(e=>!LV.includes(e.slug)).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[o]),l=(0,M.useMemo)(()=>(o.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)),[o]),d=(0,M.useMemo)(()=>(0,ic.A)(o.event?.accreditationsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,ic.A)(e.accreditations,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o]);return(0,i.jsxs)($b,{children:[(0,i.jsx)(Rb,{children:(0,i.jsx)(br,{font:"gray900 displayXs medium",children:"Weezevent"})}),(0,i.jsx)(Ob,{children:(0,i.jsx)(fl,{initialValues:{accreditationsIds:o.event?.weezevent?.accreditationsIds||[],customFieldsSlugs:o.event?.weezevent?.customFieldsSlugs||[],segmentsIds:o.event?.weezevent?.segmentsIds||[]},render:({handleSubmit:t,submitting:n})=>(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Mm,{isSearchVisible:!0,label:e("liste_des_champ_73852"),multiple:!0,name:"customFieldsSlugs",children:a}),(0,i.jsx)(Mm,{isSearchVisible:!0,label:e("liste_des_vues_82829"),multiple:!0,name:"segmentsIds",children:l}),(0,i.jsx)(Mm,{hint:e("toutes_les_accr_55233"),isSearchVisible:!0,label:e("liste_des_accr_50214"),multiple:!0,name:"accreditationsIds",children:d}),(0,i.jsx)(Ib,{rolesTypes:cI,children:(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:n,onClick:t,children:e("enregistrer_06519")})})})]}),onSubmit:e=>r({eventId:n,weezevent:e})})})]})};let VV=class{positionsCustomFieldInputSchema(){return d.Ik().shape({customFieldId:d.ai().required(),conditionValue:d.gl().required()})}};VV=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)()],VV);let UV=class extends Pl{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 d.Ik().shape({slot:this.positionsSlotInputSchema()})}positionsSlotInputSchema(){return d.Ik().shape({name:d.Yj(),startDate:Vm.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),startTime:d.Yj().required(this.t("heure_de_d_but_90785")),endDate:Vm.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)=>Bs.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&Bs.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid&&t.parent.endDate>=t.parent.startDate),endTime:d.Yj().required(this.t("l_heure_de_fin_78626")).test("after-start-time",this.t("la_date_de_fin_00429"),(e,t)=>{const n=Bs.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid,i=mh(t.parent.startTime),s=Bs.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid,o=mh(t.parent.endTime);if(n&&i&&s&&o){const[e,n]=gh(t.parent.startTime),[i,s]=gh(t.parent.endTime);return t.parent.startDate.set({hours:e,minutes:n})=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],UV);let WV=class extends Pl{positionsCustomFieldInputService;positionsSlotInputService;constructor(e,t,n){super(n),this.positionsCustomFieldInputService=e,this.positionsSlotInputService=t}positionInputDefault(e,{positionCategoryId:t,layer:n,latitude:i,longitude:s,startAt:o}){let r=e?.category.id??t;return Number.isInteger(r)||(r=null),{name:e?.name??"",positionCategoryId:r,description:e?.description??"",acronym:e?.acronym??"",color:e?.color??mr.colors.primary700.value,icon:e?.icon??qe.LocationDot,privateNote:e?.privateNote??"",address:e?.address??null,latitude:e?.latitude??i??null,longitude:e?.longitude??s??null,zoom:e?.zoom??Er,layer:e?.layer??n,tracesIds:e?.tracesIds??[],slots:e?.slots??[this.positionsSlotInputService.positionsSlotInputDefault(o)],conditionsOperator:e?.conditionsOperator??me.And,positionsCustomFields:e?.positionsCustomFields??[],tagsIds:e?.tagsIds??[],fields:e?.fields??{},leadersIds:e?.fields??[]}}createUpdatePositionSchema(){return d.Ik().shape({position:this.positionInputSchema()})}positionInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_la_mi_74207")),positionCategoryId:d.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:d.Yj(),color:d.Yj().required(this.t("la_couleur_est_95740")),icon:d.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(mn,this.t("l_ic_ne_est_req_15843")),description:d.Yj(),privateNote:d.Yj(),address:d.Yj().nullable(),latitude:d.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:d.ai().nullable().typeError(this.t("la_longitude_do_35170")),traces:d.YO().of(d.ai()),slots:d.YO().of(this.positionsSlotInputService.positionsSlotInputSchema()).required(this.t("vous_devez_avoi_26563")).min(1,this.t("vous_devez_avoi_26563")),positionsCustomFields:d.YO().of(this.positionsCustomFieldInputService.positionsCustomFieldInputSchema()),tagsIds:d.YO().of(d.ai())})}};WV=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[VV,UV,Vn])],WV);const GV=e=>{const{mutate:t}=function(e={}){return Kn("mutation PositionCategoryCreate($eventId: EventId!, $positionCategory: PositionsCategoryInput!) {\n positionCategoryCreate(eventId: $eventId, positionCategory: $positionCategory) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(wC,{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})},HV=e=>{const{mutate:t}=function(e={}){return Kn("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)(wC,{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})},qV=(0,M.memo)(function(e){const{params:{eventId:t},translate:n}=cl(),[s,o]=(0,M.useState)(AC(e.event.positionsCategories)),{isEventAdmin:r}=Jv(),[a,l]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rl,{label:n("nom_de_la_missi_64605"),name:"position.name"}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Mm,{createText:n("cr_er_une_nouve_72722"),isCreateVisible:r,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"position.positionCategoryId",placeholder:n("rechercher_ou_c_16469"),onCreateClick:()=>{l(!0)},children:s.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Rl,{label:(0,i.jsx)(_v,{children:n("Acronym")}),name:"position.acronym"})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(_j,{label:n("Color"),name:"position.color"}),(0,i.jsx)(Cj,{label:n("ic_ne_55554"),name:"position.icon"})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Tv,{label:(0,i.jsx)(_v,{children:n("description_58935")}),name:"position.description"}),a&&(0,i.jsx)(GV,{eventId:t,onClose:()=>{l(!1)},onSuccess:t=>{o(AC([...s,t])),e.change("position.positionCategoryId",t.id)}})]})}),YV=()=>{const e=Hn();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Tv,{label:(0,i.jsx)(_v,{children:e("note_priv_e_06303")}),name:"position.privateNote"})})},KV=e=>{const t=Hn(),n=Gn(UV);return(0,i.jsx)(Tj,{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,yr.A)(t.slot,["id","name","startDate","startTime","endDate","endTime","resources"])),e.onClose()},children:({form:n,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rr.Yr,{name:"slot.startDate",children:e=>{e>s.slot.endDate&&n.change("slot.endDate",e)}}),(0,i.jsxs)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Rl,{hint:t("vous_pouvez_per_94218"),label:(0,i.jsx)(_v,{children:t("nom_du_cr_neau_54351")}),name:"slot.name"}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Dm,{label:t("date_de_d_but_43380"),max:e.event.endAt,min:e.event.startAt,name:"slot.startDate"}),(0,i.jsx)(kv,{label:t("horaire_de_d_bu_02380"),name:"slot.startTime"})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Dm,{label:t("date_de_fin_86920"),max:e.event.endAt,min:e.event.startAt,name:"slot.endDate"}),(0,i.jsx)(kv,{label:t("horaire_de_fin_10624"),name:"slot.endTime"})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Rl,{label:t("nombre_de_membr_08851"),name:"slot.resources",shouldParseAsInt:!0})]})]})})},ZV=e=>{const t=Hn(),n=Gn(Wc),s=(0,M.useMemo)(()=>m(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,M.useMemo)(()=>{const i=n.toLocaleString(e.slot.startDate,Zs.DateOnly.WeekdayLongMonthLong),s=n.toLocaleString(e.slot.endDate,Zs.DateOnly.WeekdayLongMonthLong);return`${i} ${e.slot.startTime.substring(0,5)} - ${s} ${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,M.useState)(e.initialIsEditOpen),[l,d]=(0,M.useState)(!1),c=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(br,{color:"gray500",children:o})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",disabled:c,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(_m,{placement:"top",children:t(c?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(KV,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(_P,{showHours:!0,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},XV=e=>{const t=Gn(UV),[n,s]=(0,M.useState)(-1),o=(0,M.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,M.useCallback)((e,t,n)=>Hs(e).overlaps(n),[]),a=(0,M.useCallback)(()=>{e.change("position.slots",e.values.position.slots.concat([t.positionsSlotInputDefault(e.event.startAt)])),s(e.values.position.slots.length)},[e.values.position.slots,e.change]),l=(0,M.useCallback)((t,n,i)=>{const s=function(e,t,n){const i=gh(e.startTime);let s=e.startDate;i&&(s=s.set({hour:i[0],minute:i[1]}));const o=gh(e.endTime);let r=e.endDate;return o&&(r=r.set({hour:o[0],minute:o[1]})),(0,wc.A)(1,t+1).map(t=>{if("hour"===n){const n=s.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=s.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=s.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(s))},[e.values.position.slots,e.change]),d=(0,M.useCallback)(t=>{e.change("position.slots",oo(e.values.position.slots,t))},[e.values.position.slots,e.change]);return(0,i.jsx)(xP,{event:e.event,matchDateFilter:r,renderSlot:t=>(0,i.jsx)(ZV,{event:e.event,index:t.index,initialIsEditOpen:t.index===n,remove:d,slot:t,updateSlots:o,onRepeat:l},t.index),slots:e.values.position.slots,onNewSlot:a})},JV=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{showNotification:r}=ib(),a=Gn(WV),l=Gn(Da),d=(0,M.useRef)(null),c=(0,M.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.position.name):n("cr_ation_d_une_10675"),[e.isEdit,e.initialValues]);Td(c);const u=(0,M.useMemo)(()=>eo(e.initialValues.position.tracesIds)||m(e.initialValues.position.address)||"number"==typeof e.initialValues.position.latitude||"number"==typeof e.initialValues.position.longitude,[e.isEdit,e.initialValues]),h=(0,M.useMemo)(()=>!!e.isEdit&&eo(e.initialValues.position.positionsCustomFields),[e.isEdit,e.initialValues]),g=(0,M.useMemo)(()=>!!e.isEdit&&eo(Object.keys(e.initialValues.position.fields)),[e.isEdit,e.initialValues]),p=(0,M.useMemo)(()=>!!e.isEdit&&m(e.initialValues.position.privateNote),[e.isEdit,e.initialValues]),f=(0,M.useMemo)(()=>!!e.isEdit&&eo(e.initialValues.position.tagsIds),[e.isEdit,e.initialValues]);return(0,i.jsx)(fl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(zm,{button:e.isEdit&&(0,i.jsx)(jl,{isLoading:a,onClick:r,children:n("mettre_jour_l_19061")}),category:c,color:"dark",fallbackClosePath:ms.POSITIONS({organizationId:s,eventId:o}),title:e.isEdit?e.initialValues.position.name:n("nouvelle_missio_60727"),children:(0,i.jsxs)(Em,{ref:d,children:[(0,i.jsx)(hl,{}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,title:n("informations_su_61022"),children:(0,i.jsx)(qV,{change:t.change,event:e.event})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,subtitle:n("ajouter_les_dif_22779"),title:n("cr_neaux_horair_62996"),children:(0,i.jsx)(XV,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:u,subtitle:n("localiser_le_li_46319"),title:n("localisation_38416"),onToggle:n=>{n||(t.change("position.layer",e.event.layer),t.change("position.zoom",Er),t.change("position.tracesIds",[]),t.change("position.address",null),t.change("position.latitude",null),t.change("position.longitude",null))},children:(0,i.jsx)(CP,{center:e.event,layer:l.position.layer,name:"position.",point:l.position,traces:e.event.traces,tracesIds:l.position.tracesIds})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:h,subtitle:n("ajouter_des_con_75357"),title:n("conditions_77756"),onToggle:e=>{e||t.change("position.positionsCustomFields",[])},children:(0,i.jsx)(hP,{change:t.change,conditionsOperator:l.position.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.position.positionsCustomFields,name:"position.positionsCustomFields",prefix:"position."})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:g,subtitle:n("ajouter_des_inf_14340"),title:n("champs_de_formu_64126"),onToggle:e=>{e||t.change("position.fields",{})},children:(0,i.jsx)(wD,{change:t.change,customFields:e.positionCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"position.",showFormCustomFields:!1})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:p,subtitle:n("ajouter_une_not_81707"),title:n("note_priv_e_06303"),onToggle:e=>{e||t.change("position.privateNote","")},children:(0,i.jsx)(YV,{})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Rm,{initialIsOpen:f,subtitle:n("ajouter_des_tag_64526"),title:n("tags_79499"),onToggle:e=>{e||t.change("position.tagsIds",[])},children:(0,i.jsx)(Oj,{change:t.change,name:"position.",organizationId:s,tags:e.tags,tagsIds:l.position.tagsIds})}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{isLoading:a,textAlign:"center",onClick:r,children:e.isEdit?n("mettre_jour_l_19061"):n("cr_er_la_missio_82644")})})]})}),validate:l.validateForForm(a.createUpdatePositionSchema()),width:1,onSubmit:async i=>{const a=await e.mutate({eventId:o,position:{...i.position,slots:i.position.slots.map(e=>(0,rr.A)(e,["index"]))}});r(e.isEdit?n("la_mission_a_t_79916"):n("la_mission_a_t_14808")),e.isEdit?t.goBack(ms.POSITION({organizationId:s,eventId:o,positionId:a})):t.replace(ms.POSITION({organizationId:s,eventId:o,positionId:a}))}})},QV=()=>{const e=Gn(WV),{organizationId:t,eventId:n,options:s}=Zn(),{data:o,loader:r}=Yn("query PositionEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n }\n}\n",{organizationId:t,eventId:n},[Ms.ConditionsCustomFieldsFragment,Ms.CreatePositionTagsFragment,Ms.AttachCustomFieldFragment,Ms.CreatePositionEventFragment]),{mutate:a}=function(e={}){return Kn("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 m(t)&&m(n)?{latitude:parseFloat(t),longitude:parseFloat(n)}:m(e)?{positionCategoryId:parseInt(e,10)}:{}})(s);return r||(0,i.jsx)(JV,{conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,initialValues:{position:e.positionInputDefault(null,{layer:o.event.layer,startAt:o.event.startAt,positionCategoryId:l,latitude:d,longitude:c})},isEdit:!1,mutate:async e=>{const{positionCreate:{id:t}}=await a(e);return t},positionCustomFields:o.organization.positionCustomFields.nodes,tags:o.organization.tags.nodes})},eU=()=>{const{organizationId:e,eventId:t,positionId:n}=Zn(),{data:s,loader:o}=Yn("query PositionToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n\n position(id: $positionId) {\n name\n description\n acronym\n color\n icon\n privateNote\n address\n latitude\n longitude\n layer\n zoom\n tracesIds\n tagsIds\n fields\n conditionsOperator\n\n category {\n id\n }\n\n slots {\n id\n name\n startDate\n startTime\n endDate\n endTime\n resources\n assignedResources\n }\n\n positionsCustomFields {\n customFieldId\n conditionValue\n }\n }\n }\n}\n",{organizationId:e,eventId:t,positionId:n},[Ms.ConditionsCustomFieldsFragment,Ms.CreatePositionTagsFragment,Ms.AttachCustomFieldFragment,Ms.CreatePositionEventFragment]),r=Gn(WV),{mutate:a}=function(e={}){return Kn("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 o||(0,i.jsx)(JV,{conditionsCustomFields:s.organization.conditionsCustomFields.nodes,event:s.event,initialValues:{position:r.positionInputDefault(s.event.position,{layer:s.event.layer,startAt:s.event.startAt})},isEdit:!0,mutate:async e=>{const{positionUpdate:{id:t}}=await a({...e,positionId:n});return t},positionCustomFields:s.organization.positionCustomFields.nodes,tags:s.organization.tags.nodes})};var tU;let nU=class extends AO{static{tU=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...AO.IMPORT_COLUMNS_DEFAULT,PositionName:"positionName",PositionCategoryName:"positionCategoryName",SlotStart:"slotStart",SlotEnd:"slotEnd",MaxResources:"slotMaxResources",SlotName:"slotName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",Address:"address",Latitude:"latitude",Longitude:"longitude",MapLayer:"mapLayer",MapZoom:"mapZoom",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===Ye.Update?[tU.IMPORT_COLUMNS_DEFAULT.Id]:[],tU.IMPORT_COLUMNS_DEFAULT.SlotStart,tU.IMPORT_COLUMNS_DEFAULT.SlotEnd,tU.IMPORT_COLUMNS_DEFAULT.MaxResources,tU.IMPORT_COLUMNS_DEFAULT.PositionName,tU.IMPORT_COLUMNS_DEFAULT.PositionCategoryName];constructor(e,t){super(e,t),this.csvInputService=e}};nU=tU=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[aO,Vn])],nU);const iU=()=>{const{params:{organizationId:e,eventId:t},translate:n}=cl(),{mutate:s}=function(e={}){return Kn("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:o}=ib(),{data:r,loader:a}=Gr({organizationId:e,variety:_e.Position});return a||(0,i.jsx)(CO,{ImportInputService:nU,checkImport:o,closePath:ms.POSITIONS({organizationId:e,eventId:t}),customFields:r.organization.customFields.nodes,importTagPrefix:"positions",itemName:{singular:n("task_24074"),plural:n("tasks_06050")},localStorageKeyPrefix:"POSITIONS_IMPORT",mutate:s,showModeSelection:!1,title:n("importing_tasks_31757")})};var sU;!function(e){e.Acronym="acronym",e.Address="address",e.Category="category",e.CategoryLeaders="categoryLeaders",e.CheckedInRate="checkedInRate",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Latitude="latitude",e.Leaders="leaders",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.Resources="resources",e.Slot="slot",e.SlotName="slotName",e.State="state",e.Tags="tags"}(sU||(sU={}));let oU=class extends du{constructor(e,t,n){super(e,t,n)}getPositionsFilters(e,t){return(0,Va.A)([{slug:sU.Name,name:this.t("nom_de_la_missi_64605"),category:this.t("missions_63972"),fieldType:Ve.Text,hideEmpty:!0},{slug:"position",name:this.t("Position"),category:this.t("missions_63972"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:sU.Description,name:this.t("Description"),category:this.t("missions_63972"),fieldType:Ve.Text},{slug:sU.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("missions_63972"),fieldType:Ve.Text},eo(e.positionsCategories)?{slug:"positionCategory",name:this.t("cat_gorie_00291"),category:this.t("missions_63972"),fieldType:Ve.Select,values:e.positionsCategories,hideEmpty:!0}:null,{slug:"positionSlot",name:this.t("cr_neau_11117"),category:this.t("missions_63972"),fieldType:Ve.DateTimeRange,startAt:e.startAt,endAt:e.endAt},{slug:"positionSlotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("missions_63972"),fieldType:Ve.Text},{slug:"tag",name:this.t("Tag"),category:this.t("missions_63972"),fieldType:Ve.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:Ct.Positions},{slug:"positionCustomField",name:this.t("condition_61066"),category:this.t("missions_63972"),fieldType:Ve.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("missions_63972"),fieldType:Ve.Text},{slug:"color",name:this.t("Color"),category:this.t("missions_63972"),fieldType:Ve.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("missions_63972"),fieldType:Ve.Select,values:mn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("missions_63972"),fieldType:Ve.Text},{slug:"latitude",name:this.t("Latitude"),category:this.t("missions_63972"),fieldType:Ve.Number},{slug:"longitude",name:this.t("Longitude"),category:this.t("missions_63972"),fieldType:Ve.Number},{slug:"state",name:this.t("statut_des_ress_73550"),category:this.t("missions_63972"),fieldType:Ve.Select,hideEmpty:!0,values:bn.map(e=>({id:e,name:this.t(e)}))},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:"checkedInRate",name:this.t("taux_de_pointag_87285"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:sU.Leaders,name:this.t("nombre_de_respo_19772"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:sU.CategoryLeaders,name:this.t("nombre_de_respo_01994"),category:this.t("missions_63972"),fieldType:Ve.Number,hideEmpty:!0},{slug:sU.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("missions_63972"),fieldType:Ve.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:sU.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("missions_63972"),fieldType:Ve.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getPositionsPossibleColumns(e){return[{slug:sU.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:lt.Id,width:100},{slug:sU.Name,name:this.t("nom_de_la_missi_64605"),isSearchable:!0,isSortable:!0,sortAttribute:lt.Name,minWidth:120},{slug:sU.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:lt.Category,minWidth:240},{slug:sU.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:180},{slug:sU.Slot,name:this.t("cr_neau_11117"),isSortable:!0,sortAttribute:lt.Slot,minWidth:240},{slug:sU.Resources,name:this.t("membres_11310"),minWidth:320},{slug:sU.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:sU.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:sU.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:sU.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:sU.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:sU.Acronym,name:this.t("Acronym"),isSearchable:!0,minWidth:180},{slug:sU.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:sU.Icon,name:this.t("ic_ne_55554"),width:80},{slug:sU.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:sU.State,name:this.t("statut_des_ress_73550"),minWidth:240},{slug:sU.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:sU.CheckedInRate,name:this.t("taux_de_pointag_87285"),minWidth:240},{slug:sU.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:sU.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:lt.CreatedAt,minWidth:180},{slug:sU.Leaders,name:this.t("responsables_de_54941"),isSearchable:!0,minWidth:320},{slug:sU.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320}].concat(this.customFieldsToPossibleColumns(e))}};oU=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[su,Wc,Vn])],oU);const rU=e=>{const{params:{eventId:t}}=cl(),{mutate:n}=To(),s=M.useCallback(async i=>{const s=Qs(e.property);for(const o of s){const r=1===s.length?i:i[o];await n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.positionId]},slug:o,strategy:Qe.Replace,value:r}})}},[e.positionId,e.property,n]);return(0,i.jsx)(ZC,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},aU=e=>{const{translate:t}=cl();return(0,i.jsx)(rU,{column:e.column,initialValue:e.position.acronym||"",positionId:e.position.id,property:st.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.position.acronym||"",updatable:e.updatable})},lU=M.createContext({}),dU=e=>{const[t,n]=M.useState(),s=KR(da,{eventId:e.eventId},e=>e.event.positionsCategories),o=KR(Mo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(lU.Provider,{value:{newPositionLatLng:t,getPositionsCategories:s,getTags:o,setNewPositionLatLng:n},children:e.children})};function cU(){return M.useContext(lU)}const uU=e=>{const t=Hn(),{getPositionsCategories:n}=cU(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("Category")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Au,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},hU=e=>{const{params:{organizationId:t,eventId:n}}=cl(),{isEditMode:s}=HC();return(0,i.jsx)(rU,{column:e.column,initialValue:e.positionCategory.id,positionId:e.positionId,property:st.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(uU,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(h$,{isEditMode:s,title:e.positionCategory.name,updatable:e.updatable,children:(0,i.jsx)(Vc,{to:ms.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.positionCategory.id}),children:e.positionCategory.name})}),updatable:e.updatable})},mU=e=>{const{translate:t}=cl();return(0,i.jsx)(rU,{column:e.column,initialValue:e.position.color,positionId:e.position.id,property:st.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(xj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ra,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{css:{background:e.position.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{xS(e.position.color)}})}),(0,i.jsx)(_m,{placement:"top",children:e.position.color})]})}),updatable:e.updatable})},gU=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>e.position.positionsCustomFields||[],[e.position]),s=(0,M.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${FP(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:s})})},pU=e=>{const{translate:t}=cl();return(0,i.jsx)(rU,{column:e.column,initialValue:e.position.icon,positionId:e.position.id,property:st.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(jj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ya,{icon:qa(e.position.icon)}),updatable:e.updatable})},fU=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>({[st.Color]:e.position.color,[st.Icon]:e.position.icon}),[e.position]);return(0,i.jsx)(rU,{column:e.column,initialValue:n,positionId:e.position.id,property:[st.Color,st.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Ra,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(xj,{label:t("Color"),value:e[ne.Color],onChange:t=>{n({...e,[ne.Color]:t})}}),(0,i.jsx)(jj,{label:t("Icon"),renderOnPortal:!0,value:e[ne.Icon],onChange:t=>{n({...e,[ne.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(pC,{color:e.position.color,icon:e.position.icon}),updatable:e.updatable})},xU=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{isEditMode:o}=HC();return(0,i.jsx)(rU,{column:e.column,initialValue:e.position.name,positionId:e.position.id,property:st.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("nom_de_la_missi_64605"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(h$,{isEditMode:o,title:e.position.name,updatable:e.updatable,children:(0,i.jsx)(Vc,{to:ms.POSITION({organizationId:n,eventId:s,positionId:e.position.id}),children:e.position.name})}),updatable:e.updatable})},_U=e=>{const{translate:t}=cl(),{getTags:n}=cU(),{result:s,isLoading:o}=l$(n);return o?(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(El,{children:t("tags_79499")}),(0,i.jsx)(ec,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(fc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},IU=e=>{const t=(0,M.useMemo)(()=>e.position.tags||[],[e.position]),n=(0,M.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(rU,{column:e.column,initialValue:t.map(e=>e.id),positionId:e.position.id,property:st.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(_U,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(ly,{badges:n}),updatable:e.updatable})},vU=e=>{const{translate:t,params:{eventId:n}}=cl(),{mutate:s}=fa(),o=(0,M.useMemo)(()=>m(e.positionSlot.name)?e.positionSlot.name:"-",[e.positionSlot]);return(0,i.jsx)(ZC,{column:e.column,initialValue:e.positionSlot.name,mutate:async t=>s({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:{...(0,yr.A)(e.positionSlot,["id","startDate","startTime","endDate","endTime","resources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Ol,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray900 textSm medium",title:o,width:1,children:o}),updatable:e.updatable})},bU=e=>{const{translate:t,params:{eventId:n}}=cl(),{isEventAdmin:s}=Jv(),o=Gn(ah),r=Gn(Mj),{mutate:a}=fa(),l=UC(e.customFields),d=(0,M.useCallback)(()=>{e.reloadPositionSlot(e.positionSlot.id)},[e.positionSlot,e.reloadPositionSlot]),[c,u]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(n=>{const a=l.get(n.slug);return n.slug===sU.Id?(0,i.jsx)(yc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.id},n.slug):n.slug===sU.Category?(0,i.jsx)(hU,{column:n,positionCategory:e.positionSlot.positionCategory,positionId:e.positionSlot.position.id,reload:d,updatable:s},n.slug):n.slug===sU.Name?(0,i.jsx)(xU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===sU.Slot?(0,i.jsx)(yc,{minWidth:n.minWidth,width:n.width,children:o.toDisplayString(e.positionSlot.range)},n.slug):n.slug===sU.SlotName?(0,i.jsx)(vU,{column:n,positionSlot:e.positionSlot,reload:d,updatable:s},n.slug):n.slug===sU.Resources?(0,i.jsx)(yc,{minWidth:n.minWidth,width:n.width,children:(0,i.jsx)(o$,{assignedResources:e.positionSlot.assignedResources,resources:e.positionSlot.resources})},n.slug):n.slug===sU.Tags?(0,i.jsx)(IU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===sU.Conditions?(0,i.jsx)(gU,{column:n,position:e.positionSlot.position},n.slug):n.slug===sU.Address?(0,i.jsx)(yc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.address},n.slug):n.slug===sU.Latitude?(0,i.jsx)(yc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.latitude},n.slug):n.slug===sU.Longitude?(0,i.jsx)(yc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.longitude},n.slug):n.slug===sU.Acronym?(0,i.jsx)(aU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===sU.Color?(0,i.jsx)(mU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===sU.Icon?(0,i.jsx)(pU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===sU.IconColor?(0,i.jsx)(fU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===sU.State?(0,i.jsx)(yc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.state===dt.Full?(0,i.jsx)(Jd,{color:"success",children:t(e.positionSlot.state)}):(0,i.jsx)(Jd,{color:"warning",children:t(e.positionSlot.state)})},n.slug):n.slug===sU.FillingRate?(0,i.jsxs)(yc,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.fillingRate,"%"]},n.slug):n.slug==sU.CheckedInRate?(0,i.jsxs)(yc,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.checkedInRate||0,"%"]},n.slug):n.slug===sU.CreatedAt?(0,i.jsx)(iR,{column:n,insertedAt:e.positionSlot.insertedAt}):n.slug===sU.CreatedBy?(0,i.jsx)(sR,{column:n,createdBy:e.positionSlot.position.createdBy},n.slug):(0,i.jsx)(yc,{minWidth:n.minWidth,width:n.width,children:a?r.getValueString(a,e.positionSlot.position.fields,{fileReturnValue:"name"}):""},n.slug)}),(0,i.jsx)(Ib,{permissions:xb.POSITION_EDIT,children:(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",onClick:()=>{u(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]})})})]}),c&&(0,i.jsx)(KV,{event:e.event,slot:e.positionSlot,onClose:()=>{u(!1)},onSuccess:async t=>{await a({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:t}),d()}})]})},jU=e=>{const{params:{eventId:t}}=cl(),{columns:n,columnsSearch:s,limit:o,nameDebounced:r,offset:a,possibleColumns:l,predicates:d,reloadKey:c,setLimit:u,setOffset:h,setSort:g,sort:p}=HC(),f=(0,M.useMemo)(()=>({includeCheckedInRate:n.includes(sU.CheckedInRate),includeConditions:n.includes(sU.Conditions),includeCreatedBy:n.includes(sU.CreatedBy),includeTags:n.includes(sU.Tags)}),[n]),{data:x,isLoading:_,reload:I}=Yn("query PositionsSlots(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: PositionsSlotsSort\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positionsSlots(\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionsPositionSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...f,eventId:t,name:m(r)?r:null,columnsSearch:eo(s)?s:null,predicates:d,limit:o,offset:a,sort:p},[Ms.PositionsPositionSlotFragment]);const v=(0,M.useMemo)(()=>n.flatMap(e=>(0,Va.A)([l.find(t=>t.slug===e)])),[l,n]),{numberOfPages:b,totalCount:j}=vu(x.event?.positionsSlots),[C,y]=(0,M.useState)([]),[k,A]=(0,M.useState)({}),w=(0,M.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{event:{positionSlot:n}}=await function(e,t){return co("query PositionsPositionSlot(\n $eventId: EventId!\n $id: PositionsSlotId!\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n positionSlot(id: $id) {\n ...PositionsPositionSlot\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ms.PositionsPositionSlotFragment]})}({...f,eventId:t,id:e},await q());y(t=>t.map(t=>t.id===e?n:t)),A(t=>({...t,[e]:!1}))},[f,A,y]);return(0,M.useEffect)(()=>{y(x.event?.positionsSlots.nodes??[])},[x.event]),(0,M.useEffect)(()=>{c>1&&I()},[c]),(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":_,headerRow:(0,i.jsxs)(xc,{children:[v.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:g,sort:p,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(Ib,{permissions:xb.POSITION_EDIT,children:(0,i.jsx)(Fc,{width:100})})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:o,numberOfPages:b,offset:a,setLimit:u,setOffset:h,showLimits:!0,totalCount:j})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Mc,{},t.id):(0,i.jsx)(bU,{columns:v,customFields:e.customFields,event:x.event,positionSlot:t,reloadPositionSlot:w},t.id))})})};let CU=class extends Pl{translationService;constructor(e){super(e),this.translationService=e}massConditionsStep1Schema(){return d.Ik().shape({massConditions:d.Ik().shape({...this.massConditionsStep1Fields()})})}massConditionsStep2Schema(){return d.Ik().shape({massConditions:d.Ik().shape({...this.massConditionsStep2Fields()})})}massConditionsSchema(){return d.Ik().shape({...this.massConditionsStep1Fields(),...this.massConditionsStep2Fields()})}massConditionsStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(_n,this.t("la_strat_gie_es_82287"))}}massConditionsStep2Fields(){return{customFieldId:d.ai().required(this.t("le_champ_person_80074")),value:d.gl().required(this.t("la_valeur_est_r_70136"))}}};CU=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],CU);const yU=()=>{const e=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",children:e("que_souhaitez_v_87607")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(_R,{label:e("ajouter_des_con_91773"),name:"massConditions.strategy",value:Qe.Add}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(_R,{label:e("remplacer_les_c_29446"),name:"massConditions.strategy",value:Qe.Replace})]})},kU=e=>{const t=Hn(),{data:n,loader:s}=Yn("query MassConditionsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n }\n}\n",{organizationId:e.organizationId},[Ms.ConditionsCustomFieldsFragment]);const o=(0,M.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,M.useEffect)(()=>{o?.fieldType===Le.Checkbox?e.change("massConditions.value",!0):o?.fieldType===Le.Select&&e.change("massConditions.value",[])},[o]),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(yj,{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))]}),o?.fieldType===Le.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Mm,{isSearchVisible:!0,label:t("mission_accessi_77261"),multiple:!0,name:"massConditions.value",children:o.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),o?.fieldType===Le.Checkbox&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(yj,{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")})]})]})]})},AU=e=>{const t=Hn(),n=Gn(CU),s=Gn(Da),{mutate:o}=function(e={}){return Kn("mutation PositionsMassConditions($eventId: EventId!, $massConditions: MassConditionsInput!) {\n numberOfPositions: positionsMassConditions(eventId: $eventId, massConditions: $massConditions)\n}\n",e)}(),[r,a]=(0,M.useState)(0);return(0,i.jsx)(Qc,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Fa.lV,{initialValues:{massConditions:{customFieldId:-1,selecteds:e.selecteds,strategy:Qe.Add,value:""}},initialValuesEqual:Or.A,render:({form:n,handleSubmit:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(Ej,{color:"primary",icon:"lock"})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_diter_les_cond_95618")}),(0,i.jsx)(Ba,{height:"7"}),0===r?(0,i.jsx)(yU,{}):(0,i.jsx)(kU,{change:n.change,organizationId:e.organizationId,values:o}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",children:[0!==r&&(0,i.jsx)(jl,{color:"white",leftIcon:"arrow-left",onClick:()=>{a(Math.max(0,r-1))},children:t("retour_92202")}),(0,i.jsx)(br,{css:{flex:"1"}}),0===r?(0,i.jsx)(jl,{rightIcon:"arrow-right",onClick:s,children:t("suivant_1_2_16815")}):(0,i.jsx)(jl,{onClick:s,children:t("mettre_jour_l_67209")})]})]}),validate:e=>0===r?s.validateForForm(n.massConditionsStep1Schema())(e):s.validateForForm(n.massConditionsStep2Schema())(e),onSubmit:async n=>{if(1===r){const i=(await o({eventId:e.eventId,massConditions:n.massConditions})).numberOfPositions;e.onSuccess(t("les_conditions_78548",i)),e.onClose()}else a(r+1)}})})},wU=()=>{const e=Hn(),{roles:t}=_I(),{eventId:n,massActions:s,onMassEditSuccess:o,organizationId:r,predicates:a,segment:l}=HC(),{showNotification:d}=ib(),{mutate:c}=To(),{mutate:u}=sa(),{mutate:h}=ca(),[g,p]=(0,M.useState)(!1),[f,x]=(0,M.useState)(!1),[_,I]=(0,M.useState)(!1),[v,b]=(0,M.useState)(!1),j=s.getSelectedsInput(a,null),C=s.isAllSelected?l.count:s.numberOfSelected,y=(0,M.useCallback)(e=>{m(e)&&d(e),o()},[o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{onClick:()=>{p(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"lock",onClick:()=>{x(!0)},children:e("_diter_les_cond_95618")}),(0,i.jsx)(Ld,{icon:"user-gear",onClick:()=>I(!0),children:e("_diter_les_resp_29588")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{b(!0)},children:e("supprimer_43083")})]})]}),g&&(0,i.jsx)(Vk,{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)(AU,{eventId:n,organizationId:r,selecteds:j,onClose:()=>{x(!1)},onSuccess:y}),_&&(0,i.jsx)(e$,{roles:t.positionRoles,showRoleSelect:!0,onClose:()=>I(!1),onSuccess:async(t,i)=>{const s=(await u({eventId:n,massLeaders:{leaders:i,strategy:t,selecteds:j}})).numberOfPositions;y(e("les_responsable_23291",s))}}),v&&(0,i.jsx)(Pk,{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 h({eventId:n,selecteds:j})).numberOfPositions;y(e("_1_missions_on_56713",t))}})]})};function SU(){const{history:e,params:{organizationId:t,eventId:n}}=cl(),{mutate:i}=function(e={}){return Kn("mutation PositionDuplicate($eventId: EventId!, $positionId: PositionId!) {\n positionDuplicate(eventId: $eventId, positionId: $positionId) {\n id\n }\n}\n",e)}();return(0,M.useCallback)(async s=>{const{positionDuplicate:o}=await i({eventId:n,positionId:s});e.push(Os.EDIT_POSITION(t,n,o.id))},[t,n,i])}const EU=e=>{const{translate:t,params:{eventId:n}}=cl(),{showNotification:s}=ib(),{mutate:o}=ca(),r=[];return e.position.assignedResources>0&&r.push(t("_1_membre_est_66702",e.position.assignedResources)),(0,i.jsx)(Pk,{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 o({eventId:n,selecteds:{ids:[e.position.id]}}),s(t("la_mission_1_45985",e.position.name)),e.onSuccess()}})},TU=e=>{const{params:{organizationId:t,eventId:n},translate:s}=cl(),o=SU(),{isEventAdmin:r}=Jv(),[a,l]=(0,M.useState)(!1),[d,c]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",to:Os.EDIT_POSITION(t,n,e.position.id),children:s("_diter_62574")}),(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>{await o(e.position.id)},children:s("dupliquer_28256")}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{l(!0),$d(e.target)},children:s("supprimer_43083")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{icon:"plus",to:Os.CREATE_POSITION(t,n,e.position.category.id),children:s("ajouter_une_mis_99800")}),(0,i.jsx)(Ld,{icon:"eye",to:ms.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.position.category.id}),children:s("voir_1_90465",e.position.category.name)}),r&&(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{c(!0)},children:s("renommer_1_40542",e.position.category.name)})]}),a&&(0,i.jsx)(EU,{position:e.position,onClose:()=>{l(!1)},onSuccess:e.reload}),d&&(0,i.jsx)(HV,{eventId:n,positionCategoryId:e.position.category.id,positionCategoryName:e.position.category.name,onClose:()=>{c(!1)},onSuccess:e.reload})]})},zU=e=>{const t=(0,M.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)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},OU=e=>{const t=(0,M.useMemo)(()=>(e.position?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ly,{badges:t})})},RU=e=>{const{translate:t}=cl(),n=Gn(Wc),{mutate:s}=To(),o=(0,M.useCallback)((t,n)=>s({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:Qe.Replace,value:t}}),[e.row,s]),r=(0,M.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]),{isEventAdmin:a}=Jv();return e.column.slug==sU.Id?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===sU.Category?(0,i.jsx)(hU,{column:e.column,positionCategory:e.row.category,positionId:e.row.id,reload:e.reloadRow,updatable:a}):e.column.slug===sU.Name?(0,i.jsx)(xU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===sU.Slot?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ra,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(br,{font:"gray900 textSm medium",children:r}),(0,i.jsx)(br,{color:"gray500",children:t("creneau",e.row.numberOfSlots)})]})}):e.column.slug===sU.SlotName?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===sU.Resources?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(o$,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===sU.Tags?(0,i.jsx)(IU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===sU.Conditions?(0,i.jsx)(gU,{column:e.column,position:e.row}):e.column.slug===sU.Address?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===sU.Latitude?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===sU.Longitude?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):"isVisible"===e.column.slug?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ra,{align:"center",gap:"3",width:1,children:e.row.isVisible?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"square-check"})}),(0,i.jsx)(br,{children:t("visible_27909")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"square"})}),(0,i.jsx)(br,{children:t("non_visible_30040")})]})})}):e.column.slug===sU.Acronym?(0,i.jsx)(aU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===sU.Color?(0,i.jsx)(mU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===sU.Icon?(0,i.jsx)(pU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===sU.IconColor?(0,i.jsx)(fU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===sU.State?(0,i.jsx)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===dt.Full?(0,i.jsx)(Jd,{color:"success",children:t(e.row.state)}):(0,i.jsx)(Jd,{color:"warning",children:t(e.row.state)})}):e.column.slug===sU.FillingRate?(0,i.jsxs)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===sU.CheckedInRate?(0,i.jsxs)(yc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug===sU.CreatedAt?(0,i.jsx)(iR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===sU.CreatedBy?(0,i.jsx)(sR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===sU.Leaders?(0,i.jsx)(OU,{column:e.column,position:e.row}):e.column.slug===sU.CategoryLeaders?(0,i.jsx)(zU,{column:e.column,position:e.row}):(0,i.jsx)(my,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:a})},$U=e=>{const{params:{organizationId:t,eventId:n},translate:s}=cl(),{hasPermission:o}=Jv(),r=o(xb.POSITION_EDIT,{eventId:"ANY"}),a=UC(e.customFields),l=(0,M.useCallback)(()=>{e.reloadPosition(e.position.id)},[e.position,e.reloadPosition]);return(0,i.jsxs)(Tc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{$d(e.target)},children:[r&&(0,i.jsx)(yc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:e.state,onClick:(t,n)=>{Al(n),e.toggleRow(`p${e.position.id}`,t)}})}),e.columns.map(t=>{const s=a.get(t.slug);return(0,i.jsx)(RU,{column:t,customField:s,eventId:n,reloadRow:l,row:e.position},t.slug)}),(0,i.jsx)(Ib,{permissions:xb.POSITION_EDIT,children:(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsxs)(Ib,{permissions:xb.POSITION_EDIT,scope:{positionCategoryId:e.position.category.id},children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",to:Os.EDIT_POSITION(t,n,e.position.id)})})}),(0,i.jsx)(_m,{placement:"top",children:s("_diter_62574")})]}),(0,i.jsx)(TU,{position:e.position,reload:e.reload})]})})})]})},DU=e=>{const{params:{eventId:t}}=cl(),{hasPermission:n}=Jv(),s=n(xb.POSITION_EDIT,{eventId:"ANY"}),{columns:o,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:x,sort:_}=HC(),I=(0,M.useMemo)(()=>({includeCheckedInRate:o.includes(sU.CheckedInRate),includeConditions:o.includes(sU.Conditions),includeCreatedBy:o.includes(sU.CreatedBy),includeLeaders:o.includes(sU.Leaders)||o.includes(sU.CategoryLeaders),includeTags:o.includes(sU.Tags),includeTraces:!1}),[o]),{data:v,isLoading:b,reload:j}=ua({...I,eventId:t,name:m(d)?d:null,columnsSearch:eo(r)?r:null,predicates:h,limit:a,offset:c,sort:_}),C=(0,M.useMemo)(()=>o.flatMap(e=>(0,Va.A)([u.find(t=>t.slug===e)])),[u,o]),{numberOfPages:y,totalCount:k}=vu(v.data?.rows),[A,w]=(0,M.useState)([]),[S,E]=(0,M.useState)({}),T=(0,M.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...I,eventId:t,id:e},s=await q(),co("query PositionsPosition(\n $eventId: EventId!\n $id: PositionId!\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: position(id: $id) {\n ...PositionsPosition\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Ms.PositionsPositionFragment]}));var i,s;w(t=>t.map(t=>t.id===e?n:t)),E(t=>({...t,[e]:!1}))},[I,E,w]);return(0,M.useEffect)(()=>{w(v.data?.rows.nodes??[])},[v.data]),(0,M.useEffect)(()=>{g>1&&j()},[g]),(0,M.useEffect)(()=>{l.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(e=>[`p${e.id}`,{id:e.id,state:"unchecked"}])))},[v.data,l.setStates]),(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":b,headerRow:(0,i.jsxs)(xc,{children:[s&&(0,i.jsx)(Fc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:l.selectAllState,onClick:l.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:_,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(Ib,{permissions:xb.POSITION_EDIT,children:(0,i.jsx)(Fc,{width:100})})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:a,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):A.map(t=>S[t.id]?(0,i.jsx)(Mc,{},t.id):(0,i.jsx)($U,{columns:C,customFields:e.customFields,position:t,reload:j,reloadPosition:T,state:l.states[`p${t.id}`]?.state??"unchecked",toggleRow:l.toggleRow},t.id))})})},PU=(0,M.memo)(e=>{const t=(0,M.useCallback)(t=>{t&&(n.current&&(s.current?.setMap(null),o.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{...e.mapOptions??{},zoom:e.initialZoom??Er,center:e.initialCenter??Sr,fullscreenControl:!1,mapTypeControl:!1,streetViewControl:!1,mapTypeId:e.layer===Je.Google?"roadmap":e.layer===Je.GoogleSatellite?"satellite":e.layer,styles:[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi.government",stylers:[{visibility:"on"}]},{featureType:"poi.park",stylers:[{visibility:"on"}]}]}),n.current.mapTypes.set(Je.IgnPlan,$r()),s.current=new google.maps.OverlayView,s.current.draw=Hl.A,s.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&&(o.current?.setMap(null),o.current=new google.maps.Marker({position:t.latLng,map:n.current,draggable:!0}),e.onMarkerDragEnd?.(t.latLng.lat(),t.latLng.lng()),o.current.addListener("dragend",()=>{const t=o.current.getPosition();e.onMarkerDragEnd?.(t.lat(),t.lng())}))}),n.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),l(),d())},[]),n=(0,M.useRef)(null),s=(0,M.useRef)(null),o=(0,M.useRef)(null),r=(0,M.useRef)([]),a=(0,M.useRef)([]),l=()=>{r.current.forEach(e=>e.setMap(null)),r.current=e.positions.map(t=>{const i=wr(Tr(t)),o=new google.maps.Marker({position:i,map:n.current,icon:"acronym"===e.acronymIcon?`${D.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent(t.color)}&text=${t.acronym}`:`${D.HEAVENT_API_URL}/icons/${qa(t.icon)}.svg?color=${encodeURIComponent(t.color)}`});return o.addListener("click",()=>{const n=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));n&&e.onPositionClick?.(t,n)}),o})},d=()=>{a.current.forEach(e=>e.setMap(null)),a.current=e.traces.map(t=>{const i=t.points.map(([e,t])=>({lat:e,lng:t})),s=t.direction===At.None?[]:[{icon:{path:t.direction===At.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:t.color},offset:"0%",repeat:"200px"}],o=new google.maps.Polyline({path:i,geodesic:!0,strokeColor:t.color,strokeOpacity:1,strokeWeight:4,visible:!e.hiddenTracesIds.includes(t.id),icons:s});return o.setMap(n.current),o})};return(0,M.useEffect)(()=>{l()},[JSON.stringify(e.positions),e.acronymIcon]),(0,M.useEffect)(()=>{n.current?.setMapTypeId(zr(e.layer))},[e.layer]),(0,M.useEffect)(()=>{d()},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(br,{ref:t,height:1,width:1})},Or.A);PU.displayName="PositionsMap";const FU=e=>{const t=Hn();return Od(e.onClose),zd(e.onClose),(0,i.jsxs)(Ra,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("acronym")},children:[(0,i.jsx)(br,{fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"text"})}),(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},children:t("acronymes_11499")}),"acronym"===e.selectedAcronymIcon&&(0,i.jsx)(Ra,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Ya,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:mr.colors.primary600.value})})]}),(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("icon")},children:[(0,i.jsx)(br,{fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"location-dot"})}),(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},children:t("ic_nes_16022")}),"icon"===e.selectedAcronymIcon&&(0,i.jsx)(Ra,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Ya,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:mr.colors.primary600.value})})]})]})};function MU(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 NU=e=>{const t=parseFloat(e.getAttribute("lat")),n=parseFloat(e.getAttribute("lon"));return isNaN(t)||isNaN(n)?[]:[[t,n]]};let LU=class extends Pl{constructor(e){super(e)}traceInputDefault(e){return{name:e?.name??"",color:e?.color??mr.colors.primary700.value,points:e?.points??[],direction:e?.direction??At.None}}traceInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_trac_39859")),color:d.Yj().required(this.t("la_couleur_du_t_36646")),points:d.YO().required(this.t("le_trac_doit_c_20895")).min(2,this.t("le_trac_doit_c_20895"))})}createTraceSchema(){return d.Ik().shape({trace:this.traceInputSchema()})}updateNameSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_trac_39859"))})}};LU=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],LU);const BU=e=>{const t=Hn(),n=Gn(LU),s=Gn(Da),[o,r]=(0,M.useState)({name:e.trace?`${h(e.trace.name)}.gpx`:"",content:""}),{mutate:a,isLoading:l}=function(e={}){return Kn("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 Kn("mutation TraceUpdate($eventId: EventId!, $traceId: TraceId!, $trace: TraceInput!) {\n traceUpdate(eventId: $eventId, traceId: $traceId, trace: $trace) {\n id\n }\n}\n",e)}();return(0,i.jsx)(fl,{hideDefaultErrors:!0,initialValues:{trace:n.traceInputDefault(e.trace)},render:({form:n,handleSubmit:s})=>(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(br,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Ya,{icon:"route"})}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("ajouter_un_trac_05425")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(hl,{}),(0,i.jsx)(Rl,{label:t("nom_du_trac_16379"),name:"trace.name",placeholder:t("nom_du_trac_16379")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(fB,{accept:lv.Gpx,format:"string",label:t("fichier_gpx_55484"),placeholder:t("s_lectionnez_un_17918"),value:o,onChange:e=>{r(e),n.change("trace.points",function(e){const t=MU(e),n=Array.from(t.querySelectorAll("trk trkseg trkpt")),i=Array.from(t.querySelectorAll("wpt")),s=Array.from(t.querySelectorAll("rte rtept"));return n.length>0?n.flatMap(NU):i.length>0?i.flatMap(NU):s.flatMap(NU)}(e.content))}}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(_j,{label:t("couleur_du_trac_28854"),name:"trace.color"}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(yj,{label:t("sens_du_trac_49290"),name:"trace.direction",children:[(0,i.jsx)("option",{value:At.None,children:t("aucun_93456")}),(0,i.jsx)("option",{value:At.Forward,children:t("en_avant_17614")}),(0,i.jsx)("option",{value:At.Backward,children:t("en_arri_re_24636")})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{isLoading:l||c,onClick:s,children:e.traceId?t("mettre_jour_85141"):t("ajouter_97327")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]}),validate:s.validateForForm(n.createTraceSchema()),onSubmit:async t=>{e.traceId?await d({eventId:e.eventId,traceId:e.traceId,trace:t.trace}):await a({eventId:e.eventId,trace:t.trace}),e.onClose(),e.reload()}})},VU=e=>(Od(e.onClose),zd(e.onClose),(0,i.jsxs)(Ra,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a3")},children:(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},children:"A3 (420 x 297 mm)"})}),(0,i.jsx)(Ra,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a4")},children:(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},children:"A4 (297 x 210 mm)"})})]})),UU=e=>(0,i.jsxs)(Ra,{align:"center",css:{cursor:"pointer",py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",onClick:e.onClick,children:[(0,i.jsx)(br,{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)(br,{css:{flex:"1"},children:e.name}),e.isSelected&&(0,i.jsx)(Ra,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Ya,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:mr.colors.primary600.value})})]}),WU=e=>{const t=Hn();return Od(e.onClose),zd(e.onClose),(0,i.jsxs)(Ra,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(UU,{imageSrc:dd.Maps.GooglePlan,isSelected:e.selectedLayer===Je.Google,name:"Plan",onClick:()=>{e.onChange(Je.Google)}}),(0,i.jsx)(UU,{imageSrc:dd.Maps.GoogleSatellite,isSelected:e.selectedLayer===Je.GoogleSatellite,name:t("satellite_82253"),onClick:()=>{e.onChange(Je.GoogleSatellite)}}),(0,i.jsx)(UU,{imageSrc:dd.Maps.IgnPlan,isSelected:e.selectedLayer===Je.IgnPlan,name:"IGN Plan",onClick:()=>{e.onChange(Je.IgnPlan)}})]})},GU=e=>(0,i.jsxs)(Ra,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",height:"48px",minWidth:"180px",padding:"$2 $3",userSelect:"none"},gap:"3",onClick:t=>{Al(t),e.onClick()},children:[e.children,(0,i.jsx)(br,{color:"gray700",children:e.isOpen?(0,i.jsx)(Ya,{icon:"chevron-up"}):(0,i.jsx)(Ya,{icon:"chevron-down"})})]}),HU=e=>{const{organizationId:t,eventId:n}=Zn(),s=Gn(ah);return(0,i.jsx)(Ra,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:70,children:(0,i.jsxs)(Ha,{to:ms.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:[(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray800",children:e.position.name}),(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",children:e.position.range?s.toDisplayString(e.position.range):"-"})]}),(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"chevron-right"})})]})})},qU=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("mutation TraceDelete($eventId: EventId!, $traceId: TraceId!) {\n traceDelete(eventId: $eventId, traceId: $traceId) {\n id\n }\n}\n",e)}(),[s,o]=(0,M.useState)(!1),[r,a]=(0,M.useState)(!1);return(0,i.jsxs)(Ra,{align:"center",css:{py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",children:[(0,i.jsx)(br,{css:{background:e.trace.color,borderRadius:"$1",height:"16px",width:"16px"}}),(0,i.jsx)(br,{color:"gray900",css:{flex:"1",ellipsis:!0},children:e.trace.name}),(0,i.jsx)(br,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{e.toggleVisible(e.trace.id)},children:(0,i.jsx)(Ya,{icon:e.isHidden?"eye-slash":"eye"})}),(0,i.jsx)(br,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{a(!0)},children:(0,i.jsx)(Ya,{icon:"pen"})}),(0,i.jsx)(br,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{o(!0)},children:(0,i.jsx)(Ya,{icon:"xmark"})}),s&&(0,i.jsx)(Pk,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_34035"),text:t("suppression_de_73669",e.trace.name),onClose:()=>{o(!1)},onDelete:async()=>{await n({eventId:e.eventId,traceId:e.trace.id}),e.reload()}}),r&&(0,i.jsx)(BU,{eventId:e.eventId,reload:e.reload,trace:e.trace,traceId:e.trace.id,onClose:()=>{a(!1)}})]})},YU=e=>{const t=Hn();return Od(e.onClose),zd(e.onClose),(0,i.jsxs)(Ra,{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)(qU,{eventId:e.eventId,isHidden:e.hiddenTracesIds.includes(t.id),reload:e.reload,toggleVisible:e.toggleVisible,trace:t},t.id)),(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer",py:"$2"},onClick:()=>{e.onAddTrace(),e.onClose()},children:t("ajouter_un_trac_05425")})]})},KU=e=>{const{translate:t,params:{eventId:n,segmentId:s}}=cl(),{isEventAdmin:o,localEvent:r,updateLocalEvent:a}=Jv(),{mutate:l}=function(e={}){return Kn("mutation EventLayerUpdate($eventId: EventId!, $layer: MapLayer!) {\n eventLayerUpdate(eventId: $eventId, layer: $layer) {\n id\n }\n}\n",e)}(),{setNewPositionLatLng:d}=cU(),[c,u]=(0,M.useState)(e.layer),[h,m]=(0,M.useState)([]),[g,p]=(0,M.useState)(null),[f,x]=(0,M.useState)(!1),[_,I]=(0,M.useState)(!1),[v,b]=(0,M.useState)(!1),[j,C]=(0,M.useState)(!1),[y,k]=WT("positionsMap.center",e.center),[A,w]=WT("positionsMap.zoom",Er),[S,E]=WT("positionsMap.acronymIcon","icon"),[T,z]=(0,M.useState)(!1),[O,R]=(0,M.useState)(r?.isPositionsMapAlertVisible??!0),$=(0,M.useRef)(null),P=(0,M.useCallback)(e=>{const t=y?`${y.lat},${y.lng}`:"",i=new URLSearchParams;i.set("format",e),i.set("hiddenTracesIds",h.join(",")),i.set("center",t),i.set("acronymIcon",S),i.set("zoom",A.toString(10)),window.open(`${D.HEAVENT_API_URL}/image/event/${n}/positions/${s}/map.png?${i.toString()}`)},[y,A,h,S]);return(0,i.jsxs)(Ra,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[o&&O&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ja,{leftIcon:"circle-exclamation",rightIcon:"xmark",rightIconClick:async()=>{await a({isPositionsMapAlertVisible:!1}),R(!1)},children:t("pour_cr_er_une_11133")}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(br,{ref:$,css:{flex:"1",borderRadius:"$1"},width:1,children:(0,i.jsx)(PU,{acronymIcon:S,hiddenTracesIds:h,initialCenter:y,initialZoom:A,layer:c,positions:e.positions,showMarker:o,traces:e.traces,onMapCenterChanged:k,onMapDrag:()=>{p(null)},onMapZoomchanged:e=>{p(null),w(e)},onMarkerDragEnd:(e,t)=>{d({latitude:e,longitude:t})},onPositionClick:(e,t)=>{p({position:e,left:t.x,top:t.y})}})}),o&&(0,i.jsxs)(Ra,{css:{bottom:"12px",left:"12px",position:"absolute",zIndex:10},gap:"2",children:[(0,i.jsx)(Ra,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",fontSize:"$textLg"},height:48,justify:"center",width:48,onClick:()=>{$.current?.requestFullscreen()},children:(0,i.jsx)(Ya,{icon:"expand"})}),(0,i.jsxs)(GU,{isOpen:f,onClick:()=>{x(e=>!e),I(()=>!1),b(()=>!1),C(()=>!1)},children:[(0,i.jsx)(br,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32px"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:c===Je.Google?dd.Maps.GooglePlan:c===Je.GoogleSatellite?dd.Maps.GoogleSatellite:dd.Maps.IgnPlan,width:"32px"})}),(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},children:c===Je.Google?"Plan":c===Je.GoogleSatellite?t("satellite_82253"):"IGN Plan"})]}),(0,i.jsx)(GU,{isOpen:_,onClick:()=>{x(()=>!1),I(e=>!e),b(()=>!1),C(()=>!1)},children:(0,i.jsxs)(Ra,{align:"center",css:{flex:"1"},gap:"1",children:[(0,i.jsx)(br,{color:"gray900",children:t("trac_s_41454")}),(0,i.jsx)(Ba,{width:"1"}),e.traces.map(e=>(0,i.jsx)(br,{css:{background:e.color,borderRadius:"$1",height:"16px",width:"16px"}},e.id))]})}),(0,i.jsx)(GU,{isOpen:v,onClick:()=>{x(()=>!1),I(()=>!1),b(e=>!e),C(()=>!1)},children:(0,i.jsxs)(Ra,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(br,{fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"acronym"===S?"text":"location-dot"})}),(0,i.jsx)(br,{color:"gray900",children:t("acronym"===S?"acronymes_11499":"ic_nes_16022")})]})}),(0,i.jsx)(GU,{isOpen:j,onClick:()=>{x(()=>!1),I(()=>!1),b(()=>!1),C(e=>!e)},children:(0,i.jsxs)(Ra,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(br,{fontSize:"textMd",children:(0,i.jsx)(Ya,{icon:"file-export"})}),(0,i.jsx)(br,{color:"gray900",children:t("exporter_59120")})]})})]}),f&&(0,i.jsx)(br,{css:{bottom:"64px",left:"68px",position:"absolute",zIndex:10},children:(0,i.jsx)(WU,{selectedLayer:c,onChange:async e=>{u(e),await l({eventId:n,layer:e})},onClose:()=>{x(!1)}})}),_&&(0,i.jsx)(br,{css:{bottom:"64px",left:"256px",position:"absolute",zIndex:10},children:(0,i.jsx)(YU,{eventId:n,hiddenTracesIds:h,reload:e.reload,toggleVisible:e=>{m(io(h,e))},traces:e.traces,onAddTrace:()=>{z(!0)},onClose:()=>{I(!1)}})}),T&&(0,i.jsx)(BU,{eventId:n,reload:e.reload,onClose:()=>{z(!1)}}),v&&(0,i.jsx)(br,{css:{bottom:"64px",left:"444px",position:"absolute",zIndex:10},children:(0,i.jsx)(FU,{selectedAcronymIcon:S,onChange:E,onClose:()=>{b(!1)}})}),j&&(0,i.jsx)(br,{css:{bottom:"64px",left:"632px",position:"absolute",zIndex:10},children:(0,i.jsx)(VU,{onClose:()=>{C(!1)},onExport:P})}),$.current&&g&&(0,Wt.createPortal)((0,i.jsx)(br,{css:{left:`${g.left+32}px`,position:"absolute",top:g.top-35-16+"px",zIndex:10},children:(0,i.jsx)(HU,{position:g.position})}),$.current)]})},ZU=e=>{const{eventId:t}=Zn(),{data:n,loader:s,reload:o}=ua({eventId:t,includeCheckedInRate:!1,includeConditions:!1,includeCreatedBy:!1,includeLeaders:!1,includeTags:!1,includeTraces:!0,name:m(e.name)?e.name:null,predicates:e.predicates,hasCoordinates:!0});return s?(0,i.jsx)(Ra,{css:{flex:"1"},children:s}):(0,i.jsx)(KU,{center:(r=n.data,"number"==typeof r?.latitude&&"number"==typeof r?.longitude?{lat:r.latitude,lng:r.longitude}:void 0),layer:n.data.layer,positions:n.data.rows.nodes,reload:o,traces:n.data.traces});var r};var XU=n(6965);const JU=e=>{const t=M.useMemo(()=>e.startOfDay.plus({day:1}).minus({second:1}),[e.startOfDay]),n=M.useMemo(()=>Bs.IX.fromDateTimes(e.startOfDay,t).overlaps(e.slot.range),[e.startOfDay,t,e.slot]),s=M.useMemo(()=>n?Bs.IX.fromDateTimes(Bs.c9.max(e.startOfDay,e.slot.range.start),Bs.c9.min(t,e.slot.range.end)):e.slot.range,[n,e.startOfDay,t,e.slot]),o=M.useMemo(()=>{const t=s.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,s]),r=M.useMemo(()=>{const t=s.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,s]);return n?(0,i.jsx)(Ra,{css:{gridColumnStart:o,gridColumnEnd:r},height:32,children:e.renderSlot(e.slot,e.row)},s.toISO()):null},QU=e=>{const[t,n]=M.useState(null),s=M.useCallback(e=>{e&&n(e.getBoundingClientRect())},[]),[o,r]=M.useState(!1),[a,l]=M.useState(1),d=M.useMemo(()=>e.date.startOf("day").set({hour:e.startHour}),[e.date,e.startHour]),c=M.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=M.useCallback(n=>{const i=Math.floor(1440*(n.clientX-(t?.left??0))/(t?.width??0)),s=i-i%60,o=d.plus({minute:s});e.onPlus?.(o,e.row)},[d,e.row,e.onPlus,t]);return(0,i.jsxs)(Ra,{className:"h-planning-data-row",css:{borderBottom:"1px solid $gray200"},width:1,children:[(0,i.jsx)(Ra,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"},children:e.renderLeftCell(e.row)}),(0,i.jsxs)(Ra,{css:{flex:"1",py:"$3",position:"relative"},children:[(0,i.jsx)(id,{ref:s,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)(JU,{renderSlot:e.renderSlot,row:e.row,slot:t,startOfDay:d},n))}),e.showPlus&&(0,i.jsx)(id,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:5},gridtemplatecolumns:"repeat(1440, 1fr)",children:o&&(0,i.jsx)(Ra,{align:"center",css:{gridColumn:`${a} / span 60`,padding:"$1"},height:1,justify:"center",children:(0,i.jsx)(Ra,{align:"center",css:{background:"$gray100",borderRadius:"$1",color:"$gray800",cursor:"pointer",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Ya,{icon:"plus"})})})}),(0,i.jsx)(id,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1},gridtemplatecolumns:"repeat(1440, 1fr)",children:(0,wc.A)(0,23).map(e=>(0,i.jsx)(br,{css:{borderRightColor:"$gray200",borderRightStyle:"dashed",borderRightWidth:"1px",gridColumn:`${60*e+1} / ${60*e+61}`}},e))})]})]})},eW=e=>{const t=Gn(Wc),n=e.date.startOf("day").equals(e.minDate.startOf("day")),s=e.date.endOf("day").equals(e.maxDate.endOf("day"));return(0,i.jsxs)(Ra,{css:{border:"1px solid $gray200",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Ra,{css:{borderBottom:"1px solid $gray200"},height:52,width:1,children:[(0,i.jsxs)(Ra,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:"calc(2 * $cellWidth)"},gap:"3",height:1,children:[(0,i.jsx)(Tu,{max:e.maxDate,min:e.minDate,value:e.date,onChange:e.onChange}),e.renderFilters?.()]}),(0,i.jsxs)(Ra,{align:"center",css:{flex:"1",px:"$2"},gap:"3",children:[(0,i.jsx)(jl,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.date.minus({day:1}))}}),(0,i.jsx)(br,{css:{flex:"1",textTransform:"capitalize"},font:"gray800 textSm medium",textAlign:"center",children:t.toLocaleString(e.date,Zs.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(jl,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.date.plus({day:1}))}})]})]}),(0,i.jsxs)(Ra,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(Ra,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"}}),(0,i.jsx)(Ra,{css:{flex:"1"},children:(0,i.jsxs)(id,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(br,{css:{gridColumn:"span 60"}}),(0,wc.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(Ra,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,XU.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.data.map(t=>(0,i.jsx)(QU,{date:e.date,renderLeftCell:e.renderLeftCell,renderSlot:e.renderSlot,row:t,showPlus:e.showPlus,startHour:e.startHour,onPlus:e.onPlus},t.id.toString(10)))]})},tW=e=>{const{params:{organizationId:t,eventId:n}}=cl();return(0,i.jsxs)(Ra,{css:{padding:"$1 $4"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Vc,{css:{overflow:"hidden",width:"100%"},to:ms.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.position.name,width:1,children:e.position.name})}),(0,i.jsx)(br,{color:"gray500",css:{ellipsis:!0},title:e.position.category.name,width:1,children:e.position.category.name})]})},nW=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),o=Gn(ah),r="number"==typeof e.slot.assignedResources&&"number"==typeof e.slot.fillingRate&&"number"==typeof e.slot.resources;return(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsxs)(Ra,{css:{borderBottom:"1px solid $gray200",padding:"$4 $3 $3 $6"},gap:"4",children:[(0,i.jsx)(pC,{color:e.position.color,icon:e.position.icon}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(Vc,{to:ms.POSITION({organizationId:n,eventId:s,positionId:e.position.id}),children:(0,i.jsx)(br,{css:{ellipsis:!0},width:1,children:e.position.name})}),(0,i.jsx)(br,{color:"gray500",children:e.category.name})]})]}),(0,i.jsxs)(Ra,{css:{padding:"$5 $6 $4 $6"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:m(e.slot.name)?e.slot.name:"-"})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsx)(br,{color:"gray500",children:t("cr_neau_horaire_28150")}),(0,i.jsx)(br,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:o.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})})]}),r&&(0,i.jsxs)(Ra,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ra,{justify:"between",children:[(0,i.jsx)(br,{color:"gray500",children:t("membres_11310")}),(0,i.jsxs)(br,{color:"gray500",children:[e.slot.assignedResources,"/",e.slot.resources]})]}),(0,i.jsx)(br,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:(0,i.jsx)(ow,{percent:e.slot.fillingRate/100})})]})]}),(0,i.jsx)(Ra,{css:{padding:"$4"},gap:"4",justify:"end",children:(0,i.jsx)(jl,{to:Os.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,s,e.position.id,e.slot.id),children:t("affecter_sur_le_19590")})})]})},iW=e=>{const t=ph(Gn(ah),e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}});return(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Ra,{align:"center",css:{background:sw(e.slot.fillingRate/100),borderRadius:"$1",cursor:"pointer",px:"$2",userSelect:"none"},height:1,width:1,children:(0,i.jsx)(br,{css:{ellipsis:!0},font:"white textXs medium",title:t,width:1,children:t})})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(nW,{category:e.position.category,position:e.position,slot:e.slot})})]})},sW=e=>{const{params:{eventId:t}}=cl(),n=Gn(UV),{infos:s,isEditMode:o,limit:r,nameDebounced:a,offset:l,predicates:d,setInfos:c,setLimit:u,setOffset:h}=HC(),{mutate:g}=function(e={}){return Kn("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}=Yn("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:m(a)?a:void 0,predicates:d,limit:r,offset:l},[Ms.PositionPlanningFragment]);const{numberOfPages:x,totalCount:_}=vu(p.data?.rows),[I,v]=(0,M.useState)([]),b=(0,M.useMemo)(()=>Bs.c9.isDateTime(s.positionsPlanningStartAt)&&s.positionsPlanningStartAt?.isValid?s.positionsPlanningStartAt:Bs.c9.fromISO(s.positionsPlanningStartAt)?.isValid?Bs.c9.fromISO(s.positionsPlanningStartAt,{zone:"utc"}):Bs.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Bs.c9.utc())?Bs.c9.utc():e.startAt,[e.startAt,e.endAt,s]),j=(0,M.useCallback)(t=>{c({...s,positionsPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,s,c]),[C,y]=(0,M.useState)(!1),[k,A]=(0,M.useState)(e.startAt),[w,S]=(0,M.useState)(-1),E=(0,M.useMemo)(()=>{const t=gh(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]),T=(0,M.useCallback)(async e=>{const{data:{row:n}}=await function(e,t){return co("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:[Ms.PositionPlanningFragment]})}({eventId:t,positionId:e},await q());v(t=>t.map(t=>t.id===e?n:t))},[t]);return(0,M.useEffect)(()=>{v(p.data?.rows.nodes??[])},[p.data]),f||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Ra,{css:{background:"white",flex:"1"},children:(0,i.jsx)(eW,{data:I,date:b,maxDate:e.endAt,minDate:e.startAt,renderLeftCell:e=>(0,i.jsx)(tW,{position:e}),renderSlot:(e,t)=>(0,i.jsx)(iW,{position:t,slot:e}),showPlus:o,startHour:E,onChange:j,onPlus:(e,t)=>{A(e),y(!0),S(t.id)}})}),(0,i.jsx)(zc,{children:(0,i.jsx)(Ec,{limit:r,numberOfPages:x,offset:l,setLimit:u,setOffset:h,showLimits:!0,totalCount:_})})]}),C&&(0,i.jsx)(KV,{event:{endAt:e.endAt,startAt:e.startAt},slot:n.positionsSlotInputDefault(k),onClose:()=>{y(!1)},onSuccess:async e=>(await g({eventId:t,positionId:w,positionSlot:e}),T(w))})]})};function oW(e,t,n,i){const s=MU(e),o=(e=>Object.fromEntries(Array.from(e.querySelectorAll("Style")).map(e=>{const t=e.getAttribute("id"),[,,n,i,s,o,r,a]=(e.querySelector("color")?.textContent||"").trim().split("");return[`#${t}`,`#${r}${a}${s}${o}${n}${i}`]})))(s);return Array.from(s.querySelectorAll("Placemark")).map(e=>((e,t,n,i,s)=>{const[o,r]=(e.querySelector("Point coordinates")?.textContent||"").trim().split(",");return{positionCategoryId:t,name:(e.querySelector("name")?.textContent||"").trim(),description:(e.querySelector("description")?.textContent||"").trim(),color:s[`${e.querySelector("styleUrl")?.textContent||""}-normal`]||mr.colors.primary700.value,icon:qe.LocationDot,layer:n,latitude:parseFloat(r),longitude:parseFloat(o),tracesIds:[],slots:[{startDate:i,startTime:"08:00",endDate:i,endTime:"09:00",resources:1}],conditionsOperator:me.And,positionsCustomFields:[],tagsIds:[],fields:{},leadersIds:[]}})(e,t,n,i,o))}const rW=e=>{const t=Hn(),{data:n,loader:s}=Yn("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:o,isLoading:r}=function(e={}){return Kn("mutation PositionsCreate($eventId: EventId!, $positions: [PositionInput!]!) {\n positionsCreate(eventId: $eventId, positions: $positions) {\n id\n }\n}\n",e)}(),[a,l]=(0,M.useState)(),[d,c]=(0,M.useState)(-1),u=m(a?.content)&&-1!==d;return(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(br,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Ya,{icon:"cloud-arrow-up"})}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("importer_des_mi_32264")}),(0,i.jsx)(Ba,{height:"7"}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fB,{accept:lv.Kml,format:"string",label:t("fichier_kml_55657"),placeholder:t("s_lectionnez_un_75984"),value:a,onChange:e=>{l(e)}}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Au,{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)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[(0,i.jsx)(jl,{disabled:!u,isLoading:r,onClick:async()=>{a&&(await o({eventId:e.eventId,positions:oW(a.content,d,n.event.layer,n.event.startAt)}),window.location.reload())},children:t("importer_90688")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},aW=({name:e,numberOfCategories:t,segment:n})=>{const{history:s,params:{organizationId:o,eventId:r},translate:a}=cl(),{user:l}=ni(),{hasFeature:d}=_I(),{hasPermission:c}=Jv(),{newPositionLatLng:u}=cU(),{data:h,isLoading:m}=Yn("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[g,p]=(0,M.useState)(!1),[f,x]=(0,M.useState)(!1),[_,I]=(0,M.useState)(!1),[v,b]=(0,M.useState)(!1),j=c(xb.POSITION_EDIT,{eventId:"ANY"}),C=c(xb.POSITION_EDIT,{positionCategoryId:"ANY"}),y=(0,M.useMemo)(()=>{let e;return u&&(e=`${u.latitude},${u.longitude}`),Os.CREATE_POSITION(o,r,e)},[u]);return(0,i.jsxs)(RR,{name:(0,i.jsxs)(Ra,{align:"center",css:{flex:"1",overflow:"hidden",position:"relative"},gap:"2",children:[(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray900 displaySm semiBold",title:e,children:e}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"gray500",children:(0,i.jsx)(Ya,{icon:"circle-exclamation"})})}),(0,i.jsxs)(_m,{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:[j?(0,i.jsx)(wS,{menu:(0,i.jsxs)(i.Fragment,{children:[d(Fe.KmlImport)&&(0,i.jsx)(Ld,{color:0===t?"disabled":"default",icon:"file-import",onClick:()=>{p(!1),b(!0)},children:a("importer_des_mi_32264")}),(0,i.jsx)(Ld,{icon:"file-import",to:ms.POSITION_IMPORT_CSV({organizationId:o,eventId:r}),children:a("import_tasks_fr_52548")})]}),path:y,children:a("cr_er_une_missi_66818")}):C?(0,i.jsx)(jl,{onClick:()=>{s.push(y)},children:a("cr_er_une_missi_66818")}):null,j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Pd,{isOpen:g,onStateChange:p,children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"plus",onClick:()=>{p(!1),I(!0)},children:a("cr_er_une_cat_g_20051")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{icon:"calendar",to:rg(h.event?.segment.links.positionsPlanningLink,"html"),children:a("voir_le_plannin_85187")}),(0,i.jsx)(Ld,{icon:"calendar",to:rg(h.event?.segment.links.positionsVolunteersPlanningLink,"html"),children:a("voir_le_plannin_47650")}),(0,i.jsx)(Ib,{permissions:xb.POSITION_EDIT,children:(0,i.jsx)(Ld,{icon:"plug-circle-bolt",onClick:e=>{$d(e.target),x(!0)},children:a("exporter_via_l_09843")})}),(0,i.jsx)(Ld,{download:`${n.name}-positions-planning`,icon:"arrow-down-to-bracket",to:rg(h.event?.segment.links.positionsPlanningLink,"pdf"),children:a("t_l_charger_le_06050")}),(0,i.jsx)(Ld,{download:`${n.name}-positions-volunteers-planning`,icon:"arrow-down-to-bracket",to:rg(h.event?.segment.links.positionsVolunteersPlanningLink,"pdf"),children:a("t_l_charger_le_02952")})]})]}),_&&(0,i.jsx)(GV,{eventId:r,onClose:()=>{I(!1)},onSuccess:({id:e})=>{s.push(ms.POSITION_CATEGORY({organizationId:o,eventId:r,positionCategoryId:e}))}}),v&&(0,i.jsx)(rW,{eventId:r,onClose:()=>{b(!1)}}),!m&&(0,i.jsx)(M$,{isOpen:f,link:og({organizationId:o,eventId:r,lang:l?.language,pathComponent:"positions",key:h.event.key}),onClose:()=>{x(!1)}})]})]})},lW=e=>{const t=Hn(),n=Jn(),{hasPermission:s,updateLocalEvent:o}=Jv(),{limit:r,nameDebounced:a,predicates:l,rendering:d,segment:c}=HC(),u=s(xb.SEGMENT_EDIT)&&(d===Dh.List||d===Dh.SlotsList),h=s(xb.POSITION_EDIT,{eventId:"ANY"})&&(d===Dh.Calendar||d===Dh.List||d===Dh.SlotsList);return(0,M.useEffect)(()=>{o({positionBackPath:n.pathname,positionCategoryBackPath:n.pathname})},[c]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(aW,{name:c.name,numberOfCategories:e.event.positionsCategories.length,segment:c}),0===e.event.numberOfPositions&&d!==Dh.Map?(0,i.jsx)(Ob,{css:{overflow:"hidden"},children:(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(xk,{subtitle:t("plus_besoin_de_08254"),title:t("vous_n_avez_pas_08610")})})}):(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{actions:(0,i.jsx)(wU,{}),searchPlaceholder:t("rechercher_une_69998"),showActions:s(xb.POSITION_EDIT),showEditColumns:u,showEditMode:h,showSearchColumns:s(xb.SEGMENT_EDIT)}),selectSegment:(0,i.jsx)(QR,{pageSelectedText:t("les_1_mission_95719",r),segmentSelectedText:t("les_1_mission_38484",c.count,c.name)})}),d===Dh.List?(0,i.jsx)(DU,{customFields:e.customFields}):d===Dh.Map?(0,i.jsx)(ZU,{name:a,predicates:l}):d==Dh.SlotsList?(0,i.jsx)(jU,{customFields:e.customFields}):(0,i.jsx)(sW,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})]})]})},dW=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=cl(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=Jv(),c=Gn(oU),u=(0,M.useMemo)(()=>c.getPositionsFilters(e.event,e.customFields),[e.event,e.customFields]),h=(0,M.useMemo)(()=>c.getPositionsPossibleColumns(e.customFields),[e.customFields]);return(0,i.jsx)(dU,{eventId:o,organizationId:s,children:(0,i.jsx)(wR,{canEditSegments:a(xb.SEGMENT_EDIT),eventId:o,filters:u,filtersButtonText:n("filtrer_les_mis_43681"),filtersSubtitle:n("appliquer_des_f_16037"),getSegmentPath:e=>Os.POSITIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfPositions,initialLimit:l?.positionsLimit??kc,initialSegmentsOpen:l?.arePositionsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[Dh.List,Dh.Calendar,Dh.Map,Dh.SlotsList],reload:e.reload,segmentId:r,segmentType:_t.Positions,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({positionsLimit:e})},onSegmentClick:e=>{d({positionsSegmentId:e})},onSegmentDelete:async()=>{await d({positionsSegmentId:null}),t.push(ms.POSITIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({arePositionsSegmentsOpen:e})},children:(0,i.jsx)(lW,{customFields:e.customFields,event:e.event})})})},cW=(0,M.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=cl(),{event:{name:s},localEvent:o}=Jv();Td(`${s} ${n("missions_63972")}`);const{data:r,loader:a,reload:l}=Yn("query PositionsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Position) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n startAt\n endAt\n numberOfPositions\n dayStartTime\n\n positionsCategories {\n id\n name\n\n leaders {\n ...LeaderInfos\n }\n }\n\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Ms.SegmentCustomFieldFragment,Ms.LeaderInfosFragment,Ms.SegmentsFoldersSegmentsFragment]),d=(0,M.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(dW,{customFields:r.organization.customFields.nodes,event:r.event,reload:l})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.POSITIONS_SEGMENT(e,t,o?.positionsSegmentId&&d.includes(o.positionsSegmentId)?o?.positionsSegmentId:d[0]),replace:!0})})]})}),uW=e=>{const{translate:t}=cl(),n=jc();return(0,i.jsx)(tw,{title:e.title,children:(0,i.jsxs)(Ra,{align:"center",direction:"column",...n?{gap:"9"}:{gap:"7"},gap:"4",width:1,children:[(0,i.jsx)(rw,{count:e.category.assignedResources,total:e.category.resources}),(0,i.jsx)(Jd,{leftIcon:"user",children:t("_1_membre_pr_32812",e.category.preassignedResources)})]})})},hW=({position:e})=>(0,i.jsx)(br,{color:"gray800",css:{background:e.color,borderRadius:"20px",height:"20px",width:"20px"}}),mW=e=>{const{eventId:t,positionId:n}=Zn(),{mutate:s}=To(),o=(0,M.useRef)(null),[r,a]=(0,M.useState)(e.position.color),l=Dc(e=>s({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:st.Color,strategy:Qe.Replace,value:e}})),{hasPermission:d}=Jv(),c=d(xb.POSITION_EDIT,{positionCategoryId:e.position.positionCategoryId,positionId:e.position.id});return(0,i.jsx)(br,{color:"gray800",css:{background:r,borderRadius:"20px",cursor:"pointer",height:"20px",width:"20px","& input":{background:"transparent",border:"none",borderRadius:"20px",cursor:"pointer",height:"20px",width:"20px","&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"20px",border:"none"},"&::-moz-color-swatch":{border:"none"}}},onClick:()=>{c&&o.current?.click()},children:c&&(0,i.jsx)("input",{ref:o,type:"color",value:r,onChange:e=>{a(e.target.value),l(e.target.value)}})})},gW=({customFields:e,position:t})=>{const n=jc(),{params:{organizationId:s,eventId:o},translate:r}=cl(),a=Gn(ah);return(0,i.jsx)(tw,{title:r("param_tres_78420"),children:(0,i.jsx)(Ra,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(IF,{children:[(0,i.jsxs)(xF,{children:[(0,i.jsx)(mF,{children:r("cat_gorie_00291")}),(0,i.jsx)(pF,{children:n?(0,i.jsx)(i.Fragment,{children:t.positionCategoryName}):(0,i.jsx)(Vc,{to:ms.POSITION_CATEGORY({organizationId:s,eventId:o,positionCategoryId:t.positionCategoryId}),children:t.positionCategoryName})})]}),(0,i.jsx)(uF,{direction:"horizontal"}),(0,i.jsxs)(xF,{children:[(0,i.jsx)(mF,{children:r("Color")}),(0,i.jsx)(pF,{children:n?(0,i.jsx)(hW,{position:t}):(0,i.jsx)(mW,{position:t})})]}),(0,i.jsx)(uF,{direction:"horizontal"}),(0,i.jsxs)(xF,{children:[(0,i.jsx)(mF,{children:r("ic_ne_55554")}),(0,i.jsx)(pF,{children:(0,i.jsx)(Ya,{icon:qa(t.icon)})})]}),(0,i.jsx)(uF,{direction:"horizontal"}),(0,i.jsxs)(xF,{children:[(0,i.jsx)(mF,{children:r("Date")}),(0,i.jsx)(pF,{children:t.range?n?a.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):a.toDisplayString(t.range):"-"})]}),e.map(e=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(br,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Ra,{justify:"end",width:300,children:(0,i.jsx)(JA,{field:e,fields:t.fields})})]})]},e.slug))]})})})},pW=e=>{const t=Hn(),{hasPermission:n}=Jv(),s=n(xb.MEMBER_ASSIGN,{positionCategoryId:e.positionSlot.positionCategoryId,positionId:e.positionSlot.positionId}),{mutate:o}=Po(),{mutate:r}=Yo(),a=e.volunteerRegistration.positionSlotUserInfo;return(0,i.jsxs)(Bc,{children:[a.state===ue.Waiting&&(0,i.jsx)(Ld,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:he.CheckIn,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("pointer_1_57919",e.volunteerRegistration.userInfo.name)}),a.state===ue.CheckedIn&&(0,i.jsx)(Ld,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:he.CheckOut,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("d_pointer_1_08337",e.volunteerRegistration.userInfo.name)}),a.state===ue.CheckedOut&&(0,i.jsx)(Ld,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:he.Reset,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("remettre_z_ro_11572")}),s&&(0,i.jsx)(Ld,{color:"red",icon:"user-xmark",onClick:async()=>{await r({eventId:e.eventId,massAssign:{positionsSlotsIds:[e.positionSlot.id],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:Qe.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})]})},fW=e=>{const{translate:t,params:{eventId:n}}=cl(),s=Gn(Wc),o=Gn(Kg);return(0,i.jsxs)(Tc,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Ub,{userInfo:e.volunteerRegistration.userInfo})}),(0,i.jsx)(yc,{children:e.volunteerRegistration.positionSlotUserInfo.state===ue.CheckedOut?(0,i.jsx)(Jd,{leftIcon:"clock",children:t("temps_total_79448",o.minutesToHoursMinutesString(e.volunteerRegistration.positionSlotUserInfo.timeDifferenceMinutes))}):e.volunteerRegistration.positionSlotUserInfo.state===ue.CheckedIn?(0,i.jsx)(Jd,{color:"success",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("point_le_1_63576",s.toLocaleString(e.volunteerRegistration.positionSlotUserInfo.checkInAt.toLocal(),Zs.DateTime))}):(0,i.jsx)(Jd,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("non_point_42145")})}),(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsx)(pW,{eventId:n,positionSlot:e.positionSlot,reload:e.reload,volunteerRegistration:e.volunteerRegistration})})]})},xW=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,positionId:o,positionSlotId:r}}=cl(),a=Gn(ah),[l,d]=(0,M.useState)(0),[c,u]=(0,M.useState)({direction:vt.Asc,attribute:$t.Name}),{data:h,isLoading:m,reload:g}=Yn("query PositionSlotVolunteers(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $offset: Int\n $sort: VolunteersRegistrationsSort\n) {\n event(id: $eventId) {\n positionSlot(id: $positionSlotId) {\n id\n positionId\n positionCategoryId\n name\n range\n assignedResources\n resources\n }\n\n volunteersRegistrations(\n positionSlotId: $positionSlotId\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n\n userInfo {\n id\n name\n email\n picture {\n url\n }\n }\n\n positionSlotUserInfo(positionSlotId: $positionSlotId) {\n id\n checkInAt\n checkOutAt\n state\n timeDifferenceMinutes\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:s,positionSlotId:r,offset:l,sort:c},[]),{numberOfPages:p,totalCount:f}=vu(h.event?.volunteersRegistrations),x=(0,M.useMemo)(()=>h.event?.positionSlot?h.event.positionSlot.resources-h.event.positionSlot.assignedResources:0,[h.event?.positionSlot]),{hasPermissions:_}=Jv(),[I]=m?[!1]:_([xb.MEMBER_ASSIGN],{positionCategoryId:h.event.positionSlot.positionCategoryId,positionId:o});return(0,i.jsxs)(hu,{returnToFallback:ms.POSITION({organizationId:n,eventId:s,positionId:o}),size:"md",children:[(0,i.jsx)(nj,{children:(0,i.jsx)(Ra,{direction:"column",gap:"1",width:1,children:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$1",height:28,width:1}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{children:h.event.positionSlot.name||"-"}),(0,i.jsx)(br,{font:"gray500 textSm regular",children:a.toDisplayString(h.event.positionSlot.range)})]})})}),(0,i.jsxs)(mu,{children:[(0,i.jsx)(Ba,{height:"5"}),(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{children:t("liste_des_membr_89037")}),h.event?x>0?(0,i.jsx)(Jd,{color:"warning",children:t("_1_membre_manq_31014",x)}):(0,i.jsx)(Jd,{color:"success",children:t("complet_51600")}):null]}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsxs)(vc,{children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(mm,{attribute:$t.Name,setSort:e=>{d(0),u(e)},sort:c,children:t("nom_08311")}),(0,i.jsx)(Fc,{children:t("status_06428")}),(0,i.jsx)(Fc,{width:100})]}),m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):h.event.volunteersRegistrations.nodes.map(e=>(0,i.jsx)(fW,{positionSlot:h.event.positionSlot,reload:g,volunteerRegistration:e},e.id)),(0,i.jsx)(zc,{children:(0,i.jsx)(Ec,{numberOfPages:p,offset:l,setOffset:d,totalCount:f})})]}),(0,i.jsx)(Ba,{height:"5"})]}),(0,i.jsx)(gu,{children:(0,i.jsxs)(Ra,{gap:"3",justify:"end",children:[I&&(0,i.jsx)(jl,{onClick:()=>{e.push(Os.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,s,o,r))},children:t("affecter_des_me_30349")}),(0,i.jsx)(jl,{color:"white",onClick:()=>e.goBack(ms.POSITION_SLOT({organizationId:n,eventId:s,positionId:o,positionSlotId:r})),children:t("fermer_62479")})]})})]})},_W=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),r=Gn(ah),{hasPermissions:a}=Jv(),l=Gn(UV),{mutate:d}=fa(),{mutate:c}=Po(),{mutate:u}=function(e={}){return Kn("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)}(),[h,g]=(0,M.useState)(!1),[p,f]=(0,M.useState)(!1),x=(0,M.useMemo)(()=>r.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}}),[e.slot]),[_,I]=a([xb.POSITION_EDIT,xb.MEMBER_ASSIGN],{positionCategoryId:e.slot.positionCategoryId,positionId:e.slot.positionId});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{cursor:"pointer"},onClick:()=>{t.push(Os.POSITION_SLOT_MEMBERS(s,o,e.slot.positionId,e.slot.id))},children:[(0,i.jsx)(yc,{align:"start",direction:"column",justify:"center",children:(0,i.jsx)(br,{font:"gray900 textSm medium",children:m(e.slot.name)?e.slot.name:"-"})}),(0,i.jsx)(yc,{css:{textTransform:"capitalize"},children:x}),(0,i.jsx)(yc,{children:(0,i.jsx)(o$,{assignedResources:e.slot.assignedResources,resources:e.slot.resources})}),(0,i.jsx)(Uc,{justify:"end",children:(0,i.jsxs)(Bc,{children:[I&&(0,i.jsx)(Ld,{icon:"wand-magic-sparkles",to:Os.POSITION_SLOT_ASSIGN_VOLUNTEERS(s,o,e.slot.positionId,e.slot.id),children:n("affecter_des_me_30349")}),_&&(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{g(!0)},children:n("_diter_62574")}),_&&(0,i.jsx)(Ld,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{f(!0)},children:n("supprimer_43083")}),(0,i.jsx)(Ld,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:he.CheckIn,positionsSlotsIds:[e.slot.id]}})},children:n("pointer_les_mem_50347")}),(0,i.jsx)(Ld,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:he.CheckOut,positionsSlotsIds:[e.slot.id]}})},children:n("d_pointer_les_m_17150")})]})})]}),h&&(0,i.jsx)(KV,{event:e.event,slot:l.positionsSlotInputDefault(e.event.startAt,e.slot),onClose:()=>{g(!1)},onSuccess:async t=>{await d({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id,positionSlot:t}),e.reload()}}),p&&(0,i.jsx)(Pk,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_48876")],text:n("suppression_de_73669",x),onClose:()=>{f(!1)},onDelete:async()=>{await u({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id}),e.reload()}})]})},IW=()=>{const{translate:e,params:{eventId:t,positionId:n}}=cl(),[s,o,r]=Pc(""),[a,l]=WT("position.slots.date",Bs.c9.invalid("Invalid"),um),[d,c]=(0,M.useState)(0),[u,h]=WT("position.slots.sort",null),{data:g,isLoading:p,reload:f}=Yn("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:m(o)?o:void 0,date:a.isValid?a:void 0,offset:d,sort:u},[Ms.PositionPositionSlotFragment]);const{numberOfPages:x,totalCount:_}=vu(g.event?.positionsSlots),I=(0,M.useCallback)(e=>{h(e),c(0)},[h,c]);return(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(br,{width:200,children:(0,i.jsx)(Tu,{max:g.event?.endAt,min:g.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mm,{attribute:at.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(mm,{attribute:at.Range,setSort:I,sort:u,children:e("cr_neau_11117")}),(0,i.jsx)(Fc,{children:e("remplissage_75916")}),(0,i.jsx)(Fc,{width:100})]}),numberOfPages:x,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.event.positionsSlots.nodes.map(e=>(0,i.jsx)(_W,{event:g.event,reload:f,slot:e},e.id))}),setOffset:c,title:e("liste_des_cr_ne_86148"),totalCount:_})},vW=()=>{const{params:{organizationId:e,eventId:t,positionId:n},translate:s}=cl(),{roles:o}=_I(),{hasPermission:r}=Jv(),{data:a,loader:l,reload:d}=pa({organizationId:e,eventId:t,positionId:n}),{mutate:c}=sa(),{mutate:u}=To(),h=r(xb.POSITION_EDIT,{positionCategoryId:a.event?.position.positionCategoryId,positionId:n});return l||(0,i.jsxs)(Ob,{children:[(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsx)(uW,{category:a.event.position,title:s("remplissage_de_52564")}),(0,i.jsx)(gW,{customFields:a.organization.customFields.nodes,position:a.event.position})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(IW,{}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(Ra,{gap:"6",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Uw,{leaders:a.event.position.leaders,reload:d,roles:o.positionRoles,onSave:e=>c({eventId:t,massLeaders:{leaders:e,selecteds:{ids:[n]},strategy:Qe.Replace}})}),(0,i.jsx)(CF,{customFields:a.event.position.customFields}),(0,i.jsx)(pw,{modalSubtitle:s("ajouter_des_tag_64526"),reload:d,tags:a.event.position.tags,...h?{associateTags:e=>u({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:st.Tag,strategy:Qe.Replace,value:e}})}:{}})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(cw,{description:a.event.position.description}),(0,i.jsx)(kF,{location:a.event.position}),(0,i.jsx)(uw,{privateNote:a.event.position.privateNote})]})]}),(0,i.jsx)(Cr.qh,{path:Os.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(xW,{})})]})},bW=e=>{const{params:{organizationId:t,eventId:n}}=cl(),s=Gn(Bh),{isEventAdmin:o}=Jv(),[r,a]=WT("positionMembers.columns",[Nh.Name,Nh.Positions]),[l,d]=WT("positionMembers.limit",kc),[c,u]=WT("positionMembers.predicates",[]),[h,m]=WT("positionMembers.sort",null),{data:g}=Xo({organizationId:t,eventId:n,privacy:o?pe.All:pe.Public,loadForms:!1,loadSegments:!1}),p=(0,M.useMemo)(()=>g.organization?.customFields.nodes??[],[g.organization]),f=UC(p),x=(0,M.useMemo)(()=>g.event?s.getPositionMembersFilters(t,n,p,g.event):[],[n,p,g.event]),_=(0,M.useMemo)(()=>s.getPositionMembersPossibleColumns(p),[p]);return(0,i.jsx)(Ob,{children:(0,i.jsx)(lm,{columns:r,columnsSearch:[],columnsToIncludes:Lh,eventId:n,filters:x,getMassActionId:e=>e.userInfo.id,limit:l,loadDataList:nr,loadDataListParams:{includeCanRegistrationStateUpdate:!o,includeIsEditable:!o,positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId},loadRow:er,loadRowParams:{includeCanRegistrationStateUpdate:!o,includeIsEditable:!o},organizationId:t,possibleColumns:_,predicates:c,renderActions:(e,t,n)=>(0,i.jsx)(QF,{massActions:e,predicates:null,showOnlyMassEdit:!0,totalNumberOfMembers:t,onMassEditSuccess:n}),rendering:Ph.List,setColumns:a,setLimit:d,setPredicates:u,setSort:m,showEditColumns:o,showEditMode:o,showFilters:o,showMassActions:o,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:h,children:(0,i.jsx)(bm,{renderCell:(e,t,s)=>(0,i.jsx)(Qy,{canAccredit:o,canAssign:o,canChangeDelegation:o,canClickMemberName:!0,column:e,customField:f.get(e.slug),eventId:n,reloadRow:s,row:t})})})})},jW=({position:e})=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),{user:r}=ni(),{hasPermission:a}=Jv(),l=a(xb.POSITION_EDIT,{positionCategoryId:e.positionCategoryId}),d=SU(),[c,u]=(0,M.useState)(!1);return(0,i.jsxs)(Rb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Qb,{returnPathFallback:ms.POSITIONS({organizationId:s,eventId:o})}),(0,i.jsxs)(br,{css:{flex:"1"},font:"gray900 displayXs medium",children:[e.name," ",m(e.acronym)?`(${e.acronym})`:""]}),(0,i.jsx)(jl,{color:"white",download:`${e.name}-position-sheet`,to:rg(e.links.positionSheetLink,"pdf",{lang:r?.language}),children:n("t_l_charger_la_16259")}),(0,i.jsx)(Ib,{permissions:xb.POSITION_EDIT,scope:{positionCategoryId:e.positionCategoryId,positionId:e.id},children:(0,i.jsx)(jl,{to:Os.EDIT_POSITION(s,o,e.id),children:n("_diter_la_missi_90442")})}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[l&&(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>await d(e.id),children:n("dupliquer_28256")}),(0,i.jsx)(Ld,{download:`${e.name}-position-planning`,icon:"arrow-down-to-bracket",target:"_blank",to:rg(e.links.positionPlanningLink,"pdf",{lang:r?.language}),children:n("t_l_charger_le_06050")}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:async()=>u(!0),children:n("supprimer_43083")})]})]})]}),c&&(0,i.jsx)(EU,{position:e,onClose:()=>u(!1),onSuccess:()=>t.replace(ms.POSITIONS({organizationId:s,eventId:o}))})]})},CW=e=>{const{params:{organizationId:t,eventId:n,positionId:s},translate:o}=cl();Td(e.event.position.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,positionId:e?":positionId":s});return(0,i.jsxs)($b,{children:[(0,i.jsx)(jW,{position:e.event.position}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:ms.POSITION_DASHBOARD(r(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(Db,{path:ms.POSITION_MEMBERS(r(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)}),(0,i.jsx)(Db,{path:ms.POSITION_PREASSIGNED_MEMBERS(r(!1)),children:o("membres_pr_aff_93093",e.event.position.preassignedResources)})]}),(0,i.jsx)(Fb,{path:[ms.POSITION_DASHBOARD(r(!0)),Os.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId")],children:(0,i.jsx)(vW,{})}),(0,i.jsx)(Fb,{path:ms.POSITION_MEMBERS(r(!0)),children:(0,i.jsx)(bW,{positionId:s})}),(0,i.jsx)(Fb,{path:ms.POSITION_PREASSIGNED_MEMBERS(r(!0)),children:(0,i.jsx)(bW,{preassignedPositionId:s})})]})]})},yW=()=>{const{params:{organizationId:e,eventId:t,positionId:n}}=cl(),{data:s,loader:o}=Yn("query Position($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n id\n name\n acronym\n positionCategoryId\n assignedResources\n preassignedResources\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n }\n\n volunteersRegistrations(positionId: $positionId) {\n totalCount\n }\n }\n}\n",{eventId:t,positionId:n},[]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:ms.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(ei,{path:ms.POSITION_DASHBOARD({organizationId:e,eventId:t,positionId:n}),replace:!0})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(CW,{event:s.event})})]})},kW=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("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)(Tj,{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)(br,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(Tv,{label:t("description_58935"),name:"positionCategory.description"})})})},AW=e=>{const t=Hn(),{hasPermission:n}=Jv(),s=n(xb.POSITION_EDIT,{positionCategoryId:e.category.id}),[o,r]=(0,M.useState)(!1),a=m(e.category.description);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tw,{rightIcon:s?a?"pen":"plus":void 0,rightIconClick:()=>{r(!0)},title:t("description_58935"),children:a?(0,i.jsx)(hg,{text:e.category.description}):(0,i.jsx)(br,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})}),s&&o&&(0,i.jsx)(kW,{eventId:e.eventId,positionCategory:e.category,reload:e.reload,onClose:()=>{r(!1)}})]})},wW=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=cl(),r=Gn(ah),a=(0,M.useMemo)(()=>e.position.resources-e.position.assignedResources,[e.position]);return(0,i.jsxs)(Tc,{css:{cursor:"pointer"},onClick:()=>{t.push(ms.POSITION({organizationId:s,eventId:o,positionId:e.position.id}))},children:[(0,i.jsx)(yc,{children:(0,i.jsx)(br,{font:"gray900 textSm medium",children:e.position.name})}),(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray900 textSm medium",children:e.position.range?r.toLocaleString(e.position.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"}),(0,i.jsx)(br,{font:"gray500 textSm regular",children:n("creneau",e.position.numberOfSlots)})]})}),(0,i.jsx)(yc,{children:a>0?(0,i.jsx)(Jd,{color:"warning",children:n("_1_membre_manq_31014",a)}):(0,i.jsx)(Jd,{color:"success",children:n("complet_51600")})}),(0,i.jsx)(Uc,{justify:"end",children:(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"eye",to:ms.POSITION({organizationId:s,eventId:o,positionId:e.position.id}),children:n("voir_la_mission_68087")}),(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{t.push(Os.EDIT_POSITION(s,o,e.position.id))},children:n("_diter_la_missi_90442")})]})})]})},SW=()=>{const{translate:e,params:{eventId:t,positionCategoryId:n}}=cl(),[s,o,r]=Pc(""),[a,l]=(0,M.useState)(Bs.c9.invalid("Invalid")),[d,c]=(0,M.useState)(0),{data:u,isLoading:h}=Yn("query PositionCategoryPositions(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $name: String\n $date: Date\n $offset: Int\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positions(\n positionCategoriesIds: [$positionCategoryId]\n name: $name\n date: $date\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...PositionCategoryPosition\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,positionCategoryId:n,name:m(o)?o:void 0,date:a.isValid?a:void 0,offset:d},[Ms.PositionCategoryPositionFragment]);const{numberOfPages:g,totalCount:p}=vu(u.event?.positions);return(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(br,{width:200,children:(0,i.jsx)(Tu,{max:u.event?.endAt,min:u.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("nom_de_la_missi_64605")}),(0,i.jsx)(Fc,{children:e("Date")}),(0,i.jsx)(Fc,{children:e("status_06428")})]}),numberOfPages:g,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:u.event.positions.nodes.map(e=>(0,i.jsx)(wW,{position:e},e.id))}),setOffset:c,title:e("liste_des_missi_40241"),totalCount:p})},EW=e=>{const{translate:t,params:{eventId:n,positionCategoryId:s}}=cl(),{roles:o}=_I(),r=Gn(ah),{mutate:a}=function(e={}){return Kn("mutation PositionsCategoriesMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n positionsCategoriesMassLeadersAssign(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}();return(0,i.jsx)(Ob,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ra,{gap:"6",width:1,children:[(0,i.jsx)(Fw,{iconColor:"primary",text:t("nombre_de_missi_56719"),value:e.positionCategory.numberOfPositions}),(0,i.jsx)(Fw,{iconColor:"primary",text:t("number_of_membe_24698"),value:e.positionCategory.assignedResources}),(0,i.jsx)(Fw,{iconColor:"primary",text:t("nombre_de_membr_74699"),value:e.positionCategory.preassignedResources}),(0,i.jsx)(Fw,{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)(Ra,{gap:"7",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"6",width:470,children:[(0,i.jsx)(Uw,{leaders:e.positionCategory.leaders,reload:e.reload,roles:o.positionRoles,onSave:e=>a({eventId:n,massLeaders:{leaders:e,selecteds:{ids:[s]},strategy:Qe.Replace}})}),(0,i.jsx)(AW,{category:e.positionCategory,eventId:n,reload:e.reload})]}),(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(SW,{})})]})]})})},TW=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("mutation PositionCategoryDelete($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDelete(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(Pk,{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()}})},zW=({category:e,reload:t})=>{const{translate:n,history:s,params:{organizationId:o,eventId:r}}=cl(),{isEventAdmin:a}=Jv(),{mutate:l}=function(e={}){return Kn("mutation PositionCategoryDuplicate($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDuplicate(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}(),[d,c]=(0,M.useState)(!1),[u,h]=(0,M.useState)(!1);return(0,i.jsxs)(Rb,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Qb,{returnPathFallback:ms.POSITIONS({organizationId:o,eventId:r})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.name}),(0,i.jsxs)(Ib,{permissions:xb.POSITION_EDIT,scope:{positionCategoryId:e.id},children:[(0,i.jsx)(jl,{color:"white",onClick:()=>h(!0),children:n("_diter_62574")}),(0,i.jsx)(jl,{onClick:()=>{s.push(Os.CREATE_POSITION(o,r,e.id))},children:n("ajouter_une_mis_99800")})]}),a&&(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsx)(Ld,{icon:"copy",onClick:async()=>{const{positionCategoryDuplicate:{id:t}}=await l({eventId:r,positionCategoryId:e.id});s.push(ms.POSITION_CATEGORY({organizationId:o,eventId:r,positionCategoryId:t}))},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})]})]}),u&&(0,i.jsx)(HV,{eventId:r,positionCategoryId:e.id,positionCategoryName:e.name,onClose:()=>{h(!1)},onSuccess:t}),d&&(0,i.jsx)(TW,{eventId:r,positionCategory:e,onClose:()=>{c(!1)},onSuccess:()=>{s.replace(ms.POSITIONS({organizationId:o,eventId:r}))}})]})},OW=({event:e,reload:t})=>{const{translate:n,params:{organizationId:s,eventId:o,positionCategoryId:r}}=cl(),a=Jn(),{updateLocalEvent:l}=Jv();Td(e.positionCategory.name),(0,M.useEffect)(()=>{l({positionBackPath:a.pathname})},[]);const d=e=>({organizationId:e?":organizationId":s,eventId:e?":eventId":o,positionCategoryId:e?":positionCategoryId":r});return(0,i.jsxs)($b,{children:[(0,i.jsx)(zW,{category:e.positionCategory,reload:t}),(0,i.jsxs)(Mb,{css:{flex:"1"},children:[(0,i.jsxs)(Pb,{css:{px:"$7"},children:[(0,i.jsx)(Db,{path:ms.POSITION_CATEGORY_DASHBOARD(d(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(Db,{path:ms.POSITION_CATEGORY_MEMBERS(d(!1)),children:n("membres_125561",e.volunteersRegistrations.totalCount)}),(0,i.jsx)(Db,{path:ms.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!1)),children:n("membres_pr_aff_93093",e.positionCategory.preassignedResources)})]}),(0,i.jsx)(Fb,{path:ms.POSITION_CATEGORY_DASHBOARD(d(!0)),children:(0,i.jsx)(EW,{positionCategory:e.positionCategory,reload:t})}),(0,i.jsx)(Fb,{path:ms.POSITION_CATEGORY_MEMBERS(d(!0)),children:(0,i.jsx)(bW,{positionCategoryId:r})}),(0,i.jsx)(Fb,{path:ms.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!0)),children:(0,i.jsx)(bW,{preassignedPositionCategoryId:r})})]})]})},RW=()=>{const{params:{organizationId:e,eventId:t,positionCategoryId:n}}=cl(),{data:s,loader:o,reload:r}=Yn("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},[Ms.LeaderInfosFragment]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:ms.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(ei,{path:ms.POSITION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,positionCategoryId:n}),replace:!0})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(OW,{event:s.event,reload:r})})]})},$W=e=>(0,i.jsx)(zm,{category:e.popup.category,fallbackClosePath:e.closePath,title:e.popup.title,children:(0,i.jsxs)(Ra,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ra,{css:{background:"$gray50",flex:"1",overflow:"auto",py:"$9"},justify:"center",children:(0,i.jsx)(Ra,{css:{height:"fit-content",overflow:"hidden"},direction:"column",width:1170,children:e.children})}),(0,i.jsx)(Ra,{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})]})}),DW=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,positionId:o,positionSlotId:r}}=cl(),a=Gn(Wc),[l,d]=WT("positionsSlotsAssignVolunteers.filterAvailabilities",!0),[c,u]=WT("positionsSlotsAssignVolunteers.filterPositions",!1),[h,g]=WT("positionsSlotsAssignVolunteers.applyConditions",!0),[p,f]=(0,M.useState)(null),{data:x,isLoading:_}=Yn("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:s,positionSlotId:r,filterAvailabilities:l,filterPositions:c,applyConditions:h,sort:p},[]),{mutate:I,isLoading:v}=Yo(),[b,j]=(0,M.useState)(""),C=(0,M.useMemo)(()=>{const e=x.event?.positionSlot.availableVolunteersRegistrations??[];return m(b)?e.filter(e=>e.userInfo.name.toLowerCase().includes(b.toLowerCase())||e.userInfo.email.includes(b.toLowerCase())):e},[x.event,b]),{numberOfSelected:y,selectAllState:k,states:A,setStates:w,toggleRow:S,toggleSelectAll:E}=Iu({}),T=(0,M.useMemo)(()=>(h?1:0)+(l?1:0)+(c?1:0),[h,l,c]);return(0,M.useEffect)(()=>{w(Object.fromEntries((x.event?.positionSlot.availableVolunteersRegistrations??[]).map(e=>[`ui${e.userInfo.id}`,{id:e.userInfo.id,state:e.isAssignedTo?"checked":"unchecked"}])))},[x.event]),(0,i.jsx)($W,{button:(0,i.jsx)(jl,{isLoading:v,to:ms.POSITION({organizationId:n,eventId:s,positionId:o}),onClick:async()=>{const e=(x.event?.positionSlot.availableVolunteersRegistrations??[]).flatMap(e=>e.isAssignedTo?[e.userInfo.id]:[]),t=Object.values(A).filter(({state:e})=>"checked"===e).map(({id:e})=>e),n=(0,oc.A)(t,e),i=(0,oc.A)(e,t);eo(n)&&await I({eventId:s,massAssign:{positionsSlotsIds:[r],selecteds:{ids:n},strategy:Qe.Add}}),eo(i)&&await I({eventId:s,massAssign:{positionsSlotsIds:[r],selecteds:{ids:i},strategy:Qe.Delete}})},children:0===y?t("ne_pas_affecter_05756"):t("affecter_1_me_46721",y)}),closePath:ms.POSITION({organizationId:n,eventId:s,positionId:o}),popup:{category:t("affectation_u_96975",x.event?.positionSlot.positionName??""),title:x.event?.positionSlot.nameOrRange??""},children:(0,i.jsx)(Oc,{filters:(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),value:b,onChange:j})}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"gray",leftIcon:"sliders",children:t("filtres_1_41774",T)})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Ra,{css:{padding:"$4 $6"},direction:"column",width:440,children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("disponibilit_s_49923")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(hc,{state:l?"unchecked":"checked",onClick:e=>{d("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:l?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:t("filtrer_selon_l_35857")}),(0,i.jsx)(Wu,{height:"4"}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("missions_63972")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(hc,{state:c?"unchecked":"checked",onClick:e=>{u("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:c?"checked":"unchecked",onClick:e=>{u("checked"===e)},children:t("filtrer_selon_l_42798")}),(0,i.jsx)(Wu,{height:"4"}),(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("conditions_77756")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(hc,{state:h?"unchecked":"checked",onClick:e=>{g("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:h?"checked":"unchecked",onClick:e=>{g("checked"===e)},children:t("filtrer_selon_l_59697")})]})})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(lc,{state:k,onClick:E})}),(0,i.jsx)(mm,{attribute:$t.Name,css:{paddingLeft:"$2",flexGrow:2},setSort:f,sort:p,children:t("nom_du_membre_69353")}),(0,i.jsx)(Fc,{children:t("nombre_d_affect_31455")}),(0,i.jsx)(mm,{attribute:$t.InsertedAt,setSort:f,sort:p,children:t("date_d_inscript_31369")})]}),limit:C.length,numberOfPages:1,offset:0,rows:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):C.map(t=>(0,i.jsxs)(Tc,{css:{cursor:"pointer",userSelect:"none"},onClick:()=>{e.push(Os.POSITION_SLOT_ASSIGN_VOLUNTEERS_USER_INFORMATIONS(n,s,o,r,t.userInfo.id))},children:[(0,i.jsx)(yc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(lc,{state:A[`ui${t.userInfo.id}`]?.state??"unchecked",onClick:(e,n)=>{Al(n),S(`ui${t.userInfo.id}`,e)}})}),(0,i.jsx)(yc,{css:{paddingLeft:"$2",flexGrow:2},children:(0,i.jsx)(Ub,{userInfo:t.userInfo})}),(0,i.jsx)(yc,{children:t.numberOfAssignments}),(0,i.jsx)(yc,{children:a.toLocaleString(t.insertedAt.toLocal(),Zs.DateTime)})]},t.id)),setOffset:Hl.A,title:t("liste_des_membr_42505"),totalCount:C.length})})},PW=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=cl(),r=e.userInfo.volunteerRegistration?.delegation;return(0,i.jsx)(Zz,{forms:e.forms,getTabPath:e=>Os.EDIT_USER_ACCREDITATIONS_FORM(t,n,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Os.VOLUNTEERS(t,n),title:o("mise_jour_des_60902",e.userInfo.nameOrEmail),children:e.forms.map((o,a)=>(0,i.jsxs)(Fb,{path:Os.EDIT_USER_ACCREDITATIONS_FORM(t,n,s,o.id),children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(eT,{accreditationsSlotsIds:e.values.userInfo.accreditations[a].accreditationsSlotsIds,change:e.change,delegationAccreditations:r?.formId===o.id?r.accreditationsSlots:[],displayFormCustomFields:!1,event:e.event,options:{...o,showFullAccreditation:!0,slotDisplay:pt.Hide,accreditationFilter:gt.None},prefix:`userInfo.accreditations[${a}].`,showAutoAccredit:!1,slots:[],userInfosFields:e.userInfo.fields})]},o.id))})},FW=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=cl(),r=Gn(WE),{mutate:a,isLoading:l}=function(e={}){return Kn("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,M.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)(fl,{direction:"column",height:1,initialValues:{userInfo:{accreditations:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(PW,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoAccreditations:e.userInfo.accreditations}),t.goBack(Os.VOLUNTEERS(n,s))}})},MW=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Zn(),{data:s,loader:o}=Yn("query UserUpdateAccreditationsInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $loadDelegation: Boolean!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...MemberRegistrationUserInfo\n ...FormsUsersInfosWished\n\n volunteerRegistration(eventId: $eventId) @include(if: $loadDelegation) {\n delegation {\n formId\n\n accreditationsSlots {\n ...DelegationAccreditationSlot\n }\n }\n }\n }\n }\n\n event(id: $eventId) {\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n,loadDelegation:!0},[Ms.MemberRegistrationUserInfoFragment,Ms.FormsUsersInfosWishedFragment,Ms.DelegationAccreditationSlotFragment,Ms.FormMemberRegistrationFragment,Ms.FormRegisterAccreditationCategoryFragment]),r=(0,M.useMemo)(()=>{if(s.organization&&s.event){const e=s.organization.userInfo.volunteerRegistration;return s.event.forms.nodes.filter(t=>t.accreditationDisplay!==ut.None||e.delegation?.formId===t.id&&eo(e.delegation.accreditationsSlots))}return[]},[s.organization,s.event]);return o||(eo(r)?(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.EDIT_USER_ACCREDITATIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(FW,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.EDIT_USER_ACCREDITATIONS_FORM(e,t,n,r[0].id),replace:!0})})]}):(0,i.jsx)(ei,{}))},NW=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=cl();return(0,i.jsx)(Zz,{forms:e.forms,getTabPath:e=>Os.EDIT_USER_MISSIONS_FORM(t,n,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Os.VOLUNTEERS(t,n),title:o("mise_jour_des_02859",e.userInfo.nameOrEmail),children:e.forms.map((o,r)=>(0,i.jsxs)(Fb,{path:Os.EDIT_USER_MISSIONS_FORM(t,n,s,o.id),children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(gT,{change:e.change,event:e.event,options:{...o,showFullPosition:!0,slotDisplay:pt.Hide,positionFilter:gt.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})]},o.id))})},LW=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=cl(),r=Gn(WE),{mutate:a,isLoading:l}=function(e={}){return Kn("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,M.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)(fl,{direction:"column",height:1,initialValues:{userInfo:{missions:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(NW,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoPositions:e.userInfo.missions}),t.goBack(Os.VOLUNTEERS(n,s))}})},BW=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Zn(),{data:s,loader:o}=Yn("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},[Ms.MemberRegistrationUserInfoFragment,Ms.FormsUsersInfosWishedFragment,Ms.FormMemberRegistrationFragment,Ms.FormRegisterCategoryFragment]),r=(0,M.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.positionDisplay!==mt.None),[s.event]);return o||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.EDIT_USER_MISSIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(LW,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.EDIT_USER_MISSIONS_FORM(e,t,n,r[0].id),replace:!0})})]})},VW=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=cl();return(0,i.jsx)(Zz,{forms:e.forms,getTabPath:e=>Os.EDIT_USER_SLOTS_FORM(n,s,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Os.VOLUNTEERS(n,s),title:t("mise_jour_des_28904",e.userInfo.nameOrEmail),children:e.forms.map((t,r)=>(0,i.jsxs)(Fb,{path:Os.EDIT_USER_SLOTS_FORM(n,s,o,t.id),children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(kT,{change:e.change,currentSlots:e.values.userInfo.slots[r].slots,customSlotsPeriods:t.customSlotsPeriods,daysDisplay:t.daysDisplay,event:e.event,prefix:`userInfo.slots[${r}].`,slotDisplay:t.slotDisplay})]},t.id))})},UW=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=cl(),r=Gn(WE),{mutate:a,isLoading:l}=function(e={}){return Kn("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,M.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)(fl,{direction:"column",height:1,initialValues:{userInfo:{slots:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(VW,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoSlots:e.userInfo.slots}),t.goBack(Os.VOLUNTEERS(n,s))}})},WW=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Zn(),{data:s,loader:o}=Yn("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},[Ms.MemberRegistrationUserInfoFragment,Ms.FormsUsersInfosWishedFragment,Ms.FormMemberRegistrationFragment]),r=(0,M.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==pt.Hide),[s.organization,s.event]),{permissions:[a],isLoading:l}=Vy(Fy({eventId:t,userInfoId:n})),d=Xn();return l||a||d.push(Os.DASHBOARD(e,t)),o||l?o:(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.EDIT_USER_SLOTS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(UW,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.EDIT_USER_SLOTS_FORM(e,t,n,r[0].id),replace:!0})})]})},GW=()=>{const{params:{eventId:e}}=cl(),{columns:t,columnsSearch:n,infos:s,isEditMode:o,limit:r,nameDebounced:a,offset:l,predicates:d,rendering:c,setInfos:u,setLimit:h,setOffset:g}=HC(),p=(0,M.useMemo)(()=>({...Lh(t,c),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[t,c]),{mutate:f}=vo(),{data:x,isLoading:_}=Yn("query VolunteersAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:e},[Ms.AccreditationSlotMatrixFragment]),{data:I,isLoading:v}=tr({...p,eventId:e,predicates:d,name:m(a)?a:null,columnsSearch:eo(n)?n:void 0,limit:r,offset:l}),{numberOfPages:b,totalCount:j}=vu(I.data?.rows),[C,y]=(0,M.useState)([]),[k,A]=(0,M.useState)({}),w=(0,M.useMemo)(()=>s.volunteersMatrixSelectedSlotsIds||[],[s]),S=(0,M.useCallback)(e=>u({...s,volunteersMatrixSelectedSlotsIds:e}),[s,u]),E=(0,M.useCallback)(async t=>{A(e=>({...e,[t]:!0}));const{data:{row:n}}=await er({...p,eventId:e,id:t},await q());y(e=>e.map(e=>e.id===t?n:e)),A(e=>({...e,[t]:!1}))},[p,A,y]),T=(0,M.useCallback)(e=>k[e]??!1,[k]),z=(0,M.useCallback)((t,n)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:Qe.Add}}),[e,f]),O=(0,M.useCallback)((t,n)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:Qe.Delete}}),[e,f]);return(0,M.useEffect)(()=>{y(I.data?.rows.nodes??[])},[I.data]),(0,i.jsx)(vA,{addAccreditationSlot:z,allAccreditationsSlots:x.event?.accreditationsSlots.nodes??[],deleteAccreditationSlot:O,editMode:"assigned",isEditMode:o,isLoading:v||_,isRowLoading:T,limit:r,members:C,numberOfPages:b,offset:l,reloadRow:E,selectedSlotsIds:w,setLimit:h,setOffset:g,setSelectedSlotsIds:S,totalCount:j})},HW=e=>{const{translate:t,params:{eventId:n}}=cl(),{mutate:s}=function(e={}){return Kn("mutation VolunteerRegistrationDuplicate(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $numberOfCopies: Int!\n) {\n volunteerRegistrationDuplicate(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n numberOfCopies: $numberOfCopies\n )\n}\n",e)}(),[o,r]=(0,M.useState)(1),[a,l]=(0,M.useState)(!1);return(0,i.jsx)(ub,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"clone",children:t("dupliquer_un_me_90016")}),(0,i.jsx)(lb,{children:(0,i.jsx)(Ol,{label:t("nombre_de_copie_37518"),min:1,shouldParseAsInt:!0,value:o,onChange:r})}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{isLoading:a,onClick:async()=>{l(!0),await s({eventId:n,volunteerRegistrationId:e.volunteerRegistrationId,numberOfCopies:o}),e.onClose(),e.reload()},children:t("dupliquer_1_94438",e.name)})})]})})},qW=({eventId:e,organizationId:t,reload:n,reloadRow:s,volunteerRegistration:o})=>{const{history:r,translate:a}=cl(),{hasFeature:l}=_I(),{event:d,isEventAdmin:c}=Jv(),{canMemberAssign:u,canMemberAssignmentStateEdit:h,canMemberAccredit:m,canMemberCreate:g,canMemberDelete:p}=lS(),{showNotification:f}=ib(),x=o.state,_=o.accreditationState,{mutate:I,isLoading:v}=Zo(),{mutate:b,isLoading:j}=qo(),{mutate:C}=$o(),{mutate:y}=No(),k=h&&x!==Ot.WaitingAssignment,A=h&&x!==Ot.Refused,w=h&&(x===Ot.WaitingAssignment||x===Ot.Assigned),S=u&&x===Ot.Assigned,E=u&&x===Ot.PreAssigned,T=u&&x===Ot.WaitingAssignment,z=m&&_!==re.WaitingAccreditation,O=m&&_!==re.Refused,R=m&&(_===re.WaitingAccreditation||_===re.Accredited||_===re.AutoAccredited),$=m&&(_===re.Accredited||_===re.AutoAccredited),D=m&&_===re.WaitingAccreditation,[P,F]=(0,M.useState)(!1),[N,L]=(0,M.useState)(!1),[B,V]=(0,M.useState)(!1),U=c&&d.useDelegations&&l(Fe.Delegation)&&o.delegation,W=g,G=p&&o.canDelete,H=(u||h)&&m&&(U||W||G);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(u||h)&&(0,i.jsxs)(i.Fragment,{children:[k&&(0,i.jsx)(Ld,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Ot.WaitingAssignment}}),s())},children:a("changer_le_stat_90266")}),A&&(0,i.jsx)(Ld,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Ot.Refused}}),s())},children:a("changer_le_stat_68392")}),w&&(0,i.jsx)(Ld,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Ot.NotApplicable}}),s())},children:a("changer_le_stat_62507")}),S&&(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{v||r.push(Os.EDIT_ASSIGNMENT(t,e,o.userInfo.id))},children:a("_diter_les_affe_42283")}),E&&(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{v||r.push(Os.PRE_ASSIGNMENT(t,e,o.userInfo.id))},children:a("_diter_les_pr_10213")}),T&&(0,i.jsx)(Ld,{icon:"wand-magic-sparkles",onClick:()=>{v||r.push(Os.ASSIGNMENT(t,e,o.userInfo.id))},children:a("affecter_94255")})]}),(u||h)&&m&&(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),m&&(0,i.jsxs)(i.Fragment,{children:[z&&(0,i.jsx)(Ld,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:re.WaitingAccreditation}}),s())},children:a("change_le_statu_93385")}),O&&(0,i.jsx)(Ld,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:re.Refused}}),s())},children:a("changer_le_stat_68392")}),R&&(0,i.jsx)(Ld,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:re.NotApplicable}}),s())},children:a("changer_le_stat_62507")}),$&&(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{j||r.push(Os.EDIT_ACCREDIT(t,e,o.userInfo.id))},children:a("_diter_les_accr_86042")}),D&&(0,i.jsx)(Ld,{icon:"badge-check",onClick:()=>{j||r.push(Os.ACCREDIT(t,e,o.userInfo.id))},children:a("accr_diter_70543")})]}),H&&(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),W&&(0,i.jsx)(Ld,{icon:"clone",onClick:()=>F(!0),children:a("dupliquer_28256")}),U&&(0,i.jsx)(Ld,{color:"red",icon:"minus",onClick:()=>{L(!0)},children:a("retirer_de_la_d_64963")}),G&&(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{V(!0)},children:a("d_sinscrire_de_06416")})]}),W&&P&&(0,i.jsx)(HW,{name:o.userInfo.nameOrEmail,reload:n,volunteerRegistrationId:o.id,onClose:()=>F(!1)}),U&&N&&(0,i.jsx)(Pk,{buttonText:a("retirer_de_la_d_64963"),subtext:[a("_tes_vous_sur_d_34901",o.delegation.name)],text:a("suppression_de_73669",o.userInfo.name),onClose:()=>{L(!1)},onDelete:async()=>{await C({organizationId:t,eventId:e,delegationId:o.delegation.id,selecteds:{ids:[o.userInfo.id]}}),f(a("_1_a_t_retir_36729",o.userInfo.name,o.delegation.name)),s()}}),p&&B&&(0,i.jsx)(Pk,{buttonText:a("d_sinscrire_de_06416"),subtext:[a("_tes_vous_sur_d_79932")],text:a("suppression_de_73669",o.userInfo.name),onClose:()=>{V(!1)},onDelete:async()=>{await y({eventId:e,selecteds:{ids:[o.userInfo.id]}}),f(a("_1_a_t_d_sin_66177",o.userInfo.name)),n()}})]})},YW=({columns:e,customFields:t,eventId:n,organizationId:s,reload:o,reloadVolunteer:r,segmentId:a,state:l,toggleRow:d,volunteerRegistration:c})=>{const{translate:u}=cl(),{isEventAdmin:h,hasPermission:m}=Jv(),{canMemberAccredit:g,canMemberAssign:p,canMemberAssignmentStateEdit:f,canMemberCreate:x,canMemberDelete:_,canMemberEdit:I}=lS(),v=UC(t),b=(0,M.useCallback)(()=>{r(c.id)},[c,r]),j=I||p||g,C=x||_||g||p||f,y=c.userInfo,k=Os.VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS(s,n,a,y.id),A=Os.VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES(s,n,a,y.id),w=Os.VOLUNTEERS_LIST_USER_PANEL_POSITIONS(s,n,a,y.id),S=(c.teams||[]).map(e=>Os.VOLUNTEERS_LIST_USER_PANEL_TEAM(s,n,a,y.id,e.teamCode));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{background:"checked"===l?"$primary100":"white","&:hover":{background:"checked"===l?"$primary100":"$gray100"}},onMouseLeave:e=>$d(e.target),children:[j&&(0,i.jsx)(yc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:l,onClick:(e,t)=>{Al(t),d(`ui${y.id}`,e)}})}),e.map(e=>{const t=v.get(e.slug);return(0,i.jsx)(Qy,{accreditationsPanelPath:k,availabilitiesPanelPath:A,canAccredit:h,canAssign:h,canChangeDelegation:h,canClickMemberName:!0,column:e,customField:t,eventId:n,positionsPanelPath:w,reloadRow:b,row:c},e.slug)}),C&&(0,i.jsxs)(Uc,{justify:"center",children:[(y.isEditable??!0)&&(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",to:Os.EDIT_USER(s,n,c.userInfo.id)})})}),(0,i.jsx)(_m,{placement:"top",children:u("_diter_62574")})]}),(0,i.jsx)(qW,{eventId:n,organizationId:s,reload:o,reloadRow:b,volunteerRegistration:c})]})]}),(0,i.jsx)($k,{accreditationsPanelPath:k,availabilitiesPanelPath:A,canAccredit:h,canCheckIn:(e,t)=>m(xb.POSITION_READ,{positionCategoryId:e,positionId:t}),canDeletePosition:(e,t)=>m(xb.MEMBER_ASSIGN,{positionCategoryId:e,positionId:t}),canEditWishedAccreditations:!1,defaultHiddenAccreditationsSlotsIds:[],eventId:n,organizationId:s,positionsPanelPath:w,reloadRow:b,returnPathFallback:Os.VOLUNTEERS(s,n),teamsPanelsPath:S,volunteerRegistration:c})]})},KW=(0,M.memo)(function(e){const{params:{organizationId:t,eventId:n,segmentId:s}}=cl(),{isEventAdmin:o}=Jv(),{canMemberAccredit:r,canMemberAssign:a,canMemberAssignmentStateEdit:l,canMemberCreate:d,canMemberDelete:c,canMemberEdit:u}=lS(),{columns:h,columnsSearch:g,limit:p,massActions:f,nameDebounced:x,offset:_,possibleColumns:I,predicates:v,reloadKey:b,rendering:j,setLimit:C,setOffset:y,setSort:k,sort:A}=HC(),w=(0,M.useMemo)(()=>({...Lh(h,j,{includeWeezeventUrls:!0}),includeCanRegistrationStateUpdate:!o,includeIsEditable:!o}),[h,j]),{data:S,isLoading:E,reload:T}=tr({...w,eventId:n,predicates:v,name:m(x)?x:null,columnsSearch:eo(g)?g:null,limit:p,offset:_,sort:A}),{numberOfPages:z,totalCount:O}=vu(S.data?.rows);(0,M.useEffect)(()=>{b>1&&T()},[b]);const R=(0,M.useMemo)(()=>h.flatMap(e=>(0,Va.A)([I.find(t=>t.slug===e)])),[I,h]),[$,D]=(0,M.useState)([]),[P,F]=(0,M.useState)({}),N=(0,M.useCallback)(async e=>{F(t=>({...t,[e]:!0}));const{data:{row:t}}=await er({...w,eventId:n,id:e},await q());D(n=>n.map(n=>n.id===e?t:n)),F(t=>({...t,[e]:!1}))},[w,F,D]),L=u||a||r,B=d||c||r||a||l;return(0,M.useEffect)(()=>{D(S.data?.rows.nodes??[])},[S.data]),(0,M.useEffect)(()=>{f.setStates(Object.fromEntries((S.data?.rows.nodes??[]).map(({userInfo:e})=>[`ui${e.id}`,{id:e.id,state:"unchecked"}])))},[S.data,f.setStates]),(0,i.jsx)(Ra,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(gm,{"aria-busy":E,headerRow:(0,i.jsxs)(xc,{children:[L&&(0,i.jsx)(Fc,{justify:"center",width:48,children:(0,i.jsx)(lc,{state:f.selectAllState,onClick:f.toggleSelectAll})}),R.map(e=>e.isSortable?(0,i.jsx)(mm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:k,sort:A,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Fc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(br,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),B&&(0,i.jsx)(Fc,{width:100})]}),paginationRow:(0,i.jsx)(zc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ec,{limit:p,numberOfPages:z,offset:_,setLimit:C,setOffset:y,showLimits:!0,totalCount:O})}),children:E?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{})]}):$.map(o=>P[o.id]?(0,i.jsx)(Mc,{},o.id):(0,i.jsx)(YW,{columns:R,customFields:e.customFields,eventId:n,organizationId:t,reload:T,reloadVolunteer:N,segmentId:s,state:f.states[`ui${o.userInfo.id}`]?.state??"unchecked",toggleRow:f.toggleRow,volunteerRegistration:o},o.id))})})}),ZW=e=>(0,i.jsx)(Ra,{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})}),XW=()=>{const{translate:e}=cl();return(0,i.jsx)(Ra,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",px:"$2"},height:1,width:1,children:(0,i.jsx)(br,{css:{ellipsis:!0},font:"gray800 textXs medium",textAlign:"center",width:1,children:e("disponible_69523")})})},JW=e=>{const t=Gn(ah),n=(0,M.useMemo)(()=>Kd(e.slot.position.color),[e.slot]),s=(0,M.useMemo)(()=>ph(t,e.slot.positionSlot,e.slot.position.name,{position:{includeName:!0},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(Ra,{align:"center",css:{background:n[50],borderRadius:"$1",color:n[700],cursor:"pointer",px:"$2"},height:1,width:1,children:(0,i.jsx)(br,{css:{ellipsis:!0},fontSize:"textXs",fontWeight:"medium",textAlign:"center",title:s,width:1,children:s})})}),(0,i.jsx)(Vd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(nW,{category:e.slot.positionCategory,position:e.slot.position,slot:e.slot.positionSlot})})]})},QW=e=>"assignment"===e.slot.type?(0,i.jsx)(JW,{slot:e.slot}):(0,i.jsx)(XW,{}),eG=e=>{const{translate:t,params:{eventId:n}}=cl(),{infos:s,limit:o,nameDebounced:r,offset:a,predicates:l,setInfos:d,setLimit:c,setOffset:u}=HC(),{data:h,loader:g}=Yn("query VolunteersPlanning(\n $eventId: EventId!\n $predicates: [Predicate!]!\n $name: String\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n rows: volunteersRegistrations(\n predicates: $predicates\n name: $name\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...DocumentUsersPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,predicates:l,name:m(r)?r:void 0,limit:o,offset:a},[Ms.DocumentUsersPlanningFragment]);const{numberOfPages:p,totalCount:f}=vu(h.data?.rows),x=(0,M.useMemo)(()=>s?.volunteersPlanningshowAvailabilities??!0,[s]),_=(0,M.useCallback)(e=>{d({...s,volunteersPlanningshowAvailabilities:e})},[s,d]),I=(0,M.useMemo)(()=>(h.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>x?[{type:"availability",range:e.range}]:[]).concat(e.positionsSlotsUsersInfos.map(e=>({type:"assignment",range:e.positionSlot.range,positionCategory:e.positionCategory,position:e.position,positionSlot:e.positionSlot})))})),[h.data,x]),v=(0,M.useMemo)(()=>Bs.c9.isDateTime(s.volunteersPlanningStartAt)&&s.volunteersPlanningStartAt?.isValid?s.volunteersPlanningStartAt:Bs.c9.fromISO(s.volunteersPlanningStartAt)?.isValid?Bs.c9.fromISO(s.volunteersPlanningStartAt,{zone:"utc"}):Bs.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Bs.c9.utc())?Bs.c9.utc():e.startAt,[e.startAt,e.endAt,s]),b=(0,M.useCallback)(t=>{d({...s,volunteersPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,s,d]),j=(0,M.useMemo)(()=>{const t=gh(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]);return g||(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Ra,{css:{background:"white",flex:"1"},children:(0,i.jsx)(eW,{data:I,date:v,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(br,{width:40,children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{color:"white",leftIcon:x?"eye":"eye-slash",onClick:()=>_(!x)})}),(0,i.jsx)(_m,{placement:"top",children:t(x?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(ZW,{vr:e}),renderSlot:e=>(0,i.jsx)(QW,{slot:e}),showPlus:!1,startHour:j,onChange:b})}),(0,i.jsx)(zc,{children:(0,i.jsx)(Ec,{limit:o,numberOfPages:p,offset:a,setLimit:c,setOffset:u,showLimits:!0,totalCount:f})})]})},tG=()=>(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},children:[(0,i.jsx)(lc,{shouldPreventDefault:!1,state:"unchecked",onClick:Hl.A}),(0,i.jsx)(Ba,{width:"3"}),(0,i.jsx)(ec,{size:40,variant:"circular"}),(0,i.jsx)(Ba,{width:"4"}),(0,i.jsxs)(Ra,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(ec,{borderRadius:"$1",height:12,width:1}),(0,i.jsx)(ec,{borderRadius:"$1",height:12,width:1})]})]}),nG=e=>{const{data:t,isLoading:n}=ba({organizationId:e.organizationId,excludedEventId:e.eventId,name:m(e.nameOrEmail)?e.nameOrEmail:null});return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tG,{}),(0,i.jsx)(tG,{}),(0,i.jsx)(tG,{})]}):(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)(vw,{state:n,userInfo:t,onClick:()=>{e.select(t.id)}},t.id)})})},iG=e=>{const t=Hn(),n=Gn(WE),s=Gn(Da),[o,r,a]=Pc(""),{mutate:l,isLoading:d}=ja();return(0,i.jsx)(fl,{hideDefaultErrors:!0,initialValues:{usersInfosIds:[],sendVolunteerRegistrationEmail:!1},render:({form:n,handleSubmit:s,values:l})=>(0,i.jsxs)(Qc,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(br,{color:"gray800",css:{height:"56px",textAlign:"center"},children:(0,i.jsx)("img",{alt:"Avatars",height:"100%",src:dd.AvatarGroup})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("ajouter_un_memb_33261")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:t("ajouter_un_ou_d_44771")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),value:o,onChange:a}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(hl,{}),(0,i.jsx)(Ra,{css:{flex:"1",overflowY:"auto"},direction:"column",children:(0,i.jsx)(nG,{eventId:e.eventId,nameOrEmail:r,organizationId:e.organizationId,select:e=>{n.change("usersInfosIds",io(l.usersInfosIds,e))},usersInfosIds:l.usersInfosIds})}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)($m,{name:"sendVolunteerRegistrationEmail",children:t("envoyer_l_e_mai_35622")}),(0,i.jsx)(jl,{isLoading:d,onClick:s,children:t("ajouter_97327")}),(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]}),validate:s.validateForForm(n.adminAddSchema()),onSubmit:async t=>{await l({eventId:e.eventId,usersInfosIds:t.usersInfosIds,sendVolunteerRegistrationEmail:t.sendVolunteerRegistrationEmail}),e.reload(),e.onClose()}})},sG=({reload:e})=>{const{params:{organizationId:t,eventId:n,segmentId:s},translate:o}=cl(),{user:r}=ni(),{canMemberCreate:a}=dS(),{canMemberCreate:l}=lS(),{segment:d,columns:c}=HC(),{mutate:u}=function(e={}){return Kn("mutation VolunteersExport(\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $includeFiles: Boolean!\n $columns: [String!]!\n) {\n jobId: volunteersExport(\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n includeFiles: $includeFiles\n columns: $columns\n )\n}\n",e)}(),{data:h,isLoading:m}=Yn("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:s},[]),[g,p]=(0,M.useState)(!1),[f,x]=(0,M.useState)(!1),[_,I]=(0,M.useState)(!1),{checkExport:v}=ib();return(0,i.jsxs)(RR,{children:[l&&(0,i.jsx)(wS,{menu:(0,i.jsxs)(i.Fragment,{children:[a&&(0,i.jsx)(Ld,{icon:"user-group",onClick:e=>{$d(e.target),p(!0)},children:o("ajouter_des_mem_06922")}),(0,i.jsx)(Ld,{icon:"file-import",to:Os.EVENT_VOLUNTEERS_IMPORT(t,n),onClick:e=>$d(e.target),children:o("importer_via_un_61623")})]}),path:BI.CREATE({organizationId:t,eventId:n}),children:o("ajouter_un_memb_33261")}),(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[(0,i.jsxs)(Ib,{permissions:xb.POSITION_EDIT,children:[(0,i.jsx)(Ld,{icon:"plug-circle-bolt",onClick:e=>{$d(e.target),x(!0)},children:o("exporter_via_l_09843")}),(0,i.jsx)(Ld,{icon:"file-xls",onClick:e=>{$d(e.target),I(!0)},children:o("exporter_en_exc_51862")})]}),(0,i.jsx)(Ld,{download:`${d.name}-users-listing`,icon:"arrow-down-to-bracket",to:rg(h.event?.segment.links.usersListingLink,"pdf",{lang:r?.language}),children:o("t_l_charger_en_59616")}),(0,i.jsx)(Ib,{rolesTypes:cI,children:(0,i.jsx)(Ld,{icon:"file-import",to:Os.EVENT_FILES_IMPORT(t,n),children:o("importer_des_do_55420")})})]})]}),g&&(0,i.jsx)(iG,{eventId:n,organizationId:t,reload:e,onClose:()=>{p(!1)}}),!m&&(0,i.jsx)(M$,{isOpen:f,link:og({organizationId:t,eventId:n,lang:r?.language,pathComponent:`volunteers/${s}`,key:h.event.key}),onClose:()=>{x(!1)}}),(0,i.jsx)(N$,{isOpen:_,requestExport:async(e,i)=>{const{jobId:s}=await u({eventId:n,segmentId:d.id,format:e,includeFiles:i,columns:c});v(t,n,s)},showIncludeFiles:!0,onClose:()=>{I(!1)}})]})},oG=(0,M.memo)(function(e){const t=Hn(),{hasPermission:n}=Jv(),{limit:s,massActions:o,onMassEditSuccess:r,predicates:a,reloadKey:l,rendering:d,segment:c,setReloadKey:u}=HC(),h=n(xb.SEGMENT_EDIT)&&d===Ph.List,m=n(xb.MEMBER_EDIT)&&d===Ph.List||n(xb.MEMBER_ACCREDIT)&&d===Ph.AccreditationsMatrix;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sG,{reload:()=>{u(l+1)}}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(OR,{searchRow:(0,i.jsx)(TR,{actions:(0,i.jsx)(QF,{massActions:o,predicates:a,showOnlyMassEdit:!1,totalNumberOfMembers:c.count,onMassEditSuccess:r}),searchPlaceholder:t("rechercher_un_m_05904"),showActions:n(xb.MEMBER_EDIT),showEditColumns:h,showEditMode:m,showSearchColumns:n(xb.SEGMENT_EDIT)}),selectSegment:(0,i.jsx)(QR,{pageSelectedText:t("les_1_membres_00895",s),segmentSelectedText:t("les_1_membres_56748",c.count,c.name)})}),n(xb.ACCREDITATION_READ)&&d===Ph.AccreditationsMatrix?(0,i.jsx)(GW,{}):d===Ph.Calendar?(0,i.jsx)(eG,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt}):(0,i.jsx)(KW,{customFields:e.customFields})]})]})}),rG=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=cl(),{hasFeature:a}=_I(),{event:l,hasPermission:d,isEventReader:c,localEvent:u,updateLocalEvent:h}=Jv(),m=Gn(Bh),g=(0,M.useMemo)(()=>m.getVolunteersFilters(s,o,r,e.organization.customFields.nodes,e.event,{hasAccreditations:l.useAccreditations&&a(Fe.Accreditation),hasCampaigns:l.useCampaigns,hasDelegations:l.useDelegations&&a(Fe.Delegation),hasForms:l.useForms,hasPositions:l.usePositions,isWeezeventConnected:e.event.isWeezeventConnected}),[o,r,e.organization,e.event]),p=(0,M.useMemo)(()=>m.getVolunteersPossibleColumns(e.organization.customFields.nodes,e.event.forms.nodes,{hasAccreditations:l.useAccreditations&&a(Fe.Accreditation),hasCampaigns:l.useCampaigns,hasDelegations:l.useDelegations&&a(Fe.Delegation),hasForms:l.useForms,hasPositions:l.usePositions,isWeezeventConnected:e.event.isWeezeventConnected}),[l,e.organization,e.event]);return(0,i.jsx)(wR,{canEditSegments:d(xb.SEGMENT_EDIT),eventId:o,filters:g,filtersButtonText:n("filtrer_les_mem_47149"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>Os.VOLUNTEERS_SEGMENT(s,o,e),initialLimit:u?.volunteersLimit??kc,initialSegmentsOpen:u?.areVolunteersSegmentsOpen??!0,organizationId:s,possibleColumns:p,possibleRenderings:c?[Ph.List,Ph.Calendar,Ph.AccreditationsMatrix]:[Ph.List,Ph.Calendar],reload:e.reload,segmentId:r,segmentType:_t.Volunteers,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{h({volunteersLimit:e})},onSegmentClick:e=>{h({volunteersSegmentId:e})},onSegmentDelete:async()=>{await h({volunteersSegmentId:null}),t.replace(Os.VOLUNTEERS(s,o))},onSegmentsToggle:async e=>{await h({areVolunteersSegmentsOpen:e})},children:(0,i.jsx)(oG,{customFields:e.organization.customFields.nodes,event:e.event})})},aG=(0,M.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=cl(),{event:{name:s},localEvent:o}=Jv();Td(`${s} ${n("membres_11310")}`);const{data:r,loader:a,reload:l}=Xo({organizationId:e,eventId:t,privacy:pe.All,loadForms:!0,loadSegments:!0}),d=(0,M.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(rG,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.VOLUNTEERS_SEGMENT(e,t,o?.volunteersSegmentId&&d.includes(o?.volunteersSegmentId)?o.volunteersSegmentId:d[0]),replace:!0})})]})}),lG=hr(Ra,{variants:{active:{true:{color:"$blue600"}}}}),dG=({children:e,path:t,text:n,eventId:s})=>{const o=Jn(),r=null!==(0,Cr.B6)(o.pathname,{path:t}),a=Zn(),l=Xn();return(0,i.jsxs)(lG,{active:r,align:"center",direction:"column",onClick:()=>{!1===r&&l.push((0,Cr.tW)(t,{...a,eventId:a.eventId||s}))},children:[(0,i.jsx)(br,{children:e(r)}),(0,i.jsx)(br,{fontSize:"textXs",children:n})]})},cG=hr("i",{fontSize:"18px"}),uG=({active:e,className:t})=>(0,i.jsx)(cG,{className:`${e?"fa-solid":"fa-regular"} ${t}`}),hG=hr(Ra,{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)"}),mG=({user:e,eventId:t})=>{const n=Hn();return(0,i.jsxs)(hG,{justify:"evenly",children:[(0,i.jsx)(dG,{eventId:t,path:Os.DASHBOARD(":organizationId",":eventId"),text:n("accueil_70474"),children:e=>(0,i.jsx)(uG,{active:e,className:"fa-house"})}),(0,i.jsx)(dG,{eventId:t,path:Os.VOLUNTEERS(":organizationId",":eventId"),text:n("membres_11310"),children:e=>(0,i.jsx)(uG,{active:e,className:"fa-user-group"})}),(0,i.jsx)(dG,{eventId:t,path:ms.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),text:n("missions_63972"),children:e=>(0,i.jsx)(uG,{active:e,className:"fa-sitemap"})}),(0,i.jsx)(dG,{eventId:t,path:Os.ORGANIZATION_PARAMETERS(":organizationId"),text:n("profil_14444"),children:()=>(0,i.jsx)(qg,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:24})})]})},gG=({children:e,user:t,eventId:n})=>(0,i.jsxs)(Ra,{css:{height:"100%"},direction:"column",children:[(0,i.jsx)(br,{css:{flex:1,overflow:"auto"},children:e}),(0,i.jsx)(mG,{eventId:n,user:t})]}),pG=({header:e,value:t})=>(0,i.jsxs)(Ra,{css:{bd:!0,padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(br,{color:"gray500",fontSize:"textSm",fontWeight:"medium",children:e}),(0,i.jsx)(br,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:t})]}),fG=({position:e})=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=cl();return(0,i.jsx)(Tc,{css:{cursor:"pointer"},onClick:()=>{t.push(ms.POSITION({organizationId:n,eventId:s,positionId:e.id}))},children:(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(br,{color:"gray700",css:{flex:"1"},children:e.name}),(0,i.jsx)(br,{color:"gray700",children:o("_1_2_membres_04485",e.assignedResources,e.resources)})]}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)(ow,{percent:e.assignedResources/e.resources})})]})})},e.id)},xG=hr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),_G=hr(Ya,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),IG=hr("h2",{fontSize:"$textMd",fontWeight:"$semiBold",margin:0}),vG=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=cl(),o=Gn(Kg),{isEventAdmin:r,hasPermission:a}=Jv(),{data:l,loader:d}=Yn("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:s},[]),c=(0,M.useMemo)(()=>l.event?(0,ic.A)(l.event.positionsCategories,e=>e.name.toLowerCase()):[],[l.event]),u=()=>{e.push(Os.DASHBOARD_EVENT_SWITCH(n,s))};if(d)return d;{const e=r||c.some(e=>a(xb.POSITION_READ,{positionCategoryId:e.id}));return(0,i.jsxs)(Ra,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ra,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(xG,{children:t("accueil_70474")}),(0,i.jsx)(_G,{icon:"arrow-down-arrow-up",onClick:u})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(IG,{children:l.event.name}),(0,i.jsx)(pG,{header:t("nombre_de_membr_60320",l.event.resources),value:l.event.resources}),(0,i.jsx)(pG,{header:t("nombre_de_missi_67304",l.event.positions.totalCount),value:l.event.positions.totalCount}),(0,i.jsx)(pG,{header:t("nombre_de_membr_87779",l.event.assigned.totalCount),value:l.event.assigned.totalCount}),(0,i.jsx)(pG,{header:t("nombre_de_membr_63555",l.event.waitingAssignment.totalCount),value:l.event.waitingAssignment.totalCount}),(0,i.jsx)(pG,{header:t("taux_de_remplis_11913"),value:`${0===l.event.resources?"0":Math.round(l.event.assignedResources/l.event.resources*100)}%`}),(0,i.jsx)(pG,{header:t("temps_de_b_n_vo_87924"),value:o.minutesToHoursMinutesString(l.event.volunteerMinutesNeeded)}),(0,i.jsx)(pG,{header:t("temps_de_b_n_vo_60725"),value:o.minutesToHoursMinutesString(l.event.volunteerMinutesAssigned)}),(0,i.jsx)(br,{css:{boxShadow:"$xs"},children:e?(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Fc,{children:t("cat_gories_24533")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:c.length>0?c.map(e=>(0,i.jsx)(AN,{category:e,clickable:!1,eventId:s,organizationId:n},e.id)):(0,i.jsx)(ek,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:Hl.A,title:t("liste_des_membr_59735"),totalCount:0}):(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Fc,{children:t("missions_63972")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:l.event.positions.nodes.map(e=>(0,i.jsx)(fG,{position:e},e.id))}),setOffset:Hl.A,title:t("liste_des_membr_57353"),totalCount:0})})]})]})}},bG=hr("div",{alignSelf:"flex-end",cursor:"pointer",padding:"$4 $6 $3 $6",i:{color:"$gray500"}}),jG=({onClose:e})=>(0,i.jsx)(bG,{onClick:e,children:(0,i.jsx)("i",{className:"fa-regular fa-xmark"})}),CG=hr(Ra,{overflowX:"hidden",overflowY:"auto"}),yG=hr(Ra,{background:"rgba(0, 0, 0, 0.7)",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),kG=hr(Ra,{background:"white",borderRadius:"20px 20px 0 0",marginTop:"44px",flex:"1",overflow:"auto"}),AG=({children:e,onClose:t})=>{const n=(0,Cr.W6)(),s=t??n.goBack;return Od(s),(0,i.jsx)(yG,{"data-testid":"overlay-backdrop",direction:"column",onClick:s,children:(0,i.jsxs)(kG,{"data-testid":"overlay-body",direction:"column",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(jG,{onClose:s}),(0,i.jsx)(CG,{direction:"column",children:e})]})})},wG=({event:e})=>{const t=Gn(Wc);return(0,i.jsx)(br,{children:(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray500"},children:[(0,i.jsx)(br,{width:25,children:(0,i.jsx)(Ya,{icon:"calendar"})}),(0,i.jsx)(br,{css:{flex:"1",ellipsis:!0},children:O_(t,e.startAt,e.endAt)})]})})},SG=({event:e})=>{const t=Hn();return(0,i.jsxs)(Ra,{align:"start",direction:"column",gap:"2",children:[(0,i.jsx)(Jd,{color:e.state===$e.Ongoing?"success":"error",children:t(e.state)}),(0,i.jsx)(br,{color:"gray800",fontSize:"textLg",fontWeight:"medium",width:1,children:e.name}),(0,i.jsx)(wG,{event:e})]})},EG=({events:e})=>{const{organizationId:t,eventId:n}=Zn(),[s,o]=(0,M.useState)(n),r=Xn(),a=Hn();return(0,i.jsxs)(Ra,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Ra,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(xR,{state:e.id===s?"checked":"unchecked",onClick:()=>o(e.id),children:(0,i.jsx)(SG,{event:e})},e.id))}),(0,i.jsx)(Ba,{height:7}),(0,i.jsx)(jl,{onClick:()=>{r.push(Os.DASHBOARD(t,s))},children:a("s_lectionner_l_77300")})]})},TG=hr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),zG=()=>{const{organizationId:e,eventId:t}=Zn(),{loader:n,data:s}=ea({organizationId:e,includeNumberOfMembers:!1}),o=Xn(),r=Hn();return(0,i.jsxs)(AG,{onClose:()=>{o.push(Os.DASHBOARD(e,t))},children:[(0,i.jsx)(TG,{children:r("liste_de_vos_v_44993")}),n||(0,i.jsx)(EG,{events:s.data.rows.nodes})]})},OG=hr("div",{display:"flex",flex:1,flexDirection:"column",margin:"0 $3"}),RG=hr(Ra,{margin:"0 $3",padding:"$3 $4"}),$G=({back:e,children:t})=>(0,i.jsxs)(Ra,{align:"center",css:{padding:"10px 0",borderBottom:"1px solid $gray100"},children:[(0,i.jsx)(RG,{color:"gray700",onClick:e,children:(0,i.jsx)(Ya,{icon:"chevron-left"})}),t]}),DG=hr("div",{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"}),PG=hr("i",{fontSize:"$textXl"}),FG=({replaySearch:e})=>{const{eventId:t}=Zn(),{data:n,loader:s}=Yn("query RecentPositionsSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentPositionsRegistrationsSearches\n }\n}\n",{eventId:t},[]),o=Hn();if(s)return s;{const t=n.event.recentPositionsRegistrationsSearches;return(0,i.jsxs)(Ra,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(br,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(Ra,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(PG,{className:"fa-regular fa-clock"}),(0,i.jsx)(br,{children:t})]},n))]})}},MG=e=>{const t=Hn(),n=m(e.content?.[0])?t(e.content[0]):t("ooops_on_a_un_p_56888"),s=((e,t)=>"accreditation_limit_reached"===t?.[0]?e("_ditez_l_accr_d_66820"):"delegation_limit_reached"===t?.[0]?e("_diter_la_d_l_g_14763"):"can_not_delete_paired"===t?.[0]?e("ce_membre_est_d_53903"):eo(t)?t:[e("une_erreur_est_92333")])(t,e.content);return(0,i.jsx)(ub,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"triangle-exclamation",iconColor:"$error700",children:n}),(0,i.jsx)(lb,{css:{color:"$gray500"},hideBorder:!0,children:e.content?s:e.children}),(0,i.jsx)(ab,{hideBorder:!0,hideCancelButton:!0,children:(0,i.jsx)(jl,{color:"error",onClick:e.onClose,children:t("fermer_62479")})})]})})},NG=M.createContext({}),LG=e=>{const[t,n]=M.useState(!1),[s,o]=M.useState([]),r=M.useCallback((e,t)=>{n(e),o((t||[]).flatMap(e=>e.isHeaventError?e.message.split("\n"):e.message?.startsWith("db::")?[e.message.substring(4).split(" ")[0]]:[]))},[n,o]),a=M.useCallback(()=>{n(!1),o([])},[n,o]);return(0,i.jsxs)(NG.Provider,{value:{isError:t,setIsError:r},children:[e.children,t&&(0,i.jsx)(MG,{content:s,onClose:a})]})},BG=(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 VG(e,t,n){const[s,o]=(0,M.useReducer)(BG,{isLoading:!0,data:void 0,xs:void 0,offset:t.offset}),{setIsError:r}=(0,M.useContext)(NG);(0,M.useEffect)(()=>{let i=!1;return o({type:"FIRST_PAGE_INIT"}),q().then(n=>e(t,n||null)).then(e=>{!1===i&&o({type:"FIRST_PAGE_SUCCESS",data:e,xs:n(e),offset:t.offset})},()=>{!1===i&&r(!0)}),()=>{i=!0}},[e,JSON.stringify(t),n]);const a=()=>{o({type:"LOAD_MORE_INIT"});const i=s.offset+t.limit;q().then(n=>e({...t,offset:i},n||null)).then(e=>{const t=[...s.xs||[]];t.splice(i,0,...n(e)),o({type:"LOAD_MORE_SUCCESS",data:e,xs:t,offset:i})},()=>{r(!0)})};return(e=>e.isLoading&&void 0===e.data)(s)?{data:s.data,loader:(0,i.jsx)(_l,{}),loadMore:a,xs:s.xs}:{data:s.data,loader:s.isLoading?(0,i.jsx)(_l,{}):void 0,loadMore:a,xs:s.xs}}const UG=hr(br,{display:"flex",flexDirection:"column",[`${jl} + .load-more-status`]:{paddingTop:"12px"}}),WG=({loadMore:e,pageInfo:t,isLoading:n,buttonText:s,statusText:o})=>!1===t.hasNextPage&&!1===t.hasPreviousPage?null:(0,i.jsxs)(UG,{children:[t.hasNextPage&&(0,i.jsx)(jl,{isLoading:n,textAlign:"center",onClick:e,children:s}),(0,i.jsx)(br,{className:"load-more-status",fontSize:"textSm",textAlign:"center",children:o})]});var GG=n(2872);const HG=hr(Ra,{bd:!0,padding:"$4 $3"}),qG=({children:e,...t})=>(0,i.jsxs)(HG,{align:"center",...t,children:[(0,i.jsx)(br,{css:{flex:1},children:e}),(0,i.jsx)(br,{color:"gray700",css:{padding:"0 10px 0 $4"},children:(0,i.jsx)(Ya,{icon:"chevron-right"})})]}),YG=({open:e,position:t})=>{const n=Hn(),s=Gn(ah);return(0,i.jsxs)(qG,{onClick:()=>{e(t.id)},children:[(0,i.jsxs)(Ra,{gap:"2",children:[t.assignedResources>=t.resources?(0,i.jsx)(Jd,{color:"success",children:n("complet_51600")}):(0,i.jsx)(Jd,{color:"warning",children:n("incomplet_45915")}),!t.isVisible&&(0,i.jsx)(Jd,{color:"gray",children:n("Private")})]}),(0,i.jsx)(br,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(br,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:`${n("creneau",t.slots.length)} · ${t.range?s.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"}`}),(0,i.jsx)(br,{css:{marginTop:"$3"},children:(0,i.jsx)(ow,{percent:t.assignedResources/t.resources})})]})},KG=hr("div",{color:"$gray800",fontWeight:"$semiBold",lineHeight:"24px"}),ZG=hr("div",{color:"$gray400",fontSize:"$textSm"}),XG=hr("span",{color:"$gray800"}),JG=({category:e})=>{const t=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(KG,{children:e.name}),eo(e.leaders)&&(0,i.jsxs)(ZG,{children:[`${t("responsable_category",e.leaders.length)} `,(0,i.jsx)(XG,{children:e.leaders.map(({userInfo:e})=>e.name).join(", ")})]})]})},QG=({open:e,positions:t})=>{const n=(0,M.useMemo)(()=>(0,ic.A)((0,GG.A)((0,nc.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)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(JG,{category:t[0].category}),t.map((t,n)=>(0,i.jsx)(YG,{open:e,position:t},n))]},n))})},eH=()=>{const e=Hn();return(0,i.jsx)(xk,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},tH=e=>e.event.positions.nodes,nH=({search:e})=>{const t=Hn(),{organizationId:n,eventId:s}=Zn(),o={eventId:s,predicates:[],limit:kc,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=VG(ha,o,tH),c=Xn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(eH,{}):(0,i.jsxs)(Ra,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(br,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),(0,i.jsx)(QG,{open:t=>{c.push(Os.POSITION_SETTINGS(n,s,t),{from:"SEARCH_MOBILE",search:e})},positions:d}),(0,i.jsx)(WG,{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)})]})},iH=hr(Ra,{color:"$blue600"}),sH=()=>{const{organizationId:e,eventId:t}=Zn(),n=Xn(),s=Hn(),o=Jn(),[r,a]=(0,M.useState)(o.state?.search||""),[l,d]=(0,M.useState)(o.state?.search||"");return(0,i.jsxs)(DG,{children:[(0,i.jsx)($G,{back:()=>{n.push(ms.POSITIONS({organizationId:e,eventId:t}))},children:(0,i.jsxs)(Ra,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(Ol,{icon:"search",placeholder:s("rechercher_une_69998"),value:r,onChange:e=>{a(e),e||d(e)},onKeyDown:e=>{"Enter"===e.key&&d(r)}}),l&&(0,i.jsx)(iH,{onClick:()=>{a(""),d("")},children:s("annuler_48254")})]})}),(0,i.jsx)(OG,{children:l?(0,i.jsx)(nH,{search:l}):(0,i.jsx)(FG,{replaySearch:e=>{a(e),d(e)}})})]})},oH=({folders:e,segmentId:t,...n})=>(0,i.jsx)(Au,{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 rH=n(473);const aH=()=>{const e=Hn();return(0,i.jsx)(xk,{css:{flex:1,padding:"0 $4"},subtitle:e("cr_ez_de_nouvel_87003"),title:e("il_n_y_a_pas_de_55837")})},lH=e=>e.event.positions.nodes,dH=({segment:e})=>{const t=Hn(),{organizationId:n,eventId:s}=Zn(),o={eventId:s,predicates:e.predicates,limit:kc,offset:0},{data:r,loader:a,loadMore:l,xs:d}=VG(ha,o,lH),c=Xn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(aH,{}):(0,i.jsxs)(Ra,{direction:"column",gap:"7",children:[(0,i.jsx)(QG,{open:e=>{c.push(Os.POSITION_SETTINGS(n,s,e))},positions:d}),(0,i.jsx)(WG,{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)})]})},cH=hr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),uH=hr(Ya,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),hH=({event:e})=>{const{organizationId:t,eventId:n,segmentId:s}=Zn(),o=Xn(),r=Hn(),a=(0,rH.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Ra,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ra,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(cH,{children:r("missions_63972")}),(0,i.jsx)(uH,{icon:"search",onClick:()=>{o.push(Os.POSITIONS_SEARCH(t,n))}})]}),(0,i.jsx)(br,{children:(0,i.jsx)(oH,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push(Os.POSITIONS_SEGMENT(t,n,e))})}),(0,i.jsx)(Ra,{css:{flex:1},direction:"column",children:(0,i.jsx)(dH,{segment:a})})]})},mH=()=>{const{organizationId:e,eventId:t}=Zn(),{data:n,loader:s}=Yn("query PositionsSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[Ms.SegmentsFoldersSegmentsFragment]);return s||(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.POSITIONS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(sH,{})}),(0,i.jsx)(Cr.qh,{path:Os.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(hH,{event:n.event})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.POSITIONS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]})},gH=hr(Ra,{backgroundColor:"$gray100",borderRadius:"$1",padding:"2px"}),pH=({children:e,...t})=>(0,i.jsx)(gH,{...t,children:e}),fH=hr(Ra,{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"}}}}),xH=({children:e,path:t})=>{const n=Xn(),s=Jn().pathname===t;return(0,i.jsx)(fH,{isSelected:s,justify:"center",onClick:()=>{n.push(t)},children:e})},_H=({children:e,css:t,...n})=>(0,i.jsx)(Ra,{align:"center",css:{flex:1,marginRight:"66px",...t},direction:"column",...n,children:e}),IH=({back:e,position:t})=>(0,i.jsx)($G,{back:e,children:(0,i.jsxs)(_H,{css:{minHeight:"40px"},children:[(0,i.jsx)(br,{color:"gray900",fontWeight:"medium",textAlign:"center",children:t.name}),(0,i.jsx)(br,{color:"gray500",fontSize:"textXs",textAlign:"center",children:t.positionCategoryName})]})}),vH=({customFields:e,position:t})=>{const n=Hn(),{roles:s}=_I();return(0,i.jsxs)(Ra,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(uW,{category:t,title:n("remplissage_des_84383")}),(0,i.jsx)(Uw,{leaders:t.leaders,roles:s.positionRoles}),(0,i.jsx)(gW,{customFields:e,position:t}),(0,i.jsx)(cw,{description:t.description}),(0,i.jsx)(kF,{location:t}),(0,i.jsx)(CF,{customFields:t.customFields}),(0,i.jsx)(pw,{modalSubtitle:n("ajouter_des_tag_64526"),tags:t.tags}),(0,i.jsx)(uw,{privateNote:t.privateNote})]})},bH=(e,t)=>e.name||t.toLocaleString(e.range,void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),jH=({open:e,slot:t})=>{const n=Hn(),s=Gn(ah);return(0,i.jsxs)(qG,{onClick:()=>{e(t.id)},children:[(0,i.jsx)(Ra,{gap:"2",children:t.assignedResources>=t.resources?(0,i.jsx)(Jd,{color:"success",children:n("complet_51600")}):(0,i.jsx)(Jd,{color:"warning",children:n("_1_membre_manq_31014",t.resources-t.assignedResources)})}),(0,i.jsx)(br,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(br,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:bH(t,s)}),(0,i.jsx)(br,{css:{marginTop:"$3"},children:(0,i.jsx)(ow,{percent:t.assignedResources/t.resources})})]})},CH=({open:e,slots:t})=>{const n=Hn();return(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n("liste_des_cr_ne_94056")}),t.map((t,n)=>(0,i.jsx)(jH,{open:e,slot:t},n))]})},yH=e=>e.event.positionsSlots.nodes,kH=({open:e,eventId:t,positionId:n})=>{const s={eventId:t,positionId:n,limit:kc,offset:0},{data:o,loader:r,loadMore:a,xs:l}=VG(ga,s,yH);return r&&void 0===o?r:(0,i.jsxs)(Ra,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(CH,{open:e,slots:l}),(0,i.jsx)(WG,{buttonText:"Afficher plus de créneaux",isLoading:void 0!==r,loadMore:a,pageInfo:o.event.positionsSlots.pageInfo,statusText:`${l.length} sur ${o.event.positionsSlots.totalCount} créneaux`})]})},AH=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,positionId:o}}=cl(),{data:r,loader:a}=pa({organizationId:n,eventId:s,positionId:o}),l=Jn(),[d]=(0,M.useState)(l.state);if(l.pathname===ms.POSITION({organizationId:n,eventId:s,positionId:o}))return(0,i.jsx)(ei,{path:Os.POSITION_SETTINGS(n,s,o)});const c={settings:Os.POSITION_SETTINGS(n,s,o),slots:ms.POSITION_SLOTS({organizationId:n,eventId:s,positionId:o})};return a||(0,i.jsxs)(DG,{children:[(0,i.jsx)(IH,{back:()=>{"SEARCH_MOBILE"===d?.from?e.push(Os.POSITIONS_SEARCH(n,s),{search:d?.search}):e.push(ms.POSITIONS({organizationId:n,eventId:s}))},position:r.event.position}),(0,i.jsx)(OG,{children:(0,i.jsxs)(Mb,{children:[(0,i.jsxs)(pH,{css:{margin:"$6 0"},children:[(0,i.jsx)(xH,{path:c.settings,children:t("param_tres_78420")}),(0,i.jsx)(xH,{path:c.slots,children:t("cr_neaux_33401")})]}),(0,i.jsx)(Fb,{path:c.settings,children:(0,i.jsx)(vH,{customFields:r.organization.customFields.nodes,position:r.event.position})}),(0,i.jsx)(Fb,{path:c.slots,children:(0,i.jsx)(kH,{eventId:s,open:t=>{e.push(Os.POSITION_SLOT_MEMBERS(n,s,o,t))},positionId:r.event.position.id})})]})})]})},wH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Zn(),o=Xn(),r=Hn();return(0,i.jsx)(AG,{onClose:()=>{o.push(Os.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsxs)(Ra,{css:{margin:"$3"},direction:"column",gap:"3",children:[(0,i.jsx)(jl,{onClick:()=>{o.push(Os.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(e,t,n,s))},children:r("pointer_des_mem_09244")}),(0,i.jsx)(jl,{onClick:()=>{o.push(Os.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(e,t,n,s))},children:r("d_pointer_des_m_31557")}),(0,i.jsx)(jl,{onClick:()=>{o.push(Os.POSITION_SLOT_CHECK_MEMBERS_RESET(e,t,n,s))},children:r("remettre_z_ro_65589")})]})})},SH=hr(Ra,{fontSize:"$textSm",color:"$blue600"}),EH=({onSubmit:e,children:t,data:n,loader:s,loadMore:o,xs:r,disabled:a})=>{const l=Hn(),[d,c]=(0,M.useState)(r);(0,M.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)(Ra,{direction:"column",height:"100%",width:"100%",children:[(0,i.jsxs)(Ra,{css:{flex:1,overflow:"auto",padding:"$6 $4 $3 $4"},direction:"column",gap:"5",children:[(0,i.jsxs)(Ra,{justify:"between",children:[(0,i.jsx)(br,{fontSize:"textMd",fontWeight:"semiBold",children:l("liste_des_membr_86405",r.length)}),(0,i.jsx)(SH,{onClick:()=>{c(d.map(e=>({...e,state:"checked"})))},children:l("tout_s_l_ctionn_18234")})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[d.map((e,t)=>(0,i.jsx)(dc,{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)(WG,{buttonText:l("afficher_plus_d_41906"),isLoading:void 0!==s,loadMore:o,pageInfo:n.event.volunteersRegistrations.pageInfo,statusText:l("_1_sur_2_mem_14323",r.length,n.event.volunteersRegistrations.totalCount)})]})]}),(0,i.jsx)(Ra,{css:{boxShadow:"$mdReverse",padding:"$6 $4"},direction:"column",children:(0,M.isValidElement)(t)?(0,M.cloneElement)(t,{onClick:()=>e(u),disabled:0===u.length}):t})]})},TH=e=>e.event.volunteersRegistrations.nodes,zH=()=>{const{eventId:e,positionSlotId:t}=Zn(),n=Hn(),s={eventId:e,positionSlotId:t,predicates:[{operator:ct.IsNot,value:[ue.CheckedIn],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=VG(ma,s,TH),{isLoading:d,mutate:c}=Po(),[u,h]=(0,M.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:he.CheckIn,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(EH,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(jl,{isLoading:d,textAlign:"center",children:n("pointer_80927")})})}},OH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Zn(),o=Xn(),r=Hn();return(0,i.jsxs)(DG,{children:[(0,i.jsx)($G,{back:()=>{o.push(Os.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(_H,{children:r("pointer_des_mem_09244")})}),(0,i.jsx)(OG,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(zH,{})})]})},RH=e=>e.event.volunteersRegistrations.nodes,$H=()=>{const{eventId:e,positionSlotId:t}=Zn(),n=Hn(),s={eventId:e,positionSlotId:t,predicates:[{operator:ct.IsNot,value:[ue.CheckedOut],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=VG(ma,s,RH),{isLoading:d,mutate:c}=Po(),[u,h]=(0,M.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:he.CheckOut,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(EH,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(jl,{isLoading:d,textAlign:"center",children:n("d_pointer_25328")})})}},DH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Zn(),o=Xn(),r=Hn();return(0,i.jsxs)(DG,{children:[(0,i.jsx)($G,{back:()=>{o.push(Os.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(_H,{children:r("d_pointer_des_m_31557")})}),(0,i.jsx)(OG,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)($H,{})})]})},PH=e=>e.event.volunteersRegistrations.nodes,FH=()=>{const{eventId:e,positionSlotId:t}=Zn(),n=Hn(),s={eventId:e,positionSlotId:t,predicates:[{operator:ct.IsNot,value:[ue.Waiting],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=VG(ma,s,PH),{isLoading:d,mutate:c}=Po(),[u,h]=(0,M.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:he.Reset,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(EH,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(jl,{isLoading:d,textAlign:"center",children:n("remettre_z_ro_82376")})})}},MH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Zn(),o=Xn(),r=Hn();return(0,i.jsxs)(DG,{children:[(0,i.jsx)($G,{back:()=>{o.push(Os.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(_H,{children:r("remettre_z_ro_11572")})}),(0,i.jsx)(OG,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(FH,{})})]})},NH=e=>{let t,n,s;return"registrationState"in e?(({color:t,leftIcon:s}=Yb(e.registrationState)),n=`${t}100`):(t=function(e){switch(e){case ue.CheckedIn:case ue.CheckedOut:return"success";case ue.Waiting:return"warning"}}(e.checkInState),n=`${t}500`),(0,i.jsx)(Ra,{align:"center",css:{background:mr.colors[n].value,border:"2px solid white",borderRadius:`${e.size}px`,bottom:"0",color:mr.colors[`${t}700`].value,fontSize:`${Math.round(.45*e.size)}px`,right:"0",position:"absolute"},height:e.size,justify:"center",width:e.size,children:s&&(0,i.jsx)(Ya,{icon:s})})},LH=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}},BH=hr("div",{position:"relative"}),VH=e=>{let t,n;if("registrationState"in e){t={registrationState:e.registrationState,size:LH(e.size)};const{registrationState:i,...s}=e;n=s}else{t={checkInState:e.checkInState,size:LH(e.size)};const{checkInState:i,...s}=e;n=s}return(0,i.jsxs)(BH,{children:[(0,i.jsx)(qg,{...n}),(0,i.jsx)(NH,{...t})]})},UH=hr(Ra,{overflow:"hidden"}),WH=hr("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"}}}}}),GH=({userInfo:e,size:t,...n})=>(0,i.jsxs)(UH,{direction:"column",...n,children:[m(e.name)&&(0,i.jsx)(WH,{size:t,children:e.name}),(0,i.jsx)(WH,{size:t,children:e.email})]}),HH=e=>{const t={name:e.userInfo.name,email:e.userInfo.email,image:e.userInfo.picture?.url};return(0,i.jsxs)(Ra,{align:"center",onClick:e.openVolunteer,children:["registrationState"in e?(0,i.jsx)(VH,{...t,registrationState:e.registrationState,size:40}):"checkInState"in e?(0,i.jsx)(VH,{...t,checkInState:e.checkInState,size:40}):(0,i.jsx)(qg,{...t,size:40}),(0,i.jsx)(GH,{css:{marginLeft:"$3"},size:40,userInfo:e.userInfo})]})},qH=()=>{const e=Hn();return(0,i.jsxs)(Ra,{align:"center",css:{flex:1},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(Ej,{color:"primary",icon:"user-group"}),(0,i.jsx)(br,{color:"gray500",children:e("aucun_b_n_vole_19616")})]})},YH=hr("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),KH=hr(Ya,{color:"$gray800",margin:"0 $3",padding:"$3 $4"}),ZH=({back:e,slot:t})=>{const{organizationId:n,eventId:s,positionId:o,positionSlotId:r}=Zn(),a=Gn(ah),l=Xn(),{hasPermission:d}=Jv(),c=d(xb.POSITION_READ,{positionCategoryId:t.positionCategoryId,positionId:o});return(0,i.jsxs)($G,{back:e,children:[(0,i.jsx)(_H,{css:{minHeight:"40px",marginRight:"0"},children:(0,i.jsx)(YH,{children:bH(t,a)})}),c&&(0,i.jsx)(KH,{icon:"list-check",onClick:()=>{l.push(Os.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(n,s,o,r))}})]})},XH=e=>e.event.volunteersRegistrations.nodes,JH=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Zn(),o=Hn(),r=Xn(),a={eventId:t,positionSlotId:s,predicates:[],limit:kc,offset:0},{data:l,loader:d,loadMore:c,xs:u}=VG(ma,a,XH);return d&&void 0===l?d:(0,i.jsxs)(DG,{children:[(0,i.jsx)(ZH,{back:()=>{r.push(ms.POSITION_SLOTS({organizationId:e,eventId:t,positionId:n}))},slot:l.event.positionSlot}),(0,i.jsx)(OG,{children:(0,i.jsx)(Ra,{css:{flex:1,margin:"$7 0"},direction:"column",gap:"7",children:0===u.length?(0,i.jsx)(qH,{}):(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[u.map(o=>(0,i.jsx)(HH,{checkInState:o.positionSlotUserInfo.state,openVolunteer:()=>{r.push(Os.POSITION_SLOT_MEMBERS_USER_INFORMATIONS(e,t,n,s,o.userInfo.id))},userInfo:o.userInfo},o.id)),(0,i.jsx)(WG,{buttonText:o("afficher_plus_d_41906"),isLoading:void 0!==d,loadMore:c,pageInfo:l.event.volunteersRegistrations.pageInfo,statusText:o("_1_sur_2_mem_14323",u.length,l.event.volunteersRegistrations.totalCount)})]})})})]})},QH=hr("div",{minHeight:"$space$5","@tablet":{minHeight:"$space$6"}}),eq=e=>(0,i.jsx)(br,{color:"gray800",css:{fontSize:"$textLg","@tablet":{fontSize:"$textMd"},...e.css},fontWeight:"semiBold",children:e.children}),tq=e=>{const t=jc(),n=Hn(),s=e.fieldsToDisplay.filter(e=>!["picture","firstName","lastName"].includes(e.fieldProperty)),o=s.length,r=e.privateCustomFields.length;return(0,i.jsxs)(Ra,{direction:"column",children:[o>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(eq,{children:n("informations_pe_37892")}),(0,i.jsx)(Ba,{height:"3"}),s.map(t=>Lj(t,e.userInfo.fields,s)&&(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(hz,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(QH,{})]},t.id)),!1===t&&(0,i.jsx)(br,{css:{borderBottom:"1px solid $gray200"},width:1})]}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:t?5:6}),(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(eq,{children:(0,i.jsx)(Ya,{icon:"lock"})}),(0,i.jsx)(eq,{children:n("informations_pr_15873")})]}),(0,i.jsx)(Ba,{height:"3"}),e.privateCustomFields.map(t=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(hz,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(QH,{})]},t.id)),!1===t&&(0,i.jsx)(br,{css:{borderBottom:"1px solid $gray200"},width:1})]}),!1===t&&e.editButton,!1===t&&(0,i.jsx)(Ba,{height:"6"})]})},nq=e=>{const t=Xn(),n=jc(),s=m(e.path);return(0,i.jsxs)(Ra,{css:{cursor:s?"pointer":"initial"},direction:"column",onClick:()=>{s&&t.push(e.path)},children:[(0,i.jsx)(br,{color:"gray800",css:{fontSize:"$textSm",overflow:"hidden",textOverflow:"ellipsis"},fontWeight:"medium",children:e.text}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.subtext}),(0,i.jsx)(Ba,{height:n?5:6})]})},iq=e=>{const t=Hn(),{hasPermission:n}=Jv(),s=Gn(Wc),o=Gn(Kg),r=Gn(ah),a=jc(),l=n(xb.MEMBER_ASSIGN),d=(0,ic.A)(e.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),c=(0,ic.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)(Ra,{direction:"column",children:[(0,i.jsx)(Ba,{height:"6"}),eo(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eq,{children:t("affectation_plural")}),(0,i.jsx)(Ba,{height:"3"}),d.map((t,s)=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(hk,{canCheckIn:n(xb.POSITION_READ,{positionCategoryId:t.positionCategoryId,positionId:t.position.id}),canDelete:l,positionSlotUserInfo:t,reloadCheckIn:e.reload,onDelete:e.reload}),(0,i.jsx)(Ba,{height:a?2:3})]},s)),(0,i.jsx)(Ba,{height:"3"}),!1===a&&(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ba,{height:a?5:6})]}),eo(c)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eq,{children:t("missions_et_cat_88954")}),(0,i.jsx)(Ba,{height:"3"}),c.map((t,n)=>(0,i.jsx)(nq,{path:t.isPosition?ms.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}):ms.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)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ba,{height:a?5:6})]}),(eo(e.volunteerRegistration.positionsCategories)||eo(e.volunteerRegistration.positions)||eo(e.volunteerRegistration.positionsSlots))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eq,{children:t("missions_souhai_23225")}),(0,i.jsx)(Ba,{height:"3"}),(0,ic.A)(e.volunteerRegistration.positionsCategories,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(nq,{path:ms.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,ic.A)(e.volunteerRegistration.positions,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(nq,{path:ms.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,ic.A)(e.volunteerRegistration.positionsSlots,e=>e.range.start.toMillis()).map((t,n)=>(0,i.jsx)(nq,{path:ms.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.position.id}),subtext:t.nameOrRange,text:t.position.name},n)),!1===a&&(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ba,{height:a?5:6})]}),eo(e.volunteerRegistration.slots)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eq,{children:t("disponibilit_s_49923")}),(0,i.jsx)(Ba,{height:"3"}),e.volunteerRegistration.slots.map((e,n)=>(0,i.jsx)(nq,{subtext:r.toDisplayString(e.range),text:t("disponibilit_n_50484",n+1)},n)),!1===a&&(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ba,{height:a?5:6})]}),e.volunteerRegistration.state===Ot.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eq,{children:t("statistiques_98073")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(nq,{subtext:o.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes),text:t("nombre_d_heures_36999")}),!1===a&&(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ba,{height:a?5:6})]}),(0,i.jsx)(eq,{children:t("inscription_48144")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(nq,{subtext:s.toLocaleString(e.volunteerRegistration.insertedAt.toLocal(),Zs.DateTime),text:t("date_d_inscript_31369")})]})},sq=hr(br,{lineHeight:"28px",marginTop:"$3",maxWidth:"100%",ellipsis:""}),oq=hr(br,{lineHeight:"20px",maxWidth:"100%",ellipsis:""}),rq=({registration:e})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(VH,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,registrationState:e.state,size:64}),(0,i.jsx)(sq,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e.userInfo.name}),(0,i.jsx)(oq,{color:"gray500",fontSize:"textSm",children:e.userInfo.email})]}),aq=({basePath:e,data:t,reload:n})=>{const s=Hn(),{organizationId:o,eventId:r}=Zn(),a=t.event.volunteerRegistration,l={informations:`${e}/${di.INFORMATION}`,registration:`${e}/${di.REGISTRATION}`};return(0,i.jsxs)(Ra,{align:"center",css:{alignSelf:"center",padding:"0 $4"},direction:"column",width:1,children:[(0,i.jsx)(rq,{registration:a}),(0,i.jsxs)(Mb,{css:{marginTop:"$5"},children:[(0,i.jsxs)(pH,{children:[(0,i.jsx)(xH,{path:l.informations,children:s("informations_22954")}),(0,i.jsx)(xH,{path:l.registration,children:s("missions_63972")})]}),(0,i.jsx)(Fb,{path:l.informations,children:(0,i.jsx)(tq,{fieldsToDisplay:t.event.formsCustomsFields,privateCustomFields:t.organization.customFields.nodes,userInfo:a.userInfo})}),(0,i.jsx)(Fb,{path:l.registration,children:(0,i.jsx)(iq,{eventId:r,organizationId:o,reload:n,volunteerRegistration:a})})]})]})},lq=({basePath:e,onClose:t})=>{const{organizationId:n,eventId:s,userInfoId:o}=Zn(),{data:r,loader:a,reload:l}=Yn("query UserInfoMobile(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n state\n volunteerMinutes\n insertedAt\n\n slots {\n range\n }\n\n positionsSlots {\n nameOrRange\n range\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n userInfo {\n ...UserInfoOverlay\n }\n\n positionsSlotsUsersInfos {\n ...UserPositionSlotUserInfo\n }\n\n preassignPositions {\n id\n name\n range\n }\n\n preassignPositionsCategories {\n id\n name\n range\n }\n }\n }\n}\n",{organizationId:n,eventId:s,userInfoId:o},[Ms.CustomFieldWithConditionFragment,Ms.UserInfoOverlayFragment,Ms.UserPositionSlotUserInfoFragment]);return(0,i.jsx)(AG,{onClose:t,children:a||(0,i.jsx)(aq,{basePath:e,data:r,reload:l})})},dq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s,userInfoId:o}=Zn(),r=Xn(),a=Os.POSITION_SLOT_MEMBERS_USER(e,t,n,s,o);return(0,i.jsx)(lq,{basePath:a,onClose:()=>{r.push(Os.POSITION_SLOT_MEMBERS(e,t,n,s))}})},cq=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(OH,{})}),(0,i.jsx)(Cr.qh,{path:Os.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(DH,{})}),(0,i.jsx)(Cr.qh,{path:Os.POSITION_SLOT_CHECK_MEMBERS_RESET(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(MH,{})}),(0,i.jsx)(Cr.qh,{path:Os.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(JH,{})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(AH,{})})]}),(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(wH,{})}),(0,i.jsx)(Cr.qh,{path:Os.POSITION_SLOT_MEMBERS_USER(":organizationId",":eventId",":positionId",":positionSlotId",":userInfoId"),children:(0,i.jsx)(dq,{})})]})]}),uq=hr("i",{fontSize:"$textXl"}),hq=({replaySearch:e})=>{const{eventId:t}=Zn(),{data:n,loader:s}=Yn("query RecentVolunteersSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentVolunteersRegistrationsSearches\n }\n}\n",{eventId:t},[]),o=Hn();if(s)return s;{const t=n.event.recentVolunteersRegistrationsSearches;return(0,i.jsxs)(Ra,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(br,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(Ra,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(uq,{className:"fa-regular fa-clock"}),(0,i.jsx)(br,{children:t})]},n))]})}},mq=()=>{const e=Hn();return(0,i.jsx)(xk,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},gq=e=>e.event.volunteersRegistrations.nodes,pq=({search:e})=>{const t=Hn(),{organizationId:n,eventId:s}=Zn(),o={eventId:s,predicates:[],limit:kc,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=VG(ka,o,gq),c=Xn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(mq,{}):(0,i.jsxs)(Ra,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(br,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),d.map((e,t)=>(0,i.jsx)(HH,{openVolunteer:()=>{c.push(Os.VOLUNTEERS_SEARCH_USER_INFORMATIONS(n,s,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(WG,{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)})]})},fq=hr(Ra,{color:"$blue600"}),xq=()=>{const{organizationId:e,eventId:t}=Zn(),n=Xn(),s=Hn(),[o,r]=(0,M.useState)(""),[a,l]=(0,M.useState)("");return(0,i.jsxs)(DG,{children:[(0,i.jsx)($G,{back:()=>{n.push(Os.VOLUNTEERS(e,t))},children:(0,i.jsxs)(Ra,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(Ol,{icon:"search",placeholder:s("rechercher_un_m_05904"),value:o,onChange:e=>{r(e),e||l(e)},onKeyDown:e=>{"Enter"===e.key&&l(o)}}),a&&(0,i.jsx)(fq,{onClick:()=>{r(""),l("")},children:s("annuler_48254")})]})}),(0,i.jsx)(OG,{children:a?(0,i.jsx)(pq,{search:a}):(0,i.jsx)(hq,{replaySearch:e=>{r(e),l(e)}})})]})},_q=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Zn(),s=Xn(),o=Os.VOLUNTEERS_SEARCH_USER(e,t,n);return(0,i.jsx)(lq,{basePath:o,onClose:()=>{s.push(Os.VOLUNTEERS_SEARCH(e,t))}})},Iq=()=>{const e=Hn();return(0,i.jsx)(xk,{css:{flex:1,padding:"0 $4"},subtitle:e("diffusez_le_for_36054"),title:e("il_n_y_a_pas_de_22623")})},vq=e=>e.event.volunteersRegistrations.nodes,bq=({segment:e})=>{const t=Hn(),{organizationId:n,eventId:s,segmentId:o}=Zn(),r={eventId:s,predicates:e.predicates,limit:kc,offset:0},{data:a,loader:l,loadMore:d,xs:c}=VG(ka,r,vq),u=Xn();return l&&void 0===a?l:0===c.length?(0,i.jsx)(Iq,{}):(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[c.map((e,t)=>(0,i.jsx)(HH,{openVolunteer:()=>{u.push(Os.VOLUNTEERS_LIST_USER_INFORMATIONS(n,s,o,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(WG,{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)})]})},jq=hr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),Cq=hr(Ya,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),yq=({event:e})=>{const{organizationId:t,eventId:n,segmentId:s}=Zn(),o=Xn(),r=Hn(),a=(0,rH.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Ra,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ra,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(jq,{children:r("membres_11310")}),(0,i.jsx)(Cq,{icon:"search",onClick:()=>{o.push(Os.VOLUNTEERS_SEARCH(t,n))}})]}),(0,i.jsx)(br,{children:(0,i.jsx)(oH,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push(Os.VOLUNTEERS_SEGMENT(t,n,e))})}),(0,i.jsx)(Ra,{css:{flex:1},direction:"column",children:(0,i.jsx)(bq,{segment:a})})]})},kq=()=>{const{organizationId:e,eventId:t,segmentId:n,userInfoId:s}=Zn(),o=Xn(),r=Os.VOLUNTEERS_LIST_USER(e,t,n,s);return(0,i.jsx)(lq,{basePath:r,onClose:()=>{o.push(Os.VOLUNTEERS_SEGMENT(e,t,n))}})},Aq=()=>{const{organizationId:e,eventId:t}=Zn(),{data:n,loader:s}=Yn("query VolunteersSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Volunteers) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[Ms.SegmentsFoldersSegmentsFragment]);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.VOLUNTEERS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(xq,{})}),(0,i.jsx)(Cr.qh,{path:Os.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(yq,{event:n.event})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.VOLUNTEERS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]}),(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.VOLUNTEERS_SEARCH_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(_q,{})}),(0,i.jsx)(Cr.qh,{path:Os.VOLUNTEERS_LIST_USER(":organizationId",":eventId",":segmentId",":userInfoId"),children:(0,i.jsx)(kq,{})})]})]})},wq=()=>{const{organizationId:e,eventId:t}=Zn(),{user:n}=_I();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(gG,{eventId:t,user:n,children:(0,i.jsx)(vG,{})})}),(0,i.jsx)(Cr.qh,{path:Os.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(gG,{eventId:t,user:n,children:(0,i.jsx)(Aq,{})})}),(0,i.jsx)(Cr.qh,{path:ms.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(gG,{eventId:t,user:n,children:(0,i.jsx)(mH,{})})}),(0,i.jsx)(Cr.qh,{path:ms.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(cq,{})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.DASHBOARD(e,t)})})]}),(0,i.jsx)(Cr.dO,{children:(0,i.jsx)(Cr.qh,{path:Os.DASHBOARD_EVENT_SWITCH(":organizationId",":eventId"),children:(0,i.jsx)(zG,{})})})]})},Sq=e=>{const t=e.isActive?e.isActive(location.pathname):location.pathname===e.to,[n,s]=M.useState(t),o=!!e.children&&(!e.isMenuOpen||n),r=()=>(0,i.jsxs)(Ra,{align:"center",className:t?"h-event-menu-group-active":"",css:{color:"$gray700",cursor:"pointer",padding:"$2 $3","&:hover, &.h-event-menu-group-active":{background:"$primary50",borderRadius:"6px",color:"$primary700"}},gap:"3",height:e.isMenuOpen?void 0:40,width:1,onClick:()=>{e.isMenuOpen&&s(!n)},children:[(0,i.jsx)(Ya,{icon:e.icon}),e.isMenuOpen&&(0,i.jsx)(br,{css:{flex:"1"},fontWeight:"medium",children:e.title}),e.isMenuOpen&&e.children&&(0,i.jsx)(br,{fontSize:"textXs",children:(0,i.jsx)(Ya,{icon:n?"chevron-up":"chevron-down"})})]});return(0,i.jsxs)(Ra,{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)(Ha,{to:e.to,children:r()}),o&&(0,i.jsx)(Ra,{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)(Ra,{css:e.isMenuOpen?{}:{background:"white",bd:"gray200 2 md",py:"$2",width:"100%"},direction:"column",children:[!e.isMenuOpen&&(0,i.jsx)(br,{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)(Ha,{"aria-label":e.children,"aria-selected":t,role:"menuitem",to:e.to,onClick:async()=>await(e.onClick?.()),children:(0,i.jsx)(Ra,{className:t?"h-event-menu-item-active":"",css:{color:"$gray800",cursor:"pointer",padding:"6px $3","&:hover, &.h-event-menu-item-active":{color:"$primary700"}},children:e.children})})},Tq=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=cl(),{hasFeature:o}=_I(),{event:r,isEventReader:a,numberOfWaitingAccreditations:l,numberOfWaitingAssigments:d,updateLocalEvent:c}=Jv(),{canAccreditationRead:u,canCampaignRead:h,canDelegationRead:m,canDocumentRead:g,canEmailEdit:p,canFormRead:f,canMemberAccredit:x,canMemberAssign:_,canPositionRead:I,canWorkflowRead:v}=lS(),b=im(),j=(0,M.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")),[]),C=(0,M.useCallback)(e=>null!==e.match(/\/delegations\/\d+/)||null!==e.match(/\/delegation\/\d+/)||null!==e.match(/\/delegation-category\/\d+/),[]),y=(0,M.useCallback)(e=>j(e)||C(e),[j,C]),k=(0,M.useCallback)(e=>(null!==e.match(/\/positions\/\d+/)||null!==e.match(/\/position\/\d+/)||null!==e.match(/\/position-category\/\d+/))&&!e.includes("documents"),[]),A=(0,M.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+/),[]),w=(0,M.useCallback)(e=>k(e)||A(e),[k,A]),S=(0,M.useCallback)(e=>null!==e.match(/\/accreditations\/\d+/)||null!==e.match(/\/accreditation\/\d+/)||null!==e.match(/\/accreditation-category\/\d+/),[]),E=(0,M.useCallback)(e=>e.endsWith("/accreditations-assignments")||null!==e.match(/\/edit-accredit\/\d+/),[]),T=(0,M.useCallback)(e=>S(e)||E(e),[S,E]),z=(0,M.useCallback)(e=>e.endsWith("/forms")||e.endsWith("/forms/create"),[]),O=(0,M.useCallback)(e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/campaign\/\d+/),[]),R=(0,M.useCallback)(e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),[]),$=(0,M.useCallback)(e=>e.endsWith("/documents")||null!==e.match(/\/documents\//),[]),D=(0,M.useCallback)(e=>z(e)||O(e)||R(e)||$(e),[z,O,R,$]),P=(0,M.useCallback)(e=>e.endsWith("/options/api"),[]),F=(0,M.useCallback)(e=>e.endsWith("options/weezevent-v2"),[]),N=(0,M.useCallback)(e=>e.endsWith("/workflows"),[]),L=(0,M.useCallback)(e=>P(e)||F(e)||N(e),[P,F,N]),B=a,V=o(Fe.Api)&&a,U=r.isWeezeventSynchronized&&a,W=V||U||v,G=f||h||p||g;return(0,i.jsxs)(Ra,{css:{overflowY:e.isOpen?"auto":void 0,paddingTop:"$5",px:"$3"},direction:"column",gap:"5",width:1,children:[(0,i.jsxs)(Ra,{align:"center",css:{bd:"gray300 1",cursor:"pointer",padding:"$2 $3"},gap:"2",onClick:e=>{Al(e),e.target.dispatchEvent(new CustomEvent(jE,{bubbles:!0}))},children:[(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"sparkles"})}),e.isOpen&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray800",css:{flex:"1"},children:t("action_rapide_97952")}),(0,i.jsxs)(Ra,{align:"center",css:{background:"$gray50",bd:"gray200 1",padding:"2px $1"},justify:"center",children:[b?"⌘":"Ctrl","+k"]})]})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:1,children:[B&&(0,i.jsx)(Sq,{icon:"objects-column",isMenuOpen:e.isOpen,title:t("tableau_de_bord_24627"),to:Os.DASHBOARD(n,s)}),(0,i.jsxs)(Sq,{icon:"user-group",isActive:y,isMenuOpen:e.isOpen,title:t("population_38615"),to:Os.VOLUNTEERS(n,s),children:[(0,i.jsx)(Eq,{isActive:j,to:Os.VOLUNTEERS(n,s),onClick:()=>c({volunteersSegmentId:null}),children:t("membres_11310")}),m&&(0,i.jsx)(Eq,{isActive:C,to:as.DELEGATIONS({organizationId:n,eventId:s}),onClick:()=>c({delegationsSegmentId:null}),children:t("d_l_gations_78318")})]}),I&&(0,i.jsxs)(Sq,{icon:"sitemap",isActive:w,isMenuOpen:e.isOpen,title:t("missions_63972"),to:ms.POSITIONS({organizationId:n,eventId:s}),children:[(0,i.jsx)(Eq,{isActive:k,to:ms.POSITIONS({organizationId:n,eventId:s}),onClick:()=>c({positionsSegmentId:null}),children:t("missions_63972")}),_&&(0,i.jsx)(Eq,{isActive:A,to:Os.ASSIGNMENTS(n,s),children:`${t("affectation_plural")} (${d})`})]}),u&&(0,i.jsxs)(Sq,{icon:"badge-check",isActive:T,isMenuOpen:e.isOpen,title:t("accr_ditations_39450"),to:Ji.ACCREDITATIONS({organizationId:n,eventId:s}),children:[(0,i.jsx)(Eq,{isActive:S,to:Ji.ACCREDITATIONS({organizationId:n,eventId:s}),onClick:()=>c({accreditationsSegmentId:null}),children:t("accr_ditations_39450")}),x&&(0,i.jsx)(Eq,{isActive:E,to:Os.ACCREDITATIONS_ASSIGNMENTS(n,s),children:`${t("mod_ration_09947")} (${l})`})]}),G&&(0,i.jsxs)(Sq,{icon:"message",isActive:D,isMenuOpen:e.isOpen,title:t("communication_05277"),to:Fi.FORMS({organizationId:n,eventId:s}),children:[f&&(0,i.jsx)(Eq,{isActive:z,to:Fi.FORMS({organizationId:n,eventId:s}),children:t("Form_plural")}),h&&(0,i.jsx)(Eq,{isActive:O,to:jI.CAMPAIGNS({organizationId:n,eventId:s}),children:t("Campaigns")}),p&&(0,i.jsx)(Eq,{isActive:e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),to:Os.EVENT_EMAILS_PARAMETERS(n,s),children:t("e_mails_09850")}),g&&(0,i.jsx)(Eq,{isActive:$,to:Os.DOCUMENTS(n,s),children:t("Documents")})]}),W&&(0,i.jsxs)(Sq,{icon:"sliders-up",isActive:L,isMenuOpen:e.isOpen,title:t("options_53186"),to:Os.OPTIONS_API(n,s),children:[V&&(0,i.jsx)(Eq,{isActive:P,to:Os.OPTIONS_API(n,s),children:"API"}),U&&(0,i.jsx)(Eq,{isActive:F,to:Os.OPTIONS_WEEZEVENT_V2(n,s),children:"Weezevent"}),v&&(0,i.jsx)(Eq,{isActive:N,to:WI.WORKFLOWS({organizationId:n,eventId:s}),children:t("automatisations_60045")})]})]})]})},zq=e=>{const{translate:t}=cl();return(0,i.jsx)(Ra,{align:"center",css:{px:"$4"},height:48,justify:"end",children:(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(jl,{color:"white",css:{border:"none"},leftIcon:"sidebar",size:"sm",onClick:e.onToggle})}),(0,i.jsx)(_m,{placement:"top",children:e.isOpen?t("masquer_le_menu_29008"):t("afficher_le_men_91936")})]})})},Oq=()=>{const{params:{organizationId:e,eventId:t},translate:n}=cl(),{event:s,isEventAdmin:o,isEventReader:r}=Jv(),{canAccreditationRead:a,canCampaignRead:l,canDelegationRead:d,canDocumentRead:c,canEmailEdit:u,canFormEdit:h,canFormRead:m,canMemberAccredit:g,canMemberAssign:p,canMemberEdit:f,canPositionRead:x,canWorkflowRead:_}=lS();Td(s.name);const[I,v]=VC(e,"isEventMenuOpen",!1);return(0,i.jsxs)(Ra,{height:1,width:1,children:[(0,i.jsxs)(Ra,{"aria-label":n("menu_de_l_v_ne_05526"),as:Ta.Nav,css:{borderRight:"1px solid $gray200"},direction:"column",width:I?240:64,children:[(0,i.jsx)(Ra,{css:{flex:"1",overflowY:I?"hidden":void 0},width:1,children:(0,i.jsx)(Tq,{isOpen:I})}),(0,i.jsx)(zq,{isOpen:I,onToggle:()=>{v(!I)}})]}),(0,i.jsx)(br,{css:{flex:"1",height:"100%",overflowX:"hidden"},tabIndex:-1,children:(0,i.jsxs)(Cr.dO,{children:[r&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(SN,{})}),x&&(0,i.jsx)(Cr.qh,{path:ms.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(cW,{})}),x&&(0,i.jsx)(Cr.qh,{path:ms.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(RW,{})}),x&&(0,i.jsx)(Cr.qh,{path:ms.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(yW,{})}),(0,i.jsx)(Cr.qh,{path:Os.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(aG,{})}),f&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(tO,{})}),o&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_USER_DELEGATION(":organizationId",":eventId",":delegationId",":userInfoId"),children:(0,i.jsx)(tO,{})}),g&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_USER_ACCREDITATIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(MW,{})}),p&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_USER_MISSIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(BW,{})}),(0,i.jsx)(Cr.qh,{path:Os.EDIT_USER_SLOTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(WW,{})}),d&&(0,i.jsx)(Cr.qh,{path:as.DELEGATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(VN,{})}),(0,i.jsx)(Cr.qh,{path:BI.MEMBER({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(Bz,{})}),d&&(0,i.jsx)(Cr.qh,{path:as.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(Zw,{isEvent:!0})}),d&&(0,i.jsx)(Cr.qh,{path:as.DELEGATION({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(Pw,{})}),(r||p)&&(0,i.jsx)(Cr.qh,{path:Os.ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(xN,{})}),p&&(0,i.jsx)(Cr.qh,{path:Os.ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(hN,{isEdit:!1})}),o&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(hN,{isEdit:!0})}),o&&(0,i.jsx)(Cr.qh,{path:Os.TEAM_ASSIGNMENT(":organizationId",":eventId",":teamCode"),children:(0,i.jsx)(yN,{})}),p&&(0,i.jsx)(Cr.qh,{path:Os.PRE_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(hN,{isEdit:!1})}),g&&(0,i.jsx)(Cr.qh,{path:Os.ACCREDITATIONS_ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(MM,{})}),g&&(0,i.jsx)(Cr.qh,{path:Os.ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(zM,{isEdit:!1})}),g&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(zM,{isEdit:!0})}),h&&(0,i.jsx)(Cr.qh,{path:Fi.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(pS,{isCreateOpen:!0})}),m&&(0,i.jsx)(Cr.qh,{path:Fi.FORMS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(pS,{isCreateOpen:!1})}),l&&(0,i.jsx)(Cr.qh,{path:jI.CAMPAIGNS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(kN,{})}),l&&(0,i.jsx)(Cr.qh,{path:jI.CAMPAIGN({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(cj,{})}),(r||u)&&(0,i.jsx)(Cr.qh,{path:Os.EVENT_EMAILS(":organizationId",":eventId"),children:(0,i.jsx)(xV,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_USER_PLANNING(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(iV,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_USER_PLANNING_LIST(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(lV,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_USER_PLANNING_DAYS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(KB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_ASSIGNMENTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(kB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_VOLUNTEERS_LISTING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(uV,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId","generic"),children:(0,i.jsx)(SB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId",":badgeType"),children:(0,i.jsx)(RB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_CERTIFICATE(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(zB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_HOURS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(GB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_POSITION_PLANNING(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(qL,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(hB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(iB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(lB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_USERS_PICTURES(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(pV,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS_USER_CUSTOM_DOCUMENT(":organizationId",":eventId",":userInfoId",":customDocumentId"),children:(0,i.jsx)(LB,{})}),c&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.DOCUMENTS(":organizationId",":eventId"),children:(0,i.jsx)(zL,{})}),r&&(0,i.jsx)(Cr.qh,{path:Os.OPTIONS_WEEZEVENT_V2(":organizationId",":eventId"),children:(0,i.jsx)(BV,{})}),_&&(0,i.jsx)(Cr.qh,{path:WI.WORKFLOWS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(dR,{})}),r&&(0,i.jsx)(Cr.qh,{path:Os.OPTIONS_API(":organizationId",":eventId"),children:(0,i.jsx)(NV,{})}),a&&(0,i.jsx)(Cr.qh,{path:Ji.ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(dF,{})}),a&&(0,i.jsx)(Cr.qh,{path:Ji.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(KM,{})}),a&&(0,i.jsx)(Cr.qh,{path:Ji.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(nM,{})}),a&&(0,i.jsx)(Cr.qh,{path:Ji.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(HM,{})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.VOLUNTEERS(e,t),replace:!0})})]})}),(0,i.jsx)(CE,{level:"event"})]})},Rq=()=>{const{hasFeature:e}=_I(),{event:t,isEventAdmin:n}=Jv(),{canAccreditationEdit:s,canCampaignSend:o,canDelegationEdit:r,canDocumentEdit:a,canFormRead:l,canMemberAssign:d,canMemberCreate:c,canMemberEdit:u,canPositionEdit:h,canWorkflowEdit:m}=lS();return(0,i.jsxs)(Cr.dO,{children:[t.usePositions&&h&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.CREATE_POSITION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(QV,{})}),t.usePositions&&h&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.EDIT_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(eU,{})}),t.usePositions&&d&&(0,i.jsx)(Cr.qh,{path:Os.POSITION_SLOT_ASSIGN_VOLUNTEERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(DW,{})}),n&&(0,i.jsx)(Cr.qh,{exact:!0,path:jI.CREATE_TEMPLATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Eb,{isTemplate:!0})}),o&&(0,i.jsx)(Cr.qh,{exact:!0,path:jI.CREATE({organizationId:":organizationId",eventId:":eventId",options:":options?"}),children:(0,i.jsx)(Eb,{isTemplate:!1})}),o&&(0,i.jsx)(Cr.qh,{exact:!0,path:jI.UPDATE({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(Tb,{})}),s&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.CREATE_ACCREDITATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(kP,{})}),s&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.EDIT_ACCREDITATION(":organizationId",":eventId",":accreditationId"),children:(0,i.jsx)(AP,{})}),a&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_CUSTOM_DOCUMENT(":organizationId",":eventId",":customDocumentId"),children:(0,i.jsx)(vL,{})}),r&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.CREATE_DELEGATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(MC,{})}),r&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.EDIT_DELEGATION(":organizationId",":eventId",":delegationId"),children:(0,i.jsx)(LC,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_ELEMENTS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(WS,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(hE,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(lE,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_AVAILABILITIES({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(zV,{})}),t.usePositions&&l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_MISSIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(FV,{})}),t.useAccreditations&&l&&e(Fe.Accreditation)&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(jV,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(iE,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PARAMETERS_STATE({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(pE,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_INTEGRATION({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(CS,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_EMAILS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(YS,{})}),l&&(0,i.jsx)(Cr.qh,{path:Fi.FORM_PREVIEW({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(yS,{})}),r&&(0,i.jsx)(Cr.qh,{path:Os.EVENT_DELEGATIONS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(zN,{})}),u&&(0,i.jsx)(Cr.qh,{path:Os.EVENT_VOLUNTEERS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(zO,{})}),h&&(0,i.jsx)(Cr.qh,{path:ms.POSITION_IMPORT_CSV({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(iU,{})}),c&&(0,i.jsx)(Cr.qh,{path:Os.EVENT_FILES_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(oS,{})}),c&&(0,i.jsx)(Cr.qh,{path:[BI.CREATE({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),BI.CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(zT,{})}),m&&(0,i.jsx)(Cr.qh,{path:WI.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(ZO,{})}),m&&(0,i.jsx)(Cr.qh,{path:WI.UPDATE({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(XO,{})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(BE,{children:(0,i.jsx)(Oq,{})})})]})},$q=()=>{const{organizationId:e,eventId:t}=Zn(),{data:n,loader:s}=Yn("query Event($organizationId: OrganizationId!, $eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n name\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},[Ms.UserPermissionsFragment]),{setSelectedEventId:o}=_I(),r=jc(),a=(0,M.useMemo)(()=>n.user?function(e){return e.roles.some(e=>cI.includes(e.type))}(n.user):void 0,[n.user]);if((0,M.useEffect)(()=>(o(t),()=>{o()}),[t]),s)return s;{const e=n.event.assignmentsStats;return(0,i.jsx)(qv,{isEventAdmin:a,userPermissions:n.user,children:(0,i.jsx)(Xv,{event:n.event,numberOfWaitingAccreditations:n.event.accreditationsStats.numberOfWaitingAccreditation,numberOfWaitingAssigments:a?e.numberOfWaitingAssignment+e.numberOfPreAssigned:e.numberOfPreAssigned,children:r?(0,i.jsx)(wq,{}):(0,i.jsx)(Rq,{})})})}};let Dq=class extends Pl{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 d.Ik().shape({header:this.documentInputService.documentInputSchemaNotRequired(),picture:this.documentInputService.documentInputSchemaNotRequired(),signature:d.Yj(),name:d.Yj().required(this.t("le_label_est_re_86986")),fromEmail:d.Yj().required(this.t("l_e_mail_de_l_56279")),fromName:d.Yj().required(this.t("le_nom_de_l_me_01331")),replyTo:d.Yj()})}createUpdateEmailSenderSchema(){return d.Ik().shape({emailSender:this.emailSenderInputSchema()})}};Dq=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn,fj])],Dq);const Pq=e=>{const{history:t,translate:n,params:{organizationId:s}}=cl(),{showNotification:o}=ib(),r=Gn(Dq),a=(0,M.useRef)(null),[l,d]=(0,M.useState)(e.initialValues.emailSender.isOrganizationDefault||eo(e.initialValues.emailSender.eventsIds)),[c,u]=(0,M.useState)(e.initialValues.emailSender.eventsIds.concat(e.initialValues.emailSender.isOrganizationDefault?["community"]:[]));return(0,i.jsx)(fl,{customErrorRef:a,height:1,initialValues:e.initialValues,render:({handleSubmit:t,submitting:o,values:r})=>{return(0,i.jsx)(zm,{button:e.isEdit&&(0,i.jsx)(jl,{isLoading:o,onClick:t,children:n("mettre_jour_l_14264")}),category:n("_metteur_d_e_ma_51878"),fallbackClosePath:Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s),title:e.isEdit?(h=e.initialValues.emailSender,m(h.fromName)?`${h.fromName} (${h.fromEmail})`:h.fromEmail):n("nouvel_metteur_58381"),children:(0,i.jsxs)(Em,{ref:a,children:[(0,i.jsx)(hl,{}),(0,i.jsx)(Rm,{hideToggle:!0,initialIsOpen:!0,title:n("informations_su_10889"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Rl,{label:"Label",name:"emailSender.name"}),(0,i.jsx)(Rl,{hint:n("les_e_mails_ser_70662"),label:n("nom_de_l_mette_49412"),name:"emailSender.fromName"}),(0,i.jsx)(Rl,{hint:n("les_e_mails_ser_62925"),isEmail:!0,label:n("e_mail_de_l_me_98374"),name:"emailSender.fromEmail"}),(0,i.jsx)(Rl,{hint:n("cette_adresse_r_36038",r.emailSender.fromEmail),isEmail:!0,label:(0,i.jsx)(_v,{children:n("adresse_de_r_po_86181")}),name:"emailSender.replyTo"}),(0,i.jsx)(vj,{accept:lv.Images,acl:"public-read",hint:n("chaque_e_mail_c_30386"),label:n("en_t_te_11987"),organizationId:s,prefix:"emailSender.header."}),(0,i.jsx)(Yj,{label:n("photo_de_profil_08618"),organizationId:s,prefix:"emailSender.picture."}),(0,i.jsx)(Tv,{label:n("signature_67521"),name:"emailSender.signature"}),(0,i.jsx)(vj,{accept:lv.Images,acl:"public-read",hint:n("chaque_e_mail_c_65078"),label:n("bas_de_page_86491"),organizationId:s,prefix:"emailSender.footer."}),(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(dc,{state:l?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:n("utiliser_cet_m_47949")}),l&&(0,i.jsxs)(Ra,{children:[(0,i.jsx)(Ba,{width:"6"}),(0,i.jsxs)(fc,{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)(Ba,{height:"5"}),(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{isLoading:o,textAlign:"center",onClick:t,children:e.isEdit?n("mettre_jour_l_14264"):n("cr_er_l_metteu_36451")})})]})});var h},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),o(e.isEdit?n("l_metteur_a_t_48335"):n("l_metteur_a_t_67653")),t.push(Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))}})},Fq=()=>{const{params:{organizationId:e}}=cl(),{data:t,loader:n}=Qr({organizationId:e}),s=Gn(Dq),{mutate:o}=function(e={}){return Kn("mutation EmailSenderCreate($organizationId: OrganizationId!, $emailSender: EmailsSenderInput!) {\n emailSenderCreate(organizationId: $organizationId, emailSender: $emailSender) {\n id\n }\n}\n",e)}();return n||(0,i.jsx)(Pq,{events:t.organization.events.nodes,initialValues:{emailSender:s.emailSenderInputDefault()},isEdit:!1,mutate:t=>o({organizationId:e,emailSender:t})})},Mq=()=>{const{params:{organizationId:e,emailSenderId:t}}=cl(),n=Gn(Dq),{data:s,loader:o}=Yn("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 Kn("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 o||(0,i.jsx)(Pq,{events:s.organization.events.nodes,initialValues:{emailSender:n.emailSenderInputDefault(s.organization.emailSender)},isEdit:!0,mutate:n=>r({organizationId:e,emailSenderId:t,emailSender:n})})},Nq=()=>{const{translate:e,params:{organizationId:t,emailSenderId:n}}=cl(),{data:s,loader:o}=Yn("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,M.useMemo)(()=>s.organization?s.organization.emailSender.from:"-",[s.organization]);return(0,i.jsx)(zm,{category:e("aper_u_d_un_me_46930"),fallbackClosePath:Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),title:r,children:o||(0,i.jsx)(br,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsx)(Xb,{content:s.organization.emailSender.preview,from:s.organization.emailSender.from,subject:e("e_mail_test_me_23293")})})})},Lq=hr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),Bq=hr("button",{background:"none",border:"none",color:"$error700",fontWeight:"$semiBold"}),Vq=()=>{const{organizationId:e}=Zn(),t=Xn(),{mutate:n}=ra(),s=Hn(),o=()=>{t.push(Os.ORGANIZATION_PARAMETERS(e))};return(0,i.jsx)(AG,{onClose:o,children:(0,i.jsxs)(Ra,{align:"center",direction:"column",children:[(0,i.jsx)(Ej,{color:"error",icon:"user-slash"}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Lq,{children:s("suppression_de_67160")}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:s("souhaitez_vous_30775")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(jl,{onClick:o,children:s("non_je_ne_souh_99960")}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Bq,{onClick:async()=>{await n({}),K()},children:s("oui_je_souhait_87268")})]})})},Uq=({icon:e,children:t,onClick:n})=>(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray800",fontWeight:"$medium"},gap:"5",onClick:n,children:[(0,i.jsx)(Ya,{icon:e}),(0,i.jsx)("span",{children:t})]}),Wq=hr(Ra,{background:"$white",borderRadius:"$2",boxShadow:"$sm",gap:"$6",padding:"$4 $3"}),Gq=hr("h3",{color:"$gray500",fontSize:"$textSm",margin:0}),Hq=hr(Ra,{backgroundColor:"$gray50",padding:"$6 $3",height:"100%"}),qq=hr("h1",{color:"$gray800",fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),Yq=({organization:e,user:t})=>{const{history:n,translate:s}=cl();return(0,i.jsxs)(Hq,{direction:"column",gap:"6",children:[(0,i.jsx)(qq,{children:s("profil_14444")}),(0,i.jsxs)(Ra,{align:"center",gap:"4",children:[(0,i.jsx)(qg,{email:t.email,image:t.userInfo.picture?.url,name:t.userInfo.name,size:64}),(0,i.jsx)(GH,{size:64,userInfo:{email:t.email,...t.userInfo}})]}),(0,i.jsx)(Wq,{direction:"column",children:(0,i.jsxs)(Ra,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(br,{css:{color:"$gray800",fontWeight:"$medium"},children:e.name}),(0,i.jsx)(jl,{onClick:()=>{n.push(Os.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(e.id))},children:s("changer_74000")})]})}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(Gq,{children:s("profil_14444")}),(0,i.jsx)(Wq,{direction:"column",children:(0,i.jsx)(Uq,{icon:"user-gear",onClick:()=>{n.push(Os.ORGANIZATION_PARAMETERS_PROFILE(e.id))},children:s("informations_pe_37892")})})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"2",children:[(0,i.jsx)(Gq,{children:s("g_n_ral_64953")}),(0,i.jsxs)(Wq,{direction:"column",children:[(0,i.jsx)(Uq,{icon:"shield",onClick:()=>{window.open(xd(gd(t?.language,new URL(location.href).searchParams)),"_blank")},children:s("cgu_51460")}),(0,i.jsx)(Uq,{icon:"circle-question",onClick:()=>{window.open("https://support.weezevent.com/fr/weezcrew","_blank")},children:s("aide_et_support_49790")})]})]}),(0,i.jsxs)(Wq,{direction:"column",children:[(0,i.jsx)(Uq,{icon:"arrow-left-from-line",onClick:K,children:s("se_d_connecter_74151")}),(0,i.jsx)(Uq,{icon:"user-xmark",onClick:()=>{n.push(Os.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(e.id))},children:s("supprimer_mon_c_07051")})]})]})},Kq=({organizations:e})=>{const{organizationId:t}=Zn(),[n,s]=(0,M.useState)(t),o=Hn(),r=Xn();return(0,i.jsxs)(Ra,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Ra,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(xR,{state:e.id===n?"checked":"unchecked",onClick:()=>s(e.id),children:e.name},e.id))}),(0,i.jsx)(Ba,{height:7}),(0,i.jsx)(jl,{onClick:()=>{r.push(Os.ORGANIZATION_PARAMETERS(n))},children:o("s_lectionner_l_18914")})]})},Zq=hr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),Xq=()=>{const{loader:e,data:t}=oa({}),{organization:n}=_I(),s=Hn(),o=Xn();return(0,i.jsxs)(AG,{onClose:()=>{o.push(Os.ORGANIZATION_PARAMETERS(n.id))},children:[(0,i.jsx)(Zq,{children:s("liste_de_vos_or_87919")}),e||(0,i.jsx)(Kq,{organizations:t.organizations})]})},Jq=({inputName:e})=>{const t=Hn(),n=Rc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{gap:"$6","@tablet":{gap:"$4","> *":{flexGrow:1,width:"auto"}}},wrap:"wrap",children:[(0,i.jsx)(Rl,{autoComplete:"given-name",label:t("pr_nom_66988"),name:`${e}fields.firstName`}),(0,i.jsx)(Rl,{autoComplete:"family-name",label:t("last_name"),name:`${e}fields.lastName`})]}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Rl,{autoComplete:"email",isEmail:!0,label:t("e_mail_13869"),name:`${e}email`}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(yj,{autoComplete:"language",label:t("Language"),name:`${e}fields.language`,children:n(hd)}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Z_,{label:t("Phone"),prefix:`${e}fields.phone.`})]})},Qq=hr(Ra,{backgroundColor:"$gray900",height:"110px",marginBottom:"$11","> *":{transform:"translateY(50%)",boxShadow:"$md"}}),eY=()=>{const{user:e}=_I();return(0,i.jsx)(Qq,{align:"end",justify:"center",children:(0,i.jsx)(qg,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:96})})},tY=()=>{const{organizationId:e}=Zn(),{data:t,loader:n}=Vo({organizationId:e}),s=Gn(VE),o=Gn(Da),{user:r}=ni(),{mutate:a,isLoading:l}=Uo(),d=Hn();return n||(0,i.jsx)(fl,{initialValues:{userInfo:s.userInfoProfileInputDefault(t.user)},render:({handleSubmit:e})=>(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(eY,{}),(0,i.jsxs)(OG,{children:[(0,i.jsx)(Jq,{inputName:"userInfo."}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(jl,{isLoading:l,textAlign:"center",onClick:e,children:d("enregistrer_06519")})]})]}),validate:o.validateForForm(s.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?K():r.language!==i&&location.reload()}})},nY=hr("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),iY=()=>{const{organizationId:e}=Zn(),t=Xn(),n=Hn();return(0,i.jsxs)(DG,{children:[(0,i.jsx)($G,{back:()=>{t.push(Os.ORGANIZATION_PARAMETERS(e))},children:(0,i.jsx)(_H,{children:(0,i.jsx)(nY,{children:n("informations_pe_37892")})})}),(0,i.jsx)(tY,{})]})},sY=()=>{const{organization:e,user:t}=_I();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{path:Os.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(iY,{})}),eo(e.events.nodes)&&(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(gG,{eventId:e.events.nodes[0].id,user:t,children:(0,i.jsx)(Yq,{organization:e,user:t})})})]}),(0,i.jsx)(Cr.dO,{children:(0,i.jsx)(Cr.qh,{path:Os.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(":organizationId"),children:(0,i.jsx)(Xq,{})})}),(0,i.jsx)(Cr.dO,{children:(0,i.jsx)(Cr.qh,{path:Os.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(":organizationId"),children:(0,i.jsx)(Vq,{})})})]})};var oY,rY;!function(e){e.AccreditationCategoryCreate="AccreditationCategoryCreate",e.AccreditationCategoryDelete="AccreditationCategoryDelete",e.AccreditationCategoryDuplicate="AccreditationCategoryDuplicate",e.AccreditationCategoryUpdate="AccreditationCategoryUpdate",e.AccreditationCreate="AccreditationCreate",e.AccreditationDuplicate="AccreditationDuplicate",e.AccreditationSlotDelete="AccreditationSlotDelete",e.AccreditationSlotUpdate="AccreditationSlotUpdate",e.AccreditationUpdate="AccreditationUpdate",e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsMassDelete="AccreditationsMassDelete",e.AccreditationsMassEdit="AccreditationsMassEdit",e.AccreditationsSlotsUsersInfosCheckIn="AccreditationsSlotsUsersInfosCheckIn",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",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.CustomFieldDuplicate="CustomFieldDuplicate",e.CustomFieldUpdate="CustomFieldUpdate",e.CustomFieldsMassDelete="CustomFieldsMassDelete",e.CustomFieldsMassEdit="CustomFieldsMassEdit",e.DelegationCategoryCreate="DelegationCategoryCreate",e.DelegationCategoryDelete="DelegationCategoryDelete",e.DelegationCategoryDuplicate="DelegationCategoryDuplicate",e.DelegationCategoryUpdate="DelegationCategoryUpdate",e.DelegationCreate="DelegationCreate",e.DelegationDuplicate="DelegationDuplicate",e.DelegationFormInvite="DelegationFormInvite",e.DelegationUpdate="DelegationUpdate",e.DelegationUpdateFields="DelegationUpdateFields",e.DelegationsCategoriesMassLeadersEdit="DelegationsCategoriesMassLeadersEdit",e.DelegationsExport="DelegationsExport",e.DelegationsImport="DelegationsImport",e.DelegationsImportResult="DelegationsImportResult",e.DelegationsMassDelete="DelegationsMassDelete",e.DelegationsMassEdit="DelegationsMassEdit",e.DelegationsMassLeadersEdit="DelegationsMassLeadersEdit",e.DelegationsMassMove="DelegationsMassMove",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderCreate="EmailSenderCreate",e.EmailSenderDelete="EmailSenderDelete",e.EmailSenderDuplicate="EmailSenderDuplicate",e.EmailSenderUpdate="EmailSenderUpdate",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EmailTemplateUpdate="EmailTemplateUpdate",e.EmailUpdate="EmailUpdate",e.EventDocumentUpdate="EventDocumentUpdate",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventDuplicate="EventDuplicate",e.EventInvite="EventInvite",e.EventLayerUpdate="EventLayerUpdate",e.EventOrganizationCreate="EventOrganizationCreate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventUpdate="EventUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.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.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.PositionsImport="PositionsImport",e.PositionsImportResult="PositionsImportResult",e.PositionsMassConditions="PositionsMassConditions",e.PositionsMassDelete="PositionsMassDelete",e.PositionsMassEdit="PositionsMassEdit",e.PositionsMassLeadersEdit="PositionsMassLeadersEdit",e.PositionsSlotsUsersInfosCheckIn="PositionsSlotsUsersInfosCheckIn",e.RoleCreate="RoleCreate",e.RoleDelete="RoleDelete",e.RoleDuplicate="RoleDuplicate",e.RoleUpdate="RoleUpdate",e.SegmentCreate="SegmentCreate",e.SegmentDelete="SegmentDelete",e.SegmentDuplicate="SegmentDuplicate",e.SegmentFolderCreate="SegmentFolderCreate",e.SegmentFolderDelete="SegmentFolderDelete",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentFolderUpdateName="SegmentFolderUpdateName",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveFolder="SegmentMoveFolder",e.SegmentMoveUp="SegmentMoveUp",e.SegmentUpdate="SegmentUpdate",e.SegmentUpdateMetadata="SegmentUpdateMetadata",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SendAccreditationsEmails="SendAccreditationsEmails",e.SendAssignmentsEmails="SendAssignmentsEmails",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataConnectionInfosDelete="SkidataConnectionInfosDelete",e.SkidataConnectionInfosUpsert="SkidataConnectionInfosUpsert",e.SkidataSynchronize="SkidataSynchronize",e.TagCreate="TagCreate",e.TagDelete="TagDelete",e.TagUpdateName="TagUpdateName",e.TeamAssign="TeamAssign",e.TeamAssignmentRefuse="TeamAssignmentRefuse",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TextMessageSend="TextMessageSend",e.TraceCreate="TraceCreate",e.TraceDelete="TraceDelete",e.TraceUpdate="TraceUpdate",e.TranslationUpdate="TranslationUpdate",e.UserAccessCreate="UserAccessCreate",e.UserAccessDelete="UserAccessDelete",e.UserAccessUpdate="UserAccessUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAccreditationsUpdate="UserInfoAccreditationsUpdate",e.UserInfoAdminCreate="UserInfoAdminCreate",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UserInfoPositionsUpdate="UserInfoPositionsUpdate",e.UserInfoSlotsUpdate="UserInfoSlotsUpdate",e.UserInfoUpdate="UserInfoUpdate",e.UserInfoUpdateField="UserInfoUpdateField",e.UserProfileUpdate="UserProfileUpdate",e.UserRolesDelete="UserRolesDelete",e.UsersInfosExport="UsersInfosExport",e.UsersInfosMassAddEvent="UsersInfosMassAddEvent",e.UsersInfosMassCampaignSend="UsersInfosMassCampaignSend",e.UsersInfosMassDelegationAdd="UsersInfosMassDelegationAdd",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UsersInfosMassDelete="UsersInfosMassDelete",e.UsersInfosMassEdit="UsersInfosMassEdit",e.UsersInfosMassFormAdd="UsersInfosMassFormAdd",e.UsersInfosMassFormRemove="UsersInfosMassFormRemove",e.UsersInfosMerge="UsersInfosMerge",e.VolunteerRegistrationAssignmentRefuse="VolunteerRegistrationAssignmentRefuse",e.VolunteerRegistrationDuplicate="VolunteerRegistrationDuplicate",e.VolunteerRegistrationTicketIdRegenerate="VolunteerRegistrationTicketIdRegenerate",e.VolunteerRegistrationUpdate="VolunteerRegistrationUpdate",e.VolunteerRegistrationUpdateField="VolunteerRegistrationUpdateField",e.VolunteersExport="VolunteersExport",e.VolunteersImport="VolunteersImport",e.VolunteersImportResult="VolunteersImportResult",e.VolunteersRegistrationsAccreditationsValidate="VolunteersRegistrationsAccreditationsValidate",e.VolunteersRegistrationsAdminAdd="VolunteersRegistrationsAdminAdd",e.VolunteersRegistrationsMassAccredit="VolunteersRegistrationsMassAccredit",e.VolunteersRegistrationsMassAccreditationStateUpdate="VolunteersRegistrationsMassAccreditationStateUpdate",e.VolunteersRegistrationsMassAssign="VolunteersRegistrationsMassAssign",e.VolunteersRegistrationsMassDelegationAdd="VolunteersRegistrationsMassDelegationAdd",e.VolunteersRegistrationsMassDelete="VolunteersRegistrationsMassDelete",e.VolunteersRegistrationsMassFormAdd="VolunteersRegistrationsMassFormAdd",e.VolunteersRegistrationsMassFormRemove="VolunteersRegistrationsMassFormRemove",e.VolunteersRegistrationsMassPreAssign="VolunteersRegistrationsMassPreAssign",e.VolunteersRegistrationsMassStateUpdate="VolunteersRegistrationsMassStateUpdate",e.VolunteersRegistrationsMassWishedAccreditationsUpdate="VolunteersRegistrationsMassWishedAccreditationsUpdate",e.WorkflowCreate="WorkflowCreate",e.WorkflowDuplicate="WorkflowDuplicate",e.WorkflowExecute="WorkflowExecute",e.WorkflowUpdate="WorkflowUpdate",e.WorkflowssMassDelete="WorkflowssMassDelete"}(oY||(oY={})),function(e){e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignEstimate="CampaignEstimate",e.DelegationsExport="DelegationsExport",e.DelegationsImportResult="DelegationsImportResult",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventLayerUpdate="EventLayerUpdate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.ExportResult="ExportResult",e.FormRegister="FormRegister",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.PositionsImportResult="PositionsImportResult",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveUp="SegmentMoveUp",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataSynchronize="SkidataSynchronize",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TranslationUpdate="TranslationUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UserProfileUpdate="UserProfileUpdate",e.UsersInfosExport="UsersInfosExport",e.VolunteersExport="VolunteersExport",e.VolunteersImportResult="VolunteersImportResult"}(rY||(rY={}));const aY=e=>{const t=Gn(Wc);return(0,i.jsxs)(Tc,{children:[(0,i.jsxs)(yc,{align:"center",gap:"3",children:[(0,i.jsx)(Ra,{align:"center",css:{background:"$primary300",borderRadius:"32px",color:"$primary600",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Ya,{icon:e.activity.icon})}),(0,i.jsx)(br,{font:"gray900 textSm medium",children:e.activity.text})]}),(0,i.jsx)(yc,{children:t.toLocaleString(e.activity.date.toLocal(),Zs.DateTime)})]})},lY=()=>{const{translate:e,params:{organizationId:t}}=cl(),[n,s]=(0,M.useState)([]),[o,r]=(0,M.useState)([]),[a,l]=(0,M.useState)(Bs.c9.invalid("Invalid")),[d,c]=(0,M.useState)(0),{data:u,isLoading:h}=Yn("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:o,date:a,offset:d},[]),{numberOfPages:m,totalCount:g}=vu(u.organization?.activities),p=(0,M.useMemo)(()=>{const t=Object.keys(rY);return Object.keys(oY).filter(e=>!t.includes(e)).map(t=>(0,i.jsx)("option",{value:t,children:e(t)},t))},[]);return(0,i.jsxs)($b,{css:{overflowY:"auto"},children:[(0,i.jsx)(Rb,{children:(0,i.jsx)(br,{font:"gray900 displayXs semiBold",children:e("activit_95747")})}),(0,i.jsx)(Ob,{children:(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:320,children:(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,placeholder:e("op_ration_25453"),values:n,onChange:s,children:p})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(fc,{isSearchVisible:!0,multiple:!0,placeholder:e("_v_nement_22345"),values:o,onChange:r,children:(u.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(br,{width:200,children:(0,i.jsx)(Tu,{value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("Description")}),(0,i.jsx)(Fc,{children:e("Date")})]}),numberOfPages:m,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):u.organization.activities.nodes.map((e,t)=>(0,i.jsx)(aY,{activity:e},t)),setOffset:c,totalCount:g})})]})},dY=e=>{const{translate:t}=cl(),[n,s]=(0,M.useState)(!1),[o,r]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(pP,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(NM,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},cY=()=>{const{translate:e,params:{organizationId:t}}=cl(),{canOrganizationParamEdit:n}=dS(),[s,o,r]=Pc(""),[a,l]=(0,M.useState)(-1),[d,c]=(0,M.useState)(0),{data:u,isLoading:h,reload:g}=Yn("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:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=vu(u.organization?.accreditationsCategories),x=(0,M.useMemo)(()=>(0,ic.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,M.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Fc,{children:e("_v_nement_22345")}),(0,i.jsx)(Fc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Fc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):u.organization.accreditationsCategories.nodes.map(e=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Vc,{to:Ji.ACCREDITATION_CATEGORY({organizationId:t,eventId:e.eventId,accreditationCategoryId:e.id}),children:e.name})}),(0,i.jsx)(yc,{children:_[e.eventId]??""}),(0,i.jsx)(yc,{children:e.numberOfAccreditations}),n&&(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsx)(dY,{accreditationCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},uY=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("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)(Pk,{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()}})},hY=e=>{const{mutate:t}=function(e={}){return Kn("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)(wC,{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})},mY=e=>{const{translate:t}=cl(),[n,s]=(0,M.useState)(!1),[o,r]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Ld,{color:0===e.customFieldCategory.numberOfCustomFields?"red":"disabled",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(hY,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(uY,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},gY=()=>{const{translate:e,params:{organizationId:t}}=cl(),{canOrganizationParamEdit:n}=dS(),[s,o,r]=Pc(""),[a,l]=(0,M.useState)(0),{data:d,isLoading:c,reload:u}=Yn("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:m(o)?o:void 0,offset:a},[]);const{numberOfPages:h,totalCount:g}=vu(d.organization?.customFieldsCategories);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Fc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Fc,{width:100})]}),numberOfPages:h,offset:a,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):d.organization.customFieldsCategories.nodes.map(e=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:e.name}),(0,i.jsx)(yc,{children:e.numberOfCustomFields}),n&&(0,i.jsx)(Uc,{justify:"end",children:(0,i.jsx)(mY,{customFieldCategory:e,organizationId:t,reload:u})})]},e.id)),setOffset:l,title:e("liste_des_cat_g_39450"),totalCount:g})]})},pY=e=>{const{translate:t}=cl(),[n,s]=(0,M.useState)(!1),[o,r]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(EC,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(Hw,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},fY=()=>{const{translate:e,params:{organizationId:t}}=cl(),{canOrganizationParamEdit:n}=dS(),[s,o,r]=Pc(""),[a,l]=(0,M.useState)(-1),[d,c]=(0,M.useState)(0),{data:u,isLoading:h,reload:g}=Yn("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:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=vu(u.organization?.delegationsCategories),x=(0,M.useMemo)(()=>(0,ic.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,M.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Fc,{children:e("_v_nement_22345")}),(0,i.jsx)(Fc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Fc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):u.organization.delegationsCategories.nodes.map(s=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Vc,{to:as.DELEGATION_CATEGORY({organizationId:t,eventId:s.eventId,delegationCategoryId:s.id}),children:s.name})}),(0,i.jsx)(yc,{children:s.eventId?_[s.eventId]??"":e("communaut_20896")}),(0,i.jsx)(yc,{children:s.numberOfDelegations}),n&&(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsx)(pY,{delegationCategory:s,reload:g})})]},s.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},xY=e=>{const{translate:t}=cl(),[n,s]=(0,M.useState)(!1),[o,r]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(HV,{eventId:e.positionCategory.eventId,positionCategoryId:e.positionCategory.id,positionCategoryName:e.positionCategory.name,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(TW,{eventId:e.positionCategory.eventId,positionCategory:e.positionCategory,onClose:()=>{r(!1)},onSuccess:e.reload})]})},_Y=()=>{const{translate:e,params:{organizationId:t}}=cl(),{canOrganizationParamEdit:n}=dS(),[s,o,r]=Pc(""),[a,l]=(0,M.useState)(-1),[d,c]=(0,M.useState)(0),{data:u,isLoading:h,reload:g}=Yn("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:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=vu(u.organization?.positionsCategories),x=(0,M.useMemo)(()=>(0,ic.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,M.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Oc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{width:200,children:(0,i.jsxs)(Au,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Fc,{children:e("_v_nement_22345")}),(0,i.jsx)(Fc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Fc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):u.organization.positionsCategories.nodes.map(e=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Vc,{to:ms.POSITION_CATEGORY({organizationId:t,eventId:e.eventId,positionCategoryId:e.id}),children:e.name})}),(0,i.jsx)(yc,{children:_[e.eventId]??""}),(0,i.jsx)(yc,{children:e.numberOfPositions}),n&&(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsx)(xY,{positionCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},IY=()=>{const{translate:e,params:{organizationId:t}}=cl();return(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(br,{font:"gray900 displayXs semiBold",children:e("cat_gories_24533")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Mb,{children:[(0,i.jsxs)(Pb,{children:[(0,i.jsx)(Db,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),children:e("champs_de_formu_64126")}),(0,i.jsx)(Db,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(t),children:e("missions_63972")}),(0,i.jsx)(Db,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(t),children:e("accr_ditations_39450")}),(0,i.jsx)(Db,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(t),children:e("d_l_gations_78318")})]}),(0,i.jsx)(Fb,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(gY,{})}),(0,i.jsx)(Fb,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(":organizationId"),children:(0,i.jsx)(_Y,{})}),(0,i.jsx)(Fb,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(":organizationId"),children:(0,i.jsx)(cY,{})}),(0,i.jsx)(Fb,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(":organizationId"),children:(0,i.jsx)(fY,{})})]})]})},vY=e=>{const{params:{organizationId:t},translate:n}=cl(),{data:s,loader:o}=Yn("query OrganizationSpaceDesign($organizationId: OrganizationId!, $spaceType: SpaceType!) {\n organization(id: $organizationId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n }\n}\n",{organizationId:t,spaceType:e.spaceType},[Ms.SpaceDesignFragment]);const{mutate:r}=function(e={}){return Kn("mutation OrganizationSpaceDesignUpdate(\n $organizationId: OrganizationId!\n $spaceDesign: DesignInput!\n $spaceType: SpaceType!\n) {\n organizationSpaceDesignUpdate(\n organizationId: $organizationId\n spaceDesign: $spaceDesign\n spaceType: $spaceType\n ) {\n id\n }\n}\n",e)}(),a=Gn(oE);return o||(0,i.jsx)(fl,{direction:"column",initialValues:{design:a.organizationDesignInputDefault(s.organization.spaceDesign)},render:({handleSubmit:e,submitting:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(rE,{organizationId:t,prefix:"design.",showLogo:!0,title:"Images"}),(0,i.jsxs)(Ib,{permissions:xb.ORGANIZATION_PARAM_EDIT,children:[(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:s,onClick:e,children:n("enregistrer_06519")})})]})]}),onSubmit:async n=>await r({organizationId:t,spaceDesign:n.design,spaceType:e.spaceType})})},bY=e=>{const{params:{organizationId:t},translate:n}=cl(),{isLoading:s,copy:o}=_S(),r=tg(t,e.linkPath),a=``.replace(/\s+/g," ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:n("DelegationSpaceLink")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Vc,{css:{color:"$primary700"},to:r,children:r}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:n("widget_21893")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{css:{"& pre":{border:"1px solid $gray300",borderRadius:"$2",padding:"$3"}},children:(0,i.jsx)("pre",{children:a})}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:s,leftIcon:"copy",onClick:()=>{o(a)},children:n("copier_le_code_99588")})}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:n("qr_code_du_lien_34278")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:sg(r,{height:100,width:100}),width:"100%"})})]})},jY=()=>{const{params:{organizationId:e},translate:t}=cl(),[n,s]=(0,M.useState)(Te.Code);return(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Fc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(GS,{isSelected:n===Te.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>s(Te.Code)})]})]}),(0,i.jsx)(br,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ra,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(qS,{emailType:n,eventId:null,formId:null,organizationId:e,source:Xe.DelegationsSpace})})]})]})},CY=e=>{const t=Hn(),n="badge"===e.type?e.badge:e.customDocument.slug;return(0,i.jsxs)(Ra,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Ra,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(Ya,{icon:"file-lines"})}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 textSm medium",children:"badge"===e.type?z_(e.badge):`${e.customDocument.event.name} - ${e.customDocument.name}`}),(0,i.jsx)(xu,{value:e.delegationsSpaceCustomBadges.includes(n),onChange:t=>{e.change("delegationsSpaceCustomBadges",no(e.delegationsSpaceCustomBadges,n,t))},children:t("document_t_l_ch_56704")})]})},yY=()=>{const{params:{organizationId:e},translate:t}=cl(),{data:n,loader:s}=Yn("query OrganizationDelegationSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customBadges\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n customDocuments {\n id\n slug\n name\n\n event {\n id\n name\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:o}=function(e={}){return Kn("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,M.useMemo)(()=>(0,ic.A)(n.organization?.customDocuments??[],e=>`${e.event.name} - ${e.name}`.toLowerCase()),[n.organization]);return s||(0,i.jsx)(fl,{direction:"column",initialValues:{allowDelegationSpaceDownload:n.organization.allowDelegationSpaceDownload,delegationsSpaceCustomBadges:n.organization.delegationsSpaceCustomBadges},render:({form:e,handleSubmit:s,submitting:o,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("team_area_setti_29458")}),(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:t("customize_the_s_92329")}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:320,children:t("allow_documents_96106")}),(0,i.jsx)(Bm,{name:"allowDelegationSpaceDownload",children:t("allow_delegatio_08622")})]}),a.allowDelegationSpaceDownload&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:320,children:t("documents_dispo_46996")}),(0,i.jsxs)(Ra,{css:{border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:[n.organization.customBadges.map(t=>(0,i.jsx)(CY,{badge:t,change:e.change,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"badge"},t)),r.map(t=>(0,i.jsx)(CY,{change:e.change,customDocument:t,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"customDocument"},t.id))]})]})]}),(0,i.jsxs)(Ib,{rolesTypes:dI,children:[(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:o,onClick:s,children:t("enregistrer_06519")})})]})]}),onSubmit:async t=>{await o({organizationId:e,delegationSpaceSettings:t})}})},kY=()=>{const{translate:e,params:{organizationId:t}}=cl();return(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(br,{font:"gray900 displayXs semiBold",children:e("espace_d_l_gati_59251")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Mb,{children:[(0,i.jsxs)(Pb,{children:[(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(vY,{spaceType:bt.DelegationSpace})}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(bY,{linkPath:ci(Ii.ORGANIZATION_DELEGATIONS({organizationId:t}))})}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(jY,{})}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(yY,{})})]})]})},AY=e=>{const t=Hn(),{isLoading:n,copy:s}=_S(),{isLoading:o,copy:r}=_S();return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{align:"center",css:{"& i":{cursor:"pointer"}},children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{width:20,children:n?(0,i.jsx)(Ya,{icon:"loader"}):(0,i.jsx)(Ya,{icon:"copy",onClick:()=>s(e.name)})})}),(0,i.jsx)(_m,{placement:"top",children:t("copier_75889")})]}),e.name]})}),(0,i.jsx)(yc,{width:100,children:e.type}),(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{align:"center",css:{"& i":{cursor:"pointer"}},gap:"1",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{width:20,children:o?(0,i.jsx)(Ya,{icon:"loader"}):(0,i.jsx)(Ya,{icon:"copy",onClick:()=>r(e.value)})})}),(0,i.jsx)(_m,{placement:"top",children:t("copier_75889")})]}),e.value]})})]})},wY=e=>{const t=Hn(),{mutate:n,isLoading:s}=function(e={}){return Kn("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)(Oc,{filters:(0,i.jsx)(i.Fragment,{children:e.domain.status===ye.Failed&&(0,i.jsx)(jl,{color:"white",isLoading:s,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)(Fc,{children:t("nom_08311")}),(0,i.jsx)(Fc,{width:100,children:t("type_35427")}),(0,i.jsx)(Fc,{children:t("valeur_22437")})]}),numberOfPages:0,offset:0,rows:(0,i.jsxs)(i.Fragment,{children:[e.domain.dnsEntries.map((e,t)=>(0,i.jsx)(AY,{name:e.name,type:e.type,value:e.value},t)),(0,i.jsx)(AY,{name:`_dmarc.${e.domain.name}`,type:"TXT",value:"v=DMARC1; p=quarantine; adkim=r;"})]}),setOffset:Hl.A,title:(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:t("liste_des_entr_35559",e.domain.name)}),e.domain.status===ye.Success&&(0,i.jsx)(Jd,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_05106")}),e.domain.status===ye.Pending&&(0,i.jsx)(Jd,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_31271")}),e.domain.status===ye.Failed&&(0,i.jsx)(Jd,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:t("la_v_rification_65771")})]}),totalCount:0})},SY=e=>{const{history:t,translate:n}=cl(),{data:s,loader:o,reload:r}=Yn("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 o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),0===s.organization.domains.length?(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{height:250,width:1,children:(0,i.jsx)(xk,{imageSrc:cd.DnsBlank,subtitle:n("pour_avoir_acc_02742"),title:n("les_entr_es_dns_52899")})}),(0,i.jsxs)(Ra,{gap:"3",justify:"center",children:[(0,i.jsx)(jl,{color:"white",onClick:()=>{open("https://support.weezevent.com/fr/param%C3%A9trer-ladresse-e-mail-de-lexp%C3%A9diteur")},children:n("lire_la_documen_25597")}),(0,i.jsx)(Ib,{rolesTypes:dI,children:(0,i.jsx)(jl,{onClick:()=>{t.push(Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("ajouter_un_met_38216")})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ja,{color:"gray",leftIcon:"circle-exclamation",children:n("les_entr_es_dns_55177")}),s.organization.domains.map((t,n)=>(0,i.jsxs)(M.Fragment,{children:[(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(wY,{domain:t,organizationId:e.organizationId,reload:r})]},n))]})]})},EY=e=>{const{history:t,translate:n}=cl(),{mutate:s}=function(e={}){return Kn("mutation EmailSenderDuplicate($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDuplicate(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:o}=function(e={}){return Kn("mutation EmailSenderDelete($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDelete(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:r}=function(e={}){return Kn("mutation EmailSenderVerificationResend(\n $organizationId: OrganizationId!\n $emailSenderId: EmailsSenderId!\n) {\n emailSenderVerificationResend(organizationId: $organizationId, emailSenderId: $emailSenderId)\n}\n",e)}(),[a,l]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{align:"center",css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ra,{align:"center",gap:"2",children:[(0,i.jsx)(br,{color:"gray800",fontWeight:"medium",children:e.emailSender.name}),!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Jd,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:n("e_mail_non_conf_40343")})]}),(0,i.jsx)(br,{color:"gray500",children:e.emailSender.from})]}),(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(jl,{color:"white",onClick:()=>{t.push(Os.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId,e.emailSender.id))},children:n("_diter_62574")})}),(0,i.jsx)(jl,{color:"white",onClick:()=>{t.push(Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(e.organizationId,e.emailSender.id))},children:n("aper_u_25595")}),(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsxs)(Pd,{children:[(0,i.jsx)(Ud,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Vd,{placement:"bottom-end",children:[!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Ld,{icon:"paper-plane",onClick:async()=>{await r({organizationId:e.organizationId,emailSenderId:e.emailSender.id})},children:n("r_envoyer_l_e_91472")}),(0,i.jsx)(Ld,{icon:"clone",onClick:async()=>{await s({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()},children:n("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:n("supprimer_43083")})]})]})})]}),a&&(0,i.jsx)(Pk,{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 o({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()}})]})},TY=e=>{const t=Hn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{font:"gray900 textLg medium",children:t("liste_des_mett_28960")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Ra,{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)(EY,{emailSender:t,organizationId:e.organizationId,reload:e.reload},t.id))})]})},zY=e=>{const{history:t,translate:n}=cl(),{data:s,loader:o,reload:r}=Yn("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,M.useState)(null),d=(0,M.useMemo)(()=>(s.organization?.emailsSenders??[]).filter(e=>!e.isValidToSendEmail),[s.organization]);return(0,M.useEffect)(()=>{!o&&s.organization.emailsSenders.length>0&&null===a&&l(s.organization.emailsSenders[0].id)},[o,a,s.organization?.emailsSenders,l]),o||(0===s.organization.emailsSenders.length?(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{height:250,width:1,children:(0,i.jsx)(xk,{subtitle:n("cr_er_des_mett_38995"),title:n("aucun_metteur_96777")})}),(0,i.jsx)(Ib,{rolesTypes:dI,children:(0,i.jsx)(Ra,{justify:"center",children:(0,i.jsx)(jl,{onClick:()=>{t.push(Os.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("cr_er_un_mette_14030")})})})]}):(0,i.jsxs)(i.Fragment,{children:[eo(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ja,{color:"error",leftIcon:"circle-exclamation",children:[n("veuillez_confir_10865"),(0,i.jsx)("ul",{children:d.map(e=>(0,i.jsx)("li",{children:e.fromEmail},e.id))})]})]}),(0,i.jsx)(TY,{emailsSenders:s.organization.emailsSenders,organizationId:e.organizationId,reload:r})]}))},OY=()=>{const{history:e,translate:t,params:{organizationId:n}}=cl(),s=location.pathname.endsWith("emails/senders");return(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ra,{children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray900 displayXs semiBold",children:t("e_mails_09850")}),(0,i.jsx)(br,{color:"gray500",children:t("param_trer_les_39470")})]}),s&&(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(jl,{onClick:()=>{e.push(Os.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n))},children:t("cr_er_une_nouve_77052")})})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Mb,{children:[(0,i.jsxs)(Pb,{children:[(0,i.jsx)(Db,{path:Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:t("_metteurs_74545")}),(0,i.jsx)(Db,{path:Os.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:t("entr_es_dns_11256")})]}),(0,i.jsx)(Fb,{path:Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:(0,i.jsx)(zY,{organizationId:n})}),(0,i.jsx)(Fb,{path:Os.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:(0,i.jsx)(SY,{organizationId:n})})]})]})};let RY=class extends Pl{constructor(e){super(e)}settingsInputSchema(){return d.Ik().shape({title:d.Yj().required(),description:d.Yj(),events:d.YO().of(d.Ik().shape({buttonText:d.Yj().required(),eventId:d.ai().required(),formId:d.ai().nullable()}))})}};RY=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],RY);const $Y=e=>(0,i.jsxs)(Ra,{as:"section",css:{bd:!0,inlineSize:"100%",backgroundColor:"$white",padding:"$6 $7",...e.css},direction:"column",gap:"6",children:[(e.title||e.subtitle)&&(0,i.jsx)(Ra,{align:"center",as:"header",gap:"3",children:(0,i.jsxs)(br,{as:"hgroup",css:{flex:"1"},children:[e.title&&(0,i.jsx)(ol,{textStyle:"heading",children:e.title}),e.subtitle&&(0,i.jsx)(tl,{textStyle:"subtitle",children:e.subtitle})]})}),e.children]}),DY=M.forwardRef(({shouldLightDismiss:e=!0,initialOpen:t=!1,isOpen:n,setIsOpen:s,onClose:o,children:r,...a},l)=>{const[d,c]=M.useState(t),u=M.useRef(null),h=n??d,m=s??c;return M.useEffect(()=>{const e=u.current;return h?function(e){e&&!e.open&&e.showModal()}(e):e?.close(),()=>{e?.close()}},[h]),M.useEffect(()=>{const t=u.current;function n(e){e.preventDefault(),e.stopPropagation(),a.onClose?.(),m(!1)}function i(e){const{target:t}=e;t instanceof Element&&"DIALOG"===t.nodeName&&n(e)}function s(e){"Escape"===e.code&&n(e)}return e&&t?.addEventListener("click",i),t?.addEventListener("keydown",s),()=>{e&&t?.removeEventListener("click",i),t?.removeEventListener("keydown",s)}},[e,m]),M.useImperativeHandle(l,()=>({close(){m(!1)},showModal(){m(!0)},isOpen:()=>h,addEventListener(e,t,n){u.current?.addEventListener(e,t,n)},removeEventListener(e,t,n){u.current?.removeEventListener(e,t,n)}}),[h,m]),(0,i.jsxs)(i.Fragment,{children:[false,(0,i.jsx)("dialog",{ref:u,"aria-describedby":a["aria-describedby"],"aria-description":a["aria-description"],"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],style:a.style,onClose:o,children:r})]})});DY.displayName="Dialog";const PY=({children:e,descId:t,labelId:n,isOpen:s,size:o,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)(DY,{"aria-describedby":t,"aria-labelledby":n,"data-testid":"modal-body",isOpen:s,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)(Ra,{align:"center",direction:"column",...a,children:e})})]}),FY=({heading:e,leftIcon:t,leftIconColor:n,leftIconBorder:s,setIsOpen:o,...r})=>{const{translate:a}=cl();return(0,i.jsxs)(Ra,{as:"header",css:{alignItems:"flex-start",alignSelf:"stretch",background:"$white",borderBlockEnd:"1px solid $gray200"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Ra,{css:{alignItems:"center",alignSelf:"stretch",padding:"$6 $7 $5 $7"},gap:"4",children:[t&&(0,i.jsx)(Ra,{align:"center",css:{padding:"$3",bd:!0,border:s},justify:"center",children:(0,i.jsx)(Ra,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Ya,{className:"fa-xl",color:n,icon:t})})}),(0,i.jsx)(Ra,{css:{alignItems:"flex-start",flex:1},direction:"column",justify:"center",children:e})]}),(0,i.jsx)(Ra,{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)(jl,{"aria-label":a("close_dialog_50926"),color:"invisible",css:{color:"$gray500",width:"$space$6",height:"$space$6",padding:0},textAlign:"center",onClick:()=>o(!1),children:(0,i.jsx)("i",{className:"far fa-xmark"})})}),r.children]})},MY=e=>(0,i.jsx)(Ra,{css:{alignSelf:"stretch",alignItems:"start",padding:"$6",overflowY:"auto",...e.css},direction:"column",gap:"6",children:e.children}),NY=({handleSubmit:e,isSubmitDisabled:t=!1,setIsOpen:n,submitStyle:s,submitText:o,...r})=>{const{translate:a}=cl();return(0,i.jsxs)(Ra,{as:"footer",css:{alignItems:"flex-end",alignSelf:"stretch",background:"$white",borderBlockStart:"1px solid $gray200",padding:"$6"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Ra,{align:"center",gap:"4",justify:"end",children:[(0,i.jsx)(jl,{color:"white",onClick:()=>n(!1),children:a("annuler_48254")}),(0,i.jsx)(jl,{color:s,disabled:t,onClick:()=>e(),children:o??a("submit_21373")})]}),r.children]})},LY=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(FY,{heading:(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(ol,{id:e.labelId,textStyle:"heading",children:e.heading}),e.subtitle&&(0,i.jsx)(tl,{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)(MY,{id:e.descId,children:e.children}),(0,i.jsx)(NY,{handleSubmit:()=>{e.setValue(),e.setIsOpen(!1)},setIsOpen:e.setIsOpen,submitStyle:e.submitStyle,submitText:e.submitText})]}),BY=({role:e,setShowModal:t,showModal:n,...s})=>{const[o,r]=(0,M.useState)(!1),a=Na();return(0,M.useEffect)(()=>(r(!(!n||o)),()=>{r(!1)}),[n]),(0,i.jsx)(PY,{descId:a.descId,isOpen:o,labelId:a.labelId,role:e,setIsOpen:r,size:"md",onClose:()=>{t(null)},children:(0,i.jsx)(LY,{descId:a.descId,labelId:a.labelId,setIsOpen:r,...s,children:s.children})})},VY=e=>{const{params:{organizationId:t},translate:n}=cl(),{data:s,loader:o}=Yn("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 o||(eo(s.organization.forms.nodes)?(0,i.jsxs)(Au,{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")}),s.organization.forms.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,title:n("you_have_no_for_84347")}))},UY=e=>{const{translate:t}=cl(),[n,s]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{!n&&e.linkedFormId&&e.setLinkedFormId(null)},[n,e.linkedFormId]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ol,{textStyle:"subheading",children:t("personnalisatio_98369")}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(Ol,{label:t("personnalisatio_58948"),value:e.buttonText,onChange:e.setButtonText}),(0,i.jsx)(xu,{value:n,onChange:s,children:(0,i.jsx)(br,{children:t("l_v_nement_est_24339")})}),n&&(0,i.jsx)(VY,{eventId:e.eventId,formId:e.linkedFormId,setFormId:e.setLinkedFormId})]})]})},WY=e=>{const{params:{organizationId:t},translate:n}=cl(),[s,o]=(0,M.useState)(void 0),[r,a]=(0,M.useState)(n("s_inscrire_20304")),[l,d]=(0,M.useState)(null),{data:c,loader:u}=Yn("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)(BY,{heading:n("nouvel_v_nemen_99684"),isSubmitDisabled:!s,leftIcon:"building",leftIconBorder:"gray200",leftIconColor:"gray800",setShowModal:e.setShowModal,setValue:()=>e.setValue({eventId:s,formId:l,buttonText:r}),showModal:e.showModal,submitText:n("ajouter_97327"),subtitle:n("ajouter_et_pers_06084"),children:e.eventIds&&u||(0,i.jsx)($Y,{children:eo(c.organization.events.nodes)?(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsxs)(Au,{label:n("quel_v_nement_57240"),shouldParseAsInt:!0,value:s??-1,onChange:o,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionner_un_57793")}),c.organization.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),s&&(0,i.jsx)(Ra,{css:{bd:!0,backgroundColor:"$gray50",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsx)(UY,{buttonText:r,eventId:s,linkedFormId:l,setButtonText:a,setLinkedFormId:d})})]}):(0,i.jsx)(xk,{imageSrc:cd.WeezeventBlankPerson,title:n("you_have_no_oth_58056")})})})},GY=e=>(0,i.jsx)(BY,{...e,leftIcon:"trash-can",leftIconBorder:"gray200",leftIconColor:"gray800",role:"alertdialog",submitStyle:"error"}),HY=e=>{const{translate:t}=cl(),[n,s]=(0,M.useState)(e.event.buttonText),[o,r]=(0,M.useState)(!!e.event.formId),[a,l]=(0,M.useState)(e.event.formId??null);return(0,M.useEffect)(()=>{!o&&a&&l(null)},[o,a]),(0,i.jsx)(BY,{heading:t("mettre_jour_l_28846"),leftIcon:"building",leftIconBorder:"gray800",leftIconColor:"gray200",setShowModal:e.setShowModal,setValue:()=>e.setValue({eventId:e.event.eventId,formId:a,buttonText:n}),showModal:e.showModal,submitText:t("ajouter_97327"),subtitle:t("personalise_the_05652"),children:(0,i.jsxs)($Y,{children:[(0,i.jsx)(ol,{textStyle:"subheading",children:t("personnalisatio_98369")}),(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(Ol,{label:t("personnalisatio_58948"),value:n,onChange:s}),(0,i.jsx)(xu,{value:o,onChange:r,children:(0,i.jsx)(br,{children:t("l_v_nement_est_24339")})}),o&&(0,i.jsx)(VY,{eventId:e.event.eventId,formId:a,setFormId:l})]})]})})},qY=e=>{const{translate:t}=cl(),[n,s]=(0,M.useState)(null),[o,r]=(0,M.useState)(null),a=(0,M.useMemo)(()=>e.events?.find(t=>t.id===e.showcaseEvent.eventId)?.name??"",[e.showcaseEvent,e.events]),l=(0,M.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)(Ra,{...e.draggableProvided.draggableProps,ref:e.draggableProvided.innerRef,align:"center",css:{padding:"$4 $6",borderBlockStart:"1px solid $gray200"},gap:"2",children:[(0,i.jsx)(br,{color:"gray300",css:{cursor:"pointer"},...e.draggableProvided.dragHandleProps,children:(0,i.jsx)(Ya,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Ra,{css:{alignItems:"center"},gap:"4",children:[(0,i.jsx)(tl,{textStyle:"subheading",children:a}),e.showcaseEvent.formId&&(0,i.jsx)(Jd,{leftIcon:"pen",children:t("linked_to_form_64790",l)})]}),(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsxs)(Ra,{gap:"2",children:[(0,i.jsx)(jl,{color:"white",leftIcon:"pen-line",onClick:()=>r(e.showcaseEvent.eventId)}),(0,i.jsx)(jl,{color:"white",leftIcon:"trash-can",onClick:()=>s(e.showcaseEvent.eventId)})]})]}),n&&n===e.showcaseEvent.eventId&&(0,i.jsx)(GY,{heading:t("vous_tes_sur_l_04795"),setShowModal:s,setValue:()=>{console.log("FOO"),e.form.change("events",oo(e.values.events,e.values.events.findIndex(t=>t.eventId===e.showcaseEvent.eventId)))},showModal:!!n,submitText:t("oui_supprimer_57212"),subtitle:t("la_suppression_96669"),children:(0,i.jsx)(tl,{children:t("vous_tes_sur_l_80749",a)})}),o&&o===e.showcaseEvent.eventId&&(0,i.jsx)(HY,{event:e.showcaseEvent,setShowModal:r,setValue:t=>{e.form.change("events",e.values.events.map(n=>n.eventId===e.showcaseEvent.eventId?t:n))},showModal:!!o})]})},YY=e=>{const{translate:t}=cl(),n=(0,M.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.form.change("events",so(e.values.events,n.index,i.index))},[e.values.events,e.form]);return(0,i.jsx)(uu.JY,{onDragEnd:n,children:(0,i.jsx)(uu.gL,{droppableId:"main",type:"accreditation",children:n=>(0,i.jsx)(Ra,{css:{bd:!0,"& > div:first-child":{borderBlockStart:"none !important"}},direction:"column",...n.droppableProps,ref:n.innerRef,children:eo(e.values.events)?(0,i.jsxs)(i.Fragment,{children:[e.values.events.map((t,n)=>(0,i.jsx)(uu.sx,{draggableId:`a-${t.eventId}`,index:n,children:n=>(0,i.jsx)(qY,{draggableProvided:n,showcaseEvent:t,...e},t.eventId)},t.eventId)),n.placeholder]}):(0,i.jsx)(br,{css:{padding:"$4"},children:(0,i.jsx)(xk,{title:t("no_events_selec_80121")})})})})})},KY=()=>{const{history:e,params:{organizationId:t},translate:n}=cl(),[s,o]=(0,M.useState)(!1),{data:r,loader:a}=Yn("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 description\n events {\n eventId\n buttonText\n formId\n }\n }\n }\n}\n",{organizationId:t},[]),{mutate:l}=function(e={}){return Kn("mutation OrganizationEventsShowcaseSettingsUpdate(\n $organizationId: OrganizationId!\n $eventsShowcaseSettings: EventsShowcaseSettingsInput!\n) {\n organizationEventsShowcaseSettingsUpdate(\n organizationId: $organizationId\n eventsShowcaseSettings: $eventsShowcaseSettings\n ) {\n id\n }\n}\n",e)}(),d=Gn(Da),c=Gn(RY);return a||(0,i.jsx)(fl,{direction:"column",initialValues:{title:r.organization.eventsShowcaseSettings.title??n("liste_des_v_ne_29929"),description:r.organization.eventsShowcaseSettings.description??n("visualiser_tous_33187"),events:r.organization.eventsShowcaseSettings.events??[]},mutators:{setValue:([e,t],n,{changeValue:i})=>i(n,e,()=>t)},render:({form:a,handleSubmit:l,submitting:d,values:c})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("contenu_persona_18596")}),(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:n("personnaliser_l_96679")}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:n("titre_de_l_intr_54141")}),(0,i.jsx)(Rl,{name:"title"})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:n("contenu_29668")}),(0,i.jsx)(Rl,{name:"description"})]}),(0,i.jsxs)(Ib,{permissions:xb.ORGANIZATION_PARAM_EDIT,children:[(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(jl,{isLoading:d,onClick:l,children:n("enregistrer_06519")}),(0,i.jsx)(jl,{color:"invisible-gray",onClick:()=>e.goBack(Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:t})),children:n("annuler_48254")})]})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("difusion_des_v_78418")}),(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:n("personnaliser_l_19452")})]}),(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Ra,{gap:"4",justify:"end",children:(0,i.jsx)(jl,{onClick:()=>o(!0),children:n("ajouter_un_v_n_49943")})})})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(YY,{events:r.organization.events.nodes,form:a,forms:r.organization.forms.nodes,values:c}),s&&(0,i.jsx)(WY,{eventIds:c.events.map(e=>e.eventId),setShowModal:o,setValue:e=>{a.change("events",[...c.events,e])},showModal:s})]}),validate:d.validateForForm(c.settingsInputSchema()),onSubmit:async e=>{await l({organizationId:t,eventsShowcaseSettings:e})}})},ZY=()=>{const{translate:e,params:{organizationId:t}}=cl();return(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(br,{font:"gray900 displayXs semiBold",children:e("site_vitrine_17673")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Mb,{children:[(0,i.jsxs)(Pb,{children:[(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(vY,{spaceType:bt.EventsShowcase})}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(bY,{linkPath:Bi.EVENTS({organizationId:t})})}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(KY,{})})]})]})},XY=e=>{const{history:t,translate:n,params:{organizationId:s}}=cl(),o=Gn(H_),r=Gn(su),{mutate:a,isLoading:l}=function(e={}){return Kn("mutation OrganizationUpdateInfos(\n $organizationId: OrganizationId!\n $organization: OrganizationInfosInput!\n) {\n organizationUpdateInfos(organizationId: $organizationId, organization: $organization) {\n id\n }\n}\n",e)}(),d=(0,M.useMemo)(()=>({organization:e.initialValues}),[e.initialValues]),c=(0,M.useMemo)(()=>V_.map((e,t)=>(0,i.jsx)("option",{value:e,children:e},t)),[]),u=Bs.c9.now();return(0,i.jsx)(fl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:d,render:({form:o,handleSubmit:a,values:d})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HE,{change:o.change,changeCity:!0,changeCountry:!0,changeLatLng:!1,changePostalCode:!0,name:"place",prefix:"organization."}),(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:n("organisation_71863")}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",width:280,children:n("_propos_de_l_o_80406")}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Rl,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Wj,{addressName:"organization.street",label:n("Address"),placeName:"place"}),(0,i.jsx)(Rl,{label:n("code_postal_40328"),name:"organization.postalCode"}),(0,i.jsx)(Rl,{label:n("ville_67740"),name:"organization.city"}),(0,i.jsx)(Mm,{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)(Mm,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"organization.timeZone",children:c})]})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",width:280,children:n("responsable_de_20624")}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Rl,{label:n("nom_du_responsa_44907"),name:"organization.adminName"}),(0,i.jsx)(Rl,{isEmail:!0,label:n("e_mail_du_respo_66060"),name:"organization.adminEmail"})]})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",width:280,children:n("_metteur_de_e_m_77028")}),(0,i.jsx)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:(0,i.jsx)(Mm,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"organization.emailSenderId",onCreateClick:()=>{t.push(Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{font:"gray700 textSm medium",width:280,children:n("date_time_for_13370")}),(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Rl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.dateFormat)),label:n("format_de_date_82059"),name:"organization.dateFormat"}),(0,i.jsx)(Rl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.datetimeFormat)),label:n("format_de_date_24474"),name:"organization.datetimeFormat"}),(0,i.jsx)(Rl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.timeFormat)),label:n("format_d_heure_46798"),name:"organization.timeFormat"})]})]}),(0,i.jsxs)(Ib,{rolesTypes:dI,children:[(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:l,onClick:a,children:n("enregistrer_les_30411")})})]})]}),schema:o.updateOrganizationGeneralSchema(),width:1,onSubmit:async e=>{await a({organizationId:s,organization:e.organization})}})},JY=()=>{const e=Gn(H_),{organizationId:t}=Zn(),{data:n,loader:s}=Do({organizationId:t});return s||(0,i.jsx)(XY,{emailsSenders:n.organization.emailsSenders,initialValues:e.organizationInfosInputDefault(n.organization)})},QY=()=>{const e=Hn(),{organizationId:t}=Zn(),{data:n,loader:s}=Yn("query Invoices($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n invoices {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n paidAt\n url\n insertedAt\n isRefunded\n }\n }\n}\n",{organizationId:t},[]);return s||(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,children:[(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("factures_03552")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("num_ro_de_factu_68150")}),(0,i.jsx)(Fc,{children:e("Date")}),(0,i.jsx)(Fc,{children:e("montant_55595")}),(0,i.jsx)(Fc,{children:e("status_06428")}),(0,i.jsx)(Fc,{})]}),numberOfPages:1,offset:0,rows:(0,i.jsx)(i.Fragment,{children:n.organization.invoices.map((e,t)=>(0,i.jsx)(Kc,{invoice:e,isBackoffice:!1,showColumn:()=>!0},t))}),setOffset:Hl.A,title:e("factures_03552"),totalCount:0})]})},eK=()=>{const{params:{organizationId:e},translate:t}=cl(),[n,s]=(0,M.useState)(Te.Code);return(0,i.jsxs)(Ra,{direction:"column",width:1,children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsxs)(Ra,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsxs)(vc,{children:[(0,i.jsx)(xc,{children:(0,i.jsx)(Fc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(GS,{isSelected:n===Te.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>s(Te.Code)})]})]}),(0,i.jsx)(br,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ra,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(qS,{emailType:n,eventId:null,formId:null,organizationId:e,source:Xe.MembersSpace})})]})]})},tK=()=>{const{params:{organizationId:e},translate:t}=cl(),{data:n,loader:s}=Yn("query OrganizationMembersSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n }\n}\n",{organizationId:e},[]),{mutate:o}=function(e={}){return Kn("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 s||(0,i.jsx)(fl,{direction:"column",initialValues:{hideAssignmentsUntilConfirmationEmailSent:n.organization.hideAssignmentsUntilConfirmationEmailSent,hideAccreditationsUntilConfirmationEmailSent:n.organization.hideAccreditationsUntilConfirmationEmailSent},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("param_tres_de_l_83556")}),(0,i.jsx)(br,{color:"gray500",fontWeight:"medium",children:t("personnalisez_l_44387")}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:t("diffusion_des_a_83706")}),(0,i.jsx)(Bm,{name:"hideAssignmentsUntilConfirmationEmailSent",children:t("afficher_les_af_06759")})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{gap:"7",children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:300,children:t("diffusion_des_a_32535")}),(0,i.jsx)(Bm,{name:"hideAccreditationsUntilConfirmationEmailSent",children:t("afficher_les_ac_55704")})]}),(0,i.jsxs)(Ib,{rolesTypes:dI,children:[(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:n,onClick:e,children:t("enregistrer_06519")})})]})]}),onSubmit:async t=>{await o({organizationId:e,membersSpaceSettings:t})}})},nK=()=>{const{translate:e,params:{organizationId:t}}=cl();return(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(br,{font:"gray900 displayXs semiBold",children:e("espace_membres_90896")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Mb,{children:[(0,i.jsxs)(Pb,{children:[(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Db,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(vY,{spaceType:bt.MembersSpace})}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(bY,{linkPath:ci(Ii.ORGANIZATION({organizationId:t}))})}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(eK,{})}),(0,i.jsx)(Fb,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(tK,{})})]})]})},iK=e=>{const t=Jn(),n=e.isActive?e.isActive(t.pathname):t.pathname===e.path;return(0,i.jsx)(Ha,{to:e.path,children:(0,i.jsxs)(bj,{active:n,css:{gap:"$3",justifyContent:"flex-start",px:"$3",width:"100%"},children:[(0,i.jsx)(br,{width:20,children:(0,i.jsx)(Ya,{icon:e.icon})}),(0,i.jsx)(br,{children:e.title})]})})},sK=e=>{const{localOrganization:t,updateLocalOrganization:n}=_I(),[s,o]=M.useState(t?.areParametersMenuSectionsOpen?.[e.name]??!0),r=M.useCallback(async i=>{o(i),await n({areParametersMenuSectionsOpen:(0,Ua.A)(t?.areParametersMenuSectionsOpen,{[e.name]:i})})},[t,s,o]);return(0,i.jsxs)(Ra,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$1",paddingTop:"$4"},direction:"column",children:[(0,i.jsxs)(Ra,{align:"center",css:{color:"$gray800",cursor:"pointer",px:"$5"},gap:"3",onClick:async()=>{await r(!s)},children:[(0,i.jsx)(br,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(br,{css:{fontSize:"10px"},children:(0,i.jsx)(Ya,{icon:s?"chevron-down":"chevron-up"})})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(Ra,{css:{px:"$3"},direction:"column",children:e.children})]})]})},oK=()=>{const{translate:e,params:{organizationId:t}}=cl();Td(e("param_tres_78420"));const{isOrganizationAdmin:n,isOrganizationReader:s,hasFeature:o}=_I(),{canOrganizationParamRead:r,canOrganizationUserRead:a}=dS();return(0,i.jsx)(Ra,{as:Ta.Nav,css:{background:"$gray100",overflowY:"auto",py:"$2"},height:1,children:(0,i.jsxs)(Ra,{"aria-orientation":"vertical",direction:"column",role:"menubar",width:240,children:[(0,i.jsxs)(sK,{name:"general",title:e("g_n_ral_64953"),children:[(0,i.jsx)(iK,{icon:"user",path:Os.ORGANIZATION_PARAMETERS_PROFILE(t),title:e("mon_profil_48224")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iK,{icon:"building",path:Os.ORGANIZATION_PARAMETERS_INFOS(t),title:e("organisation_71863")}),(0,i.jsx)(iK,{icon:"wave-pulse",path:Os.ORGANIZATION_PARAMETERS_ACTIVITY(t),title:e("activit_95747")})]})]}),r&&(0,i.jsxs)(sK,{name:"parameters",title:e("param_tres_78420"),children:[(0,i.jsx)(iK,{icon:"star",isActive:e=>e.includes(Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:t})),path:Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:t}),title:e("site_vitrine_17673")}),(0,i.jsx)(iK,{icon:"address-card",isActive:e=>e.includes(Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:t})),path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),title:e("espace_membres_90896")}),o(Fe.Delegation)&&(0,i.jsx)(iK,{icon:"users",isActive:e=>e.includes(Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:t})),path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),title:e("espace_d_l_gati_59251")}),(0,i.jsx)(iK,{icon:"at",isActive:e=>e.includes(Os.ORGANIZATION_PARAMETERS_EMAILS(t)),path:Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),title:e("e_mails_09850")}),(0,i.jsx)(iK,{icon:"layer-group",isActive:e=>e.includes(Os.ORGANIZATION_PARAMETERS_CATEGORIES(t)),path:Os.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),title:e("cat_gories_24533")}),(0,i.jsx)(iK,{icon:"tag",path:Os.ORGANIZATION_PARAMETERS_TAGS(t),title:e("tags_79499")}),(0,i.jsx)(iK,{icon:"language",path:Os.ORGANIZATION_PARAMETERS_TRANSLATIONS(t),title:e("traductions_88349")})]}),a&&(0,i.jsxs)(sK,{name:"users",title:e("utilisateurs_04975"),children:[(0,i.jsx)(iK,{icon:"user-group",path:Os.ORGANIZATION_PARAMETERS_TEAM(t),title:e("utilisateurs_04975")}),(0,i.jsx)(iK,{icon:"shield",path:Os.ORGANIZATION_PARAMETERS_ROLES(t),title:e("r_les_et_permis_27853")})]}),n&&(0,i.jsx)(sK,{name:"subscription",title:e("abonnement_98940"),children:(0,i.jsx)(iK,{icon:"receipt",path:Os.ORGANIZATION_PARAMETERS_INVOICES(t),title:e("factures_03552")})}),s&&o(Fe.Skidata)&&(0,i.jsx)(sK,{name:"integrations",title:e("int_grations_88619"),children:(0,i.jsx)(iK,{icon:"person-skiing",path:Os.ORGANIZATION_PARAMETERS_SKIDATA(t),title:"Skidata"})})]})})},rK=()=>{const{translate:e,params:{organizationId:t}}=cl(),{data:n,loader:s}=Vo({organizationId:t}),o=Gn(VE),r=Gn(Da),{mutate:a,isLoading:l}=Uo(),{mutate:d}=ra(),{user:c}=ni(),{reload:u}=_I(),[h,m]=(0,M.useState)(!1);return s||(0,i.jsx)(fl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:{userInfo:o.userInfoProfileInputDefault(n.user)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mon_profil_48224")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e("informations_pe_37892")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(vj,{accept:lv.Images,acl:"public-read",allowCrop:!0,label:e("photo_de_profil_08618"),organizationId:t,prefix:"userInfo.fields.picture."}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Jq,{inputName:"userInfo."}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e("compte_16579")}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(br,{color:"error700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{m(!0)},children:e("supprimer_mon_c_07051")}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:l,onClick:n,children:e("enregistrer_les_30411")})}),h&&(0,i.jsx)(Pk,{buttonText:"Supprimer",subtext:e("_tes_vous_s_r_d_50084"),text:e("supprimer_mon_c_07051"),onClose:()=>{m(!1)},onDelete:async()=>{await d({}),K()}})]}),validate:r.validateForForm(o.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?K():u()}})},aK=()=>{const{organizationId:e}=Zn(),t=Hn();return(0,i.jsxs)(Ra,{align:"center",gap:"6",children:[(0,i.jsx)(br,{color:"gray900",css:{flexGrow:1},fontSize:"displayXs",fontWeight:"semiBold",children:t("r_les_et_permis_27853")}),(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(jl,{to:Os.CREATE_ORGANIZATION_PARAMETERS_ROLE(e),children:t("cr_er_un_nouvea_53551")})})]})},lK=({role:e})=>{const{organizationId:t}=Zn(),n=Hn(),{data:s,isLoading:o}=Yn("query RoleUses($organizationId: OrganizationId!, $roleId: RoleId!) {\n organization(id: $organizationId) {\n role(id: $roleId) {\n uses {\n __typename\n\n ... on UsersEvent {\n userInfo {\n id\n name\n }\n event {\n id\n name\n }\n }\n\n ... on UsersPosition {\n userInfo {\n id\n name\n }\n position {\n id\n name\n }\n }\n\n ... on UsersPositionsCategory {\n userInfo {\n id\n name\n }\n positionCategory {\n id\n name\n }\n }\n\n ... on UsersDelegationsCategory {\n userInfo {\n id\n name\n }\n delegationCategory {\n id\n name\n }\n }\n }\n }\n }\n}\n",{organizationId:t,roleId:e.id},[]);if(o)return(0,i.jsx)(ec,{borderRadius:"$1",height:18,width:160});{const e=s.organization.role.uses;if(0===e.length)return(0,i.jsx)("div",{children:n("ce_r_le_n_est_p_61959")});{const t=(0,nc.A)(e,e=>e.userInfo.id);return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:n("les_responsable_31151")}),Object.entries(t).map(([e,t])=>(0,i.jsxs)("dl",{children:[(0,i.jsx)("dt",{children:n("_1_sur_84610",t[0].userInfo.name)}),t.map(e=>"UsersEvent"===e.__typename?(0,i.jsx)("dd",{children:n("l_v_nement_1_80078",e.event.name)},e.event.id):"UsersPosition"===e.__typename?(0,i.jsx)("dd",{children:n("la_mission_1_50232",e.position.name)},e.position.id):"UsersPositionsCategory"===e.__typename?(0,i.jsx)("dd",{children:n("la_cat_gorie_1_00613",e.positionCategory.name)},e.positionCategory.id):(0,i.jsx)("dd",{children:n("la_cat_gorie_1_00613",e.delegationCategory.name)},e.delegationCategory.id))]},e))]})}}},dK=({onClose:e,onDelete:t,role:n})=>{const s=Hn(),{organizationId:o}=Zn(),{mutate:r}=function(e={}){return Kn("mutation RoleDelete($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDelete(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(Pk,{buttonText:s("supprimer_43083"),text:s("suppression_de_73669",n.name),onClose:e,onDelete:()=>r({organizationId:o,roleId:n.id}).then(e=>(t(),e)),children:(0,i.jsx)(lK,{role:n})})},cK=({onDelete:e,role:t})=>{const{history:n,translate:s,params:{organizationId:o}}=cl(),{mutate:r}=function(e={}){return Kn("mutation RoleDuplicate($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDuplicate(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}(),{canOrganizationUserEdit:a}=dS(),[l,d]=(0,M.useState)(!1),c=(0,M.useMemo)(()=>a&&t.type===xt.Custom,[a,t]),u=async()=>{const{roleDuplicate:e}=await r({organizationId:o,roleId:t.id});n.push(Os.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,e.id))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ld,{icon:"pen",onClick:()=>{n.push(Os.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,t.id))},children:s("_diter_62574")}),(0,i.jsx)(Ld,{icon:"clone",onClick:u,children:s("dupliquer_28256")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{$d(e.target),d(!0)},children:s("supprimer_43083")})]}),t.type!==xt.Custom&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ld,{icon:"eye",onClick:()=>{n.push(Os.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,t.id))},children:s("voir_36533")}),(0,i.jsx)(Ld,{icon:"clone",onClick:u,children:s("dupliquer_28256")})]})]}),l&&(0,i.jsx)(dK,{role:t,onClose:()=>{d(!1)},onDelete:e})]})},uK=()=>{const{history:e,translate:t,params:{organizationId:n}}=cl(),{canOrganizationUserEdit:s}=dS(),{data:o,isLoading:r,reload:a}=Yn("query Roles($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n roles {\n id\n name\n description\n accessLevel\n type\n }\n }\n}\n",{organizationId:n},[]),{showNotification:l}=ib(),d=(0,M.useMemo)(()=>(0,ic.A)(o.organization?.roles??[],e=>[e.accessLevel===ft.Organization?1:e.accessLevel===ft.Event?2:e.accessLevel===ft.Position?3:4,u(e.name)]),[o.organization]),c=()=>{l({color:"success",text:t("le_r_le_a_bien_53462")}),a()};return(0,i.jsx)(gm,{"aria-busy":r,css:{height:"auto",overflow:"visible","& > div:first-child":{borderRadius:"$2 $2 0 0"},"& > div:last-child":{borderBottom:"1px solid $gray200",borderRadius:"0 0 $2 $2"}},headerRow:(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:t("nom_du_r_le_38492")}),(0,i.jsx)(Fc,{children:t("niveau_d_acc_s_29898")}),(0,i.jsx)(Fc,{css:{flexGrow:2},children:t("description_du_94520")}),s&&(0,i.jsx)(Fc,{width:100})]}),children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Mc,{css:{borderBottom:"none"}})]}):d.map(o=>(0,i.jsxs)(Tc,{css:{cursor:"pointer","&:hover":{background:"$gray100"},"&:last-child":{borderBottom:"none"}},onClick:()=>{e.push(Os.EDIT_ORGANIZATION_PARAMETERS_ROLE(n,o.id))},onMouseLeave:e=>{$d(e.target)},children:[(0,i.jsx)(yc,{children:(0,i.jsx)(br,{ellipsis:!0,title:o.name,children:o.name})}),(0,i.jsx)(yc,{children:o.accessLevel===ft.Organization?t("administrateur_10076"):o.accessLevel===ft.Event?t("administrateur_99393"):o.accessLevel===ft.Position?t("responsable_de_82794"):t("responsable_de_75445")}),(0,i.jsx)(yc,{css:{flexGrow:2,minWidth:0},children:(0,i.jsx)(br,{ellipsis:!0,title:o.description,children:o.description})}),s&&(0,i.jsx)(Uc,{justify:"end",children:(0,i.jsx)(cK,{role:o,onDelete:c})})]},o.id))})},hK=()=>{const e=Hn();return(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$6 $7"},direction:"column",gap:"6",height:1,children:[(0,i.jsx)(aK,{}),(0,i.jsx)(Qa.Root,{children:(0,i.jsxs)(Qa.Titled,{children:[(0,i.jsx)(Qa.Title,{icon:"circle-info",children:e("contr_ler_les_p_50104")}),(0,i.jsx)(Qa.Text,{children:e("les_r_les_aiden_19371")})]})}),(0,i.jsx)(uK,{})]})};let mK=class extends Pl{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??""}}};mK=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],mK);const gK=e=>{const t=Hn(),n=Gn(Wc),{mutate:s}=function(e={}){return Kn("mutation SkidataConnectionInfoSeaonEventAdd($organizationId: OrganizationId!, $eventId: EventId!) {\n skidataConnectionInfoSeaonEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:o}=function(e={}){return Kn("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 Kn("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 Kn("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)(Ra,{gap:"3",width:1,children:[(0,i.jsxs)(Ra,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",children:e.title}),(0,i.jsx)(br,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(br,{width:1,children:(0,i.jsxs)(vc,{children:[(0,i.jsxs)(xc,{children:[(0,i.jsx)(Fc,{children:t("nom_de_l_v_nem_08711")}),(0,i.jsx)(Fc,{children:t("Date")}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{}),(0,i.jsx)(Fc,{})]}),"synchronized"===e.eventType&&(0,i.jsx)(Fc,{}),"season"===e.eventType&&(0,i.jsx)(Fc,{})]}),eo(e.events)?e.events.map(l=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(br,{color:"gray800",width:1,children:l.name})}),(0,i.jsx)(yc,{children:O_(n,l.startAt,l.endAt)}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:async()=>{await r({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("synchroniser_34754")})}),(0,i.jsx)(yc,{onClick:async()=>{await s({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(br,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("_v_nement_saiso_67885")})})]}),"synchronized"===e.eventType&&(0,i.jsx)(yc,{onClick:async()=>{await a({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(br,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})}),"season"===e.eventType&&(0,i.jsx)(yc,{onClick:async()=>{await o({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(br,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})})]},l.id)):(0,i.jsx)(Tc,{css:{height:"auto"},children:(0,i.jsx)(yc,{children:(0,i.jsxs)(Ra,{align:"center",css:{padding:"$8"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Ej,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(br,{fontSize:"textMd",fontWeight:"medium",children:t("aucun_v_nement_39620")})]})})})]})})]})},pK=()=>{const e=Hn(),{organizationId:t}=Zn(),n=Gn(mK),{data:s,loader:o,reload:r}=Yn("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 Kn("mutation SkidataConnectionInfosDelete($organizationId: OrganizationId!) {\n skidataConnectionInfosDelete(organizationId: $organizationId) {\n organizationId\n }\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return Kn("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 Kn("mutation SkidataSynchronize($organizationId: OrganizationId!) {\n skidataSynchronize(organizationId: $organizationId)\n}\n",e)}(),h=(0,M.useMemo)(()=>s.organization?.events.nodes??[],[s.organization]),m=(0,M.useMemo)(()=>h.map(({id:e})=>e),[h]),g=(0,M.useMemo)(()=>s.organization?.skidataConnectionInfos?.synchronizedEventsIds??[],[s.organization]),p=(0,M.useMemo)(()=>s.organization?.skidataConnectionInfos?.seasonEventsIds??[],[s.organization]),f=(0,M.useMemo)(()=>{const e=(0,oc.A)(m,g.concat(p));return h.filter(t=>e.includes(t.id))},[h,g,p]),x=(0,M.useMemo)(()=>h.filter(e=>g.includes(e.id)),[h]),_=(0,M.useMemo)(()=>h.filter(e=>p.includes(e.id)),[h,p]);return o||(0,i.jsx)(fl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:{connectionInfos:n.connectionInfosInputDefault(s.organization.skidataConnectionInfos)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:"Skidata"}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jl,{isLoading:d,onClick:n,children:e("enregistrer_06519")}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:u?(0,i.jsx)(jl,{color:"white",leftIcon:"loader"}):(0,i.jsx)(jl,{color:"white",leftIcon:"arrows-rotate",onClick:async()=>{await c({organizationId:t})}})})}),(0,i.jsx)(_m,{placement:"top",children:e("synchroniser_34754")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(jl,{color:"white",leftIcon:"arrow-right-from-bracket",onClick:async()=>{await a({organizationId:t}),r()}})})}),(0,i.jsx)(_m,{placement:"top",children:e("se_d_connecter_74151")})]})]})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:280,children:e("adresse_du_web_92125")}),(0,i.jsx)(Rl,{name:"connectionInfos.url"})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:280,children:"Issuer"}),(0,i.jsx)(Rl,{name:"connectionInfos.issuer"})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:280,children:"Receiver"}),(0,i.jsx)(Rl,{name:"connectionInfos.receiver"})]}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(br,{color:"gray700",fontWeight:"medium",width:280,children:e("lieu_20541")}),(0,i.jsx)(Rl,{name:"connectionInfos.place"})]}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Uu,{direction:"horizontal"}),(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(gK,{eventType:"all",events:f,organizationId:t,reload:r,subtitle:"",title:e("liste_des_v_ne_29929")}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(gK,{eventType:"synchronized",events:x,organizationId:t,reload:r,subtitle:e("ces_v_nements_58722"),title:e("liste_des_v_ne_09741")}),(0,i.jsx)(Wu,{height:"5"}),(0,i.jsx)(gK,{eventType:"season",events:_,organizationId:t,reload:r,subtitle:e("ces_v_nements_24479"),title:e("liste_des_v_ne_73078")})]}),!s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"5"}),(0,i.jsx)(Ra,{justify:"end",children:(0,i.jsx)(jl,{isLoading:d,onClick:n,children:e("se_connecter_63820")})})]})]}),width:1,onSubmit:async e=>{await l({organizationId:t,connectionInfos:e.connectionInfos}),r()}})},fK=e=>{const t=Hn(),{mutate:n}=function(e={}){return Kn("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)(Tj,{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)(Rl,{label:t("nom_du_tag_95054"),name:"name"})})},xK=e=>{const t=Hn(),{canOrganizationParamEdit:n}=dS(),{mutate:s}=function(e={}){return Kn("mutation TagDelete($organizationId: OrganizationId!, $tagId: TagId!) {\n tagDelete(organizationId: $organizationId, tagId: $tagId) {\n id\n }\n}\n",e)}(),[o,r]=(0,M.useState)(!1),[a,l]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(yc,{css:{color:"$gray800"},children:e.tag.name}),(0,i.jsx)(yc,{children:e.tag.numberOfTimesUsed}),n&&(0,i.jsxs)(Uc,{justify:"center",children:[(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{children:(0,i.jsx)(Ya,{icon:"pen",onClick:()=>{r(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(fm,{children:[(0,i.jsx)(Im,{children:(0,i.jsx)(br,{color:"error700",children:(0,i.jsx)(Ya,{icon:"trash-can",onClick:()=>{l(!0)}})})}),(0,i.jsx)(_m,{placement:"top",children:t("supprimer_02105")})]})]})]}),o&&(0,i.jsx)(fK,{name:e.tag.name,organizationId:e.organizationId,tagId:e.tag.id,onClose:()=>{r(!1)},onSuccess:e.reload}),a&&(0,i.jsx)(Pk,{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 s({organizationId:e.organizationId,tagId:e.tag.id}),e.reload()}})]})},_K=()=>{const{translate:e,params:{organizationId:t}}=cl(),{canOrganizationParamEdit:n}=dS(),[s,o,r]=Pc(""),[a,l]=(0,M.useState)(0),{data:d,isLoading:c,reload:u}=Yn("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:m(o)?o:void 0,offset:a},[]);const{numberOfPages:h,totalCount:g}=vu(d.organization?.tags),[p,f]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ra,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,children:[(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(br,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:e("tags_79499")}),(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(jl,{onClick:()=>{f(!0)},children:e("cr_er_un_nouvea_56617")})})]}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Oc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(br,{width:320,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_un_t_34829"),value:s,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("nom_08311")}),(0,i.jsx)(Fc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Fc,{width:100})]}),numberOfPages:h,offset:a,rows:c?(0,i.jsx)(i.Fragment,{}):d.organization.tags.nodes.map(e=>(0,i.jsx)(xK,{organizationId:t,reload:u,tag:e},e.id)),setOffset:l,title:e("liste_des_tags_83521"),totalCount:g})]}),p&&(0,i.jsx)(zj,{organizationId:t,onClose:()=>{f(!1)},onSuccess:u})]})};function IK(e,t){const n=e[`${t.toLowerCase()}String`];return m(n)?n:m(e.enString)?e.enString:m(e.frString)?e.frString:m(e.esString)?e.esString:m(e.deString)?e.deString:m(e.nlString)?e.nlString:""}const vK=e=>{const{translate:t,params:{organizationId:n}}=cl(),{user:s}=ni(),{mutate:o,isLoading:r}=function(e={}){return Kn("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,M.useState)(!1),[d,c]=(0,M.useState)(Object.fromEntries(e.languages.map(t=>[t,e.translation[t.toLowerCase()]||""]))),u=s.language,h=e.languages.every(t=>e.translation[`is${t}Translated`]);return(0,i.jsxs)(Ra,{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)(Ra,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"2",width:1,onClick:()=>{l(!a)},children:[(0,i.jsx)(jl,{color:"invisible",css:{color:"$gray700"},leftIcon:a?"chevron-down":"chevron-right"}),(0,i.jsx)(br,{css:{flex:"1"},font:"gray800 textMd medium",children:IK(e.translation,u)}),(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(Jd,{children:t(e.translation.module)}),h?(0,i.jsx)(Jd,{color:"success",children:t("Translated")}):(0,i.jsx)(Jd,{color:"warning",children:t("NotTranslated")})]})]}),a&&(0,i.jsxs)(Ra,{css:{background:"$gray100",padding:"$6"},direction:"column",gap:"6",children:[e.languages.map(t=>{const n=`Version ${t}`;return e.translation.translationType===Et.RichText?(0,i.jsx)(Ev,{initialValue:d[t],label:n,onChange:e=>{c({...d,[t]:e})}},t):(0,i.jsx)(Ol,{label:n,value:d[t],onChange:e=>{c({...d,[t]:e})}},t)}),(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Ra,{children:(0,i.jsx)(jl,{isLoading:r,onClick:async()=>{await o({organizationId:n,translationId:e.translation.id,translation:Object.fromEntries(Object.entries(d).map(([e,t])=>[e.toLowerCase(),t]))})},children:t("mettre_jour_85141")})})})]})]})},bK=e=>{const t=Hn(),n=Rc(),[s,o]=(0,M.useState)(!1),[r,a]=(0,M.useState)(e.eventsIds),[l,d]=(0,M.useState)(e.modules),[c,u]=(0,M.useState)(e.translationStatus),h=(0,M.useMemo)(()=>(0,ic.A)(e.organization.events.nodes,e=>e.name.toLowerCase()),[e.organization]);return(0,i.jsxs)(Ra,{css:{background:"white",bd:!0,padding:"$4"},gap:"3",children:[(0,i.jsx)(Ol,{icon:"search",placeholder:t("rechercher_une_22159"),value:e.content,onChange:e.setContent}),(0,i.jsxs)(eC,{apply:()=>{e.setEventsIds(r),e.setModules(l),e.setTranslationStatus(c),o(!1)},color:"gray",isOpen:s,reinit:()=>{e.setEventsIds([]),a([]),e.setModules([]),d([]),e.setTranslationStatus(St.TranslatedAndNotTranslated),u(St.TranslatedAndNotTranslated),o(!1)},showButtons:!0,onStateChange:o,children:[(0,i.jsx)(fc,{isSearchVisible:!0,label:t("_v_nements_53672"),multiple:!0,renderOnPortal:!0,values:r,onChange:a,children:h.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(fc,{isSearchVisible:!0,label:t("module_67984"),multiple:!0,renderOnPortal:!0,values:l,onChange:d,children:n(zn)}),(0,i.jsx)(Au,{label:t("statut_de_tradu_58384"),value:c,onChange:u,children:n(On)})]})]})},jK=e=>(0,i.jsx)(Ra,{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)(ec,{borderRadius:"$2",height:32,width:1})}),CK=e=>{const{translate:t}=cl(),n=e.organization.translations.totalCount-e.organization.translated.totalCount;return(0,i.jsxs)(Ra,{css:{height:"fit-content"},gap:"6",width:1,children:[(0,i.jsx)(br,{width:.3,children:(0,i.jsx)(OM,{css:{height:"100%"},children:(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(br,{font:"gray500 textSm medium",children:t("nombre_de_langu_75924")}),(0,i.jsx)(br,{font:"gray900 displayMd medium",children:e.organization.languages.length})]})})}),(0,i.jsx)(br,{css:{flex:"1"},children:(0,i.jsx)(OM,{children:(0,i.jsxs)(Ra,{gap:"6",justify:"between",children:[(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(br,{font:"gray500 textSm medium",children:t("nombre_de_champ_26560")}),(0,i.jsx)(br,{font:"gray900 displayMd medium",children:e.organization.translations.totalCount})]}),(0,i.jsxs)(Ra,{direction:"column",gap:"3",children:[(0,i.jsx)(br,{font:"gray700 textXs semiBold",children:t("dont_10477")}),(0,i.jsxs)(Ra,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(br,{font:"gray500 textSm medium",children:t("champs_tradui_47609")}),(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:n})]}),(0,i.jsxs)(Ra,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(br,{font:"gray500 textSm medium",children:t("champs_traduits_03119")}),(0,i.jsx)(br,{font:"gray900 textMd semiBold",children:e.organization.translated.totalCount})]})]})]})})})]})},yK=e=>{const{translate:t,params:{organizationId:n}}=cl(),[s,o,r]=Pc(""),[a,l]=(0,M.useState)([]),[d,c]=(0,M.useState)(St.TranslatedAndNotTranslated),[u,h]=(0,M.useState)([]),[g,p]=(0,M.useState)(0),{data:f,isLoading:x}=Yn("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:m(o)?o:null,eventsIds:a,modules:u,status:d,offset:g},[Ms.TranslationFragment]);const{numberOfPages:_,totalCount:I}=vu(f.organization?.translations),v=f.organization?.translations.nodes??[];return(0,i.jsxs)(Ra,{css:{overflowY:"auto"},direction:"column",height:1,children:[(0,i.jsxs)(Ra,{css:{borderBottom:"1px solid $gray200",padding:"$6 $7"},direction:"column",children:[(0,i.jsx)(br,{font:"gray900 textXl medium",children:t("traductions_88349")}),(0,i.jsx)(br,{color:"gray500",children:t("g_rer_toutes_le_39107")})]}),(0,i.jsxs)(Ra,{css:{background:"$gray50",flex:"1",padding:"$7"},direction:"column",children:[(0,i.jsx)(CK,{organization:e.organization}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(bK,{content:s,eventsIds:a,modules:u,organization:e.organization,setContent:r,setEventsIds:l,setModules:h,setTranslationStatus:c,translationStatus:d}),(0,i.jsx)(Ba,{height:"4"}),x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jK,{isFirst:!0,isLast:!1}),(0,i.jsx)(jK,{isFirst:!1,isLast:!1}),(0,i.jsx)(jK,{isFirst:!1,isLast:!0})]}):v.map((t,n)=>(0,i.jsx)(vK,{isFirst:0===n,isLast:n===v.length-1,languages:e.organization.languages,translation:t},t.id)),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Ec,{numberOfPages:_,offset:g,setOffset:p,totalCount:I})]})]})},kK=()=>{const{params:{organizationId:e}}=cl(),{data:t,loader:n}=Yn("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)(yK,{organization:t.organization})},AK=e=>{const{translate:t,params:{organizationId:n}}=cl(),{showNotification:s}=ib(),{mutate:o}=function(e={}){return Kn("mutation UserRolesDelete($organizationId: OrganizationId!, $userId: UserId!) {\n userRolesDelete(organizationId: $organizationId, userId: $userId)\n}\n",e)}(),r=function(e,t){const{mutate:n}=Wo();return(0,M.useCallback)(()=>Promise.all([Te.PositionCategoryLeaderAssign,Te.PositionLeaderAssign,Te.DelegationCategoryLeaderAssign,Te.DelegationLeaderAssign,Te.EventInvite,Te.OrganizationInvite].map(i=>n({organizationId:e,userInfoId:t,emailType:i}))),[n,e,t])}(n,e.userInfo.id),[a,l]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bc,{children:[(0,i.jsx)(Ld,{icon:"paper-plane",onClick:async e=>{$d(e.target),await r()},children:t("r_envoyer_l_e_96215")}),(0,i.jsx)(Uu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ld,{color:"red",icon:"trash-can",onClick:e=>{$d(e.target),l(!0)},children:t("supprimer_l_acc_85342")})]}),a&&(0,i.jsx)(Pk,{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 o({organizationId:n,userId:e.userInfo.userId}),s(t("tous_les_acc_s_26440",e.userInfo.nameOrEmail)),e.reload()}})]})};var wK;!function(e){e[e.Delegations=0]="Delegations",e[e.DelegationsCategories=1]="DelegationsCategories",e[e.Positions=2]="Positions",e[e.PositionsCategories=3]="PositionsCategories"}(wK||(wK={}));const SK=e=>{const{translate:t}=cl(),n=(0,M.useMemo)(()=>e.level??(e.eventId?tt.Event:tt.Both),[e.eventId,e.level]),[s,o]=(0,M.useState)(!1),[r,a]=(0,M.useState)(null),[l,d,c]=Pc("");(0,M.useEffect)(()=>{(async()=>{if(o(!0),e.resource===wK.Delegations){const{organization:s}=await(t={organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:n,name:m(d)?d:void 0,ids:e.ids},i=await q(),co('query DelegationsSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $level: OrganizationEventLevel!\n $ids: [DelegationId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n name\n\n list: delegations(\n level: $level\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: delegations(level: $level, ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',{variables:t,token:i||void 0,fragments:[]}));a(s)}else if(e.resource===wK.DelegationsCategories){const{organization:t}=await function(e,t){return co('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:m(d)?d:void 0,ids:e.ids},await q());a(t)}else if(e.resource===wK.Positions){const{organization:t}=await function(e,t){return co(go,{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:m(d)?d:void 0,ids:e.ids},await q());a(t)}else if(e.resource===wK.PositionsCategories){const{organization:t}=await function(e,t){return co('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:m(d)?d:void 0,ids:e.ids},await q());a(t)}var t,i;o(!1)})()},[n,d,e.eventId,e.hasSelected,e.organizationId,e.resource]);const u=(0,M.useMemo)(()=>{if(r){const t=(0,ic.A)((0,ch.A)(r.list.nodes.concat(r.selected.nodes),e=>e.id),e=>e.name.toLowerCase());return n!==tt.Both&&e.eventId?t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)):Object.values((0,nc.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)(fc,{isSearchLoading:s,isSearchVisible:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:c}),values:e.ids,onChange:e.onChange,children:u})},EK=e=>{const{translate:t,params:{organizationId:n}}=cl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:e.accessScope===ee.DelegationCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(ee.DelegationCategory),children:t("r_le_sur_une_ca_31475")}),e.accessScope===ee.DelegationCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(SK,{hasSelected:!0,ids:[e.resourceId],level:tt.Event,organizationId:n,resource:wK.DelegationsCategories,onChange:t=>{eo(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Au,{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))})})]})]})]})},TK=e=>{const{translate:t,params:{organizationId:n}}=cl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:e.accessScope===ee.Delegation?"checked":"unchecked",onClick:()=>e.setAccessScope(ee.Delegation),children:t("r_le_sur_une_d_10967")}),e.accessScope===ee.Delegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{paddingLeft:"$6"},gap:"4",children:(0,i.jsx)(SK,{hasSelected:!0,ids:[e.resourceId],level:tt.Both,organizationId:n,resource:wK.Delegations,onChange:t=>{eo(t)&&e.setResourceId(t[0])}})})]})]})},zK=e=>{const{translate:t}=cl(),{organization:n}=_I();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:e.accessScope===ee.Event?"checked":"unchecked",onClick:()=>e.setAccessScope(ee.Event),children:t("r_le_sur_un_v_89523")}),e.accessScope===ee.Event&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Au,{shouldParseAsInt:!0,value:e.resourceId,onChange:e.setResourceId,children:n.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Au,{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))})})]})]})]})},OK=e=>{const{translate:t,params:{organizationId:n}}=cl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:e.accessScope===ee.PositionCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(ee.PositionCategory),children:t("r_le_sur_une_ca_13181")}),e.accessScope===ee.PositionCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(SK,{hasSelected:!0,ids:[e.resourceId],organizationId:n,resource:wK.PositionsCategories,onChange:t=>{eo(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Au,{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))})})]})]})]})},RK=e=>{const{translate:t,params:{organizationId:n}}=cl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:e.accessScope===ee.Position?"checked":"unchecked",onClick:()=>e.setAccessScope(ee.Position),children:t("r_le_sur_une_mi_92313")}),e.accessScope===ee.Position&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsxs)(Ra,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(SK,{hasSelected:!0,ids:[e.resourceId],organizationId:n,resource:wK.Positions,onChange:t=>{eo(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(br,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Au,{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))})})]})]})]})},$K=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(ec,{borderRadius:"$1",height:20,width:1})]}),DK=e=>{const{translate:t,params:{organizationId:n}}=cl(),{organization:s,roles:o}=_I(),{mutate:r}=function(e={}){return Kn("mutation UserAccessCreate(\n $organizationId: OrganizationId!\n $scope: AccessScope!\n $userInfoId: UsersInfoId!\n $resourceId: Int!\n $roleId: RoleId\n) {\n userAccessCreate(\n organizationId: $organizationId\n scope: $scope\n userInfoId: $userInfoId\n resourceId: $resourceId\n roleId: $roleId\n )\n}\n",e)}(),{data:a,isLoading:l}=Yn('query OrganizationUserAddRole($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Both, limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n delegationsCategories(level: Event, limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n positions(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n positionsCategories(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n }\n}\n',{organizationId:n},[]),[d,c]=(0,M.useState)(ee.Organization),[u,h]=(0,M.useState)(o.organizationRoles[0].id),[m,g]=(0,M.useState)(-1),p=e=>{e===ee.Organization?h(o.organizationRoles[0].id):e===ee.Event?(h(o.eventRoles[0].id),g(s.events.nodes[0].id)):e===ee.Delegation?(h(-1),g(a.organization.delegations.nodes[0].id)):e===ee.DelegationCategory?(h(o.delegationCategoryRoles[0].id),g(a.organization.delegationsCategories.nodes[0].id)):e===ee.Position?(h(o.positionRoles[0].id),g(a.organization.positions.nodes[0].id)):e===ee.PositionCategory&&(h(o.positionRoles[0].id),g(a.organization.positionsCategories.nodes[0].id)),c(e)};return(0,i.jsxs)(ub,{children:[(0,i.jsx)(hb,{children:(0,i.jsx)(jl,{color:"invisible",leftIcon:"plus",children:t("ajouter_un_r_le_19073")})}),(0,i.jsxs)(cb,{children:[(0,i.jsx)(db,{icon:"user-lock",children:t("ajouter_un_r_le_19073")}),(0,i.jsx)(lb,{children:l?(0,i.jsx)($K,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hc,{state:d===ee.Organization?"checked":"unchecked",onClick:()=>p(ee.Organization),children:t("r_le_sur_l_orga_15663")}),d===ee.Organization&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Au,{shouldParseAsInt:!0,value:u,onChange:h,children:o.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),eo(s.events.nodes)&&(0,i.jsx)(zK,{accessScope:d,eventRoles:o.eventRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),eo(a.organization?.delegations.nodes)&&(0,i.jsx)(TK,{accessScope:d,resourceId:m,setAccessScope:p,setResourceId:g}),eo(a.organization?.delegationsCategories.nodes)&&(0,i.jsx)(EK,{accessScope:d,delegationCategoryRoles:o.delegationCategoryRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),eo(a.organization?.positions.nodes)&&(0,i.jsx)(RK,{accessScope:d,positionRoles:o.positionRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),eo(a.organization?.positionsCategories.nodes)&&(0,i.jsx)(OK,{accessScope:d,positionCategoryRoles:o.positionRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h})]})}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{onClick:async()=>{await r({organizationId:n,scope:d,resourceId:d===ee.Organization?n:m,roleId:d===ee.Delegation?void 0:u,userInfoId:e.userInfoId}),e.onClose()},children:t("ajouter_97327")})})]})]})},PK=e=>{const{organization:t}=_I(),{canOrganizationUserEdit:n}=dS(),{mutate:s}=la(),[o,r]=(0,M.useState)(e.roleId);return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Au,{shouldParseAsInt:!0,state:n?"active":"disabled",value:o,onChange:n=>(r(n),(n=>s({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)(yc,{children:e.resource}),n&&(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsx)(br,{color:"error700",onClick:async()=>{e.onDelete(e.scope,e.id)},children:(0,i.jsx)(Ya,{icon:"trash-can"})})})]})},FK=e=>{const{translate:t}=cl(),{organization:n,roles:s}=_I(),{canOrganizationUserEdit:o}=dS(),{mutate:r}=aa(),[a,l]=(0,M.useState)(e.userInfo.usersEvents.filter(t=>t.event.id===e.event.id)),[d,c]=(0,M.useState)(e.userInfo.usersDelegations.filter(t=>t.eventId===e.event.id)),[u,h]=(0,M.useState)(e.userInfo.usersDelegationsCategories.filter(t=>t.eventId===e.event.id)),[m,g]=(0,M.useState)(e.userInfo.usersPositions.filter(t=>t.eventId===e.event.id)),[p,f]=(0,M.useState)(e.userInfo.usersPositionsCategories.filter(t=>t.eventId===e.event.id)),x=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)),h(e=>e.filter(e=>e.id!==t)),g(e=>e.filter(e=>e.id!==t)),f(e=>e.filter(e=>e.id!==t))};return eo(a)||eo(d)||eo(u)||eo(m)||eo(p)?(0,i.jsx)(Oc,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:t("r_le_59302")}),(0,i.jsx)(Fc,{}),o&&(0,i.jsx)(Fc,{width:100})]}),rows:(0,i.jsxs)(i.Fragment,{children:[a.map(t=>(0,i.jsx)(PK,{id:t.id,resource:"-",roleId:t.role.id,roles:s.eventRoles,scope:ee.Event,userId:e.userInfo.userId,onDelete:x},t.id)),d.map(e=>(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:t("responsable_de_70462")}),(0,i.jsx)(yc,{children:e.delegation.name}),o&&(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsx)(br,{color:"error700",onClick:()=>x(ee.Delegation,e.id),children:(0,i.jsx)(Ya,{icon:"trash-can"})})})]},e.id)),u.map(t=>(0,i.jsx)(PK,{id:t.id,resource:t.delegationCategory.name,roleId:t.role.id,roles:s.delegationCategoryRoles,scope:ee.DelegationCategory,userId:e.userInfo.userId,onDelete:x},t.id)),m.map(t=>(0,i.jsx)(PK,{id:t.id,resource:t.position.name,roleId:t.role.id,roles:s.positionRoles,scope:ee.Position,userId:e.userInfo.userId,onDelete:x},t.id)),p.map(t=>(0,i.jsx)(PK,{id:t.id,resource:t.positionCategory.name,roleId:t.role.id,roles:s.positionRoles,scope:ee.PositionCategory,userId:e.userInfo.userId,onDelete:x},t.id))]}),title:e.event.name}):null},MK=e=>{const{translate:t}=cl(),{organization:n,roles:s}=_I(),{canOrganizationUserEdit:o}=dS(),{mutate:r}=la(),{mutate:a}=aa(),[l,d]=(0,M.useState)(e.userOrganization.role.id),[c,u]=(0,M.useState)(e.userOrganization.sendNotifications),h=(t,i)=>r({organizationId:n.id,scope:ee.Organization,id:e.userOrganization.id,sendNotifications:t,roleId:i});return(0,i.jsxs)(Tc,{children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Au,{shouldParseAsInt:!0,state:o?"active":"disabled",value:l,onChange:e=>(d(e),h(c,e)),children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(yc,{children:(0,i.jsx)(xu,{disabled:!o,value:c,onChange:e=>(u(e),h(e,l)),children:t("activer_38612")})}),o&&(0,i.jsx)(Uc,{justify:"center",children:(0,i.jsx)(br,{color:"error700",onClick:async()=>{await a({organizationId:n.id,scope:ee.Organization,id:e.userOrganization.id}),e.onDelete(e.userOrganization.id)},children:(0,i.jsx)(Ya,{icon:"trash-can"})})})]})},NK=e=>{const{translate:t}=cl(),{organization:n}=_I(),{canOrganizationUserEdit:s}=dS(),[o,r]=(0,M.useState)(e.userInfo.usersOrganizations),a=e=>{r(t=>t.filter(t=>t.id!==e))};return(0,i.jsx)(Oc,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:t("r_le_59302")}),(0,i.jsx)(Fc,{children:t("notifications_98765")}),s&&(0,i.jsx)(Fc,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:o.map((t,n)=>(0,i.jsx)(MK,{userId:e.userInfo.userId,userOrganization:t,onDelete:a},n))}),title:n.name})},LK=e=>{const{translate:t}=cl(),{organization:n}=_I(),{canOrganizationUserEdit:s}=dS();return(0,i.jsxs)(hu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nj,{children:e.userInfo.nameOrEmail}),(0,i.jsxs)(mu,{css:{gap:"$4",py:"$6"},children:[eo(e.userInfo.usersOrganizations)&&(0,i.jsx)(NK,{userInfo:e.userInfo}),n.events.nodes.map(t=>(0,i.jsx)(FK,{event:t,userInfo:e.userInfo},t.id)),s&&(0,i.jsx)(DK,{userInfoId:e.userInfo.id,onClose:e.onClose})]}),(0,i.jsx)(gu,{children:(0,i.jsx)(Ra,{gap:"3",justify:"end",children:(0,i.jsx)(jl,{color:"white",onClick:e.onClose,children:t("fermer_62479")})})})]})},BK=e=>{const[t,n]=(0,M.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>n(!0),children:[(0,i.jsx)(yc,{children:(0,i.jsx)(Ub,{isClickDisabled:!0,size:32,userInfo:e.userInfo})}),(0,i.jsx)(fy,{userPermissions:e.userInfo}),(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Uc,{justify:"end",children:(0,i.jsx)(AK,{reload:e.reload,userInfo:e.userInfo})})})]}),t&&(0,i.jsx)(LK,{userInfo:e.userInfo,onClose:()=>{e.reloadUserInfo(e.userInfo.id),n(!1)}})]})},VK=e=>{const{translate:t}=cl(),{organization:n}=_I(),{showNotification:s}=ib(),{onClose:o}=ob(),{mutate:r,isLoading:a}=function(e={}){return Kn("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:c}=function(e={}){return Kn("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===xt.OrganizationAdmin),h=n.roles.find(e=>e.type===xt.OrganizationReader),m=n.roles.find(e=>e.type===xt.EventAdmin),g=n.roles.find(e=>e.type===xt.EventReader),[p,f]=(0,M.useState)(""),[x,_]=(0,M.useState)(u.id),I=n.events.nodes,[v,b]=(0,M.useState)(I[0]?.id),j=(0,M.useMemo)(()=>I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[I]),C=function(e){return d.Yj().email().required().isValidSync(e)}(p);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(db,{icon:"user-plus",children:t("inviter_un_util_06611")}),(0,i.jsxs)(lb,{gap:"6",children:[(0,i.jsx)(Ol,{isEmail:!0,label:t("Email"),value:p,onChange:f}),(0,i.jsxs)(Ra,{direction:"column",children:[(0,i.jsx)(br,{font:"gray800 textSm medium",children:t("quel_r_le_souha_92592")}),(0,i.jsx)(Ba,{height:"2"}),(0,i.jsx)(hc,{state:x===u.id?"checked":"unchecked",onClick:()=>_(u.id),children:u.name}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:x===h.id?"checked":"unchecked",onClick:()=>_(h.id),children:h.name}),eo(I)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:x===m.id?"checked":"unchecked",onClick:()=>_(m.id),children:m.name}),x===m.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Au,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]}),(0,i.jsx)(Ba,{height:"3"}),(0,i.jsx)(hc,{state:x===g.id?"checked":"unchecked",onClick:()=>_(g.id),children:g.name}),x===g.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(Ra,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Au,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]})]})]})]}),(0,i.jsx)(ab,{children:(0,i.jsx)(jl,{disabled:!C,isLoading:a||c,onClick:async()=>{const i=n.roles.find(e=>e.id===x);if(x===u.id||x===h.id)await r({organizationId:n.id,email:p,roleId:x}),s(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:x}),s(t("_1_a_t_invit_15646",p,i.name,e.name))}e.reload(),o()},children:t("inviter_35349")})})]})},UK=e=>{const{translate:t}=cl();return(0,i.jsxs)(Rb,{gap:"6",children:[(0,i.jsx)(br,{css:{flex:"1"},font:"gray900 displayXs medium",children:t("utilisateurs_04975")}),(0,i.jsx)(Ib,{permissions:xb.ORGANIZATION_USER_EDIT,children:(0,i.jsxs)(ub,{children:[(0,i.jsx)(hb,{children:(0,i.jsx)(jl,{children:t("inviter_un_util_06611")})}),(0,i.jsx)(cb,{children:(0,i.jsx)(VK,{reload:e.reload})})]})})]})},WK=()=>{const{translate:e,params:{organizationId:t}}=cl(),{organization:n,roles:s}=_I(),[o,r]=(0,M.useState)(!0),[a,l,d]=Pc(""),[c,u]=(0,M.useState)(-1),[h,g]=(0,M.useState)(-1),[p,f]=(0,M.useState)(kc),[x,_]=(0,M.useState)(0),{data:I,isLoading:v,reload:b}=Yn("query OrganizationUsers(\n $organizationId: OrganizationId!\n $hasRole: Boolean!\n $name: String\n $roleId: RoleId\n $eventId: EventId\n $limit: Int\n $offset: Int\n) {\n organization(id: $organizationId) {\n usersInfos(\n hasRole: $hasRole\n name: $name\n roleId: $roleId\n eventId: $eventId\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...UserInfoOrganization\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,hasRole:o,name:m(l)?l:void 0,roleId:-1!==c?c:void 0,eventId:-1!==h?h:void 0,limit:p,offset:x},[Ms.UserInfoOrganizationFragment]);const{numberOfPages:j,totalCount:C}=vu(I.organization?.usersInfos),[y,k]=(0,M.useState)([]),[A,w]=(0,M.useState)({}),S=(0,M.useCallback)(async e=>{w(t=>({...t,[e]:!0}));const{organization:{userInfo:t}}=await function(e,t){return co("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:[Ms.UserInfoOrganizationFragment]})}({organizationId:n.id,userInfoId:e},await q());k(n=>n.map(n=>n.id===e?t:n)),w(t=>({...t,[e]:!1}))},[n]);return(0,M.useEffect)(()=>{k(I.organization?.usersInfos.nodes??[])},[I.organization]),(0,i.jsxs)($b,{css:{overflowY:"auto"},children:[(0,i.jsx)(UK,{reload:b}),(0,i.jsx)(Ob,{children:(0,i.jsx)(Oc,{filters:(0,i.jsxs)(Ra,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(br,{width:300,children:(0,i.jsx)(Ol,{icon:"magnifying-glass",placeholder:e("rechercher_un_m_05904"),value:a,onChange:d})}),(0,i.jsx)(br,{css:{flex:"1"}}),(0,i.jsx)(dc,{state:o?"checked":"unchecked",onClick:e=>r("checked"===e),children:e("seulement_les_u_63675")}),(0,i.jsx)(br,{width:240,children:(0,i.jsxs)(fc,{isSearchVisible:!0,menuWidth:320,renderOnPortal:!0,values:[c],onChange:e=>{eo(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:s.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:s.eventRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("Delegation"),children:s.delegationCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("Position"),children:s.positionRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})}),(0,i.jsx)(br,{width:240,children:(0,i.jsxs)(Au,{shouldParseAsInt:!0,value:h,onChange:g,children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),n.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{children:e("full_name")}),(0,i.jsx)(Fc,{children:e("r_les_61679")}),(0,i.jsx)(Ib,{rolesTypes:[xt.OrganizationAdmin],children:(0,i.jsx)(Fc,{width:100})})]}),limit:p,numberOfPages:j,offset:x,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0}),(0,i.jsx)(Mc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:y.map(e=>A[e.id]?(0,i.jsx)(Mc,{bx:!0},e.id):(0,i.jsx)(BK,{reload:b,reloadUserInfo:S,userInfo:e},e.id))}),setLimit:f,setOffset:_,totalCount:C})})]})},GK=()=>{const{translate:e,params:{organizationId:t}}=cl();Td(e("param_tres_78420"));const{isOrganizationAdmin:n,isOrganizationReader:s,hasFeature:o}=_I(),{canOrganizationParamRead:r,canOrganizationUserRead:a}=dS();return(0,i.jsxs)(Ra,{height:1,width:1,children:[(0,i.jsx)(oK,{}),(0,i.jsx)(br,{css:{flex:"1"},height:1,children:(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(rK,{})}),r&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ORGANIZATION_PARAMETERS_INFOS(":organizationId"),children:(0,i.jsx)(JY,{})}),a&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ORGANIZATION_PARAMETERS_TEAM(":organizationId"),children:(0,i.jsx)(WK,{})}),a&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ORGANIZATION_PARAMETERS_ROLES(":organizationId"),children:(0,i.jsx)(hK,{})}),r&&(0,i.jsx)(Cr.qh,{path:Os.ORGANIZATION_PARAMETERS_EMAILS(":organizationId"),children:(0,i.jsx)(OY,{})}),r&&(0,i.jsx)(Cr.qh,{path:Ii.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:":organizationId"}),children:(0,i.jsx)(ZY,{})}),r&&(0,i.jsx)(Cr.qh,{path:Ii.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(nK,{})}),r&&o(Fe.Delegation)&&(0,i.jsx)(Cr.qh,{path:Ii.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(kY,{})}),r&&(0,i.jsx)(Cr.qh,{path:Os.ORGANIZATION_PARAMETERS_CATEGORIES(":organizationId"),children:(0,i.jsx)(IY,{})}),r&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ORGANIZATION_PARAMETERS_TAGS(":organizationId"),children:(0,i.jsx)(_K,{})}),r&&(0,i.jsx)(Cr.qh,{path:Os.ORGANIZATION_PARAMETERS_TRANSLATIONS(":organizationId"),children:(0,i.jsx)(kK,{})}),n&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ORGANIZATION_PARAMETERS_INVOICES(":organizationId"),children:(0,i.jsx)(QY,{})}),r&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ORGANIZATION_PARAMETERS_ACTIVITY(":organizationId"),children:(0,i.jsx)(lY,{})}),s&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ORGANIZATION_PARAMETERS_SKIDATA(":organizationId"),children:(0,i.jsx)(pK,{})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.ORGANIZATION_PARAMETERS_PROFILE(t)})})]})})]})},HK=Object.keys(xb).length/2;function qK(e){return new Array(HK).fill("0").map((t,n)=>e.includes(n)?"1":"0").join("")}const YK=qK([xb.POSITION_READ,xb.POSITION_EDIT,xb.MEMBER_EDIT,xb.MEMBER_ASSIGNMENT_STATE_EDIT,xb.COMMENT_READ,xb.COMMENT_ADD,xb.MEMBER_AVAILABILITIES_EDIT,xb.MEMBER_ASSIGN,xb.CAMPAIGN_SEND,xb.ACCREDITATION_READ,xb.ACCREDITATION_EDIT,xb.MEMBER_ACCREDIT,xb.DELEGATION_READ,xb.DELEGATION_EDIT,xb.FORM_READ,xb.FORM_EDIT,xb.EMAIL_EDIT,xb.CAMPAIGN_READ,xb.DOCUMENT_READ,xb.DOCUMENT_EDIT,xb.WORKFLOW_READ,xb.WORKFLOW_EDIT,xb.CUSTOM_FIELD_READ,xb.CUSTOM_FIELD_EDIT,xb.SEGMENT_EDIT,xb.MEMBER_CREATE,xb.MEMBER_DELETE,xb.EVENT_EDIT,xb.ORGANIZATION_PARAM_READ,xb.ORGANIZATION_PARAM_EDIT,xb.ORGANIZATION_USER_READ,xb.ORGANIZATION_USER_EDIT]),KK=qK([xb.POSITION_READ,xb.COMMENT_READ,xb.ACCREDITATION_READ,xb.DELEGATION_READ,xb.FORM_READ,xb.CAMPAIGN_READ,xb.DOCUMENT_READ,xb.WORKFLOW_READ,xb.CUSTOM_FIELD_READ,xb.ORGANIZATION_PARAM_READ,xb.ORGANIZATION_USER_READ]),ZK=qK([xb.POSITION_READ,xb.POSITION_EDIT,xb.MEMBER_EDIT,xb.MEMBER_ASSIGNMENT_STATE_EDIT,xb.COMMENT_READ,xb.COMMENT_ADD,xb.MEMBER_AVAILABILITIES_EDIT,xb.MEMBER_ASSIGN,xb.CAMPAIGN_SEND,xb.ACCREDITATION_READ,xb.ACCREDITATION_EDIT,xb.MEMBER_ACCREDIT,xb.DELEGATION_READ,xb.DELEGATION_EDIT,xb.FORM_READ,xb.FORM_EDIT,xb.EMAIL_EDIT,xb.CAMPAIGN_READ,xb.DOCUMENT_READ,xb.DOCUMENT_EDIT,xb.WORKFLOW_READ,xb.WORKFLOW_EDIT,xb.SEGMENT_EDIT,xb.MEMBER_CREATE,xb.MEMBER_DELETE]),XK=qK([xb.POSITION_READ,xb.COMMENT_READ,xb.ACCREDITATION_READ,xb.DELEGATION_READ,xb.FORM_READ,xb.CAMPAIGN_READ,xb.DOCUMENT_READ,xb.WORKFLOW_READ]),JK=qK([xb.POSITION_READ,xb.POSITION_EDIT,xb.COMMENT_READ,xb.MEMBER_ASSIGN,xb.CAMPAIGN_SEND,xb.CAMPAIGN_READ]),QK=qK([xb.POSITION_READ,xb.COMMENT_READ]),eZ=qK([xb.DELEGATION_READ,xb.DELEGATION_EDIT]);let tZ=class extends Pl{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",accessLevel:e?.accessLevel??ft.Position,permissions:e?.permissions??JK}}schema(){return d.Ik().shape({role:d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),description:d.Yj().required(this.t("la_description_46559")),accessLevel:d.Yj().required(this.t("le_niveau_d_acc_94726")).oneOf(wn,this.t("le_niveau_d_acc_94726")),permissions:d.Yj().matches(new RegExp(`^[01]{${HK}}$`),this.t("le_format_des_p_68818")).required(this.t("le_format_des_p_68818"))}).required()}).required()}};tZ=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],tZ);const nZ=hr("div",{display:"grid",gap:"$4 $7",gridTemplateColumns:"280px auto"}),iZ=hr("div",{fontWeight:"$medium",gridColumn:1}),sZ=({children:e,disabled:t,permission:n,subtext:s,permissions:o,change:r})=>(0,i.jsx)("div",{style:{gridColumn:2},children:(0,i.jsx)(xu,{css:{alignItems:"start","> *:first-child":{margin:"2px 0"}},disabled:t,subtext:s,value:"1"===o[n],onChange:e=>r("role.permissions",function(e,t,n){return[...e].toSpliced(t,1,n).join("")}(o,n,e?"1":"0")),children:e})}),oZ=({children:e,...t})=>(0,i.jsx)(Rm,{css:{"legend + div":{minHeight:"32px"}},...t,hideToggle:!0,initialIsOpen:!0,children:e}),rZ=e=>{const{translate:t}=cl();return(0,i.jsxs)(oZ,{title:t("accr_ditations_39450"),children:[(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("accr_ditations_39450")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.ACCREDITATION_READ,permissions:e.permissions,children:t("voir_les_accr_d_34867")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.ACCREDITATION_EDIT,permissions:e.permissions,children:t("_diter_les_accr_86042")})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("mod_ration_09947")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.MEMBER_ACCREDIT,permissions:e.permissions,children:t("accr_diter_les_48281")})]})]})},aZ=e=>{const t=Hn(),n=e.roleInput.accessLevel===ft.Organization||e.roleInput.accessLevel===ft.Event,s=e.roleInput.accessLevel===ft.Organization||e.roleInput.accessLevel===ft.Event,o=e.roleInput.accessLevel===ft.Organization||e.roleInput.accessLevel===ft.Event;return(0,i.jsxs)(oZ,{title:t("communication_05277"),children:[n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("Form_plural")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.FORM_READ,permissions:e.roleInput.permissions,children:t("voir_les_formul_55824")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.FORM_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_form_10612")})]}),(0,i.jsx)(Wu,{height:"6"})]}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("Campaigns")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.CAMPAIGN_READ,permissions:e.roleInput.permissions,children:t("voir_les_campag_02148")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.CAMPAIGN_SEND,permissions:e.roleInput.permissions,children:t("envoyer_une_cam_35768")})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("e_mails_09850")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.EMAIL_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_e_ma_05609")})]})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("Documents")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.DOCUMENT_READ,permissions:e.roleInput.permissions,children:t("voir_les_docume_33988")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.DOCUMENT_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_docu_87778")})]})]})]})},lZ=()=>{const e=Hn();return(0,i.jsx)(oZ,{title:e("communication_05277"),children:(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:e("Campaigns")}),(0,i.jsx)(ec,{borderRadius:"$1",css:{gridColumn:2},height:20})]})})},dZ=e=>{const t=Hn();return(0,i.jsx)(oZ,{title:t("informations_su_20567"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsx)(Rl,{disabled:e.disabled,label:t("nom_du_r_le_38492"),name:"role.name"}),(0,i.jsx)(Lm,{disabled:e.disabled,label:t("Description"),name:"role.description"}),(0,i.jsxs)(yj,{label:t("niveau_d_acc_s_29898"),name:"role.accessLevel",state:e.disabled||e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:ft.Organization,children:t("administrateur_10076")}),(0,i.jsx)("option",{value:ft.Event,children:t("administrateur_99393")}),(0,i.jsx)("option",{value:ft.Position,children:t("responsable_de_82794")}),(0,i.jsx)("option",{disabled:!0,value:ft.DelegationCategory,children:t("responsable_de_75445")})]})]})})},cZ=()=>{const e=Hn();return(0,i.jsx)(oZ,{title:e("informations_su_20567"),children:(0,i.jsxs)(Ra,{direction:"column",gap:"6",children:[(0,i.jsx)(ec,{borderRadius:"$2",height:64,width:"100%"}),(0,i.jsx)(ec,{borderRadius:"$2",height:126,width:"100%"})]})})},uZ=e=>{const t=Hn(),n=e.roleInput.accessLevel===ft.Organization||e.roleInput.accessLevel===ft.Event,s=e.roleInput.accessLevel===ft.Organization||e.roleInput.accessLevel===ft.Event,o=e.roleInput.accessLevel===ft.Organization;return(0,i.jsxs)(oZ,{title:t("population_38615"),children:[(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("membres_11310")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.MEMBER_CREATE,permissions:e.roleInput.permissions,children:t("cr_er_des_membr_28893")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.MEMBER_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_memb_39894")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.MEMBER_DELETE,permissions:e.roleInput.permissions,children:t("supprimer_les_m_98024")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.MEMBER_AVAILABILITIES_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_disp_75220")})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("commentaires_96492")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.COMMENT_READ,permissions:e.roleInput.permissions,subtext:t("sans_cette_perm_08373",t("Private")),children:t("lire_les_commen_55215")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.COMMENT_ADD,permissions:e.roleInput.permissions,children:t("ajouter_et_supp_32493")})]}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("d_l_gations_78318")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.DELEGATION_READ,permissions:e.roleInput.permissions,children:t("voir_les_d_l_ga_71959")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.DELEGATION_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_d_l_60281")})]})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("vues_personnali_80652")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.SEGMENT_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_vues_70658")})]})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("champs_de_formu_64126")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.CUSTOM_FIELD_READ,permissions:e.roleInput.permissions,children:t("voir_les_champs_59185")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.CUSTOM_FIELD_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_cham_47733")})]})]})]})},hZ=()=>{const e=Hn();return(0,i.jsxs)(oZ,{subtitle:e("permissions_rel_37045"),title:e("membres_11310"),children:[(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:e("profil_du_membr_68116")}),(0,i.jsx)(ec,{borderRadius:"$1",css:{gridColumn:2},height:20})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:e("commentaires_96492")}),(0,i.jsx)(ec,{borderRadius:"$1",css:{gridColumn:2},height:40}),(0,i.jsx)(ec,{borderRadius:"$1",css:{gridColumn:2},height:20})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:e("disponibilit_s_49923")}),(0,i.jsx)(ec,{borderRadius:"$1",css:{gridColumn:2},height:20})]})]})},mZ=e=>{const{translate:t}=cl();return(0,i.jsx)(oZ,{title:t("options_53186"),children:(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:"Automatisations"}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.WORKFLOW_READ,permissions:e.permissions,children:t("voir_les_automa_58340")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.WORKFLOW_EDIT,permissions:e.permissions,children:t("_diter_les_auto_80436")})]})})},gZ=e=>{const{translate:t}=cl();return(0,i.jsxs)(oZ,{title:t("organisation_71863"),children:[(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("_v_nements_53672")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.EVENT_EDIT,permissions:e.permissions,children:t("_diter_les_v_n_84914")})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("param_tres_78420")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.ORGANIZATION_PARAM_READ,permissions:e.permissions,children:t("voir_les_param_41674")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.ORGANIZATION_PARAM_EDIT,permissions:e.permissions,children:t("_diter_les_para_86184")})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("utilisateurs_et_83787")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.ORGANIZATION_USER_READ,permissions:e.permissions,children:t("voir_les_utilis_06462")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.ORGANIZATION_USER_EDIT,permissions:e.permissions,children:t("_diter_les_util_98017")})]})]})},pZ=e=>{const t=Hn();return(0,i.jsxs)(oZ,{title:t("missions_63972"),children:[(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("missions_63972")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.POSITION_READ,permissions:e.permissions,children:t("voir_les_missio_71964")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.POSITION_EDIT,permissions:e.permissions,subtext:t("si_le_r_le_est_05344"),children:t("_diter_les_miss_75420")})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:t("affectation_plural")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.MEMBER_ASSIGN,permissions:e.permissions,children:t("affecter_des_me_26669")}),(0,i.jsx)(sZ,{change:e.change,disabled:e.disabled,permission:xb.MEMBER_ASSIGNMENT_STATE_EDIT,permissions:e.permissions,subtext:t("permet_notammen_90746",t("PreAssigned")),children:t("changer_le_stat_34124")})]})]})},fZ=()=>{const e=Hn();return(0,i.jsxs)(oZ,{title:e("missions_63972"),children:[(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:e("informations_su_61022")}),(0,i.jsx)(ec,{borderRadius:"$1",css:{gridColumn:2},height:60})]}),(0,i.jsx)(Wu,{height:"6"}),(0,i.jsxs)(nZ,{children:[(0,i.jsx)(iZ,{children:e("affectation")}),(0,i.jsx)(ec,{borderRadius:"$1",css:{gridColumn:2},height:20}),(0,i.jsx)(ec,{borderRadius:"$1",css:{gridColumn:2},height:40})]})]})},xZ=e=>{const{translate:t}=cl(),n=e.values.role.accessLevel,s=n===ft.Organization,o=n===ft.Organization||n===ft.Event,r=n===ft.Organization||n===ft.Event;return(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(hl,{}),(0,i.jsx)(Rr.Yr,{name:"role.accessLevel",children:t=>{t===ft.Organization?e.change("role.permissions",YK):t===ft.Event?e.change("role.permissions",ZK):t===ft.DelegationCategory?e.change("role.permissions",eZ):t===ft.Position&&e.change("role.permissions",JK)}}),!e.isCustom&&(0,i.jsx)(Qa.Root,{color:"warning",children:(0,i.jsxs)(Qa.Titled,{children:[(0,i.jsx)(Qa.Title,{icon:"circle-exclamation",children:t("impossible_de_m_46897")}),(0,i.jsx)(Qa.Text,{children:t("ce_r_le_est_pr_71742")})]})}),(0,i.jsx)(dZ,{disabled:e.disabled,isEdit:e.isEdit}),(0,i.jsx)(uZ,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),s&&(0,i.jsx)(gZ,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),(0,i.jsx)(pZ,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),o&&(0,i.jsx)(rZ,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),(0,i.jsx)(aZ,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),r&&(0,i.jsx)(mZ,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),e.children]})},_Z=({children:e})=>(0,i.jsxs)(Ra,{direction:"column",gap:"4",children:[(0,i.jsx)(cZ,{}),(0,i.jsx)(hZ,{}),(0,i.jsx)(fZ,{}),(0,i.jsx)(lZ,{}),e]}),IZ=()=>{const{history:e,translate:t,params:{organizationId:n}}=cl(),s=(0,M.useRef)(null),o=Gn(tZ),{mutate:r}=function(e={}){return Kn("mutation RoleCreate($organizationId: OrganizationId!, $role: RoleInput!) {\n roleCreate(organizationId: $organizationId, role: $role) {\n id\n }\n}\n",e)}(),{showNotification:a}=ib();return Td(t("cr_ation_d_un_r_27933")),(0,i.jsx)(fl,{customErrorRef:s,height:1,initialValues:{role:o.default(null)},render:({form:e,handleSubmit:o,submitting:r,values:a})=>(0,i.jsx)(zm,{category:t("cr_ation_d_un_r_27933"),color:"dark",fallbackClosePath:Os.ORGANIZATION_PARAMETERS_ROLES(n),title:t("nouveau_r_le_20981"),children:(0,i.jsx)(Em,{ref:s,children:(0,i.jsx)(xZ,{change:e.change,disabled:!1,isCustom:!0,isEdit:!1,values:a,children:(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{isLoading:r,textAlign:"center",onClick:o,children:t("cr_er_le_r_le_55678")})})})})}),schema:o.schema(),onSubmit:async({role:i})=>{await r({organizationId:n,role:i}),a({color:"success",text:t("le_r_le_a_bien_55424")}),e.goBack(Os.ORGANIZATION_PARAMETERS_ROLES(n))}})},vZ=()=>{const{history:e,translate:t,params:{organizationId:n,roleId:s}}=cl(),o=(0,M.useRef)(null),r=Gn(tZ),{mutate:a}=function(e={}){return Kn("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}=Yn("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:s},[]),{canOrganizationUserEdit:c}=dS(),{showNotification:u}=ib();Td(t("mise_jour_de_17055",l.organization?.role.name));const h=(0,M.useMemo)(()=>c&&l.organization?.role.type===xt.Custom,[l.organization,c]);return d?(0,i.jsx)(bZ,{}):(0,i.jsx)(fl,{customErrorRef:o,height:1,initialValues:{role:r.default(l.organization.role)},render:({form:e,handleSubmit:s,submitting:r,values:a})=>(0,i.jsx)(zm,{button:h?(0,i.jsx)(jl,{css:{flexShrink:0},isLoading:r,onClick:s,children:t("modifier_le_r_l_58957")}):void 0,category:t("mise_jour_de_17055",l.organization.role.name),color:"dark",fallbackClosePath:Os.ORGANIZATION_PARAMETERS_ROLES(n),title:l.organization.role.name,children:(0,i.jsx)(Em,{ref:o,children:(0,i.jsx)(xZ,{change:e.change,disabled:!h,isCustom:l.organization.role.type===xt.Custom,isEdit:!0,values:a,children:h&&(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{isLoading:r,textAlign:"center",onClick:s,children:t("modifier_le_r_l_58957")})})})})}),schema:r.schema(),onSubmit:async({role:i})=>{h&&(await a({organizationId:n,roleId:s,role:i}),u({color:"success",text:t("le_r_le_a_bien_48312")}),e.goBack(Os.ORGANIZATION_PARAMETERS_ROLES(n)))}})},bZ=()=>{const{organizationId:e}=Zn();return(0,i.jsx)(zm,{fallbackClosePath:Os.ORGANIZATION_PARAMETERS_ROLES(e),title:(0,i.jsx)(ec,{borderRadius:"$1",height:39,width:400}),children:(0,i.jsx)(Em,{children:(0,i.jsx)(_Z,{})})})};var jZ,CZ,yZ,kZ,AZ,wZ,SZ,EZ,TZ,zZ,OZ,RZ,$Z,DZ,PZ,FZ,MZ,NZ,LZ,BZ,VZ,UZ,WZ,GZ,HZ,qZ,YZ,KZ,ZZ,XZ,JZ,QZ,eX,tX,nX,iX,sX,oX,rX,aX,lX,dX,cX,uX,hX,mX,gX,pX,fX,xX,_X,IX,vX,bX,jX,CX,yX,kX,AX,wX,SX,EX,TX,zX,OX,RX,$X,DX,PX,FX,MX,NX,LX,BX,VX,UX,WX,GX,HX,qX,YX,KX,ZX,XX,JX,QX,eJ,tJ,nJ,iJ,sJ,oJ,rJ,aJ,lJ,dJ,cJ,uJ,hJ,mJ,gJ,pJ,fJ,xJ,_J,IJ,vJ,bJ,jJ,CJ,yJ,kJ,AJ,wJ,SJ,EJ,TJ,zJ,OJ,RJ,$J,DJ,PJ,FJ,MJ,NJ,LJ,BJ,VJ,UJ,WJ,GJ,HJ,qJ,YJ,KJ,ZJ,XJ,JJ,QJ,eQ,tQ,nQ,iQ,sQ,oQ,rQ,aQ,lQ,dQ,cQ,uQ,hQ,mQ,gQ,pQ,fQ,xQ,_Q,IQ,vQ,bQ,jQ,CQ,yQ,kQ;function AQ(){return AQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Hn();return(0,i.jsx)(Ra,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ra,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(br,{css:{"& svg":{height:"100%",width:"100%"}},height:140,width:180,children:(0,i.jsx)(wQ,{})}),(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_85226",pd)}),(0,i.jsxs)(br,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",fd,pd)]})]})})};var EQ;function TQ(){return TQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Hn();return(0,i.jsx)(Ra,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ra,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(zQ,{}),(0,i.jsx)(br,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_64779",pd)}),(0,i.jsxs)(br,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",fd,pd)]})]})})},RQ=()=>{const e=Hn(),{user:t}=ni();return(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("accepter_a_hre_50341",xd(gd(t?.language,new URL(location.href).searchParams)),pd)}})},$Q=()=>{const{history:e,translate:t,params:{organizationId:n}}=cl(),{data:s,loader:o}=Yn('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=Gn(VE),a=Gn(Da),{mutate:l}=function(e={}){return Kn("mutation UserInfoAndTermsUpdate(\n $userInfoId: UsersInfoId!\n $userInfoAndTermsInput: UserInfoAndTermsInput!\n) {\n userInfoAndTermsUpdate(userInfoId: $userInfoId, userInfoAndTermsInput: $userInfoAndTermsInput) {\n id\n }\n}\n",e)}(),d=(0,M.useRef)(null),{reload:c}=_I();return o||(0,i.jsx)(fl,{customErrorRef:d,height:1,initialValues:{userInfoAndTerms:r.userInfoAndTermsInputDefault(s.user)},render:({handleSubmit:e})=>(0,i.jsxs)(B_,{ref:d,onClose:K,children:[(0,i.jsx)(hl,{}),(0,i.jsxs)(Rm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:t("accepter_nos_co_49122"),title:t("conditions_g_n_79662"),children:[(0,i.jsx)($m,{name:"userInfoAndTerms.termsAccepted",shouldPreventDefault:!1,children:(0,i.jsx)(RQ,{})}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsxs)(Ra,{gap:"4",children:[(0,i.jsx)(Rl,{label:(0,i.jsx)(_v,{children:t("pr_nom_66988")}),name:"userInfoAndTerms.firstName"}),(0,i.jsx)(Rl,{label:(0,i.jsx)(_v,{children:t("last_name")}),name:"userInfoAndTerms.lastName"})]}),(0,i.jsx)(Ba,{height:"4"}),(0,i.jsx)(Z_,{label:(0,i.jsx)(_v,{children:t("Phone")}),prefix:"userInfoAndTerms.phone."})]}),(0,i.jsx)(Om,{children:(0,i.jsx)(jl,{textAlign:"center",onClick:e,children:t("mettre_jour_85141")})})]}),validate:a.validateForForm(r.updateUserInfoAndTermsSchema()),width:1,onSubmit:async t=>{await l({userInfoId:s.user.userInfo.id,userInfoAndTermsInput:t.userInfoAndTerms}),c(),e.location.state?e.push(e.location.state):e.push(Ii.ORGANIZATION({organizationId:n}))}})},DQ=()=>{const{isOrganizationAdmin:e,isOrganizationReader:t,organization:n}=_I(),{canCustomFieldRead:s,canEventEdit:o,canOrganizationUserEdit:r,canOrganizationUserRead:a}=dS(),l=jc();return(0,i.jsxs)(Cr.dO,{children:[e&&(0,i.jsx)(Cr.qh,{path:Bi.EVENTS_IMPORT({organizationId:":organizationId"}),children:(0,i.jsx)($D,{})}),o&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.CREATE_EVENT(":organizationId"),children:(0,i.jsx)(TD,{})}),o&&(0,i.jsx)(Cr.qh,{exact:!0,path:Os.EDIT_EVENT(":organizationId",":eventId"),children:(0,i.jsx)(zD,{})}),(0,i.jsx)(Cr.qh,{path:Bi.EVENTS({organizationId:":organizationId"}),children:l?(0,i.jsx)(aP,{}):(0,i.jsx)(BE,{children:(0,i.jsx)(rP,{})})}),(0,i.jsx)(Cr.qh,{path:Bi.EVENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)($q,{})}),s&&(0,i.jsx)(Cr.qh,{path:Os.CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(BE,{children:(0,i.jsx)(jD,{})})}),e&&(0,i.jsx)(Cr.qh,{path:Os.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId"),children:(0,i.jsx)(Fq,{})}),e&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId",":emailSenderId"),children:(0,i.jsx)(Mq,{})}),t&&(0,i.jsx)(Cr.qh,{path:Os.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(":organizationId",":emailSenderId"),children:(0,i.jsx)(Nq,{})}),r&&(0,i.jsx)(Cr.qh,{path:Os.CREATE_ORGANIZATION_PARAMETERS_ROLE(":organizationId"),children:(0,i.jsx)(IZ,{})}),a&&(0,i.jsx)(Cr.qh,{path:Os.EDIT_ORGANIZATION_PARAMETERS_ROLE(":organizationId",":roleId"),children:(0,i.jsx)(vZ,{})}),(0,i.jsx)(Cr.qh,{path:Os.ORGANIZATION_PARAMETERS(":organizationId"),children:l?(0,i.jsx)(sY,{}):(0,i.jsx)(BE,{children:(0,i.jsx)(GK,{})})}),(0,i.jsx)(Cr.qh,{path:ji.COMMUNITY({organizationId:":organizationId"}),children:(0,i.jsx)(iD,{})}),(0,i.jsx)(Cr.qh,{path:Ii.IS_EXPIRED(Ii.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(BE,{children:(0,i.jsx)(OQ,{})})}),(0,i.jsx)(Cr.qh,{path:Ii.IS_BLOCKED(Ii.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(BE,{children:(0,i.jsx)(SQ,{})})}),(0,i.jsx)(Cr.qh,{exact:!0,path:Os.ACCEPT_TERMS_AND_CONDITIONS(":organizationId"),children:(0,i.jsx)($Q,{})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Bi.EVENTS({organizationId:n.id}),replace:!0})})]})},PQ=()=>(0,i.jsx)(lI,{children:(0,i.jsx)(xI,{children:(0,i.jsx)(DQ,{})})}),FQ=()=>{const e=JSON.parse(window.HEAVENT_EXPORT_POSITIONS_MAP_DATA),[t,n]=(0,M.useState)(!1),{searchParams:s}=new URL(location.href),o=function(e){if(m(e)){const[t,n]=e.split(",");if(m(t)&&m(n)){const e=parseFloat(t),i=parseFloat(n);return isNaN(e)||isNaN(i)?null:{lat:e,lng:i}}return null}return null}(s.get("center")),r=s.get("acronymIcon")||"icon",a=s.get("zoom"),l=s.get("hiddenTracesIds")?.split(",").map(e=>parseInt(e,10))??[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(PU,{acronymIcon:r,hiddenTracesIds:l,initialCenter:o,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)(Pr,{})]})},MQ=()=>{const{eventId:e,positionId:t}=Zn(),{data:n,loader:s}=Yn("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},[Ms.TraceFragment]),[o,r]=(0,M.useState)(!1);if(s)return s;{const e=n.eventPublic.position;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(br,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Dr,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:Tr(e),traces:e.traces,onTilesloaded:()=>{r(!0)}})}),o&&(0,i.jsx)(Pr,{})]})}},NQ=()=>{const e=Hn(),t=new URL(location.href).searchParams,n=t.get("eventName")||t.get("organizationName")||"",s=`${D.HEAVENT_API_URL}/users/${t.get("userId")||""}/`,o=t.get("eventId")?`${s}blacklist-event?eventId=${t.get("eventId")}`:`${s}blacklist-organization?organizationId=${t.get("organizationId")}`;return(0,i.jsx)(Ra,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[(0,i.jsx)(br,{font:"gray900 textXl semiBold",children:e("d_sinscription_61475")}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:e("vous_tes_sur_l_71517",n)}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(br,{width:1,children:(0,i.jsx)(jl,{color:"error",textAlign:"center",onClick:()=>{window.open(o,"_blank")},children:e("oui_je_souhait_20141")})})]})})},LQ=()=>{const{translate:e,params:{organizationId:t,userInfoId:n,customFieldSlug:s,value:o}}=cl(),{data:r,loader:a}=xa({organizationId:t,slug:s}),[l,d]=(0,M.useState)(!1),[c,u]=(0,M.useState)(!1),h=r.organization?.customField.name??"",m=r.organization?.customField.description??"",g=`${D.HEAVENT_API_URL}/users/${n}/field/${s}/update/${o}`;return(0,i.jsx)(Ra,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:a||(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[(0,i.jsx)(br,{font:"gray900 textXl semiBold",children:h}),(0,i.jsx)(Ba,{height:"1"}),(0,i.jsx)(br,{color:"gray500",textAlign:"center",children:m}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{justify:"center",width:1,children:c?(0,i.jsx)(Jd,{color:"success",leftIcon:"check",children:e("votre_r_ponse_a_83191")}):(0,i.jsx)(jl,{isLoading:l,leftIcon:"check",textAlign:"center",onClick:async()=>{d(!0),await fetch(g),u(!0),d(!1)},children:h})})]})})},BQ=()=>{const{translate:e,params:{organizationId:t,customFieldSlug:n}}=cl(),{data:s,loader:o}=xa({organizationId:t,slug:n}),[r,a]=(0,M.useState)(!1),[l,d]=(0,M.useState)(!1),[c,u]=(0,M.useState)(!1),[h,m]=(0,M.useState)(""),[g,p]=(0,M.useState)(""),f=s.organization?.customField.name??"",x=s.organization?.customField.description??"",_=`${D.HEAVENT_API_URL}/users/organization/${t}/update-by-ticket-id`;return(0,i.jsx)(Ra,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:o||(0,i.jsxs)(Ra,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{width:1,children:(0,i.jsx)(Ja,{color:"success",leftIcon:"check",rightIcon:"xmark",rightIconClick:()=>{d(!1)},width:1,children:e("le_champ_1_36490",f)})}),(0,i.jsx)(Ba,{height:"6"})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ra,{width:1,children:(0,i.jsx)(Ja,{color:"error",leftIcon:"circle-exclamation",rightIcon:"xmark",rightIconClick:()=>{u(!1)},width:1,children:e("le_champ_1_46567",f)})}),(0,i.jsx)(Ba,{height:"6"})]}),(0,i.jsx)(Ol,{label:e("TicketId"),value:h,onChange:m}),(0,i.jsx)(Ba,{height:"6"}),(0,i.jsx)(Ol,{hint:x,label:f,value:g,onChange:p}),(0,i.jsx)(Ba,{height:"7"}),(0,i.jsx)(Ra,{justify:"center",width:1,children:(0,i.jsx)(jl,{isLoading:r,textAlign:"center",onClick:async()=>{a(!0),d(!1),u(!1),200===(await fetch(_,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticketId:h,slug:n,value:g})})).status?(d(!0),m(""),p("")):u(!0),a(!1)},children:e("mettre_jour_34131",f)})})]})})},VQ=()=>{const{history:e,translate:t,params:{weezeventOrganizationId:n}}=cl(),{data:s,loader:o}=Yn("query WeezeventOrganizatio($id: Int) {\n organization: organizationByWeezeventId(id: $id) {\n id\n }\n}\n",{id:parseInt(n,10)},[]);return o||(s.organization?.id?(0,i.jsx)(Cr.rd,{to:Ii.ORGANIZATION({organizationId:s.organization.id})}):(0,i.jsxs)(Ra,{align:"center",css:{background:"white"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Ra,{align:"center",css:{background:mr.colors.blueGray900.value},height:64,justify:"center",width:1,children:(0,i.jsx)(Ra,{align:"center",css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(Yl,{})})}),(0,i.jsxs)(Ra,{align:"center",css:{background:"white",flex:"1"},direction:"column",gap:"6",justify:"center",width:1,children:[(0,i.jsx)(br,{height:240,width:240,children:(0,i.jsx)("img",{height:"100%",src:dd.WeezConstruction,width:"100%"})}),(0,i.jsxs)(Ra,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(br,{font:"gray800 textMd medium",children:t("aucun_compte_we_48865")}),(0,i.jsx)(br,{color:"gray500",dangerouslySetInnerHTML:{__html:t("si_vous_d_sirez_19702")}})]}),(0,i.jsxs)(Ra,{gap:"3",children:[(0,i.jsx)(jl,{onClick:()=>window.open("mailto:benjamin.vuitton@gmail.com","_blank"),children:t("nous_contacter_38070")}),(0,i.jsx)(jl,{color:"invisible",onClick:()=>e.push(Os.CREATE_EVENT_WITH_ORGANIZATION(n)),children:t("essayer_mainten_36692")})]})]})]}))},UQ=e=>(0,i.jsx)(ii,{getRedirectPath:()=>Os.AUTH_SIGN_IN,shouldHaveUser:!0,children:e.children}),WQ=e=>(0,i.jsx)(ii,{getRedirectPath:()=>Os.HOME,shouldHaveUser:!1,children:e.children});const GQ=async()=>{const{user:e}=await(async()=>{try{const e=await async function(){const e=await q();if(m(e)){const{user:t}=await function(e,t){return co("query CurrentUser {\n user {\n id\n email\n language\n insertedAt\n hubspotToken\n profile\n termsAcceptedAt\n }\n}\n",{variables:{},token:t||void 0,fragments:[]})}(0,e);return{user:t}}throw new Error("No token")}();return Bs.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()),m(t)&&(n=t);const i=n?`lang=${n}`:"";return ev(`${D.HEAVENT_API_URL}/translation/language.js?${i}`)})(e),{user:e}},HQ=e=>{const[t,n]=(0,M.useState)(null);return(0,M.useEffect)(()=>{let e=!0;return GQ().then(t=>{e&&n(t)}).catch(()=>{alert("Could not load application, please try again.")}),()=>{e=!1}},[]),t?e.render(t):(0,i.jsx)(_l,{})},qQ=window.matchMedia("(max-width: 1200px)"),YQ=M.createContext({isMobile:!1}),KQ=e=>{const[t,n]=M.useState(!1);return M.useEffect(()=>{n(qQ.matches),qQ.addListener(e=>{n(e.matches)})},[]),(0,i.jsx)(YQ.Provider,{value:{isMobile:t},children:e.children})},ZQ=(0,i.jsx)(_l,{});function XQ(e,{redirectOnSuccess:t}={}){const[n,i]=(0,M.useState)(!1),{setIsError:s}=(0,M.useContext)(NG);let o=null;return n&&(o=ZQ),{isLoading:n,loader:o,mutate:async(n,o)=>{i(!0);try{const r=await q(),a=await((e,t,n)=>co(e,{variables:t,token:n||void 0}))(e,n,o||r);return!0!==t&&(i(!1),s(!1)),a}catch(e){throw s(!0,eo(e)?e:[]),e}}}}const JQ=(0,i.jsx)(_l,{});function QQ(e,t,n){const[i,s]=(0,M.useState)(!0),[o,r]=(0,M.useState)({}),[a,l]=(0,M.useState)(0),{setIsError:d}=(0,M.useContext)(NG),c=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");(0,M.useEffect)(()=>{let i=!1;var o;return s(!0),o=c,q().then(i=>co(e,{reloadOnNewVersion:!0,variables:t,token:i,fragments:n})).then(e=>{i||o!==c||(r(e),d(!1),s(!1))},()=>{i||o!==c||d(!0)}),()=>{i=!0}},[e,c,a]);let u=null;return i&&(u=JQ),{data:o,isLoading:i,loader:u,reload(){l(a+1)}}}function e0(){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,Cr.g)())}function t0(){const e=(0,Cr.W6)();return{...e,goBack:t=>{"POP"===e.action&&e.length<=2?e.push(t):e.goBack()}}}function n0(){return(0,Cr.zy)()}function i0(){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 s0=class extends Pl{constructor(e){super(e)}delegationFormInviteValuesDefault(){return{usersInfos:[{email:"",fields:{firstName:"",lastName:""}}]}}delegationFormInviteValuesSchema(){return d.Ik().shape({usersInfos:d.YO().of(d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),fields:d.gl()})).min(1,"Vous devez invité au moins une personne.")})}};s0=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],s0);let o0=class extends Pl{translationService;constructor(e){super(e),this.translationService=e}massStateUpdateSchema(){return d.Ik().shape({state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf([Ot.NotApplicable,Ot.PreAssigned,Ot.Refused,Ot.WaitingAssignment],this.t("le_statut_est_r_13164"))})}massAccreditationStateUpdateSchema(){return d.Ik().shape({state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf([re.NotApplicable,re.Refused,re.WaitingAccreditation],this.t("le_statut_est_r_13164"))})}};o0=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],o0);let r0=class extends Pl{translationService;constructor(e){super(e),this.translationService=e}};r0=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Vn])],r0);let a0=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 Et.String:return m(t)?t:"";case Et.StringArray:return Array.isArray(t)?t:[];case Et.RichText:return m(t)?t:"";default:return nl()}}};a0=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)()],a0);let l0=class{get(){return{[xt.OrganizationAdmin]:{accessLevel:ft.Organization,permissions:YK,nameKey:"administrateur_11083",descriptionKey:"a_acc_s_toute_73520"},[xt.OrganizationReader]:{accessLevel:ft.Organization,permissions:KK,nameKey:"acc_s_en_lectur_30252",descriptionKey:"a_acc_s_l_org_94388"},[xt.EventAdmin]:{accessLevel:ft.Event,permissions:ZK,nameKey:"administrateur_24785",descriptionKey:"a_acc_s_toute_25473"},[xt.EventReader]:{accessLevel:ft.Event,permissions:XK,nameKey:"acc_s_en_lectur_33482",descriptionKey:"a_acc_s_l_v_17476"},[xt.PositionEditor]:{accessLevel:ft.Position,permissions:JK,nameKey:"responsable_de_95683",descriptionKey:"peut_modifier_s_82832"},[xt.PositionReader]:{accessLevel:ft.Position,permissions:QK,nameKey:"responsable_de_72569",descriptionKey:"a_acc_s_ses_m_09741"},[xt.DelegationCategoryLeader]:{accessLevel:ft.DelegationCategory,permissions:eZ,nameKey:"responsable_de_32820",descriptionKey:"a_acc_s_aux_d_l_87634"}}}};l0=function(e,t,n,i){var s,o=arguments.length,r=o<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--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Gt._G)()],l0);const d0=new Gt.i0(e=>{e(l0).toSelf().inSingletonScope(),e(su).toSelf().inSingletonScope(),e(Wc).toSelf().inSingletonScope(),e(Kg).toSelf().inSingletonScope(),e(ah).toSelf().inSingletonScope(),e(iA).toSelf().inSingletonScope(),e(dw).toSelf().inSingletonScope(),e(Da).toSelf().inSingletonScope()}),c0=new Gt.i0(e=>{e(cP).toSelf().inSingletonScope(),e(lP).toSelf().inSingletonScope(),e(dP).toSelf().inSingletonScope(),e(Qw).toSelf().inSingletonScope(),e(Bl).toSelf().inSingletonScope(),e(Um).toSelf().inSingletonScope(),e(Gv).toSelf().inSingletonScope(),e(OT).toSelf().inSingletonScope(),e(aO).toSelf().inSingletonScope(),e(UN).toSelf().inSingletonScope(),e(ES).toSelf().inSingletonScope(),e(yV).toSelf().inSingletonScope(),e(kV).toSelf().inSingletonScope(),e(s0).toSelf().inSingletonScope(),e(oE).toSelf().inSingletonScope(),e(TN).toSelf().inSingletonScope(),e(mj).toSelf().inSingletonScope(),e(fj).toSelf().inSingletonScope(),e(Dq).toSelf().inSingletonScope(),e(HS).toSelf().inSingletonScope(),e(LD).toSelf().inSingletonScope(),e(RD).toSelf().inSingletonScope(),e(q_).toSelf().inSingletonScope(),e(RY).toSelf().inSingletonScope(),e(Vj).toSelf().inSingletonScope(),e(eS).toSelf().inSingletonScope(),e(td).toSelf().inSingletonScope(),e(cS).toSelf().inSingletonScope(),e(_V).toSelf().inSingletonScope(),e(AV).toSelf().inSingletonScope(),e(KS).toSelf().inSingletonScope(),e(dE).toSelf().inSingletonScope(),e(OV).toSelf().inSingletonScope(),e(mE).toSelf().inSingletonScope(),e(GE).toSelf().inSingletonScope(),e(kO).toSelf().inSingletonScope(),e(AO).toSelf().inSingletonScope(),e(Yk).toSelf().inSingletonScope(),e(q$).toSelf().inSingletonScope(),e(FF).toSelf().inSingletonScope(),e(CU).toSelf().inSingletonScope(),e(GF).toSelf().inSingletonScope(),e(o0).toSelf().inSingletonScope(),e(H_).toSelf().inSingletonScope(),e(G_).toSelf().inSingletonScope(),e(WV).toSelf().inSingletonScope(),e(nU).toSelf().inSingletonScope(),e(VV).toSelf().inSingletonScope(),e(UV).toSelf().inSingletonScope(),e(tZ).toSelf().inSingletonScope(),e(uR).toSelf().inSingletonScope(),e(r0).toSelf().inSingletonScope(),e(Vl).toSelf().inSingletonScope(),e(Id).toSelf().inSingletonScope(),e(mK).toSelf().inSingletonScope(),e(hw).toSelf().inSingletonScope(),e(LU).toSelf().inSingletonScope(),e(a0).toSelf().inSingletonScope(),e(VE).toSelf().inSingletonScope(),e(WE).toSelf().inSingletonScope(),e(UE).toSelf().inSingletonScope(),e(SO).toSelf().inSingletonScope(),e(OO).toSelf().inSingletonScope()}),u0=new Gt.i0(e=>{e(Mj).toSelf().inSingletonScope(),e(du).toSelf().inSingletonScope(),e(SP).toSelf().inSingletonScope(),e(Cm).toSelf().inSingletonScope(),e(SR).toSelf().inSingletonScope(),e(sD).toSelf().inSingletonScope(),e(YR).toSelf().inSingletonScope(),e(PD).toSelf().inSingletonScope(),e(yA).toSelf().inSingletonScope(),e(oU).toSelf().inSingletonScope(),e(Bh).toSelf().inSingletonScope(),e(eR).toSelf().inSingletonScope()});function h0(){const e=new Gt.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(!md(n))throw new Error("window.HEAVENT_LANGUAGE is not valid");return e.bind(Vn).toConstantValue(new Vn(md(n),t)),e.load(d0,c0,u0),e}const m0=e=>(0,i.jsx)(Un.Provider,{value:{container:h0(),useQuery:QQ,useMutation:XQ,useExecuteQuery:uo,useParams:e0,useHistory:t0,useLocation:n0,useLocalStorage:i0},children:e.children});var g0=n(6751);const p0=M.createContext({}),f0=e=>{const t=M.useCallback((e,t)=>{D.USE_MIXPANEL&&g0.A.track(e,t)},[]);return M.useEffect(()=>{D.USE_MIXPANEL&&g0.A.init(D.MIXPANEL_TOKEN,{debug:!0})},[]),(0,i.jsx)(p0.Provider,{value:{track:t},children:e.children})},x0=M.createContext({active:!1,enable:Hl.A,disable:Hl.A}),_0=()=>{const{user:e}=ni(),t=jc(),n=Qn(),{active:i}=M.useContext(x0);return M.useEffect(()=>{if(D.USE_HUBSPOT&&m(e?.hubspotToken)){window.hsConversationsSettings={identificationEmail:e.email,identificationToken:e.hubspotToken};try{if(t||"true"===n.getItem($l.HIDE_HUBSPOT)||!i){const{loaded:e}=window.HubSpotConversations.widget.status();e?window.HubSpotConversations.widget.remove():window.HubSpotConversations.on("widgetLoaded",()=>{window.HubSpotConversations.widget.remove()})}else window.HubSpotConversations.clear({resetWidget:!0})}catch{}}},[t,i]),null};(0,Wt.render)((0,i.jsx)(M.StrictMode,{children:(0,i.jsxs)(({children:e})=>(0,i.jsx)(HQ,{render:t=>(0,i.jsx)(ti.Provider,{value:t,children:(0,i.jsx)(m0,{children:(0,i.jsx)(KQ,{children:(0,i.jsx)(LG,{children:(0,i.jsx)(nb,{children:(0,i.jsx)(f0,{children:(0,i.jsx)(i.Fragment,{children:e})})})})})})})}),{children:[(0,i.jsx)(()=>((0,M.useEffect)(()=>{q().then(e=>{"true"===D.LOG_TOKEN&&console.log(`"${F}": "${e||""}"`)})},[]),null),{}),(0,i.jsx)(({children:e})=>{const[t,n]=M.useState(!0);return(0,i.jsxs)(x0.Provider,{value:{active:t,enable:()=>{n(!0)},disable:()=>{n(!1)}},children:[(0,i.jsx)(_0,{}),e]})},{children:(0,i.jsx)(()=>(0,i.jsx)(br,{className:Ir,css:{color:"$gray800",height:"100%",overflow:"hidden",position:"relative",width:"100%"},children:(0,i.jsx)(jr.Kd,{basename:D.HEAVENT_APP_URL.pathnameOptional,children:(0,i.jsxs)(Cr.dO,{children:[(0,i.jsx)(Cr.qh,{exact:!0,path:Os.HOME,children:(0,i.jsx)(UQ,{children:(0,i.jsx)(tI,{})})}),(0,i.jsx)(Cr.qh,{path:Os.USER_UPDATE_BY_TICKET_ID(":organizationId",":customFieldSlug"),children:(0,i.jsx)(BQ,{})}),(0,i.jsx)(Cr.qh,{path:Os.USER_FIELD_UPDATE(":organizationId",":userInfoId",":customFieldSlug",":value"),children:(0,i.jsx)(LQ,{})}),(0,i.jsx)(Cr.qh,{path:Os.BACKOFFICE,children:(0,i.jsx)(UQ,{children:(0,i.jsx)(M_,{})})}),(0,i.jsx)(Cr.qh,{path:Os.POSITION_MAP(":eventId",":positionId"),children:(0,i.jsx)(MQ,{})}),(0,i.jsx)(Cr.qh,{path:Os.ACCREDITATION_MAP(":eventId",":accreditationId"),children:(0,i.jsx)(Ea,{})}),(0,i.jsx)(Cr.qh,{path:Os.EXPORT_POSITIONS_MAP(":eventId",":segmentId"),children:(0,i.jsx)(FQ,{})}),(0,i.jsx)(Cr.qh,{path:ui(Ii.ORGANIZATIONS),children:(0,i.jsx)(UQ,{children:(0,i.jsx)(nI,{})})}),(0,i.jsx)(Cr.qh,{exact:!0,path:Os.CREATE_EVENT_WITH_ORGANIZATION(":weezeventOrganizationId?"),children:(0,i.jsx)(UQ,{children:(0,i.jsx)(eI,{})})}),(0,i.jsx)(Cr.qh,{path:Ii.ORGANIZATION({organizationId:":organizationId"}),children:(0,i.jsx)(UQ,{children:(0,i.jsx)(PQ,{})})}),(0,i.jsx)(Cr.qh,{path:Os.AUTH,children:(0,i.jsx)(WQ,{children:(0,i.jsx)(Cd,{})})}),(0,i.jsx)(Cr.qh,{path:Os.COGNITO_CALLBACK,children:(0,i.jsx)(WQ,{children:(0,i.jsx)(kd,{})})}),(0,i.jsx)(Cr.qh,{path:Os.MAGIC_LINK(":code",":source"),children:(0,i.jsx)(WQ,{children:(0,i.jsx)(or,{})})}),(0,i.jsx)(Cr.qh,{path:Os.UNSUBSCRIBE_EMAIL,children:(0,i.jsx)(NQ,{})}),(0,i.jsx)(Cr.qh,{path:"/o:weezeventOrganizationId",children:(0,i.jsx)(VQ,{})}),(0,i.jsx)(Cr.qh,{children:(0,i.jsx)(ei,{path:Os.HOME})})]})})}),{})})]})}),document.getElementById("heavent-react-hook"))},6687:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankMessages-76d6e6c79babc98388e9.svg"},6871:()=>{!function(e){const t=e.it=e.it||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 di %1","Align center":"Allinea al centro","Align left":"Allinea a sinistra","Align right":"Allinea a destra",Aquamarine:"Aquamarina",Black:"Nero","Block quote":"Blocco citazione",Blue:"Blu",Bold:"Grassetto","Break text":"Interrompi testo","Bulleted List":"Elenco puntato",Cancel:"Annulla","Centered image":"Immagine centrata","Change image text alternative":"Cambia testo alternativo dell'immagine","Choose heading":"Seleziona intestazione","Dim grey":"Grigio tenue","Document colors":"Colori del docmento",Downloadable:"Scaricabile","Dropdown toolbar":"Barra degli strumenti del menu a discesa","Edit block":"Modifica blocco","Edit link":"Modifica collegamento","Editor toolbar":"Barra degli strumenti dell'editor","Font Background Color":"Colore di sfondo caratteri","Font Color":"Colore caratteri","Full size image":"Immagine a dimensione intera",Green:"Verde",Grey:"Grigio",Heading:"Intestazione","Heading 1":"Intestazione 1","Heading 2":"Intestazione 2","Heading 3":"Intestazione 3","Heading 4":"Intestazione 4","Heading 5":"Intestazione 5","Heading 6":"Intestazione 6","Image resize list":"Elenco ridimensionamenti immagine","Image toolbar":"Barra degli strumenti dell'immagine","image widget":"Widget immagine","In line":"In linea","Insert image":"Inserisci immagine","Insert paragraph after block":"Inserisci paragrafo dopo blocco","Insert paragraph before block":"Inserisci paragrafo prima di blocco",Italic:"Corsivo",Justify:"Giustifica","Left aligned image":"Immagine allineata a sinistra","Light blue":"Azzurro","Light green":"Verde chiaro","Light grey":"Grigio chiaro",Link:"Collegamento","Link URL":"URL del collegamento",Next:"Avanti","Numbered List":"Elenco numerato","Open in a new tab":"Apri in una nuova scheda","Open link in new tab":"Apri collegamento in nuova scheda",Orange:"Arancio",Original:"Originale",Paragraph:"Paragrafo",Previous:"Indietro",Purple:"Porpora",Red:"Rosso",Redo:"Ripristina","Remove color":"Rimuovi colore","Resize image":"Ridimensiona immagine","Resize image to %0":"Ridimensiona immagine a %0","Resize image to the original size":"Ridimensiona immagine alle dimensioni originali","Rich Text Editor":"Editor di testo formattato","Rich Text Editor, %0":"Editor di testo formattato, %0","Right aligned image":"Immagine allineata a destra",Save:"Salva","Select all":"Seleziona tutto","Show more items":"Mostra più elementi","Side image":"Immagine laterale","Text alignment":"Allineamento del testo","Text alignment toolbar":"Barra degli strumenti dell'allineamento","Text alternative":"Testo alternativo","This link has no URL":"Questo collegamento non ha un URL",Turquoise:"Turchese",Underline:"Sottolineato",Undo:"Annulla",Unlink:"Elimina collegamento","Upload failed":"Caricamento fallito","Upload in progress":"Caricamento in corso",White:"Bianco","Widget toolbar":"Barra degli strumenti del widget","Wrap text":"Testo a capo",Yellow:"Giallo"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},6954:(e,t,n)=>{"use strict";e.exports=n.p+"img/googleSatellite-0706bcb1678d6e9f219c.png"},7008:(e,t,n)=>{"use strict";e.exports=n.p+"img/accreditation-7f66e46aebab965fa566.png"},7648:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankPerson-e5c7b9cf3fcac68f3df8.svg"},8144:(e,t,n)=>{"use strict";e.exports=n.p+"img/asoHomeBackground-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:()=>{},9844:()=>{!function(e){const t=e.es=e.es||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 de %1","Align center":"Centrar","Align left":"Alinear a la izquierda","Align right":"Alinear a la derecha",Aquamarine:"Aguamarina",Black:"Negro","Block quote":"Cita de bloque",Blue:"Azul",Bold:"Negrita","Break text":"Permitir quebrar texto","Bulleted List":"Lista con viñetas",Cancel:"Cancelar","Centered image":"Imagen centrada","Change image text alternative":"Cambiar el texto alternativo de la imagen","Choose heading":"Elegir Encabezado","Dim grey":"Gris Oscuro","Document colors":"Colores del documento",Downloadable:"Descargable","Dropdown toolbar":"Barra de herramientas desplegable","Edit block":"Cuadro de edición","Edit link":"Editar enlace","Editor toolbar":"Barra de herramientas de edición","Font Background Color":"Color de Fondo","Font Color":"Color de Fuente","Full size image":"Imagen a tamaño completo",Green:"Verde",Grey:"Gris",Heading:"Encabezado","Heading 1":"Encabezado 1","Heading 2":"Encabezado 2","Heading 3":"Encabezado 3","Heading 4":"Encabezado 4","Heading 5":"Encabezado 5","Heading 6":"Encabezado 6","Image resize list":"Listado para redimensionar imagen","Image toolbar":"Barra de herramientas de imagen","image widget":"Widget de imagen","In line":"En línea","Insert image":"Insertar imagen","Insert paragraph after block":"Insertar párrafo después del bloque","Insert paragraph before block":"Insertar párrafo antes del bloque",Italic:"Cursiva",Justify:"Justificar","Left aligned image":"Imagen alineada a la izquierda","Light blue":"Azul Claro","Light green":"Verde Claro","Light grey":"Gris Claro",Link:"Enlace","Link URL":"URL del enlace",Next:"Siguiente","Numbered List":"Lista numerada","Open in a new tab":"Abrir en una pestaña nueva ","Open link in new tab":"Abrir enlace en una pestaña nueva",Orange:"Anaranjado",Original:"Original",Paragraph:"Párrafo",Previous:"Anterior",Purple:"Morado",Red:"Rojo",Redo:"Rehacer","Remove color":"Quitar color","Resize image":"Redimensionar imagen","Resize image to %0":"Redimensionar imagen al %0","Resize image to the original size":"Redimensionar imagen al tamaño original","Rich Text Editor":"Editor de Texto Enriquecido","Rich Text Editor, %0":"Editor de Texto Enriquecido, %0","Right aligned image":"Imagen alineada a la derecha",Save:"Guardar","Select all":"Seleccionar todo","Show more items":"Mostrar más elementos","Side image":"Imagen lateral","Text alignment":"Alineación del texto","Text alignment toolbar":"Barra de herramientas de alineación del texto","Text alternative":"Texto alternativo","This link has no URL":"Este enlace no tiene URL",Turquoise:"Turquesa",Underline:"Subrayado",Undo:"Deshacer",Unlink:"Quitar enlace","Upload failed":"Fallo en la subida","Upload in progress":"Subida en progreso",White:"Blanco","Widget toolbar":"Barra de herramientas del widget","Wrap text":"Mantener texto unido",Yellow:"Amarillo"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},9882:(e,t,n)=>{"use strict";e.exports=n.p+"img/ign-3cfd31ba578060a32efa.png"}},e=>{e.O(0,[121],()=>e(e.s=6473)),e.O()}]); //# sourceMappingURL=app-d41ce016cbcaf08823a3.cjs.map