(self.webpackChunkroot=self.webpackChunkroot||[]).push([[524],{0:(e,n,t)=>{"use strict";e.exports=t.p+"img/asoLogo-eb0c34a967f39c0e7e3a.jpg"},384:(e,n,t)=>{"use strict";e.exports=t.p+"img/avatarGroup-faca1e69e2c224b7eebe.png"},418:(e,n,t)=>{"use strict";var i=t(4848),s=(t(8630),t(9191));function o(e){try{return Buffer.from(e).toString("base64")}catch{try{return btoa(e)}catch{return""}}}function a(e){try{return Buffer.from(e,"base64").toString()}catch{try{return atob(e)}catch{return""}}}var r,d,l=t(2347);function c(e){return(0,l.A)(e.normalize("NFD").replace(/\p{Diacritic}/gu,""))}function u(e){return(0,l.A)((e||"").trim().toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu,""))}function m(e,n={}){const t=n.replacer??d.Dash,i=c(e).trim().toLowerCase().replace(/['"]+/gi,"");let s;return s=t===d.Dash?i.replace(/[^a-z0-9\\-]+/gu,"-").replace(/-+$/,"").replace(/^-+/,""):t===d.Underscore?i.replace(/[^a-z0-9_]+/gu,"_").replace(/_+$/,"").replace(/^_+/,""):i.replace(/[^a-z0-9]+/gu,"").trim(),n?.replaceStartingNumber?s.replace(/^(\d)/,"_$1"):s}function g(e){return Array.isArray(e)&&"production"!==r.Production&&console.warn("Array passed to `isNonEmptyString()`, did you mean to use `isNonEmptyArray()` instead?"),"string"==typeof e&&e.trim().length>0}function h(e){return!g(e)}!function(e){e.Development="development",e.Production="production",e.Test="test"}(r||(r={})),function(e){e[e.Dash=0]="Dash",e[e.Empty=1]="Empty",e[e.Underscore=2]="Underscore"}(d||(d={}));const p={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:'"'},I=["hm","hrh","him","hih","hh","hsh","hgdh","kg","lg","kt","lt","sm","sar","sai","sas","sagd"],x=e=>g(e)?e[0].toUpperCase()+e.slice(1):"";function f(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").split(" ").map(e=>I.includes(e.toLowerCase())?e.toUpperCase():x(e.trim())).join(" ").split("-").map(e=>I.includes(e.toLowerCase())?e.toUpperCase():x(e.trim())).join("-")}const _=/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/i;function j(e,n){const t=(e,n,t,i,s)=>et?t+1:e+1:i===s?n:n+1;if(e===n)return 0;if(e.length>n.length){const t=e;e=n,n=t}let i=e.length,s=n.length;for(;i>0&&e.charCodeAt(i-1)===n.charCodeAt(s-1);)i--,s--;let o=0;for(;o{if("object"==typeof window&&void 0!==window[e])return window[e];if(void 0!==y?.[e])return y[e];throw new Error(`Missing env. var. ${e}`)},b=e=>"object"==typeof window&&void 0!==window[e]?window[e]:void 0!==y?.[e]?y[e]:void 0,A=e=>{const n=C(e);return"boolean"==typeof n?n:"true"===n},E=C("HEAVENT_APPLICATION_DOMAIN"),w=b("HEAVENT_RESOURCES_DOMAIN")??E,$=b("HEAVENT_ASSETS_DOMAIN")??w,T=b("HEAVENT_APP_SUBDOMAIN")??"admin",z=b("HEAVENT_API_SUBDOMAIN")??"api",O=b("HEAVENT_PUBLIC_SUBDOMAIN")??"widget",R=b("HEAVENT_INVOICES_SUBDOMAIN")??"invoices",D=b("HEAVENT_ASSETS_SUBDOMAIN")??"assets",M=b("HEAVENT_UPLOADS_SUBDOMAIN")??"uploads",P=b("HEAVENT_APPLICATION_BASENAME")??"crew",k=b("HEAVENT_RESOURCES_BASENAME")??"",F={ADMINS:C("HEAVENT_ADMINS"),EMAIL_FROM:C("HEAVENT_EMAIL_FROM"),EMAIL_FROM_NAME:C("HEAVENT_EMAIL_FROM_NAME"),EMAIL_PICTURE_LINK:C("HEAVENT_EMAIL_PICTURE_LINK"),HEAVENT_APPLICATION_DOMAIN:E,HEAVENT_RESOURCES_DOMAIN:w,HEAVENT_ASSETS_DOMAIN:$,HEAVENT_APPLICATION_BASENAME:P,HEAVENT_APP_URL:new v(b("HEAVENT_APP_DOMAIN")??E,void 0,T,b("HEAVENT_APP_BASENAME")??P),HEAVENT_API_URL:new v(b("HEAVENT_API_DOMAIN")??E,void 0,z,b("HEAVENT_API_BASENAME")??P),HEAVENT_PUBLIC_URL:new v(b("HEAVENT_PUBLIC_DOMAIN")??E,void 0,O,b("HEAVENT_PUBLIC_BASENAME")??P),HEAVENT_ASSETS_URL:new v($,void 0,D,b("HEAVENT_ASSETS_BASENAME")??k),HEAVENT_INVOICES_URL:new v(b("HEAVENT_INVOICES_DOMAIN")??w,void 0,R,b("HEAVENT_INVOICES_BASENAME")??k),HEAVENT_UPLOADS_URL:new v(b("HEAVENT_UPLOADS_DOMAIN")??w,void 0,M,b("HEAVENT_UPLOADS_BASENAME")??k),USE_HUBSPOT:A("HEAVENT_USE_HUBSPOT"),USE_INTERCOM:A("HEAVENT_USE_INTERCOM"),FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID:b("HEAVENT_FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID"),HIGHLIGHT_CUSTOM_COLOURS:(()=>{const e=b("HEAVENT_HIGHLIGHT_CUSTOM_COLOURS");return void 0!==e?"boolean"==typeof e?e:"true"===e:void 0})(),COGNITO_USER_POOL_ID:C("HEAVENT_COGNITO_USER_POOL_ID"),COGNITO_USER_POOL_CLIENT_ID:C("HEAVENT_COGNITO_USER_POOL_CLIENT_ID"),COGNITO_DOMAIN_URL:C("HEAVENT_COGNITO_DOMAIN_URL"),COGNITO_CLIENT_CALLBACK_URL:C("HEAVENT_COGNITO_CLIENT_CALLBACK_URL")[0],USE_MIXPANEL:A("HEAVENT_USE_MIXPANEL"),MIXPANEL_TOKEN:A("HEAVENT_MIXPANEL_TOKEN"),HEAVENT_AWS_UPLOADS_BUCKET:C("HEAVENT_AWS_UPLOADS_BUCKET"),LOG_TOKEN:C("HEAVENT_LOG_TOKEN"),WEEZEVENT_DOMAIN:C("HEAVENT_WEEZEVENT_DOMAIN")},N="x-heavent-commit-sha",L="x-heavent-request-uuid",U="x-user-token";var V=t(6540),B=t(5002);function W(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})}const G="heavent-user-session-key",q="heavent-user-email",H="UserNotFoundException";let Y=null;const Z=()=>(null===Y&&(Y=new B.NE({UserPoolId:F.COGNITO_USER_POOL_ID,ClientId:F.COGNITO_USER_POOL_CLIENT_ID})),Y);function K(){return new Promise((e,n)=>{const t=Z().getCurrentUser();null!==t?t.getSession((i,s)=>{i||!1===s?.isValid()?n(new Error("Could not get current user")):e({user:t,token:s.getIdToken().getJwtToken()})}):n(new Error("Could not get current user"))})}async function X(){try{const e=localStorage.getItem("heavent-test-token");return g(e)?e:(await K()).token}catch{return}}function Q(e,n){const t=e.trim().toLowerCase();return new Promise((e,i)=>{const s=[new B.HB({Name:"email",Value:t})];Z().signUp(t,n,s,[],(n,t)=>{n?i(n):e(t.user)})})}function J(){K().then(({user:e})=>{e.signOut(),location.reload()}).catch(()=>{alert("Something wrong happened ")})}function ee(e,n,t){return new Promise((i,s)=>{const o=new B.TU({Username:e,Pool:Z()}),a=new B.By({Username:e}),r={onSuccess(e){n(e.getIdToken().getJwtToken())},onFailure(e){e.code===H?s(H):t(e)},customChallenge(){localStorage.setItem(q,e),localStorage.setItem(G,o.Session),i({user:o,callbacks:r})}};o.setAuthenticationFlowType("CUSTOM_AUTH"),o.initiateAuth(a,r)})}function ne(e,n){return new Promise((t,i)=>{new B.TU({Username:e,Pool:Z()}).authenticateUser(new B.By({Username:e,Password:n}),{onSuccess(e){t(e.getIdToken().getJwtToken())},onFailure(e){i(e)}})})}function te(e){return new Promise((n,t)=>{new B.TU({Username:e,Pool:Z()}).forgotPassword({onSuccess(){n(!0)},async onFailure(i){if(i.code===H)try{await Q(e,W().toString()),await te(e),n(!0)}catch(e){t(e)}else t(i)}})})}function ie(e,n,t){return new Promise((i,s)=>{new B.TU({Username:e,Pool:Z()}).confirmPassword(n,t,{async onSuccess(){i(await ne(e,t))},onFailure(e){s(e)}})})}var se,oe,ae,re,de,le,ce,ue,me,ge,he,pe,Ie,xe,fe,_e,je,ve,Se,ye,Ce,be,Ae,Ee,we,$e,Te,ze,Oe,Re,De,Me,Pe,ke,Fe,Ne,Le,Ue,Ve,Be,We,Ge,qe,He,Ye,Ze,Ke,Xe,Qe,Je,en,nn,tn,sn,on,an,rn,dn,ln,cn,un,mn,gn,hn,pn,In,xn,fn,_n,jn,vn,Sn,yn,Cn,bn,An,En,wn,$n,Tn,zn,On,Rn,Dn,Mn,Pn,kn,Fn,Nn,Ln,Un,Vn,Bn,Wn,Gn,qn,Hn,Yn,Zn,Kn,Xn,Qn,Jn,et,nt,tt,it,st,ot,at,rt,dt,lt,ct,ut,mt,gt,ht,pt,It,xt,ft,_t,jt,vt,St=t(961),yt=t(1519);!function(e){e.Delegation="Delegation",e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position",e.PositionCategory="PositionCategory"}(se||(se={})),function(e){e.Calendar="Calendar",e.List="List",e.Radio="Radio"}(oe||(oe={})),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"}(ae||(ae={})),function(e){e.Accredited="Accredited",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(re||(re={})),function(e){e.Done="Done",e.Waiting="Waiting"}(de||(de={})),function(e){e.Acronym="Acronym",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Name="Name"}(le||(le={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(ce||(ce={})),function(e){e.Accreditation="Accreditation",e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Date="Date",e.Id="Id",e.Name="Name"}(ue||(ue={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Index="Index",e.Name="Name"}(me||(me={})),function(e){e.Accredited="Accredited",e.AutoAccredited="AutoAccredited",e.NotApplicable="NotApplicable",e.Refused="Refused",e.WaitingAccreditation="WaitingAccreditation"}(ge||(ge={})),function(e){e.Car="Car",e.Moto="Moto"}(he||(he={})),function(e){e.Assigned="Assigned",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(pe||(pe={})),function(e){e.EventStart="EventStart",e.EventEnd="EventEnd"}(Ie||(Ie={})),function(e){e.Before="Before",e.After="After"}(xe||(xe={})),function(e){e.NoSchedule="NoSchedule",e.Datetime="Datetime",e.Anchor="Anchor"}(fe||(fe={})),function(e){e.InsertedAt="InsertedAt",e.Name="Name",e.State="State",e.Type="Type"}(_e||(_e={})),function(e){e.Done="Done",e.Draft="Draft",e.InProgress="InProgress",e.Scheduled="Scheduled",e.Template="Template"}(je||(je={})),function(e){e.Email="Email",e.Sms="Sms"}(ve||(ve={})),function(e){e.C10012713_1K="C10012713_1K",e.C10012713_2K="C10012713_2K",e.C10012713_3K="C10012713_3K",e.C10012713_4K="C10012713_4K",e.C10012713_5K="C10012713_5K",e.C10012713_6K="C10012713_6K",e.C10012713_7K="C10012713_7K",e.C10012713_1="C10012713_1",e.C10012713_2="C10012713_2",e.C10012713_3="C10012713_3",e.C10012713_4="C10012713_4",e.C10012713_5="C10012713_5",e.C10012713_6="C10012713_6",e.C10012713_7="C10012713_7",e.C10012717_1K="C10012717_1K",e.C10012717_2K="C10012717_2K",e.C10012717_3K="C10012717_3K",e.C10012717_4K="C10012717_4K",e.C10012717_5K="C10012717_5K",e.C10012717_6K="C10012717_6K",e.C10012717_7K="C10012717_7K",e.C10012717_1="C10012717_1",e.C10012717_2="C10012717_2",e.C10012717_3="C10012717_3",e.C10012717_4="C10012717_4",e.C10012717_5="C10012717_5",e.C10012717_6="C10012717_6",e.C10012717_7="C10012717_7",e.C10006995K="C10006995K",e.C10006995_1K="C10006995_1K",e.C10006995_2K="C10006995_2K",e.C10006995_3K="C10006995_3K",e.C10006995_4K="C10006995_4K",e.C10006995_5K="C10006995_5K",e.C10006995_6K="C10006995_6K",e.C10006995_7K="C10006995_7K",e.C10006995="C10006995",e.C10006995_1="C10006995_1",e.C10006995_2="C10006995_2",e.C10006995_3="C10006995_3",e.C10006995_4="C10006995_4",e.C10006995_5="C10006995_5",e.C10006995_6="C10006995_6",e.C10006995_7="C10006995_7",e.C10010951K="C10010951K",e.C10010951_1K="C10010951_1K",e.C10010951_2K="C10010951_2K",e.C10010951_3K="C10010951_3K",e.C10010951_4K="C10010951_4K",e.C10010951_5K="C10010951_5K",e.C10010951_6K="C10010951_6K",e.C10010951_7K="C10010951_7K",e.C10010951="C10010951",e.C10010951_1="C10010951_1",e.C10010951_2="C10010951_2",e.C10010951_3="C10010951_3",e.C10010951_4="C10010951_4",e.C10010951_5="C10010951_5",e.C10010951_6="C10010951_6",e.C10010951_7="C10010951_7",e.C10006999="C10006999",e.C10006999_1="C10006999_1",e.C10006999_2="C10006999_2",e.C10006999_3="C10006999_3",e.C10006999_4="C10006999_4",e.C10006999_5="C10006999_5",e.C10006999_6="C10006999_6",e.C10006999_7="C10006999_7",e.C10006999K="C10006999K",e.C10006999_1K="C10006999_1K",e.C10006999_2K="C10006999_2K",e.C10006999_3K="C10006999_3K",e.C10006999_4K="C10006999_4K",e.C10006999_5K="C10006999_5K",e.C10006999_6K="C10006999_6K",e.C10006999_7K="C10006999_7K",e.C10015355K="C10015355K",e.C10015355_1K="C10015355_1K",e.C10015355_2K="C10015355_2K",e.C10015355_3K="C10015355_3K",e.C10015355_4K="C10015355_4K",e.C10015355_5K="C10015355_5K",e.C10015355_6K="C10015355_6K",e.C10015355_7K="C10015355_7K",e.C10015355="C10015355",e.C10015355_1="C10015355_1",e.C10015355_2="C10015355_2",e.C10015355_3="C10015355_3",e.C10015355_4="C10015355_4",e.C10015355_5="C10015355_5",e.C10015355_6="C10015355_6",e.C10015355_7="C10015355_7"}(Se||(Se={})),function(e){e.Waiting="Waiting",e.CheckedIn="CheckedIn",e.CheckedOut="CheckedOut"}(ye||(ye={})),function(e){e.BreakTime="BreakTime",e.CheckIn="CheckIn",e.CheckInOut="CheckInOut",e.CheckOut="CheckOut",e.Reset="Reset"}(Ce||(Ce={})),function(e){e.And="And",e.Or="Or"}(be||(be={})),function(e){e.Animajeconvention="Animajeconvention",e.Asoassignment="Asoassignment",e.Hbcldc="Hbcldc",e.Hbclnh="Hbclnh",e.P2nassignment="P2nassignment",e.P2nassignmentmontagedemontage="P2nassignmentmontagedemontage",e.Paris20km="Paris20km",e.Paris20kmassignment="Paris20kmassignment",e.Paris20kmcontremarque="Paris20kmcontremarque",e.Playground="Playground",e.T24assignment="T24assignment"}(Ae||(Ae={})),function(e){e.All="All",e.Public="Public",e.Private="Private"}(Ee||(Ee={})),function(e){e.Category="Category",e.Label="Label",e.Name="Name",e.Privacy="Privacy"}(we||(we={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Label="Label",e.Name="Name",e.Status="Status",e.Type="Type"}($e||($e={})),(vt=Te||(Te={})).Accreditation="Accreditation",vt.Delegation="Delegation",vt.Event="Event",vt.Position="Position",vt.UserInfo="UserInfo",function(e){e.Campaigns="Campaigns",e.CanLeadersAddMembers="CanLeadersAddMembers",e.CanLeadersDeleteMembers="CanLeadersDeleteMembers",e.CanLeadersDuplicateMembers="CanLeadersDuplicateMembers",e.CanLeadersEditColumns="CanLeadersEditColumns",e.CanLeadersEditCustomFields="CanLeadersEditCustomFields",e.CanLeadersEditMembers="CanLeadersEditMembers",e.CanLeadersImportMembers="CanLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="CanLeadersSeeHiddenAccreditationsSlots",e.Category="Category",e.Columns="Columns",e.DeadlineDate="DeadlineDate",e.DelegationsSpaceLayout="DelegationsSpaceLayout",e.Description="Description",e.Documents="Documents",e.Form="Form",e.IsLocked="IsLocked",e.MaxResources="MaxResources",e.Name="Name",e.Parent="Parent",e.ShowAllAccreditations="ShowAllAccreditations",e.ShowFormLinkInDelegationSpace="ShowFormLinkInDelegationSpace",e.ShowInDelegationSpace="ShowInDelegationSpace",e.Tag="Tag"}(ze||(ze={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Oe||(Oe={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Re||(Re={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.MaxResources="MaxResources",e.Name="Name"}(De||(De={})),function(e){e.Expired="Expired",e.Full="Full",e.Locked="Locked",e.Ongoing="Ongoing"}(Me||(Me={})),function(e){e.Failed="FAILED",e.Pending="PENDING",e.Success="SUCCESS"}(Pe||(Pe={})),function(e){e.OnePerPage="OnePerPage",e.GroupedA4="GroupedA4"}(ke||(ke={})),function(e){e.Name="Name"}(Fe||(Fe={})),function(e){e.AsoPaxManifest="AsoPaxManifest",e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.CustomBadge="CustomBadge",e.DelegationCalendar="DelegationCalendar",e.Planning="Planning",e.Position="Position",e.PositionPlanning="PositionPlanning",e.PositionsVolunteersPlanning="PositionsVolunteersPlanning",e.UserCustomDocument="UserCustomDocument",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList",e.UsersPictures="UsersPictures",e.VolunteersListing="VolunteersListing"}(Ne||(Ne={})),function(e){e.Bounced="Bounced",e.Delivered="Delivered",e.Opened="Opened",e.Queued="Queued",e.Sent="Sent",e.Waiting="Waiting"}(Le||(Le={})),function(e){e.DoesNotExist="DoesNotExist",e.NotVerified="NotVerified",e.Verified="Verified"}(Ue||(Ue={})),function(e){e.Accreditations="Accreditations",e.AccreditationsImport="AccreditationsImport",e.AccreditationsProfilesImport="AccreditationsProfilesImport",e.AccreditationsRefused="AccreditationsRefused",e.Assignments="Assignments",e.Campaign="Campaign",e.Code="Code",e.DelegationCategoryLeaderAssign="DelegationCategoryLeaderAssign",e.DelegationFormInvite="DelegationFormInvite",e.DelegationLeaderAssign="DelegationLeaderAssign",e.DelegationsImport="DelegationsImport",e.Documents="Documents",e.EventInvite="EventInvite",e.EventsImport="EventsImport",e.Export="Export",e.FilesImport="FilesImport",e.FormInvite="FormInvite",e.FormSubmit="FormSubmit",e.MembersImport="MembersImport",e.NewMember="NewMember",e.NotifyLeaders="NotifyLeaders",e.OrganizationInvite="OrganizationInvite",e.PositionCategoryLeaderAssign="PositionCategoryLeaderAssign",e.PositionLeaderAssign="PositionLeaderAssign",e.PositionsImport="PositionsImport",e.Refused="Refused",e.VolunteerRegistration="VolunteerRegistration"}(Ve||(Ve={})),function(e){e.Description="Description",e.EndAt="EndAt",e.Name="Name",e.StartAt="StartAt",e.Tag="Tag"}(Be||(Be={})),function(e){e.Done="Done",e.Waiting="Waiting"}(We||(We={})),function(e){e.CreatedAt="CreatedAt",e.EndAt="EndAt",e.Id="Id",e.Name="Name",e.StartAt="StartAt"}(Ge||(Ge={})),(jt=qe||(qe={})).Archived="Archived",jt.Done="Done",jt.Ongoing="Ongoing",jt.Upcoming="Upcoming",function(e){e.Excel="Excel",e.Csv="CSV"}(He||(He={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Ye||(Ye={})),function(e){e.Accreditation="Accreditation",e.Api="Api",e.Beta="Beta",e.Community="Community",e.Criblage="Criblage",e.CustomDocument="CustomDocument",e.Delegation="Delegation",e.Documents="Documents",e.Eid="Eid",e.KmlImport="KmlImport",e.Languages="Languages",e.Multiform="Multiform",e.Skidata="Skidata",e.Sms="Sms",e.Weezevent="Weezevent",e.Zapier="Zapier"}(Ze||(Ze={})),function(e){e.BirthCity="birthCity",e.BirthCountry="birthCountry",e.BirthPostalCode="birthPostalCode",e.City="city",e.Country="country",e.Custom="custom",e.DateOfBirth="dateOfBirth",e.Eid="eid",e.FirstName="firstName",e.Language="language",e.LastName="lastName",e.Nationality="nationality",e.Phone="phone",e.Picture="picture",e.Population="population",e.PostalCode="postalCode",e.Sex="sex",e.Street="street"}(Ke||(Ke={})),function(e){e.Freeform="Freeform",e.Iban="Iban",e.Avs="Avs",e.Eid="Eid"}(Xe||(Xe={})),(_t=Qe||(Qe={})).Address="Address",_t.Checkbox="Checkbox",_t.Country="Country",_t.Date="Date",_t.Datetime="Datetime",_t.File="File",_t.Language="Language",_t.Nationality="Nationality",_t.Number="Number",_t.Phone="Phone",_t.Select="Select",_t.Sex="Sex",_t.Text="Text",_t.Textarea="Textarea",_t.Time="Time",_t.Validation="Validation",function(e){e.Done="Done",e.Waiting="Waiting"}(Je||(Je={})),function(e){e.Default="Default",e.Picture="Picture"}(en||(en={})),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"}(nn||(nn={})),function(e){e.Field="Field",e.Section="Section",e.Text="Text"}(tn||(tn={})),function(e){e.Ranked="Ranked",e.Unranked="Unranked"}(sn||(sn={})),function(e){e.Admin="Admin",e.DelegationsSpace="DelegationsSpace",e.Form="Form"}(on||(on={})),function(e){e.CloseWhenEventDone="CloseWhenEventDone",e.Closed="Closed",e.ClosedAt="ClosedAt",e.Open="Open"}(an||(an={})),function(e){e.Backpack="Backpack",e.BadgeCheck="BadgeCheck",e.BagShopping="BagShopping",e.Bed="Bed",e.BedBunk="BedBunk",e.Bicycle="Bicycle",e.BriefcaseMedical="BriefcaseMedical",e.BurgerSoda="BurgerSoda",e.CakeCandles="CakeCandles",e.Camera="Camera",e.Car="Car",e.CircleParking="CircleParking",e.CircleQuestion="CircleQuestion",e.Computer="Computer",e.Droplet="Droplet",e.ForkKnife="ForkKnife",e.HatCowboy="HatCowboy",e.House="House",e.LocationDot="LocationDot",e.MartiniGlass="MartiniGlass",e.Megaphone="Megaphone",e.Motorcycle="Motorcycle",e.PersonBiking="PersonBiking",e.PersonHiking="PersonHiking",e.Phone="Phone",e.ScrewdriverWrench="ScrewdriverWrench",e.Shirt="Shirt",e.SignsPost="SignsPost",e.Star="Star",e.Ticket="Ticket",e.UserPolice="UserPolice",e.WalkieTalkie="WalkieTalkie"}(rn||(rn={})),function(e){e.Create="Create",e.Upsert="Upsert",e.Update="Update"}(dn||(dn={})),function(e){e.Overdue="Overdue",e.Paid="Paid",e.Refunded="Refunded",e.Waiting="Waiting",e.WrittenOff="WrittenOff"}(ln||(ln={})),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"}(cn||(cn={})),function(e){e.Default="Default",e.Dot="Dot",e.Badge="Badge"}(un||(un={})),function(e){e.App="App",e.DelegationsSpace="DelegationsSpace",e.MembersSpace="MembersSpace",e.VolunteerAssignments="VolunteerAssignments",e.VolunteerRegister="VolunteerRegister"}(mn||(mn={})),function(e){e.Google="Google",e.GoogleSatellite="GoogleSatellite",e.IgnPlan="IgnPlan"}(gn||(gn={})),function(e){e.Add="Add",e.Delete="Delete",e.Replace="Replace"}(hn||(hn={})),function(e){e.Add="Add",e.Replace="Replace",e.Reset="Reset"}(pn||(pn={})),function(e){e.Categories="Categories",e.Positions="Positions"}(In||(In={})),function(e){e.Both="Both",e.Event="Event",e.Organization="Organization"}(xn||(xn={})),function(e){e.Id="Id",e.InsertedAt="InsertedAt",e.PeriodEndAt="PeriodEndAt",e.WeezeventOrganizationId="WeezeventOrganizationId"}(fn||(fn={})),function(e){e.A4Portrait="A4Portrait",e.A4Landscape="A4Landscape",e.A5Portrait="A5Portrait",e.A6Portrait="A6Portrait"}(_n||(_n={})),function(e){e.List="List",e.Radio="Radio"}(jn||(jn={})),function(e){e.Acronym="Acronym",e.Address="Address",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Latitude="Latitude",e.Layer="Layer",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.Traces="Traces",e.WeezeventIsSynchronized="WeezeventIsSynchronized",e.Zoom="Zoom"}(vn||(vn={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Sn||(Sn={})),function(e){e.Done="Done",e.Waiting="Waiting"}(yn||(yn={})),function(e){e.EndDate="EndDate",e.EndTime="EndTime",e.Resources="Resources",e.StartDate="StartDate",e.StartTime="StartTime"}(Cn||(Cn={})),function(e){e.Add="Add",e.Replace="Replace",e.Subtract="Subtract"}(bn||(bn={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Position="Position",e.Range="Range"}(An||(An={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Slot="Slot"}(En||(En={})),function(e){e.Empty="Empty",e.Partial="Partial",e.Full="Full"}(wn||(wn={})),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.IsInLast="isInLast",e.IsInNext="isInNext",e.IsMoreThanAgo="isMoreThanAgo",e.IsMoreThanAhead="isMoreThanAhead",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"}($n||($n={})),function(e){e.And="and",e.Or="or"}(Tn||(Tn={})),function(e){e.EventNotLinked="EventNotLinked",e.GroupsUnreachable="GroupsUnreachable",e.GroupNotFound="GroupNotFound",e.Unexpected="Unexpected"}(zn||(zn={})),function(e){e.Paper="Paper",e.Ticket="Ticket",e.Wristband="Wristband"}(On||(On={})),function(e){e.OrganizationNotLinked="OrganizationNotLinked",e.PartnersUnreachable="PartnersUnreachable",e.PartnerNotFound="PartnerNotFound",e.EventNotLinked="EventNotLinked",e.GroupsUnreachable="GroupsUnreachable",e.GroupNotFound="GroupNotFound",e.DocumentNotFound="DocumentNotFound"}(Rn||(Rn={})),function(e){e.ActivationRange="ActivationRange",e.CreatedAt="CreatedAt",e.Document="Document",e.Id="Id",e.MediaType="MediaType",e.PrinterGroup="PrinterGroup",e.Status="Status",e.WeezaccessPartner="WeezaccessPartner"}(Dn||(Dn={})),(ft=Mn||(Mn={})).Active="Active",ft.Past="Past",ft.Upcoming="Upcoming",function(e){e.Accreditation="Accreditation",e.None="None"}(Pn||(Pn={})),function(e){e.AllDays="AllDays",e.DaysWithSlots="DaysWithSlots"}(kn||(kn={})),function(e){e.Category="Category",e.Position="Position",e.Slot="Slot",e.None="None"}(Fn||(Fn={})),function(e){e.FilterWithSlots="FilterWithSlots",e.None="None"}(Nn||(Nn={})),(xt=Ln||(Ln={})).Calendar="Calendar",xt.Custom="Custom",xt.Display="Display",xt.DisplayDays="DisplayDays",xt.Hide="Hide",function(e){e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position"}(Un||(Un={})),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"}(Vn||(Vn={})),function(e){e.Accreditations="Accreditations",e.AccreditationsProfiles="AccreditationsProfiles",e.Campaigns="Campaigns",e.CustomFields="CustomFields",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.Volunteers="Volunteers",e.Workflows="Workflows"}(Bn||(Bn={})),function(e){e.Female="Female",e.Male="Male",e.Nonbinary="Nonbinary",e.Notsay="Notsay",e.Other="Other"}(Wn||(Wn={})),function(e){e.Asc="Asc",e.Desc="Desc"}(Gn||(Gn={})),function(e){e.DelegationSpace="DelegationSpace",e.EventsShowcase="EventsShowcase",e.MembersSpace="MembersSpace"}(qn||(qn={})),(It=Hn||(Hn={})).De="De",It.En="En",It.Es="Es",It.Fr="Fr",It.Keys="Keys",It.Nl="Nl",function(e){e.Accreditations="Accreditations",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.UsersInfos="UsersInfos"}(Yn||(Yn={})),function(e){e.WithReplies="WithReplies",e.WithUnreadReplies="WithUnreadReplies",e.WithoutReplies="WithoutReplies"}(Zn||(Zn={})),function(e){e.Delivered="Delivered",e.InvalidNumber="InvalidNumber",e.Other="Other",e.Refused="Refused",e.Sent="Sent",e.Undelivered="Undelivered",e.Waiting="Waiting"}(Kn||(Kn={})),function(e){e.None="None",e.Backward="Backward",e.Forward="Forward"}(Xn||(Xn={})),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"}(Qn||(Qn={})),function(e){e.NotTranslated="NotTranslated",e.Translated="Translated",e.TranslatedAndNotTranslated="TranslatedAndNotTranslated"}(Jn||(Jn={})),function(e){e.String="String",e.StringArray="StringArray",e.RichText="RichText"}(et||(et={})),function(e){e.Admin="Admin",e.Leader="Leader"}(nt||(nt={})),function(e){e.Email="Email",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LastSeenAt="LastSeenAt",e.LocalId="LocalId",e.Name="Name",e.UpdatedAt="UpdatedAt"}(tt||(tt={})),function(e){e.Assigned="Assigned",e.NotApplicable="NotApplicable",e.PreAssigned="PreAssigned",e.Refused="Refused",e.WaitingAssignment="WaitingAssignment"}(it||(it={})),function(e){e.Done="Done",e.Waiting="Waiting"}(st||(st={})),function(e){e.AccreditationState="AccreditationState",e.Delegation="Delegation",e.Email="Email",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LocalId="LocalId",e.Name="Name",e.OrganizationLocalId="OrganizationLocalId",e.PairedAt="PairedAt",e.State="State",e.TeamCode="TeamCode",e.UpdatedAt="UpdatedAt"}(ot||(ot={})),function(e){e.OrganizationNotLinked="OrganizationNotLinked",e.PartnersUnreachable="PartnersUnreachable",e.PartnerNotFound="PartnerNotFound",e.Unexpected="Unexpected"}(at||(at={})),function(e){e.AddAccreditations="AddAccreditations",e.AddDelegationPermissions="AddDelegationPermissions",e.AddEvent="AddEvent",e.AddPositions="AddPositions",e.CreateDelegation="CreateDelegation",e.DeleteAccreditations="DeleteAccreditations",e.DeleteDelegationPermissions="DeleteDelegationPermissions",e.DeletePositions="DeletePositions",e.DuplicateMember="DuplicateMember",e.LockDelegation="LockDelegation",e.SendCampaign="SendCampaign",e.SetCustomField="SetCustomField",e.UnlockDelegation="UnlockDelegation"}(rt||(rt={})),function(e){e.EveryMinute="EveryMinute",e.Every2Minutes="Every2Minutes",e.Every5Minutes="Every5Minutes",e.Every10Minutes="Every10Minutes"}(dt||(dt={})),function(e){e.Revert="Revert",e.Keep="Keep"}(lt||(lt={})),function(e){e.Frequency="Frequency",e.Name="Name",e.State="State"}(ct||(ct={})),function(e){e.DelegationsLeaders="DelegationsLeaders",e.PositionsLeaders="PositionsLeaders",e.UsersInfosIds="UsersInfosIds",e.View="View"}(ut||(ut={})),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"}(gt||(gt={})),(pt=ht||(ht={})).Assigned="Assigned",pt.DelegationsSegment="DelegationsSegment",pt.FormSubmit="FormSubmit",pt.VolunteersSegment="VolunteersSegment",Object.keys(se);const Ct=Object.keys(oe),bt=Object.keys(ae),At=(Object.keys(re),Object.keys(de),Object.keys(le)),Et=(Object.keys(ce),Object.keys(ue),Object.keys(me),Object.keys(ge)),wt=Object.keys(he),$t=(Object.keys(pe),Object.keys(Ie)),Tt=Object.keys(xe),zt=(Object.keys(fe),Object.keys(_e),Object.keys(je)),Ot=Object.keys(ve),Rt=(Object.keys(Se),Object.keys(ye)),Dt=(Object.keys(Ce),Object.keys(be),Object.keys(Ae)),Mt=(Object.keys(Ee),Object.keys(we)),Pt=(Object.keys($e),Object.keys(Te)),kt=Object.keys(ze),Ft=(Object.keys(Oe),Object.keys(Re),Object.keys(De),Object.keys(Me)),Nt=(Object.keys(Pe),Object.keys(ke)),Lt=(Object.keys(Fe),Object.keys(Ne),Object.keys(Le)),Ut=(Object.keys(Ue),Object.keys(Ve)),Vt=(Object.keys(Be),Object.keys(We),Object.keys(Ge),Object.keys(qe)),Bt=(Object.keys(He),Object.keys(Ye),Object.keys(Ze)),Wt=(Object.keys(Ke),Object.keys(Xe)),Gt=Object.keys(Qe),qt=(Object.keys(Je),Object.keys(en)),Ht=(Object.keys(nn),Object.keys(tn),Object.keys(sn)),Yt=(Object.keys(on),Object.keys(an)),Zt=Object.keys(rn),Kt=Object.keys(dn),Xt=Object.keys(ln),Qt=Object.keys(cn),Jt=Object.keys(un),ei=(Object.keys(mn),Object.keys(gn)),ni=Object.keys(hn),ti=Object.keys(pn),ii=Object.keys(In),si=(Object.keys(xn),Object.keys(fn),Object.keys(_n),Object.keys(jn)),oi=Object.keys(vn),ai=(Object.keys(Sn),Object.keys(yn),Object.keys(Cn)),ri=Object.keys(bn),di=(Object.keys(An),Object.keys(En),Object.keys(wn)),li=(Object.keys($n),Object.keys(Tn),Object.keys(zn),Object.keys(On),Object.keys(Rn),Object.keys(Dn),Object.keys(Mn),Object.keys(Pn)),ci=Object.keys(kn),ui=Object.keys(Fn),mi=Object.keys(Nn),gi=Object.keys(Ln),hi=Object.keys(Un),pi=(Object.keys(Vn),Object.keys(Bn),Object.keys(Wn)),Ii=Object.keys(Gn),xi=(Object.keys(qn),Object.keys(Hn),Object.keys(Yn),Object.keys(Zn)),fi=Object.keys(Kn),_i=(Object.keys(Xn),Object.keys(Qn)),ji=Object.keys(Jn),vi=(Object.keys(et),Object.keys(nt),Object.keys(tt),Object.keys(it)),Si=(Object.keys(st),Object.keys(ot)),yi=(Object.keys(at),Object.keys(rt)),Ci=Object.keys(dt),bi=Object.keys(lt),Ai=Object.keys(ct),Ei=Object.keys(ut),wi=(Object.keys(mt),Object.keys(gt)),$i=Object.keys(ht),Ti=["insertedAt","updatedAt","checkInAt","date","sentAt","scheduledAt","deletedAt","lockedAt","bouncedAt","complaintAt","deliveredAt","rejectedAt","openedAt","clickedAt","queuedAt","closedAt","periodEndAt","checkOutAt","validatedAt","receptionDate","startAt","termsAcceptedAt","lastSeenAt","registrationDate","pairedAt","executedAt"],zi=["date","calendarInviteStartDate","calendarInviteEndDate","startDate","endDate","deadlineDate","minAccreditationSlotDate","startAt","endAt","paidAt"],Oi=["range","ranges","activationRange"],Ri=["assignedDuration","duration"];let Di=class{language;translations;constructor(e,n){this.language=e,this.translations=n}translate(e,...n){if("production"!==r.Test||process.env.JEST_WORKER_ID){let t=this.translations[e]||e;const i=this.translations[`${e}_plural`];return i&&"number"==typeof n[0]&&n[0]>1&&(t=i),Array.isArray(n)&&n.length>0&&(t=n.reduce((e,n,t)=>e.replaceAll(`{${t+1}}`,n),t)),t}return`${e} - ${JSON.stringify(n)}`}*interpolateWithComponents(e,...n){let t=0;for(const[s,o]of e.split(/{\d+}/).entries())t>0&&(yield(0,i.jsx)(V.Fragment,{children:n[s-1]},t)),t++,yield o}formatListValues(e,n="disjunction"){return new Intl.ListFormat(this.language.toLowerCase(),{style:"long",type:n}).format(e)}};Di=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[String,Object])],Di);const Mi=(0,V.createContext)({}),Pi=Mi.Consumer;function ki(e){return(0,V.useContext)(Mi).container.get(e)}function Fi(){const e=(0,V.useContext)(Mi).container.get(Di);return e.translate.bind(e)}function Ni(){const e=(0,V.useContext)(Mi).container.get(Di);return e.interpolateWithComponents.bind(e)}function Li(e,n,t=[]){const i="production"!==r.Test?e:e.loc.source.body;return(0,V.useContext)(Mi).useQuery(i,n,t)}function Ui(e,n={}){return(0,V.useContext)(Mi).useMutation(e,n)}function Vi(){return(0,V.useContext)(Mi).useParams()}function Bi(){return(0,V.useContext)(Mi).useHistory()}function Wi(){return(0,V.useContext)(Mi).useLocation()}function Gi(){return(0,V.useContext)(Mi).useLocalStorage()}const qi=e=>{const n=Vi(),t=Bi();return(0,V.useEffect)(()=>{g(e.path)&&(e.replace?t.replace(e.path,e.state):t.push(e.path,e.state)),e.push&&t.push(e.push(n),e.state),e.onLoad&&e.onLoad()},[]),(0,i.jsx)("div",{})},Hi=(0,V.createContext)({user:null});function Yi(){return(0,V.useContext)(Hi)}const Zi=e=>{const n=Vi(),{user:t}=Yi();return t&&e.shouldHaveUser||!t&&!e.shouldHaveUser?(0,i.jsx)(i.Fragment,{children:e.children}):(0,i.jsx)(qi,{path:e.getRedirectPath(n),replace:!0})};function Ki(...e){console.log(...e)}const Xi=e=>e.join("/"),Qi=F.HEAVENT_APPLICATION_BASENAME,Ji={FIELDS:{PLURAL:"fields",SINGLE:"field"}},es={AUTH:"auth",EDIT:"edit",CREATE:"create",EXPORT:"export",EXPORT_BASIC:"export/basic",EXPORT_API:"export/api",IMPORT:"import",INVITE:"invite"},ns={INFORMATION:"information",DASHBOARD:"dashboard",HISTORY:"history",REGISTRATION:"registration",DOCUMENTS:"documents",PROFILE:"profile",REPORTING:"reporting",FORMS:"forms",FORM:"form",MEMBER:"member",MEMBERS:"members",PREVIEW:"preview"},ts=e=>Xi([e,es.AUTH]),is=e=>Xi([e,es.CREATE]),ss=e=>Xi([e,es.EDIT]),os={PLURAL:"/organizations",SINGLE:"/organization"},as="delegations",rs={_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"}},ds="blocked",ls="expired",cs={ORGANIZATIONS:os.PLURAL,ORGANIZATION:e=>Xi([os.SINGLE,e])},us={ORGANIZATIONS:cs.ORGANIZATIONS,ORGANIZATION:({organizationId:e})=>cs.ORGANIZATION(e),ORGANIZATION_SETTINGS:e=>Xi([us.ORGANIZATION(e),rs._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE:e=>Xi([us.ORGANIZATION_SETTINGS(e),rs.EVENTS_SHOWCASE._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN:e=>Xi([us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),rs.COMMON.DESIGN]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION:e=>Xi([us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),rs.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS:e=>Xi([us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),rs.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_MEMBERS_SPACE:e=>Xi([us.ORGANIZATION_SETTINGS(e),rs.MEMBERS_SPACE._BASE]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN:e=>Xi([us.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),rs.COMMON.DESIGN]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION:e=>Xi([us.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),rs.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES:e=>Xi([us.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),rs.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS:e=>Xi([us.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),rs.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_DELEGATION_SPACE:e=>Xi([us.ORGANIZATION_SETTINGS(e),rs.DELEGATION_SPACE._BASE]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN:e=>Xi([us.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),rs.COMMON.DESIGN]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION:e=>Xi([us.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),rs.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES:e=>Xi([us.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),rs.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS:e=>Xi([us.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),rs.COMMON.SETTINGS]),ORGANIZATION_DELEGATIONS:e=>Xi([us.ORGANIZATION(e),as]),IS_BLOCKED:e=>Xi([e,ds]),IS_EXPIRED:e=>Xi([e,ls]),ORGANIZATION_FORM:e=>$s.FORM(e)},ms="dashboard",gs="users",hs={COMMUNITY:e=>Xi([us.ORGANIZATION(e),"community"]),COMMUNITY_DASHBOARD:e=>Xi([hs.COMMUNITY(e),ms]),COMMUNITY_USERS:e=>Xi([hs.COMMUNITY(e),gs])},ps={PLURAL:"forms",SINGLE:"form"},Is="elements",xs="emails",fs="integration",_s="parameters",js="preview",vs="general",Ss="design",ys="availabilities",Cs="missions",bs="accreditations",As="broadcast",Es="state",ws={FORMS:ps.PLURAL,FORM:e=>Xi([ps.SINGLE,e])},$s={FORMS:({eventId:e,...n})=>Xi([e?Rs.EVENT({...n,eventId:e}):hs.COMMUNITY(n),ws.FORMS]),FORM:({formId:e,...n})=>Xi(["eventId"in n&&n.eventId?Rs.EVENT(n):hs.COMMUNITY(n),ws.FORM(e)]),CREATE:e=>is($s.FORMS(e)),FORM_ELEMENTS:e=>Xi([$s.FORM(e),Is]),FORM_INTEGRATION:e=>Xi([$s.FORM(e),fs]),FORM_EMAILS:e=>Xi([$s.FORM(e),xs]),FORM_PREVIEW:e=>Xi([$s.FORM(e),js]),FORM_PARAMETERS:e=>Xi([$s.FORM(e),_s]),FORM_PARAMETERS_GENERAL:e=>Xi([$s.FORM_PARAMETERS(e),vs]),FORM_PARAMETERS_DESIGN:e=>Xi([$s.FORM_PARAMETERS(e),Ss]),FORM_PARAMETERS_AVAILABILITIES:e=>Xi([$s.FORM_PARAMETERS(e),ys]),FORM_PARAMETERS_MISSIONS:e=>Xi([$s.FORM_PARAMETERS(e),Cs]),FORM_PARAMETERS_ACCREDITATIONS:e=>Xi([$s.FORM_PARAMETERS(e),bs]),FORM_PARAMETERS_BROADCAST:e=>Xi([$s.FORM_PARAMETERS(e),As]),FORM_PARAMETERS_STATE:e=>Xi([$s.FORM_PARAMETERS(e),Es])},Ts={PLURAL:"events",SINGLE:"event"},zs={PLURAL:"teams",SINGLE:"team"},Os={EVENTS:Ts.PLURAL,EVENT:e=>Xi([Ts.SINGLE,e]),TEAM:e=>Xi([zs.SINGLE,e])},Rs={EVENTS_IMPORT:e=>Xi([us.ORGANIZATION(e),Os.EVENTS,es.IMPORT]),EVENTS:e=>Xi([us.ORGANIZATION(e),Os.EVENTS]),EVENT:({eventId:e,...n})=>Xi([us.ORGANIZATION(n),Os.EVENT(e)]),EVENT_FORM:e=>Xi([$s.FORM(e)]),EVENT_TEAM_FORM:({teamCode:e,...n})=>Xi([Rs.EVENT_FORM(n),Os.TEAM(e)])},Ds={PLURAL:"accreditation-categories",SINGLE:"accreditation-category"},Ms={PLURAL:"accreditations",SINGLE:"accreditation"},Ps={PLURAL:"slots",SINGLE:"slot"},ks="dashboard",Fs="member",Ns="members",Ls={ACCREDITATION_CATEGORIES:Ds.PLURAL,ACCREDITATION_CATEGORY:e=>Xi([Ds.SINGLE,e]),ACCREDITATIONS:Ms.PLURAL,ACCREDITATION:e=>Xi([Ms.SINGLE,e]),ACCREDITATION_SLOTS:Ps.PLURAL,ACCREDITATION_SLOT:e=>Xi([Ps.SINGLE,e])},Us={ACCREDITATION_CATEGORY:({accreditationCategoryId:e,...n})=>Xi([Rs.EVENT(n),Ls.ACCREDITATION_CATEGORY(e)]),ACCREDITATION_CATEGORY_DASHBOARD:e=>Xi([Us.ACCREDITATION_CATEGORY(e),ks]),ACCREDITATION_CATEGORY_MEMBERS:e=>Xi([Us.ACCREDITATION_CATEGORY(e),Ns])},Vs={ACCREDITATIONS_IMPORT:e=>Xi([Rs.EVENT(e),Ls.ACCREDITATIONS,es.IMPORT]),ACCREDITATIONS:e=>Xi([Rs.EVENT(e),Ls.ACCREDITATIONS]),ACCREDITATION:({accreditationId:e,...n})=>Xi([Rs.EVENT(n),Ls.ACCREDITATION(e)]),ACCREDITATION_DASHBOARD:e=>Xi([Vs.ACCREDITATION(e),ks]),ACCREDITATION_MEMBERS:e=>Xi([Vs.ACCREDITATION(e),Ns]),ACCREDITATION_MEMBER:({userInfoId:e,...n})=>Xi([Vs.ACCREDITATION_MEMBERS(n),Fs,e]),ACCREDITATION_MEMBER_INFORMATION:e=>Xi([Vs.ACCREDITATION_MEMBER(e),ns.INFORMATION])},Bs={ACCREDITATION_SLOT:({accreditationSlotId:e,...n})=>Xi([Ws.ACCREDITATION(n),Ls.ACCREDITATION_SLOT(e)]),ACCREDITATION_SLOT_DASHBOARD:e=>Xi([Bs.ACCREDITATION_SLOT(e),ks]),ACCREDITATION_SLOT_MEMBERS:e=>Xi([Bs.ACCREDITATION_SLOT(e),Ns])},Ws={...Us,...Vs,...Bs},Gs={PLURAL:"delegations-categories",SINGLE:"delegation-category"},qs={PLURAL:"delegations",SINGLE:"delegation"},Hs="accreditations",Ys="availabilities",Zs="positions",Ks={DELEGATIONS_CATEGORIES:Gs.PLURAL,DELEGATION_CATEGORY:e=>Xi([Gs.SINGLE,e]),DELEGATIONS:qs.PLURAL,DELEGATION:e=>Xi([qs.SINGLE,e])},Xs={DELEGATION_CATEGORY:({delegationCategoryId:e,...n})=>Xi(["eventId"in n&&n.eventId?Rs.EVENT(n):hs.COMMUNITY(n),Ks.DELEGATION_CATEGORY(e)]),DELEGATION_CATEGORY_DASHBOARD:e=>Xi([Xs.DELEGATION_CATEGORY(e),ns.DASHBOARD]),DELEGATION_CATEGORY_MEMBERS:e=>Xi([Xs.DELEGATION_CATEGORY(e),ns.MEMBERS]),DELEGATION_CATEGORY_UPDATE:e=>ss(Xs.DELEGATION_CATEGORY(e))},Qs={DELEGATIONS:e=>Xi(["eventId"in e&&e.eventId?Rs.EVENT(e):hs.COMMUNITY(e),Ks.DELEGATIONS]),DELEGATION:({delegationId:e,...n})=>Xi(["eventId"in n&&n.eventId?Rs.EVENT(n):hs.COMMUNITY(n),Ks.DELEGATION(e)]),DELEGATION_DASHBOARD:e=>Xi([Qs.DELEGATION(e),ns.DASHBOARD]),DELEGATION_MEMBERS:e=>Xi([Qs.DELEGATION(e),ns.MEMBERS]),DELEGATION_ACCREDITATIONS:e=>Xi([Qs.DELEGATION(e),Hs]),DELEGATION_REPORTING:e=>Xi([Qs.DELEGATION(e),ns.REPORTING]),DELEGATION_DOCUMENTS:e=>Xi([Qs.DELEGATION(e),ns.DOCUMENTS]),DELEGATION_TAB:e=>Xi([Qs.DELEGATION(e),e.slug]),DELEGATION_MEMBERS_IMPORT:e=>Xi([Qs.DELEGATION(e),es.IMPORT]),DELEGATION_MEMBER:({userInfoId:e,slug:n,...t})=>Xi([g(n)?Qs.DELEGATION_TAB({...t,slug:n}):Qs.DELEGATION_MEMBERS(t),ns.MEMBER,e]),DELEGATION_MEMBER_INFORMATION:e=>Xi([Qs.DELEGATION_MEMBER(e),ns.INFORMATION]),DELEGATION_MEMBER_ACCREDITATIONS:e=>Xi([Qs.DELEGATION_MEMBER(e),Hs]),DELEGATION_MEMBER_AVAILABILITIES:e=>Xi([Qs.DELEGATION_MEMBER(e),Ys]),DELEGATION_MEMBER_POSITIONS:e=>Xi([Qs.DELEGATION_MEMBER(e),Zs]),MEMBERS_INVITE:e=>Xi([Qs.DELEGATION(e),ns.MEMBERS,es.INVITE]),MEMBER_CREATE:({formId:e,...n})=>is(Xi([Qs.DELEGATION(n),ns.MEMBER,ns.FORM,e])),MEMBER_EDIT:({formId:e,...n})=>ss(Xi([Qs.DELEGATION_MEMBER(n),ns.FORM,e])),DELEGATION_PROFILE:e=>Xi([Qs.DELEGATION(e),ns.PROFILE]),FIELDS_EDIT:e=>ss(Xi([Qs.DELEGATION(e),Ji.FIELDS.PLURAL])),DELEGATION_FORM:({delegationId:e,...n})=>Xi([$s.FORM(n),Ks.DELEGATION(e)])},Js={...Xs,...Qs},eo={ITEMS:{POSITIONS_CATEGORIES:{PLURAL:"position-categories",SINGLE:"position-category"},POSITIONS:{PLURAL:"positions",SINGLE:"position"},POSITION_SLOTS:{PLURAL:"slots",SINGLE:"slot"}},ACTIONS:{IMPORT:{CSV:`${es.IMPORT}/csv`}},SECTIONS:{PREASSIGNED_MEMBERS:"preassigned-members",PLANNING:"planning"}},no={POSITION_CATEGORIES:eo.ITEMS.POSITIONS_CATEGORIES.PLURAL,POSITION_CATEGORY:e=>Xi([eo.ITEMS.POSITIONS_CATEGORIES.SINGLE,e]),POSITIONS:eo.ITEMS.POSITIONS.PLURAL,POSITION:e=>Xi([eo.ITEMS.POSITIONS.SINGLE,e]),POSITION_SLOTS:eo.ITEMS.POSITION_SLOTS.PLURAL,POSITION_SLOT:e=>Xi([eo.ITEMS.POSITION_SLOTS.SINGLE,e])},to={POSITION_CATEGORY:({positionCategoryId:e,...n})=>Xi([Rs.EVENT(n),no.POSITION_CATEGORY(e)]),POSITION_CATEGORY_DASHBOARD:e=>Xi([to.POSITION_CATEGORY(e),ns.DASHBOARD]),POSITION_CATEGORY_MEMBERS:e=>Xi([to.POSITION_CATEGORY(e),ns.MEMBERS]),POSITION_CATEGORY_PREASSIGNED_MEMBERS:e=>Xi([to.POSITION_CATEGORY(e),eo.SECTIONS.PREASSIGNED_MEMBERS])},io={POSITIONS:e=>Xi([Rs.EVENT(e),no.POSITIONS]),POSITION:({positionId:e,positionCategoryId:n,...t})=>Xi(n?[to.POSITION_CATEGORY({positionCategoryId:n,...t}),no.POSITION(e)]:[Rs.EVENT(t),no.POSITION(e)]),POSITION_DASHBOARD:e=>Xi([io.POSITION(e),ns.DASHBOARD]),POSITION_MEMBERS:e=>Xi([io.POSITION(e),ns.MEMBERS]),POSITION_PREASSIGNED_MEMBERS:e=>Xi([io.POSITION(e),eo.SECTIONS.PREASSIGNED_MEMBERS]),POSITION_PLANNING:e=>Xi([io.POSITION(e),eo.SECTIONS.PLANNING]),POSITION_MEMBER:({userInfoId:e,...n})=>Xi([io.POSITION_MEMBERS(n),ns.MEMBER,e]),POSITION_MEMBER_INFORMATION:e=>Xi([io.POSITION_MEMBER(e),ns.INFORMATION]),POSITION_IMPORT_CSV:e=>Xi([Rs.EVENT(e),eo.ACTIONS.IMPORT.CSV])},so={POSITION_SLOTS:e=>Xi([io.POSITION(e),no.POSITION_SLOTS]),POSITION_SLOT:({positionSlotId:e,...n})=>Xi([io.POSITION(n),no.POSITION_SLOT(e)])},oo={...to,...io,...so},ao="/auth",ro=`${ao}/sign-in`,lo=`${ao}/sign-up`,co="/backoffice",uo=e=>`${us.ORGANIZATION({organizationId:e})}/parameters`,mo=(e,n,t,i)=>`${oo.POSITION_SLOT({organizationId:e,eventId:n,positionId:t,positionSlotId:i})}/check-members`,go=(e,n,t,i)=>`${oo.POSITION_SLOT({organizationId:e,eventId:n,positionId:t,positionSlotId:i})}/members`,ho=(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/volunteers`,po=(e,n)=>`${ho(e,n)}/search`,Io=(e,n,t)=>`${po(e,n)}/volunteer/${t}`,xo=(e,n,t)=>`${ho(e,n)}/${t}`,fo=(e,n,t,i)=>`${xo(e,n,t)}/volunteer/${i}`,_o=(e,n,t,i)=>`${xo(e,n,t)}/volunteer-panel/${i}`,jo=(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/emails`,vo=(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/options`,So=(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/dashboard`,yo={HOME:`/${Qi}`,UNSUBSCRIBE_EMAIL:"/unsubscribe-email",USER_UPDATE_BY_TICKET_ID:(e,n)=>`/organization/${e}/update-by-ticket-id/field/${n}`,USER_FIELD_UPDATE:(e,n,t,i)=>`/organization/${e}/user/${n}/field/${t}/update/${i}`,USER_EVENT_UNREGISTER:(e,n,t)=>`/organization/${e}/user/${n}/event/${t}/unregister`,USER_CHECK_IN:(e,n)=>`/organization/${e}/user/${n}/check-in`,USER_CHECK_OUT:(e,n)=>`/organization/${e}/user/${n}/check-out`,AUTH:ao,AUTH_FORGOT_PASSWORD:`${ao}/forgot-password`,AUTH_SIGN_IN:ro,AUTH_SIGN_UP:lo,AUTH_SIGN_IN_EMAIL:`${ro}/email`,AUTH_SIGN_IN_CODE:`${ro}/code`,AUTH_SIGN_UP_CREDENTIALS:`${lo}/credentials`,AUTH_SIGN_UP_CODE:`${lo}/code`,COGNITO_CALLBACK:"/cognito-callback",MAGIC_LINK:(e,n)=>`/magic-link/${e}/${n}`,ACCEPT_TERMS_AND_CONDITIONS:e=>`${us.ORGANIZATION({organizationId:e})}/accept-terms-and-conditions`,BACKOFFICE:co,BACKOFFICE_ORGANIZATIONS:`${co}/organizations`,EDIT_BACKOFFICE_ORGANIZATION:e=>`${co}/organization/${e}/edit`,BACKOFFICE_INVOICES:`${co}/invoices`,ORGANIZATION_PARAMETERS:uo,ORGANIZATION_PARAMETERS_PROFILE:e=>`${uo(e)}/profile`,ORGANIZATION_PARAMETERS_INFOS:e=>`${uo(e)}/general`,ORGANIZATION_PARAMETERS_TEAM:e=>`${uo(e)}/team`,ORGANIZATION_PARAMETERS_GROUPS:e=>`${uo(e)}/groups`,CREATE_ORGANIZATION_PARAMETERS_GROUP:e=>`${uo(e)}/groups/create`,EDIT_ORGANIZATION_PARAMETERS_GROUP:(e,n)=>`${uo(e)}/groups/group/${n}/edit`,ORGANIZATION_PARAMETERS_ROLES:e=>`${uo(e)}/roles`,CREATE_ORGANIZATION_PARAMETERS_ROLE:e=>`${uo(e)}/roles/create`,EDIT_ORGANIZATION_PARAMETERS_ROLE:(e,n)=>`${uo(e)}/roles/role/${n}/edit`,ORGANIZATION_PARAMETERS_EMAILS:e=>`${uo(e)}/emails`,CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${uo(e)}/emails/senders/create`,EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:(e,n)=>`${uo(e)}/emails/senders/${n}/edit`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${uo(e)}/emails/senders`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW:(e,n)=>`${uo(e)}/emails/senders/${n}/preview`,ORGANIZATION_PARAMETERS_EMAILS_DNS:e=>`${uo(e)}/emails/dns`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE:e=>`${uo(e)}/delegations-space`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_DESIGN:e=>`${uo(e)}/delegations-space/design`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_INTEGRATION:e=>`${uo(e)}/delegations-space/integration`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_EMAILS:e=>`${uo(e)}/delegations-space/emails`,ORGANIZATION_PARAMETERS_CATEGORIES:e=>`${uo(e)}/categories`,ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS:e=>`${uo(e)}/categories/custom-fields`,ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS:e=>`${uo(e)}/categories/positions`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS:e=>`${uo(e)}/categories/accreditations`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES:e=>`${uo(e)}/categories/accreditation-profiles`,ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS:e=>`${uo(e)}/categories/delegations`,ORGANIZATION_PARAMETERS_TAGS:e=>`${uo(e)}/tags`,ORGANIZATION_PARAMETERS_TRANSLATIONS:e=>`${uo(e)}/translations`,ORGANIZATION_PARAMETERS_INVOICES:e=>`${uo(e)}/invoices`,ORGANIZATION_PARAMETERS_ACTIVITY:e=>`${uo(e)}/activity`,ORGANIZATION_PARAMETERS_SKIDATA:e=>`${uo(e)}/skidata`,ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH:e=>`${uo(e)}/organization-switch`,ORGANIZATION_PARAMETERS_DELETE_ACCOUNT:e=>`${uo(e)}/delete-account`,COMMUNITY_USERS_SEGMENT:(e,n)=>`${us.ORGANIZATION({organizationId:e})}/community/users/${n}`,COMMUNITY_USERS_USER:(e,n,t)=>`${us.ORGANIZATION({organizationId:e})}/community/users/${n}/user/${t}`,COMMUNITY_USERS_USER_INFORMATIONS:(e,n,t)=>`${us.ORGANIZATION({organizationId:e})}/community/users/${n}/user/${t}/${ns.INFORMATION}`,COMMUNITY_USERS_DUPLICATES:e=>`${us.ORGANIZATION({organizationId:e})}/community/users-duplicates`,COMMUNITY_EDIT_USER:(e,n)=>`${us.ORGANIZATION({organizationId:e})}/community/user/${n}/edit`,COMMUNITY_EDIT_USER_FORM:(e,n,t)=>`${us.ORGANIZATION({organizationId:e})}/community/user/${n}/edit/form/${t}`,COMMUNITY_VOLUNTEERS_IMPORT:e=>`${us.ORGANIZATION({organizationId:e})}/community/import`,COMMUNITY_FILES_IMPORT:e=>`${us.ORGANIZATION({organizationId:e})}/community/documents-import`,COMMUNITY_DELEGATIONS:e=>`${us.ORGANIZATION({organizationId:e})}/community/delegations`,COMMUNITY_DELEGATIONS_SEGMENT:(e,n)=>`${us.ORGANIZATION({organizationId:e})}/community/delegations/${n}`,COMMUNITY_DELEGATION:(e,n)=>`${us.ORGANIZATION({organizationId:e})}/community/delegation/${n}`,COMMUNITY_CREATE_DELEGATION(e,n){let t=`${us.ORGANIZATION({organizationId:e})}/community/create-delegation`;return n&&(t=`${t}/${n}`),t},COMMUNITY_EDIT_DELEGATION:(e,n)=>`${us.ORGANIZATION({organizationId:e})}/community/delegation/${n}/edit`,CREATE_EVENT_WITH_ORGANIZATION(e){let n="/create-event";return e&&(n=`${n}/${e}`),n},CREATE_EVENT:e=>`${us.ORGANIZATION({organizationId:e})}/create-event`,EVENTS_SEGMENT:(e,n)=>`${us.ORGANIZATION({organizationId:e})}/events/${n}`,EVENT_DELEGATIONS_IMPORT:(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/delegations-import`,EVENT_VOLUNTEERS_IMPORT:(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/members-import`,EVENT_FILES_IMPORT:(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/documents-import`,EDIT_EVENT:(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/edit`,DASHBOARD:So,DASHBOARD_EVENT_SWITCH:(e,n)=>`${So(e,n)}/event-switch`,POSITION_MEMBERS_USER:(e,n,t,i,s)=>`${oo.POSITION_MEMBERS({organizationId:e,eventId:n,positionCategoryId:t,positionId:i})}/${s}`,POSITION_MEMBERS_USER_INFORMATIONS:(e,n,t,i,s)=>`${oo.POSITION_MEMBERS({organizationId:e,eventId:n,positionCategoryId:t,positionId:i})}/${s}/${ns.INFORMATION}`,EXPORT_POSITIONS_MAP:(e,n)=>`/export/event/${e}/positions/${n}/map`,POSITIONS_SEARCH:(e,n)=>`${oo.POSITIONS({organizationId:e,eventId:n})}/search`,POSITIONS_SEGMENT:(e,n,t)=>`${oo.POSITIONS({organizationId:e,eventId:n})}/${t}`,CREATE_POSITION(e,n,t){let i=`${Rs.EVENT({organizationId:e,eventId:n})}/create-position`;return t&&(i=`${i}/${t}`),i},POSITION_MAP:(e,n)=>`/position/${e}-${n}/map`,POSITION_SETTINGS:(e,n,t)=>`${oo.POSITION({organizationId:e,eventId:n,positionId:t})}/settings`,EDIT_POSITION:(e,n,t)=>`${oo.POSITION({organizationId:e,eventId:n,positionId:t})}/edit`,POSITION_SLOT_ASSIGN_VOLUNTEERS:(e,n,t,i)=>`${oo.POSITION_SLOT({organizationId:e,eventId:n,positionId:t,positionSlotId:i})}/assign-volunteers`,POSITION_SLOT_MEMBERS:go,POSITION_SLOT_MEMBERS_USER:(e,n,t,i,s)=>`${go(e,n,t,i)}/${s}`,POSITION_SLOT_MEMBERS_USER_INFORMATIONS:(e,n,t,i,s)=>`${go(e,n,t,i)}/${s}/${ns.INFORMATION}`,POSITION_SLOT_MEMBERS_CHECK_OPTIONS:(e,n,t,i)=>`${go(e,n,t,i)}/check-options`,POSITION_SLOT_CHECK_MEMBERS_CHECK_IN:(e,n,t,i)=>`${mo(e,n,t,i)}/check-in`,POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT:(e,n,t,i)=>`${mo(e,n,t,i)}/check-out`,POSITION_SLOT_CHECK_MEMBERS_RESET:(e,n,t,i)=>`${mo(e,n,t,i)}/reset`,VOLUNTEERS:ho,VOLUNTEERS_SEARCH:po,VOLUNTEERS_SEARCH_USER:Io,VOLUNTEERS_SEARCH_USER_INFORMATIONS:(e,n,t)=>`${Io(e,n,t)}/${ns.INFORMATION}`,VOLUNTEERS_SEGMENT:(e,n,t)=>`${ho(e,n)}/${t}`,VOLUNTEERS_LIST_USER:fo,VOLUNTEERS_LIST_USER_INFORMATIONS:(e,n,t,i)=>`${fo(e,n,t,i)}/${ns.INFORMATION}`,VOLUNTEERS_LIST_USER_PANEL:_o,VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS:(e,n,t,i)=>`${_o(e,n,t,i)}/accreditations`,VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES:(e,n,t,i)=>`${_o(e,n,t,i)}/availabilities`,VOLUNTEERS_LIST_USER_PANEL_POSITIONS:(e,n,t,i)=>`${_o(e,n,t,i)}/positions`,VOLUNTEERS_LIST_USER_PANEL_TEAM:(e,n,t,i,s)=>`${_o(e,n,t,i)}/team/${s}`,EDIT_USER:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/user/${t}/edit`,EDIT_USER_FORM:(e,n,t,i)=>`${Rs.EVENT({organizationId:e,eventId:n})}/user/${t}/edit/form/${i}`,EDIT_USER_MISSIONS:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-missions`,EDIT_USER_MISSIONS_FORM:(e,n,t,i)=>`${Rs.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-missions/form/${i}`,EDIT_USER_SLOTS:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-slots`,EDIT_USER_SLOTS_FORM:(e,n,t,i)=>`${Rs.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-slots/form/${i}`,EDIT_USER_ACCREDITATIONS:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-accreditations`,EDIT_USER_ACCREDITATIONS_FORM:(e,n,t,i)=>`${Rs.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-accreditations/form/${i}`,ASSIGNMENTS:(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/assignments`,ASSIGNMENT:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/assignment/${t}`,EDIT_ASSIGNMENT:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/edit-assignment/${t}`,TEAM_ASSIGNMENT:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/team-assignment/${t}`,PRE_ASSIGNMENT:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/pre-assignment/${t}`,ACCREDITATIONS_ASSIGNMENTS:(e,n)=>`${Rs.EVENT({organizationId:e,eventId:n})}/accreditations-assignments`,ACCREDIT:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/accredit/${t}`,EDIT_ACCREDIT:(e,n,t)=>`${Rs.EVENT({organizationId:e,eventId:n})}/edit-accredit/${t}`,EVENT_EMAILS:jo,EVENT_EMAILS_PARAMETERS:(e,n)=>`${jo(e,n)}/parameters`,OPTIONS:vo,OPTIONS_API:(e,n)=>`${vo(e,n)}/api`,OPTIONS_WEEZEVENT:(e,n)=>`${vo(e,n)}/weezevent`,ACCREDITATIONS_SEGMENT:(e,n,t)=>`${Ws.ACCREDITATIONS({organizationId:e,eventId:n})}/${t}`,CREATE_ACCREDITATION(e,n,t){let i=`${Rs.EVENT({organizationId:e,eventId:n})}/create-accreditation`;return t&&(i=`${i}/${t}`),i},EDIT_ACCREDITATION:(e,n,t)=>`${Ws.ACCREDITATION({organizationId:e,eventId:n,accreditationId:t})}/edit`,ACCREDITATION_MAP:(e,n)=>`/accreditation/${e}-${n}/map`,DELEGATIONS_SEGMENT:(e,n,t)=>`${Js.DELEGATIONS({organizationId:e,eventId:n})}/${t}`,CREATE_DELEGATION(e,n,t){let i=`${Rs.EVENT({organizationId:e,eventId:n})}/create-delegation`;return t&&(i=`${i}/${t}`),i},EDIT_DELEGATION:(e,n,t)=>`${Js.DELEGATION({organizationId:e,eventId:n,delegationId:t})}/edit`},Co=(e,n)=>`/volunteers/${e}-${n}`,bo=(e,n)=>`${Co(e,n)}/assignments`,Ao=(e,n)=>`${Co(e,n)}/register`,Eo=bo;var wo=t(1343);const $o={AccreditationChartFragment:{code:"fragment AccreditationChart on Accreditation {\n id\n name\n hasSlots\n willAutoAccredit\n\n slots(includeHidden: true) {\n date\n name\n assignedResources\n delegationsTotalResources\n maxResources\n scannedResources\n wishedResources\n }\n}\n",fragments:[]},AccreditationEmailFragment:{code:"fragment AccreditationEmail on AccreditationsUsersInfo {\n accreditationCategory {\n id\n name\n }\n\n accreditation {\n id\n eventId\n name\n acronym\n description\n icon\n color\n address\n latitude\n longitude\n fields\n }\n\n accreditationSlot {\n id\n name\n date\n }\n}\n",fragments:[]},AccreditationImportFragment:{code:"fragment AccreditationImport on Accreditation {\n id\n name\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n}\n",fragments:[]},AccreditationProfileFragment:{code:"fragment AccreditationProfile on AccreditationsProfile {\n id\n accreditationProfileCategoryId\n name\n description\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileEmailFragment:{code:"fragment AccreditationProfileEmail on AccreditationsProfile {\n id\n name\n\n accreditationProfileCategory {\n name\n }\n}\n",fragments:[]},AccreditationProfileImportFragment:{code:"fragment AccreditationProfileImport on AccreditationsProfile {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileMatrixFragment:{code:"fragment AccreditationProfileMatrix on AccreditationsProfile {\n id\n name\n color\n assignedResources\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileVolunteerRegistrationFragment:{code:"fragment AccreditationProfileVolunteerRegistration on AccreditationsProfile {\n id\n name\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationSlotMatrixFragment:{code:"fragment AccreditationSlotMatrix on AccreditationsSlot {\n id\n name\n date\n assignedResources\n maxResources\n isBlocked\n\n accreditation {\n id\n accreditationCategoryName\n accreditationDisplay\n acronym\n color\n index\n name\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationSlotStatsFragment:{code:"fragment AccreditationSlotStats on AccreditationsSlot {\n assignedResources\n maxResources\n scannedResources\n wishedResources\n}\n",fragments:[]},AccreditationSlotVolunteerRegistrationFragment:{code:"fragment AccreditationSlotVolunteerRegistration on AccreditationsSlot {\n id\n accreditationId\n name\n date\n isBlocked\n\n accreditation {\n id\n accreditationCategoryId\n acronym\n name\n color\n icon\n hiddenSlotId\n hasSlots\n index\n fields\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationsAccreditationFragment:{code:"fragment AccreditationsAccreditation on Accreditation {\n id\n accreditationCategoryId\n index\n name\n description @include(if: $includeDescription)\n address\n latitude\n longitude\n acronym\n icon\n color\n fillingRate\n maxResources\n assignedResources\n willAutoAccredit\n weezeventIsSynchronized\n fields\n index\n hasDateSlots\n insertedAt\n numberOfSlots\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields @include(if: $includeConditions) {\n ...AccreditationsAccreditationCustomField\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsAccreditationCustomFieldFragment:{code:"fragment AccreditationsAccreditationCustomField on AccreditationsCustomField {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n}\n",fragments:[]},AccreditationsAccreditationSlotFragment:{code:"fragment AccreditationsAccreditationSlot on AccreditationsSlot {\n id\n accreditationCategoryId\n accreditationId\n name\n date\n assignedResources\n fillingRate\n insertedAt\n isHidden\n maxResources\n resourcesByFields(slugs: $customFieldsSlugs) @include(if: $includeResources)\n scannedResources @include(if: $includeResources)\n weezeventChecklistId\n wishedResources @include(if: $includeResources)\n\n accreditation {\n ...AccreditationsAccreditation\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationFragment"]},AccreditationsProfilesProfileFragment:{code:"fragment AccreditationsProfilesProfile on AccreditationsProfile {\n id\n name\n description @include(if: $includeDescription)\n acronym\n color\n icon\n insertedAt\n\n accreditationsSlots @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n accreditationProfileCategory {\n id\n name\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment"]},AccreditationsSlotFragment:{code:"fragment AccreditationsSlot on AccreditationsSlot {\n id\n accreditationCategoryId\n accreditationId\n eventId\n name\n date\n assignedResources\n maxResources\n isBlocked\n isFull\n\n accreditation {\n id\n accreditationCategoryId\n eventId\n acronym\n name\n color\n icon\n hasSlots\n accreditationDisplay\n hiddenSlotId\n index\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AssigmentEmailFragment:{code:"fragment AssigmentEmail on PositionsSlotsUsersInfo {\n id\n\n position {\n id\n eventId\n name\n description\n acronym\n color\n address\n latitude\n longitude\n zoom\n range\n layer\n fields\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n id\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n\n tags {\n name\n }\n }\n\n positionSlot {\n id\n name\n range\n timeDifferenceMinutes\n }\n}\n",fragments:["LeaderAssignmentFragment"]},AttachCustomFieldFragment:{code:"fragment AttachCustomField on CustomField {\n ...CustomFieldWithCondition\n\n category {\n id\n name\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},CampaignEditFragment:{code:"fragment CampaignEdit on Campaign {\n name\n state\n campaignType\n sender\n text\n subject\n html\n replyTo\n sendToEveryone\n states\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n tagsIds\n accreditationsCategoriesIds\n accreditationsIds\n accreditationsSlotsIds\n usersInfosIds\n segmentsIds\n scheduledAt\n emailSenderId\n attachments\n includeDuplicateMembersAttachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n scheduleType\n scheduleAnchor\n scheduleOffsetDays\n scheduleBeforeAfter\n scheduleSendTime\n\n documents {\n acl\n key\n name\n size\n }\n}\n",fragments:[]},CampaignEmailRendererFragment:{code:"fragment CampaignEmailRenderer on Campaign {\n subject\n text\n html\n replyTo\n attachments\n includeDuplicateMembersAttachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n\n documents {\n name\n key\n }\n}\n",fragments:[]},CampaignListFragment:{code:"fragment CampaignList on Campaign {\n id\n name\n campaignType\n state\n numberOfRecipients\n cost\n sentAt\n scheduledAt\n\n createdBy {\n nameOrEmail\n }\n}\n",fragments:[]},CampaignUserInfoFragment:{code:'fragment CampaignUserInfo on UsersInfo {\n id\n name\n email\n picture {\n url\n }\n phone: fieldValue(slug: "phone")\n}\n',fragments:[]},CommentFragment:{code:"fragment Comment on Comment {\n id\n content\n insertedAt\n\n event {\n name\n }\n\n writtenBy {\n id\n email\n\n userInfo(organizationId: $organizationId) {\n ...UserInfoNameAndPicture\n nameOrEmail\n }\n }\n}\n",fragments:["UserInfoNameAndPictureFragment"]},ConditionCustomFieldFragment:{code:"fragment ConditionCustomField on CustomField {\n id\n name\n slug\n fieldType\n fileType\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},ConditionsCustomFieldsFragment:{code:"fragment ConditionsCustomFields on Organization {\n conditionsCustomFields: customFields(\n eventId: $eventId\n variety: UserInfo\n privacy: All\n fieldTypes: [Checkbox, Select]\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...ConditionCustomField\n }\n }\n}\n",fragments:["ConditionCustomFieldFragment"]},CreateAccreditationEventFragment:{code:"fragment CreateAccreditationEvent on Event {\n startAt\n endAt\n layer\n isWeezeventConnected\n\n accreditationsCategories {\n id\n name\n }\n}\n",fragments:[]},CreateAccreditationProfileEventFragment:{code:"fragment CreateAccreditationProfileEvent on Event {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n color\n icon\n hasSlots\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n\n accreditationsProfilesCategories {\n id\n name\n }\n}\n",fragments:[]},CreateCampaignEmailSenderFragment:{code:"fragment CreateCampaignEmailSender on EmailsSender {\n id\n name\n isValidToSendEmail\n}\n",fragments:[]},CreateCustomFieldInfosFragment:{code:"fragment CreateCustomFieldInfos on Organization {\n # the fields a condition can depend on, of every variety: the form keeps those of its own\n customFields(\n eventId: $eventId\n privacy: All\n fieldTypes: [Checkbox, Country, Language, Nationality, Select]\n ) {\n nodes {\n id\n organizationId\n eventId\n variety\n name\n label\n fieldProperty\n fieldType\n listType\n\n values {\n id\n value\n color\n }\n }\n }\n\n # the fields an Address field can fill, of every variety: the form keeps those of its own\n addressLinksCustomFields: customFields(\n eventId: $eventId\n privacy: All\n fieldTypes: [Text, Country]\n ) {\n nodes {\n id\n organizationId\n eventId\n name\n label\n variety\n fieldType\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateDelegationEventFragment:{code:"fragment CreateDelegationEvent on Event {\n campaigns(states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n delegationsSpaceLayouts {\n id\n name\n }\n\n forms {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n color\n icon\n }\n }\n\n ...EventAccreditations\n}\n",fragments:["CreateDelegationFormFragment","EventAccreditationsFragment"]},CreateDelegationFormFragment:{code:"fragment CreateDelegationForm on Form {\n id\n name\n}\n",fragments:[]},CreatePositionEventFragment:{code:"fragment CreatePositionEvent on Event {\n startAt\n endAt\n layer\n latitude\n longitude\n isWeezeventConnected\n\n positionsCategories(scoped: true) {\n id\n name\n }\n\n traces {\n ...Trace\n }\n}\n",fragments:["TraceFragment"]},CreatePositionTagsFragment:{code:"fragment CreatePositionTags on Organization {\n tags {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateUpdateEventInfosFragment:{code:"fragment CreateUpdateEventInfos on Organization {\n name\n weezeventOrganizationId\n\n eventCustomFields: customFields(variety: Event) {\n nodes {\n ...AttachCustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n id\n name\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n\n groups {\n nodes {\n id\n name\n }\n }\n}\n",fragments:["AttachCustomFieldFragment"]},CreateUpdateMemberFormFragment:{code:"fragment CreateUpdateMemberForm on Form {\n id\n name\n isEditableInMemberSpace\n description\n positionTitle\n positionSubtitle\n accreditationTitle\n accreditationSubtitle\n informationTitle\n registerButtonText\n\n ...FormSlotsOptions\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n elements {\n ...FormElementDisplay\n }\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormSlotsOptionsFragment","FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormElementDisplayFragment","FormRegisterCustomSlotPeriodFragment"]},CreatedByFragment:{code:"fragment CreatedBy on UsersInfo {\n ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},CustomBadgeVolunteerRegistrationFragment:{code:"fragment CustomBadgeVolunteerRegistration on VolunteersRegistration {\n localId\n state\n isLeader\n utid\n ticketId\n weezevent\n segmentsIds(usedInCustomDocument: true)\n\n userInfo {\n id\n localId\n email\n name\n fields(expand: true)\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n formsUsersInfos(eventId: $eventId, level: Event) {\n formId\n\n slots {\n range\n }\n }\n }\n\n accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n\n accreditationsUsersInfos {\n ...AccreditationEmail\n }\n\n positionsSlotsUsersInfos {\n ...AssigmentEmail\n }\n}\n",fragments:["UserInfoLinksFragment","AccreditationProfileEmailFragment","DelegationEmailFragment","AccreditationEmailFragment","AssigmentEmailFragment"]},CustomDocumentPopulationFragment:{code:"fragment CustomDocumentPopulation on CustomDocument {\n id\n slug\n name\n populationsIds\n shouldRegenerateTicketIdOnDownload\n}\n",fragments:[]},CustomFieldFragment:{code:"fragment CustomField on CustomField {\n id\n slug\n name\n label\n variety\n fieldProperty\n fieldType\n isPrivate\n isEncrypted\n hasCondition\n conditionCustomFieldId\n dependencies\n numberOfTimesUsed\n canDelete\n isSelectV2\n insertedAt\n\n category {\n id\n name\n }\n\n conditionCustomField {\n name\n }\n\n createdBy {\n id\n ...CreatedBy\n }\n\n values {\n id\n value\n }\n}\n",fragments:["CreatedByFragment"]},CustomFieldImportFragment:{code:"fragment CustomFieldImport on CustomField {\n id\n name\n slug\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},CustomFieldWithConditionFragment:{code:"fragment CustomFieldWithCondition on CustomField {\n id\n name\n label\n description\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n isPrivate\n hasCondition\n conditionValue\n canSelectMultiple\n slug\n isSelectV2\n canBeUpdatedByUrl\n validationRules\n\n conditionCustomField {\n id\n name\n fieldType\n fieldProperty\n canSelectMultiple\n slug\n }\n\n addressPostalCodeCustomField {\n id\n slug\n }\n\n addressCityCustomField {\n id\n slug\n }\n\n addressCountryCustomField {\n id\n slug\n }\n\n document {\n url\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},DelegationAccreditationProfileFragment:{code:"fragment DelegationAccreditationProfile on DelegationAccreditationProfile {\n accreditationProfileId\n assignedResources\n isFull\n maxResources\n}\n",fragments:[]},DelegationAccreditationProfileStatsFragment:{code:"fragment DelegationAccreditationProfileStats on DelegationAccreditationProfile {\n accreditationProfileId\n assignedResources\n maxResources\n wishedResources\n}\n",fragments:[]},DelegationAccreditationSlotFragment:{code:"fragment DelegationAccreditationSlot on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n isFull\n isVisible\n assignedResources\n maxResources\n willAutoAccredit\n\n accreditationSlot {\n date\n isBlocked\n isFull\n }\n}\n",fragments:[]},DelegationAccreditationSlotStatsFragment:{code:"fragment DelegationAccreditationSlotStats on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationSlotId\n accreditationId\n assignedResources\n maxResources\n resourcesByFields\n scannedResources\n wishedResources\n}\n",fragments:[]},DelegationAccreditationsSlotsFragment:{code:"fragment DelegationAccreditationsSlots on Delegation {\n accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\n\n accreditationsSlots {\n ...DelegationAccreditationSlot\n }\n}\n",fragments:["DelegationAccreditationProfileFragment","DelegationAccreditationSlotFragment"]},DelegationEmailFragment:{code:'fragment DelegationEmail on Delegation {\n id\n organizationId\n eventId\n formId\n name\n fields\n\n category: delegationCategory {\n id\n name\n }\n\n leaders {\n email\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n}\n',fragments:[]},DelegationUserProfileFragment:{code:"fragment DelegationUserProfile on Delegation {\n id\n name\n event {\n id\n name\n }\n}\n",fragments:[]},DelegationsDelegationFragment:{code:"fragment DelegationsDelegation on Delegation {\n id\n organizationId\n eventId\n name\n description @include(if: $includeDescription)\n state\n deadlineDate\n numberOfResources @include(if: $includeResources)\n maxResources\n fillingRate @include(if: $includeResources)\n showInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersEditMembers\n canLeadersDeleteMembers\n canLeadersDuplicateMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n showFormLinkInDelegationSpace\n showAllAccreditations\n lockedAt\n usedCustomFieldsFilled @include(if: $includeUsedCustomFieldsFilled)\n insertedAt\n\n accreditationsSlots @include(if: $includeAccreditations) {\n accreditationSlot {\n ...AccreditationSlotVolunteerRegistration\n }\n }\n\n accreditationsProfiles @include(if: $includeAccreditationsProfiles) {\n ...DelegationAccreditationProfileStats\n\n accreditationProfile {\n ...AccreditationProfileVolunteerRegistration\n }\n }\n\n campaigns @include(if: $includeCampaigns) {\n id\n name\n }\n\n children @include(if: $includeChildren) {\n event {\n id\n name\n }\n }\n\n parent @include(if: $includeParent) {\n id\n name\n }\n\n customDocuments @include(if: $includeDocuments) {\n slug\n name\n }\n\n delegationCategory {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n email\n name\n nameOrEmail\n }\n }\n }\n\n delegationsSpaceLayout @include(if: $includeLayout) {\n id\n name\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n form {\n id\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n\n leaders @include(if: $includeLeaders) {\n id\n email\n name\n nameOrEmail\n }\n\n allAccreditationsSlots @include(if: $includeAccreditationsSlots) {\n ...DelegationAccreditationSlotStats\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment","DelegationAccreditationProfileStatsFragment","AccreditationProfileVolunteerRegistrationFragment","DelegationAccreditationSlotStatsFragment"]},DelegationsSpaceLayoutTabFragment:{code:"fragment DelegationsSpaceLayoutTab on DelegationsSpaceLayoutsTab {\n id\n name\n description\n slug\n isVisible\n isPinned\n segmentType\n rendering\n infos\n}\n",fragments:[]},DesignColorsFragment:{code:"fragment DesignColors on Design {\n colors {\n grayCustom50\n grayCustom500\n grayCustom700\n grayCustom800\n grayCustom900\n primaryCustom500\n primaryCustom600\n }\n}\n",fragments:[]},DocumentAsoPaxManifestFragment:{code:"fragment DocumentAsoPaxManifest on Query {\n event(id: $eventId) {\n name\n\n accreditationSlot(id: $accreditationSlotId) {\n id\n name\n date\n maxResources\n\n accreditation {\n id\n name\n }\n\n links {\n asoPaxManifestLink\n }\n\n volunteersRegistrations {\n id\n\n userInfo {\n id\n fields(expand: true)\n }\n }\n }\n }\n}\n",fragments:[]},DocumentDelegationCalendarFragment:{code:"fragment DocumentDelegationCalendar on Event {\n startAt\n endAt\n\n document(documentType: DelegationCalendar) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n delegation(id: $delegationId) {\n ...DelegationEmail\n\n allAccreditationsSlots(onlyVisible: $onlyVisible) {\n assignedResources\n\n accreditationSlot {\n id\n date\n name\n }\n\n accreditation {\n name\n color\n index\n }\n }\n\n links {\n delegationCalendarLink\n }\n }\n}\n",fragments:["DelegationEmailFragment"]},DocumentEmailPreviewFragment:{code:"fragment DocumentEmailPreview on Document {\n id\n acl\n key\n name\n size\n url\n}\n",fragments:[]},DocumentPositionPlanningFragment:{code:'fragment DocumentPositionPlanning on Event {\n startAt\n endAt\n dayStartTime\n\n document(documentType: PositionPlanning) {\n id\n options\n }\n\n position(id: $positionId) {\n name\n range\n color\n\n links {\n positionPlanningLink\n }\n\n slots {\n id\n name\n range\n }\n }\n\n volunteersRegistrations(positionId: $positionId, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n\n userInfo {\n name\n\n phone {\n internationalFormat\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n',fragments:[]},DocumentPositionSheetFragment:{code:"fragment DocumentPositionSheet on Query {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: Position) {\n id\n options\n }\n\n position(id: $positionId) {\n ...PositionPdfInfos\n\n links {\n positionSheetLink\n }\n\n slots {\n id\n name\n range\n }\n }\n\n volunteersRegistrations(states: [Assigned], positionId: $positionId) {\n nodes {\n ...VolunteerPdf\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","PositionPdfInfosFragment","VolunteerPdfFragment"]},DocumentPositionsPlanningFragment:{code:"fragment DocumentPositionsPlanning on Event {\n name\n\n positionsSlots(segmentId: $segmentId, date: $date) {\n nodes {\n id\n positionId\n name\n range\n\n position {\n id\n name\n color\n }\n }\n }\n\n segment(id: $segmentId) {\n name\n }\n}\n",fragments:[]},DocumentPositionsVolunteersPlanningFragment:{code:"fragment DocumentPositionsVolunteersPlanning on Event {\n name\n\n positionsSlots(segmentId: $segmentId) {\n nodes {\n id\n range\n\n position {\n id\n name\n acronym\n }\n }\n }\n\n segment(id: $segmentId) {\n name\n }\n\n volunteersRegistrations(states: [Assigned]) {\n nodes {\n id\n\n userInfo {\n ...UserInfoContactInformation\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},DocumentUserAssignmentsFragment:{code:"fragment DocumentUserAssignments on Query {\n organization(id: $organizationId) {\n id\n\n customFields(eventId: $eventId, variety: Position, privacy: Public) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoDocument\n }\n }\n\n event(id: $eventId) {\n id\n name\n\n document(documentType: Assignments) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n localId\n ticketId\n weezevent\n\n # For the {user.profile} and {user.delegation.*} of the texts.\n accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\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","AccreditationProfileEmailFragment","DelegationEmailFragment","AssigmentEmailFragment"]},DocumentUserBadgeFragment:{code:'fragment DocumentUserBadge on Event {\n document(documentType: Badge) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n ...UserInfoContactInformation\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userBadgeLink\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n name\n }\n\n positionSlot {\n range\n }\n }\n }\n}\n',fragments:["UserInfoContactInformationFragment"]},DocumentUserCertificateFragment:{code:'fragment DocumentUserCertificate on Event {\n document(documentType: Certificate) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n name\n dateOfBirth: fieldValue(slug: "dateOfBirth")\n street: fieldValue(slug: "street")\n city: fieldValue(slug: "city")\n postalCode: fieldValue(slug: "postalCode")\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userCertificateLink\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n name\n }\n\n positionSlot {\n range\n }\n }\n }\n}\n',fragments:[]},DocumentUserCustomBadgeFragment:{code:"fragment DocumentUserCustomBadge on Event {\n id\n name\n startAt\n weezevent\n\n tags {\n name\n }\n\n document(documentType: CustomBadge, customBadge: $customBadge) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...CustomBadgeVolunteerRegistration\n }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserCustomBadgesFragment:{code:"fragment DocumentUserCustomBadges on Event {\n id\n name\n startAt\n weezevent\n fields\n\n tags {\n name\n }\n\n document(documentType: CustomBadge, customBadge: $customBadge) {\n id\n options\n }\n\n volunteersRegistrations(segmentId: $segmentId) {\n nodes {\n ...CustomBadgeVolunteerRegistration\n }\n }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserPlanningFragment:{code:"fragment DocumentUserPlanning on Event {\n startAt\n endAt\n dayStartTime\n\n document(documentType: UserPlanning) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n localId\n ticketId\n weezevent\n\n # For the {user.profile} and {user.delegation.*} of the texts.\n accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n\n userInfo {\n ...UserInfoDocument\n }\n\n positionsSlotsUsersInfos {\n ...PsuiUserPlanning\n }\n }\n}\n",fragments:["AccreditationProfileEmailFragment","DelegationEmailFragment","UserInfoDocumentFragment","PsuiUserPlanningFragment"]},DocumentUserPlanningDaysFragment:{code:'fragment DocumentUserPlanningDays on Event {\n document(documentType: UserPlanningDays) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userPlanningDaysLink\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n range\n }\n\n position {\n id\n organizationId\n name\n address\n }\n }\n }\n}\n',fragments:[]},DocumentUserPlanningListFragment:{code:'fragment DocumentUserPlanningList on Event {\n document(documentType: UserPlanningList) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userPlanningListLink\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n name\n range\n }\n\n position {\n name\n }\n }\n }\n}\n',fragments:[]},DocumentUsersHoursFragment:{code:"fragment DocumentUsersHours on Event {\n timeZone\n\n document(documentType: UserHours) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n positionsSlotsUsersInfos {\n ...PsuiUserHours\n }\n\n userInfo {\n ...UserInfoDocument\n }\n }\n}\n",fragments:["PsuiUserHoursFragment","UserInfoDocumentFragment"]},DocumentUsersListingFragment:{code:"fragment DocumentUsersListing on Query {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: VolunteersListing) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n segment(id: $segmentId) {\n name\n\n links {\n usersListingLink\n }\n }\n\n volunteersRegistrations(segmentId: $segmentId) {\n nodes {\n ...VolunteerPdf\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","VolunteerPdfFragment"]},DocumentUsersPicturesFragment:{code:'fragment DocumentUsersPictures on Query {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: UsersPictures) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n segment(id: $segmentId) {\n name\n\n links {\n usersPicturesLink\n }\n }\n\n volunteersRegistrations(\n segmentId: $segmentId\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n userInfo {\n id\n ...UserInfoContactInformation\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n fields\n }\n }\n }\n }\n}\n',fragments:["CustomFieldWithConditionFragment","UserInfoContactInformationFragment"]},DocumentUsersPlanningFragment:{code:"fragment DocumentUsersPlanning on VolunteersRegistration {\n id\n state\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n\n positionsSlotsUsersInfos(positionId: $positionId) {\n positionCategory {\n name\n }\n\n positionSlot {\n id\n name\n range\n }\n\n position {\n id\n name\n color\n icon\n }\n }\n\n slots {\n range\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},EmailRecipientFragment:{code:"fragment EmailRecipient on Email {\n id\n state\n sentAt\n infos\n\n userInfo {\n ...CampaignUserInfo\n }\n}\n",fragments:["CampaignUserInfoFragment"]},EmailSenderEmailRendererFragment:{code:"fragment EmailSenderEmailRenderer on EmailsSender {\n fromName\n fromEmail\n replyTo\n signature\n\n header {\n key\n }\n\n picture {\n key\n }\n\n footer {\n key\n }\n}\n",fragments:[]},EmailTemplateEmailRendererFragment:{code:"fragment EmailTemplateEmailRenderer on EmailsTemplate {\n useDefault\n subject\n content\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n}\n",fragments:[]},EventAccreditationsFragment:{code:"fragment EventAccreditations on Event {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n accreditationCategoryId\n name\n color\n icon\n accreditationCategoryName\n accreditationDisplay\n hasSlots\n hiddenSlotId\n index\n\n slots(includeHidden: true) {\n id\n accreditationId\n name\n date\n }\n }\n }\n}\n",fragments:[]},EventCreateUpdateMemberFragment:{code:"fragment EventCreateUpdateMember on Event {\n id\n name\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId, delegationId: $delegationId)\n country\n fields\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n\n accreditationsProfilesCategories {\n ...FormRegisterAccreditationProfileCategory\n }\n\n positionsCategories {\n ...FormRegisterCategory\n }\n}\n",fragments:["FormRegisterAccreditationCategoryFragment","FormRegisterAccreditationProfileCategoryFragment","FormRegisterCategoryFragment"]},EventDelegationsExportFragment:{code:"fragment EventDelegationsExport on Event {\n languages\n\n segmentsFolders(segmentType: Delegations) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventEmailRendererFragment:{code:"fragment EventEmailRenderer on Event {\n id\n organizationId\n name\n languages\n timeZone\n startAt\n endAt\n fields\n\n customDocuments {\n slug\n }\n}\n",fragments:[]},EventPositionsExportFragment:{code:"fragment EventPositionsExport on Event {\n languages\n\n segmentsFolders(segmentType: Positions) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventVolunteersExportFragment:{code:"fragment EventVolunteersExport on Event {\n languages\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventsEventFragment:{code:"fragment EventsEvent on Event {\n id\n name\n description @include(if: $includeDescription)\n state\n startAt\n endAt\n fields\n insertedAt\n numberOfMembers @include(if: $includeNumberOfMembers)\n numberOfMembersAccredited @include(if: $includeNumberOfMembers)\n numberOfMembersAssigned @include(if: $includeNumberOfMembers)\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags {\n id\n name\n }\n}\n",fragments:[]},ExistingVolunteerFragment:{code:"fragment ExistingVolunteer on UsersInfo {\n id\n ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},FormAccreditationsOptionsFragment:{code:"fragment FormAccreditationsOptions on Form {\n accreditationDisplay\n accreditationFilter\n showFullAccreditation\n hiddenAccreditationsCategoriesIds\n hiddenAccreditationsIds\n hiddenAccreditationsSlotsIds\n displayedAccreditationsCategoriesIds\n displayedAccreditationsIds\n displayedAccreditationsSlotsIds\n showAccreditationDescription\n slotDisplay\n\n accreditationsFormCustomFields {\n accreditationsSlotsIds\n isMandatory\n\n customField {\n ...CustomFieldWithCondition\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormCustomFieldFragment:{code:"fragment FormCustomField on CustomField {\n id\n slug\n eventId\n name\n label\n fieldType\n listType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},FormCustomFieldsFragment:{code:"fragment FormCustomFields on Organization {\n formCustomFields: customFields(\n eventId: $eventId\n variety: UserInfo\n privacy: Public\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...FormCustomField\n }\n }\n}\n",fragments:["FormCustomFieldFragment"]},FormElementDisplayFragment:{code:"fragment FormElementDisplay on FormsElement {\n id\n elementType\n isMandatory\n section\n text\n hasCondition\n conditionValue\n\n conditionCustomField {\n ...CustomFieldWithCondition\n }\n\n customField {\n ...CustomFieldWithCondition\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormElementsElementFragment:{code:"fragment FormElementsElement on FormsElement {\n id\n elementType\n customFieldId\n section\n text\n isMandatory\n hasCondition\n conditionCustomFieldId\n conditionValue\n}\n",fragments:[]},FormEmailFragment:{code:"fragment FormEmail on FormsUsersInfo {\n teamCode\n\n form {\n id\n areTeamsAllowed\n }\n\n ...WishesEmail\n}\n",fragments:["WishesEmailFragment"]},FormListFragment:{code:"fragment FormList on Form {\n id\n name\n numberOfCustomFields\n}\n",fragments:[]},FormMemberRegistrationFragment:{code:"fragment FormMemberRegistration on Form {\n id\n name\n isEditableInMemberSpace\n\n elements {\n id\n ...FormElementDisplay\n }\n\n ...FormSlotsOptions\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormElementDisplayFragment","FormSlotsOptionsFragment","FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormRegisterCustomSlotPeriodFragment"]},FormMissionsOptionsFragment:{code:"fragment FormMissionsOptions on Form {\n positionDisplay\n positionFilter\n positionRanking\n positionLimit\n showFullPosition\n hiddenPositionsCategoriesIds\n hiddenPositionsIds\n hiddenPositionsSlotsIds\n hiddenPositionsTagsIds\n displayedPositionsCategoriesIds\n displayedPositionsIds\n displayedPositionsSlotsIds\n displayedPositionsTagsIds\n showPositionCategoryDescription\n showPositionDescription\n slotDisplay\n willAutoAssign\n}\n",fragments:[]},FormRegisterAccreditationFragment:{code:"fragment FormRegisterAccreditation on IAccreditation {\n id\n accreditationCategoryId\n name\n description\n color\n icon\n hiddenSlotId\n hasSlots\n accreditationDisplay\n conditionsOperator\n index\n\n slots(includeHidden: true) {\n ...FormRegisterAccreditationSlot\n }\n\n conditionsCustomFields: accreditationsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n\n formCustomFields {\n isMandatory\n\n customField {\n ...CustomFieldWithCondition\n }\n }\n}\n",fragments:["FormRegisterAccreditationSlotFragment","CustomFieldWithConditionFragment"]},FormRegisterAccreditationCategoryFragment:{code:"fragment FormRegisterAccreditationCategory on IAccreditationsCategory {\n id\n name\n\n accreditations {\n ...FormRegisterAccreditation\n }\n}\n",fragments:["FormRegisterAccreditationFragment"]},FormRegisterAccreditationProfileFragment:{code:"fragment FormRegisterAccreditationProfile on AccreditationsProfile{\n id\n name\n description\n color\n icon\n}\n",fragments:[]},FormRegisterAccreditationProfileCategoryFragment:{code:"fragment FormRegisterAccreditationProfileCategory on AccreditationsProfilesCategory {\n id\n name\n\n accreditationsProfiles {\n ...FormRegisterAccreditationProfile\n }\n}\n",fragments:["FormRegisterAccreditationProfileFragment"]},FormRegisterAccreditationSlotFragment:{code:"fragment FormRegisterAccreditationSlot on IAccreditationsSlot {\n id\n accreditationId\n name\n date\n isBlocked\n isFull\n}\n",fragments:[]},FormRegisterCategoryFragment:{code:"fragment FormRegisterCategory on IPositionsCategory {\n id\n name\n description\n\n positions {\n ...FormRegisterPosition\n }\n}\n",fragments:["FormRegisterPositionFragment"]},FormRegisterCustomSlotFragment:{code:"fragment FormRegisterCustomSlot on CustomSlot {\n name\n startTime\n endTime\n}\n",fragments:[]},FormRegisterCustomSlotPeriodFragment:{code:"fragment FormRegisterCustomSlotPeriod on CustomSlotsPeriod {\n id\n name\n startDate\n endDate\n hideNameDates\n displayAsCalendar\n hasCondition\n conditionCustomFieldId\n conditionValue\n\n conditionCustomField {\n ...CustomFieldWithCondition\n }\n\n customSlots {\n ...FormRegisterCustomSlot\n }\n}\n",fragments:["CustomFieldWithConditionFragment","FormRegisterCustomSlotFragment"]},FormRegisterPositionFragment:{code:"fragment FormRegisterPosition on IPosition {\n id\n positionCategoryId\n name\n description\n acronym\n isVisible\n conditionsOperator\n positionDisplay\n tagsIds\n\n slots {\n ...FormRegisterSlot\n }\n\n conditionsCustomFields: positionsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n}\n",fragments:["FormRegisterSlotFragment"]},FormRegisterSlotFragment:{code:"fragment FormRegisterSlot on IPositionsSlot {\n id\n positionId\n name\n range\n nameOrRange\n isFull\n}\n",fragments:[]},FormSlotsOptionsFragment:{code:"fragment FormSlotsOptions on Form {\n slotDisplay\n minNumberOfSlots\n daysDisplay\n slotTitle\n slotSubtitle\n}\n",fragments:[]},FormUserInfoUserProfileFragment:{code:"fragment FormUserInfoUserProfile on FormsUsersInfo {\n organizationId\n eventId\n formId\n insertedAt\n teamCode\n\n teamMembers {\n ...UserInfoTeamMember\n }\n}\n",fragments:["UserInfoTeamMemberFragment"]},FormUserInfoWishedFragment:{code:"fragment FormUserInfoWished on UsersInfo {\n formUserInfo(formId: $formId) {\n insertedAt\n formId\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationsSlotsIds\n\n form {\n ...FormMemberRegistration\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n slots {\n startDate\n startTime\n endDate\n endTime\n }\n }\n}\n",fragments:["FormMemberRegistrationFragment"]},FormUserOverlayFragment:{code:"fragment FormUserOverlay on Form {\n id\n name\n\n elements {\n ...FormElementDisplay\n }\n}\n",fragments:["FormElementDisplayFragment"]},FormsUsersInfosWishedFragment:{code:"fragment FormsUsersInfosWished on UsersInfo {\n formsUsersInfos(eventId: $eventId, level: Both) {\n insertedAt\n formId\n eventId\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationProfileId\n accreditationsSlotsIds\n\n form {\n ...FormMemberRegistration\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n index\n }\n\n accreditationCategory {\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n\n positionCategory {\n name\n }\n }\n\n positions {\n id\n name\n range\n\n category {\n name\n }\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n slots {\n startDate\n startTime\n endDate\n endTime\n range\n }\n }\n}\n",fragments:["FormMemberRegistrationFragment"]},FullPageInfoFragment:{code:"fragment FullPageInfo on PageInfo {\n hasNextPage\n hasPreviousPage\n}\n",fragments:[]},HistoryRowFragment:{code:"fragment HistoryRow on History {\n id\n action\n executedBy\n data\n details\n insertedAt\n\n user {\n id\n name\n email\n picture {\n url\n }\n }\n}\n",fragments:[]},LeaderAssignmentFragment:{code:'fragment LeaderAssignment on Leader {\n userInfo {\n id\n name\n email\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n}\n',fragments:[]},LeaderInfosFragment:{code:"fragment LeaderInfos on Leader {\n role {\n id\n name\n }\n\n userInfo {\n ...LeaderUserInfo\n }\n}\n",fragments:["LeaderUserInfoFragment"]},LeaderUserInfoFragment:{code:"fragment LeaderUserInfo on UsersInfo {\n id\n userId\n ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},MassEditCustomFieldFragment:{code:"fragment MassEditCustomField on CustomField {\n id\n name\n label\n slug\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},MemberAccreditationFragment:{code:"fragment MemberAccreditation on AccreditationsUsersInfo {\n accreditationSlot {\n name\n date\n }\n\n accreditation {\n name\n description\n acronym\n hasSlots\n }\n\n accreditationCategory {\n name\n }\n}\n",fragments:[]},MemberAssignmentFragment:{code:"fragment MemberAssignment on PositionsSlotsUsersInfo {\n position {\n name\n description\n address\n latitude\n longitude\n zoom\n layer\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n\n traces {\n ...Trace\n }\n }\n\n positionSlot {\n range\n }\n}\n",fragments:["LeaderAssignmentFragment","TraceFragment"]},MemberRegistrationUserInfoFragment:{code:"fragment MemberRegistrationUserInfo on UsersInfo {\n id\n userId\n ...UserInfoContactInformation\n nameOrEmail\n fields\n}\n",fragments:["UserInfoContactInformationFragment"]},OrganizationAdminInfosFragment:{code:"fragment OrganizationAdminInfos on Organization {\n name\n adminName\n adminEmail\n street\n postalCode\n city\n country\n timeZone\n emailSenderId\n dateFormat\n datetimeFormat\n timeFormat\n\n emailsSenders(isValidToSendEmail: true) {\n id\n name\n }\n}\n",fragments:[]},OrganizationBackofficeFragment:{code:"fragment OrganizationBackoffice on Organization {\n customBadges\n features\n id\n insertedAt\n isBlocked\n name\n numberOfEvents\n periodEndAt\n weezeventOrganizationId\n useOldBilling\n membersLimit\n pricePerMember\n billingComment\n\n membersStats {\n numberOfMembers\n }\n\n membersStats2024: membersStats(year: 2024) {\n numberOfMembers\n }\n\n users {\n id\n email\n }\n}\n",fragments:[]},OrganizationCertificateDefaultFragment:{code:"fragment OrganizationCertificateDefault on Organization {\n name\n adminName\n street\n city\n postalCode\n country\n}\n",fragments:[]},OrganizationCustomFieldsFragment:{code:"fragment OrganizationCustomFields on Organization {\n customFields(eventId: $eventId, variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n}\n",fragments:["SegmentCustomFieldFragment"]},OrganizationDelegationsSpaceFragment:{code:"fragment OrganizationDelegationsSpace on IOrganization {\n name\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n delegationsSpaceDesign: spaceDesign(spaceType: DelegationSpace) {\n ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:["DesignColorsFragment"]},OrganizationEmailRendererFragment:{code:"fragment OrganizationEmailRenderer on Organization {\n id\n name\n dateFormat\n datetimeFormat\n timeFormat\n timeZone\n customBadges\n}\n",fragments:[]},OrganizationEventsShowcaseFragment:{code:"fragment OrganizationEventsShowcase on OrganizationPublic {\n eventsShowcaseDesign: spaceDesign(spaceType: EventsShowcase) {\n ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:["DesignColorsFragment"]},OrganizationMemberFragment:{code:"fragment OrganizationMember on VolunteersRegistration {\n id\n ticketId\n exportedCustomDocumentsSlugs @include(if: $includeCustomDocuments)\n\n delegation {\n name\n }\n\n event {\n id\n name\n }\n\n positionsSlotsUsersInfos{\n positionSlot {\n name\n range\n }\n\n position {\n name\n }\n }\n\n userInfo {\n id\n name\n email\n fields\n\n picture {\n url\n }\n }\n}\n",fragments:[]},OrganizationMemberCustomDocumentFragment:{code:"fragment OrganizationMemberCustomDocument on CustomDocument {\n id\n eventId\n slug\n name\n populationsIds\n shouldRegenerateTicketIdOnDownload\n}\n",fragments:[]},OrganizationMembersSpaceFragment:{code:"fragment OrganizationMembersSpace on Organization {\n name\n\n membersSpaceDesign: spaceDesign(spaceType: MembersSpace) {\n ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n membersSpaceExcludeAccreditations\n showMembersSpaceCommunity\n}\n",fragments:["DesignColorsFragment"]},PositionCategoryPositionFragment:{code:"fragment PositionCategoryPosition on Position {\n id\n assignedResources\n name\n range\n resources\n numberOfSlots\n}\n",fragments:[]},PositionPdfInfosFragment:{code:"fragment PositionPdfInfos on Position {\n id\n eventId\n name\n description\n range\n address\n latitude\n longitude\n zoom\n layer\n numberOfSlots\n assignedResources\n acronym\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n}\n",fragments:["LeaderAssignmentFragment"]},PositionPlanningFragment:{code:"fragment PositionPlanning on Position {\n id\n name\n acronym\n color\n icon\n\n category {\n name\n }\n\n slots {\n id\n name\n range\n fillingRate\n assignedResources\n resources\n }\n}\n",fragments:[]},PositionPositionSlotFragment:{code:"fragment PositionPositionSlot on PositionsSlot {\n id\n positionCategoryId\n positionId\n assignedResources\n name\n range\n nameOrRange\n resources\n startDate\n startTime\n endDate\n endTime\n}\n",fragments:[]},PositionPositionsCustomFieldsFragment:{code:"fragment PositionPositionsCustomFields on Position {\n conditionsOperator\n\n conditionsCustomFields: positionsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n}\n",fragments:[]},PositionPositionsMapFragment:{code:"fragment PositionPositionsMap on Position {\n acronym\n color\n icon\n latitude\n longitude\n}\n",fragments:[]},PositionsPositionFragment:{code:"fragment PositionsPosition on Position {\n id\n name\n description @include(if: $includeDescription)\n range\n resources\n assignedResources\n address\n layer\n zoom\n latitude\n longitude\n acronym\n color\n icon\n isVisible\n state\n fillingRate\n numberOfSlots\n fields\n weezeventIsSynchronized\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n checkedOutRate @include(if: $includeCheckedOutRate)\n\n category {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n name\n email\n nameOrEmail\n }\n }\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n name\n email\n nameOrEmail\n }\n }\n\n positionsCustomFields @include(if: $includeConditions) {\n ...PositionsPositionCustomField\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n\n traces @include(if: $includePositionTraces) {\n id\n name\n color\n }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PositionsPositionCustomFieldFragment:{code:"fragment PositionsPositionCustomField on PositionsCustomField {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n}\n",fragments:[]},PositionsPositionSlotFragment:{code:"fragment PositionsPositionSlot on PositionsSlot {\n id\n name\n startDate\n startTime\n endDate\n endTime\n range\n assignedResources\n resources\n fillingRate\n state\n weezeventChecklistId\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n checkedOutRate @include(if: $includeCheckedOutRate)\n\n position {\n ...PositionsPosition\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:["PositionsPositionFragment"]},PrintTriggerFormEventFragment:{code:"fragment PrintTriggerFormEvent on Event {\n printerGroups {\n __typename\n\n ... on PrinterGroupList {\n nodes {\n id\n name\n }\n }\n\n ... on PrinterGroupError {\n message\n }\n }\n\n zplDocuments {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},PrintTriggerFormOrganizationFragment:{code:"fragment PrintTriggerFormOrganization on Organization {\n weezaccessPartners {\n __typename\n\n ... on WeezaccessPartnerList {\n nodes {\n id\n name\n }\n }\n\n ... on WeezaccessPartnerError {\n message\n }\n }\n}\n",fragments:[]},PrintTriggersPrintTriggerFragment:{code:"fragment PrintTriggersPrintTrigger on PrintTrigger {\n id\n insertedAt\n activationRange\n status\n\n createdBy {\n email\n name\n }\n\n weezaccessPartner {\n __typename\n ... on WeezaccessPartner {\n id\n name\n url\n }\n ... on WeezaccessPartnerError {\n message\n }\n }\n\n printerGroup {\n __typename\n ... on PrinterGroup {\n id\n name\n }\n ... on PrinterGroupError {\n message\n }\n }\n\n document {\n __typename\n ... on CustomDocument {\n name\n }\n ... on EventsDocument {\n documentType\n }\n ... on ZplDocument {\n name\n }\n }\n}\n",fragments:[]},PsuiUserHoursFragment:{code:"fragment PsuiUserHours on PositionsSlotsUsersInfo {\n breakTime\n checkInAt\n checkOutAt\n timeDifferenceMinutes\n\n positionSlot {\n range\n }\n\n position {\n name\n }\n}\n",fragments:[]},PsuiUserPlanningFragment:{code:"fragment PsuiUserPlanning on PositionsSlotsUsersInfo {\n id\n\n positionSlot {\n name\n range\n }\n\n position {\n name\n color\n }\n}\n",fragments:[]},SegmentCampaignFragment:{code:"fragment SegmentCampaign on Campaign {\n id\n name\n campaignType\n}\n",fragments:[]},SegmentCustomFieldFragment:{code:"fragment SegmentCustomField on CustomField {\n id\n slug\n name\n label\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n isSelectV2\n isEncrypted\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},SegmentEventFragment:{code:"fragment SegmentEvent on Event {\n id\n name\n}\n",fragments:[]},SegmentFormFragment:{code:"fragment SegmentForm on Form {\n id\n name\n}\n",fragments:[]},SegmentsFoldersSegmentsFragment:{code:"fragment SegmentsFoldersSegments on SegmentsFolder {\n id\n name\n\n segments {\n id\n segmentFolderId\n name\n predicatesGroups\n columns\n columnsExport\n columnsSearch\n sort\n count\n rendering\n description\n isUsedInWorkflow\n infos\n }\n}\n",fragments:[]},SpaceDesignFragment:{code:"fragment SpaceDesign on Design {\n banner {\n acl\n name\n key\n }\n\n logo {\n acl\n name\n key\n }\n\n ...DesignColors\n}\n",fragments:["DesignColorsFragment"]},TraceFragment:{code:"fragment Trace on Trace {\n id\n name\n color\n points\n direction\n startAt\n firstRunnerPace\n lastRunnerPace\n}\n",fragments:[]},TranslationFragment:{code:"fragment Translation on Translation {\n id\n translationType\n module\n fr\n en\n es\n de\n nl\n isFrTranslated\n isEnTranslated\n isEsTranslated\n isDeTranslated\n isNlTranslated\n frString\n enString\n esString\n deString\n nlString\n}\n",fragments:[]},UpdateUserFormFragment:{code:"fragment UpdateUserForm on Form {\n id\n name\n areTeamsAllowed\n delegationsIds\n\n elements {\n ...FormElementDisplay\n }\n}\n",fragments:["FormElementDisplayFragment"]},UserAllPermissionsFragment:{code:"fragment UserAllPermissions on UsersInfo {\n usersOrganizations {\n id\n sendNotifications\n\n group {\n id\n name\n }\n\n role {\n id\n name\n type\n }\n }\n\n usersEvents(eventId: $eventId) {\n id\n\n group {\n id\n name\n }\n\n event {\n id\n name\n }\n\n role {\n id\n name\n type\n }\n }\n\n usersDelegations(eventId: $eventId) {\n id\n eventId\n userInfoId\n\n delegation {\n name\n }\n }\n\n usersDelegationsCategories(eventId: $eventId) {\n id\n eventId\n\n group {\n id\n name\n }\n\n delegationCategory {\n name\n }\n\n role {\n id\n name\n }\n }\n\n usersPositionsCategories(eventId: $eventId) {\n id\n eventId\n\n group {\n id\n name\n }\n\n positionCategory {\n name\n }\n\n role {\n id\n name\n }\n }\n\n usersPositions(eventId: $eventId) {\n id\n eventId\n\n group {\n id\n name\n }\n\n position {\n name\n }\n\n role {\n id\n name\n }\n }\n}\n",fragments:[]},UserInfoCommunityFragment:{code:'fragment UserInfoCommunity on UsersInfo {\n id\n localId\n name\n email\n nameOrEmail\n fields\n lastSeenAt\n insertedAt\n phone: fieldValue(slug: "phone")\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n picture {\n url\n }\n\n comments @include(if: $includeComments) {\n content\n }\n\n events @include(if: $includeEvents) {\n id\n name\n }\n\n duplicatedFrom @include(if: $includeDuplicatedFrom) {\n id\n email\n name\n\n picture {\n url\n }\n }\n\n delegations(level: Organization) @include(if: $includeDelegations) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n emails(emailTypes: [Campaign], level: Organization) @include(if: $includeEmails) {\n id\n state\n\n campaign {\n name\n }\n }\n\n formsUsersInfos(level: Organization) @include(if: $includeForms) {\n id\n insertedAt\n\n form {\n id\n name\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n',fragments:["UserAllPermissionsFragment"]},UserInfoContactInformationFragment:{code:"fragment UserInfoContactInformation on UsersInfo {\n ...UserInfoNameAndPicture\n email\n phone {\n internationalFormat\n }\n}\n",fragments:["UserInfoNameAndPictureFragment"]},UserInfoDocumentFragment:{code:'fragment UserInfoDocument on UsersInfo {\n id\n localId\n ...UserInfoContactInformation\n nameOrEmail\n language: fieldValue(slug: "language")\n fields(expand: true)\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n}\n',fragments:["UserInfoContactInformationFragment","UserInfoLinksFragment"]},UserInfoEmailRendererFragment:{code:"fragment UserInfoEmailRenderer on UsersInfo {\n id\n localId\n email\n fields\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n user {\n id\n language\n }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoFormFragment:{code:"fragment UserInfoForm on UsersInfo {\n id\n localId\n email\n nameOrEmail\n fields\n registrationDate(eventId: $eventId)\n canAccess(formId: $formId)\n}\n",fragments:[]},UserInfoLinksFragment:{code:"fragment UserInfoLinks on UserInfoDocumentLink {\n userAssignmentsLink\n userBadgeLink\n userCertificateLink\n userCustomBadgeLinks\n userCustomDocumentLinks\n userHoursLink\n userPlanningLink\n userPlanningDaysLink\n userPlanningListLink\n}\n",fragments:[]},UserInfoNameAndPictureFragment:{code:"fragment UserInfoNameAndPicture on UsersInfo {\n name\n picture {\n url\n }\n}\n",fragments:[]},UserInfoOrganizationFragment:{code:"fragment UserInfoOrganization on UsersInfo {\n id\n userId\n name\n email\n nameOrEmail\n\n ...UserAllPermissions\n\n groups {\n id\n name\n }\n\n picture {\n url\n }\n}\n",fragments:["UserAllPermissionsFragment"]},UserInfoOverlayFragment:{code:'fragment UserInfoOverlay on UsersInfo {\n id\n name\n email\n nameOrEmail\n fields\n phone: fieldValue(slug: "phone")\n population: fieldValue(slug: "population")\n language: fieldValue(slug: "language")\n\n picture {\n url\n }\n}\n',fragments:[]},UserInfoTeamMemberFragment:{code:"fragment UserInfoTeamMember on UsersInfo {\n id\n ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},UserInfoTeamRightPanelFragment:{code:"fragment UserInfoTeamRightPanel on VolunteersRegistration {\n positionsCategories {\n positions {\n id\n name\n icon\n color\n\n slots {\n id\n name\n range\n }\n }\n }\n\n positions {\n id\n name\n icon\n color\n\n slots {\n id\n name\n range\n }\n }\n\n positionsSlots {\n id\n name\n range\n\n position {\n id\n name\n icon\n color\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n id\n name\n range\n }\n\n position {\n id\n name\n icon\n color\n }\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},UserInfoUpdateMemberFragment:{code:"fragment UserInfoUpdateMember on UsersInfo {\n id\n email\n name\n fields\n userId\n\n picture {\n url\n }\n\n formUserInfo(formId: $formId) {\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationProfileId\n accreditationsSlotsIds\n\n slots {\n startDate\n startTime\n endDate\n endTime\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n form {\n ...CreateUpdateMemberForm\n }\n }\n\n volunteerRegistration(eventId: $eventId) {\n accreditationsUsersInfos {\n accreditationSlotId\n checkInAt\n }\n }\n}\n",fragments:["CreateUpdateMemberFormFragment"]},UserPanelAccreditationSlotUserInfoFragment:{code:"fragment UserPanelAccreditationSlotUserInfo on AccreditationsUsersInfo {\n id\n eventId\n isAutoAccredit\n isWorkflow\n checkInAt\n insertedAt\n checkInAt\n state\n\n accreditationCategory {\n name\n }\n\n accreditation {\n id\n name\n color\n icon\n index\n }\n\n accreditationSlot {\n id\n name\n date\n }\n\n accreditationProfile {\n id\n name\n }\n\n createdBy {\n email\n name\n }\n}\n",fragments:[]},UserPermissionsFragment:{code:"fragment UserPermissions on User {\n roles(organizationId: $organizationId, eventId: $eventId) {\n id\n accessLevel\n type\n permissions\n }\n\n usersDelegationsCategories(eventId: $eventId) {\n delegationCategoryId\n roleId\n }\n\n usersEvents(eventId: $eventId) {\n eventId\n roleId\n }\n\n usersPositionsCategories(eventId: $eventId) {\n positionCategoryId\n roleId\n }\n\n usersPositions(eventId: $eventId) {\n positionId\n roleId\n }\n}\n",fragments:[]},UserPositionSlotUserInfoFragment:{code:"fragment UserPositionSlotUserInfo on PositionsSlotsUsersInfo {\n breakTime\n checkInAt\n checkOutAt\n eventId\n id\n insertedAt\n isAutoAssign\n isWorkflow\n organizationId\n positionCategoryId\n positionSlotId\n state\n timeDifferenceMinutes\n userInfoId\n\n createdBy {\n email\n name\n }\n\n position {\n id\n acronym\n color\n icon\n name\n }\n\n positionSlot {\n id\n name\n range\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:[]},VolunteerInfosFragment:{code:'fragment VolunteerInfos on VolunteersRegistration {\n delegation {\n id\n name\n }\n\n userInfo {\n id\n name\n email\n phone: fieldValue(slug: "phone")\n picture {\n url\n }\n }\n}\n',fragments:[]},VolunteerPdfFragment:{code:"fragment VolunteerPdf on VolunteersRegistration {\n delegation {\n name\n }\n\n teams {\n teamCode\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n fields\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationFragment:{code:"fragment VolunteerRegistration on VolunteersRegistration {\n id\n localId\n ticketId\n ticketIdVersion\n state\n accreditationState\n insertedAt\n canDelete\n canRegistrationStateUpdate @include(if: $includeCanRegistrationStateUpdate)\n numberOfAccreditations @include(if: $includeNumberOfAccreditations)\n numberOfAssignments @include(if: $includeNumberOfAssignments)\n numberOfAssignmentsDays @include(if: $includeNumberOfAssignmentsDays)\n numberOfAvailableDays @include(if: $includeNumberOfAvailableDays)\n shortTag\n pairedAt\n volunteerMinutes @include(if: $includeVolunteerMinutes)\n weezeventPayUrl @include(if: $includeWeezeventUrls)\n weezeventTicketUrl @include(if: $includeWeezeventUrls)\n delegationBannerNumber @include(if: $includeDelegation)\n exportedCustomDocumentsSlugs @include(if: $includeCustomDocuments)\n accreditationProfileId\n wishedAccreditationProfileId @include(if: $includeAccreditationsMatrix)\n\n delegation @include(if: $includeDelegation) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n userInfo {\n id\n localId\n userId\n organizationId\n email\n name\n nameOrEmail\n fields\n isEditable @include(if: $includeIsEditable)\n insertedAt\n\n picture @include(if: $includePicture) {\n url\n }\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n comments @include(if: $includeComments) {\n content\n }\n\n emails(\n emailTypes: [Campaign]\n level: Event\n eventId: $eventId\n delegationId: $delegationId\n ) @include(if: $includeEmails) {\n id\n state\n\n campaign {\n name\n }\n }\n\n formsUsersInfos(level: Event, eventId: $eventId) @include(if: $includeFormsUsersInfos) {\n id\n insertedAt\n\n accreditationProfile @include(if: $includeAccreditationProfile) {\n ...AccreditationProfileVolunteerRegistration\n }\n\n form @include(if: $includeForms) {\n id\n name\n slotDisplay\n }\n\n slots @include(if: $includeAvailability) {\n id\n range\n }\n\n teamMembers @include(if: $includeTeam) {\n ...UserInfoTeamMember\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n accreditationProfile @include(if: $includeAccreditationProfile) {\n ...AccreditationProfileVolunteerRegistration\n }\n\n accreditationsUsersInfos(\n delegationId: $delegationId\n onlyVisible: $onlyVisibleAccreditationsSlots\n ) @include(if: $includeAccreditations) {\n checkInAt\n\n accreditationSlot {\n ...AccreditationSlotVolunteerRegistration\n }\n }\n\n matrixAuis: accreditationsUsersInfos(\n delegationId: $delegationId\n onlyVisible: $onlyVisibleAccreditationsSlots\n ) @include(if: $includeAccreditationsMatrix) {\n accreditationSlotId\n isAutoAccredit\n accreditationProfileId\n checkInAt\n }\n\n accreditationsSlots(delegationId: $delegationId, onlyVisible: $onlyVisibleAccreditationsSlots)\n @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n matrixWishedSlots: accreditationsSlots @include(if: $includeAccreditationsMatrix) {\n id\n }\n\n duplicatedFrom @include(if: $includeDuplicatedFrom) {\n userInfo {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n\n positionsSlotsUsersInfos @include(if: $includePositions) {\n ...UserPositionSlotUserInfo\n }\n\n positionsCategories @include(if: $includeWishedPositions) {\n id\n name\n }\n\n positions @include(if: $includeWishedPositions) {\n id\n acronym\n color\n icon\n name\n }\n\n positionsSlots @include(if: $includeWishedPositions) {\n id\n name\n range\n\n position {\n acronym\n color\n icon\n name\n }\n }\n\n preassignPositionsCategories @include(if: $includePreassignedPositions) {\n id\n name\n }\n\n preassignPositions @include(if: $includePreassignedPositions) {\n id\n name\n }\n\n teams @include(if: $includeTeam) {\n teamCode\n }\n\n weezaccessChecklists @include(if: $includeWeezeventChecklists) {\n id\n name\n }\n}\n",fragments:["UserAllPermissionsFragment","UserInfoLinksFragment","AccreditationProfileVolunteerRegistrationFragment","UserInfoTeamMemberFragment","AccreditationSlotVolunteerRegistrationFragment","UserPositionSlotUserInfoFragment"]},VolunteerRegistrationDelegationAccreditationProfileFragment:{code:"fragment VolunteerRegistrationDelegationAccreditationProfile on VolunteersRegistration {\n id\n accreditationProfileId\n wishedAccreditationProfileId\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationDelegationAccreditationSlotFragment:{code:"fragment VolunteerRegistrationDelegationAccreditationSlot on VolunteersRegistration {\n id\n\n accreditationsSlots {\n id\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationEmailRendererFragment:{code:"fragment VolunteerRegistrationEmailRenderer on VolunteersRegistration {\n localId\n ticketId\n weezevent\n\n accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n}\n",fragments:["AccreditationProfileEmailFragment","DelegationEmailFragment"]},VolunteerRegistrationWaitingAssignmentFragment:{code:"fragment VolunteerRegistrationWaitingAssignment on VolunteersRegistration {\n insertedAt\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationWeezeventFragment:{code:"fragment VolunteerRegistrationWeezevent on VolunteersRegistration {\n id\n localId\n state\n accreditationState\n ticketId\n weezevent\n\n accreditationProfile {\n name\n\n accreditationProfileCategory {\n name\n }\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n accreditationCategoryId\n\n accreditationCategory {\n id\n name\n }\n\n accreditation {\n id\n name\n fields\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n\n positionCategory {\n id\n name\n }\n\n position {\n id\n name\n }\n }\n\n delegation {\n name\n\n delegationCategory {\n name\n }\n }\n\n userInfo {\n id\n localId\n ...UserInfoContactInformation\n fieldsExpanded: fields(expand: true)\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationZplRendererFragment:{code:"fragment VolunteerRegistrationZplRenderer on VolunteersRegistration {\n localId\n ticketId\n weezevent\n\n accreditationsUsersInfos {\n accreditation {\n id\n }\n accreditationSlot {\n id\n }\n }\n\n delegation {\n ...DelegationEmail\n }\n\n userInfo {\n id\n localId\n email\n fields\n registrationDate\n }\n}\n",fragments:["DelegationEmailFragment"]},WishesEmailFragment:{code:"fragment WishesEmail on FormsUsersInfo {\n form {\n slotDisplay\n }\n\n positionsCategories {\n name\n }\n\n positions {\n name\n }\n\n positionsSlots {\n name\n range\n\n position {\n name\n }\n }\n\n slots {\n range\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n name\n }\n }\n}\n",fragments:[]},WorkflowsWorkflowFragment:{code:"fragment WorkflowsWorkflow on Workflow {\n id\n name\n state\n trigger\n action\n frequency\n executedAt\n insertedAt\n\n createdBy {\n email\n name\n }\n\n data {\n errorMessage\n }\n\n accreditationsSlots @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n campaign @include(if: $includeCampaign) {\n id\n name\n }\n\n customField @include(if: $includeCustomField) {\n id\n name\n }\n\n positionsSlots @include(if: $includePositions) {\n id\n name\n range\n\n position {\n acronym\n color\n icon\n name\n }\n }\n\n segment {\n id\n name\n segmentType\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment"]},ZapierMemberFragment:{code:"fragment ZapierMember on UsersInfo {\n id\n fields(expand: true)\n email\n insertedAt\n updatedAt\n deletedAt\n}\n",fragments:[]}};function To(e){return e.flatMap(e=>[e.code].concat(To(e.fragments.map(e=>$o[e]))))}function zo(e){return(0,wo.A)(To(e)).join(" ")}var Oo=t(8097);const Ro="yyyy-MM-dd",Do="yyyy-MM-dd'T'HH:mm",Mo="yyyy-MM-dd'T'HH:mm:ss";function Po(e){const[n,t]=JSON.parse(e);return Oo.IX.fromDateTimes(Oo.c9.fromISO(n,{zone:"UTC"}),Oo.c9.fromISO(t,{zone:"UTC"}))}function ko({startDate:e,startTime:n,endDate:t,endTime:i}){try{const[s,o]=n.split(":"),[a,r]=i.split(":");return Oo.IX.fromDateTimes(e.set({hour:parseInt(s,10),minute:parseInt(o,10)}),t.set({hour:parseInt(a,10),minute:parseInt(r,10)}))}catch{return Oo.IX.invalid("Invalid")}}function Fo(e){return Oo.IX.isInterval(e)?e:ko(e)}function No(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 Lo=(e,n)=>e.contains(n)||e.start.startOf("day").toMillis()===n.startOf("day").toMillis()||e.end.minus({minute:1}).startOf("day").toMillis()===n.startOf("day").toMillis(),Uo={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 Vo(e){return"string"==typeof e?Oo.c9.fromISO(e,{setZone:!0}):e}function Bo(){return Oo.c9.utc().toLocal().zoneName}function Wo(e){return"string"==typeof e&&e.startsWith("[")}function Go(e){if(!0===Array.isArray(e))return e.map(e=>null!=e&&"object"==typeof e?Go(e):e);if("boolean"==typeof e||"number"==typeof e||"string"==typeof e||null===e)return e;{const n={};return Object.keys(e).forEach(t=>{const i=e[t];zi.includes(t)||Ti.includes(t)?n[t]=i&&Oo.c9.fromISO(i,{zone:"UTC"}):Oi.includes(t)?Array.isArray(i)?n[t]=i.map(e=>Wo(e)?Po(e):e):n[t]=Wo(i)?Po(i):i:Ri.includes(t)?n[t]=i&&Oo.dw.fromISO(i):n[t]=null!=i&&"object"==typeof i?Go(i):i}),n}}const qo=[];function Ho(e){return null==e?[]:Array.isArray(e)?e:[e]}function Yo(e){return Array.isArray(e)&&e.length>0}function Zo(e){return!Yo(e)}function Ko(e,n,t){const i=new Set(e);return t?i.add(n):i.delete(n),Array.from(i)}function Xo(e,n){const t=new Set(e);return t.has(n)?t.delete(n):t.add(n),Array.from(t)}function Qo(e,n,t){const i=[...e],[s]=i.splice(n,1);return i.splice(t,0,s),i}function Jo(e,n){return e.filter((e,t)=>t!==n)}const ea="68f3d403894092846580e9363c9b160199bceb83\n".trim();var na=t(7405);const ta="heaventRequestUuid";function ia(e,n){return"object"==typeof e&&null!==e&&Object.defineProperty(e,ta,{value:n}),e}const sa="h-new-version";async function oa(e,n={}){let t=F.HEAVENT_API_URL.href;const i=new URL(location.href).searchParams,s=`${e} ${Yo(n.fragments)?zo(n.fragments):""}`,o=W(),a={"Content-Type":"application/json",[N]:ea,[L]:o};i.has("lang")&&(t=`${t}?lang=${i.get("lang")}`),n.token&&(a[U]=n.token);const r=await fetch(t,{method:"post",headers:a,body:JSON.stringify({query:s,variables:n.variables||{}})});if(r.ok){n.reloadOnNewVersion&&"true"===r.headers.get("x-heavent-new-version")&&document.body.dispatchEvent(new CustomEvent(sa,{bubbles:!0}));const e=await r.json();if(e.errors){const n=e.errors[0]?.message??"";if("You need to be logged-in"===n)return localStorage.clear(),location.href="/crew",{};if(n.startsWith("You do not have access to this"))return location.href="/crew",{};throw ia(e.errors,o)}{const n=(0,na.A)(e.data),t={};return n.forEach(n=>{t[n]=Go(e.data[n])}),t}}throw ia(new Error(r.statusText),o)}function aa(e,n,t){const i=Object.keys(n).sort().map(e=>{const t=n[e];return`"${e}":${JSON.stringify(t)}`}).join(",");return(0,V.useMemo)(()=>X().then(i=>oa(e,{variables:n,token:i||void 0,fragments:t})),[e,i])}const ra="query CustomFieldsMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n }\n}\n",da="query DelegationsMassEditInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n campaigns(level: $level, eventId: $eventId, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customFields(\n eventId: $eventId\n variety: Delegation\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n delegationsCategories(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n\n delegationsSpaceLayouts {\n id\n name\n }\n }\n }\n}\n",la='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',ca='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',ua="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",ma="query EventAccreditationsProfiles($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n color\n icon\n }\n }\n }\n}\n",ga="query EventAccreditationsSlots($eventId: EventId!, $loadIsBlocked: Boolean!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n isBlocked @include(if: $loadIsBlocked)\n }\n }\n }\n }\n}\n",ha="query EventPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n acronym\n positionDisplay\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",pa="query Volunteers(\n $eventId: EventId!\n $predicatesGroups: PredicatesGroups!\n $limit: Int\n $offset: Int\n $sort: VolunteersRegistrationsSort\n $name: String\n $columnsSearch: [String!]\n $positionCategoryId: PositionsCategoryId\n $positionId: PositionId\n $preassignedPositionCategoryId: PositionsCategoryId\n $preassignedPositionId: PositionId\n $accreditationsCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $accreditationsSlotsIds: [AccreditationsSlotId!]\n $accreditationsProfilesCategoriesIds: [AccreditationsProfilesCategoryId!]\n $accreditationsProfilesIds: [AccreditationsProfileId!]\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $hasCoordinates: Boolean\n $includeAccreditationProfile: Boolean!\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeCustomDocuments: Boolean!\n $includeDelegation: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeFormsUsersInfos: Boolean!\n $includeForms: Boolean!\n $includeIsEditable: Boolean!\n $includeNumberOfAccreditations: Boolean!\n $includeNumberOfAssignments: Boolean!\n $includeNumberOfAssignmentsDays: Boolean!\n $includeNumberOfAvailableDays: Boolean!\n $includePicture: Boolean!\n $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeTraces: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: volunteersRegistrations(\n predicatesGroups: $predicatesGroups\n name: $name\n columnsSearch: $columnsSearch\n positionCategoryId: $positionCategoryId\n positionId: $positionId\n preassignedPositionCategoryId: $preassignedPositionCategoryId\n preassignedPositionId: $preassignedPositionId\n accreditationsCategoriesIds: $accreditationsCategoriesIds\n accreditationsIds: $accreditationsIds\n accreditationsSlotsIds: $accreditationsSlotsIds\n accreditationsProfilesCategoriesIds: $accreditationsProfilesCategoriesIds\n accreditationsProfilesIds: $accreditationsProfilesIds\n delegationCategoryId: $delegationCategoryId\n delegationId: $delegationId\n hasCoordinates: $hasCoordinates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...VolunteerRegistration\n }\n\n numberOfPages\n totalCount\n }\n\n traces @include(if: $includeTraces) {\n ...Trace\n }\n }\n}\n",Ia="mutation UserCreate {\n userCreate {\n id\n email\n }\n}\n";function xa(e){return Li('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,[$o.VolunteerRegistrationWaitingAssignmentFragment])}function fa(e={}){return Ui("mutation VolunteersRegistrationsMassAccreditationProfileUpdate(\n $eventId: EventId!\n $massProfileUpdate: MassAccreditationProfileUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationProfileUpdate(\n eventId: $eventId\n massProfileUpdate: $massProfileUpdate\n )\n}\n",e)}function _a(e={}){return Ui("mutation AccreditationsProfilesMassAccreditationsEdit(\n $eventId: EventId!\n $massAccreditations: MassAccreditationsInput!\n) {\n numberOfAccreditationsProfiles: accreditationsProfilesMassAccreditationsEdit(\n eventId: $eventId\n massAccreditations: $massAccreditations\n )\n}\n",e)}function ja(e={}){return Ui("mutation VolunteersRegistrationsMassAccredit(\n $eventId: EventId!\n $massAccredit: MassAccreditInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccredit(\n eventId: $eventId\n massAccredit: $massAccredit\n )\n}\n",e)}function va(e={}){return Ui("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 Sa(e={}){return Ui("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 ya(e){return Li("query CreateCampaignInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId\n) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n customFields(\n eventId: $eventId\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n\n event: eventMaybe(id: $eventId) {\n hasDuplicatedMembers\n timeZone\n\n customDocuments {\n slug\n name\n }\n\n emailSender {\n ... on EmailsSender {\n id\n }\n }\n }\n\n userInfo: userInfoMaybe(id: $userInfoId) {\n name\n }\n }\n}\n",e,[$o.CustomFieldFragment,$o.CreateCampaignEmailSenderFragment])}function Ca(e={}){return Ui("mutation EventLayerUpdate($eventId: EventId!, $layer: MapLayer!) {\n eventLayerUpdate(eventId: $eventId, layer: $layer) {\n id\n }\n}\n",e)}function ba(e={}){return Ui("mutation AccreditationsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function Aa(e={}){return Ui("mutation AccreditationsProfilesMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsProfilesMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function Ea(e={}){return Ui("mutation CustomFieldsMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: customFieldsMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n massEdit: $massEdit\n )\n}\n",e)}function wa(e,n){return oa(ra,{variables:e,token:n||void 0,fragments:[]})}function $a(e={}){return Ui("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 Ta(e,n){return oa(da,{variables:e,token:n||void 0,fragments:[$o.MassEditCustomFieldFragment]})}function za(e={}){return Ui("mutation EventsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n eventsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function Oa(e={}){return Ui("mutation PositionsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: positionsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function Ra(e={}){return Ui("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 Da(e={}){return Ui("mutation WorkflowsMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: workflowsMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n massEdit: $massEdit\n )\n}\n",e)}function Ma(e,n){return oa("query CustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel\n $name: String\n $predicatesGroups: PredicatesGroups!\n $limit: Int\n $offset: Int\n $sort: CustomFieldsSort\n) {\n data: organization(id: $organizationId) {\n rows: customFields(\n eventId: $eventId\n level: $level\n predicatesGroups: $predicatesGroups\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",{variables:e,token:n||void 0,fragments:[$o.CustomFieldFragment]})}function Pa(e,n){return oa("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:n||void 0,fragments:[$o.DelegationAccreditationSlotStatsFragment]})}function ka(e){return Li("query AllEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",e,[])}function Fa(e={}){return Ui("mutation EventDocumentsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $documentsExport: DocumentsExportInput!\n) {\n jobId: eventDocumentsExport(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n documentsExport: $documentsExport\n )\n}\n",e)}function Na(e={}){return Ui("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 La(e){return Li("query OrganizationParametersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...OrganizationAdminInfos\n }\n}\n",e,[$o.OrganizationAdminInfosFragment])}function Ua(e={}){return Ui("mutation PositionsSlotsUsersInfosCheckIn($eventId: EventId!, $checkIn: PositionSlotCheckInInput!) {\n numberOfMembers: positionsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}function Va(e){return Li("query UserPositions(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n name\n startAt\n endAt\n dayStartTime\n hasFormWithPositionDisplay\n hasFormWithSlotDisplay\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n volunteerMinutes\n isAssignmentsEmailSent\n\n positionsSlotsUsersInfos {\n ...UserPositionSlotUserInfo\n }\n\n preassignPositions {\n id\n name\n range\n }\n\n preassignPositionsCategories {\n id\n name\n range\n }\n }\n }\n}\n",e,[$o.FormsUsersInfosWishedFragment,$o.UserPositionSlotUserInfoFragment])}function Ba(e,n){return oa("query ConditionsCustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $fieldTypes: [FieldType!]\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: All, fieldTypes: $fieldTypes) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}function Wa(e,n){return oa(ua,{variables:e,token:n||void 0,fragments:[]})}function Ga(e={}){return Ui("mutation VolunteersRegistrationsMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function qa(e,n){return oa("query User(\n $organizationId: OrganizationId!\n $eventId: EventId\n $id: UsersInfoId!\n $includeComments: Boolean!\n $includeDelegations: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: userInfo(id: $id) {\n ...UserInfoCommunity\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.UserInfoCommunityFragment]})}function Ha(e={}){return Ui("mutation UserInfoUpdateField(\n $organizationId: OrganizationId!\n $userInfoId: UsersInfoId!\n $slug: String!\n $value: JSON!\n) {\n userInfoUpdateField(\n organizationId: $organizationId\n userInfoId: $userInfoId\n slug: $slug\n value: $value\n ) {\n id\n }\n}\n",e)}function Ya(e,n){return oa("query Users(\n $organizationId: OrganizationId!\n $eventId: EventId\n $predicatesGroups: PredicatesGroups!\n $name: String\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: UsersInfosSort\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $includeComments: Boolean!\n $includeDelegations: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: usersInfos(\n predicatesGroups: $predicatesGroups\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",{variables:e,token:n||void 0,fragments:[$o.UserInfoCommunityFragment]})}function Za(e){return Li("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 Ka(e={}){return Ui("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 Xa(e={}){return Ui("mutation EmailUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $email: UserEmail!\n) {\n emailUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n userInfoId: $userInfoId\n email: $email\n )\n}\n",e)}function Qa(e){return Li(ma,e,[])}function Ja(e){return Li(ga,e,[])}function er(e,n){return oa(ga,{variables:e,token:n||void 0,fragments:[]})}function nr(e,n){return oa(ha,{variables:e,token:n||void 0,fragments:[]})}function tr(e={}){return Ui("mutation VolunteersRegistrationsMassDuplicate(\n $eventId: EventId!\n $delegationId: DelegationId\n $selecteds: MassActionSelectedsInput!\n $numberOfCopies: Int!\n) {\n numberOfCreatedMembers: volunteersRegistrationsMassDuplicate(\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n numberOfCopies: $numberOfCopies\n )\n}\n",e)}function ir(e={}){return Ui("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 sr(e){return Li("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,[$o.FormsUsersInfosWishedFragment])}function or(e={}){return Ui("mutation VolunteersRegistrationsAccreditationsValidate(\n $eventId: EventId!\n $delegationId: DelegationId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsAccreditationsValidate(\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n )\n}\n",e)}function ar(e={}){return Ui("mutation VolunteersRegistrationsMassAccreditationStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassAccreditationStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function rr(e={}){return Ui("mutation VolunteersRegistrationsMassAssign($eventId: EventId!, $massAssign: MassAssignInput!) {\n numberOfMembers: volunteersRegistrationsMassAssign(eventId: $eventId, massAssign: $massAssign)\n}\n",e)}function dr(e={}){return Ui("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 lr(e={}){return Ui("mutation VolunteersRegistrationsMassStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function cr(e){return Li("query VolunteersSegments(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $privacy: CustomFieldPrivacy!\n $loadCustomDocuments: Boolean!\n $loadForms: Boolean!\n $loadSegments: Boolean!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n isWeezeventConnected\n\n customDocuments @include(if: $loadCustomDocuments) {\n ...CustomDocumentPopulation\n }\n\n forms @include(if: $loadForms) {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) @include(if: $loadSegments) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[$o.SegmentCustomFieldFragment,$o.CustomDocumentPopulationFragment,$o.SegmentsFoldersSegmentsFragment])}function ur(e,n){return oa("query UpdateCellDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}function mr(e={}){return Ui("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 gr(e,n){return oa("query Volunteer(\n $eventId: EventId!\n $id: VolunteersRegistrationId!\n $delegationId: DelegationId\n $includeAccreditationProfile: Boolean!\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeCustomDocuments: Boolean!\n $includeDelegation: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeFormsUsersInfos: Boolean!\n $includeForms: Boolean!\n $includeIsEditable: Boolean!\n $includeNumberOfAccreditations: Boolean!\n $includeNumberOfAssignments: Boolean!\n $includeNumberOfAssignmentsDays: Boolean!\n $includeNumberOfAvailableDays: Boolean!\n $includePicture: Boolean!\n $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n row: volunteerRegistration(id: $id) {\n ...VolunteerRegistration\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.VolunteerRegistrationFragment]})}function hr(e,n){return oa(pa,{variables:e,token:n||void 0,fragments:[$o.VolunteerRegistrationFragment,$o.TraceFragment]})}function pr(e={}){return Ui("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 Ir(e={}){return Ui("mutation VolunteersRegistrationsMassWishedAccreditationsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $massAccredit: MassAccreditInput!\n) {\n volunteersRegistrationsMassWishedAccreditationsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massAccredit: $massAccredit\n )\n}\n",e)}function xr(e={}){return Ui("mutation VolunteersRegistrationsMassWishedProfileUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $massProfileUpdate: MassAccreditationProfileUpdateInput!\n) {\n volunteersRegistrationsMassWishedProfileUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massProfileUpdate: $massProfileUpdate\n )\n}\n",e)}const fr=()=>{const{code:e,source:n,organizationId:t,eventId:i}=Vi();return(0,V.useEffect)(()=>{const s=localStorage.getItem(q),o=localStorage.getItem(G);if(g(s)&&g(o)&&g(e)&&g(n)){localStorage.removeItem(q),localStorage.removeItem(G);const a=new B.TU({Username:s,Pool:Z()});a.Session=o,a.setAuthenticationFlowType("CUSTOM_AUTH"),a.sendCustomChallengeAnswer(e,{async onSuccess(e){const s=e.getIdToken().getJwtToken();await oa(Ia,{token:s}),t&&i&&n===mn.VolunteerRegister?location.href=Ao(t,i):t&&i&&n===mn.VolunteerAssignments?location.href=Eo(t,i):n===mn.App?location.href=yo.HOME:location.href="/"},onFailure(e){Ki("Could not sendCustomChallengeAnswer",e),location.href="/"}})}else location.href="/"},[]),null};var _r=t(5126);function jr(e){if(e){const[n,t,i]=e.split(" ");return{color:n,fontSize:t,fontWeight:i}}return{}}function vr(e){return"string"==typeof e?e:"number"==typeof e?e<=1?100*e+"%":`${e}px`:void 0}var Sr=t(3345);const yr={mobile:"screen and (max-width: 743px)",tablet:"screen and (min-width: 744px)",desktop:"screen and (min-width: 1280px)"},Cr="-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",{styled:br,theme:Ar,config:Er,getCssText:wr,createTheme:$r,globalCss:Tr,keyframes:zr,reset:Or}=(0,Sr.GC)({theme:{colors:{gray25:"#fcfcfd",gray50:"#f9fafb",grayCustom50:"var(--colors-gray50)",gray100:"#f2f4f7",gray200:"#e4e7ec",gray300:"#d0d5dd",gray400:"#98a2b3",gray500:"#667085",grayCustom500:"var(--colors-gray500)",gray600:"#475467",gray700:"#344054",grayCustom700:"var(--colors-gray700)",gray800:"#1d2939",grayCustom800:"var(--colors-gray800)",gray900:"#101828",grayCustom900:"var(--colors-gray900)",grayDark50:"#f0f3f4",grayDark100:"#dfe4e7",grayDark500:"#667c8a",grayDark700:"#3d4a52",primary50:"#F0EBF9",primary100:"#E0D8F3",primary200:"#C4B4E9",primary300:"#A58DDD",primary400:"#8666D1",primary500:"#6941C6",primaryCustom500:"var(--colors-primary500)",primary600:"#5230A1",primaryCustom600:"var(--colors-primary600)",primary700:"#3E257A",primary800:"#2A1952",primary900:"#140C27",primary950:"#0A0614",error25:"#fffbfa",error50:"#fef3f2",error100:"#fee4e2",error200:"#fecdca",error300:"#fda29b",error400:"#f97066",error500:"#f04438",error600:"#d92d20",error700:"#b42318",error800:"#912018",error900:"#7a271a",warning25:"#fffcf5",warning50:"#fffaeb",warning100:"#fef0c7",warning200:"#fedf89",warning300:"#fec84b",warning400:"#fdb022",warning500:"#f79009",warning600:"#dc6803",warning700:"#b54708",warning800:"#93370d",warning900:"#7a2e0e",success25:"#f6fef9",success50:"#ecfdf3",success100:"#d1fadf",success200:"#a6f4c5",success300:"#6ce9a6",success400:"#32d583",success500:"#12b76a",success600:"#039855",success700:"#027a48",success800:"#05603a",success900:"#054f31",blue25:"#f5faff",blue50:"#edf4fd",blue100:"#dae9fb",blue200:"#b2ddff",blue300:"#84caff",blue400:"#53b1fd",blue500:"#4995ec",blue600:"#1570ef",blue700:"#1157a6",blue800:"#1849a9",blue900:"#194185",blueGray50:"#edeef8",blueGray100:"#daddf1",blueGray500:"#4352af",blueGray600:"#3e4784",blueGray700:"#29326b",blueGray900:"#272e3c",blueLight50:"#eff9fb",blueLight100:"#dff2f6",blueLight500:"#54bad1",blueLight600:"#0086C9",blueLight700:"#267a8d",purple25:"#fafaff",purple50:"#f4e7f8",purple100:"#ecd4f2",purple200:"#d9d6fe",purple300:"#bdb4fe",purple400:"#9b8afb",purple500:"#9033aa",purple600:"#6938ef",purple700:"#571f66",purple800:"#4a1fb8",purple900:"#3e1c96",purpleLight50:"#f9e7f8",purpleLight100:"#f2cef1",purpleLight500:"#9d2999",purpleLight700:"#5d185b",purpleDark50:"#f0ecf8",purpleDark100:"#ded5f0",purpleDark500:"#613eb1",purpleDark700:"#3a256a",pink25:"#fef6fb",pink50:"#fdf2fa",pink100:"#fce7f6",pink200:"#fcceee",pink300:"#faa7e0",pink400:"#f670c7",pink500:"#ee46bc",pink600:"#dd2590",pink700:"#c01574",pink800:"#9e165f",pink900:"#851651",orange50:"#fcefed",orange100:"#f9dbd7",orange500:"#e15241",orange700:"#962418",redLight50:"#fff1f3",redLight100:"#ffe4e8",redLight500:"#f63d68",redLight700:"#c01048",redDark50:"#fbeaef",redDark100:"#f7d9e2",redDark500:"#d63865",redDark700:"#871c3a",green50:"#eff6ee",green100:"#dfeedd",green500:"#67ad5c",green700:"#3c6935",greenDark50:"#eaf6f4",greenDark100:"#d5ece9",greenDark500:"#429488",greenDark700:"#275851",brown50:"#f3eeec",brown100:"#e5dbd7",brown500:"#74574a",brown700:"#44342c",white:"white",inherit:"inherit",blueGray25:"#ff08ce",cyan:"#ff08ce",primary25:"#ff08ce",blueGray200:"#ff08ce",blueGray300:"#ff08ce",blueGray400:"#ff08ce",blueGray800:"#ff08ce",blueLight400:"#ff08ce",blueLight900:"#ff08ce",orange400:"#ff08ce",orange600:"#ff08ce",indigo100:"#ff08ce",indigo600:"#ff08ce"},space:{1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"32px",8:"40px",9:"48px",10:"64px",11:"80px",12:"96px",13:"128px"},fonts:{default:`'Open Sans', ${Cr}`,grafik:`Graphik, ${Cr}`,montserrat:`Montserrat, ${Cr}`,anton:`Anton, ${Cr}`,roboto:`Roboto, ${Cr}`,poppins:`Poppins, ${Cr}`,inter:`Inter, ${Cr}`,unbounded:`Unbounded, ${Cr}`,rubik:`Rubik, ${Cr}`,firaSans:`"Fira Sans", ${Cr}`,arimo:`Arimo, ${Cr}`,zuumeMedium:`"Zuume Medium", ${Cr}`,zuumeBold:`"Zuume Bold", ${Cr}`,formulaCondensedBold:`FormulaCondensedBold, ${Cr}`,raleway:`Raleway, ${Cr}`,avenir:`Avenir, ${Cr}`,movement:`Movement, ${Cr}`,atrament:`Atrament, ${Cr}`,lato:`Lato, ${Cr}`,helveticaNeue97BlackCondensed:`HelveticaNeue97BlackCondensed, ${Cr}`,graphie:`Graphie, ${Cr}`,archerBoldPro:`ArcherBoldPro, ${Cr}`,acumin:`Acumin, ${Cr}`,chillax:`Chillax, ${Cr}`,neufileGrotesk:`NeufileGrotesk, ${Cr}`},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:yr,utils:{bd:e=>{let n="$gray200",t="$2",i="$xs";if(g(e)){const s=function(e){if(e){const[n,t,i]=e.split(" ");return{borderColor:n,borderRadius:t,boxShadow:i}}return{}}(e);s.borderColor&&(n=`$${s.borderColor}`),s.borderRadius&&(t=`$${s.borderRadius}`),i=s.boxShadow?`$${s.boxShadow}`:void 0}return{borderColor:n,borderRadius:t,borderStyle:"solid",borderWidth:"1px",boxShadow:i}},clamp:e=>({display:"-webkit-box",overflow:"hidden","-webkit-line-clamp":e.toString(10),"-webkit-box-orient":"vertical"}),ellipsis:()=>({overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingBottom:e,paddingTop:e})}}),Rr=$r("weezcrew-theme",{}),Dr=br("div",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},grayCustom50:{color:"$grayCustom50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},grayCustom500:{color:"$grayCustom500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},grayCustom700:{color:"$grayCustom700"},gray800:{color:"$gray800"},grayCustom800:{color:"$grayCustom800"},gray900:{color:"$gray900"},grayCustom900:{color:"$grayCustom900"},grayDark50:{color:"$grayDark50"},grayDark100:{color:"$grayDark100"},grayDark500:{color:"$grayDark500"},grayDark700:{color:"$grayDark700"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primaryCustom500:{color:"$primaryCustom500"},primary600:{color:"$primary600"},primaryCustom600:{color:"$primaryCustom600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},primary950:{color:"$primary950"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight50:{color:"$blueLight50"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight500:{color:"$blueLight500"},blueLight600:{color:"$blueLight600"},blueLight700:{color:"$blueLight700"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},purpleLight50:{color:"$purpleLight50"},purpleLight100:{color:"$purpleLight100"},purpleLight500:{color:"$purpleLight500"},purpleLight700:{color:"$purpleLight700"},purpleDark50:{color:"$purpleDark50"},purpleDark100:{color:"$purpleDark100"},purpleDark500:{color:"$purpleDark500"},purpleDark700:{color:"$purpleDark700"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange50:{color:"$orange50"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange500:{color:"$orange500"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},redLight50:{color:"$redLight50"},redLight100:{color:"$redLight100"},redLight500:{color:"$redLight500"},redLight700:{color:"$redLight700"},redDark50:{color:"$redDark50"},redDark100:{color:"$redDark100"},redDark500:{color:"$redDark500"},redDark700:{color:"$redDark700"},green50:{color:"$green50"},green100:{color:"$green100"},green500:{color:"$green500"},green700:{color:"$green700"},greenDark50:{color:"$greenDark50"},greenDark100:{color:"$greenDark100"},greenDark500:{color:"$greenDark500"},greenDark700:{color:"$greenDark700"},brown50:{color:"$brown50"},brown100:{color:"$brown100"},brown500:{color:"$brown500"},brown700:{color:"$brown700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}},textAlign:{start:{textAlign:"start"},end:{textAlign:"end"},center:{textAlign:"center"},justify:{textAlign:"justify"}},ellipsis:{true:{ellipsis:""}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start"}}),Mr=V.forwardRef((e,n)=>{const t={};return e.height&&(t.height=vr(e.height)),e.width&&(t.width=vr(e.width)),(0,i.jsx)(Dr,{...(0,_r.A)(e,"font"),...jr(e.font),ref:n,css:{...t,...e.css}})});Mr.displayName="Box";var Pr=t(4625),kr=t(6347),Fr=t(8542);function Nr(e){return"number"==typeof e&&!isNaN(e)}function Lr(e,n=96){return Math.round(25.4*e/n)}function Ur(e){return"number"==typeof e&&Number.isInteger(e)&&e>0}function Vr(e){return e?{lat:e.latitude,lng:e.longitude}:null}const Br=Vr({latitude:43.6087733,longitude:3.87963579999996}),Wr=13;function Gr(e,n,t){return{center:e??Br,zoom:n??Wr,fullscreenControl:!1,mapTypeControl:!1,streetViewControl:!1,mapTypeId:Hr(t),styles:[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi.government",stylers:[{visibility:"on"}]},{featureType:"poi.park",stylers:[{visibility:"on"}]}]}}function qr(e){return Nr(e.latitude)&&Nr(e.longitude)?(0,Fr.A)(e,["latitude","longitude"]):void 0}function Hr(e){return e===gn.GoogleSatellite?"satellite":e===gn.Google?"roadmap":e??gn.Google}var Yr=t(6996),Zr=t(2096);function Kr(){return new google.maps.ImageMapType({getTileUrl:(e,n)=>((e,n)=>`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=${n}`,`TILEROW=${e.y}`,`TILECOL=${e.x}`].join("&")}`)(e,n),tileSize:new google.maps.Size(256,256),name:gn.IgnPlan,maxZoom:18})}const Xr=(0,V.memo)(e=>{const n=(0,V.useCallback)(n=>{n&&(t.current&&(s.current?.setMap(null),t.current=null),t.current=new google.maps.Map(n,{zoom:e.coordinatesFieldsProps?.zoomProps.input.value??e.initialZoom??Wr,center:Vr(e.center)||Br,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,mapTypeId:Hr(e.layer),...e.mapOptions||{}}),t.current.mapTypes.set(gn.IgnPlan,Kr()),t.current.addListener("zoom_changed",()=>{e.coordinatesFieldsProps&&e.coordinatesFieldsProps.zoomProps.input.onChange(t.current.getZoom())}),t.current.addListener("tilesloaded",()=>{e.onTilesloaded?.()}),a())},[]),t=(0,V.useRef)(null),s=(0,V.useRef)(null),o=(0,V.useRef)([]),a=()=>{o.current.forEach(e=>e.setMap(null)),Yo(e.traces)?o.current=e.traces.map(e=>{const n=e.points.map(([e,n])=>({lat:e,lng:n})),i=e.direction===Xn.None?[]:[{icon:{path:e.direction===Xn.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:e.color},offset:"0%",repeat:"200px"}],s=new google.maps.Polyline({path:n,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,icons:i});return s.setMap(t.current),s}):o.current=[]};return(0,V.useEffect)(()=>{(()=>{if(s.current&&s.current.setMap(null),e.point&&t.current){const n=Vr(e.point);t.current.setCenter(n),s.current=new google.maps.Marker({position:n,map:t.current,draggable:"object"==typeof e.coordinatesFieldsProps&&null!==e.coordinatesFieldsProps}),e.coordinatesFieldsProps&&s.current.addListener("dragend",n=>{e.coordinatesFieldsProps?.latitudeProps.input.onChange(n.latLng.lat()),e.coordinatesFieldsProps?.longitudeProps.input.onChange(n.latLng.lng())})}})()},[JSON.stringify(e.point)]),(0,V.useEffect)(()=>{t.current?.setMapTypeId(Hr(e.layer))},[e.layer]),(0,V.useEffect)(()=>{a()},[JSON.stringify(e.traces||[])]),(0,i.jsx)(Mr,{ref:n,height:1,width:1,children:e.coordinatesFieldsProps?.zoomProps&&(0,i.jsx)(Zr.Yr,{name:e.coordinatesFieldsProps.zoomProps.input.name,children:e=>{t.current?.setZoom(e)}})})},Yr.A);Xr.displayName="Map";const Qr=()=>(0,St.createPortal)((0,i.jsx)(Mr,{className:"h-map-loaded",css:{background:"transparent",height:"1px",left:"-100px",position:"absolute",top:"-100px",width:"1px"}}),document.body),Jr="query AccreditationsSlotsList(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $columnsSearch: [String!]\n $customFieldsSlugs: [CustomFieldSlug!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSlotsSort\n $includeConditions: Boolean!\n $includeCustomFields: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $onlyWithDate: Boolean\n) {\n organization(id: $organizationId) @include(if: $includeCustomFields) {\n customFields(eventId: $eventId, fieldTypes: [Select]) {\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n accreditationsSlots(\n name: $name\n predicatesGroups: $predicatesGroups\n includeHidden: true\n onlyWithDate: $onlyWithDate\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsAccreditationSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",ed="query BackofficeOrganization($organizationId: OrganizationId!) {\n data: backoffice {\n row: organization(id: $organizationId) {\n ...OrganizationBackoffice\n }\n }\n}\n",nd="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",td="query Events(\n $organizationId: OrganizationId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: EventsSort\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: events(\n name: $name\n whereUserIsLeader: true\n predicatesGroups: $predicatesGroups\n offset: $offset\n limit: $limit\n sort: $sort\n ) {\n nodes {\n ...EventsEvent\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",id="query Positions(\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $hasCoordinates: Boolean\n $limit: Int\n $offset: Int\n $sort: PositionsSort\n $columnsSearch: [String!]\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includePositionTraces: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n $includeTraces: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: positions(\n name: $name\n predicatesGroups: $predicatesGroups\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",sd="query VolunteersPlanning(\n $eventId: EventId!\n $positionId: PositionId\n $predicatesGroups: PredicatesGroups!\n $name: String\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n dayStartTime\n startAt\n endAt\n\n rows: volunteersRegistrations(\n positionId: $positionId\n predicatesGroups: $predicatesGroups\n name: $name\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...DocumentUsersPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n";function od(e,n){return oa("query Accreditations(\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: AccreditationsSort\n $columnsSearch: [String!]\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n rows: accreditations(\n name: $name\n predicatesGroups: $predicatesGroups\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",{variables:e,token:n||void 0,fragments:[$o.AccreditationsAccreditationFragment]})}function ad(e,n){return oa("query AccreditationsAccreditation(\n $eventId: EventId!\n $id: AccreditationId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: accreditation(id: $id) {\n ...AccreditationsAccreditation\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.AccreditationsAccreditationFragment]})}function rd(e,n){return oa("query AccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}function dd(e={}){return Ui("mutation AccreditationsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfAccreditations: accreditationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function ld(e={}){return Ui("mutation AccreditationSlotDelete($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n accreditationSlotDelete(eventId: $eventId, accreditationSlotId: $accreditationSlotId) {\n id\n }\n}\n",e)}function cd(e={}){return Ui("mutation AccreditationsProfilesMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfAccreditationsProfiles: accreditationsProfilesMassDelete(\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function ud(e={}){return Ui("mutation AccreditationProfileDuplicate(\n $eventId: EventId!\n $accreditationProfileId : AccreditationsProfileId!\n){\n accreditationProfileDuplicate(eventId: $eventId, accreditationProfileId: $accreditationProfileId) {\n id\n }\n}\n",e)}function md(e,n){return oa("query AccreditationsProfiles(\n $eventId: EventId!\n $name: String\n $columnsSearch: [String!]\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: AccreditationsProfilesSort\n $includeAccreditations: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n) {\n data: event(id: $eventId) {\n rows: accreditationsProfiles(\n name: $name\n columnsSearch: $columnsSearch\n predicatesGroups: $predicatesGroups\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsProfilesProfile\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.AccreditationsProfilesProfileFragment]})}function gd(e,n){return oa("query AccreditationsProfilesProfile(\n $eventId: EventId!\n $id: AccreditationsProfileId!\n $includeAccreditations: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n) {\n data: event(id: $eventId) {\n row: accreditationProfile(id: $id) {\n ...AccreditationsProfilesProfile\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.AccreditationsProfilesProfileFragment]})}function hd(e={}){return Ui("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 pd(e){return Li(Jr,e,[$o.ConditionCustomFieldFragment,$o.AccreditationsAccreditationSlotFragment])}function Id(e){return Li('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 xd(e,n){return oa(ed,{variables:e,token:n||void 0,fragments:[$o.OrganizationBackofficeFragment]})}function fd(e,n){return oa("query BackofficeOrganizations(\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: OrganizationSort\n) {\n data: backoffice {\n rows: organizations(\n name: $name\n predicatesGroups: $predicatesGroups\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:n||void 0,fragments:[$o.OrganizationBackofficeFragment]})}function _d(e){return Li("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,[$o.DocumentEmailPreviewFragment])}function jd(e){return Li("query ImportInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $variety: CustomFieldVariety\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: $variety) {\n nodes {\n ...CustomFieldImport\n }\n }\n\n event: eventMaybe(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n\n accreditationsProfiles {\n nodes {\n ...AccreditationProfileImport\n }\n }\n }\n }\n}\n",e,[$o.CustomFieldImportFragment,$o.AccreditationImportFragment,$o.AccreditationProfileImportFragment])}function vd(e){return Li("query SpaceDesign(\n $organizationId: OrganizationId!\n $eventId: EventId\n $includeIntro: Boolean!\n $spaceType: SpaceType!\n) {\n organization(id: $organizationId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n\n event: eventMaybe(id: $eventId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n }\n\n eventsShowcaseSettings @include(if: $includeIntro) {\n title\n intro\n }\n }\n}\n",e,[$o.SpaceDesignFragment])}function Sd(e,n){return oa("query CommunityCampaigns(\n $organizationId: OrganizationId!\n $predicatesGroups: PredicatesGroups!\n $name: String\n $limit: Int\n $offset: Int\n $sort: CampaignsSort\n) {\n data: organization(id: $organizationId) {\n rows: campaigns(\n level: Organization\n predicatesGroups: $predicatesGroups\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",{variables:e,token:n||void 0,fragments:[$o.CampaignListFragment]})}function yd(e={}){return Ui("mutation UsersInfosMerge(\n $organizationId: OrganizationId!\n $eventId: EventId\n $mainUserInfoId: UsersInfoId!\n $toMergeUsersInfosIds: [UsersInfoId!]!\n) {\n usersInfosMerge(\n organizationId: $organizationId\n eventId: $eventId\n mainUserInfoId: $mainUserInfoId\n toMergeUsersInfosIds: $toMergeUsersInfosIds\n ) {\n id\n }\n}\n",e)}function Cd(e,n){return oa("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:n||void 0,fragments:[$o.CustomFieldFragment]})}function bd(e={}){return Ui("mutation CustomFieldsMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfCustomFields: customFieldsMassDelete(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function Ad(e={}){return Ui("mutation CustomFieldsMassDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n customFieldsMassDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n ) {\n id\n }\n}\n",e)}function Ed(e){return Li("query CustomFieldsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $predicatesGroups: PredicatesGroups!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, predicatesGroups: $predicatesGroups) {\n nodes {\n id\n name\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(level: $level, eventId: $eventId, segmentType: CustomFields) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[$o.SegmentsFoldersSegmentsFragment])}function wd(e={}){return Ui("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 $d(e={}){return Ui("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 Td(e={}){return Ui("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 zd(e,n){return oa("query Delegations(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicatesGroups: PredicatesGroups\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: DelegationsSort\n $includeAccreditations: Boolean!\n $includeAccreditationsProfiles: Boolean!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeDocuments: Boolean!\n $includeLayout: Boolean!\n $includeLeaders: Boolean!\n $includeParent: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $includeUsedCustomFieldsFilled: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: delegations(\n level: $level\n eventId: $eventId\n name: $name\n predicatesGroups: $predicatesGroups\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",{variables:e,token:n||void 0,fragments:[$o.DelegationsDelegationFragment]})}function Od(e,n){return oa("query DelegationsDelegation(\n $organizationId: OrganizationId!\n $id: DelegationId!\n $includeAccreditations: Boolean!\n $includeAccreditationsProfiles: Boolean!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeDocuments: Boolean!\n $includeLayout: Boolean!\n $includeLeaders: Boolean!\n $includeParent: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $includeUsedCustomFieldsFilled: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: delegation(id: $id) {\n ...DelegationsDelegation\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.DelegationsDelegationFragment]})}function Rd(e={}){return Ui("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 Dd(e={}){return Ui("mutation DelegationsMassLeadersEmailSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfDelegations: delegationsMassLeadersEmailSend(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function Md(e,n){return oa(nd,{variables:e,token:n||void 0,fragments:[]})}function Pd(e={}){return Ui("mutation DelegationCategoryCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategory: DelegationsCategoryInput!\n) {\n delegationCategoryCreate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}function kd(e,n){return oa(td,{variables:e,token:n||void 0,fragments:[$o.EventsEventFragment]})}function Fd(e,n){return oa("query EventsEvent(\n $organizationId: OrganizationId!\n $id: EventId!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: event(id: $id) {\n ...EventsEvent\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.EventsEventFragment]})}function Nd(e){return Li("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,[$o.FormListFragment])}function Ld(e){return Li("query Form($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n }\n }\n}\n",e,[])}function Ud(e={}){return Ui("mutation PositionsMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n numberOfPositions: positionsMassLeadersEdit(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}function Vd(e){return Li("query Organizations {\n organizations {\n id\n name\n }\n\n user {\n roles {\n organizationId\n type\n }\n }\n}\n",e,[])}function Bd(e,n){return oa("query OrganizationMember(\n $organizationId: OrganizationId!\n $id: VolunteersRegistrationId!\n $includeCustomDocuments: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: volunteerRegistration(id: $id) {\n ...OrganizationMember\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.OrganizationMemberFragment]})}function Wd(e,n){return oa("query OrganizationMembers(\n $organizationId: OrganizationId!\n $name: String\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: VolunteersRegistrationsSort\n $includeCustomDocuments: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: volunteersRegistrations(\n name: $name\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...OrganizationMember\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.OrganizationMemberFragment]})}function Gd(e={}){return Ui("mutation OrganizationSpaceDesignUpdate(\n $organizationId: OrganizationId!\n $spaceDesign: DesignInput!\n $settings: EventsShowcaseSettingsDesignInput\n $spaceType: SpaceType!\n) {\n organizationSpaceDesignUpdate(\n organizationId: $organizationId\n spaceDesign: $spaceDesign\n settings: $settings\n spaceType: $spaceType\n ) {\n id\n }\n}\n",e)}function qd(e={}){return Ui("mutation UserDelete {\n userDelete {\n id\n }\n}\n",e)}function Hd(e={}){return Ui("mutation UserAccessDelete($organizationId: OrganizationId!, $scope: AccessScope!, $id: Int!) {\n userAccessDelete(organizationId: $organizationId, scope: $scope, id: $id)\n}\n",e)}function Yd(e={}){return Ui("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 Zd(e,n){return oa("query PositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}function Kd(e={}){return Ui("mutation PositionsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfPositions: positionsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Xd(e,n){return oa("query PositionsPosition(\n $eventId: EventId!\n $id: PositionId!\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includePositionTraces: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: position(id: $id) {\n ...PositionsPosition\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.PositionsPositionFragment]})}function Qd(e,n){return oa(id,{variables:e,token:n||void 0,fragments:[$o.PositionsPositionFragment,$o.TraceFragment]})}function Jd(e,n){return oa('query PositionsMobile(\n $eventId: EventId!\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $name: String\n) {\n event(id: $eventId) {\n positions(\n predicatesGroups: $predicatesGroups\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:n||void 0,fragments:[$o.LeaderInfosFragment,$o.FullPageInfoFragment]})}function el(e,n){return oa('query PositionSlotMembersMobile(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $predicatesGroups: PredicatesGroups!\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 predicatesGroups: $predicatesGroups\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:n||void 0,fragments:[$o.FullPageInfoFragment]})}function nl(e,n){return oa("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:n||void 0,fragments:[$o.PositionPositionSlotFragment,$o.FullPageInfoFragment]})}function tl(e){return Li("query PositionDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: Position) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n position(id: $positionId) {\n id\n positionCategoryId\n positionCategoryName\n name\n description\n privateNote\n color\n icon\n resources\n assignedResources\n preassignedResources\n address\n latitude\n longitude\n zoom\n layer\n isVisible\n range\n fields\n numberOfSlots\n\n slots {\n id\n fillingRate\n name\n range\n }\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n\n traces {\n ...Trace\n }\n\n customFields: positionsCustomFields {\n customField {\n slug\n name\n fieldType\n listType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n leaders {\n ...LeaderInfos\n }\n\n tags {\n id\n name\n }\n }\n }\n}\n",e,[$o.CustomFieldWithConditionFragment,$o.TraceFragment,$o.LeaderInfosFragment])}function il(e,n){return oa("query VolunteerPlanning(\n $id: VolunteersRegistrationId!\n $eventId: EventId!\n $positionId: PositionId\n) {\n data: event(id: $eventId) {\n row: volunteerRegistration(id: $id) {\n ...DocumentUsersPlanning\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.DocumentUsersPlanningFragment]})}function sl(e={}){return Ui("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 ol(e,n){return oa("query PrintTriggers(\n $eventId: EventId!\n $name: String\n $limit: Int\n $offset: Int\n $sort: PrintTriggersSort\n) {\n data: event(id: $eventId) {\n rows: printTriggers(\n name: $name\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PrintTriggersPrintTrigger\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.PrintTriggersPrintTriggerFragment]})}function al(e,n){return oa("query PrintTriggersPrintTrigger($eventId: EventId!, $id: PrintTriggerId!) {\n data: event(id: $eventId) {\n row: printTrigger(id: $id) {\n ...PrintTriggersPrintTrigger\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.PrintTriggersPrintTriggerFragment]})}function rl(e){return Li("query UserFieldUpdate($organizationId: OrganizationId!, $slug: CustomFieldSlug!) {\n organization: organizationPublic(id: $organizationId) {\n customField: customFieldBySlug(slug: $slug) {\n name\n description\n fieldType\n\n values {\n id\n value\n }\n }\n }\n}\n",e,[])}function dl(e,n){return oa("query CreateUserDelegationForm(\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $eventId: EventId\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n id\n name\n dateFormat\n datetimeFormat\n\n country\n\n delegation: delegationMaybe(id: $delegationId) {\n id\n\n accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\n\n accreditationsSlots(onlyVisible: true) {\n ...DelegationAccreditationSlot\n }\n }\n\n event: eventMaybe(id: $eventId) {\n ...EventCreateUpdateMember\n }\n\n form(id: $formId) {\n ...CreateUpdateMemberForm\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.DelegationAccreditationProfileFragment,$o.DelegationAccreditationSlotFragment,$o.EventCreateUpdateMemberFragment,$o.CreateUpdateMemberFormFragment]})}function ll(e={}){return Ui("mutation UserInfoAdminCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $email: UserEmail!\n $userInfo: UsersInfoInput!\n $sendNotificationEmail: Boolean!\n) {\n userInfoAdminCreate(\n organizationId: $organizationId\n eventId: $eventId\n email: $email\n userInfo: $userInfo\n sendNotificationEmail: $sendNotificationEmail\n ) {\n id\n }\n}\n",e)}function cl(e={}){return Ui("mutation VolunteersRegistrationsMassTicketIdRegenerate(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfEdited: volunteersRegistrationsMassTicketIdRegenerate(\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function ul(e={}){return Ui("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 ml(e){return Li("query Comments($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n comments {\n ...Comment\n }\n }\n }\n}\n",e,[$o.CommentFragment])}function gl(e){return Li("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,[$o.ExistingVolunteerFragment])}function hl(e={}){return Ui("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 pl(e){return Li(sd,e,[$o.DocumentUsersPlanningFragment])}function Il(e,n){return oa(sd,{variables:e,token:n||void 0,fragments:[$o.DocumentUsersPlanningFragment]})}function xl(e={}){return Ui("mutation VolunteersRegistrationsMassPreAssign(\n $eventId: EventId!\n $massPreAssign: MassPreAssignInput!\n) {\n numberOfMembers: volunteersRegistrationsMassPreAssign(\n eventId: $eventId\n massPreAssign: $massPreAssign\n )\n}\n",e)}function fl(e={}){return Ui("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 _l(e,n){return oa("query VolunteersMobile(\n $eventId: EventId!\n $predicatesGroups: PredicatesGroups!\n $limit: Int\n $offset: Int\n $name: String\n) {\n event(id: $eventId) {\n volunteersRegistrations(\n predicatesGroups: $predicatesGroups\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:n||void 0,fragments:[$o.FullPageInfoFragment]})}function jl(e){return Li("query WorkflowCustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $variety: CustomFieldVariety!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: $variety, privacy: All) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",e,[$o.MassEditCustomFieldFragment])}function vl(e={}){return Ui("mutation WorkflowssMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n workflowssMassDelete(organizationId: $organizationId, eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Sl(e={}){return Ui("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)}function yl(e,n){return oa("query Workflows(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: WorkflowsSort\n $includeAccreditations: Boolean!\n $includeCampaign: Boolean!\n $includeCustomField: Boolean!\n $includePositions: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: workflows(\n level: $level\n eventId: $eventId\n name: $name\n predicatesGroups: $predicatesGroups\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:n||void 0,fragments:[$o.WorkflowsWorkflowFragment]})}function Cl(e={}){return Ui("mutation WorkflowsMassExecute(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfExecuted: workflowsMassExecute(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function bl(e){return Li("query WorkflowsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, eventId: $eventId, segmentType: Workflows) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[$o.SegmentsFoldersSegmentsFragment])}const Al=()=>{const{eventId:e,accreditationId:n}=Vi(),{data:t,loader:s}=Li("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:n},[]),[o,a]=(0,V.useState)(!1);if(s)return s;{const e=t.eventPublic.accreditation;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Xr,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:qr(e),onTilesloaded:()=>{a(!0)}})}),o&&(0,i.jsx)(Qr,{})]})}};var El;function wl(e){return(0,Fr.A)(e,["direction","align","justify","wrap","gap","css","height","width"])}!function(e){e.Nav="nav",e.Header="header",e.Footer="footer",e.Main="main",e.Section="section"}(El||(El={}));const $l=br("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"}}),Tl=V.forwardRef(({onClick:e,...n},t)=>{const s={};return n.height&&(s.height=vr(n.height)),n.width&&(s.width=vr(n.width)),(0,i.jsx)($l,{...n,ref:t,css:{...s,...n.css},onClick:e})});Tl.displayName="Flex";var zl=t(7356);let Ol=class{validate(e){return async n=>{try{return await e.validate(n,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}}validateSync(e,n){try{return e.validateSync(n,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}isValidSync(e,n){return 0===Object.keys(this.validateSync(e,n)).length}validateForForm(e){return async n=>{try{return await e.validate(n,{abortEarly:!1,strict:!0}),{}}catch(e){return e.inner.reduce((e,n)=>(0,zl.Oe)(e,n.path,n.message),{})}}}errorToObject(e){return e.inner.reduce((e,n)=>({...e,[n.path]:n.message}),{})}};Ol=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)()],Ol);var Rl=t(924),Dl=t(952);const Ml=(0,V.createContext)({}),Pl=br("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 kl=t(9241),Fl=t(2695),Nl=t(8174);const Ll=["access","ticket","pay"],Ul=/^(con|prn|aux|nul|com[1-9]|lpt[1-9]|conin\$|conout\$|clock\$)$/i,Vl=/[\u0000-\u001F\u007F-\u009F\u061C\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF\uFFF9-\uFFFB]/g,Bl=/[<>:"/\\|?*]/g,Wl=e=>(new TextEncoder).encode(e).length;function Gl(e,n="download",t=200){let i=e.normalize("NFC").replace(Vl,"").replace(Bl,"-").replace(/\s+/g," ").replace(/^[.\s-]+/,"").replace(/[.\s]+$/,"");return Ul.test(i.split(".")[0])&&(i=`_${i}`),i=function(e,n){if(Wl(e)<=n)return e;let t="";for(const i of e){if(Wl(t+i)>n)break;t+=i}return t}(i,t).replace(/[.\s]+$/,""),i||n}const ql=({children:e,height:n,replace:t,style:s,to:o,width:a,...r})=>{const d=new URL(o.toString(),location.origin),l={};n&&(l.height=vr(n)),a&&(l.width=vr(a));const c={alignItems:"inherit",color:"inherit",cursor:"pointer",display:"inherit",flexDirection:"inherit",flexWrap:"inherit",gap:"inherit",justifyContent:"inherit",textDecoration:"none",...l,...s};return d.origin!==location.origin||Ll.includes(d.pathname.split("/")[1])?(0,i.jsx)("a",{href:d.href,rel:"noreferrer",style:c,target:"_blank",...r,children:e}):(0,i.jsx)(Pr.N_,{replace:t,style:c,to:{pathname:g(F.HEAVENT_APPLICATION_BASENAME)?d.pathname.replace(new RegExp(`^/${F.HEAVENT_APPLICATION_BASENAME}`,"gm"),""):d.pathname,hash:d.hash,search:d.search},...r,children:e})};function Hl(e){return(0,Nl.A)(e)}ql.displayName="LinkWrapper";const Yl=e=>{const n=e.iconStyle??"regular",t={};e.primaryColor&&(t["--fa-primary-color"]=e.primaryColor),e.secondaryColor&&(t["--fa-secondary-color"]=e.secondaryColor,t["--fa-secondary-opacity"]="1");const s=()=>(0,i.jsx)("i",{"aria-hidden":e["aria-hidden"]??!0,className:`fa-${n} fa-${e.icon} ${e.className||""}`,role:e.role,style:{...t,cursor:e.title?"help":"inherit"},title:e.title,onClick:e.to?void 0:e.onClick});return e.to?(0,i.jsx)(ql,{target:e.target,to:e.to,onClick:e.onClick,children:s()}):s()};function Zl(e){throw new Error("Didn't expect to get here")}function Kl(){return{history:Bi(),params:Vi(),translate:Fi()}}const Xl=e=>(0,V.createElement)("svg",{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:"lds-rolling","data-testid":"loader",style:{background:"none"}},(0,V.createElement)("circle",{cx:"50",cy:"50",fill:"none",stroke:e.color,strokeWidth:e.strokeWidth,r:"16",strokeDasharray:"75.39822368615503 27.132741228718345",transform:"rotate(120 50 50)"},(0,V.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))),Ql=(0,V.memo)(function(){return(0,i.jsx)(Tl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Xl,{color:"#162131",height:"200px",strokeWidth:"2",width:"200px"})})}),Jl={alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",gap:"$2",padding:"$1 $4",userSelect:"none","& .loader":{borderRadius:"$1"},variants:{color:{primary:{background:"$primaryCustom500",border:"1px solid $primaryCustom500",color:"white","&:hover":{background:"$primaryCustom600",border:"1px solid $primaryCustom600"},"& .loader":{background:"$primaryCustom500",border:"1px solid $primaryCustom500"},"& .loader:hover":{background:"$primary600",border:"1px solid $primary600"}},gray:{background:"$gray100",border:"1px solid $gray100",color:"$gray800","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}},white:{background:"white",border:"1px solid $gray300",color:"$grayCustom700","&:hover":{background:"$grayCustom50",color:"$grayCustom800"},"& .loader":{background:"white",border:"1px solid $gray300"},"& .loader:hover":{background:"$gray50",color:"$gray800"}},error:{background:"$error600",border:"1px solid $error600",color:"white","&:hover":{background:"$error700",border:"1px solid $error600"},"& .loader":{background:"$error600",border:"1px solid $error600"},"& .loader:hover":{background:"$error700",border:"1px solid $error600"}},invisible:{background:"none",border:"none",color:"$primaryCustom500",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$primaryCustom600"},"& .h-button-content:has( + .loader)":{color:"transparent"}},"invisible-gray":{background:"none",border:"none",color:"$gray700",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$gray900"},"& .h-button-content:has( + .loader)":{color:"transparent"}}},disabled:{true:{cursor:"not-allowed"}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}},iconOnly:{true:{justifyContent:"center",px:"0"}}},compoundVariants:[{color:"primary",disabled:!0,css:{color:"$gray400",background:"$gray100",border:"1px solid $gray100","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}}},{color:"gray",disabled:!0,css:{background:"$gray50",border:"1px solid $gray50",color:"$gray400","&:hover":{background:"$gray50",border:"1px solid $gray50"},"& .loader":{background:"$gray50",border:"1px solid $gray50"},"& .loader:hover":{background:"$gray50",border:"1px solid $gray50"}}},{color:"transparent",disabled:!0,css:{color:"$gray400",background:"$primary100",border:"1px solid $primary100","&:hover":{color:"$gray400",background:"$primary100",border:"1px solid $primary100"},"& .loader":{background:"$primary100",border:"1px solid $primary100"},"& .loader:hover":{background:"$primary100",border:"1px solid $primary100"}}},{color:"invisible",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"invisible-gray",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"error",disabled:!0,css:{background:"$error200",border:"1px solid $error200","&:hover":{background:"$error200",border:"1px solid $error200"},"& .loader":{background:"$error200",border:"1px solid $error200"},"& .loader:hover":{background:"$error200",border:"1px solid $error200"}}},{size:"sm",iconOnly:!0,css:{width:"32px"}},{size:"md",iconOnly:!0,css:{width:"40px"}},{size:"lg",iconOnly:!0,css:{width:"44px"}},{size:"xl",iconOnly:!0,css:{width:"48px"}},{size:"2xl",iconOnly:!0,css:{width:"56px"}}],defaultVariants:{color:"primary",size:"md"}},ec=br("button",Jl),nc=br("div",Jl),tc=V.forwardRef(({children:e,className:n,color:t,css:s,disabled:o,featureFlags:a,isLoading:r,leftIcon:d,onClick:l,to:c,rightIcon:u,size:m,textAlign:g=(a?.isV4?"center":void 0),title:h,...p},I)=>{const x=!!d&&!e&&!u||!d&&!e&&!!u,f={className:`button ${n||""}`,color:t,css:{width:a?.isV4?"100%":void 0,...s,position:"relative"},disabled:o,iconOnly:x,size:m,title:h},_={children:e,color:t,leftIcon:d,isLoading:r,rightIcon:u,textAlign:g};return c&&!o?(0,i.jsx)(ql,{style:a?.isV4?{flex:"1"}:void 0,title:h,to:c,onClick:e=>{o||r||l&&l(e)},...p,children:(0,i.jsx)(nc,{...f,ref:I,children:(0,i.jsx)(ic,{..._})})}):(0,i.jsx)(ec,{...f,ref:I,type:"button",onClick:e=>{o||r||l&&l(e)},...p,children:(0,i.jsx)(ic,{..._})})});tc.displayName="Button",tc.toString=()=>".button";const ic=({children:e,color:n,isLoading:t,leftIcon:s,rightIcon:o,textAlign:a})=>(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsx)(Tl,{children:(0,i.jsx)(Yl,{icon:s})}),e&&(0,i.jsx)(Mr,{className:"h-button-content",css:{flex:"1"},textAlign:a,children:e}),o&&(0,i.jsx)(Tl,{children:(0,i.jsx)(Yl,{icon:o})}),t&&(0,i.jsx)(Tl,{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:n&&"primary"!==n&&"error"!==n?Ar.colors.gray800.value:"white",height:"40px",strokeWidth:"3",width:"40px"})})]}),sc=e=>{const n={iconStyle:"solid"};switch(e.iconStyle){case"error":return(0,i.jsx)(Yl,{className:"h-alert-icon",icon:"circle-exclamation",...n});case"warning":return(0,i.jsx)(Yl,{className:"h-alert-icon",icon:"triangle-exclamation",...n});case"success":return(0,i.jsx)(Yl,{className:"h-alert-icon",icon:"circle-check",...n});case"primary":case"gray":return(0,i.jsx)(Yl,{className:"h-alert-icon",icon:"circle-info",...n});default:Zl(e.iconStyle)}},oc=br(Tl,{borderRadius:"$1",alignItems:"flex-start",gap:"$2",padding:"$4","& i":{fontSize:"$textMd"},variants:{alertStyle:{error:{background:"$error50",border:"1px solid $error500",color:"$gray800","& i.h-alert-icon":{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning500",color:"$gray800","& i.h-alert-icon":{color:"$warning500"}},success:{background:"$success50",border:"1px solid $success500",color:"$gray800","& i.h-alert-icon":{color:"$success500"}},primary:{background:"$primary50",border:"1px solid $primary500",color:"$gray800","& i.h-alert-icon":{color:"$primary500"}},gray:{background:"$gray50",border:"1px solid $gray500",color:"$gray800","& i.h-alert-icon":{color:"$gray500"}}}},defaultVariants:{alertStyle:"error"}}),ac=br("p",{fontStyle:"normal",padding:"unset",margin:"unset",lineHeight:"1.42857143","& > *:not(ul)":{display:"inline"},variants:{textStyle:{inherit:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit"},heading:{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium",lineHeight:"1.55556"},smallcapsheading:{color:"$gray500",fontSize:"10px",lineHeigh:"24px",textTransform:"uppercase"},subheading:{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium",lineHeight:"1.5"},subtitle:{color:"$gray500",fontSize:"$textSm",fontWeight:"$regular",lineHeight:"1.42857"},bodyText:{color:"$gray800",fontSize:"$textSm"},abbreviation:{color:"$gray500",fontVariant:"small-caps",fontSize:"$textSm"}}},defaultVariants:{textStyle:"bodyText"}}),rc=V.forwardRef(({children:e,...n},t)=>(0,i.jsx)(ac,{ref:t,...n,children:e}));rc.displayName="Text";const dc=({min:e=2,max:n=6,textStyle:t="heading",children:s,...o})=>{n{const i=e?.parentElement;if(!i||t===n)return t;for(const e of Array(i.children))if(e[0]instanceof HTMLHeadingElement)return l(i,++t);return l(i,t)},[n]);return V.useEffect(()=>d(`h${l(a.current?.parentElement,e)}`),[e,n]),(0,i.jsx)(rc,{ref:a,as:r,...o,textStyle:t,children:s})},lc=e=>{const{translate:n}=Kl();return(0,i.jsxs)(oc,{alertStyle:e.alertStyle,"aria-live":e["aria-live"]??"polite",role:"alert",width:e.width,children:[(0,i.jsx)(Tl,{align:"start",children:(0,i.jsx)(Mr,{height:"20px",width:"20px",children:(0,i.jsx)(sc,{iconStyle:e.alertStyle})})}),(0,i.jsx)(Tl,{align:"start",css:{flex:"1",gap:"2px"},direction:"column",children:e.children}),e.onClose&&(0,i.jsx)(tc,{"aria-label":n("fermer_62479"),color:"invisible",css:{height:"20px",padding:0,width:"20px","& i":{color:"$gray500"}},textAlign:"center",onClick:e.onClose,children:(0,i.jsx)(Yl,{icon:"xmark"})})]})},cc=({children:e})=>(0,i.jsx)(dc,{css:{color:"$gray900",fontWeight:"$medium",fontSize:"$textSm",lineHeight:"1.42857"},children:e}),uc=({children:e})=>(0,i.jsx)(i.Fragment,{children:e}),mc=e=>(0,i.jsxs)(lc,{alertStyle:"error","aria-live":"assertive",children:[(0,i.jsx)(cc,{children:e.title}),(0,i.jsx)(uc,{children:e.children})]});function gc(e){return e?(0,wo.A)(Object.values(e).map(e=>"string"==typeof e?e:Array.isArray(e)?(0,kl.A)(e).map(e=>gc(e)).flat():gc(e)).flat()):[]}const hc=e=>{const{translate:n}=Kl(),{formRenderProps:{errors:t,submitErrors:s},showErrors:o}=(0,V.useContext)(Ml),a=gc((0,Fl.A)({},t,s));return o&&Yo(a)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mc,{title:n("form_has_errors_14074"),children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:a.map((e,n)=>(0,i.jsx)("li",{children:e},n))})}),!0!==e.hideSpacer&&(0,i.jsx)(Pl,{height:"6"})]}):null};function pc(e,n){Object.values(n.fields).forEach(e=>{e.data={...e.data,forceDisplayError:!0}})}const Ic=e=>{const n=V.useRef(null),{setShowErrors:t}=V.useContext(Ml),s=()=>{const n=e.formRenderProps.handleSubmit();return n?.catch(e=>{console.debug("Form submission failed:",e)}),n},o=i=>(i?.preventDefault?.(),e.formRenderProps.invalid?(t(!0),e.formRenderProps.form.mutators.forceErrors(),setTimeout(()=>{e.customErrorRef&&e.customErrorRef.current?(e.customErrorRef.current.scrollIntoView(),e.customErrorRef.current.scrollTop=0):!e.hideDefaultErrors&&n.current&&(n.current.scrollIntoView(),n.current.scrollTop=0)},100),!e.formRenderProps.hasValidationErrors&&e.formRenderProps.hasSubmitErrors?s():void 0):s());return(0,i.jsxs)(Tl,{ref:n,as:"form",onSubmit:o,...wl(e),children:[!e.hideDefaultErrors&&!e.customErrorRef&&(0,i.jsx)(hc,{}),(0,i.jsx)("input",{style:{display:"none"},type:"submit",value:"Submit"}),e.render({...e.formRenderProps,handleSubmit:o})]})},xc=e=>{const n=ki(Ol),[t,s]=V.useState(!1);return(0,i.jsx)(Dl.lV,{initialValues:e.initialValues,initialValuesEqual:e.initialValuesEqual??Yr.A,mutators:{...e.mutators,...Rl.A,forceErrors:pc},render:n=>(0,i.jsx)(Ml.Provider,{value:{formRenderProps:n,showErrors:t,setShowErrors:s},children:(0,i.jsx)(Ic,{...(0,Fr.A)(e,["direction","align","justify","wrap","gap","css","height","width"]),customErrorRef:e.customErrorRef,formRenderProps:n,hideDefaultErrors:e.hideDefaultErrors,render:e.render})}),validate:t=>e.schema?n.validateForForm(e.schema)(t):"function"==typeof e.validate?e.validate(t):{},onSubmit:async(n,t,i)=>{const o=await e.onSubmit(n,t,i);return Object.keys(o||{}).length>0&&s(!0),o}})};var fc=t(9008);function _c(e){return e.data?.forceDisplayError&&e.invalid||e.touched&&!e.pristine&&e.invalid||!1}const jc=(e,n=!0)=>{n&&e?.preventDefault(),e?.nativeEvent?.stopImmediatePropagation(),e?.stopPropagation()};var vc=t(5664);function Sc(){const[e]=(0,V.useState)(()=>(0,vc.A)("forminput-")),[n]=(0,V.useState)(()=>(0,vc.A)("forminputlabel-")),[t]=(0,V.useState)(()=>(0,vc.A)("forminputdesc-")),[i]=(0,V.useState)(()=>(0,vc.A)("forminputerror-"));return{inputId:e,labelId:n,descId:t,errorId:i}}const yc=({children:e,id:n})=>e?(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",id:n,children:e}):null,Cc=e=>e.children?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"error"===e.state?"error500":"gray500",fontSize:"textXs",id:e.id,role:"error"===e.state?"alert":void 0,children:e.children})]}):null,bc=({id:e,children:n,htmlFor:t,isClickable:s=!0})=>n?(0,i.jsx)("label",{htmlFor:t,id:e,style:{display:"block",cursor:"inherit",fontWeight:"$medium",marginBlockEnd:0},onClick:e=>{s||e.preventDefault()},children:(0,i.jsx)(Mr,{color:"gray700",fontWeight:"medium",children:n})}):null,Ac=br("div",{alignItems:"center",borderRadius:"$1",display:"flex",gap:"$space$2",padding:"0 $space$3",position:"relative",width:"100%","& input::placeholder":{color:"$gray500"},"&:focus-within":{border:"2px solid $primaryCustom500"},variants:{state:{active:{backgroundColor:"white",border:"1px solid $gray300",color:"$gray900"},disabled:{background:"$gray50",border:"1px solid $gray300",color:"$gray500"},error:{backgroundColor:"white",border:"1px solid $error500"},search:{backgroundColor:"$gray100",border:"1px solid $gray300",color:"$gray500"}},cursor:{default:{cursor:"default"},text:{cursor:"text"},pointer:{cursor:"pointer"}},height:{fixed:{height:"40px"},fluid:{minHeight:"40px"}}},defaultVariants:{state:"active",height:"fixed"}}),Ec=V.forwardRef(({height:e,cursor:n,css:t,icon:s,children:o,state:a,onClick:r,rightIcon:d,rightText:l,onRightIconClick:c,...u},m)=>(0,i.jsxs)(Ac,{ref:m,className:"h-styled-input-container",css:t,cursor:n,height:e,state:a,onClick:e=>{r?.(e)},...u,children:[s&&(0,i.jsx)(Tl,{css:{color:"$gray500"},role:"presentation",children:(0,i.jsx)(Yl,{icon:s})}),o,"error"===a&&(0,i.jsx)(Tl,{className:"styled-input-container-circle-exclamation",css:{color:"$error500"},children:(0,i.jsx)(Yl,{icon:"circle-exclamation"})}),d&&(0,i.jsx)(Tl,{css:{color:"$gray500",cursor:"function"==typeof c?"pointer":"inherit"},role:"presentation",onClick:e=>{c?.(e)},children:(0,i.jsx)(Yl,{icon:d})}),g(l)&&(0,i.jsx)(Mr,{css:{userSelect:"none"},font:"gray500 textSm regular",children:l})]}));Ec.displayName="StyledInputContainer";const wc=V.forwardRef(({autoComplete:e,isEmail:n,shouldParseAsInt:t,css:s,label:o,description:a,hint:r,onRightIconClick:d,state:l,type:c,onChange:u,rightIcon:m,rightText:h,icon:p,treatIntNaNAsNull:I,...x},f)=>{const _=V.useRef(),j=V.useRef(),v=f??j,{inputId:S,descId:y,errorId:C}=Sc();return(0,i.jsxs)(Tl,{ref:_,css:s,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:S,children:o}),(0,i.jsx)(yc,{id:y,children:a}),(o||a)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Ec,{cursor:"text",icon:p,rightIcon:m,rightText:h,state:l,onClick:()=>v.current?.focus(),onRightIconClick:e=>{jc(e),d?.(e)},children:(0,i.jsx)(Mr,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%","&:disabled":{color:"$gray500"}},"& input::placeholder":{color:"search"===l?"$gray400":"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"search"===l?"$gray400":"$gray500",opacity:1}},children:(0,i.jsx)("input",{ref:v,"aria-describedby":a?y:void 0,"aria-errormessage":"error"===l?C:void 0,"aria-invalid":"error"===l,autoComplete:e??"off",disabled:"disabled"===l,id:S,type:c??(n?"email":t?"number":"text"),onChange:e=>{if(n&&g(e.target.value))u(e.target.value.toLowerCase());else if(!0===t){const n=parseInt(e.target.value,10);isNaN(n)?u(I?null:0):u(n)}else u(e.target.value)},...x})})}),(0,i.jsx)(Cc,{id:C,state:l,children:r})]})});wc.displayName="TextInput";const $c=({autoComplete:e,hint:n,shouldParseAsInt:t,name:s,state:o,...a})=>{const r=(0,V.useCallback)(e=>{switch(e){case Ke.City:return"address-level1";case Ke.DateOfBirth:return"bday";case Ke.FirstName:return"given-name";case Ke.LastName:return"family-name";case Ke.PostalCode:return"postal-code";case Ke.Street:return"street-address";case Ke.Country:case Ke.Language:case Ke.Nationality:case Ke.Phone:case Ke.Picture:case Ke.Sex:default:return}},[]),d=(0,V.useMemo)(()=>s.startsWith("formRegister.userInfo.fields.")?r(s.split(".").pop())??e:e,[s,e,r]),l=(0,V.useCallback)(e=>{const s=_c(e.meta);return(0,i.jsx)(wc,{autoComplete:d,hint:s?e.meta.error||e.meta.submitError:n,shouldParseAsInt:t??!1,state:s?"error":o,value:e.input.value,onBlur:e.input.onBlur,onChange:n=>{e.input.onChange(n)},onFocus:e.input.onFocus,...a})},[n,t,o,d,a]);return(0,i.jsx)(Dl.D0,{name:s,parse:fc.A,render:l})},Tc={AUTH_EMAIL:"heavent-auth-email",BACKOFFICE_INVOICES_COLUMNS:"heavent-backoffice-invoices-columns",BACKOFFICE_COLUMNS:"heavent-backoffice-columns",BACKOFFICE_LIMIT:"heavent-backoffice-limit",BACKOFFICE_PREDICATES:"heavent-backoffice-predicates",BACKOFFICE_SEARCH:"heavent-backoffice-search",BACKOFFICE_SORT:"heavent-backoffice-sort",CURRENT_EVENT_ID:"heavent-current-event-id",CURRENT_EVENT_NAME:"heavent-current-event-name",CURRENT_ORGANIZATION_ID:"heavent-current-organization-id",DELEGATIONS_SPACE_TAB:"heavent-delegations-space-tab",EVENT_ID:"heavent-event-id",HIDE_HUBSPOT:"hide-hubspot",ORGANIZATION_ID:"heavent-organization-id",ACCREDITATIONS_IMPORT_FORMATS:"heavent-accreditations-import-formats",ACCREDITATIONS_IMPORT_MAPPINGS:"heavent-accreditations-import-mappings",ACCREDITATIONS_IMPORT_MODE:"heavent-accreditations-import-mode",ACCREDITATIONS_IMPORT_PRESETS:e=>`heavent-accreditations-import-presets-${e}`,ACCREDITATIONS_PROFILES_IMPORT_FORMATS:"heavent-accreditations-profiles-import-formats",ACCREDITATIONS_PROFILES_IMPORT_MAPPINGS:"heavent-accreditations-profiles-import-mappings",ACCREDITATIONS_PROFILES_IMPORT_MODE:"heavent-accreditations-profiles-import-mode",ACCREDITATIONS_PROFILES_IMPORT_PRESETS:e=>`heavent-accreditations-profiles-import-presets-${e}`,EVENTS_IMPORT_FORMATS:"heavent-events-import-formats",EVENTS_IMPORT_MAPPINGS:"heavent-events-import-mappings",EVENTS_IMPORT_MODE:"heavent-events-import-mode",EVENTS_IMPORT_PRESETS:e=>`heavent-events-import-presets-${e}`,POSITIONS_IMPORT_FORMATS:"heavent-positions-import-formats",POSITIONS_IMPORT_MAPPINGS:"heavent-positions-import-mappings",POSITIONS_IMPORT_MODE:"heavent-positions-import-mode",POSITIONS_IMPORT_PRESETS:e=>`heavent-positions-import-presets-${e}`,VOLUNTEERS_IMPORT_FORMATS:"heavent-volunteers-import-formats",VOLUNTEERS_IMPORT_MAPPINGS:"heavent-volunteers-import-mappings",VOLUNTEERS_IMPORT_MODE:"heavent-volunteers-import-mode",VOLUNTEERS_IMPORT_PRESETS:e=>`heavent-volunteers-import-presets-${e}`,DELEGATIONS_IMPORT_FORMATS:"heavent-delegations-import-formats",DELEGATIONS_IMPORT_MAPPINGS:"heavent-delegations-import-mappings",DELEGATIONS_IMPORT_PRESETS:e=>`heavent-delegations-import-presets-${e}`,DELEGATIONS_IMPORT_MODE:"heavent-delegations-import-mode",DELEGATION_MEMBERS_IMPORT_FORMATS:"heavent-delegation-members-import-formats",DELEGATION_MEMBERS_IMPORT_MAPPINGS:"heavent-delegation-members-import-mappings",DELEGATION_MEMBERS_IMPORT_PRESETS:e=>`heavent-delegation-members-import-presets-${e}`,DELEGATION_MEMBERS_IMPORT_MODE:"heavent-delegation-members-import-mode"};var zc=t(2664);let Oc=class{translationService;constructor(e){this.translationService=e}t(e,...n){return this.translationService.translate(e,...n)}};Oc=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Oc);let Rc=class extends Oc{translationService;constructor(e){super(e),this.translationService=e}oneOfMessage(e,n){return this.t("_1_doit_tre_70659",e,this.translationService.formatListValues(n.map(e=>this.t(e))))}};Rc=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Rc);function Dc(e){return"string"==typeof e&&e.length>=16}function Mc(e){return"string"==typeof e&&null!==e.match(/\d/)}function Pc(e){return"string"==typeof e&&null!==e.match(/[A-Z]/)&&null!==e.match(/[a-z]/)}function kc(e){return"string"==typeof e&&null!==e.match(/[^A-Za-z0-9]/)}let Fc=class extends Rc{constructor(e){super(e)}signInSchema(){return zc.Ik().shape({email:this.email()})}signInPasswordSchema(){return zc.Ik().shape({email:this.email(),password:this.password()})}codeSchema(){return zc.Ik().shape({code:this.code()})}emailSchema(){return zc.Ik().shape({email:this.email()})}emailConfirmSchema(){return zc.Ik().shape({email:this.email(),emailConfirm:this.emailConfirm()})}emailCodeSchema(){return zc.Ik().shape({email:this.email(),code:this.code()})}email(){return zc.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856"))}emailConfirm(){return zc.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 zc.Yj().required(this.t("le_code_est_req_77618")).length(6,this.t("le_code_doit_co_37160"))}password(){return zc.Yj().required(this.t("le_mot_de_passe_14773"))}passwordRules(){return zc.Yj().required(this.t("le_mot_de_passe_24842")).test("valid-password",this.t("le_mot_de_passe_24842"),function(){return Dc(this.parent.password)&&Mc(this.parent.password)&&Pc(this.parent.password)&&kc(this.parent.password)})}};Fc=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Fc);let Nc=class extends Fc{constructor(e){super(e)}step1Schema(){return zc.Ik().shape({email:this.email()})}step2Schema(){return zc.Ik().shape({email:this.email(),code:this.code()})}};Nc=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Nc);var Lc,Uc,Vc,Bc=t(2302);function Wc(){return Wc=Object.assign?Object.assign.bind():function(e){for(var n=1;n(0,i.jsxs)(Tl,{align:"center",css:{background:"#232935",overflowX:"hidden",overflowY:"auto"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{css:{marginBottom:"40px","@desktop":{marginBottom:"80px"},"& svg":{height:"100%"}},height:32,children:(0,i.jsx)(Gc,{})}),(0,i.jsxs)(Tl,{css:{width:"100%","@mobile":{px:"$4"},"@desktop":{width:"540px"}},direction:"column",children:[(0,i.jsx)(Tl,{css:{background:"white",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$7"},width:1,children:e.children}),(0,i.jsx)(Tl,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$7"},direction:"column",gap:"2",width:1,children:e.link})]}),(0,i.jsx)(Pl,{height:"7"})]}),Yc=e=>(0,i.jsx)(Tl,{align:"center",direction:{"@initial":"column","@desktop":"row"},gap:"1",justify:"center",width:1,children:e.children}),Zc=e=>{const n=Fi(),t=Bi(),s=Gi(),o=ki(Ol),a=ki(Nc),{mutate:r}=function(e={}){return Ui("mutation LoginCodeEmailCreate($loginCodeEmail: LoginCodesEmailInput!) {\n loginCodeEmailCreate(loginCodeEmail: $loginCodeEmail) {\n insertedAt\n }\n}\n",e)}(),[d,l]=(0,V.useState)(null),[c,u]=(0,V.useState)(0),[m,g]=(0,V.useState)(0),[h,p]=(0,V.useState)(!1),[I,x]=(0,V.useState)(Date.now());return(0,i.jsx)(Hc,{link:(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Mr,{color:"gray500",children:n("vous_n_avez_pas_69078")}),(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{t.push(yo.AUTH_SIGN_IN_EMAIL)},children:n("r_essayer_21582")})]}),children:(0,i.jsx)(xc,{direction:"column",initialValues:{email:s.getItem(Tc.AUTH_EMAIL)||"",code:""},render:({handleSubmit:t,submitting:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("se_connecter_av_59438")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("saisissez_votre_01613")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)($c,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451"),state:c>0||h?"disabled":"active"}),c>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{autoComplete:"one-time-code",inputMode:"numeric",label:n("code_20843"),name:"code",pattern:"\\d*",placeholder:n("code_20843"),state:h?"disabled":void 0})]}),(0,i.jsx)(Pl,{height:"6"}),h?(0,i.jsx)(tc,{textAlign:"center",onClick:e.onFailure,children:n("recommencer_14712")}):(0,i.jsx)(tc,{isLoading:s,textAlign:"center",onClick:t,children:n(0===c?"recevoir_le_cod_88633":"se_connecter_63820")})]}),validate:e=>0===c?o.validateForForm(a.step1Schema())(e):o.validateForForm(a.step2Schema())(e),width:1,onSubmit:async t=>{if(0!==c){const{user:i,callbacks:s}=d;return function({code:e,user:n,callbacks:t}){return new Promise((i,s)=>{n.sendCustomChallengeAnswer(e,{...t,onSuccess:(...e)=>{t.onSuccess(...e),i(e)},onFailure:e=>{t.onFailure(e),s({type:"FAILED",error:e})},customChallenge:(...e)=>{t.customChallenge&&t.customChallenge(...e),s({type:"RETRY"})}})}).then(([e])=>e.getIdToken().getJwtToken())}({code:t.code,user:i,callbacks:s}).then(e.onSuccess,e=>{if("RETRY"===e.type)return g(m+1),{code:n("le_code_n_est_p_95065",3-(m+1))};{let i;return function(e,n,t){!async function(e){await fetch(`${F.HEAVENT_API_URL}/log/report`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}({message:"Could not auth",errorMessage:e,email:n,location:location.href,diff:Math.round((Date.now()-t)/1e3),userAgent:navigator.userAgent})}(e.message,t.email,I),p(!0),i=Oo.dw.fromMillis(Date.now()-I).as("minutes")>3?n("le_code_a_expir_45975"):n("le_code_n_est_p_12317"),{FORM_ERROR:i}}})}{await r({loginCodeEmail:{email:t.email,source:mn.App}}),x(Date.now());const e=await async function(e,n,t){try{return await ee(e,n,t)}catch(i){if(i!==H)throw i;try{return await Q(e,W().toString()),await ee(e,n,t)}catch{throw new Error("Auth failure")}}}(t.email,Bc.A,Bc.A);l(e),u(1)}}})})},Kc=V.forwardRef(({css:e,hint:n,description:t,icon:s,state:o,onChange:a,label:r,onForgotPasswordClick:d,...l},c)=>{const u=Fi(),m=V.useRef(),[g,h]=V.useState("password"),{inputId:p,descId:I,errorId:x}=Sc();return(0,i.jsxs)(Tl,{ref:m,css:e,direction:"column",width:1,onClick:e=>{e.preventDefault(),m.current?.querySelector("input")?.focus()},children:[(0,i.jsxs)(Tl,{gap:"3",width:1,children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(bc,{htmlFor:p,children:r})}),"function"==typeof d&&(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{d?.()},children:u("mot_de_passe_ou_17690")})]}),(0,i.jsx)(yc,{id:I,children:t}),(r||t)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Ec,{cursor:"text",icon:s,rightIcon:"password"===g?"eye":"eye-slash",state:o,onRightIconClick:e=>{jc(e),h("password"===g?"text":"password")},children:(0,i.jsx)(Mr,{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":t?I:void 0,"aria-errormessage":"error"===o?x:void 0,"aria-invalid":"error"===o,disabled:"disabled"===o,id:p,type:g,onChange:e=>{a(e.target.value)},...l})})}),(0,i.jsx)(Cc,{id:x,state:o,children:n})]})});Kc.displayName="PasswordInput";const Xc=({name:e,autoComplete:n,hint:t,state:s,...o})=>(0,i.jsx)(Dl.D0,{name:e,render:a=>{const r=_c(a.meta);return(0,i.jsx)(Kc,{autoComplete:n??"current-password",hint:r?a.meta.error:t,name:e,state:r?"error":s,value:a.input.value,onBlur:a.input.onBlur,onChange:e=>{a.input.onChange(e)},onFocus:a.input.onFocus,...o})}});let Qc=class extends Fc{constructor(e){super(e)}step1Schema(){return zc.Ik().shape({email:this.email()})}step2Schema(){return zc.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};Qc=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Qc);const Jc=br("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"}}}}),eu=V.forwardRef((e,n)=>{const t={gridTemplate:e.gridtemplate,gridTemplateColumns:e.gridtemplatecolumns,gridTemplateRows:e.gridtemplaterows};return e.height&&(t.height=vr(e.height)),e.width&&(t.width=vr(e.width)),(0,i.jsx)(Jc,{role:"grid",...e,ref:n,css:{...t,...e.css}})});eu.displayName="Grid";const nu=e=>(0,i.jsxs)(Tl,{align:"center",gap:{"@initial":"2","@desktop":"1"},children:[(0,i.jsx)(Tl,{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)(Yl,{icon:"check"})}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:e.children})]}),tu=e=>{const n=Fi();return(0,i.jsxs)(eu,{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)(nu,{isValid:Dc(e.password),children:n("16_caract_res_m_52434")}),(0,i.jsx)(nu,{isValid:Mc(e.password),children:n("au_moins_un_chi_73862")}),(0,i.jsx)(nu,{isValid:Pc(e.password),children:n("au_moins_une_ma_58302")}),(0,i.jsx)(nu,{isValid:kc(e.password),children:n("au_moins_un_car_54396")})]})},iu=e=>{const n=Fi(),t=Bi(),s=Gi(),o=ki(Ol),a=ki(Qc),[r,d]=(0,V.useState)(0);return(0,i.jsx)(Hc,{link:(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Mr,{color:"gray500",children:n("vous_n_avez_pas_69078")}),(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{t.push(yo.AUTH_SIGN_IN_EMAIL)},children:n("r_essayer_21582")})]}),children:(0,i.jsx)(xc,{direction:"column",initialValues:{email:s.getItem(Tc.AUTH_EMAIL)||"",code:"",password:""},render:({handleSubmit:e,submitting:t,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("mot_de_passe_ou_17690")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("saisissez_votre_47959")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)($c,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451"),state:r>0?"disabled":"active"}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{autoComplete:"one-time-code",inputMode:"numeric",label:n("code_re_u_par_e_75150"),name:"code",pattern:"\\d*",placeholder:n("code_20843")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Xc,{autoComplete:"new-password",label:n("nouveau_mot_de_46347"),name:"password",placeholder:n("entrez_votre_mo_51874")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(tu,{password:s.password})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(tc,{isLoading:t,textAlign:"center",onClick:e,children:n(0===r?"recevoir_le_cod_88633":"r_initialiser_l_12900")})]}),validate:e=>0===r?o.validateForForm(a.step1Schema())(e):o.validateForForm(a.step2Schema())(e),width:1,onSubmit:async n=>{0===r?(await te(n.email),d(1)):e.onSuccess(await ie(n.email,n.code,n.password))}})})},su={Aso:{Aso:t(8301),HomeBackground:t(8144),Logo:t(0)},Blanks:{Accreditation:t(7008),Member:t(5594)},Maps:{GooglePlan:t(1416),GoogleSatellite:t(6954),IgnPlan:t(4025)},AvatarGroup:t(384),Background404:t(4236),FormPositionRanked:t(4628),FormPositionUnranked:t(1205),Google:t(1931),GoogleMaps:t(1446),Ign:t(9882),Login:t(2647),Login2x:t(2281),LogoWeezeventSquare:t(6041),NetflixWood:t(5095),UserProfile:t(8264),WeezConstruction:t(6400)},ou={Alert:t(2630),Check:t(3780),DnsBlank:t(1037),DnsWrongDomain:t(8184),Done:t(8652),Done2:t(3574),FileBlank:t(7619),FileCSV:t(9625),FileJPG:t(6751),FilePDF:t(9848),FilePNG:t(6959),FileZIP:t(539),RecrewteerMarker:t(8798),Sad:t(5376),WeezeventBlankHandGlobe:t(2599),WeezeventBlankMessages:t(6687),WeezeventBlankPerson:t(7648),WeezeventBlankSwissArmyKnife:t(4362)};var au=t(7480);const ru=[Hn.De,Hn.En,Hn.Es,Hn.Fr,Hn.Nl];function du(e){return e===Hn.En?"en-gb":e.toString().toLowerCase()}function lu(e){if(g(e)){const n=(0,au.A)(e.trim().substring(0,2));return ru.includes(n)?n:null}return null}function cu(e,n){return n.has("lang")?lu(n.get("lang"))||Hn.En:e||lu(navigator.language)||Hn.En}Hn.En.toLowerCase(),Hn.Fr.toLowerCase(),Hn.De.toLowerCase(),Hn.Es.toLowerCase(),Hn.Nl.toLowerCase();const uu=F.EMAIL_FROM_NAME,mu=(F.EMAIL_PICTURE_LINK,F.EMAIL_FROM);function gu(e){return e===Hn.Fr?`${F.HEAVENT_ASSETS_URL}/cgu/weezcrew-cgus-fr.pdf`:e===Hn.Nl?`https://${F.WEEZEVENT_DOMAIN}/nl/gebruiksvoorwaarden-diensten`:e===Hn.Es?`https://${F.WEEZEVENT_DOMAIN}/es/cgus`:`https://${F.WEEZEVENT_DOMAIN}/en-gb/terms-of-use`}const hu=e=>{const{translate:n,history:t}=Kl(),s=ki(Fc),o=ki(Ol),a=Gi(),r=gu(cu(null,new URL(location.href).searchParams));return(0,i.jsx)(Hc,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Mr,{color:"gray500",children:n("pas_encore_sur_13386")}),(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{t.push(yo.AUTH_SIGN_UP_CREDENTIALS)},children:n("ouvrez_un_compt_91337")})]}),(0,i.jsx)(Yc,{children:(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{window.open(r,"_blank")},children:n("conditions_g_n_34786")})})]}),children:(0,i.jsx)(xc,{direction:"column",initialValues:{email:"",password:""},render:({handleSubmit:e,submitting:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("ravi_de_vous_re_24368")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("identifiez_vous_57743")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)($c,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Xc,{label:n("mot_de_passe_41738"),name:"password",placeholder:n("entrez_votre_mo_51874"),onForgotPasswordClick:()=>{a.setItem(Tc.AUTH_EMAIL,o.email),t.push(yo.AUTH_FORGOT_PASSWORD)}}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(tc,{isLoading:s,textAlign:"center",onClick:e,children:n("se_connecter_63820")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",children:n("ou_67404")}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{a.setItem(Tc.AUTH_EMAIL,o.email),t.push(yo.AUTH_SIGN_IN_CODE)},children:[(0,i.jsx)(Mr,{color:"gray500",fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"envelope"})}),(0,i.jsx)(Mr,{color:"gray700",children:n("se_connecter_av_59438")})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=qc("Google")},children:[(0,i.jsx)(Mr,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:su.Google})}),(0,i.jsx)(Mr,{color:"gray700",children:n("se_connecter_av_86208")})]})]}),validate:e=>o.validateForForm(s.signInPasswordSchema())(e),width:1,onSubmit:async t=>{try{return e.onSuccess(await ne(t.email,t.password)),{}}catch(e){if("NotAuthorizedException"===e.code&&"Incorrect username or password."===e.message||"UserNotFoundException"===e.code&&"User does not exist."===e.message)return{email:n("adresse_e_mail_73393")};throw e}}})})};let pu=class extends Fc{constructor(e){super(e)}step1Schema(){return zc.Ik().shape({email:this.email(),password:this.passwordRules()})}step2Schema(){return zc.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};pu=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],pu);const Iu=e=>{const{history:n,translate:t}=Kl(),s=ki(Ol),o=ki(pu),[a,r]=(0,V.useState)(0),d=gu(cu(null,new URL(location.href).searchParams));return(0,i.jsx)(Hc,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Mr,{color:"gray500",children:t("vous_avez_d_j_26391")}),(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{n.push(yo.AUTH_SIGN_IN_EMAIL)},children:t("connectez_vous_14760")})]}),(0,i.jsx)(Yc,{children:(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{window.open(d,"_blank")},children:t("conditions_g_n_34786")})})]}),children:(0,i.jsx)(Dl.lV,{initialValues:{email:"",code:"",password:""},render:({handleSubmit:e,submitting:n,values:s})=>(0,i.jsxs)("form",{style:{width:"100%"},onSubmit:e,children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("cr_er_un_compte_71423")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:t("utilisez_recrew_64841")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)($c,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451"),state:a>0?"disabled":"active"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Xc,{label:t("nouveau_mot_de_46347"),name:"password",placeholder:t("entrez_votre_mo_51874"),state:a>0?"disabled":"active"}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(tu,{password:s.password}),a>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{autoComplete:"one-time-code",inputMode:"numeric",label:t("code_re_u_par_e_75150"),name:"code",pattern:"\\d*",placeholder:t("code_20843")})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(tc,{isLoading:n,textAlign:"center",onClick:e,children:t(0===a?"recevoir_le_cod_04513":"cr_er_mon_compt_84515")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",children:t("ou_67404")}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=qc("Google")},children:[(0,i.jsx)(Mr,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:su.Google})}),(0,i.jsx)(Mr,{color:"gray700",children:t("s_inscrire_avec_54027")})]})]}),validate:e=>0===a?s.validateForForm(o.step1Schema())(e):s.validateForForm(o.step2Schema())(e),onSubmit:async n=>{0===a?(await te(n.email),r(1)):e.onSuccess(await ie(n.email,n.code,n.password))}})})},xu=async e=>{await oa(Ia,{token:e}),window.location.href=yo.HOME},fu=e=>{e&&Ki("Auth failure",e),window.location.href=yo.AUTH_SIGN_IN},_u=()=>(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:yo.AUTH_FORGOT_PASSWORD,children:(0,i.jsx)(iu,{onSuccess:xu})}),(0,i.jsx)(kr.qh,{exact:!0,path:yo.AUTH_SIGN_IN_EMAIL,children:(0,i.jsx)(hu,{onSuccess:xu})}),(0,i.jsx)(kr.qh,{exact:!0,path:yo.AUTH_SIGN_IN_CODE,children:(0,i.jsx)(Zc,{onFailure:fu,onSuccess:xu})}),(0,i.jsx)(kr.qh,{exact:!0,path:yo.AUTH_SIGN_UP_CREDENTIALS,children:(0,i.jsx)(Iu,{onSuccess:xu})}),(0,i.jsx)(kr.qh,{exact:!0,path:yo.AUTH_SIGN_UP_CODE,children:(0,i.jsx)(qi,{path:yo.AUTH_SIGN_IN_EMAIL})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.AUTH_SIGN_IN_EMAIL})})]}),ju=e=>(V.useEffect(()=>{!e.loader&&e.onLoad&&e.onLoad()},[e.loader]),e.loader?e.loader:(0,i.jsx)(i.Fragment,{children:e.children||(0,i.jsx)("div",{})})),vu=()=>{const[,e]=location.search.substr(1).split("="),{data:n,loader:t}=Li("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)(ju,{loader:t,onLoad:()=>{!function(e){const n=new B.p4({IdToken:new B.Yw({IdToken:e.idToken}),RefreshToken:new B.c9({RefreshToken:e.refreshToken}),AccessToken:new B.pD({AccessToken:e.accessToken})}),t=e.email.trim().toLowerCase();new B.TU({Username:t,Pool:Z()}).setSignInUserSession(n)}(n.userTokens),window.location.href=yo.HOME}})},Su="www.partagetapassion.com",yu="registering.aso.fr",Cu="billets.onepiecemarket.fr",bu=new Map([[1792,"evenements.handicap-international.fr"],[858,Su],[1773,"communaute.rncb.fr"],[3306,"mariage.ravey.fr"],[3136,yu],[3469,Cu]]);function Au(e){(0,V.useEffect)(()=>{const n=document.title;return document.title=(t=location.host,`${g(i=e)?`${i} | `:""}${function(e){return e===Su?"Partage Ta Passion":e===Cu?"One Piece":e===yu?"A.S.O.":uu}(t)}`),()=>{document.title=n};var t,i},[e])}function Eu(e,n){const t=V.useCallback(e,n||[]);V.useEffect(()=>(document.addEventListener("click",t,!1),()=>{document.removeEventListener("click",t,!1)}),n||[])}function wu(e){const n=(0,V.useCallback)(n=>{"Esc"!==n.key&&"Escape"!==n.key||e()},[]);(0,V.useEffect)(()=>(document.addEventListener("keydown",n,!1),()=>{document.removeEventListener("keydown",n,!1)}),[])}const $u="h-dropdown-open";function Tu(e,n){e.dispatchEvent(new CustomEvent($u,{bubbles:!0,detail:{uuid:n??""}}))}const zu=V.createContext({}),Ou=e=>{const n=V.useRef(W()),[t,s]=V.useState(e.isOpen??!1),[o,a]=V.useState(null),[r,d]=V.useState(null),l=V.useCallback(t=>{e.disabled||(s(t),e.onStateChange&&e.onStateChange(t),!0===t&&o&&Tu(o,n.current))},[e.disabled,o,s,e.onStateChange]),c=V.useCallback(t=>{t.detail.uuid!==n.current&&!0!==e.doNotCloseOnOtherOpen&&l(!1)},[l]);return V.useEffect(()=>{e.isOpen!==t&&s(e.isOpen??!1)},[e.isOpen]),V.useEffect(()=>(document.addEventListener($u,c),()=>{document.removeEventListener($u,c)}),[c]),wu(()=>{l(!1)}),Eu(()=>{l(!1)}),(0,i.jsx)(zu.Provider,{value:{isOpen:t,referenceElement:o,popperElement:r,setIsOpen:l,setReferenceElement:a,setPopperElement:d},children:e.children})};function Ru(){return V.useContext(zu)}const Du=br("div",{alignItems:"center",display:"flex",fontSize:"$textSm",fontWeight:"$regular",minHeight:"40px",px:"$4",py:"$2",userSelect:"none",width:"100%",ellipsis:"",variants:{color:{default:{cursor:"pointer",color:"$gray700","&:hover":{background:"$primary50",color:"$primary500"}},disabled:{color:"$gray400",cursor:"not-allowed"},heading:{color:"$gray500",fontSize:"$textXs",fontWeight:"$semiBold",cursor:"default"},red:{cursor:"pointer",color:"$error700","&:hover":{background:"$error50"}}}},defaultVariants:{color:"default"}}),Mu=({children:e,color:n,css:t,download:s,to:o,onClick:a,target:r,role:d})=>"disabled"!==n&&o?(0,i.jsx)(ql,{download:s,target:r,to:o,onClick:e=>a?.(e),children:(0,i.jsx)(Du,{color:n||"default",css:t,children:e})}):(0,i.jsx)(Du,{color:n||"default",css:t,role:d??"menuitem",tabIndex:o?void 0:"presentation"!==d?0:void 0,onClick:e=>a?.(e),children:e}),Pu=({css:e,children:n,color:t,download:s,icon:o,isDisabled:a=!1,onClick:r,to:d,target:l})=>(0,i.jsx)(Mu,{color:t,css:{cursor:a?"not-allowed":"pointer",opacity:a?"0.6":"inherit",...e},download:s,target:l,to:d,onClick:e=>{a||(Tu(e.target),r?.(e))},children:(0,i.jsxs)(Tl,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Tl,{align:"center",height:1,justify:"start",width:16,children:(0,i.jsx)(Yl,{icon:o})}),(0,i.jsx)(Mr,{css:{flex:"1",ellipsis:""},children:n})]})});var ku=t(832);const Fu=e=>{const{isOpen:n,referenceElement:t,popperElement:s,setPopperElement:o}=Ru(),{styles:a,attributes:r,update:d}=(0,ku.E)(t,s,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,e.offset??8]}}]}),l="match"===e.width?`${t?.getBoundingClientRect().width??240}px`:"number"==typeof e.width?`${e.width}px`:"fit-content";V.useEffect(()=>{d?.()},[d,n,t]),V.useEffect(()=>{if(t){const e=new ResizeObserver(()=>{d?.()});return e.observe(t),()=>{e.disconnect()}}return Bc.A},[d,t]);const c=(0,i.jsx)(Tl,{ref:o,"aria-hidden":!n,"aria-orientation":e["aria-orientation"],css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$lg",display:n?"flex":"none",maxHeight:e.maxHeight?`${e.maxHeight}px`:void 0,overflowX:"hidden",overflowY:"auto",py:"$2",width:l,zIndex:"400",...e.css,...a.popper,"&:empty":{opacity:0}},direction:"column",id:e.id,role:"menu",onClick:e=>jc(e,!1),...r.popper,tabIndex:-1,children:e.children});return n?e.renderOnPortal?(0,St.createPortal)(c,document.body):c:null},Nu=e=>{const{isOpen:n,setIsOpen:t,setReferenceElement:s}=Ru(),o=e.children,a=e=>{jc(e),t(!n),o.props.onClick?.(e)},r=V.cloneElement(V.Children.only(o),{ref(e){s(e)},onClick(e){e.preventDefault(),a(e)},onKeyPress(e){a(e)},tabIndex:0});return(0,i.jsx)(i.Fragment,{children:r})};var Lu=t(5315);function Uu(e){try{if("#"!==e[0]||7!==e.length)return"black";{const n=parseInt(e.substring(1,3),16);return.299*n+.587*parseInt(e.substring(3,5),16)+.114*parseInt(e.substring(5),16)>150?"black":"white"}}catch{return"black"}}function Vu(e,n){const t="#"===e[0]?1:0;return`rgba(${parseInt(e.substring(0+t,2+t),16)}, ${parseInt(e.substring(2+t,4+t),16)}, ${parseInt(e.substring(4+t),16)}, ${n>1?n/100:n})`}const Bu=[0,50,100,200,300,400,500,600,700,800,900,950,1e3],Wu=Object.fromEntries(["gray","grayDark","primary","error","warning","success","blue","blueGray","blueLight","purple","purpleLight","purpleDark","pink","orange","redLight","redDark","green","greenDark","brown"].flatMap(e=>{const n={50:Ar.colors[`${e}50`].value,100:Ar.colors[`${e}100`].value,500:Ar.colors[`${e}500`].value,700:Ar.colors[`${e}700`].value};return[[e,n],[n[700],n]]}));function Gu(e,n=700){const t=Wu[e.toLowerCase()];if(t)return t;{const t=(0,Lu.KI)(e),i=((e,n=700)=>Bu.map(t=>{if(0===t)return{stop:t,tweak:100};if(1e3===t)return{stop:t,tweak:0};if(t===n)return{stop:t,tweak:e};{const i=Math.abs((t-n)/100),s=t[e,t.copy({l:n/100}).formatHex()]))}}const qu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Hu(e){return g(e)&&(function(e){return/^#(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/g.test(e)}(e)||function(e){return Object.keys(qu).includes(e)}(e))}function Yu(e,{higherIsBetter:n}={higherIsBetter:!0}){return e<=.2?n?Ar.colors.error500.value:Ar.colors.success500.value:e<=.7?Ar.colors.warning500.value:e<=1?n?Ar.colors.success500.value:Ar.colors.error500.value:Ar.colors.blueGray500.value}const Zu=br("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"}}),Ku=V.forwardRef((e,n)=>{const t=V.useMemo(()=>{const n=e.color||"gray",t=Gu(n);return"gray"===n?{background:"$gray100",color:"$gray700","& > .h-badge-left-icon":{color:"$gray500"},"& > .h-badge-count":{background:"$gray200"}}:"white"===n?{background:"white",border:"1px solid $gray300","& > .h-badge-count":{background:"$gray100"}}:"white-with-green-icon"===n?{background:"white",border:"1px solid $gray300","& > .h-badge-left-icon":{color:"$success500"}}:"orange"===n?{background:"$orange50",color:"$orange700","& > .h-badge-left-icon":{color:"$orange500"}}:{background:t[50],color:t[700],"& > .h-badge-left-icon":{color:t[500]},"& > .h-badge-count":{background:t[100]}}},[e.color]);return(0,i.jsxs)(Zu,{ref:n,color:e.color,css:{maxWidth:"100%",...t,...e.css},cursor:e.cursor,ellipsis:e.ellipsis,size:e.size,onClick:e.onClick,children:[e.leftIcon&&(0,i.jsx)(Tl,{className:"h-badge-left-icon",css:{cursor:e.onLeftIconClick?"pointer":"inherit"},onClick:n=>{e.onLeftIconClick?.(n)},children:(0,i.jsx)(Yl,{icon:e.leftIcon,iconStyle:e.leftIconStyle})}),e.children&&(0,i.jsx)(Mr,{className:"h-badge-content",css:{flex:"1",overflow:"hidden"},title:e.title,onClick:n=>{e.onContentClick?.(n)},children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:"string"==typeof e.children?e.children:"",children:e.children})}),e.rightIcon&&(0,i.jsx)(Tl,{css:{cursor:e.onRightIconClick?"pointer":"inherit"},onClick:n=>{e.onRightIconClick?.(n)},children:(0,i.jsx)(Yl,{icon:e.rightIcon})}),("number"==typeof e.count||g(e.count))&&(0,i.jsx)(Tl,{align:"center",className:"h-badge-count",children:e.count})]})});Ku.displayName="Badge";const Xu=zr({"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}),Qu=V.memo(function(e){const n="circular"===e.variant?e.size:e.height,t="circular"===e.variant?e.size:e.width;return(0,i.jsx)(Mr,{css:{animation:`${Xu} 1.5s ease-in-out 0.5s infinite`,background:"$gray200",borderRadius:"circular"===e.variant?"50%":e.borderRadius,color:"transparent",...e.css},height:n,width:t,children:e.children})});var Ju=t(7456),em=t(4757);const nm=e=>(0,i.jsx)(Tl,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary500",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:e.onClick,children:e.children});function tm(e,n){"production"!==r.Production&&console.warn(`Component ${e} is deprecated, use ${n} instead.`)}const im=br("div",{alignItems:"center",border:"1px solid $gray300",cursor:"pointer",display:"flex",fontSize:"10px",fontWeight:"$semiBold",justifyContent:"center","& > i":{fontSize:"10px",fontWeight:"$semiBold"},variants:{size:{sm:{borderRadius:"4px",height:"16px",width:"16px"},md:{borderRadius:"6px",height:"20px",width:"20px"}},state:{unchecked:{background:"white","&:hover":{border:"1px solid $primaryCustom600"}},checked:{background:"$primaryCustom600",border:"none",color:"white"},indeterminate:{background:"$primaryCustom600",border:"none",color:"white",padding:"$1","& > div":{borderTop:"2px solid white",width:"100%"}}},disabled:{true:{}}},compoundVariants:[{state:"unchecked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","&:hover":{borderColor:"$gray200"}}},{state:"checked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300"}},{state:"indeterminate",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300","& > div":{borderTopColor:"$gray300"}}}],defaultVariants:{size:"sm",state:"unchecked"}}),sm=({shouldPreventDefault:e=!0,...n})=>{tm("common-front/src/designSystem/components/checkbox.tsx","a new component following the pattern of common-front/src/designSystem/components/radioCard.tsx");const t=t=>{e&&jc(t),!0!==n.disabled&&("unchecked"!==n.state&&n.state?n.onClick("unchecked",t):n.onClick("checked",t))};return(0,i.jsxs)(im,{"aria-describedby":n.descId,"aria-labelledby":n.labelId,disabled:n.disabled,id:n.inputId,role:"checkbox",size:n.size,state:n.state,tabIndex:n.tabIndex??0,onClick:e=>t(e),onKeyDown:e=>{"Space"===e.code&&t(e)},onMouseDown:e=>{e.shiftKey&&jc(e)},children:["checked"===n.state&&(0,i.jsx)("i",{className:"far fa-check"}),"indeterminate"===n.state&&(0,i.jsx)("div",{})]})},om=({shouldPreventDefault:e=!0,...n})=>{tm("common-front/src/designSystem/components/checkbox.tsx","a new component following the pattern of common-front/src/designSystem/components/radioCard.tsx");const{descId:t,inputId:s,labelId:o}=Sc(),a=void 0!==n.subtext&&null!==n.subtext,r=t=>{e&&t.preventDefault(),!0!==n.disabled&&("unchecked"!==n.state&&n.state?n.onClick("unchecked",t):n.onClick("checked",t))};return(0,i.jsxs)(Tl,{css:{cursor:n.disabled?"not-allowed":"pointer",userSelect:"none",...n.css},tabIndex:0,onClick:r,onKeyDown:e=>{"Space"===e.code&&r(e)},children:[(0,i.jsx)(Tl,{css:{alignItems:"center",height:"md"===n.size?"23px":"20px"},children:(0,i.jsx)(sm,{descId:t,disabled:n.disabled,inputId:s,labelId:o,shouldPreventDefault:!1,size:n.size,state:n.state,tabIndex:-1,onClick:Bc.A})}),(0,i.jsx)(Pl,{width:"2"}),(0,i.jsxs)(Tl,{css:{flexDirection:"column",fontSize:"md"===n.size?"$3":"$2"},children:[(0,i.jsx)(bc,{htmlFor:s,id:o,children:(0,i.jsx)(Mr,{css:{color:n.disabled&&!a?"$gray300":"$gray800"},fontWeight:"medium",children:n.children})}),a&&(0,i.jsx)(Mr,{color:"gray500",id:t,children:n.subtext})]})]})},am=({children:e,index:n,state:t,onToggle:s,...o})=>(0,i.jsxs)(i.Fragment,{children:[0!==n&&(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{align:"center",css:s?{cursor:"pointer",userSelect:"none"}:void 0,gap:"2",width:1,onClick:s,children:[s&&(0,i.jsx)(sm,{shouldPreventDefault:!1,state:t??"unchecked",onClick:Bc.A}),(0,i.jsx)(Mr,{"aria-label":e?.toString(),css:{flex:"1"},font:"gray600 textXs semiBold",role:"group",...o,children:e})]}),(0,i.jsx)(Pl,{height:"2"})]});function rm(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(rm).join(""):(0,V.isValidElement)(e)?rm(e.props.children):""}const dm=br("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"}}),lm=({shouldPreventDefault:e=!0,...n})=>{tm("common-front/src/designSystem/components/radio.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button");const t=t=>{e&&jc(t),!0!==n.disabled&&("unchecked"!==n.state&&n.state?n.onClick("unchecked"):n.onClick("checked"))};return(0,i.jsx)(dm,{"aria-describedby":n.descId,"aria-labelledby":n.labelId,disabled:n.disabled,id:n.inputId,role:"radio",size:n.size,state:n.state,tabIndex:n.tabIndex??0,onClick:t,onKeyDown:e=>{"Space"===e.key&&t(e)},children:"checked"===n.state&&(0,i.jsx)("div",{})})},cm=({shouldPreventDefault:e=!0,...n})=>{tm("common-front/src/designSystem/components/radio.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button");const{inputId:t,descId:s,labelId:o}=Sc(),a="string"==typeof n.subtext&&n.subtext.length>0,r=t=>{e&&jc(t),!0!==n.disabled&&("unchecked"!==n.state&&n.state?n.onClick("unchecked"):n.onClick("checked"))};return(0,i.jsxs)(Tl,{css:{...n.css,cursor:n.disabled?"not-allowed":"pointer",userSelect:"none"},tabIndex:0,onClick:e=>{r(e)},onKeyDown:e=>{"Space"===e.key&&r(e)},children:[(0,i.jsx)(Tl,{css:{alignItems:"center",height:"md"===n.size?"23px":"20px"},children:(0,i.jsx)(lm,{descId:s,disabled:n.disabled,inputId:t,labelId:o,shouldPreventDefault:!1,size:n.size,state:n.state,tabIndex:-1,onClick:Bc.A})}),(0,i.jsx)(Pl,{width:"2"}),(0,i.jsxs)(Tl,{css:{flexDirection:"column",fontSize:"md"===n.size?"$3":"$2","& div":{cursor:"pointer !important"}},children:[(0,i.jsx)(bc,{htmlFor:t,id:o,children:(0,i.jsx)(Mr,{css:{color:n.disabled&&!a?"$gray300":"$gray800"},fontWeight:"medium",children:n.children})}),n.subtext&&(0,i.jsx)(Mr,{color:"gray500",id:s,children:n.subtext})]})]})},um=({badge:e,children:n,color:t,css:s,disabled:o,isCheckbox:a,isRadio:r,isSelected:d,onClick:l,subtext:c,value:u,...m})=>{const h=(0,V.useCallback)(()=>{o||l?.()},[o,l]),p=(0,V.useCallback)(e=>{"Enter"===e.key&&h?.()},[h]),I=(0,V.useMemo)(()=>rm(n),[n]);return(0,i.jsxs)(Tl,{align:"center","aria-checked":a?d:void 0,"aria-label":I,"aria-selected":d,css:{cursor:o?"default":"pointer",minHeight:"40px",padding:"$2 $3",userSelect:"none","&:hover":{background:"$gray100",borderRadius:"$1"},...s},gap:"3",role:"option",tabIndex:0,width:1,onClick:h,onKeyDown:p,...m,children:[a&&(0,i.jsx)(sm,{disabled:o,shouldPreventDefault:!1,state:d?"checked":"unchecked",onClick:Bc.A}),r&&(0,i.jsx)(lm,{shouldPreventDefault:!1,state:d?"checked":"unchecked",onClick:Bc.A}),(0,i.jsxs)(Tl,{align:"center",css:{flex:"1",overflow:"hidden"},gap:"2",children:[Hu(t)&&!e&&(0,i.jsx)(Mr,{css:{background:t,borderRadius:"16px",overflow:"hidden"},height:16,width:16}),Hu(t)&&e?(0,i.jsx)(Tl,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Ku,{color:t,children:n})}):(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",css:{ellipsis:!0},title:I,width:1,children:n}),g(c)&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),!a&&!r&&d&&(0,i.jsx)(Mr,{color:"primary500",children:(0,i.jsx)(Yl,{icon:"check"})})]})};var mm=t(7231);function gm(e,n){if(0===e.length)return"unchecked";{const t=(0,mm.A)(e,n).length;return 0===t?"unchecked":t>=e.length?"checked":"indeterminate"}}function hm(e,n,t){return"checked"===t?(0,em.A)(e,n):(0,wo.A)(e.concat(n))}function pm(e){return V.Children.toArray(e).map(n=>{if("optgroup"===n.type)return[{id:(0,vc.A)(),type:"group",text:n.props.label}].concat(pm(n.props.children));if("option"===n.type)return{id:(0,vc.A)(),type:"option",text:n.props.children,value:n.props.value,badge:!0===n.props["data-badge"]||"true"===n.props["data-badge"],color:n.props["data-color"],disabled:n.props.disabled,radio:n.props["data-radio"],selected:n.props.selected,style:n.props.style,subtext:n.props["data-subtext"]};if(n.type===Symbol.for("react.fragment"))return pm(n.props.children);throw Ki("Unexpected child type",n,e),new Error("Unexpected child type")}).flat()}function Im(e){return Object.fromEntries(e.filter(e=>"option"===e.type).map(e=>[e.value,e.text]))}var xm=t(9116),fm=t(6618);const _m=({children:e,createText:n,css:t,description:s,hint:o,icon:a,isCreateVisible:r,isSearchLoading:d,isSearchVisible:l,isSelectAllVisible:c,label:m,menuWidth:p,multiple:I,onChange:x,onClick:f,onCreateClick:_,placeholder:j,renderOnPortal:v,renderValue:S,searchElement:y,searchPlaceholder:C,state:b,triggerElem:A,values:E})=>{const{translate:w}=Kl(),$=(0,V.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[T,z]=(0,V.useState)(!1),[O,R]=(0,V.useState)(""),{inputId:D,descId:M}=Sc(),{displayedChildren:P,allValues:k,valuesByGroup:F,childrenByRadio:N,valueToName:L,valueToText:U}=function(e,n){const t=(0,V.useMemo)(()=>pm(e),[e]),i=(0,V.useMemo)(()=>{const e=u(n||"");return t.filter(n=>""===e||"group"===n.type||u(rm(n.text)).includes(e)).filter((e,n,t)=>{const i=t[n+1];return"option"===e.type||"option"===i?.type})},[t,n]),s=(0,V.useMemo)(()=>i.flatMap(e=>"option"===e.type?[e.value]:[]),[i]),o=(0,V.useMemo)(()=>{const e={};let n=null;for(const t of i)"group"===t.type?(n=t.id,e[n]=[]):n&&!t.disabled&&h(t.radio)&&e[n].push(t.value);return e},[i]),a=(0,V.useMemo)(()=>(0,xm.A)((0,fm.A)(i.filter(e=>"option"===e.type&&g(e.radio)),e=>e.radio),e=>e.map(e=>e.value)),[i]),r=(0,V.useMemo)(()=>Im(t),[t]),d=(0,V.useMemo)(()=>(0,xm.A)(r,rm),[r]);return{displayedChildren:i,allValues:s,valuesByGroup:o,childrenByRadio:a,valueToName:r,valueToText:d}}(e,O),B=gm(k,E),W=(0,V.useMemo)(()=>S?S(E[0],L[E[0]]):L[E[0]],[S,E,L]);return(0,V.useEffect)(()=>{T||R("")},[T]),(0,i.jsxs)(Tl,{css:t,direction:"column",width:1,children:[m&&(0,i.jsx)(bc,{htmlFor:D,children:m}),s&&(0,i.jsx)(yc,{id:M,children:s}),(m||s)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Ou,{disabled:"disabled"===b,isOpen:T,onStateChange:e=>z(e),children:[(0,i.jsx)(Nu,{children:A||(0,i.jsx)(Ec,{"aria-describedby":M,"aria-label":(m??j)+(U[E[0]]?` (currently: ${U[E[0]]})`:""),"aria-multiselectable":I,"aria-owns":P.map(e=>e.id).join(" "),"aria-placeholder":j,css:{maxHeight:"200px",overflowY:"auto",padding:"$2 $3",userSelect:"none",cursor:"disabled"===b?"not-allowed":void 0},cursor:"disabled"===b?"default":"pointer",height:"fluid",icon:a,id:D,rightIcon:T?"chevron-up":"chevron-down",role:"listbox",state:b,children:Yo(E)?I?(0,i.jsx)(Tl,{css:{flex:"1",overflowY:"auto"},gap:"2",height:1,role:"presentation",wrap:"wrap",children:E.map((e,n)=>(0,i.jsx)(Ku,{ellipsis:!0,rightIcon:"xmark",onRightIconClick:n=>{jc(n),x((0,Ju.A)(E,e))},children:L[e]},n))}):(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1",overflow:"hidden"},role:"presentation",children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:U[E[0]],children:W})}):(0,i.jsx)(Mr,{color:"gray500",css:{flex:"1"},role:"presentation",children:j})})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:v,width:p??"match",children:(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsxs)(Tl,{css:{padding:"$3"},direction:"column",width:1,children:[l&&(0,i.jsxs)(i.Fragment,{children:[y||(0,i.jsx)(wc,{ref:$,icon:"magnifying-glass",placeholder:C||w("rechercher_50038"),state:"search",value:O,onChange:R}),(0,i.jsx)(Pl,{height:"3"})]}),(0,i.jsx)(Mr,{css:{maxHeight:"250px",overflowY:"auto"},children:d?(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:40}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40})]}):P.map((e,n)=>{if("group"===e.type){const t=F[e.id]??[],s=!0===I&&Yo(t),o=gm(t,E);return(0,i.jsx)(am,{id:e.id,index:n,state:s?o:void 0,onToggle:s?()=>{x(hm(E,t,o))}:void 0,children:e.text},e.id)}{const t=e.value,s=e.selected??E.includes(t),o=e.radio,a=!0===I&&h(o),r=!0===I&&g(o);return(0,i.jsx)(um,{badge:e.badge,color:e.color,css:e.style,disabled:e.disabled,id:e.id,isCheckbox:a,isRadio:r,isSelected:s,subtext:e.subtext,value:e.value,onClick:()=>{if(f)f(t,s);else if(I&&a)x(s?(0,Ju.A)(E,t):E.concat(t));else if(I&&r){const e=(0,em.A)(E,N[o]).concat(s?[]:[t]);x(e)}else x(s?[]:[t]),z(!1)},children:e.text},n)}})})]}),r&&(0,i.jsxs)(nm,{onClick:()=>{_?.(),z(!1)},children:["+ ",n||w("cr_er_82895")]}),c&&(0,i.jsx)(nm,{onClick:()=>{x(hm(E,k,B))},children:w("checked"===B?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})})]}),(0,i.jsx)(Cc,{state:b,children:o})]})},jm=e=>(0,i.jsx)(Tl,{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}),vm=V.createContext({}),Sm=e=>{const[n,t]=V.useState(null);return(0,i.jsx)(vm.Provider,{value:{clickedRowIndex:n,setClickedRowIndex:t},children:e.children})},ym=({children:e,css:n,hideBorder:t,...s})=>(0,i.jsx)(Sm,{children:(0,i.jsx)(Tl,{className:!0===t?"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"},...n},direction:"column",...s,children:e})}),Cm="old",bm="new2025",Am=(0,V.createContext)({});function Em(){return(0,V.useContext)(Am)}function wm(e,n){return{flex:n?"1 1 0":e?"0 0 0":"1",minWidth:n?`${n}px`:e?`${e}px`:void 0}}const $m=V.forwardRef((e,n)=>(0,i.jsx)(Tl,{ref:n,align:"center",className:"table-cell",css:{...wm(e.width,e.minWidth),color:"$gray800",overflow:"hidden",px:"$3",...e.css},height:1,role:"gridcell",onClick:n=>{e.onClick&&e.onClick(n)},...(0,Fr.A)(e,["direction","align","justify","wrap","gap"]),children:e.children}));$m.displayName="Cell";const Tm=25,zm=[25,50,100];var Om=t(7773);function Rm(e){const n=window.matchMedia(e),[t,i]=(0,V.useState)(n.matches);return(0,V.useEffect)(()=>{const e=()=>i(n.matches);return n.addEventListener("change",e),()=>n.removeEventListener("change",e)},[t,e]),t}function Dm(){return Rm(yr.mobile)}const Mm=e=>(0,i.jsx)(tc,{color:"white",css:{background:e.active?"$gray100":"white",border:0,borderInlineStart:"1px solid $gray300",color:e.disabled?"$gray400":"$gray700",cursor:e.disabled?"not-allowed":e.cursor,fontWeight:"$medium",inlineSize:"40px",blockSize:"32px",alignItems:"center",justifyContent:"center",borderRadius:"unset"},disabled:e.disabled,textAlign:"center",onClick:()=>{e.onClick()},children:e.children}),Pm=e=>{const{translate:n}=Kl(),t=Dm(),s=e.limit??Tm,o=Ni(),a=e.offset/s,r=(0,Om.A)(Math.max(0,a-2),Math.min(e.numberOfPages,a+3)),d=0===a,l=a===e.numberOfPages-1,c=Math.min(e.totalCount,(a+1)*s);return(0,i.jsxs)($m,{css:{gap:"$6","@tablet":{justifyContent:"space-between"}},children:[(0,i.jsx)(Mr,{css:{order:1,display:t?"none":void 0},width:150,children:!t&&e.showLimits&&(0,i.jsxs)(Tl,{align:"center",css:{inlineSize:"fit-content",overflow:"hidden"},gap:"4",children:[(0,i.jsx)(Tl,{css:{border:"1px solid $gray300",inlineSize:"fit-content",overflow:"hidden",borderRadius:"$1","& > button:first-child":{borderInlineStart:"none"}},children:zm.map((n,t)=>(0,i.jsx)(Mm,{active:s===n,cursor:"pointer",disabled:!1,onClick:()=>{e.setLimit?.(n)},children:n},t))}),e.itemName&&(0,i.jsx)(rc,{css:{width:150},children:n("_1_per_page_06128",e.itemName)})]})}),!t&&(e.totalCount>s?(0,i.jsxs)(Tl,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:3,"& > button:first-child":{borderInlineStart:"none"}},children:[(0,i.jsx)(Mm,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(Yl,{icon:"arrow-left"})}),e.numberOfPages<=7?(0,Om.A)(0,e.numberOfPages).map(n=>(0,i.jsx)(Mm,{active:a===n,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(n*s),children:n+1},n)):(0,i.jsxs)(i.Fragment,{children:[!r.includes(0)&&(0,i.jsx)(Mm,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(0),children:"1"}),!r.includes(1)&&(0,i.jsx)(Mm,{active:!1,cursor:"default",disabled:!1,onClick:Bc.A,children:(0,i.jsx)(Yl,{icon:"ellipsis"})}),r.map(n=>(0,i.jsx)(Mm,{active:a===n,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(n*s),children:n+1},n)),!r.includes(e.numberOfPages-2)&&(0,i.jsx)(Mm,{active:!1,cursor:"default",disabled:!1,onClick:Bc.A,children:(0,i.jsx)(Yl,{icon:"ellipsis"})}),!r.includes(e.numberOfPages-1)&&(0,i.jsx)(Mm,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset((e.numberOfPages-1)*s),children:e.numberOfPages})]}),(0,i.jsx)(Mm,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(Yl,{icon:"arrow-right"})})]}):(0,i.jsx)(Mr,{css:{order:3}})),t&&(0,i.jsx)(Tl,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:1,inlineSize:"fit-content","& > button:first-child":{borderInlineStart:"none"}},children:(0,i.jsx)(Mm,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(Yl,{icon:"arrow-left"})})}),(0,i.jsx)(Mr,{css:{order:2,flex:"1","@tablet":{order:3,flex:"unset"}},textAlign:t?"center":"end",width:150,children:t?[...o(n("page_1_of_2_92409"),(0,i.jsx)("b",{children:a+1}),(0,i.jsx)("b",{children:e.numberOfPages}))]:[...o(n(e.itemName?"_1_of_2_3_03566":"x_to_y_of_x","{1}",e.totalCount,e.itemName),(0,i.jsxs)("b",{children:[a*s+1,"–",c]}))]}),t&&(0,i.jsx)(Tl,{css:{border:"1px solid $gray300",order:3,borderRadius:"$1",overflow:"hidden",inlineSize:"fit-content","& > button:first-child":{borderInlineStart:"none"}},children:(0,i.jsx)(Mm,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(Yl,{icon:"arrow-right"})})})]})},km=e=>{const{setClickedRowIndex:n}=V.useContext(vm);return(0,i.jsx)(Tl,{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:t=>{n?.(null),e.onMouseLeave?.(t)},children:e.children})},Fm=e=>(0,i.jsx)(km,{css:{borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",height:"56px",...e.css},children:e.children}),Nm=({css:e,filters:n,headerCells:t,limit:s,numberOfPages:o,offset:a,rows:r,setLimit:d,setOffset:l,showLimits:c=!1,showPagination:u=!0,title:m,totalCount:g})=>{const{designSystem:h}=Em(),p=(c||u)&&"number"==typeof o&&"number"==typeof a&&"function"==typeof l&&(g??0)>0;return(0,i.jsxs)(Mr,{css:{...e},children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $6"},gap:"3",children:[m&&(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1"},fontSize:h===bm?"textMd":"textLg",fontWeight:"medium",children:m}),n]}),(0,i.jsxs)(ym,{role:"grid",children:[(0,i.jsx)(jm,{css:{borderRadius:"0 !important",borderTop:"1px solid $gray200"},children:t}),r,p&&(0,i.jsx)(Fm,{children:(0,i.jsx)(Pm,{limit:s,numberOfPages:o,offset:a,setLimit:d,setOffset:l,showLimits:c,totalCount:g??0})})]})]})};var Lm=t(2499);function Um(){const e=Fi();return n=>(0,Lm.A)(n.map(n=>({value:n,translation:e(n)})),({translation:e})=>u(e)).map(({value:e,translation:n},t)=>(0,i.jsx)("option",{value:e,children:n},t))}var Vm=t(4741);function Bm(e,n=500){return(0,V.useCallback)((0,Vm.A)(e,n),[])}function Wm(e,n=500){const[t,i]=(0,V.useState)(e),[s,o]=(0,V.useState)(e),a=Bm(e=>{o(e)},n);return[t,s,e=>{i(e),a(e)}]}const Gm=e=>(0,i.jsx)(Tl,{align:"center",className:"table-header-cell",css:{...wm(e.width,e.minWidth),color:"$gray500",overflow:"hidden",px:"$3",...e.css},height:1,role:"columnheader",tabIndex:0,onClick:()=>{e.onClick?.()},...(0,Fr.A)(e,["aria-label","direction","align","justify","wrap","gap"]),children:e.children}),qm=e=>(0,i.jsx)(Tl,{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)(Qu,{borderRadius:"$1",height:1,width:1})}),Hm=["weezevent.com","weeztix.com","kaboodle.com"];function Ym(e){return Hm.includes(e.split("@")[1])}function Zm(e){return["benjamin.vuitton@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(e)}const Km=e=>(0,i.jsxs)(Ou,{isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Nu,{children:e.triggerElem||(0,i.jsx)(Tl,{align:"center",css:{cursor:"pointer"},height:20,justify:"center",width:20,children:(0,i.jsx)(Yl,{icon:"ellipsis-vertical"})})}),(0,i.jsx)(Fu,{placement:"bottom-end",children:e.children})]}),Xm=({css:e,children:n,hideIcon:t,to:s,...o})=>{const a=new URL(s.toString(),location.origin),r=t?void 0:["http:","https:"].includes(a.protocol)&&a.origin!==location.origin?"arrow-up-right-from-square":o.download?"arrow-down-to-bracket":void 0;return(0,i.jsx)(Tl,{align:"center",as:"span",css:{cursor:"pointer",fontWeight:"$medium","&:hover":{textDecoration:"underline"},...e},gap:"2",children:(0,i.jsxs)(ql,{to:a,...o,children:[n,r&&(0,i.jsx)(Mr,{as:"span",css:{marginInlineStart:"$1"},children:(0,i.jsx)(Yl,{icon:r})})]})})};Xm.displayName="LinkText";const Qm=({children:e,css:n,gap:t,justify:s,width:o})=>(0,i.jsx)($m,{width:o??100,children:(0,i.jsx)(Tl,{align:"center",className:"h-controls",css:{cursor:"pointer",display:"none",...n},gap:t??"6",height:1,justify:s,width:1,onClick:jc,children:e})});let Jm=class{translationService;constructor(e){this.translationService=e}now(){return Oo.c9.utc()}invalid(){return Oo.c9.invalid("Invalid")}toLocaleString(e,n){return e.toLocaleString(n,{locale:du(this.translationService.language)})}};function eg(e){return e.infos?.billingAddress?.company||""}function ng(e){return e.infos?.vatExonerated?e.amountCents:1.2*e.amountCents}function tg(e){switch(e){case ln.Refunded:return{color:"warning",leftIcon:"rotate-left"};case ln.Paid:return{color:"success",leftIcon:"check"};case ln.Overdue:return{color:"error",leftIcon:"alarm-clock"};case ln.Waiting:return{color:"error",leftIcon:"xmark"};case ln.WrittenOff:return{color:"gray",leftIcon:"ban"};default:return Zl()}}var ig;Jm=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Jm),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"}(ig||(ig={}));const sg=e=>{const n=Fi(),t=ki(Jm),{user:s}=Yi(),o=new Intl.NumberFormat(s?.language.toLowerCase()||"fr",{style:"currency",currency:e.invoice.currency}),a=(r=e.invoice).isWrittenOff?ln.WrittenOff:r.isRefunded?ln.Refunded:r.paidAt?ln.Paid:r.insertedAte.markAsPaid?.(),children:n("marqu_e_comme_p_72620")}),!e.invoice.isRefunded&&(0,i.jsx)(Pu,{icon:"rotate-left",onClick:()=>e.markAsRefunded?.(),children:n("marqu_e_comme_r_27551")}),!e.invoice.isWrittenOff&&(0,i.jsx)(Pu,{icon:"ban",onClick:()=>e.markAsWrittenOff?.(),children:n("marqu_e_comme_i_89016")})]})})]})},og=br("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}}),ag=br("div",{display:"flex",flexDirection:"column",overflow:"auto",width:"100%",variants:{mobile:{true:{flex:"1",px:"$4"},false:{px:"$8"}}}}),rg=br("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"}}}}),dg=({buttons:e,children:n,onClose:t,role:s,size:o})=>{const a=Dm();return wu(t),tm("../../../../../components/modals/__deprecated/modal/modal.tsx","../../../../../components/modals/base/modal.tsx"),(0,St.createPortal)((0,i.jsx)(Tl,{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:t,children:(0,i.jsxs)(og,{mobile:a,open:!0,role:s,size:o,onClick:e=>jc(e,!1),onMouseDown:e=>jc(e,!1),children:[(0,i.jsx)(ag,{mobile:a,children:n}),e&&(0,i.jsx)(rg,{mobile:a,children:e})]})}),document.body)};var lg=t(6666);const cg=e=>{const n=Fi(),{mutate:t,isLoading:s}=function(e={}){return Ui("mutation BackofficeInvoiceMarkAsPaid($invoiceId: InvoiceId!, $transactionId: String!) {\n backofficeInvoiceMarkAsPaid(invoiceId: $invoiceId, transactionId: $transactionId)\n}\n",e)}(),{data:o}=Li("query QontoTransactions {\n backoffice {\n qontoTransactions {\n id\n label\n amount\n }\n }\n}\n",{},[]),[a,r]=(0,V.useState)(null);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Mr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Yl,{icon:"file-invoice"})}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:n("marqu_e_une_fac_47139")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("s_lectionner_un_46296"),values:a?[a]:[],onChange:e=>{r((0,lg.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)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:!a,isLoading:s,onClick:async()=>{await t({invoiceId:e.invoiceId,transactionId:a}),e.reload()},children:n("marqu_e_comme_p_72620")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},ug=e=>{const{mutate:n}=function(e={}){return Ui("mutation BackofficeInvoiceMarkAsRefunded($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsRefunded(invoiceId: $invoiceId)\n}\n",e)}(),{mutate:t}=function(e={}){return Ui("mutation BackofficeInvoiceMarkAsWrittenOff($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsWrittenOff(invoiceId: $invoiceId)\n}\n",e)}(),[s,o]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sg,{invoice:e.invoice,isBackoffice:!0,markAsPaid:()=>o(!0),markAsRefunded:async()=>{await n({invoiceId:e.invoice.id}),e.reload()},markAsWrittenOff:async()=>{await t({invoiceId:e.invoice.id}),e.reload()},showColumn:e.showColumn}),s&&(0,i.jsx)(cg,{invoiceId:e.invoice.id,reload:e.reload,onClose:()=>o(!1)})]})},mg=()=>{const{history:e,translate:n}=Kl(),t=Gi(),s=Um(),{user:o}=Yi(),[a,r,d]=Wm(""),[l,c]=(0,V.useState)([]),[u,m]=(0,V.useState)(Tm),[h,p]=(0,V.useState)(0),{data:I,isLoading:x,reload:f}=Li("query BackofficeInvoices($name: String, $states: [InvoiceState!], $limit: Int, $offset: Int) {\n backoffice {\n invoices(name: $name, states: $states, limit: $limit, offset: $offset) {\n nodes {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n currency\n paidAt\n url\n organizationsNames\n dealId\n isRefunded\n isWrittenOff\n insertedAt\n infos\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{name:g(r)?r:void 0,states:Yo(l)?l:void 0,limit:u,offset:h},[]);const[_,j]=(0,V.useState)(()=>{const e=t.getItem(Tc.BACKOFFICE_INVOICES_COLUMNS);return e?JSON.parse(e):[]}),v=(0,V.useCallback)(e=>{j(e),t.setItem(Tc.BACKOFFICE_INVOICES_COLUMNS,JSON.stringify(e))},[j]),S=(0,V.useCallback)(async e=>{try{const n=new URLSearchParams;e?n.set("date",e):Yo(l)&&n.set("states",l.join(","));const t=await fetch(`${F.HEAVENT_API_URL}/invoice/all?${n}`,{method:"post",headers:{[U]:await X()||""}}),{link:i}=await t.json();window.open(i,"_blank")}catch{window.alert(n("impossible_d_ex_55872"))}},[l]),y=e=>_.includes(e);return(0,i.jsx)(Mr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Tl,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:n("factures_03552")}),(0,i.jsx)(Mr,{children:(0,i.jsxs)(_m,{isSelectAllVisible:!0,multiple:!0,placeholder:"Colonnes visibles",values:_,onChange:v,children:[(0,i.jsx)("option",{value:"organization",children:n("organisation_71863")}),(0,i.jsx)("option",{value:"customerName",children:n("nom_du_client_28343")}),(0,i.jsx)("option",{value:"date",children:n("Date")}),(0,i.jsx)("option",{value:"paidAt",children:n("pay_e_le_92377")}),(0,i.jsx)("option",{value:"amount",children:n("montant_55595")}),(0,i.jsx)("option",{value:"amountTTC",children:n("montant_ttc_86677")}),(0,i.jsx)("option",{value:"state",children:n("State")}),(0,i.jsx)("option",{value:"transactionId",children:n("id_de_la_transa_98869")})]})}),(0,i.jsx)(tc,{onClick:()=>{e.push(yo.HOME)},children:"Home"}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(Pu,{icon:"eye",onClick:()=>{e.push(yo.BACKOFFICE_ORGANIZATIONS)},children:n("voir_les_organi_78756")}),(0,i.jsx)(Pu,{icon:"file-export",onClick:()=>S(null),children:"Exporter les factures sĂ©lectionnĂ©es"}),(0,i.jsx)(Pu,{icon:"file-export",onClick:()=>S("this-month"),children:n("exporter_les_fa_11017")}),(0,i.jsx)(Pu,{icon:"file-export",onClick:()=>S("last-month"),children:n("exporter_les_fa_01571")}),(0,i.jsx)(Pu,{icon:"file-export",onClick:()=>S("all"),children:n("exporter_toutes_46318")})]})]})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Nm,{filters:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("id_ou_nom_25064"),value:a,onChange:e=>{d(e),p(0)}})}),(0,i.jsx)(Mr,{width:200,children:(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,values:l,onChange:c,children:s(Xt)})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("num_ro_de_factu_68150")}),y(ig.Organization)&&(0,i.jsx)(Gm,{children:n("organisation_71863")}),y(ig.CustomerName)&&(0,i.jsx)(Gm,{children:n("nom_du_client_28343")}),y(ig.Date)&&(0,i.jsx)(Gm,{children:n("Date")}),y(ig.PaidAt)&&(0,i.jsx)(Gm,{children:n("pay_e_le_92377")}),y(ig.Amount)&&(0,i.jsx)(Gm,{children:n("montant_55595")}),y(ig.AmountTTC)&&(0,i.jsx)(Gm,{children:n("montant_ttc_86677")}),y(ig.State)&&(0,i.jsx)(Gm,{children:n("State")}),y(ig.TransactionId)&&(0,i.jsx)(Gm,{children:n("id_de_la_transa_98869")}),Zm(o?.email||"")&&(0,i.jsx)(Gm,{width:100})]}),limit:u,numberOfPages:I.backoffice?.invoices.numberOfPages??0,offset:h,rows:x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:I.backoffice.invoices.nodes.map(e=>(0,i.jsx)(ug,{invoice:e,reload:f,showColumn:y},e.id))}),setLimit:m,setOffset:p,showLimits:!0,title:n("liste_des_factu_86735"),totalCount:I.backoffice?.invoices.totalCount??0})]})})};function gg(e){const[n,t]=(0,V.useState)(e),[i,s]=(0,V.useState)(!1),o=(0,V.useMemo)(()=>{const e=Object.values(n).filter(e=>!0!==e.disabled),t=e.filter(e=>"checked"===e.state),i=t.map(e=>e.id),s=(0,wo.A)(e.map(({state:e})=>e)),o=2===s.length?"indeterminate":"checked"===s[0]?"checked":"unchecked";return{numberOfSelected:t.length,selectAllState:o,selecteds:t,selectedsIds:i}},[n]),a=(0,V.useRef)(null),r=(0,V.useCallback)((e,n,i)=>{const o=a.current;t(t=>{const s=i&&o?function(e,n,t){const i=Object.keys(e),s=i.indexOf(n),o=i.indexOf(t);return-1===s||-1===o?[t]:i.slice(Math.min(s,o),Math.max(s,o)+1)}(t,o,e):[e];return{...t,...Object.fromEntries(s.filter(e=>!0!==t[e]?.disabled).map(e=>[e,{...t[e],state:n}]))}}),a.current=e,"unchecked"===n&&s(!1)},[t,s]),d=(0,V.useCallback)(e=>{a.current=null,t(Object.fromEntries(Object.entries(n).filter(([e,n])=>!0!==n.disabled).map(([n,t])=>[n,{...t,state:e}]))),"unchecked"===e&&s(!1)},[n,t,s]);return{getSelectedsInput:(0,V.useCallback)((e,n)=>i?{ids:null,predicatesGroups:e??null,scope:n??null}:{ids:o.selectedsIds,predicatesGroups:null,scope:null},[i,o]),isAllSelected:i,numberOfSelected:o.numberOfSelected,selectAllState:o.selectAllState,selecteds:o.selecteds,selectedsIds:o.selectedsIds,setIsAllSelected:s,setStates:t,states:n,toggleRow:r,toggleSelectAll:d}}const hg=(0,V.createContext)({});function pg(){return(0,V.useContext)(hg)}let Ig=class{countries;countriesCodes;phoneCodes;constructor(e){const n=e.translate.bind(e);this.countries=(0,Lm.A)([{phoneCode:"+93",code:"AF",name:n("afghanistan_59344"),nationality:n("afghan_10143"),emoji:"đŸ‡ŠđŸ‡«",language:["ps","ps-AR"],smsPrice:.27},{phoneCode:"+35818",code:"AX",name:n("_land_islands_92853"),nationality:n("_land_island_62794"),emoji:"đŸ‡ŠđŸ‡œ"},{phoneCode:"+355",code:"AL",name:n("albania_07621"),nationality:n("albanian_82021"),emoji:"đŸ‡ŠđŸ‡±",language:["sq","sq-AL"],smsPrice:.12},{phoneCode:"+213",code:"DZ",name:n("algeria_37723"),nationality:n("algerian_97855"),emoji:"đŸ‡©đŸ‡ż",language:"ar-DZ",smsPrice:.285},{phoneCode:"+1684",code:"AS",name:n("american_samoa_95023"),nationality:n("american_samoan_76272"),emoji:"🇩🇾"},{phoneCode:"+376",code:"AD",name:n("andorra_45150"),nationality:n("andorran_97838"),emoji:"đŸ‡ŠđŸ‡©",smsPrice:.52},{phoneCode:"+244",code:"AO",name:n("angola_15815"),nationality:n("angolan_91942"),emoji:"🇩🇮",smsPrice:.17},{phoneCode:"+1264",code:"AI",name:n("anguilla_53408"),nationality:n("anguillan_92612"),emoji:"🇩🇼"},{phoneCode:"+1268",code:"AG",name:n("antigua_and_bar_05164"),nationality:n("antiguan_or_bar_26833"),emoji:"🇩🇬"},{phoneCode:"+54",code:"AR",name:n("argentina_92219"),nationality:n("argentine_14780"),emoji:"đŸ‡ŠđŸ‡·",language:"es-AR",smsPrice:.11},{phoneCode:"+374",code:"AM",name:n("armenia_90330"),nationality:n("armenian_87788"),language:["hy","hy-AM"],emoji:"🇩đŸ‡Č"},{phoneCode:"+297",code:"AW",name:n("aruba_62942"),nationality:n("aruban_18515"),emoji:"đŸ‡ŠđŸ‡Œ",smsPrice:.33},{phoneCode:"+61",code:"AU",name:n("australia_84647"),nationality:n("australian_83553"),emoji:"🇩đŸ‡ș",language:"en-AU",smsPrice:.093},{phoneCode:"+43",code:"AT",name:n("austria_67457"),nationality:n("austrian_39761"),emoji:"🇩đŸ‡č",language:"de-AT",smsPrice:.066},{phoneCode:"+994",code:"AZ",name:n("azerbaijan_14476"),nationality:n("azerbaijani_az_92428"),emoji:"🇩🇿",language:"az-AZ",smsPrice:.39},{phoneCode:"+1242",code:"BS",name:n("bahamas_33701"),nationality:n("bahamian_86817"),emoji:"🇧🇾"},{phoneCode:"+973",code:"BH",name:n("bahrain_43417"),nationality:n("bahraini_76209"),emoji:"🇧🇭",language:"ar-BH",smsPrice:.12},{phoneCode:"+880",code:"BD",name:n("bangladesh_48531"),nationality:n("bangladeshi_66399"),emoji:"đŸ‡§đŸ‡©",smsPrice:.425},{phoneCode:"+1246",code:"BB",name:n("barbados_57235"),nationality:n("barbadian_02319"),emoji:"🇧🇧"},{phoneCode:"+375",code:"BY",name:n("belarus_97102"),nationality:n("belarusian_60742"),emoji:"đŸ‡§đŸ‡Ÿ",language:["be","be-BY"],smsPrice:.31},{phoneCode:"+32",code:"BE",name:n("belgium_21048"),nationality:n("belgian_00407"),emoji:"🇧đŸ‡Ș",language:["fr-BE","nl-BE"],smsPrice:.094},{phoneCode:"+501",code:"BZ",name:n("belize_94460"),nationality:n("belizean_90827"),emoji:"🇧🇿",language:"en-BZ",smsPrice:0},{phoneCode:"+229",code:"BJ",name:n("benin_88614"),nationality:n("beninese_benin_55987"),emoji:"🇧🇯",smsPrice:.04},{phoneCode:"+1441",code:"BM",name:n("bermuda_84448"),nationality:n("bermudian_berm_58878"),emoji:"🇧đŸ‡Č"},{phoneCode:"+975",code:"BT",name:n("bhutan_12608"),nationality:n("bhutanese_34101"),emoji:"🇧đŸ‡č",smsPrice:.39},{phoneCode:"+591",code:"BO",name:n("bolivia_plurin_43912"),nationality:n("bolivian_98429"),emoji:"🇧🇮",language:["es-BO","qu-BO"],smsPrice:.38},{phoneCode:"+5997",code:"BQ",name:n("bonaire_sint_e_69605"),nationality:n("bonaire_07340"),emoji:"đŸ‡§đŸ‡¶"},{phoneCode:"+387",code:"BA",name:n("bosnia_and_herz_91990"),nationality:n("bosnian_or_herz_88694"),emoji:"🇧🇩",language:["bs-BA","hr-BA","sr-BA"],smsPrice:.46},{phoneCode:"+267",code:"BW",name:n("botswana_49258"),nationality:n("motswana_botsw_32461"),emoji:"đŸ‡§đŸ‡Œ",smsPrice:.13},{phoneCode:"+55",code:"BR",name:n("brazil_03275"),nationality:n("brazilian_74116"),emoji:"đŸ‡§đŸ‡·",language:"pt-BR",smsPrice:.051},{phoneCode:"+246",code:"IO",name:n("british_indian_92949"),nationality:n("british_indian_08875"),emoji:"🇼🇮"},{phoneCode:"+673",code:"BN",name:n("brunei_darussal_84695"),nationality:n("bruneian_06218"),emoji:"🇧🇳",language:"ms-BN",smsPrice:.05},{phoneCode:"+359",code:"BG",name:n("bulgaria_97045"),nationality:n("bulgarian_79288"),emoji:"🇧🇬",language:["bg","bg-BG"],smsPrice:.16},{phoneCode:"+226",code:"BF",name:n("burkina_faso_55299"),nationality:n("burkinab_02690"),emoji:"đŸ‡§đŸ‡«",smsPrice:.032},{phoneCode:"+257",code:"BI",name:n("burundi_85561"),nationality:n("burundian_35605"),emoji:"🇧🇼",smsPrice:.05},{phoneCode:"+238",code:"CV",name:n("cabo_verde_28261"),nationality:n("cabo_verdean_88842"),emoji:"đŸ‡šđŸ‡»",smsPrice:.2},{phoneCode:"+855",code:"KH",name:n("cambodia_77971"),nationality:n("cambodian_19577"),emoji:"🇰🇭",smsPrice:.52},{phoneCode:"+237",code:"CM",name:n("cameroon_44200"),nationality:n("cameroonian_12953"),emoji:"🇹đŸ‡Č",smsPrice:.024},{phoneCode:"+1",code:"CA",name:n("canada_52584"),nationality:n("canadian_90836"),emoji:"🇹🇩",language:["en-CA","fr-CA"],smsPrice:.03},{phoneCode:"+1345",code:"KY",name:n("cayman_islands_80923"),nationality:n("caymanian_07521"),emoji:"đŸ‡°đŸ‡Ÿ"},{phoneCode:"+236",code:"CF",name:n("central_african_74182"),nationality:n("central_african_89873"),emoji:"đŸ‡šđŸ‡«",smsPrice:.053},{phoneCode:"+235",code:"TD",name:n("chad_58721"),nationality:n("chadian_55061"),emoji:"đŸ‡čđŸ‡©",smsPrice:.035},{phoneCode:"+56",code:"CL",name:n("chile_06923"),nationality:n("chilean_69498"),emoji:"đŸ‡šđŸ‡±",language:"es-CL",smsPrice:.13},{phoneCode:"+86",code:"CN",name:n("china_40708"),nationality:n("chinese_12117"),emoji:"🇹🇳",language:["zh","zh-CN"],smsPrice:.055},{phoneCode:"+6189164",code:"CX",name:n("christmas_islan_46649"),nationality:n("christmas_islan_46649"),emoji:"đŸ‡šđŸ‡œ"},{phoneCode:"+6189162",code:"CC",name:n("cocos_keeling_98180"),nationality:n("cocos_island_82627"),emoji:"🇹🇹"},{phoneCode:"+57",code:"CO",name:n("colombia_37632"),nationality:n("colombian_28222"),emoji:"🇹🇮",language:"es-CO",smsPrice:.033},{phoneCode:"+269",code:"KM",name:n("comoros_35439"),nationality:n("comoran_comori_49754"),emoji:"🇰đŸ‡Č",smsPrice:.42},{phoneCode:"+242",code:"CG",name:n("congo_republic_97304"),nationality:n("congolese_04965"),emoji:"🇹🇬",smsPrice:.045},{phoneCode:"+243",code:"CD",name:n("congo_democrat_80102"),nationality:n("congolese_04965"),emoji:"đŸ‡šđŸ‡©",smsPrice:.2},{phoneCode:"+682",code:"CK",name:n("cook_islands_51542"),nationality:n("cook_island_99158"),emoji:"🇹🇰",smsPrice:.12},{phoneCode:"+506",code:"CR",name:n("costa_rica_57058"),nationality:n("costa_rican_17127"),emoji:"đŸ‡šđŸ‡·",language:"es-CR",smsPrice:.061},{phoneCode:"+225",code:"CI",name:n("c_te_d_ivoire_55380"),nationality:n("ivorian_01729"),emoji:"🇹🇼",smsPrice:.055},{phoneCode:"+385",code:"HR",name:n("croatia_52101"),nationality:n("croatian_62900"),emoji:"đŸ‡­đŸ‡·",language:["hr","hr-HR"],smsPrice:.13},{phoneCode:"+53",code:"CU",name:n("cuba_11922"),nationality:n("cuban_00956"),emoji:"🇹đŸ‡ș",smsPrice:.08},{phoneCode:"+5999",code:"CW",name:n("cura_ao_46587"),nationality:n("cura_aoan_65055"),emoji:"đŸ‡šđŸ‡Œ"},{phoneCode:"+357",code:"CY",name:n("cyprus_86967"),nationality:n("cypriot_85282"),emoji:"đŸ‡šđŸ‡Ÿ",smsPrice:.083},{phoneCode:"+420",code:"CZ",name:n("czech_republic_57570"),nationality:n("czech_42120"),emoji:"🇹🇿",language:["cs","cs-CZ"],smsPrice:.08},{phoneCode:"+45",code:"DK",name:n("denmark_28356"),nationality:n("danish_44544"),emoji:"đŸ‡©đŸ‡°",language:["da","da-DK"],smsPrice:.06},{phoneCode:"+253",code:"DJ",name:n("djibouti_38156"),nationality:n("djiboutian_72034"),emoji:"đŸ‡©đŸ‡Ż",smsPrice:.12},{phoneCode:"+1767",code:"DM",name:n("dominica_13395"),nationality:n("dominican_54004"),emoji:"đŸ‡©đŸ‡Č"},{phoneCode:["+1809","+1829","+1849"],code:"DO",name:n("dominican_repub_08891"),nationality:n("dominican_54004"),emoji:"đŸ‡©đŸ‡Ž",language:"es-DO"},{phoneCode:"+593",code:"EC",name:n("ecuador_25933"),nationality:n("ecuadorian_50591"),emoji:"đŸ‡Ș🇹",language:["es-EC","qu-EC"],smsPrice:.48},{phoneCode:"+20",code:"EG",name:n("egypt_61058"),nationality:n("egyptian_75798"),emoji:"đŸ‡Ș🇬",language:"ar-EG",smsPrice:.45},{phoneCode:"+503",code:"SV",name:n("el_salvador_37036"),nationality:n("salvadoran_02475"),emoji:"đŸ‡žđŸ‡»",language:"es-SV",smsPrice:.34},{phoneCode:"+240",code:"GQ",name:n("equatorial_guin_39570"),nationality:n("equatorial_guin_44537"),emoji:"đŸ‡ŹđŸ‡¶",smsPrice:.21},{phoneCode:"+291",code:"ER",name:n("eritrea_67366"),nationality:n("eritrean_20355"),emoji:"đŸ‡ȘđŸ‡·",smsPrice:.045},{phoneCode:"+372",code:"EE",name:n("estonia_58256"),nationality:n("estonian_46354"),emoji:"đŸ‡ȘđŸ‡Ș",language:["et","et-EE"],smsPrice:.08},{phoneCode:"+251",code:"ET",name:n("ethiopia_72971"),nationality:n("ethiopian_03019"),emoji:"đŸ‡ȘđŸ‡č",smsPrice:.08},{phoneCode:"+500",code:"FK",name:n("falkland_island_59316"),nationality:n("falkland_island_15848"),emoji:"đŸ‡«đŸ‡°"},{phoneCode:"+298",code:"FO",name:n("faroe_islands_71549"),nationality:n("faroese_32806"),emoji:"đŸ‡«đŸ‡Ž",language:["fo","fo-FO"],smsPrice:.046},{phoneCode:"+679",code:"FJ",name:n("fiji_36369"),nationality:n("fijian_39649"),emoji:"đŸ‡«đŸ‡Ż",smsPrice:.21},{phoneCode:"+358",code:"FI",name:n("finland_07531"),nationality:n("finnish_24918"),emoji:"đŸ‡«đŸ‡ź",language:["fi","fi-FI","se-FI","sv-FI"],smsPrice:.083},{phoneCode:"+33",code:"FR",name:n("france_26614"),nationality:n("french_86034"),emoji:"đŸ‡«đŸ‡·",language:["fr","fr-FR"],smsPrice:.045},{phoneCode:"+594",code:"GF",name:n("french_guiana_80598"),nationality:n("french_guianese_02041"),emoji:"đŸ‡ŹđŸ‡«",smsPrice:.17},{phoneCode:"+689",code:"PF",name:n("french_polynesi_50842"),nationality:n("french_polynesi_47751"),emoji:"đŸ‡”đŸ‡«",smsPrice:.18},{phoneCode:"+241",code:"GA",name:n("gabon_58286"),nationality:n("gabonese_62984"),emoji:"🇬🇩",smsPrice:.045},{phoneCode:"+220",code:"GM",name:n("gambia_93575"),nationality:n("gambian_30767"),emoji:"🇬đŸ‡Č",smsPrice:.19},{phoneCode:"+995",code:"GE",name:n("georgia_93003"),nationality:n("georgian_79366"),emoji:"🇬đŸ‡Ș",language:["ka","ka-GE"]},{phoneCode:"+49",code:"DE",name:n("germany_31193"),nationality:n("german_36386"),emoji:"đŸ‡©đŸ‡Ș",language:["de","de-DE"],smsPrice:.089},{phoneCode:"+233",code:"GH",name:n("ghana_32464"),nationality:n("ghanaian_99745"),emoji:"🇬🇭",smsPrice:.033},{phoneCode:"+350",code:"GI",name:n("gibraltar_24360"),nationality:n("gibraltar_24360"),emoji:"🇬🇼",smsPrice:.076},{phoneCode:"+30",code:"GR",name:n("greece_28837"),nationality:n("greek_hellenic_39006"),emoji:"đŸ‡ŹđŸ‡·",language:["el","el-GR"],smsPrice:.061},{phoneCode:"+299",code:"GL",name:n("greenland_80916"),nationality:n("greenlandic_67508"),emoji:"đŸ‡ŹđŸ‡±",smsPrice:.036},{phoneCode:"+1473",code:"GD",name:n("grenada_04221"),nationality:n("grenadian_25686"),emoji:"đŸ‡ŹđŸ‡©"},{phoneCode:"+590",code:"GP",name:n("guadeloupe_95839"),nationality:n("guadeloupe_95839"),emoji:"đŸ‡ŹđŸ‡”"},{phoneCode:"+1671",code:"GU",name:n("guam_76384"),nationality:n("guamanian_guam_01132"),emoji:"🇬đŸ‡ș"},{phoneCode:"+502",code:"GT",name:n("guatemala_49597"),nationality:n("guatemalan_60946"),emoji:"🇬đŸ‡č",language:"es-GT",smsPrice:.3},{phoneCode:["+441481","+447781","+447839","+447911"],code:"GG",name:n("guernsey_87507"),nationality:n("channel_island_53762"),emoji:"🇬🇬"},{phoneCode:"+224",code:"GN",name:n("guinea_20770"),nationality:n("guinean_42564"),emoji:"🇬🇳",smsPrice:.056},{phoneCode:"+245",code:"GW",name:n("guinea_bissau_80728"),nationality:n("bissau_guinean_66742"),emoji:"đŸ‡ŹđŸ‡Œ",smsPrice:.09},{phoneCode:"+592",code:"GY",name:n("guyana_92443"),nationality:n("guyanese_56902"),emoji:"đŸ‡ŹđŸ‡Ÿ",smsPrice:.3},{phoneCode:"+509",code:"HT",name:n("haiti_99471"),nationality:n("haitian_50142"),emoji:"🇭đŸ‡č",smsPrice:.3},{phoneCode:"+379",code:"VA",name:n("vatican_city_st_63732"),nationality:n("vatican_36370"),emoji:"đŸ‡»đŸ‡Š"},{phoneCode:"+504",code:"HN",name:n("honduras_79402"),nationality:n("honduran_35392"),emoji:"🇭🇳",language:"es-HN",smsPrice:.267},{phoneCode:"+852",code:"HK",name:n("hong_kong_96239"),nationality:n("hong_kong_hong_64846"),emoji:"🇭🇰",language:"zh-HK",smsPrice:.079},{phoneCode:"+36",code:"HU",name:n("hungary_57981"),nationality:n("hungarian_magy_62212"),emoji:"🇭đŸ‡ș",language:["hu","hu-HU"],smsPrice:.106},{phoneCode:"+354",code:"IS",name:n("iceland_79438"),nationality:n("icelandic_17689"),emoji:"🇼🇾",language:["is","is-IS"],smsPrice:.085},{phoneCode:"+91",code:"IN",name:n("india_39466"),nationality:n("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:n("indonesia_65003"),nationality:n("indonesian_29723"),emoji:"đŸ‡źđŸ‡©",language:["id","id-ID"],smsPrice:.464},{phoneCode:"+98",code:"IR",name:n("iran_76293"),nationality:n("iranian_persia_76791"),emoji:"đŸ‡źđŸ‡·",language:["fa","fa-IR"],smsPrice:.38},{phoneCode:"+964",code:"IQ",name:n("iraq_82027"),nationality:n("iraqi_31025"),emoji:"đŸ‡źđŸ‡¶",language:"ar-IQ",smsPrice:.33},{phoneCode:"+353",code:"IE",name:n("ireland_62034"),nationality:n("irish_35774"),emoji:"🇼đŸ‡Ș",language:"en-IE",smsPrice:.065},{phoneCode:["+441624","+447524","+447624","+447924"],code:"IM",name:n("isle_of_man_64982"),nationality:n("manx_86314"),emoji:"🇼đŸ‡Č"},{phoneCode:"+972",code:"IL",name:n("israel_20033"),nationality:n("israeli_69936"),emoji:"đŸ‡źđŸ‡±",language:["he","he-IL"],smsPrice:.3},{phoneCode:"+39",code:"IT",name:n("italy_14828"),nationality:n("italian_56623"),emoji:"🇼đŸ‡č",language:["it","it-IT"],smsPrice:.038},{phoneCode:"+1876",code:"JM",name:n("jamaica_55090"),nationality:n("jamaican_58881"),emoji:"🇯đŸ‡Č",language:"en-JM"},{phoneCode:"+81",code:"JP",name:n("japan_61810"),nationality:n("japanese_82636"),emoji:"đŸ‡ŻđŸ‡”",language:["ja","ja-JP"],smsPrice:.08},{phoneCode:"+441534",code:"JE",name:n("jersey_78898"),nationality:n("channel_island_53762"),emoji:"🇯đŸ‡Ș"},{phoneCode:"+962",code:"JO",name:n("jordan_36280"),nationality:n("jordanian_41310"),emoji:"🇯🇮",language:"ar-JO",smsPrice:.39},{phoneCode:["+76","+77"],code:"KZ",name:n("kazakhstan_30541"),nationality:n("kazakhstani_ka_27277"),emoji:"🇰🇿",language:["kk","kk-KZ"]},{phoneCode:"+254",code:"KE",name:n("kenya_67944"),nationality:n("kenyan_92311"),emoji:"🇰đŸ‡Ș",language:["sw","sw-KE"],smsPrice:.3},{phoneCode:"+686",code:"KI",name:n("kiribati_25369"),nationality:n("i_kiribati_66745"),emoji:"🇰🇼",smsPrice:.036},{phoneCode:"+383",code:"XK",name:n("kosovo_44440"),nationality:n("kosovare_35920"),emoji:"đŸ‡œđŸ‡°",smsPrice:.12},{phoneCode:"+850",code:"KP",name:n("korea_democrat_48584"),nationality:n("north_korean_16553"),emoji:"đŸ‡°đŸ‡”",smsPrice:.045},{phoneCode:"+82",code:"KR",name:n("korea_republic_72269"),nationality:n("south_korean_89943"),emoji:"đŸ‡°đŸ‡·",language:["ko","ko-KR"],smsPrice:.029},{phoneCode:"+965",code:"KW",name:n("kuwait_22026"),nationality:n("kuwaiti_76148"),emoji:"đŸ‡°đŸ‡Œ",language:"ar-KW",smsPrice:.327},{phoneCode:"+996",code:"KG",name:n("kyrgyzstan_84406"),nationality:n("kyrgyzstani_ky_19120"),emoji:"🇰🇬",language:["ky","ky-KG"],smsPrice:.34},{phoneCode:"+856",code:"LA",name:n("lao_people_s_de_31069"),nationality:n("lao_laotian_28318"),emoji:"đŸ‡±đŸ‡Š",smsPrice:.273},{phoneCode:"+371",code:"LV",name:n("latvia_73526"),nationality:n("latvian_53651"),emoji:"đŸ‡±đŸ‡»",language:["lv","lv-LV"],smsPrice:.057},{phoneCode:"+961",code:"LB",name:n("lebanon_49493"),nationality:n("lebanese_43182"),emoji:"đŸ‡±đŸ‡§",language:"ar-LB",smsPrice:.32},{phoneCode:"+266",code:"LS",name:n("lesotho_91086"),nationality:n("basotho_52532"),emoji:"đŸ‡±đŸ‡ž",smsPrice:.35},{phoneCode:"+231",code:"LR",name:n("liberia_12077"),nationality:n("liberian_64388"),emoji:"đŸ‡±đŸ‡·",smsPrice:.3},{phoneCode:"+218",code:"LY",name:n("libya_26741"),nationality:n("libyan_35337"),emoji:"đŸ‡±đŸ‡Ÿ",language:"ar-LY",smsPrice:.38},{phoneCode:"+424",code:"LI",name:n("liechtenstein_56974"),nationality:n("liechtenstein_56974"),emoji:"đŸ‡±đŸ‡ź",language:"de-LI"},{phoneCode:"+370",code:"LT",name:n("lithuania_95793"),nationality:n("lithuanian_94145"),emoji:"đŸ‡±đŸ‡č",language:["lt","lt-LT"],smsPrice:.06},{phoneCode:"+352",code:"LU",name:n("luxembourg_15613"),nationality:n("luxembourg_lux_47318"),emoji:"đŸ‡±đŸ‡ș",language:["de-LU","fr-LU"],smsPrice:.1},{phoneCode:"+853",code:"MO",name:n("macao_74812"),nationality:n("macanese_chine_74224"),emoji:"đŸ‡Č🇮",language:"zh-MO",smsPrice:.038},{phoneCode:"+389",code:"MK",name:n("macedonia_the_19021"),nationality:n("macedonian_20446"),emoji:"đŸ‡Č🇰",language:["mk","mk-MK"],smsPrice:.095},{phoneCode:"+261",code:"MG",name:n("madagascar_57052"),nationality:n("malagasy_02353"),emoji:"đŸ‡Č🇬",smsPrice:.029},{phoneCode:"+265",code:"MW",name:n("malawi_27143"),nationality:n("malawian_10093"),emoji:"đŸ‡ČđŸ‡Œ",smsPrice:.3},{phoneCode:"+60",code:"MY",name:n("malaysia_54920"),nationality:n("malaysian_81474"),emoji:"đŸ‡ČđŸ‡Ÿ",language:["ms","ms-MY"],smsPrice:.29},{phoneCode:"+960",code:"MV",name:n("maldives_67432"),nationality:n("maldivian_67878"),emoji:"đŸ‡ČđŸ‡»",language:["dv","dv-MV"],smsPrice:.34},{phoneCode:"+223",code:"ML",name:n("mali_95091"),nationality:n("malian_malines_66005"),emoji:"đŸ‡ČđŸ‡±",smsPrice:.055},{phoneCode:"+356",code:"MT",name:n("malta_73993"),nationality:n("maltese_52729"),emoji:"đŸ‡ČđŸ‡č",language:["mt","mt-MT"],smsPrice:.08},{phoneCode:"+692",code:"MH",name:n("marshall_island_92726"),nationality:n("marshallese_30337"),emoji:"đŸ‡Č🇭",smsPrice:.045},{phoneCode:"+596",code:"MQ",name:n("martinique_79541"),nationality:n("martiniquais_m_01923"),emoji:"đŸ‡ČđŸ‡¶"},{phoneCode:"+222",code:"MR",name:n("mauritania_77906"),nationality:n("mauritanian_68205"),emoji:"đŸ‡ČđŸ‡·",smsPrice:.055},{phoneCode:"+230",code:"MU",name:n("mauritius_10801"),nationality:n("mauritian_09142"),emoji:"đŸ‡ČđŸ‡ș",smsPrice:.184},{phoneCode:["+262269","+262639"],code:"YT",name:n("mayotte_91167"),nationality:n("mahoran_45424"),emoji:"đŸ‡ŸđŸ‡č"},{phoneCode:"+52",code:"MX",name:n("mexico_21962"),nationality:n("mexican_80494"),emoji:"đŸ‡ČđŸ‡œ",language:"es-MX",smsPrice:.92},{phoneCode:"+691",code:"FM",name:n("micronesia_fed_39555"),nationality:n("micronesian_97912"),emoji:"đŸ‡«đŸ‡Č",smsPrice:.045},{phoneCode:"+373",code:"MD",name:n("moldova_republ_08796"),nationality:n("moldovan_76486"),emoji:"đŸ‡ČđŸ‡©"},{phoneCode:"+377",code:"MC",name:n("monaco_72117"),nationality:n("mon_gasque_mon_17281"),emoji:"đŸ‡Č🇹",language:"fr-MC",smsPrice:.1},{phoneCode:"+976",code:"MN",name:n("mongolia_36757"),nationality:n("mongolian_33711"),emoji:"đŸ‡Č🇳",language:["mn","mn-MN"],smsPrice:.33},{phoneCode:"+382",code:"ME",name:n("montenegro_78236"),nationality:n("montenegrin_68334"),emoji:"đŸ‡ČđŸ‡Ș",smsPrice:.15},{phoneCode:"+1664",code:"MS",name:n("montserrat_38432"),nationality:n("montserratian_13585"),emoji:"đŸ‡Č🇾"},{phoneCode:"+212",code:"MA",name:n("morocco_52420"),nationality:n("moroccan_14305"),emoji:"đŸ‡Č🇩",language:"ar-MA"},{phoneCode:"+258",code:"MZ",name:n("mozambique_60988"),nationality:n("mozambican_68300"),emoji:"đŸ‡Č🇿",smsPrice:.32},{phoneCode:"+95",code:"MM",name:n("myanmar_78678"),nationality:n("burmese_66869"),emoji:"đŸ‡ČđŸ‡Č",smsPrice:1.1},{phoneCode:"+264",code:"NA",name:n("namibia_19026"),nationality:n("namibian_01490"),emoji:"🇳🇩",smsPrice:.048},{phoneCode:"+674",code:"NR",name:n("nauru_16303"),nationality:n("nauruan_52578"),emoji:"đŸ‡łđŸ‡·",smsPrice:.21},{phoneCode:"+977",code:"NP",name:n("nepal_49088"),nationality:n("nepali_nepales_64761"),emoji:"đŸ‡łđŸ‡”",smsPrice:.35},{phoneCode:"+31",code:"NL",name:n("netherlands_38005"),nationality:n("dutch_netherla_42451"),emoji:"đŸ‡łđŸ‡±",language:["nl","nl-NL"],smsPrice:.095},{phoneCode:"+687",code:"NC",name:n("new_caledonia_14574"),nationality:n("new_caledonian_12113"),emoji:"🇳🇹",smsPrice:.1},{phoneCode:"+64",code:"NZ",name:n("new_zealand_61929"),nationality:n("new_zealander_71823"),emoji:"🇳🇿",language:["en-NZ","mi","mi-NZ"],smsPrice:.14},{phoneCode:"+505",code:"NI",name:n("nicaragua_14531"),nationality:n("nicaraguan_06649"),emoji:"🇳🇼",language:"es-NI",smsPrice:.17},{phoneCode:"+227",code:"NE",name:n("niger_59137"),nationality:n("nigerien_06144"),emoji:"🇳đŸ‡Ș",smsPrice:.067},{phoneCode:"+234",code:"NG",name:n("nigeria_77810"),nationality:n("nigerian_43407"),emoji:"🇳🇬",smsPrice:.47},{phoneCode:"+683",code:"NU",name:n("niue_97570"),nationality:n("niuean_70518"),emoji:"🇳đŸ‡ș",smsPrice:.045},{phoneCode:"+6723",code:"NF",name:n("norfolk_island_62377"),nationality:n("norfolk_island_62377"),emoji:"đŸ‡łđŸ‡«"},{phoneCode:"+1670",code:"MP",name:n("northern_marian_94262"),nationality:n("northern_marian_82360"),emoji:"đŸ‡ČđŸ‡”"},{phoneCode:"+47",code:"NO",name:n("norway_14236"),nationality:n("norwegian_50751"),emoji:"🇳🇮",language:["nb","nb-NO","nn-NO","se-NO"],smsPrice:.064},{phoneCode:"+968",code:"OM",name:n("oman_20900"),nationality:n("omani_15042"),emoji:"🇮đŸ‡Č",language:"ar-OM",smsPrice:.21},{phoneCode:"+92",code:"PK",name:n("pakistan_59697"),nationality:n("pakistani_12622"),emoji:"đŸ‡”đŸ‡°",language:["ur","ur-PK"],smsPrice:.5},{phoneCode:"+680",code:"PW",name:n("palau_46088"),nationality:n("palauan_73033"),emoji:"đŸ‡”đŸ‡Œ",smsPrice:.1},{phoneCode:"+970",code:"PS",name:n("palestine_stat_33253"),nationality:n("palestinian_06829"),emoji:"đŸ‡”đŸ‡ž",smsPrice:.35},{phoneCode:"+507",code:"PA",name:n("panama_16821"),nationality:n("panamanian_07882"),emoji:"đŸ‡”đŸ‡Š",language:"es-PA",smsPrice:.17},{phoneCode:"+675",code:"PG",name:n("papua_new_guine_56959"),nationality:n("papua_new_guine_50302"),emoji:"đŸ‡”đŸ‡Ź",smsPrice:.2},{phoneCode:"+595",code:"PY",name:n("paraguay_66859"),nationality:n("paraguayan_50310"),emoji:"đŸ‡”đŸ‡Ÿ",language:"es-PY",smsPrice:.124},{phoneCode:"+51",code:"PE",name:n("peru_23048"),nationality:n("peruvian_85045"),emoji:"đŸ‡”đŸ‡Ș",language:["es-PE","qu-PE"],smsPrice:.31},{phoneCode:"+63",code:"PH",name:n("philippines_65361"),nationality:n("philippine_fil_40400"),emoji:"đŸ‡”đŸ‡­",language:["en-PH","tl","tl-PH"],smsPrice:.243},{phoneCode:"+64",code:"PN",name:n("pitcairn_59104"),nationality:n("pitcairn_island_58961"),emoji:"đŸ‡”đŸ‡ł"},{phoneCode:"+48",code:"PL",name:n("poland_13527"),nationality:n("polish_26779"),emoji:"đŸ‡”đŸ‡±",language:["pl","pl-PL"],smsPrice:.036},{phoneCode:"+351",code:"PT",name:n("portugal_19698"),nationality:n("portuguese_08463"),emoji:"đŸ‡”đŸ‡č",language:["pt","pt-PT"],smsPrice:.025},{phoneCode:["+1787","+1939"],code:"PR",name:n("puerto_rico_88176"),nationality:n("puerto_rican_10401"),emoji:"đŸ‡”đŸ‡·",language:"es-PR"},{phoneCode:"+974",code:"QA",name:n("qatar_70548"),nationality:n("qatari_58016"),emoji:"đŸ‡¶đŸ‡Š",language:"ar-QA",smsPrice:.3},{phoneCode:"+262",code:"RE",name:n("r_union_34094"),nationality:n("r_unionese_r_u_86871"),emoji:"đŸ‡·đŸ‡Ș",smsPrice:.055},{phoneCode:"+40",code:"RO",name:n("romania_41618"),nationality:n("romanian_49647"),emoji:"đŸ‡·đŸ‡Ž",language:["ro","ro-RO"],smsPrice:.09},{phoneCode:"+7",code:"RU",name:n("russian_federat_68392"),nationality:n("russian_12506"),emoji:"đŸ‡·đŸ‡ș",language:["ru","ru-RU","tt","tt-RU"],smsPrice:2.63},{phoneCode:"+250",code:"RW",name:n("rwanda_84901"),nationality:n("rwandan_47719"),emoji:"đŸ‡·đŸ‡Œ",smsPrice:.1},{phoneCode:"+590",code:"BL",name:n("saint_barth_lem_80830"),nationality:n("barth_lemois_35003"),emoji:"đŸ‡§đŸ‡±",smsPrice:.09},{phoneCode:"+290",code:"SH",name:n("saint_helena_a_39384"),nationality:n("saint_helenian_19012"),emoji:"🇾🇭",smsPrice:.1},{phoneCode:"+1869",code:"KN",name:n("saint_kitts_and_74455"),nationality:n("kittitian_or_ne_99867"),emoji:"🇰🇳"},{phoneCode:"+1758",code:"LC",name:n("saint_lucia_60679"),nationality:n("saint_lucian_97267"),emoji:"đŸ‡±đŸ‡š"},{phoneCode:"+590",code:"MF",name:n("saint_martin_f_87295"),nationality:n("saint_martinois_75974"),emoji:"đŸ‡žđŸ‡œ"},{phoneCode:"+508",code:"PM",name:n("saint_pierre_an_55649"),nationality:n("saint_pierrais_60177"),emoji:"đŸ‡”đŸ‡Č",smsPrice:.13},{phoneCode:"+1784",code:"VC",name:n("saint_vincent_a_23833"),nationality:n("saint_vincentia_81882"),emoji:"đŸ‡»đŸ‡š"},{phoneCode:"+685",code:"WS",name:n("samoa_25648"),nationality:n("samoan_97653"),emoji:"đŸ‡ŒđŸ‡ž",smsPrice:.21},{phoneCode:"+378",code:"SM",name:n("san_marino_47437"),nationality:n("sammarinese_71553"),emoji:"🇾đŸ‡Č",smsPrice:.045},{phoneCode:"+239",code:"ST",name:n("sao_tome_and_pr_10491"),nationality:n("s_o_tom_an_21489"),emoji:"🇾đŸ‡č",smsPrice:.045},{phoneCode:"+966",code:"SA",name:n("saudi_arabia_06433"),nationality:n("saudi_saudi_ar_22967"),emoji:"🇾🇩",language:"ar-SA",smsPrice:.215},{phoneCode:"+221",code:"SN",name:n("senegal_38099"),nationality:n("senegalese_64680"),emoji:"🇾🇳",smsPrice:.034},{phoneCode:"+381",code:"RS",name:n("serbia_45061"),nationality:n("serbian_68735"),emoji:"đŸ‡·đŸ‡ž",smsPrice:.46},{phoneCode:"+248",code:"SC",name:n("seychelles_67712"),nationality:n("seychellois_69858"),emoji:"🇾🇹",smsPrice:.3},{phoneCode:"+232",code:"SL",name:n("sierra_leone_02995"),nationality:n("sierra_leonean_86179"),emoji:"đŸ‡žđŸ‡±",smsPrice:.4},{phoneCode:"+65",code:"SG",name:n("singapore_37928"),nationality:n("singaporean_41916"),emoji:"🇾🇬",language:"zh-SG",smsPrice:.064},{phoneCode:"+1721",code:"SX",name:n("sint_maarten_d_57391"),nationality:n("sint_maarten_82241"),emoji:"đŸ‡žđŸ‡œ"},{phoneCode:"+421",code:"SK",name:n("slovakia_10924"),nationality:n("slovak_69840"),emoji:"🇾🇰",language:["sk","sk-SK"],smsPrice:.068},{phoneCode:"+386",code:"SI",name:n("slovenia_75447"),nationality:n("slovenian_slov_38562"),emoji:"🇾🇼",language:["sl","sl-SI"],smsPrice:.18},{phoneCode:"+677",code:"SB",name:n("solomon_islands_05259"),nationality:n("solomon_island_59052"),emoji:"🇾🇧",smsPrice:.155},{phoneCode:"+252",code:"SO",name:n("somalia_56358"),nationality:n("somali_somalia_97997"),emoji:"🇾🇮",smsPrice:.35},{phoneCode:"+27",code:"ZA",name:n("south_africa_61184"),nationality:n("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:n("south_georgia_a_39555"),nationality:n("south_georgia_o_65055"),emoji:"🇬🇾",smsPrice:.12},{phoneCode:"+211",code:"SS",name:n("south_sudan_88232"),nationality:n("south_sudanese_69140"),emoji:"🇾🇾"},{phoneCode:"+34",code:"ES",name:n("spain_40048"),nationality:n("spanish_74199"),emoji:"đŸ‡Ș🇾",language:["ca","ca-ES","es","es-ES","eu-ES","gl-ES"],smsPrice:.044},{phoneCode:"+94",code:"LK",name:n("sri_lanka_51563"),nationality:n("sri_lankan_09436"),emoji:"đŸ‡±đŸ‡°",smsPrice:.4},{phoneCode:"+249",code:"SD",name:n("sudan_18427"),nationality:n("sudanese_42330"),emoji:"đŸ‡žđŸ‡©",smsPrice:.322},{phoneCode:"+597",code:"SR",name:n("suriname_78561"),nationality:n("surinamese_38193"),emoji:"đŸ‡žđŸ‡·",smsPrice:.3},{phoneCode:"+4779",code:"SJ",name:n("svalbard_and_ja_38511"),nationality:n("svalbard_26353"),emoji:"🇾🇯"},{phoneCode:"+268",code:"SZ",name:n("swaziland_91614"),nationality:n("swazi_88825"),emoji:"🇾🇿",smsPrice:.3},{phoneCode:"+46",code:"SE",name:n("sweden_85663"),nationality:n("swedish_90836"),emoji:"🇾đŸ‡Ș",language:["se-SE","sv","sv-SE"],smsPrice:.098},{phoneCode:"+41",code:"CH",name:n("switzerland_07889"),nationality:n("swiss_23240"),emoji:"🇹🇭",language:["de-CH","fr-CH","it-CH"],smsPrice:.098},{phoneCode:"+963",code:"SY",name:n("syrian_arab_rep_72539"),nationality:n("syrian_06992"),emoji:"đŸ‡žđŸ‡Ÿ",language:["ar-SY","syr","syr-SY"],smsPrice:.37},{phoneCode:"+886",code:"TW",name:n("taiwan_provinc_87264"),nationality:n("chinese_taiwan_24003"),emoji:"đŸ‡čđŸ‡Œ",language:"zh-TW",smsPrice:.105},{phoneCode:"+992",code:"TJ",name:n("tajikistan_97104"),nationality:n("tajikistani_21375"),emoji:"đŸ‡č🇯",smsPrice:.38},{phoneCode:"+255",code:"TZ",name:n("tanzania_unite_52757"),nationality:n("tanzanian_71935"),emoji:"đŸ‡č🇿",smsPrice:.38},{phoneCode:"+66",code:"TH",name:n("thailand_97396"),nationality:n("thai_51972"),emoji:"đŸ‡č🇭",language:["th","th-TH"],smsPrice:.066},{phoneCode:"+670",code:"TL",name:n("timor_leste_95604"),nationality:n("timorese_87542"),emoji:"đŸ‡čđŸ‡±",smsPrice:.22},{phoneCode:"+228",code:"TG",name:n("togo_60267"),nationality:n("togolese_55079"),emoji:"đŸ‡č🇬",smsPrice:.03},{phoneCode:"+690",code:"TK",name:n("tokelau_79536"),nationality:n("tokelauan_89444"),emoji:"đŸ‡č🇰",smsPrice:.045},{phoneCode:"+676",code:"TO",name:n("tonga_96982"),nationality:n("tongan_52630"),emoji:"đŸ‡č🇮",smsPrice:.2},{phoneCode:"+1868",code:"TT",name:n("trinidad_and_to_31939"),nationality:n("trinidadian_or_65515"),emoji:"đŸ‡čđŸ‡č",language:"en-TT"},{phoneCode:"+216",code:"TN",name:n("tunisia_36732"),nationality:n("tunisian_19451"),emoji:"đŸ‡č🇳",language:"ar-TN",smsPrice:.35},{phoneCode:"+90",code:"TR",name:n("turkey_65699"),nationality:n("turkish_85889"),emoji:"đŸ‡čđŸ‡·",language:["tr","tr-TR"],smsPrice:.033},{phoneCode:"+993",code:"TM",name:n("turkmenistan_86069"),nationality:n("turkmen_63945"),emoji:"đŸ‡čđŸ‡Č"},{phoneCode:"+1649",code:"TC",name:n("turks_and_caico_34033"),nationality:n("turks_and_caico_41685"),emoji:"đŸ‡č🇹"},{phoneCode:"+688",code:"TV",name:n("tuvalu_52410"),nationality:n("tuvaluan_49403"),emoji:"đŸ‡čđŸ‡»",smsPrice:.12},{phoneCode:"+256",code:"UG",name:n("uganda_42928"),nationality:n("ugandan_07085"),emoji:"đŸ‡ș🇬",smsPrice:.3},{phoneCode:"+380",code:"UA",name:n("ukraine_86632"),nationality:n("ukrainian_77624"),emoji:"đŸ‡ș🇩",language:["uk","uk-UA"],smsPrice:.26},{phoneCode:"+971",code:"AE",name:n("united_arab_emi_58689"),nationality:n("emirati_emiria_12413"),emoji:"🇩đŸ‡Ș",language:"ar-AE",smsPrice:.12},{phoneCode:"+44",code:"GB",name:n("united_kingdom_16783"),nationality:n("british_43680"),emoji:"🇬🇧",language:["cy","cy-GB","en","en-GB"],smsPrice:.078},{phoneCode:"+1",code:"US",name:n("united_states_o_43878"),nationality:n("american_36800"),emoji:"đŸ‡ș🇾",language:"en-US",smsPrice:.03},{phoneCode:"+598",code:"UY",name:n("uruguay_21979"),nationality:n("uruguayan_28212"),emoji:"đŸ‡șđŸ‡Ÿ",language:"es-UY",smsPrice:.1},{phoneCode:"+998",code:"UZ",name:n("uzbekistan_27729"),nationality:n("uzbekistani_uz_10593"),emoji:"đŸ‡ș🇿",language:["uz","uz-UZ"],smsPrice:.39},{phoneCode:"+678",code:"VU",name:n("vanuatu_82756"),nationality:n("ni_vanuatu_van_02924"),emoji:"đŸ‡»đŸ‡ș",smsPrice:.21},{phoneCode:"+58",code:"VE",name:n("venezuela_boli_00470"),nationality:n("venezuelan_52634"),emoji:"đŸ‡»đŸ‡Ș",language:"es-VE",smsPrice:.31},{phoneCode:"+84",code:"VN",name:n("vietnam_82968"),nationality:n("vietnamese_55360"),emoji:"đŸ‡»đŸ‡ł",language:["vi","vi-VN"],smsPrice:.27},{phoneCode:"+1284",code:"VG",name:n("virgin_islands_14222"),nationality:n("british_virgin_42963"),emoji:"đŸ‡»đŸ‡Ź"},{phoneCode:"+1340",code:"VI",name:n("virgin_islands_12516"),nationality:n("american_virgi_98088"),emoji:"đŸ‡»đŸ‡ź"},{phoneCode:"+681",code:"WF",name:n("wallis_and_futu_93206"),nationality:n("wallisian_or_fu_60327"),emoji:"đŸ‡ŒđŸ‡«",smsPrice:.09},{phoneCode:"+212",code:"EH",name:n("western_sahara_02173"),nationality:n("sahrawi_sahraw_96671"),emoji:"đŸ‡Ș🇭",smsPrice:.053},{phoneCode:"+967",code:"YE",name:n("yemen_76340"),nationality:n("yemeni_26632"),emoji:"đŸ‡ŸđŸ‡Ș",language:"ar-YE",smsPrice:.23},{phoneCode:"+260",code:"ZM",name:n("zambia_50513"),nationality:n("zambian_85114"),emoji:"🇿đŸ‡Č",smsPrice:.324},{phoneCode:"+263",code:"ZW",name:n("zimbabwe_70209"),nationality:n("zimbabwean_42291"),emoji:"đŸ‡żđŸ‡Œ",language:"en-ZW",smsPrice:.35}],({name:e})=>u(e)),this.countriesCodes=this.countries.map(({code:e})=>e),this.phoneCodes=this.countries.flatMap(({phoneCode:e})=>Ho(e))}countryCodeExists(e){return!!e&&void 0!==this.countries.find(n=>n.code===e)}getCountriesIdName(e){const n=this.getDefaultCountryValues(e).user.country;return(0,Lm.A)(this.countries.map(({code:e,name:n})=>({id:e,name:n})),({id:e,name:t})=>[e===n?1:2,u(t)])}getNationalitiesIdName(e){const n=this.getDefaultCountryValues(e).user.nationality;return(0,Lm.A)(this.countries.map(({code:e,nationality:n})=>({id:e,name:n})),({id:e,name:t})=>[e===n?1:2,u(t)])}getNationality(e){return this.countries.find(n=>n.code===e)?.nationality}getName(e){return this.countries.find(n=>n.code===e)?.name}getDefaultCountryValues(e){let n=this.countries.find(({code:n})=>n===e);if(!n){try{n=this.countries.find(e=>Ho(e.language||[]).map(e=>e.toLowerCase()).includes(navigator.language.toLowerCase()))}catch{}n||(n=this.countries.find(({code:e})=>"FR"===e))}const t=Ho(n.language||[]);return{user:{language:t.some(e=>e.toLowerCase().startsWith("fr"))?Hn.Fr:t.some(e=>e.toLowerCase().startsWith("es"))?Hn.Es:t.some(e=>e.toLowerCase().startsWith("de"))?Hn.De:t.some(e=>e.toLowerCase().startsWith("nl"))?Hn.Nl:Hn.En,country:n.code,nationality:n.code},phone:{country:n.code,code:Ho(n.phoneCode)[0]}}}getSmsPriceByPhone(e){return this.countries.find(n=>Ho(n.phoneCode).some(n=>e.startsWith(n)))?.smsPrice}};function xg(e){return function(e){return!!e&&!Array.isArray(e)}(e)?e:Array.isArray(e)&&e.length>0?{operator:Tn.And,groups:[{operator:Tn.And,predicates:e}]}:{operator:Tn.And,groups:[]}}function fg(){return{operator:Tn.And,groups:[]}}function _g(e,n,t){return{...e,groups:e.groups.map((e,i)=>i===n?t(e):e)}}function jg(e,n,t){const i=e.groups[n];return i&&1===i.predicates.length&&0===t?vg(e,n):_g(e,n,e=>({...e,predicates:e.predicates.filter((e,n)=>n!==t)}))}function vg(e,n){return{...e,groups:e.groups.filter((e,t)=>t!==n)}}Ig=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Ig);const Sg=["formsInsertedAt","campaignSentAt"];function yg(e){return Sg.includes(e)}function Cg(e){return yg(e.slug)?{...e,value:e.value2,value2:e.value3,value3:e.value}:e}function bg(e){return yg(e.slug)?{...e,value:e.value3,value2:e.value,value3:e.value2}:e}const Ag=[Qe.Date,Qe.Number,Qe.Text,Qe.Textarea],Eg=[Qe.Phone,Qe.Select,Qe.Text,Qe.Textarea];function wg(e,n){const t=new Map(n.map(e=>[e.slug,e]));return{operator:e.operator,groups:e.groups.map((e,n)=>({operator:e.operator,groupIndex:n,filtersPredicates:e.predicates.flatMap((e,i)=>{const s=t.get(e.slug);return s?[{filter:s,predicate:e,groupIndex:n,predicateIndex:i}]:[]})})).filter(e=>e.filtersPredicates.length>0)}}function $g(e){return e.groups.flatMap(e=>e.filtersPredicates)}function Tg(e,n){return Yo(e.values)?e.values.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:n(t)},e)):Yo(e.valuesGroups)?e.valuesGroups.map(({name:e,values:n},t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t)):[]}function zg(e,n){return u(e.name).includes(u(n))||(!("number"!=typeof(t=n)||!isFinite(t))||"string"==typeof t&&parseInt(t,10).toString(10)===t)&&e.id===parseInt(n,10);var t}let Og=class extends Oc{countriesService;dateTimeService;constructor(e,n,t){super(t),this.countriesService=e,this.dateTimeService=n}filterPredicateToText(e){const{filter:n}=e,t=e.predicate&&Cg(e.predicate);if(!t)return"";{const i=Oo.c9.isDateTime(t.value)?t.value:g(t.value)?Oo.c9.fromISO(t.value,{zone:"utc",setZone:!0}):Oo.c9.invalid("Not valid predicate.value"),s=!i.isValid||n.fieldType!==nn.DateTimeRange&&n.fieldType!==nn.Datetime?i.isValid&&n.fieldType===nn.Date?this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong):t.value:this.dateTimeService.toLocaleString(i,Uo.DateTime),o=Oo.c9.isDateTime(t.value2)?t.value2:g(t.value2)?Oo.c9.fromISO(t.value2,{zone:"utc",setZone:!0}):Oo.c9.invalid("Not valid predicate.value2"),a=!o.isValid||n.fieldType!==nn.DateTimeRange&&n.fieldType!==nn.Datetime?o.isValid&&n.fieldType===nn.Date?this.dateTimeService.toLocaleString(o,Uo.DateOnly.MonthLong):t.value2:this.dateTimeService.toLocaleString(o,Uo.DateTime),r=t.value3;switch(t.operator){case $n.Contains:return"condition"===n.slug?this.conditionFilterToString(e):"wishedPositions"===n.slug?this.t("mission_souhait_38008",a,this.valueToString(n,s)):"wishedPositionsCategories"===n.slug?this.t("cat_gorie_souha_24744",a,this.valueToString(n,s)):"isDelegationLeader"===n.slug?this.t("est_responsable_13012",this.valueToString(n,s)):this.t("_1_contient_2_40552",n.name,s);case $n.NotContains:return this.t("_1_ne_contient_14612",n.name,s);case $n.Is:if("isLeader"===n.slug)return this.t("est_responsable_19679");if("isPositionLeader"===n.slug)return this.t("est_responsable_27270");if("isPositionCategoryLeader"===n.slug)return this.t("est_responsable_72923");if("isDelegationLeader"===n.slug)return this.t("est_responsable_87662");if("privacy"===n.slug)return this.t("visibilit_est_12738");if("campaign"===n.slug)return this.campaignFilterToString(e);if("campaignReply"===n.slug)return this.campaignReplyFilterToString(e);if("condition"===n.slug)return this.t("champ_dont_un_a_44854");if("numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug)return this.t("_1_pour_la_jou_73174",n.name,this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong),a);if(n.fieldType===nn.Date)return this.t("_1_est_gal_43375",n.name,this.valueDateToString(t.valueDate));if(n.fieldType===nn.Datetime||n.fieldType===nn.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong):t.value;return this.t("_1_est_gal_43375",n.name,e)}return this.t("_1_est_gal_43375",n.name,this.valueToString(n,s));case $n.IsNot:if("isLeader"===n.slug)return this.t("n_est_pas_respo_55625");if("isPositionLeader"===n.slug)return this.t("n_est_pas_respo_35508");if("isPositionCategoryLeader"===n.slug)return this.t("n_est_pas_respo_07811");if("isDelegationLeader"===n.slug)return this.t("n_est_pas_respo_91275");if("privacy"===n.slug)return this.t("visibilit_est_55411");if("condition"===n.slug)return this.t("champ_d_pendant_33676");if("numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug)return this.t("_1_pour_la_jou_61197",n.name,this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong),a);if(n.fieldType===nn.Date)return this.t("_1_n_est_pas_38478",n.name,this.valueDateToString(t.valueDate));if(n.fieldType===nn.Datetime||n.fieldType===nn.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong):t.value;return this.t("_1_n_est_pas_38478",n.name,e)}return this.t("_1_n_est_pas_38478",n.name,this.valueToString(n,s));case $n.IsEmpty:return this.t("_1_est_vide_08225",n.name);case $n.IsNotEmpty:return this.t("_1_n_est_pas_v_31530",n.name);case $n.IsValid:return this.t("_1_est_valide_45209",n.name);case $n.IsNotValid:return this.t("_1_n_est_pas_v_05077",n.name);case $n.GreaterThan:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_91055",n.name,this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong),a):this.t("_1_est_plus_gr_93527",n.name,t.value);case $n.GreaterThanEqual:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_41388",n.name,this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong),a):this.t("_1_est_gal_ou_95771",n.name,t.value);case $n.LessThan:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_99548",n.name,this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong),a):this.t("_1_est_plus_pe_18306",n.name,t.value);case $n.LessThanEqual:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_37455",n.name,this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong),a):this.t("_1_est_gal_ou_39305",n.name,t.value);case $n.Overlaps:return this.t("_1_chevauche_45834",n.name,s,a);case $n.NotOverlaps:return this.t("_1_ne_chevauch_01846",n.name,s,a);case $n.Engulfs:return this.t("_1_engloutis_32228",n.name,s,a);case $n.NotEngulfs:return this.t("_1_n_engloutis_52951",n.name,s,a);case $n.EngulfedBy:return this.t("_1_est_englout_36064",n.name,s,a);case $n.NotEngulfedBy:return this.t("_1_n_est_pas_e_89161",n.name,s,a);case $n.IsBefore:return this.t("_1_est_avant_l_83271",n.name,s);case $n.IsAfter:return this.t("_1_est_apr_s_l_63712",n.name,s);case $n.Between:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_66546",n.name,this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong),a,r):this.t("_1_est_entre_39871",n.name,s,a);case $n.StartsWith:return this.t("_1_commence_pa_47720",n.name,s);case $n.EndsWith:return this.t("_1_finit_par_65840",n.name,s);case $n.ThisDayMonth:return this.t("_1_est_aujourd_09227",n.name);case $n.Today:return this.t("_1_est_aujourd_42954",n.name);case $n.IsInLast:return this.t("_1_est_dans_le_96995",n.name,s);case $n.IsMoreThanAgo:return this.t("_1_est_il_y_a_01320",n.name,s);case $n.IsInNext:return this.t("_1_est_dans_le_19106",n.name,s);case $n.IsMoreThanAhead:return this.t("_1_est_dans_pl_88491",n.name,s);default:return Zl(t.operator)}}}getValues(e){return e.fieldType===Qe.Sex?pi.map(e=>({id:e,name:this.t(e)})):e.fieldType===Qe.Language?e.fieldProperty===Ke.Language?ru.map(e=>({id:e,name:this.t(e)})):Qt.map(e=>({id:e,name:this.t(e)})):e.fieldType===Qe.Nationality?this.countriesService.getNationalitiesIdName():e.fieldType===Qe.Country?this.countriesService.getCountriesIdName():e.fieldType===Qe.Select&&Yo(e.values)?e.values.map(({id:e,value:n})=>({id:e,name:n})):[]}valueToString(e,n){const t=function(e){return Yo(e.values)?e.values:Yo(e.valuesGroups)?e.valuesGroups.flatMap(e=>e.values):[]}(e);return Yo(t)?Ho(n).map(e=>this.t(t.find(({id:n})=>n===e)?.name??e)).join(` ${this.t("ou_67404")} `):this.t(n)}valueDateToString(e){const n=[];return"number"==typeof e?.day&&-1!==e.day&&n.push(e.day),"number"==typeof e?.month&&-1!==e.month&&n.push(this.dateTimeService.toLocaleString(Oo.c9.now().set({month:e.month}),{month:"long"})),"number"==typeof e?.year&&-1!==e.year&&n.push(e.year),n.join(" ")}conditionFilterToString(e){if(e.predicate){const n=e.predicate.value.map(n=>e.filter.values?.find(e=>e.id===n)?.name??"");return 1===n.length?this.t("d_pend_du_champ_43516",n[0]):this.t("d_pend_des_cham_85348",n.join(", "))}return""}campaignFilterToString(e){if(e.predicate){const n=e.predicate.value.map(n=>e.filter.campaigns?.find(e=>e.id===n)?.name??"").join(", "),t=e.predicate.value2.map(e=>this.t(e)).join(", ");return this.t("a_re_u_un_messa_76546",n,t)}return""}campaignReplyFilterToString(e){if(e.predicate){const n=e.predicate.value.map(n=>e.filter.campaigns?.find(e=>e.id===n)?.name??"").join(", ");return this.t("la_r_ponse_des_14160",n,e.predicate.value2)}return""}customFieldsToFilters(e){return e.filter(({fieldType:e})=>[nn.Address,nn.Checkbox,nn.Country,nn.Date,nn.Datetime,nn.File,nn.Language,nn.Nationality,nn.Number,nn.Phone,nn.Select,nn.Sex,nn.Text,nn.Textarea,nn.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:Eg.includes(e.fieldType),isSortable:!!Ag.includes(e.fieldType)||e.fieldType===Qe.Select&&e.isSelectV2&&!e.canSelectMultiple,sortAttribute:e.slug,width:e.fileType===en.Picture?80:void 0,minWidth:e.fileType===en.Picture?void 0:180}))}};Og=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],Og);var Rg=t(5582),Dg=t(8389),Mg=t(8047);const Pg=({children:e,dateTime:n,...t})=>{const s=g(n)?n:n.toISO();return(0,i.jsx)(rc,{as:"time",dateTime:s,textStyle:"inherit",...t,children:e})};function kg(e,n){const t={...n.formats?.localeFormat||Uo.DateOnly.MonthLong,...n.formats?.displayWeekday?{weekday:"long"}:{}},i=Uo.TimeOnly,s=n.language?{locale:du(n.language)}:{},o=e.start,a=e.end;return{startDateString:g(n.formats?.dateFormat)?o.toFormat(n.formats.dateFormat):o.toLocaleString(t,s),startTimeString:g(n.formats?.timeFormat)?o.toFormat(n.formats.timeFormat):o.toLocaleString(i,s),endDateString:g(n.formats?.dateFormat)?a.toFormat(n.formats.dateFormat):a.toLocaleString(t,s),endTimeString:g(n.formats?.timeFormat)?a.toFormat(n.formats.timeFormat):a.toLocaleString(i,s)}}function Fg(e){return Math.ceil(e.end.endOf("day").diff(e.start.startOf("day"),"days").days)}function Ng(e){return e.flatMap(e=>{const n=e.range,t=Fg(n);return t>1?(0,Om.A)(0,t).map(t=>{const i=n.start.plus({days:t}),s=i.startOf("day").equals(n.start.startOf("day"))?n.start:i.startOf("day"),o=i.endOf("day").equals(n.end.endOf("day"))?n.end:i.endOf("day");return{...e,range:Oo.IX.fromDateTimes(s,o)}}):[e]})}function Lg(e,n,t,i){const s=Math.ceil(t.endOf("day").diff(n.startOf("day"),"days").days),o=(0,Om.A)(0,s).map(e=>n.startOf("day").set({hour:i}).plus({day:e}));return e.flatMap(e=>{const{start:n,end:t}=e.range,i=o.filter(e=>e>n&&e({...e,range:n}))})}function Ug(e){const n=e.filter(e=>e.isValid);if(Yo(n)){const e=(0,Lm.A)(n,e=>e.start.toMillis()),t=[e[0]];for(let n=1;ne.start),i=t.reduce((e,n)=>Math.min(e,n.hour),n.minHour??8),s=i%2==0?i:i-1,o=e.map(e=>e.end),a=o.reduce((e,n)=>Math.max(e,n.hour),n.maxHour??20),r=a%2==0?a:a+1,d=(r-s)/2,l=(0,Dg.A)(t,e=>e.toMillis()).startOf("day"),c=(0,Mg.A)(o,e=>e.toMillis()).endOf("day"),u=Math.ceil(c.diff(l,"days").days);return{starts:t,ends:o,startHour:s,endHour:r,numberOfSlots:d,startDate:l,endDate:c,numberOfDays:u}}let Bg=class{translationService;constructor(e){this.translationService=e}toDisplayString(e,n={}){return function(e,n={}){const{startDateString:t,startTimeString:i,endDateString:s,endTimeString:o}=kg(e,n),a=n?.formats?.separator??"–";return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?n.hideTime?`${t}${a}${s}`:n.hideDate?`${i}${a}${o}`:`${t} ${i}${a}${s} ${o}`:n.hideTime?`${t}`:n.hideDate?`${i}${a}${o}`:`${t} ${i}${a}${o}`}(e,{...n,language:this.translationService.language})}toComponents(e,n={}){return function(e,n={}){const{startDateString:t,startTimeString:s,endDateString:o,endTimeString:a}=kg(e,n),r=n?.formats?.separator??"–";return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?n.hideTime?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{dateTime:e.start.toISODate(),children:t}),r,(0,i.jsx)(Pg,{dateTime:e.end.toISODate(),children:o})]}):n.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{dateTime:e.start.toISOTime(),children:s}),r,(0,i.jsx)(Pg,{dateTime:e.end.toISOTime(),children:s})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Pg,{dateTime:e.start,children:[t," ",s]}),r,(0,i.jsxs)(Pg,{dateTime:e.end,children:[o," ",a]})]}):n.hideTime?(0,i.jsx)(Pg,{dateTime:e.start.toISODate(),children:t}):n.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{dateTime:e.start.toISOTime(),children:s}),"–",(0,i.jsx)(Pg,{dateTime:e.end.toISOTime(),children:a})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Pg,{dateTime:e.start,children:[t," ",s]}),"–",(0,i.jsx)(Pg,{dateTime:e.end,children:a})]})}(e,{...n,language:this.translationService.language})}toLocaleString(e,n,t){return e.toLocaleString(t,n)}};Bg=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Bg);var Wg=t(6452);const Gg=/^\d{1,2}:\d{2}$/,qg=/^\d{1,2}:\d{2}:\d{2}$/;function Hg(e){return g(e)&&(null!==e.match(Gg)||null!==e.match(qg))}function Yg(e){if(Hg(e)){const[n,t]=e.split(":");return[parseInt(n,10),parseInt(t,10)]}return null}function Zg(e,n,t,i={}){const s=g(n.name)?n.name:"",o=e.toDisplayString(n.range,i.interval?.options),a=(0,kl.A)([i.position?.includeName?t:"",s,i.slot?.includeRange||h(s)?o:"",i.position?.includeNameAtEnd?t:""]).join(" - ");return g(a)?a:t}function Kg(e,n){return n.some(({id:n,range:t})=>e.id!==n&&t.overlaps(e.range))}function Xg(e,n){const t=e.toISODate();return n.filter(e=>e.range.start.toISODate()===t)}function Qg(e,n,t,i,s,o){const a=[],r=[],d=[],l=e=>nh(e.position,o),c=(e,n)=>n.some(n=>n.engulfs(e.range)),u=Yo(s),m=Yo(i)||Yo(t)||Yo(n),g=u&&m?"both":u?"ranges":m?"positions":"none";e.forEach(e=>{const o=i.includes(e.id)||t.includes(e.position.id)||n.includes(e.positionCategory.id);"both"===g&&c(e,s)&&l(e)&&o||"ranges"===g&&c(e,s)&&l(e)||"positions"===g&&l(e)&&o?a.push(e):l(e)&&(0===s.length||c(e,s))?r.push(e):d.push(e)});const h=e=>e.range.start.toMillis();return{wishedPositionsSlots:(0,Lm.A)(a,h),possiblePositionsSlots:(0,Lm.A)(r,h),otherPositionsSlots:(0,Lm.A)(d,h)}}function Jg(e){return`${e.name}${g(e.acronym)?` (${e.acronym})`:""}`}function eh(e,n){const t=n[e.customField.slug];return"boolean"==typeof t&&e.customField.fieldType===Qe.Checkbox?t===e.conditionValue:e.customField.fieldType===Qe.Select&&e.customField.canSelectMultiple&&Yo(t)?(0,mm.A)(e.conditionValue,t??[]).length>0:e.customField.fieldType===Qe.Select&&"number"==typeof t&&e.conditionValue.includes(t)}function nh(e,n){if(!Yo(e?.conditionsCustomFields))return!0;switch(e.conditionsOperator){case be.Or:return e.conditionsCustomFields.some(e=>eh(e,n));case be.And:return e.conditionsCustomFields.every(e=>eh(e,n));default:return Zl(e.conditionsOperator)}}function th(e){return g(e.address)}function ih(e){return Nr(e.latitude)&&Nr(e.longitude)}function sh(e){return th(e)||ih(e)}function oh(e){return(0,Lm.A)(Object.values((0,fm.A)(e,e=>e.position.name)).map(e=>{const n=e[0].positionCategory,t=e[0].position,i=e.map(e=>e.positionSlot.range.start.toMillis());return{id:t.id,category:n.name,text:g(t.acronym)?t.acronym:t.name,minDate:(0,Wg.A)(i),color:t.color,count:e.length,icon:t.icon}}),({category:e,text:n,minDate:t})=>[e.toLowerCase(),n.toLowerCase(),t])}function ah(e,n,t,i){return(0,Rg.A)(n,e=>e.id).map(e=>({id:`c-${e.id}`,color:"gray",icon:null,text:e.name})).concat((0,Rg.A)(t,e=>e.id).map(e=>({id:`p-${e.id}`,color:e.color,icon:e.icon,text:g(e.acronym)?e.acronym:e.name}))).concat((0,Rg.A)(i,e=>e.id).map(n=>{const t=g(n.position.acronym)?n.position.acronym:n.position.name,i=Zg(e,n,t,{interval:{options:{formats:{localeFormat:Uo.DateOnly.Numeric}}}});return{id:`s-${n.id}`,color:n.position.color,icon:n.position.icon,text:`${t} | ${i}`}}))}function rh(e){return`${e.name}${g(e.acronym)?` (${e.acronym})`:""}`}function dh(e){return lh(e.map(({accreditationSlot:e})=>e))}function lh(e){return(0,Lm.A)(Object.values((0,fm.A)(e,e=>e.accreditation.id)).map(e=>{const n=e[0].accreditationCategory,t=e[0].accreditation,i=e.map(e=>e.date?.toMillis()??1);return{id:t.id,category:n.name,index:t.index,text:g(t.acronym)?t.acronym:t.name,minDate:(0,Wg.A)(i),color:t.color,count:e.length,icon:t.icon}}),({category:e,index:n,text:t,minDate:i})=>[u(e),ch(n),u(t),i])}function ch(e){return"number"!=typeof e||isNaN(e)?"9999":e.toString(10).padStart(4,"0")}function uh(e){return(0,Lm.A)(e,e=>[u(e.accreditationCategoryName||""),ch(e.index),u(e.name)])}var mh,gh,hh,ph,Ih,xh;function fh(e){switch(e){case hh.AccreditationsMatrix:case xh.AccreditationsMatrix:return"table-cells";case Ih.Calendar:case xh.Calendar:return"chart-gantt";case ph.Card:return"rectangle-list";case gh.List:case hh.List:case ph.List:case Ih.List:case xh.List:return"table";case Ih.Map:case xh.Map:return"map-location";case gh.SlotsList:case Ih.SlotsList:return"table";case gh.Table:return"table-cells";case gh.WeeklyCalendar:return"calendar";default:return Zl()}}function _h(e,n){switch(n){case hh.AccreditationsMatrix:case xh.AccreditationsMatrix:return e("matrice_des_acc_84939");case Ih.Calendar:case xh.Calendar:return e("vue_planning_91663");case ph.Card:return e("vue_grille_37962");case gh.List:case hh.List:case ph.List:case Ih.List:case xh.List:return e("vue_liste_56882");case Ih.Map:case xh.Map:return e("vue_carte_79064");case gh.SlotsList:case Ih.SlotsList:return e("vue_liste_cr_n_47406");case gh.Table:return e("vue_tableau_18026");case gh.WeeklyCalendar:return e("vue_calendrier_58086");default:return Zl()}}!function(e){e.Category="Category",e.Date="Date"}(mh||(mh={})),function(e){e.List="List",e.SlotsList="SlotsList",e.Table="Table",e.WeeklyCalendar="WeeklyCalendar"}(gh||(gh={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.List="List"}(hh||(hh={})),function(e){e.Card="Card",e.List="List"}(ph||(ph={})),function(e){e.Calendar="Calendar",e.List="List",e.Map="Map",e.SlotsList="SlotsList"}(Ih||(Ih={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.Calendar="Calendar",e.List="List",e.Map="Map"}(xh||(xh={}));var jh;function vh(e,n){return n===hh.AccreditationsMatrix?{includeAccreditations:!1,includeAccreditationsProfiles:!0,includeAccreditationsSlots:!0,includeCampaigns:!1,includeChildren:!1,includeCreatedBy:!1,includeDescription:!1,includeDocuments:!1,includeLayout:!1,includeLeaders:!1,includeResources:!1,includeParent:!1,includeTags:!1,includeUsedCustomFieldsFilled:!1}:{includeAccreditations:e.includes(jh.Accreditations),includeAccreditationsProfiles:e.includes(jh.AccreditationsProfiles),includeAccreditationsSlots:!1,includeCampaigns:e.includes(jh.Campaigns),includeChildren:e.includes(jh.Events),includeCreatedBy:e.includes(jh.CreatedBy),includeDescription:e.includes(jh.Description),includeDocuments:e.includes(jh.Documents),includeLayout:e.includes(jh.DelegationsSpaceLayout),includeLeaders:e.includes(jh.Leaders)||e.includes(jh.CategoryLeaders),includeResources:e.includes(jh.FillingRate)||e.includes(jh.AssignedResources),includeParent:e.includes(jh.Parent),includeTags:e.includes(jh.Tags),includeUsedCustomFieldsFilled:e.includes(jh.UsedCustomFieldsFilled)}}!function(e){e.Accreditation="accreditation",e.AccreditationProfile="accreditation_profile",e.Accreditations="accreditations",e.AccreditationSlot="accreditationSlotId",e.AccreditationsProfiles="accreditationsProfiles",e.AssignedResources="resources",e.Campaigns="campaigns",e.CanLeadersAddMembers="canLeadersAddMembers",e.CanLeadersDeleteMembers="canLeadersDeleteMembers",e.CanLeadersDuplicateMembers="canLeadersDuplicateMembers",e.CanLeadersEditColumns="canLeadersEditColumns",e.CanLeadersEditCustomFields="canLeadersEditCustomFields",e.CanLeadersEditMembers="canLeadersEditMembers",e.CanLeadersImportMembers="canLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="canLeadersSeeHiddenAccreditationsSlots",e.CategoryLeaders="categoryLeaders",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.DeadlineDate="deadlineDate",e.DelegationCategory="delegationCategory",e.DelegationSpaceLink="delegationSpaceLink",e.DelegationsSpaceLayout="delegationsSpaceLayout",e.Description="description",e.Documents="documents",e.Events="events",e.FillingRate="fillingRate",e.Form="form",e.FormLink="formLink",e.Id="id",e.IsLocked="isLocked",e.Leaders="leaders",e.MaxResources="maxResources",e.Name="name",e.Parent="parent",e.PrivateNote="privateNote",e.ShowAllAccreditations="showAllAccreditations",e.ShowFormLinkInDelegationSpace="showFormLinkInDelegationSpace",e.ShowInDelegation="showInDelegation",e.State="delegationState",e.Tags="tags",e.UsedCustomFieldsFilled="usedCustomFieldsFilled"}(jh||(jh={}));let Sh=class extends Og{constructor(e,n,t){super(e,n,t)}getDelegationsFilters(e,n,t,i){return(0,kl.A)([{slug:jh.Name,name:this.t("nom_de_la_d_l_g_28087"),category:this.t("d_l_gations_78318"),fieldType:nn.Text,hideEmpty:!0},{slug:jh.Description,name:this.t("Description"),category:this.t("d_l_gations_78318"),fieldType:nn.Text},{slug:jh.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("d_l_gations_78318"),fieldType:nn.Text},Yo(i)?{slug:jh.DelegationCategory,name:this.t("cat_gorie_00291"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,values:(0,Lm.A)(i,e=>u(e.name)),hideEmpty:!0}:null,{slug:"delegationState",name:this.t("State"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,values:Ft.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:jh.CategoryLeaders,name:this.t("responsables_de_22220"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,organizationId:e,eventId:n},{slug:jh.Leaders,name:this.t("responsables_de_03381"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,organizationId:e,eventId:n},{slug:"leadersEmailSend",name:this.t("les_responsable_08257"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"form",name:this.t("Form"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:"deadlineDate",name:this.t("date_limite_d_i_79779"),category:this.t("d_l_gations_78318"),fieldType:nn.Date},{slug:jh.MaxResources,name:this.t("MaxResources"),category:this.t("d_l_gations_78318"),fieldType:nn.Number},{slug:"tag",name:this.t("Tag"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,organizationId:e,eventId:n,tagContext:Yn.Delegations},{slug:"resources",name:this.t("nombre_de_membr_08851"),category:this.t("d_l_gations_78318"),fieldType:nn.Number,hideEmpty:!0},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("d_l_gations_78318"),fieldType:nn.Number,hideEmpty:!0},{slug:jh.ShowInDelegation,name:this.t("ShowInDelegationSpace"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.CanLeadersDuplicateMembers,name:this.t("CanLeadersDuplicateMembers"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:jh.ShowAllAccreditations,name:this.t("ShowAllAccreditations"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},n?{slug:jh.DelegationsSpaceLayout,name:this.t("DelegationsSpaceLayout"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,eventId:n}:null,n?{slug:jh.Accreditation,name:this.t("accr_ditations_39450"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,eventId:n}:null,n?{slug:jh.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,eventId:n}:null,n?{slug:jh.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,eventId:n}:null,{slug:jh.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:jh.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("d_l_gations_78318"),fieldType:nn.Datetime,hideEmpty:!0},n?{slug:"parent",name:this.t("est_li_e_une_48471"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0}:{slug:"event",name:this.t("_v_nement_22345"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:jh.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(t)])}getDelegationsPossibleColumns(e,n){return[{slug:jh.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:De.Id,width:100},{slug:jh.Name,name:this.t("nom_de_la_d_l_g_28087"),isSearchable:!0,isSortable:!0,sortAttribute:De.Name,minWidth:240},{slug:jh.Description,name:this.t("Description"),minWidth:320},{slug:jh.DelegationCategory,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:De.Category,minWidth:240},{slug:jh.State,name:this.t("State"),minWidth:180},{slug:jh.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320},{slug:jh.Leaders,name:this.t("responsables_de_03381"),isSearchable:!0,minWidth:320},{slug:jh.Form,name:this.t("Form"),isSearchable:!0,minWidth:180},{slug:jh.FormLink,name:this.t("FormLink"),minWidth:240},{slug:jh.DelegationSpaceLink,name:this.t("DelegationSpaceLink"),minWidth:240},{slug:jh.DelegationsSpaceLayout,name:this.t("DelegationsSpaceLayout"),minWidth:240},{slug:jh.DeadlineDate,name:this.t("date_limite_d_i_79779"),minWidth:180},{slug:jh.MaxResources,name:this.t("MaxResources"),minWidth:180,isSortable:!0,sortAttribute:De.MaxResources},{slug:jh.AssignedResources,name:this.t("membres_11310"),minWidth:240},{slug:jh.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:jh.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:jh.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:jh.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:De.CreatedAt,minWidth:180},{slug:jh.ShowInDelegation,name:this.t("ShowInDelegationSpace"),minWidth:180},{slug:jh.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),minWidth:180},{slug:jh.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),minWidth:180},{slug:jh.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),minWidth:180},{slug:jh.CanLeadersDuplicateMembers,name:this.t("CanLeadersDuplicateMembers"),minWidth:180},{slug:jh.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),minWidth:180},{slug:jh.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),minWidth:180},{slug:jh.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),minWidth:180},{slug:jh.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),minWidth:180},{slug:jh.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),minWidth:180},{slug:jh.ShowAllAccreditations,name:this.t("ShowAllAccreditations"),minWidth:180},{slug:jh.IsLocked,name:this.t("IsLocked"),minWidth:180},e?{slug:jh.Parent,name:this.t("d_l_gation_de_l_86100"),minWidth:320}:{slug:jh.Events,name:this.t("_v_nements_53672"),minWidth:320},...e?[{slug:jh.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:jh.AccreditationsProfiles,name:this.t("profils_d_accr_27825"),minWidth:320}]:[],{slug:jh.Campaigns,name:this.t("campagnes_que_l_81468"),minWidth:320},{slug:jh.Documents,name:this.t("documents_que_l_18755"),minWidth:320},{slug:jh.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),minWidth:180},...this.customFieldsToPossibleColumns(n)]}};function yh(e){return"production"===r.Development?1===e:3136===e}function Ch(){return"production"===r.Development?[14]:[66919,68131,68598,70260,74864,74866,74868]}Sh=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],Sh);const bh="custom_document_";function Ah(e){return`${bh}${e}`}function Eh(e){return e.startsWith(bh)}function wh(e,n){return 0===e.length||Yo((0,mm.A)(e,Ho(n)))}function $h(e){return"production"===r.Development?1===e:2676===e}var Th;function zh(e,n,t){return n===xh.AccreditationsMatrix?{includeAccreditationProfile:!1,includeAccreditations:!1,includeAccreditationsMatrix:!0,includeAvailability:!1,includeComments:!1,includeCustomDocuments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePicture:!0,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeTraces:!1,includeVolunteerMinutes:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:n===xh.Map?{includeAccreditationProfile:!1,includeAccreditations:!1,includeAccreditationsMatrix:!1,includeAvailability:!1,includeComments:!1,includeCustomDocuments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePicture:!1,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeTraces:!0,includeVolunteerMinutes:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:{includeAccreditationProfile:e.includes(Th.AccreditationProfile)||e.includes(Th.WishedAccreditationProfile),includeAccreditations:e.includes(Th.Accreditations)||e.includes(Th.AccreditationsCategories)||e.includes(Th.AccreditationsSlots)||e.includes(Th.WishedAccreditationSlots)||e.includes(Th.ScannedAccreditations)||e.includes("bracelet_a_delivrer"),includeAccreditationsMatrix:!1,includeAvailability:e.includes(Th.Availability),includeComments:e.includes(Th.Comments),includeCustomDocuments:e.some(Eh),includeDelegation:e.includes(Th.Delegations)||e.includes(Th.DelegationCategory)||e.includes(Th.DelegationBannerNumber),includeDuplicatedFrom:e.includes(Th.DuplicatedFrom),includeEmails:e.includes(Th.CampaignsStates),includeFormsUsersInfos:e.includes(Th.CompletedForms)||e.includes(Th.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at_"))||e.includes(Th.Availability)||e.includes(Th.TeamCode)||e.includes(Th.TeamMembers)||e.includes(Th.WishedAccreditationProfile),includeForms:e.includes(Th.CompletedForms)||e.includes(Th.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at_"))||e.includes(Th.Availability),includeNumberOfAccreditations:e.includes(Th.NumberOfAccreditations),includeNumberOfAssignments:e.includes(Th.NumberOfAssignments),includeNumberOfAssignmentsDays:e.includes(Th.NumberOfAssignmentsDays),includeNumberOfAvailableDays:e.includes(Th.NumberOfAvailableDays),includePicture:e.includes(Th.Name),includePositions:e.includes(Th.Positions)||e.includes(Th.PositionsCategories)||e.includes(Th.WishedPositions)||e.includes(Th.CheckedInPositions),includeRoles:e.includes(Th.Roles),includeTags:e.includes(Th.Tags),includeTeam:e.includes(Th.TeamCode)||e.includes(Th.TeamMembers),includeTraces:!1,includeVolunteerMinutes:e.includes(Th.VolunteerMinutes),includeWishedPositions:e.includes(Th.WishedPositions),includePreassignedPositions:e.includes(Th.PreassignedPositionsCategories)||e.includes(Th.PreassignedPositions),includeWeezeventChecklists:e.includes(Th.WeezaccessChecklists),includeWeezeventUrls:!0===t?.includeWeezeventUrls&&(e.includes(Th.WeezeventBarcodeId)||e.includes(Th.WeezeventShortTag))}}!function(e){e.AccreditationProfile="accreditation_profile",e.AccreditationState="accreditation_state",e.Accreditations="accreditations",e.AccreditationsCategories="accreditations_categories",e.AccreditationsSlots="accreditations_slots",e.Availability="availability",e.CampaignsStates="campaigns_states",e.CheckedInPositions="checed_in_positions",e.Comments="comments",e.CompletedForms="forms",e.DelegationBannerNumber="delegation_banner_number",e.DelegationCategory="delegation_category",e.Delegations="delegations",e.DuplicatedFrom="duplicatedFrom",e.Email="email",e.FormsInsertedAt="forms_inserted_at",e.Id="id",e.InsertedAt="inserted_at",e.LocalId="local_id",e.Name="name",e.NumberOfAccreditations="number_of_accreditations",e.NumberOfAssignments="number_of_assignments",e.NumberOfAssignmentsDays="number_of_assignments_days",e.NumberOfAvailableDays="number_of_available_days",e.OrganizationLocalId="organization_local_id",e.Positions="positions",e.PositionsCategories="positions_categories",e.PreassignedPositions="preassigned_positions",e.PreassignedPositionsCategories="preassigned_positions_categories",e.Roles="roles",e.ScannedAccreditations="scanned_accreditations",e.Tags="tags",e.TeamCode="teamCode",e.TeamMembers="teamMembers",e.VolunteerMinutes="volunteer_minutes",e.VolunteerRegistrationState="volunteer_registration_state",e.WeezaccessChecklists="weezevent_checklists",e.WeezeventBarcodeId="weezevent_barcode_id",e.WeezeventBarcodeVersion="weezevent_barcode_version",e.WeezeventPairedAt="weezevent_paired_at",e.WeezeventShortTag="weezevent_short_tag",e.WishedAccreditationProfile="wished_accreditation_profile",e.WishedAccreditationSlots="wished_accreditation_slots",e.WishedPositions="wished_positions"}(Th||(Th={}));let Oh=class extends Og{constructor(e,n,t){super(e,n,t)}getVolunteersFilters(e,n,t,i,s,{hasAccreditations:o,hasCampaigns:a,hasDelegations:r,hasForms:d,hasPositions:l,isWeezeventConnected:c}){return[...this.getBaseFilters(i),...this.getBarcodeFilters(),...this.getAvailabilitiesFilters(n,s),...l?this.getPositionsFilters(e,n,s):[],...o?this.getAccreditationsFilters(e,n,s):[],...r?this.getDelegationsFilters(e,n):[],...this.getSegmentsFilters(e,n,t,s),...d?this.getFormsFilters(n):[],...d?this.getTeamsFilters():[],...c?this.getWeezeventFilters(n):[],...this.getEmailsFilters(n,a),...this.getCommentsFilter(e,n),{slug:"tag",name:this.t("Tags"),category:this.t("autres_99130"),fieldType:nn.Select,needLoading:!0,organizationId:e,eventId:n,tagContext:Yn.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:nn.Number,hideEmpty:!0},{slug:"possibleDuplicates",name:this.t("potentiel_doubl_87672"),category:this.t("autres_99130"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"isLeader",name:this.t("est_responsable_19679"),category:this.t("autres_99130"),fieldType:nn.Checkbox},{slug:"isPositionLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:nn.Checkbox},{slug:"isPositionCategoryLeader",name:this.t("est_responsable_91796"),category:this.t("autres_99130"),fieldType:nn.Checkbox}]}getPositionMembersFilters(e,n,t,i){return[...this.getBaseFilters(t),...this.getAvailabilitiesFilters(n,i),...this.getPositionsFilters(e,n,i)]}getAccreditationMembersFilters(e,n,t,i,{hasDelegations:s}){return[...this.getBaseFilters(t),...this.getAccreditationsFilters(e,n,i),...s?this.getDelegationsFilters(e,n):[]]}getDelegationCategoryMembersFilters(e,n,t,i,s){return[...this.getBaseFilters(t),...this.getAccreditationsFilters(e,n,i),...s?this.getWeezeventFilters(n):[]]}getDelegationMembersFilters(e,n,t,i,s,o){return[...this.getBaseFilters(t),...s.slotDisplay===Ln.Hide?[]:this.getAvailabilitiesFilters(n,i),...this.getAccreditationsFilters(e,n,i),...s.positionDisplay===Fn.None?[]:this.getPositionMembersFilters(e,n,t,i),...o?this.getWeezeventFilters(n):[]]}getVolunteersPossibleColumns(e,n,t,i,{hasAccreditations:s,hasCampaigns:o,hasCustomDocuments:a,hasDelegations:r,hasForms:d,hasPositions:l,isWeezeventConnected:c}){return[...this.getBaseColumns(n,{forDelegationsSpace:!1}),...a?this.getCustomDocumentsColumns(i):[],...d?this.getFormsColumns(t):[],...l?this.getPositionsColumns():[],...c?this.getWeezeventColumns():[],...s?this.getAccreditationsColumns(e):[],...this.getAvailabilitiesColumns(),...r?this.getDelegationsColumns(e):[],...o?[{slug:Th.CampaignsStates,name:this.t("statut_des_camp_25280"),minWidth:320}]:[],{slug:Th.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:Th.Comments,name:this.t("commentaires_96492"),isSearchable:!0,minWidth:320},{slug:Th.Roles,name:this.t("r_les_61679"),minWidth:320}]}getPositionMembersPossibleColumns(e){return[...this.getBaseColumns(e,{forDelegationsSpace:!1}),...this.getPositionsColumns()]}getAccreditationMembersPossibleColumns(e,n){return[...this.getBaseColumns(n,{forDelegationsSpace:!1}),...this.getAccreditationsColumns(e),...this.getDelegationsColumns(e)]}getDelegationCategoryMembersPossibleColumns(e,n,t,{hasCustomDocuments:i,isWeezeventConnected:s}){return[...this.getBaseColumns(n,{forDelegationsSpace:!1}),...i?this.getCustomDocumentsColumns(t):[],...this.getAccreditationsColumns(e),...this.getDelegationsColumns(e),...s?this.getWeezeventColumns():[],{slug:Th.CampaignsStates,name:this.t("statut_des_camp_25280")},{slug:Th.Delegations,name:this.t("Delegation"),isSearchable:!0}]}getDelegationMembersPossibleColumns(e,n,{customDocuments:t,forDelegationsSpace:i,isWeezeventConnected:s,positionDisplay:o,slotDisplay:a}){return[...this.getBaseColumns(n,{forDelegationsSpace:i}),...this.getCustomDocumentsColumns(t??[]),...this.getAccreditationsColumns(e),...o===Fn.None?[]:this.getPositionsColumns(),...a===Ln.Hide?[]:this.getAvailabilitiesColumns(),...s?this.getWeezeventColumns():[],{slug:Th.CampaignsStates,name:this.t("statut_des_camp_25280")}]}getBaseColumns(e,{forDelegationsSpace:n}){return(0,kl.A)([{slug:Th.Email,name:this.t("e_mail_du_membr_69509"),isSearchable:!0,isSortable:!0,sortAttribute:ot.Email,minWidth:180},n?null:{slug:Th.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:ot.Id,width:100},n?null:{slug:Th.LocalId,name:this.t("id_sur_l_v_nem_01171"),isSearchable:!0,isSortable:!0,sortAttribute:ot.LocalId,width:100},n?null:{slug:Th.OrganizationLocalId,name:this.t("id_sur_l_organi_45566"),isSearchable:!0,isSortable:!0,sortAttribute:ot.OrganizationLocalId,width:100},n?null:{slug:Th.WeezeventBarcodeId,name:this.t("TicketId"),isSearchable:!0,minWidth:240},n?null:{slug:Th.WeezeventBarcodeVersion,name:this.t("version_du_code_15471"),minWidth:100},{slug:Th.Name,name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:ot.Name,minWidth:240},{slug:Th.InsertedAt,name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:ot.InsertedAt,width:240},n?null:{slug:Th.DuplicatedFrom,name:this.t("dupliqu_de_28582"),minWidth:240},...this.customFieldsToPossibleColumns(e)])}getAvailabilitiesColumns(){return[{slug:Th.Availability,name:this.t("disponibilit_s_49923"),minWidth:320}]}getCustomDocumentsColumns(e){return(0,Lm.A)(e,e=>u(e.name)).map(e=>({slug:Ah(e.id),name:this.t("imprimer_1_75795",e.name),customDocument:e,minWidth:240}))}getFormsColumns(e){return[{slug:Th.CompletedForms,name:this.t("formulaires_rem_62495"),minWidth:320},{slug:Th.FormsInsertedAt,name:this.t("dates_de_rempli_65075"),minWidth:320},...(0,Lm.A)(e,e=>u(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:Th.TeamCode,name:this.t("code_quipe_14296"),isSearchable:!0,isSortable:!0,sortAttribute:ot.TeamCode,minWidth:180},{slug:Th.TeamMembers,name:this.t("membres_de_l_q_00891"),minWidth:240}]}getPositionsColumns(){return[{slug:Th.NumberOfAssignments,name:this.t("nombre_d_affect_31455"),width:240},{slug:Th.NumberOfAssignmentsDays,name:this.t("nombre_de_jours_86280"),width:240},{slug:Th.NumberOfAvailableDays,name:this.t("nombre_de_jours_07962"),width:240},{slug:Th.Positions,name:this.t("missions_affect_97811"),minWidth:320},{slug:Th.PositionsCategories,name:this.t("cat_gories_de_m_93035"),minWidth:320},{slug:Th.VolunteerMinutes,name:this.t("nombre_de_minut_50497"),width:240},{slug:Th.VolunteerRegistrationState,name:this.t("status_d_affect_75769"),isSortable:!0,sortAttribute:ot.State,width:240},{slug:Th.WishedPositions,name:this.t("missions_souhai_23225"),minWidth:320},{slug:Th.PreassignedPositions,name:this.t("missions_pr_af_02950"),minWidth:320},{slug:Th.PreassignedPositionsCategories,name:this.t("cat_gories_pr_83825"),minWidth:320},{slug:Th.CheckedInPositions,name:this.t("missions_point_05292"),minWidth:320}]}getAccreditationsColumns(e){return(0,kl.A)([{slug:Th.Accreditations,name:this.t("accr_ditations_33155"),minWidth:320},{slug:Th.AccreditationsCategories,name:this.t("cat_gories_d_ac_37678"),minWidth:320},{slug:Th.AccreditationState,name:this.t("statut_d_accr_d_75527"),isSortable:!0,sortAttribute:ot.AccreditationState,width:240},{slug:Th.NumberOfAccreditations,name:this.t("nombre_d_accr_d_02452"),width:240},{slug:Th.WishedAccreditationSlots,name:this.t("accr_ditations_74375"),minWidth:320},{slug:Th.ScannedAccreditations,name:this.t("accr_ditations_52153"),minWidth:320},{slug:Th.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),minWidth:240},{slug:Th.WishedAccreditationProfile,name:this.t("profil_d_accr_d_63000"),minWidth:240},$h(e)?{slug:"bracelet_a_delivrer",name:this.t("bracelet_d_li_50372")}:null])}getWeezeventColumns(){return[{slug:Th.WeezeventShortTag,name:this.t("puce_50504"),isSearchable:!0,minWidth:180},{slug:Th.WeezeventPairedAt,name:this.t("appair_le_70213"),isSortable:!0,sortAttribute:ot.PairedAt,minWidth:180},{slug:Th.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),minWidth:320}]}getDelegationsColumns(e){return(0,kl.A)([{slug:Th.Delegations,name:this.t("Delegation"),isSearchable:!0,isSortable:!0,sortAttribute:ot.Delegation,minWidth:240},{slug:Th.DelegationCategory,name:this.t("cat_gorie_de_d_18027"),minWidth:240},yh(e)?{slug:Th.DelegationBannerNumber,name:this.t("num_ro_de_bande_16203"),isSearchable:!0,width:100}:null])}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:nn.Text,hideEmpty:!0},{slug:"insertedAt",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:nn.Date,hideEmpty:!0},{slug:Th.LocalId,name:this.t("id_sur_l_v_nem_01171"),category:this.t("champs_de_formu_64126"),fieldType:nn.Number,hideEmpty:!0},{slug:Th.OrganizationLocalId,name:this.t("id_sur_l_organi_45566"),category:this.t("champs_de_formu_64126"),fieldType:nn.Number,hideEmpty:!0},{slug:Th.DuplicatedFrom,name:this.t("est_dupliqu_62764"),category:this.t("champs_de_formu_64126"),fieldType:nn.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(e)]}getBarcodeFilters(){return[{slug:Th.WeezeventBarcodeId,name:this.t("TicketId"),category:"Weezevent",fieldType:nn.Text,hideEmpty:!0},{slug:Th.WeezeventBarcodeVersion,name:this.t("version_du_code_15471"),category:"Weezevent",fieldType:nn.Number,hideEmpty:!0}]}getAvailabilitiesFilters(e,n){return[{slug:"numberOfAvailableDays",name:this.t("nombre_de_jours_07962"),category:this.t("disponibilit_s_49923"),fieldType:nn.Number,hideEmpty:!0},{slug:"wishedSlots",name:this.t("disponibilit_s_49923"),category:this.t("disponibilit_s_49923"),fieldType:nn.DateTimeRange,startAt:n.startAt,endAt:n.endAt},{slug:"wishedSlotsCustom",name:this.t("disponibilit_s_26280"),category:this.t("disponibilit_s_49923"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:e},{slug:"numberOfWishedSlots",name:this.t("nombre_de_dispo_26405"),category:this.t("disponibilit_s_49923"),fieldType:nn.Number,hideEmpty:!0}]}getPositionsFilters(e,n,t){return[{slug:"volunteerRegistrationState",name:this.t("statut_d_affect_57444"),category:this.t("missions_63972"),fieldType:nn.Select,values:vi.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"position",name:this.t("missions_affect_97811"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"hasOtherEventPosition",name:this.t("has_shift_on_ot_92375"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:"positionSlotId",name:this.t("cr_neau_affect_50400_plural"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"positionSlot",name:this.t("date_d_affectat_98566"),category:this.t("missions_63972"),fieldType:nn.DateTimeRange,startAt:t.startAt,endAt:t.endAt},{slug:"positionCategory",name:this.t("cat_gories_de_m_93035"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"numberOfAssignmentsPerDay",name:this.t("nombre_d_affect_22087"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0,startAt:t.startAt,endAt:t.endAt},{slug:"numberOfAssignmentsDays",name:this.t("nombre_de_jours_86280"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0,startAt:t.startAt,endAt:t.endAt},{slug:"preassignedPosition",name:this.t("missions_pr_af_02950"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"numberOfPreAssignments",name:this.t("nombre_de_pr_a_86516"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:"preassignedPositionCategory",name:this.t("cat_gories_pr_83825"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"wishedPositionsCategories",name:this.t("cat_gories_souh_80851"),category:this.t("missions_63972"),fieldType:nn.Select,needLoading:!0,eventId:n},{slug:"numberOfWishedPositionsCategories",name:this.t("nombre_de_cat_g_05961"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:"wishedPositions",name:this.t("missions_souhai_23225"),category:this.t("missions_63972"),fieldType:nn.Select,needLoading:!0,eventId:n},{slug:"numberOfWishedPositions",name:this.t("nombre_de_missi_52579"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:"wishedPositionsSlots",name:this.t("cr_neaux_souhai_90108"),category:this.t("missions_63972"),fieldType:nn.Select,needLoading:!0,eventId:n},{slug:"numberOfWishedPositionsSlots",name:this.t("nombre_de_cr_ne_28370"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:"volunteersMinutes",name:this.t("nombre_de_minut_50497"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:"volunteersMinutesDays",name:this.t("nombre_de_minut_89574"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0,startAt:t.startAt,endAt:t.endAt},{slug:"checkInAt",name:this.t("point_le_93167"),category:this.t("missions_63972"),fieldType:nn.Datetime,useLocalZone:!0},{slug:"checkOutAt",name:this.t("d_point_le_29289"),category:this.t("missions_63972"),fieldType:nn.Datetime,useLocalZone:!0},{slug:"checkInState",name:this.t("statut_de_point_44328"),category:this.t("missions_63972"),fieldType:nn.Select,values:Rt.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:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"checkOutAtPositionSlot",name:this.t("cr_neaux_d_poin_45477"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"overlappingAssignments",name:this.t("affectations_se_49339"),category:this.t("missions_63972"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"differentPositions",name:this.t("les_missions_af_61709"),category:this.t("missions_63972"),fieldType:nn.Checkbox,hideEmpty:!0}]}getAccreditationsFilters(e,n,t){return(0,kl.A)([{slug:"accreditationState",name:this.t("statut_d_accr_d_75527"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,values:Et.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:nn.Number,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"accreditation",name:this.t("accr_ditations_33155"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"hasOtherEventAccreditation",name:this.t("has_accreditati_31831"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:"accreditationCategory",name:this.t("cat_gories_d_ac_37678"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"wishedAccreditationsSlots",name:this.t("accr_ditations_74375"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,needLoading:!0,eventId:n},{slug:"numberOfWishedAccreditationsSlots",name:this.t("nombre_d_accr_d_92021"),category:this.t("accr_ditations_39450"),fieldType:nn.Number,hideEmpty:!0},{slug:"accreditationSlotId",name:this.t("cr_neaux_accr_d_70934"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"accreditationSlot",name:this.t("date_d_accr_dit_26214"),category:this.t("accr_ditations_39450"),fieldType:nn.Date,startAt:t.startAt,endAt:t.endAt,hideEmpty:!0},{slug:"scannedAccreditationsSlots",name:this.t("accr_ditations_52153"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"differentAccreditations",name:this.t("les_accr_ditati_88638"),category:this.t("accr_ditations_39450"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:Th.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,needLoading:!0,eventId:n},{slug:Th.WishedAccreditationProfile,name:this.t("profil_d_accr_d_63000"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,needLoading:!0,eventId:n}])}getDelegationsFilters(e,n){return(0,kl.A)([{slug:"delegation",name:this.t("inscrit_via_la_86398"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,eventId:n},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,organizationId:e,eventId:n},{slug:"isDelegationCategoryLeader",name:this.t("est_responsable_36610"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,needLoading:!0,eventId:n},yh(e)?{slug:Th.DelegationBannerNumber,name:this.t("num_ro_de_bande_16203"),category:this.t("d_l_gations_78318"),fieldType:nn.Number}:null,{slug:"hasBeenInvitedToDelegation",name:this.t("a_re_u_le_lien_34327"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox,hideEmpty:!0}])}getSegmentsFilters(e,n,t,i){return[{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("vues_personnali_80652"),fieldType:nn.Select,values:i.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==t),hideEmpty:!0},{slug:"usersSegments",name:this.t("fait_partie_de_44893"),category:this.t("vues_personnali_80652"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"positionsSegments",name:this.t("affecter_une_10657"),category:this.t("vues_personnali_80652"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"accreditationsSegments",name:this.t("affecter_une_91431"),category:this.t("vues_personnali_80652"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"delegationsSegments",name:this.t("affecter_une_45240"),category:this.t("vues_personnali_80652"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:n}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:nn.Select,needLoading:!0,eventId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:nn.Date,hideEmpty:!0,needLoading:!0,eventId:e}]}getTeamsFilters(){return[{slug:"isTeam",name:this.t("est_inscrit_en_86193"),category:this.t("_quipes_18817"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"teamCode",name:this.t("code_quipe_14296"),category:this.t("_quipes_18817"),fieldType:nn.Text},{slug:"numberOfTeamMembers",name:this.t("nombre_de_membr_82302"),category:this.t("_quipes_18817"),fieldType:nn.Number,hideEmpty:!0},{slug:"isTeamLeader",name:this.t("est_chef_d_qui_73792"),category:this.t("_quipes_18817"),fieldType:nn.Checkbox,hideEmpty:!0}]}getWeezeventFilters(e){return[{slug:Th.WeezeventShortTag,name:this.t("puce_50504"),category:"Weezevent",fieldType:nn.Text},{slug:Th.WeezeventPairedAt,name:this.t("appair_le_70213"),category:"Weezevent",fieldType:nn.Datetime,useLocalZone:!0},{slug:Th.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),category:"Weezevent",fieldType:nn.Select,needLoading:!0,eventId:e}]}getEmailsFilters(e,n){return(0,kl.A)([n?{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:nn.Campaign,needLoading:!0,eventId:e}:null,n?{slug:"campaignSentAt",name:this.t("date_d_envoi_de_84374"),category:this.t("e_mails_09850"),fieldType:nn.Date,hideEmpty:!0,needLoading:!0,eventId:e}:null,{slug:"assignmentEmailSentAt",name:this.t("date_d_envoi_de_01614"),category:this.t("e_mails_09850"),fieldType:nn.Date},{slug:"assignmentEmailState",name:this.t("statut_de_de_l_36346"),category:this.t("e_mails_09850"),fieldType:nn.Select,values:Lt.filter(e=>e!==Le.Queued).map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"accreditationEmailSentAt",name:this.t("date_d_envoi_de_74383"),category:this.t("e_mails_09850"),fieldType:nn.Date},{slug:"accreditationEmailState",name:this.t("statut_de_l_e_m_97776"),category:this.t("e_mails_09850"),fieldType:nn.Select,values:Lt.filter(e=>e!==Le.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:nn.Checkbox,hideEmpty:!0},n?{slug:"campaignReply",name:this.t("r_ponse_une_c_32448"),category:this.t("e_mails_09850"),fieldType:nn.Text,needLoading:!0,eventId:e}:null])}getCommentsFilter(e,n){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:nn.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:nn.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n}]}};var Rh;function Dh(e){return{includeAccreditations:e.includes(Rh.Accreditations),includeCampaign:e.includes(Rh.Campaign),includeCustomField:e.includes(Rh.CustomField),includePositions:e.includes(Rh.Positions)}}Oh=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],Oh),function(e){e.AccreditationSlot="accreditationSlotId",e.Accreditations="accreditations",e.Action="Action",e.Campaign="campaign",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.CustomField="customField",e.ExecutedAt="executedAt",e.Frequency="frequency",e.Id="id",e.Name="name",e.PositionSlot="positionSlotId",e.Positions="positions",e.State="state",e.Trigger="trigger",e.VolunteersSegment="volunteersSegment"}(Rh||(Rh={}));class Mh extends Og{constructor(e,n,t){super(e,n,t)}getWorkflowsFilters(e,n){return[{slug:Rh.State,name:this.t("State"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,values:wi.map(e=>({id:e,name:this.t(e)}))},{slug:Rh.Trigger,name:this.t("d_clencheur_73493"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,values:$i.map(e=>({id:e,name:this.t(e)}))},{slug:Rh.Action,name:this.t("action_44224"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,values:yi.map(e=>({id:e,name:this.t(e)}))},{slug:Rh.Frequency,name:this.t("Frequency"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,values:Ci.map(e=>({id:e,name:this.t(e)}))},{slug:Rh.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:Rh.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("automatisations_60045"),fieldType:nn.Datetime,hideEmpty:!0},...n?[{slug:Rh.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:Rh.PositionSlot,name:this.t("cr_neau_affect_50400_plural"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n}]:[],{slug:Rh.Campaign,name:this.t("campagne_97871"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:Rh.CustomField,name:this.t("CustomField"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:Rh.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),category:this.t("automatisations_60045"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n}]}getWorkflowsPossibleColumns(){return[{slug:Rh.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:mt.Id},{slug:Rh.Name,name:this.t("nom_de_l_automa_04883"),isSearchable:!0,isSortable:!0,sortAttribute:mt.Name,minWidth:240},{slug:Rh.State,name:this.t("State"),minWidth:180},{slug:Rh.Trigger,name:this.t("d_clencheur_73493"),minWidth:180},{slug:Rh.Action,name:this.t("action_44224"),minWidth:180},{slug:Rh.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:Rh.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:mt.CreatedAt,minWidth:180},{slug:Rh.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),isSortable:!0,sortAttribute:mt.VolunteersSegment,minWidth:320},{slug:Rh.ExecutedAt,name:this.t("ex_cut_e_le_99019"),isSortable:!0,sortAttribute:mt.ExecutedAt,minWidth:180},{slug:Rh.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:Rh.Positions,name:this.t("missions_63972"),minWidth:320},{slug:Rh.Campaign,name:this.t("campagne_97871"),minWidth:240},{slug:Rh.CustomField,name:this.t("CustomField"),minWidth:240},{slug:Rh.Frequency,name:this.t("Frequency"),minWidth:180}]}}var Ph=t(9669);function kh(e,n,t,i,s){const o=n.diff(e,"days").days;return(0,Ph.A)((0,Om.A)(0,o+1).map(n=>e.plus({days:n}).set({hour:s})),e=>i===kn.AllDays||t.some(n=>n.contains(e)||n.start.startOf("day").equals(e.startOf("day"))||n.end.startOf("day").equals(e.startOf("day"))))}function Fh(e,n,t,i,s){const o=n.diff(e,"days").days;return(0,Om.A)(0,o+1).flatMap(n=>{const i=e.plus({days:n});return t.map(e=>{const[n,t]=e.startTime.split(":").map(e=>parseInt(e,10)),[s,o]=e.endTime.split(":").map(e=>parseInt(e,10)),a=i.set({hour:n,minute:t});let r=i.set({hour:s,minute:o});return(ss===kn.AllDays||i.some(n=>n.overlaps(e.interval)))}function Nh(e,n){return g(e)?`${e} (${n.toFormat("HH:mm")})`:n.toFormat("HH:mm")}function Lh(e,n,t){const i=e.filter(e=>!n.equals(ko(e)));return i.length===e.length&&t?[...e,No(n)]:i.length===e.length||t?e:i}function Uh(e,n,t,i={}){const s=g(n.name)?n.name:"",o=n.date?g(i?.date?.format)?n.date.toFormat(i?.date?.format??""):e.toLocaleString(n.date,i?.date?.localeFormat||Uo.DateOnly.Numeric):"",a=(0,kl.A)([i?.accreditation?.includeName?t:"",s,o,i?.accreditation?.includeNameAtEnd?t:""]).join(" - ");return g(a)?a:g(i?.defaultName)?i?.defaultName:t}function Vh(e){return(0,Lm.A)(e,e=>[e.date?.toMillis()??1,e.name.toLowerCase()])}function Bh(e,n,t={}){return(0,Lm.A)(n,e=>u(e.name)).flatMap(n=>uh(n.accreditations).map(s=>{const o=t.useAccreditationDisplay&&s.accreditationDisplay===oe.Radio?s.name:void 0,a=Vh(s.slots);return(0,i.jsx)("optgroup",{label:`${n.name} - ${rh(s)}`,children:a.map(n=>{const a=Uh(e,n,rh(s),{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{"data-radio":o,disabled:!(!t.useIsBlocked||!n.isBlocked),value:n.id,children:a},n.id)})},s.id)}))}function Wh(e,n,t={}){return(0,Lm.A)(n,e=>u(e.name)).flatMap(n=>(0,Lm.A)(n.positions,e=>u(e.name)).map(s=>{const o=t.usePositionDisplay&&s.positionDisplay===jn.Radio?`position-${s.id}`:void 0;return(0,i.jsx)("optgroup",{label:`${n.name} - ${Jg(s)}`,children:(0,Lm.A)(s.slots,e=>[e.range.start.toMillis(),e.name]).map(n=>{const t=Zg(e,n,Jg(s),{position:{includeNameAtEnd:!0},slot:{includeRange:!0}});return(0,i.jsx)("option",{"data-radio":o,value:n.id,children:t},n.id)})},s.id)}))}const Gh=new WeakMap,qh=(e,n,t,i)=>{let s=Gh.get(i);return s||(s=(async(e,n,t,i)=>{const s=await X();if("createdBy"===i.slug&&i.organizationId){const{organization:e}=await function(e,n){return oa("query Admins($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n usersInfos(isResourceCreator: true) {\n nodes {\n userId\n email\n name\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({organizationId:i.organizationId},s);i.values=e.usersInfos.nodes.map(({userId:e,email:n,name:t})=>({id:e,name:`${g(t)?t:"-"} - ${n}`})),i.needLoading=!1}else if("categoryLeaders"===i.slug&&i.organizationId){const{organization:e}=await function(e,n){return oa('query DelegationsSegmentsCategoryLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n isDelegationCategoryLeader: true\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{variables:e,token:n||void 0,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},s);i.values=e.usersInfos.nodes,i.needLoading=!1}else if("leaders"===i.slug&&i.organizationId){const{organization:e}=await function(e,n){return oa('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:n||void 0,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},s);i.values=e.usersInfos.nodes,i.needLoading=!1}else if("delegationCategory"===i.slug&&i.organizationId){const{organization:e}=await function(e,n){return oa("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:n||void 0,fragments:[]})}({organizationId:i.organizationId,level:i.eventId?xn.Event:xn.Organization,eventId:i.eventId},s);i.values=(0,Lm.A)(e.delegationsCategories.nodes,e=>u(e.name)),i.needLoading=!1}else if("roles"===i.slug&&i.organizationId){const{organization:e}=await function(e,n){return oa("query UsersSegmentsRoles($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n roles {\n id\n name\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({organizationId:i.organizationId},s);i.values=(0,Lm.A)(e.roles,e=>u(e.name)),i.needLoading=!1}else if("tag"===i.slug&&i.organizationId){const{organization:e}=await Wa({organizationId:i.organizationId,eventId:i.eventId,context:i.tagContext},s);i.values=(0,Lm.A)(e.tags.nodes,e=>u(e.name)),i.needLoading=!1}else if(i.slug===Rh.CustomField&&i.organizationId){const{organization:e}=await Ba({organizationId:i.organizationId,eventId:i.eventId},s);i.values=(0,Lm.A)(e.customFields.nodes,e=>u(e.name)),i.needLoading=!1}else if(i.slug===Rh.VolunteersSegment&&i.organizationId){const{organization:e}=await function(e,n){return oa("query WorkflowsSegmentsSegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n volunteersSegmentsFolders: segmentsFolders(\n level: $level\n eventId: $eventId\n segmentType: Volunteers\n ) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n\n delegationsSegmentsFolders: segmentsFolders(\n level: $level\n eventId: $eventId\n segmentType: Delegations\n ) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({organizationId:i.organizationId,level:i.eventId?xn.Event:xn.Organization,eventId:i.eventId},s),n=(e,n)=>(0,Lm.A)(n,e=>e.index).map(n=>({name:`${e} - ${n.name}`,values:(0,Lm.A)(n.segments,e=>e.index)}));i.valuesGroups=n(t.translate("membres_11310"),e.volunteersSegmentsFolders).concat(n(t.translate("d_l_gations_78318"),e.delegationsSegmentsFolders)),i.needLoading=!1}else if(i.eventId){if(["preassignedPosition","position","wishedPositions"].includes(i.slug)){const{event:e}=await function(e,n){return oa("query VolunteersSegmentsPositions($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n acronym\n positionCategoryName\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.valuesGroups=(0,Lm.A)(Object.entries((0,fm.A)(e.positions.nodes,e=>e.positionCategoryName)).map(([e,n])=>({name:n[0].positionCategoryName,values:(0,Lm.A)(n.map(e=>({id:e.id,name:`${Jg(e)} - ${e.positionCategoryName}`})),e=>u(e.name))})),({name:e})=>u(e)),i.needLoading=!1}else if("hasOtherEventPosition"===i.slug&&i.organizationId){const{organization:{positions:e}}=await function(e,n){return oa("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:n||void 0,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},s);i.valuesGroups=(0,Lm.A)(Object.entries((0,fm.A)(e.nodes,e=>[e.event.id,e.positionCategoryName])).map(([e,n])=>({name:`${n[0].event.name}: ${n[0].positionCategoryName}`,values:(0,Lm.A)(n,e=>u(e.name))})),({name:e})=>u(e)),i.needLoading=!1}else if(["numberOfAssignments","positionSlotId","wishedPositionsSlots","checkInAtPositionSlot","checkOutAtPositionSlot"].includes(i.slug)){const{event:e}=await nr({eventId:i.eventId},s);i.valuesGroups=function(e,n){return(0,Lm.A)(n,e=>u(e.name)).flatMap(n=>(0,Lm.A)(n.positions,e=>u(e.name)).map(t=>({id:t.id,name:`${n.name} - ${Jg(t)}`,values:(0,Lm.A)(t.slots,e=>[e.range.start.toMillis(),e.name]).map(n=>{const i=Zg(e,n,Jg(t),{position:{includeNameAtEnd:!0}});return{id:n.id,name:i}})})))}(n,e.positionsCategories),i.needLoading=!1}else if(["positionCategory","preassignedPositionCategory","wishedPositionsCategories"].includes(i.slug)){const{event:e}=await function(e,n){return oa("query VolunteersSegmentsPositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.values=(0,Lm.A)(e.positionsCategories,e=>u(e.name)),i.needLoading=!1}else if("wishedSlotsCustom"===i.slug){const{event:n}=await function(e,n){return oa("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:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.valuesGroups=((e,n)=>{const t=n.customSlotsPeriods.flatMap(e=>Fh(e.startDate??n.startAt,e.endDate??n.endAt,e.customSlots,n.ranges,kn.AllDays));return(0,Lm.A)(Object.values((0,fm.A)(t,({interval:e})=>e.start.startOf("day").toMillis())),e=>e[0].interval.start.startOf("day").toMillis()).map(n=>{const t=n[0].interval;return{name:e.toLocaleString(t.start.startOf("day"),Uo.DateOnly.WeekdayLongMonthLong),values:n.map(({name:e,interval:n})=>({id:n.toISO(),name:Nh(e,n)}))}})})(e,n),i.needLoading=!1}else if(i.slug==Th.AccreditationProfile||i.slug===Th.WishedAccreditationProfile){const{event:e}=await function(e,n){return oa("query VolunteersSegmentsAccreditationsProfiles($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n acronym\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.valuesGroups=(0,Lm.A)(e.accreditationsProfilesCategories,e=>u(e.name)).map(e=>({name:e.name,values:(0,Lm.A)(e.accreditationsProfiles,e=>u(e.name)).map(n=>({id:n.id,name:`${rh(n)} - ${e.name}`}))})),i.needLoading=!1}else if("accreditation"===i.slug){const{event:e}=await function(e,n){return oa("query VolunteersSegmentsAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n acronym\n accreditationCategoryName\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.valuesGroups=(0,Lm.A)(Object.entries((0,fm.A)(e.accreditations.nodes,e=>e.accreditationCategoryName)).map(([e,n])=>({name:n[0].accreditationCategoryName,values:(0,Lm.A)(n.map(e=>({id:e.id,name:`${rh(e)} - ${e.accreditationCategoryName}`})),e=>u(e.name))})),({name:e})=>u(e)),i.needLoading=!1}else if("hasOtherEventAccreditation"===i.slug&&i.organizationId){const{organization:{accreditations:e}}=await function(e,n){return oa("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:n||void 0,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},s);i.valuesGroups=(0,Lm.A)(Object.entries((0,fm.A)(e.nodes,e=>e.accreditationCategoryName)).map(([e,n])=>({name:`${n[0].event.name}: ${n[0].accreditationCategoryName}`,values:(0,Lm.A)(n,e=>u(e.name))})),({name:e})=>u(e)),i.needLoading=!1}else if("accreditationCategory"===i.slug){const{event:e}=await function(e,n){return oa("query VolunteersSegmentsAccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.values=(0,Lm.A)(e.accreditationsCategories,e=>u(e.name)),i.needLoading=!1}else if("positionsSegments"===i.slug){const{event:e}=await function(e,n){return oa("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:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.valuesGroups=(0,Lm.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Lm.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("accreditationsSegments"===i.slug){const{event:e}=await function(e,n){return oa("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:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.valuesGroups=(0,Lm.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Lm.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("delegationsSegments"===i.slug||"isDelegationLeader"===i.slug){const{event:e}=await function(e,n){return oa("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:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.valuesGroups=(0,Lm.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Lm.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("forms"===i.slug||"form"===i.slug||"formsInsertedAt"===i.slug){const{event:e}=await function(e,n){return oa("query VolunteersSegmentsForms($eventId: EventId!) {\n event(id: $eventId) {\n forms {\n nodes {\n ...SegmentForm\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.SegmentFormFragment]})}({eventId:i.eventId},s);i.values=(0,Lm.A)(e.forms.nodes,e=>u(e.name)),i.needLoading=!1}else if("campaign"===i.slug||"campaignReply"===i.slug||"campaignSentAt"===i.slug){const{event:e}=await function(e,n){return oa("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:n||void 0,fragments:[$o.SegmentCampaignFragment]})}({eventId:i.eventId},s);i.campaigns=(0,Lm.A)(e.campaigns.nodes,e=>u(e.name)),i.values=i.campaigns,i.needLoading=!1}else if("delegation"===i.slug){const{event:e}=await function(e,n){return oa("query VolunteersSegmentsDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.values=(0,Lm.A)(e.delegations.nodes,e=>u(e.name)),i.needLoading=!1}else if(["numberOfAccreditations","accreditationSlotId","scannedAccreditationsSlots","wishedAccreditationsSlots"].includes(i.slug)){const{event:n}=await er({eventId:i.eventId,loadIsBlocked:!1},s);i.valuesGroups=function(e,n){return(0,Lm.A)(n,e=>u(e.name)).flatMap(n=>uh(n.accreditations).map(t=>{const i=Vh(t.slots);return{id:t.id,name:`${n.name} - ${rh(t)}`,values:i.map(n=>{const i=Uh(e,n,rh(t),{accreditation:{includeNameAtEnd:!0}});return{id:n.id,name:i}})}}))}(e,n.accreditationsCategories),i.needLoading=!1}else if(i.slug===Th.WeezaccessChecklists){const{event:e}=await function(e,n){return oa("query VolunteersWeezaccessChecklists($eventId: EventId!) {\n event(id: $eventId) {\n weezaccessChecklists {\n id\n name\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.values=(0,Lm.A)(e.weezaccessChecklists,e=>u(e.name)),i.needLoading=!1}else if("commentWrittenBy"===i.slug){const{organization:e}=await function(e,n){return oa("query VolunteersSegmentsLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n admins: usersInfos(isResourceCreator: true) {\n nodes {\n id\n nameOrEmail\n }\n }\n\n usersInfos(eventId: $eventId, hasRole: true) {\n nodes {\n id\n nameOrEmail\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},s);i.values=(0,Lm.A)((0,Rg.A)(e.admins.nodes.concat(e.usersInfos.nodes),e=>e.id),e=>u(e.nameOrEmail)).map(({id:e,nameOrEmail:n})=>({id:e,name:n})),i.needLoading=!1}else if(i.slug===jh.DelegationsSpaceLayout){const{event:e}=await function(e,n){return oa("query DelegationsSegmentsLayouts($eventId: EventId!) {\n event(id: $eventId) {\n delegationsSpaceLayouts {\n id\n name\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({eventId:i.eventId},s);i.values=(0,Lm.A)(e.delegationsSpaceLayouts,e=>u(e.name)),i.needLoading=!1}}else if(i.organizationId)if("event"===i.slug){const{organization:e}=await function(e,n){return oa("query UsersSegmentsEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n ...SegmentEvent\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.SegmentEventFragment]})}({organizationId:i.organizationId},s);i.values=(0,Lm.A)(e.events.nodes,e=>u(e.name)),i.needLoading=!1}else if("forms"===i.slug||"formsInsertedAt"===i.slug){const{organization:e}=await function(e,n){return oa("query UsersSegmentsForms($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n forms(level: Organization) {\n nodes {\n ...SegmentForm\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.SegmentFormFragment]})}({organizationId:i.organizationId},s);i.values=(0,Lm.A)(e.forms.nodes,e=>u(e.name)),i.needLoading=!1}else if("campaign"===i.slug){const{organization:e}=await function(e,n){return oa("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:n||void 0,fragments:[$o.SegmentCampaignFragment]})}({organizationId:i.organizationId},s);i.campaigns=(0,Lm.A)(e.campaigns.nodes,e=>u(e.name)),i.values=i.campaigns,i.needLoading=!1}else if("positionCustomField"===i.slug||"accreditationCustomField"===i.slug){const{organization:e}=await Ba({organizationId:i.organizationId,eventId:i.eventId,fieldTypes:[Qe.Checkbox,Qe.Select]},s);i.values=(0,Lm.A)(e.customFields.nodes,e=>u(e.name)),i.needLoading=!1}else if("delegation"===i.slug){const{organization:e}=await function(e,n){return oa("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:n||void 0,fragments:[]})}({organizationId:i.organizationId},s);i.valuesGroups=(0,Lm.A)(Object.entries((0,fm.A)(e.delegations.nodes,e=>e.event?.id||-1)).map(([n,t])=>({name:t[0].event?.name??e.name,values:(0,Lm.A)(t,e=>u(e.name))})),({name:e})=>u(e)),i.needLoading=!1}else if("usersSegments"===i.slug){const{organization:e}=await function(e,n){return oa("query VolunteersSegmentsUsersSegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, eventId: $eventId, segmentType: Volunteers) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({organizationId:i.organizationId,level:xn.Organization},s);i.valuesGroups=(0,Lm.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Lm.A)(e.segments,e=>e.index)})),i.needLoading=!1}})(e,n,t,i).finally(()=>{Gh.delete(i)}),Gh.set(i,s)),s};function Hh(e){const n=ki(Jm),t=ki(Bg),i=ki(Di),[s,o]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{e.needLoading&&(o(!0),qh(n,t,i,e).then(()=>{o(!1)}))},[e.needLoading]),s}const Yh={boxShadow:"$xs",color:"$gray800"},Zh=e=>{const n=ki(Og);return e.filterPredicate.filter.needLoading?(0,i.jsx)(Ku,{color:"white",css:Yh,leftIcon:"loader"}):e.isReadOnly?(0,i.jsx)(Ku,{color:"white",css:Yh,cursor:"default",ellipsis:!0,children:n.filterPredicateToText(e.filterPredicate)}):(0,i.jsx)(Ku,{color:"white",css:Yh,cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>e.onClick(e.filterPredicate),onRightIconClick:()=>e.onRemove(e.filterPredicate),children:n.filterPredicateToText(e.filterPredicate)})},Kh=e=>{const n=Fi();return(0,i.jsx)(Mr,{color:"gray800",css:{textTransform:"uppercase",whiteSpace:"nowrap"},fontSize:"textXs",fontWeight:"medium",children:e.operator===Tn.Or?n("Or"):n("And")})},Xh=e=>(0,i.jsx)(Tl,{align:"center",css:{background:"$gray100",borderRadius:"$1",maxWidth:"100%",minWidth:0,padding:"$1 $2"},gap:"2",wrap:"wrap",children:e.group.filtersPredicates.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[t>0&&(0,i.jsx)(Kh,{operator:e.group.operator}),(0,i.jsx)(Zh,{filterPredicate:n,isReadOnly:e.isReadOnly,onClick:e.onClick,onRemove:e.onRemove})]},n.predicateIndex))}),Qh=e=>{const n=Fi(),{filtersPredicates:t,clearNameCursors:s,setPredicates:o,setIsFilterOpen:a,setSelectedFilterPredicate:r,predicates:d}=pg(),l=(0,V.useMemo)(()=>$g(t),[t]),c=(0,V.useMemo)(()=>(0,Rg.A)(l,({filter:e})=>e.slug),[l]),u=(0,V.useCallback)(()=>{s(),o(fg())},[s,o]),m=(0,V.useCallback)(({groupIndex:e,predicateIndex:n})=>{r({groupIndex:e,predicateIndex:n}),a(!0)},[a,r]),g=(0,V.useCallback)(({groupIndex:e,predicateIndex:n})=>{s(),o(jg(d,e,n))},[d,s,o]);return function(e){const n=ki(Jm),t=ki(Bg),i=ki(Di),[s,o]=(0,V.useState)(!1);(0,V.useEffect)(()=>{const s=e.filter(({filter:e})=>e.needLoading);Yo(s)&&(o(!0),Promise.all(s.map(({filter:e})=>qh(n,t,i,e))).then(()=>{o(!1)}))},[e])}(c),Yo(l)?(0,i.jsxs)(Tl,{align:"center",gap:"2",width:1,wrap:"wrap",children:[t.groups.map((n,s)=>(0,i.jsxs)(V.Fragment,{children:[s>0&&(0,i.jsx)(Kh,{operator:t.operator}),(0,i.jsx)(Xh,{group:n,isReadOnly:e.isReadOnly,onClick:m,onRemove:g})]},n.groupIndex)),!e.isReadOnly&&(0,i.jsx)(Mr,{color:"gray700",css:{cursor:"pointer",marginLeft:"$1"},fontWeight:"medium",onClick:u,children:n("r_initialiser_l_66835")})]}):null},Jh=br("div",{alignItems:"center",borderRadius:"12px",cursor:"pointer",display:"flex",position:"relative",padding:"$1","&:hover":{background:"$gray300"},"& > div":{background:"white",boxShadow:"$sm",position:"absolute",transition:"left 200ms ease-in"},"& > i":{color:"white"},"&:focus":{outline:"none"},"&:focus-visible":{border:"1px solid $success500",boxShadow:"0 0 0 4px rgba(16, 167, 77, 0.16)"},variants:{disabled:{true:{cursor:"not-allowed",background:"$gray100","&:hover":{background:"$gray100"},"&:focus-visible":{border:"1px solid $gray300",boxShadow:"0 0 0 4px rgba(206, 206, 206, 0.4)"},"& > i":{color:"$gray400"}}},size:{sm:{blockSize:"16px",inlineSize:"30px","& > div":{borderRadius:"12px",blockSize:"12px",inlineSize:"12px"},"& > i":{fontSize:"8px"}},md:{blockSize:"24px",inlineSize:"44px","& > div":{borderRadius:"20px",blockSize:"20px",inlineSize:"20px"},"& > i":{fontSize:"12px",paddingInlineStart:"2px"}}},state:{unchecked:{background:"$gray200","& > div":{left:"2px"}},checked:{background:"$success500","&:hover":{background:"$success600"}}}},compoundVariants:[{size:"sm",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 12px)"}}},{size:"md",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 20px)"}}},{disabled:!0,state:"checked",css:{background:"$gray100","&:hover":{background:"$gray100"}}}],defaultVariants:{size:"sm"}}),ep=e=>(0,i.jsxs)(Jh,{"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:n=>{e.disabled||"Space"!==n.code||(n.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(Yl,{height:"8",icon:"check",width:"8"}),(0,i.jsx)("div",{})]}),np=e=>{const{inputId:n,descId:t,labelId:s}=Sc(),o=g(e.subtext);return(0,i.jsxs)(Tl,{align:"center","aria-keyshortcuts":e["aria-keyshortcuts"],css:{cursor:e.disabled?"auto":"pointer",userSelect:"none",...e.css},onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:n=>{e.disabled||"Space"!==n.code||(n.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(ep,{descId:t,disabled:e.disabled,inputId:n,labelId:s,size:e.size,value:e.value,onChange:Bc.A}),(0,i.jsx)(Pl,{width:"2"}),(0,i.jsxs)(Tl,{css:{flex:"1",fontSize:"md"===e.size?"$3":"$2"},direction:"column",children:[(0,i.jsx)(bc,{htmlFor:n,id:s,children:(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:e.children})}),o&&(0,i.jsx)(Mr,{color:"gray500",id:t,children:e.subtext})]})]})};function tp(){return(0,V.useMemo)(()=>navigator.platform.toLowerCase().startsWith("mac"),[])}function ip(e,n){const t=tp(),i=(0,V.useCallback)(i=>{i.key===e&&(t&&i.metaKey||!t&&i.ctrlKey)&&n(i)},[e,n]);(0,V.useEffect)(()=>(document.addEventListener("keydown",i,!1),()=>{document.removeEventListener("keydown",i,!1)}),[e,n,i])}const sp=e=>{const{translate:n}=Kl(),{columnsSearch:t,setColumnsSearch:s}=pg(),[o,a]=(0,V.useState)(""),r=(0,V.useMemo)(()=>g(o)?e.searchableColumns.filter(e=>u(e.name).includes(u(o))):e.searchableColumns,[e.searchableColumns,o]);return(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(Fu,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Tl,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("rechercher_sur_85243")}),(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("filtrer_78031"),state:"search",value:o,onChange:a}),(0,i.jsx)(Tl,{direction:"column",gap:"3",children:r.map(({slug:e,name:n})=>(0,i.jsx)(om,{state:t.includes(e)?"checked":"unchecked",onClick:n=>{s(Ko(t,e,"checked"===n))},children:n},e))})]})})]})},op=e=>{const n=Fi(),{isEditMode:t,massActions:s,name:o,possibleColumns:a,possibleRenderings:r,rendering:d,setAreColumnsOpen:l,setIsEditMode:c,setIsFilterOpen:u,setName:m,setNameDebounced:g,setRendering:h,setSelectedFilterPredicate:p}=pg(),I=tp(),x=e.showActions&&!!e.actions&&s.numberOfSelected>0,f=(0,V.useMemo)(()=>(0,Lm.A)(a.filter(e=>e.isSearchable),e=>e.name),[a]),_=(0,V.useMemo)(()=>e.showSearchColumns?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[e.showSearchColumns]);return ip("e",(0,V.useCallback)(()=>{e.showEditMode&&c(!t)},[t,e.showEditMode,c])),(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsxs)(Tl,{width:320,children:[(0,i.jsx)(wc,{autoFocus:!0,css:_,icon:"magnifying-glass",placeholder:e.searchPlaceholder??n("rechercher_50038"),value:o,onChange:e=>{m(e),g(e)}}),e.showSearchColumns&&(0,i.jsx)(sp,{searchableColumns:f})]}),x?(0,i.jsx)(Tl,{css:{flex:"1",justifyContent:"right"},gap:"4",children:e.actions}):(0,i.jsxs)(Tl,{css:{flex:"1"},gap:"4",children:[e.showFilters&&(0,i.jsx)(tc,{color:"gray",leftIcon:"bars-filter",onClick:()=>{p(null),u(!0)},children:n("filtres_64574")}),(0,i.jsx)(Mr,{css:{flex:"1"}}),e.controls,Yo(r)&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:fh(d),children:_h(n,d)})}),(0,i.jsx)(Fu,{placement:"bottom-end",children:r.map(e=>(0,i.jsx)(Pu,{icon:fh(e),onClick:()=>h(e),children:_h(n,e)},e))})]}),e.showEditColumns&&(0,i.jsx)(tc,{color:"white",leftIcon:"gear",onClick:()=>{l(!0)},children:n("_diter_les_colo_39630")}),e.showEditMode&&(0,i.jsx)(np,{"aria-keyshortcuts":(I?"Meta":"Control")+"+E",value:t,onChange:c,children:n("mode_dition_93778")})]})]})},ap=e=>{const n=Fi(),{massActions:t}=pg(),s=(0,V.useCallback)(()=>{t.toggleSelectAll("unchecked"),t.setIsAllSelected(!1)},[t]),o=(0,V.useCallback)(()=>{t.setIsAllSelected(!0)},[t]);return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(Mr,{fontSize:"textMd",fontWeight:"medium",children:(0,i.jsx)(Yl,{icon:"circle-exclamation"})}),(0,i.jsx)(Mr,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:t.isAllSelected?e.allSelectedText:e.pageSelectedText}),t.isAllSelected?(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:s,children:n("effacer_la_s_le_85095")}):(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:o,children:e.selectAllText})]})},rp=e=>{const{limit:n,massActions:t,reload:s,showMassActions:o,totalCount:a}=pg(),r=o&&e.showSelectAll&&t.numberOfSelected===n&&a>n;return(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$1",borderTopRightRadius:"$1",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(op,{actions:e.renderActions?.(t,a,s),controls:e.renderControls?.(),showActions:o,showEditColumns:e.showEditColumns??!1,showEditMode:e.showEditMode??!1,showFilters:e.showFilters??!1,showSearchColumns:e.showSearchColumns??!1}),e.showPredicatesBadges&&(0,i.jsx)(Qh,{isReadOnly:!e.showFilters}),r&&(0,i.jsx)(ap,{allSelectedText:e.renderAllSelectedText?.(a)??"",pageSelectedText:e.renderPageSelectedText?.(n)??"",selectAllText:e.renderSelectAllText?.(a)??""})]})};var dp=t(1932),lp=t(3627),cp=t(4979);function up(e,n){const{attributes:t,isDragging:i,listeners:s,setActivatorNodeRef:o,setNodeRef:a,transform:r,transition:d}=(0,lp.gl)({id:e,data:n});return{handleProps:{ref:o,...t,...s},isDragging:i,setNodeRef:a,style:{position:"relative",transform:cp.Ks.Translate.toString(r),transition:d,zIndex:i?1:void 0}}}const mp=e=>{const{setNodeRef:n,style:t,handleProps:s}=up(e.column.slug);return(0,i.jsxs)(Tl,{ref:n,css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",style:t,children:[(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"grab"},...s,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name}),g(e.column.label)&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},title:e.column.label,width:1,children:e.column.label})]}),(0,i.jsx)(ep,{value:e.column.isSelected,onChange:e.onToggle})]})},gp=({children:e,css:n,onClose:t,returnToFallback:s,size:o})=>{const a=Bi(),r=()=>{t?t():a.goBack(s??yo.HOME)};return wu(r),tm("common-front/src/designSystem/components/rightPanels/__deprecated/rightPanel.tsx","common-front/src/designSystem/components/rightPanels/base/rightPanel.tsx"),(0,St.createPortal)((0,i.jsx)(Tl,{css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"100",...n},"data-testid":"right-panel-backdrop",onClick:r,children:(0,i.jsxs)(Tl,{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=>jc(e,!1),children:[(0,i.jsx)(Mr,{color:"gray500",css:{cursor:"pointer",fontSize:"$textMd",position:"absolute",right:"$space$6",top:"$space$6"},onClick:r,children:(0,i.jsx)("i",{className:"far fa-xmark"})}),e]})}),document.body)},hp=V.forwardRef((e,n)=>(0,i.jsx)(Tl,{ref:n,css:{flex:"1",overflowY:"auto",px:"$6",...e.css},direction:"column",children:e.children}));hp.displayName="RightPanelBody";const pp=e=>(0,i.jsx)(Mr,{color:"gray800",css:{borderTop:"1px solid $gray200",px:"$6",py:"$4"},children:e.children});var Ip=t(3375),xp=t(8831);const fp=[xp.FN,xp.Mk],_p=e=>{const n=(0,Ip.FR)((0,Ip.MS)(Ip.AN,{activationConstraint:{distance:4}}),(0,Ip.MS)(Ip.uN,{coordinateGetter:lp.JR})),t=(0,V.useCallback)(({active:n,over:t})=>{if(t&&n.id!==t.id){const i=e.ids.indexOf(n.id),s=e.ids.indexOf(t.id);-1!==i&&-1!==s&&e.onReorder(i,s)}},[e.ids,e.onReorder]);return(0,i.jsx)(Ip.Mp,{collisionDetection:Ip.fp,modifiers:fp,sensors:n,onDragEnd:t,children:(0,i.jsx)(lp.gB,{items:e.ids,strategy:lp._G,children:e.children})})},jp=e=>{const n=Fi(),[t,s]=(0,V.useState)(""),[o,a]=(0,V.useState)((0,Lm.A)(e.columns.map(n=>({...n,isSelected:e.initialSelectedColumns.includes(n.slug)})),[({slug:n})=>{const t=e.initialSelectedColumns.indexOf(n);return-1===t?e.columns.length:t},({name:e})=>e])),r=e=>{if(g(t)){const n=u(t);return u(e.name).includes(n)||g(e.label)&&u(e.label).includes(n)}return!0},d=o.filter(r).map(e=>e.slug);return(0,i.jsxs)(gp,{css:e.css,size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(hp,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXl",children:e.title}),(0,i.jsx)(Mr,{color:"gray500",children:e.subtitle}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:t,onChange:s}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:n("liste_des_champ_00325")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(_p,{ids:d,onReorder:(e,n)=>{const t=o.map(e=>e.slug);a(Qo(o,t.indexOf(d[e]),t.indexOf(d[n])))},children:(0,i.jsx)(Tl,{direction:"column",gap:"2",children:o.map((e,n)=>r(e)?(0,i.jsx)(mp,{column:e,onToggle:()=>{((e,n)=>{a((0,dp.jM)(t=>{t[n].isSelected=!e.isSelected}))})(e,n)}},e.slug):null)})}),(0,i.jsx)(Pl,{height:"6"})]}),(0,i.jsx)(pp,{children:(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{onClick:()=>{e.onSave(o.filter(e=>e.isSelected).map(e=>e.slug)),e.onClose()},children:e.saveButtonText}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})})]})};var vp=t(903);const Sp=Oo.c9.fromObject({year:1920,month:1,day:1}),yp=Oo.c9.now();function Cp(e){if(Oo.c9.isDateTime(e)&&e?.isValid)return e;if(g(e)){const n=Oo.c9.fromISO(e);return n.isValid?n:null}return null}const bp=["isLeader","isPositionLeader","isPositionCategoryLeader","isDelegationLeader"],Ap=[$n.IsInLast,$n.IsMoreThanAgo,$n.IsInNext,$n.IsMoreThanAhead],Ep=[$n.Is,$n.IsNot,$n.GreaterThan,$n.GreaterThanEqual,$n.LessThan,$n.LessThanEqual];function wp(e){const{slug:n,fieldType:t}=e;if("condition"===n)return"condition";if(bp.includes(n))return"leader";if("isAdmin"===n)return"admin";if("privacy"===n)return"privacy";if("isTeam"===n)return"team";if("wishedPositions"===n||"wishedPositionsCategories"===n)return"wishedPositions";if("numberOfAssignmentsPerDay"===n||"volunteersMinutesDays"===n)return"numberPerDay";if("campaignReply"===n)return"campaignReply";switch(t){case nn.Address:case nn.Text:case nn.Textarea:return"text";case nn.Country:case nn.Language:case nn.Nationality:case nn.Select:case nn.Sex:return"select";case nn.Checkbox:case nn.Validation:return"checkbox";case nn.Phone:return"phone";case nn.Number:return"number";case nn.DateTimeRange:return"dateTimeRange";case nn.Date:return"date";case nn.Datetime:return"datetime";case nn.File:return"file";case nn.Campaign:return"campaign";default:return"unknown"}}function $p(e){return"numberOfAccreditations"===e||"numberOfAssignments"===e}function Tp(e){const n=e.slug,t=(e,t)=>({slug:n,operator:e,...t});switch(wp(e)){case"condition":case"leader":case"select":return t($n.Is,{value:[]});case"admin":case"privacy":case"team":case"unknown":return t($n.Is,{value:""});case"file":return t($n.IsEmpty,{value:""});case"wishedPositions":return t($n.Is,{value:[],value2:1});case"numberPerDay":return t($n.Is,{value:"",value2:"",value3:""});case"campaignReply":return t($n.Contains,{value:[],value2:""});case"campaign":return t($n.Is,{value:[],value2:[]});case"text":case"phone":return t(e.isEncrypted?$n.IsEmpty:$n.Contains,{value:""});case"checkbox":return t($n.Is,{value:!0});case"number":return t($n.Is,{value:"",value2:"",value3:$p(n)?[]:"",value4:""});case"dateTimeRange":return t($n.Contains,{value:"",value2:""});case"date":return bg(t($n.Is,{value:"",value2:"",value3:yg(n)?[]:void 0,valueDate:{day:-1,month:-1,year:-1}}));case"datetime":return t($n.Is,{value:"",value2:""})}}function zp(e){return null!==Cp(e)}function Op(e){return Number.isInteger(e)&&e>=0}function Rp(e){return"number"==typeof e}function Dp(e){return null==e||""===e}function Mp(e,n,t){return Ep.includes(e.operator)?Rp(n):e.operator!==$n.Between||Rp(n)&&Rp(t)}function Pp(e,n){const{operator:t,value:i,value2:s,value3:o,value4:a}=n;switch(wp(e)){case"condition":return t===$n.Is||t===$n.IsNot||Yo(i);case"leader":return t!==$n.Contains||Yo(i);case"select":return t!==$n.Is&&t!==$n.IsNot||Yo(i);case"admin":case"privacy":case"team":case"file":case"checkbox":return!0;case"wishedPositions":return Yo(i)||t===$n.IsEmpty||t===$n.IsNotEmpty;case"numberPerDay":return zp(i)&&(Ep.includes(t)||t===$n.Between)&&Mp(n,s,o);case"campaignReply":return Yo(i)&&(t===$n.Contains&&g(s)||t===$n.IsEmpty||t===$n.IsNotEmpty);case"campaign":return Yo(i)&&Yo(s);case"text":case"phone":return t!==$n.Contains&&t!==$n.NotContains||g(i);case"number":return($p(e.slug)||Dp(o)&&Dp(a)||zp(o)&&zp(a))&&Mp(n,i,s);case"dateTimeRange":return zp(i)&&([$n.Contains,$n.NotContains,$n.Is].includes(t)||zp(s));case"date":{const t=Cg(n);return function(e){const{operator:n,value:t,value2:i,valueDate:s}=e;return n===$n.Is||n===$n.IsNot?[s?.day,s?.month,s?.year].some(e=>"number"==typeof e&&-1!==e):n===$n.IsBefore||n===$n.IsAfter?zp(t):n===$n.Between?zp(t)&&zp(i):!Ap.includes(n)||Op(t)}(t)&&(!yg(e.slug)||Yo(t.value3))}case"datetime":return function(e){const{operator:n,value:t,value2:i}=e;return[$n.Is,$n.IsNot,$n.IsBefore,$n.IsAfter].includes(n)?zp(t):n===$n.Between?zp(t)&&zp(i):!Ap.includes(n)||Op(t)}(n);case"unknown":return!1}}const kp=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.value??[]),[o,a]=(0,V.useState)(e.filterPredicate.predicate?.value2??[]),r=e.filterPredicate.filter.campaigns??[],d=(0,wo.A)(r.filter(({id:e})=>t.includes(e)).map(({campaignType:e})=>e)),l=(0,wo.A)(["NotSent",...d.includes(ve.Email)?Lt.filter(e=>e!==Le.Queued):[],...d.includes(ve.Sms)?fi:[]]),c={operator:$n.Is,value:t,value2:o,slug:e.filterPredicate.filter.slug},u=Pp(e.filterPredicate.filter,c);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_28439"),values:t,onChange:s,children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),t.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_62901"),values:o,onChange:a,children:l.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!u,onClick:()=>{e.onAdd(c)},children:n("ajouter_le_filt_54222")})})]})},Fp=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.value??[]),[o,a]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Contains),[r,d]=(0,V.useState)(e.filterPredicate.predicate?.value2??[]),l=e.filterPredicate.filter.campaigns??[],c={operator:o,value:t,value2:r,slug:e.filterPredicate.filter.slug},u=Pp(e.filterPredicate.filter,c);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_28439"),values:t,onChange:s,children:l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),t.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"contains"===o?"checked":"unchecked",onClick:()=>a($n.Contains),children:n("contient_34012")}),"contains"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isEmpty"===o?"checked":"unchecked",onClick:()=>a($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===o?"checked":"unchecked",onClick:()=>a($n.IsNotEmpty),children:n("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!u,onClick:()=>{e.onAdd(c)},children:n("ajouter_le_filt_54222")})})]})},Np=br("select",{backgroundColor:"$white",height:"100%",left:0,opacity:0,position:"absolute",top:0,width:"100%"}),Lp=br("div",{ellipsis:""}),Up=({autoComplete:e,children:n,css:t,label:s,description:o,shouldParseAsInt:a,shouldParseAsBoolean:r,onChange:d,hint:l,icon:c,state:u,value:m="",...g})=>{const h=V.useMemo(()=>Im(pm(n)),[n]),{inputId:p,descId:I,errorId:x}=Sc();return(0,i.jsxs)(Tl,{css:t,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:p,children:s}),(0,i.jsx)(yc,{id:I,children:o}),(s||o)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Ec,{cursor:"default",icon:c,state:u,children:[(0,i.jsx)(Tl,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,width:1,children:(0,i.jsx)(Lp,{children:h[m.toString()]})}),(0,i.jsx)(Tl,{css:{color:"$gray500"},children:(0,i.jsx)(Yl,{icon:"chevron-down"})}),(0,i.jsx)(Np,{"aria-describedby":o?I: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:m.toString(),onChange:e=>{d(a?parseInt(e.target.value,10):r?"true"===e.target.value:e.target.value)},...g,children:n})]}),(0,i.jsx)(Cc,{id:x,state:u,children:l})]})},Vp=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is),[o,a]=(0,V.useState)(e.filterPredicate.predicate?.value??!0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("est_25967")}),"is"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsxs)(Up,{shouldParseAsBoolean:!0,value:o,onChange:a,children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("n_est_pas_97826")}),"isNot"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsxs)(Up,{shouldParseAsBoolean:!0,value:o,onChange:a,children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]})]}),(0,i.jsx)(Pl,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsNotEmpty),children:n("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:()=>{e.onAdd({operator:t,value:o,slug:e.filterPredicate.filter.slug})},children:n("ajouter_le_filt_54222")})})]})},Bp=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is),o=e.filterPredicate.filter.values??[],[a,r]=(0,V.useState)(Yo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),d={operator:t,value:a,slug:e.filterPredicate.filter.slug},l=Pp(e.filterPredicate.filter,d);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("champ_dont_un_a_44854")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("champ_d_pendant_33676")}),o.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"contains"===t?"checked":"unchecked",onClick:()=>s($n.Contains),children:n("d_pends_du_cham_39787")}),"contains"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:a,onChange:r,children:o.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]}),(0,i.jsx)(Pl,{height:"1"})]})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!l,onClick:()=>{e.onAdd(d)},children:n("ajouter_le_filt_54222")})})]})},Wp=({value:e,css:n,label:t,description:s,hint:o,icon:a,min:r,onChange:d,max:l,state:c,rightIcon:u,onRightIconClick:m,zone:h,...p})=>{const I=e?Cp(e):null,x=I?.isValid?I.toFormat(Ro):"",{inputId:f,descId:_,errorId:j}=Sc();return(0,i.jsxs)(Tl,{css:n,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:f,children:t}),(0,i.jsx)(yc,{id:_,children:s}),(t||s)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Ec,{cursor:"default",icon:a,rightIcon:u,state:c,onRightIconClick:m,children:(0,i.jsx)(Mr,{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?_:void 0,"aria-errormessage":"error"===c?j:void 0,"aria-invalid":"error"===c,disabled:"disabled"===c,id:f,max:l?.toFormat(Ro),min:r?.toFormat(Ro),type:"date",value:x,onChange:e=>{g(e.target.value)?d(Oo.c9.fromFormat(e.target.value,Ro,{zone:h||"UTC"})):d(Oo.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Cc,{id:j,state:c,children:o})]})},Gp=[$n.IsInLast,$n.IsMoreThanAgo,$n.IsInNext,$n.IsMoreThanAhead],qp=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:e.operator===e.relativeOperator?"checked":"unchecked",onClick:()=>e.setOperator(e.relativeOperator),children:e.label}),e.operator===e.relativeOperator&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{align:"center",children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:e.days,onChange:e.setDays})]}),(0,i.jsx)(Pl,{height:"1"})]})]});var Hp=t(3551);const Yp=e=>{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>Oo.c9.now().startOf("year"),[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsxs)(Up,{shouldParseAsInt:!0,value:e.value.day,onChange:n=>{e.setValue({...e.value,day:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("jour_74089")}),(0,Om.A)(1,32).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsxs)(Up,{shouldParseAsInt:!0,value:e.value.month,onChange:n=>{e.setValue({...e.value,month:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("mois_10165")}),(0,Om.A)(1,13).map(e=>{const n=t.toLocaleString(s.set({month:e}),{month:"long"});return(0,i.jsx)("option",{value:e,children:n},e)})]})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsxs)(Up,{shouldParseAsInt:!0,value:e.value.year,onChange:n=>{e.setValue({...e.value,year:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("ann_e_38546")}),(0,Hp.A)(1900,s.year+2).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(Pl,{height:"1"})]})},Zp=e=>{const n=Fi(),t=yg(e.filterPredicate.filter.slug),s=e.filterPredicate.predicate?Cg(e.filterPredicate.predicate):void 0,o=(0,V.useMemo)(()=>(e.filterPredicate.filter.values||[]).map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e)),[e.filterPredicate.filter]),[a,r]=(0,V.useState)(t?s?.value3??[]:[]),[d,l]=(0,V.useState)(s?.operator??$n.Is),[c,u]=(0,V.useState)(Cp(s?.value)||""),[m,g]=(0,V.useState)(Cp(s?.value2)||""),[h,p]=(0,V.useState)(s?.valueDate??{day:-1,month:-1,year:-1}),[I,x]=(0,V.useState)(Gp.includes(d)?s?.value??"":""),f=Gp.includes(d),_=bg({operator:d,value:f?I:c,value2:f?"":m,value3:t?a:void 0,valueDate:h,slug:e.filterPredicate.filter.slug}),j=Pp(e.filterPredicate.filter,_);return(0,i.jsxs)(i.Fragment,{children:[t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:"campaignSentAt"===e.filterPredicate.filter.slug?n("s_lectionner_un_28439"):n("s_lectionner_un_13356"),values:a,onChange:r,children:o}),(0,i.jsx)(Pl,{height:"3"})]}),(!t||a.length>0)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===d?"checked":"unchecked",onClick:()=>l($n.Is),children:n("est_25967")}),"is"===d&&(0,i.jsx)(Yp,{setValue:p,value:h}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===d?"checked":"unchecked",onClick:()=>l($n.IsNot),children:n("n_est_pas_97826")}),"isNot"===d&&(0,i.jsx)(Yp,{setValue:p,value:h}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isBefore"===d?"checked":"unchecked",onClick:()=>l($n.IsBefore),children:n("est_avant_le_16689")}),"isBefore"===d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:c,onChange:u})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isAfter"===d?"checked":"unchecked",onClick:()=>l($n.IsAfter),children:n("est_apr_s_le_79703")}),"isAfter"===d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:c,onChange:u})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"between"===d?"checked":"unchecked",onClick:()=>l($n.Between),children:n("est_entre_born_59665")}),"between"===d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:c,onChange:u}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:m,onChange:g})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(qp,{days:I,label:n("est_dans_les_n_05750"),operator:d,relativeOperator:$n.IsInLast,setDays:x,setOperator:l}),(0,i.jsx)(qp,{days:I,label:n("est_il_y_a_plus_04600"),operator:d,relativeOperator:$n.IsMoreThanAgo,setDays:x,setOperator:l}),(0,i.jsx)(qp,{days:I,label:n("est_dans_les_n_72234"),operator:d,relativeOperator:$n.IsInNext,setDays:x,setOperator:l}),(0,i.jsx)(qp,{days:I,label:n("est_dans_plus_d_94311"),operator:d,relativeOperator:$n.IsMoreThanAhead,setDays:x,setOperator:l}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"today"===d?"checked":"unchecked",onClick:()=>l($n.Today),children:n("est_aujourd_hui_82571")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"thisDayMonth"===d?"checked":"unchecked",onClick:()=>l($n.ThisDayMonth),children:n("est_aujourd_hui_70881")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isEmpty"===d?"checked":"unchecked",onClick:()=>l($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===d?"checked":"unchecked",onClick:()=>l($n.IsNotEmpty),children:n("n_est_pas_vide_45804")})]})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!j,onClick:()=>{e.onAdd(_)},children:n("ajouter_le_filt_54222")})})]})},Kp=({value:e,css:n,label:t,description:s,hint:o,icon:a,min:r,onChange:d,max:l,rightIcon:c,onRightIconClick:u,state:m,zone:h,...p})=>{const I=e?g(e)?Oo.c9.fromISO(e,{zone:"utc"}):e:null,x=I?.isValid?I.toFormat(Do):"",{inputId:f,descId:_,errorId:j}=Sc();return(0,i.jsxs)(Tl,{css:n,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:f,children:t}),(0,i.jsx)(yc,{id:_,children:s}),(t||s)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Ec,{cursor:"default",icon:a,rightIcon:c,state:m,onRightIconClick:u,children:(0,i.jsx)(Mr,{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?_:void 0,"aria-errormessage":"error"===m?j:void 0,"aria-invalid":"error"===m,disabled:"disabled"===m,id:f,max:l?.toFormat(Do),min:r?.toFormat(Do),type:"datetime-local",value:x,onChange:e=>{g(e.target.value)?d(Oo.c9.fromFormat(e.target.value,Do,{zone:h||"UTC"})):d(Oo.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Cc,{id:j,state:m,children:o})]})},Xp=e=>{const n=Fi(),t=(0,V.useMemo)(()=>e.filterPredicate.filter.useLocalZone?Bo():void 0,[e.filterPredicate]),[s,o]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is),[a,r]=(0,V.useState)(Cp(e.filterPredicate.predicate?.value)||""),[d,l]=(0,V.useState)(Cp(e.filterPredicate.predicate?.value2)||""),[c,u]=(0,V.useState)(Gp.includes(s)?e.filterPredicate.predicate?.value??"":""),m=Gp.includes(s),g={operator:s,value:m?c:a,value2:m?"":d,slug:e.filterPredicate.filter.slug},h=Pp(e.filterPredicate.filter,g);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===s?"checked":"unchecked",onClick:()=>o($n.Is),children:n("est_25967")}),"is"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:a,onChange:r})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===s?"checked":"unchecked",onClick:()=>o($n.IsNot),children:n("n_est_pas_97826")}),"isNot"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:a,onChange:r})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isBefore"===s?"checked":"unchecked",onClick:()=>o($n.IsBefore),children:n("est_avant_le_16689")}),"isBefore"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{value:a,zone:t,onChange:r})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isAfter"===s?"checked":"unchecked",onClick:()=>o($n.IsAfter),children:n("est_apr_s_le_79703")}),"isAfter"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{value:a,zone:t,onChange:r})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"between"===s?"checked":"unchecked",onClick:()=>o($n.Between),children:n("est_entre_born_59665")}),"between"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{value:a,zone:t,onChange:r})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{value:d,zone:t,onChange:l})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(qp,{days:c,label:n("est_dans_les_n_05750"),operator:s,relativeOperator:$n.IsInLast,setDays:u,setOperator:o}),(0,i.jsx)(qp,{days:c,label:n("est_il_y_a_plus_04600"),operator:s,relativeOperator:$n.IsMoreThanAgo,setDays:u,setOperator:o}),(0,i.jsx)(qp,{days:c,label:n("est_dans_les_n_72234"),operator:s,relativeOperator:$n.IsInNext,setDays:u,setOperator:o}),(0,i.jsx)(qp,{days:c,label:n("est_dans_plus_d_94311"),operator:s,relativeOperator:$n.IsMoreThanAhead,setDays:u,setOperator:o}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"today"===s?"checked":"unchecked",onClick:()=>o($n.Today),children:n("est_aujourd_hui_82571")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isEmpty"===s?"checked":"unchecked",onClick:()=>o($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===s?"checked":"unchecked",onClick:()=>o($n.IsNotEmpty),children:n("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!h,onClick:()=>{e.onAdd(g)},children:n("ajouter_le_filt_54222")})})]})},Qp=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Contains),[o,a]=(0,V.useState)(e.filterPredicate.predicate?.value??""),[r,d]=(0,V.useState)(e.filterPredicate.predicate?.value2??""),l={operator:t,value:o,value2:r,slug:e.filterPredicate.filter.slug},c=Pp(e.filterPredicate.filter,l);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"contains"===t?"checked":"unchecked",onClick:()=>s($n.Contains),children:n("contient_34012")}),"contains"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("contient_date_89885")}),"is"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:a})]})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"notContains"===t?"checked":"unchecked",onClick:()=>s($n.NotContains),children:n("ne_contient_pas_85399")}),"notContains"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"overlaps"===t?"checked":"unchecked",onClick:()=>s($n.Overlaps),children:n("chevauche_49445")}),"overlaps"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("d_but_41840"),value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("fin_60104"),value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"notOverlaps"===t?"checked":"unchecked",onClick:()=>s($n.NotOverlaps),children:n("ne_chevauche_pa_17307")}),"notOverlaps"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("d_but_41840"),value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("fin_60104"),value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"engulfs"===t?"checked":"unchecked",onClick:()=>s($n.Engulfs),children:n("engloutis_42346")}),"engulfs"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("d_but_41840"),value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("fin_60104"),value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"notEngulfs"===t?"checked":"unchecked",onClick:()=>s($n.NotEngulfs),children:n("n_engloutis_pas_42363")}),"notEngulfs"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("d_but_41840"),value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("fin_60104"),value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"engulfedBy"===t?"checked":"unchecked",onClick:()=>s($n.EngulfedBy),children:n("est_englouti_pa_47852")}),"engulfedBy"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("d_but_41840"),value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("fin_60104"),value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"notEngulfedBy"===t?"checked":"unchecked",onClick:()=>s($n.NotEngulfedBy),children:n("n_est_pas_englo_08733")}),"notEngulfedBy"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("d_but_41840"),value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Kp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:n("fin_60104"),value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!c,onClick:()=>{e.onAdd(l)},children:n("ajouter_le_filt_54222")})})]})},Jp=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.IsEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"isEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsNotEmpty),children:n("n_est_pas_vide_45804")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:()=>{e.onAdd({operator:t,value:"",slug:e.filterPredicate.filter.slug})},children:n("ajouter_le_filt_54222")})})]})},eI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("est_administrat_15766")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("n_est_pas_admin_58612")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:()=>{e.onAdd({operator:t,value:"",slug:e.filterPredicate.filter.slug})},children:n("ajouter_le_filt_54222")})})]})},nI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is),o=(0,V.useMemo)(()=>Tg(e.filterPredicate.filter,n),[e.filterPredicate.filter]),[a,r]=(0,V.useState)(Yo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),d={operator:t,value:a,slug:e.filterPredicate.filter.slug},l=Pp(e.filterPredicate.filter,d),c=(0,V.useMemo)(()=>Array.isArray(a)?a.length:0,[a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("est_responsable_47377")}),(0,i.jsx)(Pl,{height:"3"}),"isDelegationLeader"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"contains"===t?"checked":"unchecked",onClick:()=>s($n.Contains),children:n("est_responsable_00281")}),"contains"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{hint:n("_1_s_lectionn_51286",c),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:a,onChange:r,children:o})}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"})]}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("n_est_pas_respo_55625")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!l,onClick:()=>{e.onAdd(d)},children:n("ajouter_le_filt_54222")})})]})},tI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("est_inscrit_en_86193")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("n_est_pas_inscr_25311")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:()=>{e.onAdd({operator:t,value:"",slug:e.filterPredicate.filter.slug})},children:n("ajouter_le_filt_54222")})})]})},iI=br("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"}}),sI=e=>(0,i.jsx)(iI,{"aria-orientation":e.direction,color:e.color,css:e.css,direction:e.direction,role:"separator"}),oI=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:e.height}),(0,i.jsx)(iI,{color:e.color,direction:"horizontal",role:"separator"}),(0,i.jsx)(Pl,{height:e.height})]}),aI=e=>{const n=Fi(),t="numberOfAccreditations"===e.filterPredicate.filter.slug,s="numberOfAssignments"===e.filterPredicate.filter.slug,[o,a]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is),[r,d]=(0,V.useState)(e.filterPredicate.predicate?.value??""),[l,c]=(0,V.useState)(e.filterPredicate.predicate?.value2??""),[u,m]=(0,V.useState)(Cp(e.filterPredicate.predicate?.value3)||""),[g,h]=(0,V.useState)(Cp(e.filterPredicate.predicate?.value4)||""),[p,I]=(0,V.useState)(Oo.c9.isDateTime(u)&&u.isValid&&Oo.c9.isDateTime(g)&&g.isValid?"checked":"unchecked"),[x,f]=(0,V.useState)(!t||Zo(e.filterPredicate.predicate?.value3)),[_,j]=(0,V.useState)(t&&Yo(e.filterPredicate.predicate?.value3)?e.filterPredicate.predicate?.value3:[]),[v,S]=(0,V.useState)(!s||Zo(e.filterPredicate.predicate?.value3)),[y,C]=(0,V.useState)(s&&Yo(e.filterPredicate.predicate?.value3)?e.filterPredicate.predicate?.value3:[]),b={operator:o,value:r,value2:l,value3:t?_:s?y:"checked"===p?u:"",value4:"checked"===p?g:"",slug:e.filterPredicate.filter.slug},A=Pp(e.filterPredicate.filter,b);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===o?"checked":"unchecked",onClick:()=>a($n.Is),children:n("est_25967")}),"is"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===o?"checked":"unchecked",onClick:()=>a($n.IsNot),children:n("n_est_pas_97826")}),"isNot"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"greaterThan"===o?"checked":"unchecked",onClick:()=>a($n.GreaterThan),children:n("plus_grand_que_28412")}),"greaterThan"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"greaterThanEqual"===o?"checked":"unchecked",onClick:()=>a($n.GreaterThanEqual),children:n("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"lessThan"===o?"checked":"unchecked",onClick:()=>a($n.LessThan),children:n("plus_petit_que_35846")}),"lessThan"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"lessThanEqual"===o?"checked":"unchecked",onClick:()=>a($n.LessThanEqual),children:n("_gal_ou_plus_pe_38400")}),"lessThanEqual"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"between"===o?"checked":"unchecked",onClick:()=>a($n.Between),children:n("est_entre_born_59665")}),"between"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:r,onChange:d}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:l,onChange:c})]}),(0,i.jsx)(Pl,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isEmpty"===o?"checked":"unchecked",onClick:()=>a($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===o?"checked":"unchecked",onClick:()=>a($n.IsNotEmpty),children:n("n_est_pas_vide_45804")})]}),"numberOfAssignmentsDays"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"3"}),(0,i.jsx)(om,{state:p,onClick:I,children:n("filtrer_sur_une_06420")}),"checked"===p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:u,onChange:m}),(0,i.jsx)(Wp,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:g,onChange:h})]})]})]}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$2",background:"$gray50",padding:"$5 $6"},direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:n("le_filtre_se_ba_92445")}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(cm,{state:x?"checked":"unchecked",onClick:()=>f(!0),children:n("sur_toutes_les_40684")}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(cm,{state:x?"unchecked":"checked",onClick:()=>f(!1),children:n("sur_certaines_a_13180")}),!x&&(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:_,onChange:j,children:Tg(e.filterPredicate.filter,n)})})]})]})]})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$2",background:"$gray50",padding:"$5 $6"},direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:n("le_filtre_se_ba_92445")}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(cm,{state:v?"checked":"unchecked",onClick:()=>S(!0),children:n("sur_toutes_les_97037")}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(cm,{state:v?"unchecked":"checked",onClick:()=>S(!1),children:n("sur_certaines_m_74733")}),!v&&(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:y,onChange:C,children:Tg(e.filterPredicate.filter,n)})})]})]})]})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!A,onClick:()=>{e.onAdd(b)},children:n("ajouter_le_filt_54222")})})]})},rI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is),[o,a]=(0,V.useState)(e.filterPredicate.predicate?.value??""),[r,d]=(0,V.useState)(e.filterPredicate.predicate?.value2??""),[l,c]=(0,V.useState)(e.filterPredicate.predicate?.value3??""),u={operator:t,value:o,value2:r,value3:l,slug:e.filterPredicate.filter.slug},m=Pp(e.filterPredicate.filter,u);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wp,{label:n("jour_d_affectat_27334"),max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:a}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(bc,{children:e.filterPredicate.filter.name}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("est_25967")}),"is"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{min:0,shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("n_est_pas_97826")}),"isNot"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{min:0,shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"greaterThan"===t?"checked":"unchecked",onClick:()=>s($n.GreaterThan),children:n("plus_grand_que_28412")}),"greaterThan"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{min:0,shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"greaterThanEqual"===t?"checked":"unchecked",onClick:()=>s($n.GreaterThanEqual),children:n("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{min:0,shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"lessThan"===t?"checked":"unchecked",onClick:()=>s($n.LessThan),children:n("plus_petit_que_35846")}),"lessThan"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{min:0,shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"lessThanEqual"===t?"checked":"unchecked",onClick:()=>s($n.LessThanEqual),children:n("_gal_ou_plus_pe_38400")}),"lessThanEqual"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{min:0,shouldParseAsInt:!0,value:r,onChange:d})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"between"===t?"checked":"unchecked",onClick:()=>s($n.Between),children:n("est_entre_born_59665")}),"between"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:r,onChange:d}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:l,onChange:c})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!m,onClick:()=>{e.onAdd(u)},children:n("ajouter_le_filt_54222")})})]})},dI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("Public")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("Private")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:()=>{e.onAdd({operator:t,value:"",slug:e.filterPredicate.filter.slug})},children:n("ajouter_le_filt_54222")})})]})},lI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is),o=(0,V.useMemo)(()=>Tg(e.filterPredicate.filter,n),[e.filterPredicate.filter]),[a,r]=(0,V.useState)(Yo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),d={operator:t,value:a,slug:e.filterPredicate.filter.slug},l=Pp(e.filterPredicate.filter,d),c=(0,V.useMemo)(()=>Array.isArray(a)?a.length:0,[a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("est_25967")}),"is"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{hint:n("_1_s_lectionn_51286",c),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:a,onChange:r,children:o})}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("n_est_pas_97826")}),"isNot"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{hint:n("_1_s_lectionn_51286",c),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:a,onChange:r,children:o})}),(0,i.jsx)(Pl,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsNotEmpty),children:n("n_est_pas_vide_45804")})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!l,onClick:()=>{e.onAdd(d)},children:n("ajouter_le_filt_54222")})})]})},cI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??(e.filterPredicate.filter.isEncrypted?$n.IsEmpty:$n.Contains)),[o,a]=(0,V.useState)(e.filterPredicate.predicate?.value??""),r={operator:t,value:o,slug:e.filterPredicate.filter.slug},d=Pp(e.filterPredicate.filter,r);return(0,i.jsxs)(i.Fragment,{children:[!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsx)(cm,{state:"contains"===t?"checked":"unchecked",onClick:()=>s($n.Contains),children:n("contient_34012")}),"contains"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"notContains"===t?"checked":"unchecked",onClick:()=>s($n.NotContains),children:n("ne_contient_pas_85399")})]}),"notContains"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"startsWith"===t?"checked":"unchecked",onClick:()=>s($n.StartsWith),children:n("commence_par_11056")})]}),"startsWith"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"endsWith"===t?"checked":"unchecked",onClick:()=>s($n.EndsWith),children:n("finit_par_79657")})]}),"endsWith"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{value:o,onChange:a})]}),(0,i.jsx)(Pl,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsNotEmpty),children:n("n_est_pas_vide_45804")})]}),e.showIsValid&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isValid"===t?"checked":"unchecked",onClick:()=>s($n.IsValid),children:n("est_valide_72630")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotValid"===t?"checked":"unchecked",onClick:()=>s($n.IsNotValid),children:n("n_est_pas_valid_75405")})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!d,onClick:()=>{e.onAdd(r)},children:n("ajouter_le_filt_54222")})})]})},uI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.filterPredicate.predicate?.operator??$n.Is),o=(0,V.useMemo)(()=>Tg(e.filterPredicate.filter,n),[e.filterPredicate.filter]),[a,r]=(0,V.useState)(Yo(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),[d,l]=(0,V.useState)(e.filterPredicate.predicate?.value2??1),c={operator:t,value:a,value2:d,slug:e.filterPredicate.filter.slug},u=Pp(e.filterPredicate.filter,c);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:"is"===t?"checked":"unchecked",onClick:()=>s($n.Is),children:n("est_25967")}),"is"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:a,onChange:r,children:o})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNot"===t?"checked":"unchecked",onClick:()=>s($n.IsNot),children:n("n_est_pas_97826")}),"isNot"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:a,onChange:r,children:o})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"contains"===t?"checked":"unchecked",onClick:()=>s($n.Contains),children:n("est_le_choix_07450")}),"contains"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:d,onChange:l})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:a,onChange:r,children:o})]}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsEmpty),children:n("est_vide_96759")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"isNotEmpty"===t?"checked":"unchecked",onClick:()=>s($n.IsNotEmpty),children:n("n_est_pas_vide_45804")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{disabled:!u,onClick:()=>{e.onAdd(c)},children:n("ajouter_le_filt_54222")})})]})},mI=e=>{const n=Fi(),t=Hh(e.filterPredicate.filter),s=(()=>{const{filterPredicate:n,onAdd:t}=e;switch(wp(n.filter)){case"condition":return(0,i.jsx)(Bp,{filterPredicate:n,onAdd:t});case"leader":return(0,i.jsx)(nI,{filterPredicate:n,onAdd:t});case"admin":return(0,i.jsx)(eI,{filterPredicate:n,onAdd:t});case"privacy":return(0,i.jsx)(dI,{filterPredicate:n,onAdd:t});case"team":return(0,i.jsx)(tI,{filterPredicate:n,onAdd:t});case"wishedPositions":return(0,i.jsx)(uI,{filterPredicate:n,onAdd:t});case"numberPerDay":return(0,i.jsx)(rI,{filterPredicate:n,onAdd:t});case"campaignReply":return(0,i.jsx)(Fp,{filterPredicate:n,onAdd:t});case"text":return(0,i.jsx)(cI,{filterPredicate:n,showIsValid:!1,onAdd:t});case"phone":return(0,i.jsx)(cI,{filterPredicate:n,showIsValid:!0,onAdd:t});case"select":return(0,i.jsx)(lI,{filterPredicate:n,onAdd:t});case"checkbox":return(0,i.jsx)(Vp,{filterPredicate:n,onAdd:t});case"number":return(0,i.jsx)(aI,{filterPredicate:n,onAdd:t});case"dateTimeRange":return(0,i.jsx)(Qp,{filterPredicate:n,onAdd:t});case"date":return(0,i.jsx)(Zp,{filterPredicate:n,onAdd:t});case"datetime":return(0,i.jsx)(Xp,{filterPredicate:n,onAdd:t});case"file":return(0,i.jsx)(Jp,{filterPredicate:n,onAdd:t});case"campaign":return(0,i.jsx)(kp,{filterPredicate:n,onAdd:t});case"unknown":return(0,i.jsx)("div",{children:"TODO"})}})();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{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"}),n("retour_la_lis_63860")]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:e.filterPredicate.filter.name}),(0,i.jsx)(Pl,{height:"3"}),t?(0,i.jsx)(Ql,{}):s]})};function gI(e){switch(e){case nn.Address:return"map-location";case nn.Text:case nn.Textarea:return"text";case nn.Checkbox:return"square-check";case nn.Validation:return"check";case nn.Select:return"list-ul";case nn.Date:return"calendar";case nn.Datetime:return"calendar-day";case nn.Time:return"clock";case nn.File:return"file";case nn.Phone:return"phone";case nn.Language:return"language";case nn.Number:return"00";case nn.Sex:return"venus-mars";case nn.Nationality:case nn.Country:return"flag";case nn.DateTimeRange:return"calendar-range";case nn.Campaign:return"paper-plane";default:return Zl()}}const hI=e=>{const n=(0,V.useMemo)(()=>(0,wo.A)(e.filtersPredicates.map(({filter:e})=>e.category)),[e.filtersPredicates]),t=(0,V.useMemo)(()=>(0,fm.A)(e.filtersPredicates,({filter:e})=>e.category),[e.filtersPredicates]);return(0,i.jsx)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",px:"$4"},direction:"column",children:n.map((n,s)=>{const o=t[n];return(0,i.jsxs)(V.Fragment,{children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[0!==s&&(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Mr,{css:{paddingBottom:"$2",paddingTop:"$3"},font:"gray500 textXs semiBold",children:n})]}),o.map(n=>{const{filter:t}=n;return(0,i.jsxs)(Tl,{align:"center",css:{py:"$2"},gap:"3",children:[(0,i.jsx)(Tl,{align:"center",css:{borderRadius:"$1",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Yl,{icon:gI(t.fieldType)})}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray900",css:{ellipsis:!0},fontWeight:"medium",title:t.name,width:1,children:t.name}),g(t.label)&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},title:t.label,width:1,children:t.label})]}),e.isEdit?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>e.onEdit(n)}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(t.slug)})]}):(0,i.jsx)(tc,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>e.onAdd(n)})]},t.slug)})]},s)})})},pI=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.selectedFilterPredicate),[o,a]=(0,V.useState)((0,vp.A)(e.predicates)),r=(0,V.useCallback)(e=>{a((0,dp.jM)(n=>{const t=n.findIndex(n=>n.slug===e.slug);-1===t?n.push(e):n[t]=e})),s(null)},[a,s]),d=(0,V.useCallback)(e=>{a((0,dp.jM)(n=>{const t=n.findIndex(n=>n.slug===e);n.splice(t,1)}))},[a]),[l,c]=(0,V.useState)(""),[m,h]=function(e,n,t){const i=[],s=[];for(const o of n)if(!g(t)||u(o.name).includes(u(t))||g(o.label)&&u(o.label).includes(u(t))){const n=e.find(({slug:e})=>e===o.slug);n?i.push({filter:o,predicate:n}):s.push({filter:o,predicate:n})}return[i,s]}(o,e.possibleFilters,l);return(0,i.jsxs)(gp,{size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(hp,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXl",children:n("filtres_64574")}),g(e.subtitle)&&(0,i.jsx)(Mr,{color:"gray500",children:e.subtitle}),(0,i.jsx)(Pl,{height:"6"}),t?(0,i.jsx)(mI,{filterPredicate:t,onAdd:r,onBack:()=>{s(null)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_f_22061"),value:l,onChange:c}),(0,i.jsx)(Pl,{height:"6"}),o.length>0&&m.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:n("liste_des_filtr_29511")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(hI,{filtersPredicates:m,isEdit:!0,onDelete:d,onEdit:e=>s(e)}),(0,i.jsx)(Pl,{height:"8"})]}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:n("liste_des_filtr_37728")}),h.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(hI,{filtersPredicates:h,isEdit:!1,onAdd:e=>{s(e)}})]})]}),(0,i.jsx)(Pl,{height:"6"})]}),null===t&&(0,i.jsx)(pp,{children:(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{onClick:()=>{e.onFilter(o),e.onClose()},children:e.buttonText||n("filtrer_78031")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})})]})},II=br(Tl,{borderRadius:"$2",fontSize:"$textSm",height:"32px",width:"32px",variants:{size:{sm:{},md:{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"},responsive:{"@tablet":{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"}}}},defaultVariants:{size:"responsive"}}),xI=e=>{const n=(0,V.useMemo)(()=>Gu(e.color??""),[e.color]),t=(0,V.useMemo)(()=>Zt.includes(e.icon)?Hl(e.icon):e.icon,[e.icon]);return(0,i.jsx)(II,{align:"center",css:{background:n[100],color:n[700],...e.css},justify:"center",role:"presentation",size:e.size,children:(0,i.jsx)(Yl,{icon:t})})};function fI(){return Rm(yr.desktop)}const _I=V.forwardRef(({shouldLightDismiss:e=!0,initialOpen:n=!1,isOpen:t,setIsOpen:s,onClose:o,children:a,...r},d)=>{const[l,c]=V.useState(n),u=V.useRef(null),m=t??l,g=s??c;return V.useEffect(()=>{const e=u.current;return m?function(e){e&&!e.open&&e.showModal()}(e):e?.close(),()=>{e?.close()}},[m]),V.useEffect(()=>{const n=u.current;function t(e){e.preventDefault(),e.stopPropagation(),r.onClose?.(),g(!1)}function i(e){const{target:n}=e;n instanceof Element&&"DIALOG"===n.nodeName&&t(e)}function s(e){"Escape"===e.code&&t(e)}return e&&n?.addEventListener("click",i),n?.addEventListener("keydown",s),()=>{e&&n?.removeEventListener("click",i),n?.removeEventListener("keydown",s)}},[e,g]),V.useImperativeHandle(d,()=>({close(){g(!1)},showModal(){g(!0)},isOpen:()=>m,addEventListener(e,n,t){u.current?.addEventListener(e,n,t)},removeEventListener(e,n,t){u.current?.removeEventListener(e,n,t)}}),[m,g]),(0,i.jsxs)(i.Fragment,{children:[false,(0,i.jsx)("dialog",{ref:u,"aria-describedby":r["aria-describedby"],"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],style:r.style,onClose:o,...r["aria-description"]?{"aria-description":r["aria-description"]}:{},children:a})]})});_I.displayName="Dialog";const jI=({children:e,labelId:n,isOpen:t,size:s,setIsOpen:o,...a})=>{const r=fI();return(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)(_I,{"aria-labelledby":n,"data-testid":"right-panel-body",isOpen:t,setIsOpen:o,style:{maxHeight:"none",maxWidth:"none",margin:"0 0 0 0",marginInlineStart:r?"auto":"0",height:"100%",border:"none",inlineSize:r?"sm"===s?"480px":"690px":"100%",top:0,padding:0},onClose:a.onClose,children:(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50",boxShadow:"$shadowsXl",blockSize:"100%",flex:1},direction:"column",...a,children:e})})]})},vI=({heading:e,id:n,leftIcon:t,leftIconColor:s,leftIconBorder:o,setIsOpen:a,...r})=>(0,i.jsxs)(Tl,{as:"header",css:{alignItems:"flex-start",alignSelf:"stretch",background:"$white",borderBlockEnd:"1px solid $gray200"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Tl,{css:{alignItems:"center",alignSelf:"stretch",padding:"$6 $7 $5 $7"},gap:"4",children:[t&&(0,i.jsx)(Tl,{align:"center",css:{border:o},justify:"center",children:(0,i.jsx)(xI,{color:s,icon:t})}),(0,i.jsx)(Tl,{css:{alignItems:"flex-start",flex:1},direction:"column",id:n,justify:"center",children:e})]}),(0,i.jsx)(Tl,{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)(tc,{color:"invisible",css:{color:"$gray500",width:"$space$6",height:"$space$6",padding:0},textAlign:"center",onClick:()=>a(!1),children:(0,i.jsx)("i",{className:"far fa-xmark"})})}),r.children]}),SI=e=>(0,i.jsx)(Tl,{css:{alignSelf:"stretch",alignItems:"start",padding:"$6",overflowY:"auto",...e.css},direction:"column",gap:"6",children:e.children}),yI=e=>(0,i.jsx)(Tl,{as:"footer",css:{alignSelf:"stretch",background:"$white",borderBlockStart:"1px solid $gray200",marginBlockStart:"auto",padding:"$4 $6"},gap:"3",justify:"end",children:e.children});function CI(e){return{...e,groups:e.groups.map(e=>({...e,key:e.key??W(),predicates:e.predicates.map(e=>({...e,key:e.key??W()}))}))}}function bI(e){return e.key}const AI=e=>{const{setIsOpen:n}=Ru();return(0,i.jsxs)(um,{isCheckbox:!1,isRadio:!1,isSelected:!1,value:e.filter.slug,onClick:()=>{e.onSelect(e.filter),n(!1)},children:[e.filter.name,g(e.filter.label)&&(0,i.jsxs)(Mr,{as:"span",color:"gray500",css:{marginLeft:"$1"},fontSize:"textXs",children:["(",e.filter.label,")"]})]})},EI=e=>{const n=Fi(),[t,s]=(0,V.useState)(""),o=(0,V.useMemo)(()=>{const n=u(t),i=g(t)?e.filters.filter(e=>u(e.name).includes(n)||g(e.label)&&u(e.label).includes(n)):e.filters;return Object.entries((0,fm.A)(i,e=>e.category))},[e.filters,t]);return(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"invisible",css:{paddingInline:0},leftIcon:"plus",children:e.text})}),(0,i.jsx)(Fu,{css:{padding:0},placement:e.placement??"bottom-start",width:560,children:(0,i.jsxs)(Tl,{css:{padding:"$2"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(wc,{autoFocus:!0,icon:"magnifying-glass",placeholder:n("rechercher_un_f_22061"),value:t,onChange:s}),(0,i.jsx)(Mr,{css:{maxHeight:"360px",overflowY:"auto"},children:o.map(([n,t],o)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(am,{index:o,children:n}),t.map(n=>(0,i.jsx)(AI,{filter:n,onSelect:n=>{s(""),e.onSelect(n)}},n.slug))]},n))})]})})]})},wI=e=>{const n=Fi(),t=e.filter.campaigns??[],s=Array.isArray(e.predicate.value)?e.predicate.value:[],o=Array.isArray(e.predicate.value2)?e.predicate.value2:[],a=(0,wo.A)(t.filter(({id:e})=>s.includes(e)).map(({campaignType:e})=>e)),r=(0,wo.A)(["NotSent",...a.includes(ve.Email)?Lt.filter(e=>e!==Le.Queued):[],...a.includes(ve.Sms)?fi:[]]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_28439"),values:s,onChange:n=>{e.onChange({...e.predicate,value:n})},children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),s.length>0&&(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_62901"),values:o,onChange:n=>{e.onChange({...e.predicate,value2:n})},children:r.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))})]})},$I=e=>(0,i.jsx)(Up,{value:e.value,onChange:n=>{e.onChange(n)},children:e.operators.map(({operator:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),TI=e=>{const n=Fi(),t=e.filter.campaigns??[],{operator:s,value2:o}=e.predicate,a=Array.isArray(e.predicate.value)?e.predicate.value:[],r=(0,V.useMemo)(()=>[{operator:$n.Contains,name:n("contient_34012")},{operator:$n.IsEmpty,name:n("est_vide_96759")},{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")}],[n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_28439"),values:a,onChange:n=>{e.onChange({...e.predicate,value:n})},children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),a.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:r,value:s,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),s===$n.Contains&&(0,i.jsx)(wc,{value:o??"",onChange:n=>{e.onChange({...e.predicate,value2:n})}})]})]})},zI=[$n.Is,$n.IsNot],OI=e=>{const n=Fi(),t=(0,V.useMemo)(()=>(0,kl.A)([{operator:$n.Is,name:n("est_25967")},{operator:$n.IsNot,name:n("n_est_pas_97826")},!0!==e.filter.hideEmpty&&{operator:$n.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),zI.includes(e.predicate.operator)&&(0,i.jsxs)(Up,{shouldParseAsBoolean:!0,value:e.predicate.value??!0,onChange:n=>{e.onChange({...e.predicate,value:n})},children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]})]})},RI=e=>{const n=Fi(),t=e.filter.values??[],s=(0,V.useMemo)(()=>(0,kl.A)([{operator:$n.Is,name:n("champ_dont_un_a_44854")},{operator:$n.IsNot,name:n("champ_d_pendant_33676")},Yo(e.filter.values)&&{operator:$n.Contains,name:n("d_pends_du_cham_39787")}]),[e.filter,n]),o=Array.isArray(e.predicate.value)?e.predicate.value:[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:s,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),e.predicate.operator===$n.Contains&&(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:o,onChange:n=>{e.onChange({...e.predicate,value:n})},children:t.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]})},DI=e=>{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>Oo.c9.now().startOf("year"),[]);return(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsxs)(Up,{shouldParseAsInt:!0,value:e.value.day??-1,onChange:n=>{e.onChange({...e.value,day:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("jour_74089")}),(0,Om.A)(1,32).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]}),(0,i.jsxs)(Up,{shouldParseAsInt:!0,value:e.value.month??-1,onChange:n=>{e.onChange({...e.value,month:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("mois_10165")}),(0,Om.A)(1,13).map(e=>(0,i.jsx)("option",{value:e,children:t.toLocaleString(s.set({month:e}),{month:"long"})},e))]}),(0,i.jsxs)(Up,{shouldParseAsInt:!0,value:e.value.year??-1,onChange:n=>{e.onChange({...e.value,year:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("ann_e_38546")}),(0,Hp.A)(1900,s.year+2).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]})};function MI(e){return Ap.includes(e)}function PI(e,n){return MI(e)===MI(n)?{operator:n}:{operator:n,value:"",value2:""}}function kI(e){return[{operator:$n.IsInLast,name:e("est_dans_les_n_05750")},{operator:$n.IsMoreThanAgo,name:e("est_il_y_a_plus_04600")},{operator:$n.IsInNext,name:e("est_dans_les_n_72234")},{operator:$n.IsMoreThanAhead,name:e("est_dans_plus_d_94311")}]}const FI={day:-1,month:-1,year:-1},NI=e=>{const n=Fi(),t=yg(e.filter.slug),s=Cg(e.predicate),{operator:o,value:a,value2:r,value3:d,valueDate:l}=s,c=t&&Array.isArray(d)?d:[],u=(0,V.useMemo)(()=>(0,kl.A)([{operator:$n.Is,name:n("est_25967")},{operator:$n.IsNot,name:n("n_est_pas_97826")},{operator:$n.IsBefore,name:n("est_avant_le_16689")},{operator:$n.IsAfter,name:n("est_apr_s_le_79703")},{operator:$n.Between,name:n("est_entre_born_59665")},...kI(n),{operator:$n.Today,name:n("est_aujourd_hui_82571")},{operator:$n.ThisDayMonth,name:n("est_aujourd_hui_70881")},!0!==e.filter.hideEmpty&&{operator:$n.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]),m=n=>{e.onChange(bg({...s,...n}))};return(0,i.jsxs)(i.Fragment,{children:[t&&(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:"campaignSentAt"===e.filter.slug?n("s_lectionner_un_28439"):n("s_lectionner_un_13356"),values:c,onChange:e=>{m({value3:e})},children:(e.filter.values||[]).map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(!t||c.length>0)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:u,value:o,onChange:e=>{m(PI(o,e))}}),(o===$n.Is||o===$n.IsNot)&&(0,i.jsx)(DI,{value:l??FI,onChange:e=>{m({valueDate:e})}}),(o===$n.IsBefore||o===$n.IsAfter)&&(0,i.jsx)(Wp,{max:e.filter.endAt,min:e.filter.startAt,value:a??"",onChange:e=>{m({value:e})}}),o===$n.Between&&(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(Wp,{max:e.filter.endAt,min:e.filter.startAt,value:a??"",onChange:e=>{m({value:e})}}),(0,i.jsx)(Wp,{max:e.filter.endAt,min:e.filter.startAt,value:r??"",onChange:e=>{m({value2:e})}})]}),MI(o)&&(0,i.jsx)(wc,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:a??"",onChange:e=>{m({value:e})}})]})]})},LI=e=>{const n=Fi(),{operator:t,value:s,value2:o}=e.predicate,a=(0,V.useMemo)(()=>e.filter.useLocalZone?Bo():void 0,[e.filter]),r=e=>g(e)?Oo.c9.fromISO(e,{zone:a||"UTC"}):e??"",d=(0,V.useMemo)(()=>(0,kl.A)([{operator:$n.Is,name:n("est_25967")},{operator:$n.IsNot,name:n("n_est_pas_97826")},{operator:$n.IsBefore,name:n("est_avant_le_16689")},{operator:$n.IsAfter,name:n("est_apr_s_le_79703")},{operator:$n.Between,name:n("est_entre_born_59665")},...kI(n),{operator:$n.Today,name:n("est_aujourd_hui_82571")},!0!==e.filter.hideEmpty&&{operator:$n.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]),l=n=>{e.onChange({...e.predicate,...n})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:d,value:t,onChange:e=>{l(PI(t,e))}}),(t===$n.Is||t===$n.IsNot)&&(0,i.jsx)(Wp,{max:e.filter.endAt,min:e.filter.startAt,value:s??"",onChange:e=>{l({value:e})}}),(t===$n.IsBefore||t===$n.IsAfter)&&(0,i.jsx)(Kp,{value:r(s),zone:a,onChange:e=>{l({value:e})}}),t===$n.Between&&(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Kp,{value:r(s),zone:a,onChange:e=>{l({value:e})}}),(0,i.jsx)(Kp,{value:r(o),zone:a,onChange:e=>{l({value2:e})}})]}),MI(t)&&(0,i.jsx)(wc,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:s??"",onChange:e=>{l({value:e})}})]})},UI=[$n.Contains,$n.NotContains],VI=[$n.Overlaps,$n.NotOverlaps,$n.Engulfs,$n.NotEngulfs,$n.EngulfedBy,$n.NotEngulfedBy],BI=e=>{const n=Fi(),{operator:t,value:s,value2:o}=e.predicate,a=(0,V.useMemo)(()=>[{operator:$n.Contains,name:n("contient_34012")},{operator:$n.Is,name:n("contient_date_89885")},{operator:$n.NotContains,name:n("ne_contient_pas_85399")},{operator:$n.Overlaps,name:n("chevauche_49445")},{operator:$n.NotOverlaps,name:n("ne_chevauche_pa_17307")},{operator:$n.Engulfs,name:n("engloutis_42346")},{operator:$n.NotEngulfs,name:n("n_engloutis_pas_42363")},{operator:$n.EngulfedBy,name:n("est_englouti_pa_47852")},{operator:$n.NotEngulfedBy,name:n("n_est_pas_englo_08733")}],[n]),r=n=>{e.onChange({...e.predicate,...n})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:a,value:t,onChange:e=>{r({operator:e})}}),UI.includes(t)&&(0,i.jsx)(Kp,{max:e.filter.endAt,min:e.filter.startAt,value:s??"",onChange:e=>{r({value:e})}}),t===$n.Is&&(0,i.jsx)(Wp,{max:e.filter.endAt,min:e.filter.startAt,value:s??"",onChange:e=>{r({value:e})}}),VI.includes(t)&&(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Kp,{max:e.filter.endAt,min:e.filter.startAt,placeholder:n("d_but_41840"),value:s??"",onChange:e=>{r({value:e})}}),(0,i.jsx)(Kp,{max:e.filter.endAt,min:e.filter.startAt,placeholder:n("fin_60104"),value:o??"",onChange:e=>{r({value2:e})}})]})]})},WI=e=>{const n=Fi(),t=(0,V.useMemo)(()=>(0,kl.A)([{operator:$n.Is,name:n("est_responsable_47377")},"isDelegationLeader"===e.filter.slug&&{operator:$n.Contains,name:n("est_responsable_00281")},{operator:$n.IsNot,name:n("n_est_pas_respo_55625")}]),[e.filter,n]),s=(0,V.useMemo)(()=>Tg(e.filter,n),[e.filter,n]),o=Array.isArray(e.predicate.value)?e.predicate.value:[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),e.predicate.operator===$n.Contains&&(0,i.jsx)(_m,{hint:n("_1_s_lectionn_51286",o.length),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:o,onChange:n=>{e.onChange({...e.predicate,value:n})},children:s})]})},GI=e=>{const n=Fi(),[t,s]=(0,V.useState)(!Yo(e.value)),o=(0,V.useMemo)(()=>Tg(e.filter,n),[e.filter,n]);return(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$2",background:"$white",padding:"$4"},direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textSm",fontWeight:"medium",children:n("le_filtre_se_ba_92445")}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(cm,{state:t?"checked":"unchecked",onClick:()=>{s(!0),e.onChange([])},children:e.allText}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(cm,{state:t?"unchecked":"checked",onClick:()=>s(!1),children:e.someText}),!t&&(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:e.value,onChange:e.onChange,children:o})})]})]})]})},qI=[$n.Is,$n.IsNot,$n.GreaterThan,$n.GreaterThanEqual,$n.LessThan,$n.LessThanEqual],HI=e=>null!==Cp(e),YI=e=>{const n=Fi(),{slug:t}=e.filter,{operator:s,value:o,value2:a,value3:r,value4:d}=e.predicate,l=(0,V.useMemo)(()=>(0,kl.A)([{operator:$n.Is,name:n("est_25967")},{operator:$n.IsNot,name:n("n_est_pas_97826")},{operator:$n.GreaterThan,name:n("plus_grand_que_28412")},{operator:$n.GreaterThanEqual,name:n("_gal_ou_plus_gr_76897")},{operator:$n.LessThan,name:n("plus_petit_que_35846")},{operator:$n.LessThanEqual,name:n("_gal_ou_plus_pe_38400")},{operator:$n.Between,name:n("est_entre_born_59665")},!0!==e.filter.hideEmpty&&{operator:$n.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]),[c,u]=(0,V.useState)(HI(r)&&HI(d)),m=n=>{e.onChange({...e.predicate,...n})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:l,value:s,onChange:e=>{m({operator:e})}}),qI.includes(s)&&(0,i.jsx)(wc,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:o??"",onChange:e=>{m({value:e})}}),s===$n.Between&&(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(wc,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:o??"",onChange:e=>{m({value:e})}}),(0,i.jsx)(wc,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:a??"",onChange:e=>{m({value2:e})}})]}),"numberOfAssignmentsDays"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(om,{state:c?"checked":"unchecked",onClick:e=>{u("checked"===e),"checked"!==e&&m({value3:"",value4:""})},children:n("filtrer_sur_une_06420")}),c&&(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(Wp,{max:e.filter.endAt,min:e.filter.startAt,value:r??"",onChange:e=>{m({value3:e})}}),(0,i.jsx)(Wp,{max:e.filter.endAt,min:e.filter.startAt,value:d??"",onChange:e=>{m({value4:e})}})]})]}),"numberOfAccreditations"===t&&(0,i.jsx)(GI,{allText:n("sur_toutes_les_40684"),filter:e.filter,someText:n("sur_certaines_a_13180"),value:Array.isArray(r)?r:[],onChange:e=>{m({value3:e})}}),"numberOfAssignments"===t&&(0,i.jsx)(GI,{allText:n("sur_toutes_les_97037"),filter:e.filter,someText:n("sur_certaines_m_74733"),value:Array.isArray(r)?r:[],onChange:e=>{m({value3:e})}})]})},ZI=e=>{const n=Fi(),{operator:t,value:s,value2:o,value3:a}=e.predicate,r=(0,V.useMemo)(()=>[{operator:$n.Is,name:n("est_25967")},{operator:$n.IsNot,name:n("n_est_pas_97826")},{operator:$n.GreaterThan,name:n("plus_grand_que_28412")},{operator:$n.GreaterThanEqual,name:n("_gal_ou_plus_gr_76897")},{operator:$n.LessThan,name:n("plus_petit_que_35846")},{operator:$n.LessThanEqual,name:n("_gal_ou_plus_pe_38400")},{operator:$n.Between,name:n("est_entre_born_59665")}],[n]),d=n=>{e.onChange({...e.predicate,...n})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wp,{label:n("jour_d_affectat_27334"),max:e.filter.endAt,min:e.filter.startAt,value:s??"",onChange:e=>{d({value:e})}}),(0,i.jsx)($I,{operators:r,value:t,onChange:e=>{d({operator:e})}}),(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(wc,{min:0,shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:o??"",onChange:e=>{d({value2:e})}}),t===$n.Between&&(0,i.jsx)(wc,{min:0,shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:a??"",onChange:e=>{d({value3:e})}})]})]})},KI=e=>{const n=Fi(),t=(0,V.useMemo)(()=>{switch(e.kind){case"admin":return[{operator:$n.Is,name:n("est_administrat_15766")},{operator:$n.IsNot,name:n("n_est_pas_admin_58612")}];case"privacy":return[{operator:$n.Is,name:n("Public")},{operator:$n.IsNot,name:n("Private")}];case"team":return[{operator:$n.Is,name:n("est_inscrit_en_86193")},{operator:$n.IsNot,name:n("n_est_pas_inscr_25311")}];case"file":return[{operator:$n.IsEmpty,name:n("est_vide_96759")},{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")}]}},[e.kind,n]);return(0,i.jsx)($I,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}})},XI=[$n.Is,$n.IsNot],QI=e=>{const n=Fi(),t=(0,V.useMemo)(()=>(0,kl.A)([{operator:$n.Is,name:n("est_25967")},{operator:$n.IsNot,name:n("n_est_pas_97826")},!0!==e.filter.hideEmpty&&{operator:$n.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]),s=(0,V.useMemo)(()=>Tg(e.filter,n),[e.filter,n]),o=Array.isArray(e.predicate.value)?e.predicate.value:[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),XI.includes(e.predicate.operator)&&(0,i.jsx)(_m,{hint:n("_1_s_lectionn_51286",o.length),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:o,onChange:n=>{e.onChange({...e.predicate,value:n})},children:s})]})},JI=[$n.Contains,$n.NotContains,$n.StartsWith,$n.EndsWith],ex=e=>{const n=Fi(),t=(0,V.useMemo)(()=>{const t=!0===e.filter.isEncrypted,i=!0!==e.filter.hideEmpty;return(0,kl.A)([!t&&{operator:$n.Contains,name:n("contient_34012")},!t&&{operator:$n.NotContains,name:n("ne_contient_pas_85399")},!t&&{operator:$n.StartsWith,name:n("commence_par_11056")},!t&&{operator:$n.EndsWith,name:n("finit_par_79657")},i&&{operator:$n.IsEmpty,name:n("est_vide_96759")},i&&{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")},e.showIsValid&&{operator:$n.IsValid,name:n("est_valide_72630")},e.showIsValid&&{operator:$n.IsNotValid,name:n("n_est_pas_valid_75405")}])},[e.filter,e.showIsValid,n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),JI.includes(e.predicate.operator)&&(0,i.jsx)(wc,{value:e.predicate.value??"",onChange:n=>{e.onChange({...e.predicate,value:n})}})]})},nx=[$n.Is,$n.IsNot,$n.Contains],tx=e=>{const n=Fi(),t=(0,V.useMemo)(()=>[{operator:$n.Is,name:n("est_25967")},{operator:$n.IsNot,name:n("n_est_pas_97826")},{operator:$n.Contains,name:n("est_le_choix_07450")},{operator:$n.IsEmpty,name:n("est_vide_96759")},{operator:$n.IsNotEmpty,name:n("n_est_pas_vide_45804")}],[n]),s=(0,V.useMemo)(()=>Tg(e.filter,n),[e.filter,n]),{operator:o,value2:a}=e.predicate,r=Array.isArray(e.predicate.value)?e.predicate.value:[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($I,{operators:t,value:o,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),o===$n.Contains&&(0,i.jsx)(wc,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:a??"",onChange:n=>{e.onChange({...e.predicate,value2:n})}}),nx.includes(o)&&(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:r,onChange:n=>{e.onChange({...e.predicate,value:n})},children:s})]})},ix=({filter:e,predicate:n,onChange:t})=>{const s=wp(e);switch(s){case"text":case"phone":return(0,i.jsx)(ex,{filter:e,predicate:n,showIsValid:"phone"===s,onChange:t});case"select":return(0,i.jsx)(QI,{filter:e,predicate:n,onChange:t});case"checkbox":return(0,i.jsx)(OI,{filter:e,predicate:n,onChange:t});case"number":return(0,i.jsx)(YI,{filter:e,predicate:n,onChange:t});case"date":return(0,i.jsx)(NI,{filter:e,predicate:n,onChange:t});case"datetime":return(0,i.jsx)(LI,{filter:e,predicate:n,onChange:t});case"dateTimeRange":return(0,i.jsx)(BI,{filter:e,predicate:n,onChange:t});case"condition":return(0,i.jsx)(RI,{filter:e,predicate:n,onChange:t});case"leader":return(0,i.jsx)(WI,{filter:e,predicate:n,onChange:t});case"admin":case"file":case"privacy":case"team":return(0,i.jsx)(KI,{kind:s,predicate:n,onChange:t});case"wishedPositions":return(0,i.jsx)(tx,{filter:e,predicate:n,onChange:t});case"numberPerDay":return(0,i.jsx)(ZI,{filter:e,predicate:n,onChange:t});case"campaign":return(0,i.jsx)(wI,{filter:e,predicate:n,onChange:t});case"campaignReply":return(0,i.jsx)(TI,{filter:e,predicate:n,onChange:t});case"unknown":return null}},sx=e=>{const n=Fi(),t=Hh(e.filter),s=Pp(e.filter,e.predicate),o=(0,V.useRef)(null);return(0,V.useEffect)(()=>{if(e.isSelected&&!t){const e=requestAnimationFrame(()=>{o.current?.scrollIntoView({block:"center"})});return()=>{cancelAnimationFrame(e)}}return Bc.A},[t]),(0,i.jsxs)(Tl,{ref:o,css:{background:"$white",border:"1px solid "+(s?"$gray200":"$error500"),borderRadius:"$2",boxShadow:"$xs",overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"4",width:1,children:[(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1"},fontSize:"textSm",fontWeight:"semiBold",children:e.filter.name}),(0,i.jsx)(tc,{"aria-label":n("Supprimer le filtre"),color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onDelete})]}),(0,i.jsx)(Tl,{css:{background:"$gray50",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:t?(0,i.jsx)(Ql,{}):(0,i.jsx)(ix,{filter:e.filter,predicate:e.predicate,onChange:e.onChange})})]})},ox=e=>{const n=Fi();return e.isFirst?(0,i.jsxs)(Up,{css:{width:"fit-content"},value:e.operator,onChange:e.onChange,children:[(0,i.jsx)("option",{value:Tn.And,children:n("And")}),(0,i.jsx)("option",{value:Tn.Or,children:n("Or")})]}):(0,i.jsx)(Mr,{color:"gray800",fontSize:"textSm",fontWeight:"medium",children:e.operator===Tn.Or?n("Or"):n("And")})},ax=e=>{const n=Fi();return(0,i.jsxs)(Tl,{css:{background:"$white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6"},gap:"4",width:1,children:[(0,i.jsxs)(Mr,{color:"gray900",css:{flex:"1"},fontSize:"textSm",fontWeight:"semiBold",children:[n("groupe_74342")," ",e.index+1]}),(0,i.jsx)(tc,{"aria-label":n("Supprimer le groupe"),color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onDelete})]}),(0,i.jsxs)(Tl,{align:"start",css:{padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[e.group.filtersPredicates.map(({filter:n,predicate:t,predicateIndex:s},o)=>(0,i.jsxs)(V.Fragment,{children:[o>0&&(0,i.jsx)(ox,{isFirst:1===o,operator:e.group.operator,onChange:e.onOperatorChange}),(0,i.jsx)(sx,{filter:n,isSelected:e.selectedFilterPredicate?.groupIndex===e.group.groupIndex&&e.selectedFilterPredicate.predicateIndex===s,predicate:t,onChange:n=>e.onChange(s,n),onDelete:()=>e.onDeletePredicate(s)})]},bI(t)??s)),(0,i.jsx)(EI,{filters:e.filters,text:n("Ajouter un filtre"),onSelect:e.onAdd})]})]})},rx="filters-v2-heading",dx=e=>{const n=Fi(),[t,s]=(0,V.useState)(()=>CI(e.predicates)),o=e=>s(n=>CI(e(n))),a=(0,V.useMemo)(()=>wg(t,e.possibleFilters),[t,e.possibleFilters]),r=(0,V.useMemo)(()=>$g(a).every(({filter:e,predicate:n})=>Pp(e,n)),[a]),d=e=>o(n=>{return t=n,i=Tp(e),{...t,groups:[...t.groups,{operator:Tn.And,predicates:[i]}]};var t,i});return(0,i.jsxs)(jI,{isOpen:!0,labelId:rx,setIsOpen:n=>{n||e.onClose()},size:"md",children:[(0,i.jsx)(vI,{heading:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n("filtres_64574")}),g(e.subtitle)&&(0,i.jsx)(Mr,{color:"gray500",fontSize:"textSm",children:e.subtitle})]}),id:rx,leftIcon:"sliders",leftIconColor:"gray",setIsOpen:()=>e.onClose()}),(0,i.jsx)(SI,{css:{alignItems:"stretch",flex:"1"},children:0===a.groups.length?(0,i.jsxs)(Tl,{align:"center",css:{background:"$white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs",flex:"1",padding:"$6"},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textSm",children:n("Personnaliser votre liste en appliquant des filtres")}),(0,i.jsx)(EI,{filters:e.possibleFilters,placement:"bottom",text:n("Ajouter un filtre"),onSelect:d})]}):(0,i.jsxs)(Tl,{align:"start",direction:"column",gap:"4",children:[a.groups.map((n,s)=>(0,i.jsxs)(V.Fragment,{children:[s>0&&(0,i.jsx)(ox,{isFirst:1===s,operator:t.operator,onChange:e=>o(n=>function(e,n){return{...e,operator:n}}(n,e))}),(0,i.jsx)(ax,{filters:e.possibleFilters,group:n,index:s,selectedFilterPredicate:e.selectedFilterPredicate,onAdd:e=>o(t=>{return i=t,s=n.groupIndex,o=Tp(e),_g(i,s,e=>({...e,predicates:[...e.predicates,o]}));var i,s,o}),onChange:(e,t)=>o(i=>function(e,n,t,i){return _g(e,n,e=>({...e,predicates:e.predicates.map((e,n)=>n===t?i:e)}))}(i,n.groupIndex,e,t)),onDelete:()=>o(e=>vg(e,n.groupIndex)),onDeletePredicate:e=>o(t=>jg(t,n.groupIndex,e)),onOperatorChange:e=>o(t=>function(e,n,t){return _g(e,n,e=>({...e,operator:t}))}(t,n.groupIndex,e))})]},bI(t.groups[n.groupIndex])??n.groupIndex)),(0,i.jsx)(EI,{filters:e.possibleFilters,text:n("Ajouter un groupe de filtre"),onSelect:d})]})}),(0,i.jsxs)(yI,{children:[(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")}),(0,i.jsx)(tc,{disabled:!r,onClick:()=>{var n;e.onFilter((n=t,{...n,groups:n.groups.map(e=>({...(0,_r.A)(e,"key"),predicates:e.predicates.map(e=>(0,_r.A)(e,"key"))}))})),e.onClose()},children:e.buttonText||n("filtrer_78031")})]})]})},lx=e=>{const n=Fi(),{areColumnsOpen:t,clearNameCursors:s,columns:o,filtersPredicates:a,isFilterOpen:r,possibleColumns:d,predicates:l,selectedFilterPredicate:c,setAreColumnsOpen:u,setColumns:m,setIsFilterOpen:g,setPredicates:h}=pg(),{user:p}=Yi(),I=(p?.email??"").endsWith("@weezevent.com")||!function(e){return 0===e.groups.length||1===e.groups.length&&e.groups[0].operator===Tn.And}(l)||function(e){return e.groups.some(e=>new Set(e.predicates.map(({slug:e})=>e)).size!==e.predicates.length)}(l),x=(0,V.useMemo)(()=>function(e){return xg(e).groups.flatMap(e=>e.predicates)}(l),[l]),f=(0,V.useMemo)(()=>c?$g(a).find(({groupIndex:e,predicateIndex:n})=>e===c.groupIndex&&n===c.predicateIndex)??null:null,[a,c]);return(0,i.jsxs)(i.Fragment,{children:[r&&I&&(0,i.jsx)(dx,{buttonText:e.filtersButtonText,possibleFilters:e.filters,predicates:l,selectedFilterPredicate:c,subtitle:e.filtersSubtitle,onClose:()=>{g(!1)},onFilter:e=>{s(),h(e)}}),r&&!I&&(0,i.jsx)(pI,{buttonText:e.filtersButtonText,possibleFilters:e.filters,predicates:x,selectedFilterPredicate:f,subtitle:e.filtersSubtitle,onClose:()=>{g(!1)},onFilter:e=>{s(),h(xg(e))}}),t&&(0,i.jsx)(jp,{columns:d,initialSelectedColumns:o,saveButtonText:n("_diter_les_colo_39630"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_03763"),title:n("_dition_des_col_70300"),onClose:()=>{u(!1)},onSave:m})]})},cx=V.createContext({});function ux(){return V.useContext(cx)}const mx=br("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}}),gx=e=>{const n=Fi(),{onClose:t}=ux();return(0,i.jsxs)(Tl,{css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$6 $7"},gap:"3",justify:"end",children:[!e.hideCancelButton&&(0,i.jsx)(tc,{color:"white",onClick:t,children:n("annuler_48254")}),"function"==typeof e.children?e.children(t):e.children]})},hx=e=>(0,i.jsx)(Tl,{direction:"column",...wl(e),css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$5 $7 $7 $7",...e.css},children:e.children}),px=({icon:e,iconColor:n,children:t,subtitle:s,onClose:o})=>(0,i.jsxs)(Tl,{children:[(0,i.jsxs)(Tl,{align:"center",css:{flexGrow:"1",padding:"$6 $7 $5 $7"},gap:"4",children:[(0,i.jsx)(Tl,{align:"center",css:{border:"1px solid $gray200",borderRadius:"10px",boxShadow:"$xs",color:n||"$gray700",fontSize:"textMd",padding:"$3"},height:48,justify:"center",width:48,children:(0,i.jsx)(Yl,{className:"fa-xl",icon:e})}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:t}),g(s)&&(0,i.jsx)(Mr,{color:"gray500",children:s})]})]}),o&&(0,i.jsx)(Tl,{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)(Yl,{className:"fa-xl",icon:"xmark"})})]}),Ix=({children:e})=>{const{isOpen:n,onClose:t}=ux();return wu(t),tm("common-front/src/designSystem/components/modals/__deprecated/modal/modal.tsx","common-front/src/designSystem/components/modals/base/modal.tsx"),n?(0,St.createPortal)((0,i.jsx)(Tl,{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:t,children:(0,i.jsx)(mx,{onClick:e=>jc(e,!1),children:e})}),document.body):null},xx=e=>{const[n,t]=V.useState(e.isOpen??!1),s=V.useCallback(()=>{t(!1),e.onClose?.()},[t,e.onClose]);return V.useEffect(()=>{"boolean"==typeof e.isOpen&&t(e.isOpen)},[e.isOpen]),(0,i.jsx)(cx.Provider,{value:{isOpen:n,onClose:s,setIsOpen:t},children:e.children})},fx=e=>{const{setIsOpen:n}=ux(),t=e.children,s=V.useCallback(e=>{jc(e),n(!0),t.props.onClick?.(e)},[n,t]),o=V.useMemo(()=>V.cloneElement(V.Children.only(t),{onClick:s,onKeyPress:s,tabIndex:0}),[t,s]);return(0,i.jsx)(i.Fragment,{children:o})},_x=e=>{const n=Fi(),t=g(e.content?.[0])?n(e.content[0]):n("ooops_on_a_un_p_56888"),s=((e,n)=>"accreditation_limit_reached"===n?.[0]?[e("_ditez_l_accr_d_66820")]:"delegation_slots_limit_reached"===n?.[0]?[e("la_limite_sur_l_75773")]:"delegation_accreditations_limit_reached"===n?.[0]?[e("la_limite_sur_l_43036")]:"delegation_categories_limit_reached"===n?.[0]?[e("la_limite_sur_l_49480")]:"delegation_profiles_limit_reached"===n?.[0]?[e("la_limite_sur_l_56747")]:"can_not_delete_paired"===n?.[0]?[e("ce_membre_est_d_53903")]:Yo(n)?n.map(e):[e("une_erreur_est_92333")])(n,e.content);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"triangle-exclamation",iconColor:"$error700",children:t}),(0,i.jsx)(hx,{css:{color:"$gray500"},hideBorder:!0,children:(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[e.content?s.join(" "):e.children,g(e.requestUuid)&&(0,i.jsx)(rc,{css:{color:"$gray400",fontSize:"$textXs",userSelect:"text",wordBreak:"break-all"},children:n("r_f_rence_1_92505",e.requestUuid)})]})}),(0,i.jsx)(gx,{hideBorder:!0,hideCancelButton:!0,children:(0,i.jsx)(tc,{color:"error",onClick:e.onClose,children:n("fermer_62479")})})]})})},jx=(0,V.createContext)({}),vx=e=>{const[n,t]=(0,V.useState)(!1),[s,o]=(0,V.useState)([]),[a,r]=(0,V.useState)(void 0),d=(0,V.useCallback)((e,n)=>{e&&void 0!==n&&Ki(n),t(e),o((Array.isArray(n)?n:[]).flatMap(e=>e.isHeaventError?e.message.split("\n"):e.message?.startsWith("db::")?[e.message.substring(4).split(" ")[0]]:[])),r(function(e){const n=e?.[ta];return"string"==typeof n?n:void 0}(n))},[t,o,r]),l=(0,V.useCallback)(()=>{t(!1),o([]),r(void 0)},[t,o,r]);return(0,i.jsxs)(jx.Provider,{value:{isError:n,setIsError:d},children:[e.children,n&&(0,i.jsx)(_x,{content:s,requestUuid:a,onClose:l})]})};function Sx(e){return{numberOfPages:(0,V.useMemo)(()=>e?.numberOfPages??1,[e]),totalCount:(0,V.useMemo)(()=>e?.totalCount??0,[e])}}const yx=[],Cx=e=>{const{isGridDirty:n,...t}=function(e){const{filters:n,initial:t,onChange:i}=e,[s,o]=(0,V.useState)(t.predicates),[a,r]=(0,V.useState)(t.columns),[d,l]=(0,V.useState)(t.columnsSearch),[c,u]=(0,V.useState)(t.rendering),[m,g]=(0,V.useState)(t.sort),[h,p]=(0,V.useState)(t.name||""),[I,x]=(0,V.useState)(t.name||""),[f,_]=(0,V.useState)(t.limit),[j,v]=(0,V.useState)(0),[S,y]=(0,V.useState)(!1),[C,b]=(0,V.useState)(!1),[A,E]=(0,V.useState)(!1),[w,$]=(0,V.useState)(null),T=(0,V.useCallback)(()=>{v(0)},[v]),z=Bm(e=>{x(e),T()}),O=(0,V.useCallback)(e=>{i?.setName?.(e),p(e)},[i?.setName,p]),R=(0,V.useCallback)(()=>{O(""),x(""),T()},[O,x,T]),D=(0,V.useCallback)(e=>{i?.setPredicates?.(e),o(e)},[i?.setPredicates,o]),M=(0,V.useCallback)(e=>{i?.setColumns?.(e),r(e)},[i?.setColumns,r]),P=(0,V.useCallback)(e=>{i?.setColumnsSearch?.(e),l(e)},[i?.setColumnsSearch,l]),k=(0,V.useCallback)(e=>{i?.setRendering?.(e),u(e)},[i?.setRendering,u]),F=(0,V.useCallback)(e=>{i?.setLimit?.(e),_(e),T()},[i?.setLimit,_,T]),N=(0,V.useCallback)(e=>{i?.setSort?.(e),g(e),v(0)},[i?.setSort,g,v]),L=(0,V.useMemo)(()=>wg(s,n),[s,n]),U=(0,V.useMemo)(()=>JSON.stringify(t.predicates),[t.predicates]),B=(0,V.useMemo)(()=>JSON.stringify(t.columns),[t.columns]),W=(0,V.useMemo)(()=>JSON.stringify(t.columnsSearch),[t.columnsSearch]),G=(0,V.useMemo)(()=>JSON.stringify(t.rendering),[t.rendering]),q=(0,V.useMemo)(()=>JSON.stringify(t.sort),[t.sort]),H=(0,V.useMemo)(()=>JSON.stringify(s)!==U||JSON.stringify(a)!==B||JSON.stringify(d)!==W||JSON.stringify(c)!==G||JSON.stringify(m)!==q,[U,s,B,a,W,d,G,c,q,m]);return{areColumnsOpen:A,clearNameCursors:R,columns:a,columnsSearch:d,filtersPredicates:L,isEditMode:S,isFilterOpen:C,isGridDirty:H,limit:f,name:h,nameDebounced:I,offset:j,predicates:s,rendering:c,selectedFilterPredicate:w,setAreColumnsOpen:E,setColumns:M,setColumnsSearch:P,setIsEditMode:y,setIsFilterOpen:b,setLimit:F,setName:O,setNameDebounced:z,setOffset:v,setPredicates:D,setRendering:k,setSelectedFilterPredicate:$,setSort:N,sort:m}}({filters:e.filters,initial:{columns:e.columns,columnsSearch:e.columnsSearch,limit:e.limit,name:e.name,predicates:e.predicates,rendering:e.rendering,sort:e.sort},onChange:{setColumns:e.setColumns,setColumnsSearch:e.setColumnsSearch,setLimit:e.setLimit,setName:e.setName,setPredicates:e.setPredicates,setRendering:e.setRendering,setSort:e.setSort}}),s=gg({}),o=function(e){const{massActions:n}=e,{columns:t,columnsSearch:i,limit:s,nameDebounced:o,offset:a,predicates:r,rendering:d,sort:l}=e.state,c=(0,V.useMemo)(()=>{const n=e.renderingLoaders?.(d);return null===n?{}:{columnsToIncludes:e.columnsToIncludes,getMassActionId:e.getMassActionId,loadDataList:e.loadDataList,loadDataListParams:e.loadDataListParams,loadRow:e.loadRow,loadRowParams:e.loadRowParams,...n}},[d,e.columnsToIncludes,e.getMassActionId,e.loadDataList,e.loadDataListParams,e.loadRow,e.loadRowParams,e.renderingLoaders]),u=(0,V.useMemo)(()=>c.columnsToIncludes?.(t,d)??{},[t,d,c.columnsToIncludes]),m=(0,V.useMemo)(()=>e.renderingParams?.(d)??{},[d,e.renderingParams]),[h,p]=(0,V.useState)(null),[I,x]=(0,V.useState)(!1),{setIsError:f}=(0,V.useContext)(jx),_=(0,V.useRef)(0),j=(0,V.useCallback)(async()=>{const n=c.loadDataList;if(!n)return;const t=++_.current;x(!0);try{const h=await n({...u,...c.loadDataListParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,name:g(o)?o:null,columnsSearch:Yo(i)?i:null,predicatesGroups:r,limit:s,offset:a,sort:l,...m},await X());t===_.current&&(p({loadDataList:n,rendering:d,result:h.data}),f(!1),x(!1))}catch(e){t===_.current&&f(!0,e)}},[i,u,s,o,a,r,d,m,f,x,p,l,e.organizationId,e.eventId,c.loadDataList,c.loadDataListParams]),v=!!c.loadDataList&&h?.loadDataList===c.loadDataList&&h.rendering===d,S=v?h.result:null,[y,C]=(0,V.useState)([]),b=v?y:yx,{numberOfPages:A,totalCount:E}=Sx(S?.rows),[w,$]=(0,V.useState)({}),T=(0,V.useRef)(0),z=(0,V.useCallback)(async n=>{const t=c.loadRow;if(!t)return;const i=T.current,s=()=>i!==T.current;$(e=>({...e,[n]:!0}));try{const i=(await t({...u,...c.loadRowParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,id:n},await X())).data.row;if(s())return;C(e=>e.map(e=>e.id===n?i:e))}catch(e){if(s())return;f(!0,e)}$(e=>({...e,[n]:!1}))},[u,$,f,e.organizationId,e.eventId,c.loadRow,c.loadRowParams]),O=(0,V.useCallback)(e=>c.getMassActionId?.(e)??e.id,[c.getMassActionId]);return(0,V.useEffect)(()=>(j(),()=>{_.current++,x(!1)}),[i,u,s,o,a,r,d,m,l,e.organizationId,e.eventId,c.loadDataList]),(0,V.useEffect)(()=>{C(h?.result.rows?.nodes??[])},[h]),(0,V.useEffect)(()=>($({}),()=>{T.current++}),[h,d,c.loadRow]),(0,V.useEffect)(()=>{c.loadDataList&&(n.setStates(Object.fromEntries(b.map(e=>[`r${O(e)}`,{id:O(e),state:"unchecked"}]))),n.setIsAllSelected(!1))},[b,n.setStates,n.setIsAllSelected]),{data:b,getMassActionId:O,idToLoading:w,isLoading:I||!!c.loadDataList&&!v,loadDataResult:S,numberOfPages:A,reload:j,reloadRow:z,totalCount:E}}({columnsToIncludes:e.columnsToIncludes,eventId:e.eventId,getMassActionId:e.getMassActionId,loadDataList:e.loadDataList,loadDataListParams:e.loadDataListParams,loadRow:e.loadRow,loadRowParams:e.loadRowParams,massActions:s,organizationId:e.organizationId,renderingLoaders:e.renderingLoaders,renderingParams:e.renderingParams,state:t});return(0,i.jsxs)(hg.Provider,{value:{...t,...o,isSaveVisible:n,massActions:s,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,showMassActions:e.showMassActions??!1,showRowDropdown:e.showRowDropdown??!1,showRowEdit:e.showRowEdit??!1},children:[!1===e.showHeader?e.children:(0,i.jsxs)(Tl,{css:{background:"white"},direction:"column",height:1,width:1,children:[(0,i.jsx)(rp,{renderActions:e.renderActions,renderAllSelectedText:e.renderAllSelectedText,renderControls:e.renderControls,renderPageSelectedText:e.renderPageSelectedText,renderSelectAllText:e.renderSelectAllText,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:e.showFilters,showPredicatesBadges:e.showPredicatesBadges,showSearchColumns:e.showSearchColumns,showSelectAll:e.showSelectAll}),e.children]}),(0,i.jsx)(lx,{filters:e.filters,filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle})]})},bx={deserialize(e){const n=parseInt(e||"",10);return isNaN(n)?null:n},serialize:e=>e.toString(10)},Ax={deserialize(e){try{return JSON.parse(e||"")}catch{return null}},serialize:e=>JSON.stringify(e)},Ex={deserialize:e=>g(e)&&Oo.c9.fromISO(e)?.isValid?Oo.c9.fromISO(e):null,serialize:e=>e.toISO()};function wx(e,n,t={}){const i=Gi(),[s,o]=V.useState("function"==typeof t.deserialize?t.deserialize(i.getItem(e))||n:i.getItem(e)??n);return[s,V.useCallback(n=>{o(n),i.setItem(e,"function"==typeof t.serialize?t.serialize(n):n)},[e,o,i])]}const $x=e=>{return(0,i.jsxs)(Gm,{css:{cursor:"pointer",userSelect:"none",...e.css||{}},minWidth:e.minWidth,width:e.width,onClick:()=>{var n,t;e.setSort((n=e.sort,t=e.attribute,null===n||n.attribute!==t?{attribute:t,direction:Gn.Asc}:n.direction===Gn.Asc?{attribute:t,direction:Gn.Desc}:null))},children:[e.children,(0,i.jsx)(Pl,{width:"2"}),(0,i.jsx)(Yl,{icon:(n=e.sort,t=e.attribute,null===n||n.attribute!==t?"arrow-down-arrow-up":n.direction===Gn.Asc?"arrow-up":"arrow-down")})]});var n,t},Tx=e=>{const n=!!e.paginationRow;return(0,i.jsx)(Sm,{children:(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsxs)(eu,{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:n?void 0:"$radii$2",borderEndStartRadius:n?void 0:"$radii$2"},"& .table-header-row, & .table-row":{borderLeft:"none",borderRight:"none"},...e.css},gridtemplaterows:"44px 1fr",children:[e.headerRow,(0,i.jsx)(Mr,{css:{overflow:"auto"},children:e.children})]}),e.paginationRow]})})},zx=V.createContext({}),Ox=e=>{const[n,t]=V.useState(!1),[s,o]=V.useState(null),[a,r]=V.useState(null),d=(0,vc.A)("tooltip-");return(0,i.jsx)(zx.Provider,{value:{isVisible:n,referenceElement:s,popperElement:a,tooltipId:d,setIsVisible:t,setReferenceElement:o,setPopperElement:r},children:e.children})};function Rx(){return V.useContext(zx)}const Dx=e=>{const{isVisible:n,popperElement:t,referenceElement:s,setPopperElement:o,tooltipId:a}=Rx(),{styles:r,attributes:d,update:l}=(0,ku.E)(s,t,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,4]}}]});V.useEffect(()=>{l?.()},[n,s]);const c=(0,i.jsx)(Tl,{ref:o,align:"center",css:{background:"$grayCustom900",borderRadius:"$1",color:location.origin===F.HEAVENT_PUBLIC_URL.origin?"contrast-color(var(--colors-grayCustom900))":"white",display:n?"flex":"none",px:"$3",py:"6px",zIndex:1e3,...r.popper},id:a,justify:"center",role:"tooltip",...d.popper,children:e.children});return e.renderOnPortal?(0,St.createPortal)(c,document.body):c},Mx=e=>{const{setIsVisible:n,setReferenceElement:t,tooltipId:s}=Rx(),o=V.cloneElement(V.Children.only(e.children),{ref(e){t(e)},"aria-labelledby":s,"aria-describedby":s,onMouseEnter(){n(!0)},onMouseLeave(){n(!1)},onFocus(){n(!0)},onBlur(){n(!1)}});return(0,i.jsx)(Mr,{css:e.css,children:o})},Px=e=>{const{translate:n}=Kl(),{getMassActionId:t,massActions:s,reload:o,reloadRow:a}=pg(),{showMassActions:r,showRowDropdown:d,showRowEdit:l}=e,c=s.states[`r${t(e.row)}`]?.state??"unchecked",u=V.useCallback(()=>{a(e.row.id)},[e.row.id,a]),m=d||l;return(0,i.jsxs)(km,{css:{background:"checked"===c?"$primary100":"white","&:hover":{background:"checked"===c?"$primary100":"$gray100"}},onMouseLeave:e=>{Tu(e.target)},children:[r&&(0,i.jsx)($m,{justify:"center",width:48,children:(0,i.jsx)(sm,{state:c,onClick:(n,i)=>{s.toggleRow(`r${t(e.row)}`,n,i.shiftKey)}})}),e.selectedColumns.map(n=>(0,i.jsx)(V.Fragment,{children:e.renderCell(n,e.row,u)},n.slug)),m&&(0,i.jsxs)(Qm,{justify:"center",children:[l&&e.getEditPath&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",to:e.getEditPath(e.row)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),d&&e.renderRowDropdown?.(e.row,o)]}),e.renderRowPanels?.(e.row,u)]})},kx=e=>{const{columns:n,data:t,idToLoading:s,isLoading:o,limit:a,massActions:r,numberOfPages:d,offset:l,possibleColumns:c,setLimit:u,setOffset:m,setSort:g,sort:h,totalCount:p,...I}=pg(),x=e.showMassActions??I.showMassActions,f=e.showRowDropdown??I.showRowDropdown,_=e.showRowEdit??I.showRowEdit,j=V.useMemo(()=>n.flatMap(e=>(0,kl.A)([c.find(n=>n.slug===e)])),[n,c]);return(0,i.jsx)(Tl,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Tx,{"aria-busy":o,headerRow:(0,i.jsxs)(jm,{children:[x&&(0,i.jsx)(Gm,{justify:"center",width:48,children:(0,i.jsx)(sm,{state:r.selectAllState,onClick:r.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)($x,{attribute:e.sortAttribute,minWidth:e.minWidth,setSort:g,sort:h,width:e.width,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gm,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(f||_)&&(0,i.jsx)(Gm,{width:100})]}),paginationRow:(0,i.jsx)(Fm,{children:(0,i.jsx)(Pm,{limit:a,numberOfPages:d,offset:l,setLimit:u,setOffset:m,showLimits:!0,totalCount:p})}),children:o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{})]}):t.map(n=>s[n.id]?(0,i.jsx)(qm,{},n.id):(0,i.jsx)(Px,{getEditPath:e.getEditPath,renderCell:e.renderCell,renderRowDropdown:e.renderRowDropdown,renderRowPanels:e.renderRowPanels,row:n,selectedColumns:j,showMassActions:x,showRowDropdown:f,showRowEdit:_},n.id))})})};var Fx;!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"}(Fx||(Fx={}));let Nx=class extends Og{constructor(e,n,t){super(e,n,t)}getFilters(){return[{slug:"features",name:this.t("fonctionnalit_s_47714"),category:this.t("organisation_71863"),fieldType:nn.Select,values:Bt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_admin_98471"),category:this.t("organisation_71863"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"isActive",name:this.t("est_active_05309"),category:this.t("organisation_71863"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"useOldBilling",name:this.t("utilise_l_ancie_27299"),category:this.t("organisation_71863"),fieldType:nn.Checkbox},{slug:"isOverLimit",name:this.t("d_passe_la_limi_27046"),category:this.t("organisation_71863"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:Fx.MembersLimit,name:this.t("nombre_de_membr_16400"),category:this.t("organisation_71863"),fieldType:nn.Number},{slug:Fx.PricePerMember,name:this.t("prix_par_membre_20633"),category:this.t("organisation_71863"),fieldType:nn.Number}]}getPossibleColumns(){return[{slug:Fx.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:fn.Id,width:100},{slug:Fx.Name,name:this.t("nom_de_l_organi_49583"),minWidth:240},{slug:Fx.InsertedAt,name:this.t("date_de_cr_atio_00749"),isSortable:!0,sortAttribute:fn.InsertedAt,width:200},{slug:Fx.PeriodEndAt,name:this.t("date_de_fin_de_17750"),isSortable:!0,sortAttribute:fn.PeriodEndAt,width:200},{slug:Fx.Features,name:this.t("fonctionnalit_s_47714"),minWidth:320},{slug:Fx.NumberOfEvents,name:this.t("nombre_d_v_nem_14214"),minWidth:180},{slug:Fx.NumberOfMembers,name:this.t("nombre_de_membr_49522"),minWidth:180},{slug:Fx.MembersLimit,name:this.t("nombre_de_membr_16400"),minWidth:180},{slug:Fx.PricePerMember,name:this.t("prix_par_membre_20633"),minWidth:180},{slug:Fx.WeezeventOrganizationId,name:this.t("id_de_l_organis_67465"),isSortable:!0,sortAttribute:fn.WeezeventOrganizationId,width:100}]}};function Lx(e){switch(e){case Ze.Accreditation:return"badge-check";case Ze.Api:return"code-branch";case Ze.Beta:return"flask";case Ze.Community:return"people-group";case Ze.Criblage:return"filter";case Ze.CustomDocument:return"file";case Ze.Delegation:return"users";case Ze.Documents:return"file";case Ze.Eid:return"id-card";case Ze.KmlImport:return"cloud-arrow-up";case Ze.Languages:return"language";case Ze.Multiform:return"file-lines";case Ze.Skidata:return"person-skiing";case Ze.Sms:return"message";case Ze.Weezevent:return"ticket";case Ze.Zapier:return"bolt";default:return Zl()}}Nx=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],Nx);const Ux=e=>{const n=ki(Jm);return e.column.slug===Fx.Id?(0,i.jsx)($m,{width:e.column.width,children:e.row.id}):e.column.slug===Fx.WeezeventOrganizationId?(0,i.jsx)($m,{width:e.column.width,children:e.row.weezeventOrganizationId?(0,i.jsxs)(Xm,{to:`/ticket/O${e.row.weezeventOrganizationId}`,children:["O",e.row.weezeventOrganizationId]}):""}):e.column.slug===Fx.Name?(0,i.jsx)($m,{css:{"& a":{color:"$primary500 !important"}},children:(0,i.jsx)(ql,{to:us.ORGANIZATION({organizationId:e.row.id}),children:e.row.name})}):e.column.slug===Fx.InsertedAt?(0,i.jsx)($m,{width:e.column.width,children:n.toLocaleString(e.row.insertedAt,Uo.DateOnly.MonthLong)}):e.column.slug===Fx.PeriodEndAt?(0,i.jsx)($m,{width:e.column.width,children:n.toLocaleString(e.row.periodEndAt,Uo.DateOnly.MonthLong)}):e.column.slug===Fx.Features?(0,i.jsx)($m,{children:(0,i.jsx)(Tl,{align:"center",css:{overflow:"auto",py:"$2"},gap:"2",height:1,width:1,wrap:"wrap",children:e.row.features.map(e=>(0,i.jsx)(Ku,{leftIcon:Lx(e),children:e},e))})}):e.column.slug===Fx.NumberOfEvents?(0,i.jsx)($m,{children:e.row.numberOfEvents}):e.column.slug===Fx.NumberOfMembers?(0,i.jsx)($m,{children:e.row.membersStats.numberOfMembers}):e.column.slug===Fx.MembersLimit?(0,i.jsx)($m,{children:e.row.membersLimit}):e.column.slug===Fx.PricePerMember?(0,i.jsx)($m,{children:e.row.pricePerMember}):(0,i.jsx)($m,{})},Vx=e=>{const n=Fi(),{user:t}=Yi(),{mutate:s,isLoading:o}=function(e={}){return Ui("mutation BackofficeOrganizationUserAdd($organizationId: OrganizationId!) {\n backofficeOrganizationUserAdd(organizationId: $organizationId)\n}\n",e)}(),{mutate:a,isLoading:r}=function(e={}){return Ui("mutation BackofficeOrganizationUserRemove($organizationId: OrganizationId!) {\n backofficeOrganizationUserRemove(organizationId: $organizationId)\n}\n",e)}(),d=e.organization.users.map(({id:e})=>e);return(0,i.jsxs)(Km,{children:[d.includes(t.id)?(0,i.jsx)(Pu,{color:r?"disabled":"default",icon:"minus",onClick:async()=>{await a({organizationId:e.organization.id}),e.reload()},children:n("s_enlever_comme_18919")}):(0,i.jsx)(Pu,{color:o?"disabled":"default",icon:"plus",onClick:async()=>{await s({organizationId:e.organization.id}),window.open(`${F.HEAVENT_APP_URL}${us.ORGANIZATION({organizationId:e.organization.id})}`,"_blank"),e.reload()},children:n("s_ajouter_comme_70404")}),(0,i.jsx)(Pu,{icon:"pen",to:yo.EDIT_BACKOFFICE_ORGANIZATION(e.organization.id),children:n("_diter_62574")})]})},Bx=()=>{const{history:e,translate:n}=Kl(),t=ki(Nx),[s,o]=wx(Tc.BACKOFFICE_SEARCH,"",{deserialize(e){const n=new URL(location.href).searchParams.get("q");return g(n)?n:e}}),[a,r]=wx(Tc.BACKOFFICE_COLUMNS,[Fx.Id,Fx.Name,Fx.InsertedAt,Fx.PeriodEndAt],Ax),[d,l]=wx(Tc.BACKOFFICE_LIMIT,Tm,bx),[c,u]=wx(Tc.BACKOFFICE_PREDICATES,[],Ax),m=(0,V.useMemo)(()=>xg(c),[c]),[h,p]=wx(Tc.BACKOFFICE_SORT,null,Ax);return(0,i.jsx)(Mr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Tl,{css:{padding:"$7"},direction:"column",gap:"7",width:1,children:[(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:n("organisations_26509")}),(0,i.jsx)(tc,{color:"white",leftIcon:"plus",to:is(us.ORGANIZATIONS),children:n("cr_er_une_organ_06669")}),(0,i.jsx)(tc,{leftIcon:"house",onClick:()=>{e.push(yo.HOME)},children:"WeezCrew"}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Fu,{placement:"bottom-end",children:(0,i.jsx)(Pu,{icon:"eye",onClick:()=>{e.push(yo.BACKOFFICE_INVOICES)},children:n("voir_les_factur_82290")})})]})]}),(0,i.jsx)(Cx,{columns:a,columnsSearch:[],eventId:null,filters:t.getFilters(),limit:d,loadDataList:fd,loadRow:xd,name:s,organizationId:null,possibleColumns:t.getPossibleColumns(),predicates:m,rendering:xh.List,setColumns:r,setLimit:l,setName:o,setPredicates:u,setSort:p,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showPredicatesBadges:!0,showRowDropdown:!0,showRowEdit:!0,showSearchColumns:!1,sort:h,children:(0,i.jsx)(kx,{getEditPath:e=>yo.EDIT_BACKOFFICE_ORGANIZATION(e.id),renderCell:(e,n)=>(0,i.jsx)(Ux,{column:e,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)(Vx,{organization:e,reload:n})})})]})})},Wx=br("div",{margin:"auto",width:"$containerTablet","@desktop":{width:"$container"}}),Gx=V.forwardRef((e,n)=>(0,i.jsx)(Mr,{ref:n,css:{background:"$gray50",overflowX:"hidden",overflowY:"auto",py:"$10",...e.css},height:1,width:1,children:(0,i.jsx)(Wx,{children:e.children})}));Gx.displayName="CenteredContainer";const qx=br("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"}}),Hx=e=>{const n=Bi();return(0,i.jsxs)(qx,{color:e.color,children:[(0,i.jsxs)(Tl,{align:"center",className:"fsp-header",gap:"4",height:65,width:1,children:[(0,i.jsx)(Mr,{css:{flexShrink:3},width:300}),(0,i.jsxs)(Tl,{align:"center",css:{flex:"1"},direction:"column",children:[e.category&&(0,i.jsx)(Mr,{className:"fsp-category",children:e.category}),(0,i.jsx)(Mr,{className:"fsp-title",css:{maxWidth:"100%"},ellipsis:!0,children:e.heading})]}),(0,i.jsxs)(Tl,{gap:"4",justify:"end",width:300,children:[e.button,(0,i.jsx)(tc,{color:"dark"===e.color?"gray":"white",css:{flexShrink:0},leftIcon:"xmark",onClick:()=>{"function"==typeof e.onClose?e.onClose():n.goBack(e.fallbackClosePath||yo.HOME)}})]})]}),(0,i.jsx)(Mr,{css:{height:"calc(100% - 65px)"},width:1,children:e.children})]})},Yx=({acceptCustomColours:e,css:n,footer:t,header:s,heading:o,subtitle:a,children:r,...d})=>(0,i.jsxs)(Tl,{as:El.Section,className:"card",css:{padding:"unset !important",bd:!0,inlineSize:"100%",backgroundColor:"$white","& .card":{backgroundColor:"$gray50","& .card__body":{padding:"$4 $5"}},...n},direction:"column",...d,children:[s||(o||a)&&(0,i.jsx)(Tl,{align:"center",as:El.Header,css:{borderBlockEnd:"1px solid $gray200",padding:"$6 $7 $5 $7"},gap:"3",children:(0,i.jsxs)(Mr,{css:{flex:"1"},children:[o&&(0,i.jsx)(dc,{css:e?{color:"$grayCustom900"}:void 0,children:o}),a&&(0,i.jsx)(rc,{css:e?{color:"$grayCustom500"}:void 0,textStyle:"subtitle",children:a})]})}),(0,i.jsx)(Tl,{className:"card__body",css:{gap:"$6",padding:"$6 $7","&:empty":{display:"none"}},direction:"column",children:r}),t&&(0,i.jsx)(Tl,{as:El.Footer,css:{borderBlockStart:"1px solid $gray200",padding:"$6","&:empty":{display:"none"}},gap:"3",children:t})]}),Zx=(0,V.createContext)({});function Kx(){return(0,V.useContext)(Zx)}const Xx=({name:e,children:n,...t})=>{const{isDisabled:s}=Kx();return(0,i.jsx)(Dl.D0,{name:e,render:e=>{const o=!0===e.input.checked?"checked":"unchecked";return(0,i.jsx)(om,{...t,disabled:s??t.disabled,state:o,onClick:()=>{e.input.onChange(!e.input.checked)},children:n})},type:"checkbox"})},Qx=(0,V.memo)(function({name:e,hint:n,state:t,...s}){return(0,i.jsx)(Dl.D0,{name:e,render:({input:o,meta:a})=>{const r=a.data?.forceDisplayError&&a.invalid||a.touched&&a.invalid;return(0,i.jsx)(Wp,{hint:r?a.error:n,name:e,state:r?"error":t,value:o.value,onBlur:o.onBlur,onChange:o.onChange,onFocus:o.onFocus,...s})}})}),Jx=({value:e,onChange:n,...t})=>{const[s,o]=(0,V.useState)(e?.toString()??""),[a,r]=(0,V.useState)(e);return a!==e&&(o(e?.toString()??""),r(e)),(0,i.jsx)(wc,{value:s,onChange:e=>{const t=parseFloat(e);o(e),r(isNaN(t)?null:t),n(isNaN(t)?null:t)},...t})},ef=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(Dl.D0,{name:e,render:o=>{const a=_c(o.meta);return(0,i.jsx)(Jx,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),nf=e=>(0,i.jsx)(Tl,{as:"legend",css:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",width:"1px",height:"1px",whiteSpace:"nowrap"},direction:"column",children:e.heading});var tf;!function(e){e.Dark="dark",e.Normal="normal"}(tf||(tf={}));const sf=({canSelect:e,centerHeader:n,children:t,disabled:s,footerActions:o,heading:a,header:r,headerStyle:d=tf.Normal,headerActions:l,hideHeader:c,initialIsOpen:u,isCompleted:m,isOpen:g,isToggleable:h,onSelect:p,onToggle:I,stepNumber:x,subtitle:f,..._})=>{const j=Fi(),{descId:v}=Sc(),[S,y]=V.useState(u??!0),C=h?S:g,b=d===tf.Dark;return(0,i.jsx)(Zx.Provider,{value:{isDisabled:s},children:(0,i.jsx)(Yx,{"aria-describedby":v,as:"fieldset",css:{borderRadius:b?"$1":void 0,overflow:"hidden","&:disabled :is(input, select, textarea, datalist, button)":{cursor:"not-allowed !important"},..._.css},direction:"column",disabled:s,footer:!1!==C&&o,header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nf,{heading:a}),!c&&(0,i.jsxs)(Tl,{align:"center",as:"header",css:b?{background:C?"$gray900":"white",blockSize:"64px",cursor:e&&!C?"pointer":"default",padding:"$6 $6 $5 $6"}:n?{padding:"$7 $7 0 $7",textAlign:"center"}:!1!==C?{borderBlockEnd:"1px solid $gray200",padding:"$6 $7 $5 $7"}:{padding:"$6 $7"},gap:"3",onClick:p,children:[b&&(0,i.jsx)(Tl,{align:"center",css:{background:m?"$success200":"white",border:m?"none":"1px solid $gray200",borderRadius:"32px",color:m?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:m?(0,i.jsx)(Yl,{icon:"check"}):x}),(0,i.jsxs)(Mr,{css:{flex:"1"},children:[a&&(0,i.jsx)(dc,{"aria-hidden":"true",css:b?C?{color:"white"}:void 0:{fontWeight:"$semiBold"},children:a}),f&&(0,i.jsx)(rc,{color:b?C?"white":"gray800":void 0,id:v,textStyle:"subtitle",children:f})]}),l&&(0,i.jsx)(Tl,{gap:"4",justify:"end",children:l}),h&&(0,i.jsx)(ep,{label:j("toggle_section_92160"),size:"md",value:S,onChange:e=>{y(e),I?.(e)}})]})]}),..._,children:!1!==C&&(0,i.jsx)(Tl,{css:{"&:has(> fieldset.fieldset--column)":{gap:"$9"}},direction:"column",children:t})})})},of=({name:e,hint:n,state:t,multiple:s,...o})=>{const{isDisabled:a}=Kx();return(0,i.jsx)(Dl.D0,{name:e,render:r=>{const d=_c(r.meta);return(0,i.jsx)(_m,{hint:d?r.meta.error:n,multiple:s,name:e,state:d?"error":a?"disabled":t,values:s?Array.isArray(r.input.value)?r.input.value:[]:"number"==typeof r.input.value||g(r.input.value)?[r.input.value]:[],onChange:e=>{s?r.input.onChange(e):Yo(e)?r.input.onChange(e[0]):r.input.onChange(null)},...o})}})},af=({css:e,label:n,description:t,state:s,icon:o,hint:a,rightIcon:r,rightText:d,onChange:l,value:c,...u})=>{const{inputId:m,descId:g,errorId:h}=Sc();return(0,i.jsxs)(Tl,{css:e,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:m,children:n}),(0,i.jsx)(yc,{id:g,children:t}),(n||t)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Ec,{cursor:"text",height:"fluid",icon:o,rightIcon:r,rightText:d,state:s,children:(0,i.jsxs)(eu,{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":t?g:void 0,"aria-errormessage":"error"===s?h:void 0,"aria-invalid":"error"===s,disabled:"disabled"===s,id:m,value:c,onChange:e=>{l(e.target.value)},...u}),(0,i.jsxs)(Mr,{className:"replicated-text",children:[c," "]})]})}),(0,i.jsx)(Cc,{id:h,state:s,children:a})]})},rf=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(Dl.D0,{name:e,render:o=>{const a=_c(o.meta);return(0,i.jsx)(af,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),df=e=>(0,i.jsx)(Dl.D0,{name:e.name,render:n=>(0,i.jsx)(np,{disabled:e.disabled,size:e.size,subtext:e.subtext,value:n.input.value,onChange:n.input.onChange,children:e.children})}),lf=zc.gl(e=>e&&Oo.c9.fromISO(e).isValid);let cf=class extends Rc{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 zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_de_l_org_60618")),periodEndAt:lf.required(this.t("la_date_de_fin_04076")).typeError(this.t("la_date_de_fin_04076")).test("min-period-end-at",this.t("la_date_de_fin_63806"),function(){return Oo.c9.isDateTime(this.parent.periodEndAt)&&this.parent.periodEndAt.isValid&&this.parent.periodEndAt>Oo.c9.fromObject({year:2016})}),features:zc.YO().of(zc.Yj().oneOf(Bt,this.t("les_fonctionnal_36778"))),usersIds:zc.YO().of(zc.ai()),isBlocked:zc.zM().required()})}updateOrganizationSchema(){return zc.Ik().shape({organization:this.organizationInputSchema()})}};cf=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],cf);const uf=br("span",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},grayCustom50:{color:"$grayCustom50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},grayCustom500:{color:"$grayCustom500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},grayCustom700:{color:"$grayCustom700"},gray800:{color:"$gray800"},grayCustom800:{color:"$grayCustom800"},gray900:{color:"$gray900"},grayCustom900:{color:"$grayCustom900"},grayDark50:{color:"$grayDark50"},grayDark100:{color:"$grayDark100"},grayDark500:{color:"$grayDark500"},grayDark700:{color:"$grayDark700"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primaryCustom500:{color:"$primaryCustom500"},primary600:{color:"$primary600"},primaryCustom600:{color:"$primaryCustom600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},primary950:{color:"$primary950"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight50:{color:"$blueLight50"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight500:{color:"$blueLight500"},blueLight600:{color:"$blueLight600"},blueLight700:{color:"$blueLight700"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},purpleLight50:{color:"$purpleLight50"},purpleLight100:{color:"$purpleLight100"},purpleLight500:{color:"$purpleLight500"},purpleLight700:{color:"$purpleLight700"},purpleDark50:{color:"$purpleDark50"},purpleDark100:{color:"$purpleDark100"},purpleDark500:{color:"$purpleDark500"},purpleDark700:{color:"$purpleDark700"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange50:{color:"$orange50"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange500:{color:"$orange500"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},redLight50:{color:"$redLight50"},redLight100:{color:"$redLight100"},redLight500:{color:"$redLight500"},redLight700:{color:"$redLight700"},redDark50:{color:"$redDark50"},redDark100:{color:"$redDark100"},redDark500:{color:"$redDark500"},redDark700:{color:"$redDark700"},green50:{color:"$green50"},green100:{color:"$green100"},green500:{color:"$green500"},green700:{color:"$green700"},greenDark50:{color:"$greenDark50"},greenDark100:{color:"$greenDark100"},greenDark500:{color:"$greenDark500"},greenDark700:{color:"$greenDark700"},brown50:{color:"$brown50"},brown100:{color:"$brown100"},brown500:{color:"$brown500"},brown700:{color:"$brown700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit"}}),mf=V.forwardRef((e,n)=>(0,i.jsx)(uf,{...(0,_r.A)(e,"font"),...jr(e.font),ref:n,css:e.css}));mf.displayName="Span";const gf=1587,hf=1123,pf=1122,If=793,xf=559,ff=396,_f=323,jf=204,vf={A4:{height:"297mm",width:"210mm"},A5:{height:"210mm",width:"148mm"},A6:{height:"148mm",width:"105mm"},CB:{height:"53.98mm",width:"85.6mm"}},Sf=(e,n)=>{n?.startsWith("/")||(console.warn(`Path '${n}' missing leading slash`),n="/"+n);const t=new v(F.HEAVENT_PUBLIC_URL);return bu.has(e)&&(t.host=bu.get(e)),t.pathname+=n,t.href},yf=({organizationId:e,eventId:n,delegationId:t,formId:i,teamCode:s,query:o})=>{const a=new v(F.HEAVENT_PUBLIC_URL);return bu.has(e)&&(a.host=bu.get(e)),a.pathname+=`${(()=>{if(t)return"number"==typeof n?Js.DELEGATION_FORM({organizationId:e,delegationId:t,eventId:n,formId:i}):Js.DELEGATION_FORM({organizationId:e,delegationId:t,formId:i});{const t="number"==typeof n?Rs.EVENT_FORM({organizationId:e,eventId:n,formId:i}):us.ORGANIZATION_FORM({organizationId:e,formId:i});return g(s)?`${t}/team/${s}`:t}})()}`,g(o?.email)&&a.searchParams.set("email",o.email),o?.preview&&a.searchParams.set("preview",o?.preview?.toString()),o?.previewState&&a.searchParams.set("state",o?.previewState?.toString()),a.href};var Cf;!function(e){e.QR="qr",e.Code39="code39"}(Cf||(Cf={}));const bf=(e,n)=>{const t=new v(F.HEAVENT_API_URL);return t.pathname+=`/barcode/${n?.barcodeType??Cf.QR}`,t.searchParams.set("text",e),t.searchParams.set("color",n?.color??"000000"),n?.height&&t.searchParams.set("height",n?.height?.toString()),n?.width&&t.searchParams.set("width",n?.width?.toString()),t.href},Af=({organizationId:e,eventId:n,lang:t,pathComponent:i,key:s,searchParams:o})=>{const a=new v(F.HEAVENT_API_URL);return a.pathname+=n?`/export/organization/${e}/event/${n}/${i}`:`/export/organization/${e}/${i}`,g(s)&&a.searchParams.set("key",s),g(t)&&a.searchParams.set("lang",t),Object.entries(o??{}).forEach(([e,n])=>{a.searchParams.set(e,n)}),a.href};function Ef(e,n,t={}){const i=new v(F.HEAVENT_API_URL);i.pathname+=`/documents/${e}.${n}`;const s=new URLSearchParams(Object.entries(t).filter(([e,n])=>g(n)));for(const[e,n]of s)i.searchParams.set(e,n);return i.href}function wf(e){const n=new v(`https://${F.HEAVENT_APP_URL.subdomain}.${F.WEEZEVENT_DOMAIN}`,void 0,void 0,`access/O${e}/partners`);return n.searchParams.append("utm_source","weezcrew"),n.href}function $f(e,n){return new v(`https://${F.HEAVENT_APP_URL.subdomain}.${F.WEEZEVENT_DOMAIN}`,void 0,void 0,`access/O${e}/checkpoints/edit/${n}`).href}const Tf=e=>{const n=e.event.volunteerRegistration,t=n.userInfo,s=(0,Lm.A)(n.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/animaje/convention-2026-2-page1.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:pf,width:If,children:[(0,i.jsxs)(Mr,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"334px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]}),(0,i.jsx)(Mr,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"364px"},children:t.fields?.phone?.internationalFormat||""}),(0,i.jsx)(Mr,{css:{left:"650px",position:"absolute",top:"322px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:bf(n.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Tl,{css:{left:"72px",position:"absolute",top:"558px"},direction:"column",gap:"1",children:s.map((e,n)=>(0,i.jsxs)(Mr,{css:{fontSize:"12px",fontWeight:"500"},children:[(0,i.jsxs)(mf,{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]},n))})]}),(0,i.jsxs)(Tl,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/animaje/convention-2026-3-page2.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:pf,width:If,children:[(0,i.jsxs)(Mr,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"222px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]}),(0,i.jsx)(Mr,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"252px"},children:t.fields?.phone?.internationalFormat||""}),(0,i.jsx)(Mr,{css:{left:"650px",position:"absolute",top:"210px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:bf(n.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsxs)(Mr,{css:{fontSize:"12px",fontWeight:"700",left:"178px",position:"absolute",top:"455px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]}),(0,i.jsxs)(Mr,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"537px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]}),(0,i.jsxs)(Mr,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"617px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]})]})]})};function zf(e,n,t){return e.filter(e=>{if(n?.isValid&&t?.isValid){const i=Oo.IX.fromDateTimes(n.startOf("day"),t.endOf("day"));return e.positionSlot.range.overlaps(i)}return!n?.isValid||e.positionSlot.range.start.startOf("day").equals(n.startOf("day"))})}function Of(e){return{[`${e} p.h-small`]:{fontSize:"12px"},[`${e} h2`]:{fontSize:"20px",fontWeight:"$semiBold"},[`${e} h3`]:{fontSize:"18px",fontWeight:"$semiBold"},[`${e} h4`]:{fontSize:"16px",fontWeight:"$semiBold"},[`${e} a`]:{color:"$primary500"},[`${e} blockquote`]:{borderLeft:"3px solid $gray200",fontStyle:"italic",marginLeft:0,marginRight:0,px:"$4","& p":{margin:0,paddingBottom:"$2",paddingTop:"$2"}}}}const Rf=e=>(0,i.jsx)(Mr,{className:"h-rich-text",css:{...Of("&"),"& > 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 n=e.target;if(n){const t=n.closest("a");t&&(e.preventDefault(),window.open(t.getAttribute("href"),"_blank"))}}});function Df(e,n){return`https://www.google.com/maps/place/${e},${n}`}const Mf=4427,Pf=4848,kf=e=>e===Mf?{color:"#ff5501"}:e===Pf?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},Ff=e=>e===Mf?{color:"white"}:e===Pf?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},Nf=e=>{const n=e.psuis[0].position,t=(0,Lm.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=n.leaders[0];return(0,i.jsxs)(Tl,{css:{background:`url(${o=e.eventId,o===Mf?`${F.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/semi.jpg`:o===Pf?`${F.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/marathon.jpg`:-1===o?`${F.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/10k.jpg`:""}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:pf,width:If,children:[(0,i.jsx)(Mr,{css:{fontSize:"24px",left:"298px",position:"absolute",top:"101px",...Ff(e.eventId)},textAlign:"center",width:409,children:e.userInfo.name}),(0,i.jsx)(Mr,{css:{fontSize:"12px",left:"46px",position:"absolute",top:"374px"},children:g(e.options.habits)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{css:{...Ff(e.eventId),"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Rf,{text:e.options.habits})})})}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{color:"#005a41",left:"46px",position:"absolute",top:"581px",...Ff(e.eventId)},textAlign:"center",width:150,children:s.userInfo.name}),(0,i.jsx)(Mr,{css:{left:"46px",position:"absolute",top:"602px",...Ff(e.eventId)},textAlign:"center",width:150,children:s.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Tl,{css:{left:"228px",position:"absolute",padding:"32px",top:"167px"},direction:"column",width:550,children:[(0,i.jsx)(Mr,{css:{fontSize:"28px",fontWeight:"700",...kf(e.eventId)},textAlign:"center",children:n.name}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{css:{fontWeight:"700",textTransform:"uppercase",...kf(e.eventId)},children:"Date et heure de la mission"}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{fontSize:"12px"},direction:"column",gap:"1",children:t.map((e,n)=>{const t=e.range.start;return(0,i.jsxs)(Mr,{children:[t.toFormat("cccc dd MMMM yyyy",{locale:"fr"})," Ă "," ",t.toFormat("H'h'mm",{locale:"fr"})]},n)})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:{fontWeight:"700",textTransform:"uppercase",...kf(e.eventId)},children:"DĂ©tail de la mission"}),(0,i.jsx)(Pl,{height:"1"}),g(n.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{css:{color:"black",fontSize:"12px","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Rf,{text:n.description})})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:{fontWeight:"700",textTransform:"uppercase",...kf(e.eventId)},children:"Lieu de rendez-vous"}),(0,i.jsx)(Pl,{height:"1"}),th(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{fontSize:"12px"},children:n.address}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsxs)(Tl,{gap:"3",width:1,children:[(0,i.jsx)(Mr,{height:180,width:1,children:(0,i.jsx)("a",{href:Df(n.latitude,n.longitude),style:{background:`url(${F.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),g(n.fields?.cf45815?.url)&&(0,i.jsx)(Mr,{css:{background:`url(${n.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]}),g(n.fields.cf44423)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:{fontWeight:"700",textTransform:"uppercase",...kf(e.eventId)},children:"Ton kit bĂ©nĂ©vole"}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{css:{fontSize:"12px"},dangerouslySetInnerHTML:{__html:n.fields.cf44423.replace(/\n/g,"
")}})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:{fontWeight:"700",textTransform:"uppercase",...kf(e.eventId)},children:"Un imprĂ©vu ?"}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{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},Lf=[120785,134101],Uf=e=>{const n=zf(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>!Lf.includes(e.id)),t=(0,Lm.A)(Object.entries((0,fm.A)(n,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:t.map(([n,t],s)=>(0,i.jsx)(Nf,{eventId:e.event.id,options:e.options,psuis:t,userInfo:e.event.volunteerRegistration.userInfo},s))})},Vf=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],Bf={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"},Wf=({css:e,name:n})=>(0,i.jsx)(Mr,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${Bf[n]}) no-repeat`,backgroundSize:"cover",height:"30px",position:"absolute",width:"30px",...e}}),Gf=({event:e})=>{const n=e.volunteerRegistration,t=n.userInfo,s=t.fields?.cf38222?.value,o=n.accreditationsUsersInfos.reduce((e,n)=>Vf.includes(n.accreditation.name)?{...e,[n.accreditation.name]:!0}:e,{});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2026/bg_badge_recto.jpg) no-repeat",backgroundSize:"cover",color:"#FFF",fontFamily:"$formulaCondensedBold",position:"relative"},height:476,width:363,children:[(0,i.jsx)(Mr,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"221px"},children:`${t.fields?.firstName?.value||""} ${t.fields?.lastName?.value||""}`.trim().toUpperCase()}),(0,i.jsx)(Mr,{css:{fontSize:"13px",fontWeight:"700",left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",top:"172px"},children:t.fields.cf38077?.value}),(0,i.jsx)(Mr,{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)(Wf,{css:{left:"251px",top:"314px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(Wf,{css:{left:"299px",top:"314px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(Wf,{css:{left:"251px",top:"363px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(Wf,{css:{left:"299px",top:"363px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(Wf,{css:{left:"251px",top:"412px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(Wf,{css:{left:"299px",top:"412px"},name:"SALON PRESTIGE"})]}),(0,i.jsx)(Tl,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2026/bg_badge_verso.jpg) no-repeat",backgroundSize:"cover",position:"relative"},height:476,width:363})]})},qf=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],Hf={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"},Yf=({css:e,name:n})=>(0,i.jsx)(Mr,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/hbc/lnh/${Hf[n]}) no-repeat`,backgroundSize:"cover",height:"47px",position:"absolute",top:"463px",width:"47px",...e}}),Zf=({event:e})=>{const n=e.volunteerRegistration,t=n.userInfo,s=t.fields?.cf38222?.value,o=n.accreditationsUsersInfos.reduce((e,n)=>qf.includes((n.accreditation?.name||"").toUpperCase())?{...e,[n.accreditation.name]:!0}:e,{});return(0,i.jsxs)(Tl,{css:{fontFamily:"$zuumeMedium",position:"relative"},height:xf,width:ff,children:[(0,i.jsx)(Mr,{css:{left:"52px",position:"absolute",top:"205px"},height:111,width:111,children:g(t.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:t.fields.picture.url,width:"100%"})}),(0,i.jsx)(Mr,{css:{left:"69px",position:"absolute",top:"317px"},textAlign:"center",width:77,children:t.id}),(0,i.jsx)(Mr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"205px"},children:t.fields?.lastName?.value||""}),(0,i.jsx)(Mr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"229px"},children:t.fields?.firstName?.value||""}),(0,i.jsx)(Mr,{css:{fontFamily:"$zuumeBold",fontSize:"25px",fontWeight:"700",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"261px"},children:t.fields.cf38077?.value}),(0,i.jsx)(Mr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",textDecoration:"uppercase",top:"298px"},children:s}),o.TERRAIN&&(0,i.jsx)(Yf,{css:{left:"45px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(Yf,{css:{left:"96px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(Yf,{css:{left:"149px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(Yf,{css:{left:"201px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(Yf,{css:{left:"253px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(Yf,{css:{left:"306px"},name:"SALON PRESTIGE"})]})};function Kf(e={}){const n=f(e.firstName||"").trim();return`${f(e.lastName||"").trim().toUpperCase()} ${n}`.trim()}const Xf=(e,n)=>e.split(n).map(e=>e.trim().length>0?e.trim()[0]:"").join("").substring(0,3);function Qf(e,n){if(g(e))return Xf(e," ");if(g(n)){const[e]=n.split("@");return Xf(e,".")}return""}const Jf=[Ar.colors.success600.value,Ar.colors.blueGray600.value,Ar.colors.blueLight600.value,Ar.colors.purple600.value,Ar.colors.pink600.value,Ar.colors.warning600.value];function e_(e){const n=e.charCodeAt(0);return Jf[n%Jf.length]}const n_=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}},t_=e=>{const[n,t]=(0,V.useState)(g(e.image)?e.image:void 0);if((0,V.useEffect)(()=>{g(e.image)&&t(e.image)},[e.image]),g(n))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:n,style:{height:`${e.size}px`,width:`${e.size}px`,verticalAlign:"baseline"}})});{const n=Qf(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:e_(n),color:"white",display:"flex",fontSize:`${n_(e.size)}px`,height:"100%",justifyContent:"center",textTransform:"uppercase",width:"100%"},children:n})})}},i_=e=>{const n=e.event.volunteerRegistration.userInfo,t=n.fields.phone?.internationalFormat||"";return(0,i.jsxs)(Tl,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/p2n/planning_masque.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"Plus Jakarta Sans",fontSize:"$textXs",fontWeight:"$regular",pageBreakBefore:"always",position:"relative"},direction:"column",height:pf,width:If,children:[(0,i.jsx)(Mr,{css:{left:"48px",position:"absolute",top:"47px"},children:(0,i.jsx)(t_,{email:n.email,image:n.fields?.picture?.url,name:n.name,size:40})}),(0,i.jsxs)(Tl,{css:{left:"104px",position:"absolute",top:"45px"},direction:"column",children:[(0,i.jsx)(Mr,{css:{color:"$gray800",fontWeight:"600"},children:n.name}),(0,i.jsx)(Mr,{color:"gray800",children:t})]}),(0,i.jsx)(Mr,{css:{color:"black",fontSize:"24px",fontWeight:"700",position:"absolute",top:"112px"},textAlign:"center",width:1,children:e.title}),(0,i.jsx)(Tl,{css:{gap:"28px",flex:"1",left:"48px",position:"absolute",top:"172px",width:"calc(100% - 96px)"},direction:"column",children:e.children})]})},s_=Oo.IX.fromDateTimes(Oo.c9.fromObject({year:2026,month:5,day:22}).startOf("day"),Oo.c9.fromObject({year:2026,month:5,day:24}).endOf("day"));var o_;function a_(){return a_=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const n=ki(Jm),t=e.psui.position,s=t.category,o=e.psui.positionSlot,a=(0,Lm.A)((0,Rg.A)(t.leaders.concat(s.leaders),e=>e.userInfo.id),e=>e.userInfo.name).map(e=>e.userInfo.name).join(", ");return(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:n.toLocaleString(o.range.start,Uo.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Tl,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(r_,{})}),(0,i.jsxs)(Mr,{color:"gray800",children:[(0,i.jsx)(mf,{css:{fontWeight:"600"},children:t.name})," | De"," ",o.range.start.toFormat("H:mm")," Ă  ",o.range.end.toFormat("H:mm")]})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsx)(Tl,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(c_,{})}),(0,i.jsxs)(Mr,{color:"gray800",children:[(0,i.jsx)(mf,{css:{fontWeight:"600"},children:"Responsable : "}),a]})]}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{css:{color:"black"},children:(0,i.jsx)(Rf,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:t.description})})]})},m_=e=>{const n=e.event.volunteerRegistration,[t,s]=(0,Ph.A)(n.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(s_));return(0,i.jsx)(i.Fragment,{children:Yo(t)&&(0,i.jsx)(i_,{event:e.event,title:"Planning P2N 2026",children:(0,Lm.A)(t,({positionSlot:e})=>e.range.start.toMillis()).map(e=>(0,i.jsx)(u_,{psui:e},e.id))})})},g_=e=>{const n=ki(Jm);return(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:e.psuis[0].position.name}),(0,Lm.A)(e.psuis,e=>e.positionSlot.range.start.toMillis()).map(e=>{const t=e.positionSlot;return(0,i.jsxs)(Mr,{color:"gray800",children:[(0,i.jsx)(mf,{css:{fontWeight:"600",textTransform:"capitalize"},children:n.toLocaleString(t.range.start,{month:"long",day:"numeric",weekday:"long"})})," ","| De ",t.range.start.toFormat("H:mm")," Ă "," ",t.range.end.toFormat("H:mm")]},e.id)})]})},h_=e=>{const n=e.event.volunteerRegistration,[t,s]=(0,Ph.A)(n.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(s_)),o=(0,Lm.A)(Object.entries((0,fm.A)(s,e=>e.position.name)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:Yo(s)&&(0,i.jsx)(i_,{event:e.event,title:"Planning Montage/DĂ©montage P2N 2026",children:o.map(([e,n],t)=>(0,i.jsx)(g_,{psuis:n},t))})})},p_=e=>e.includes("BLEU_CLAIR")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_clair_verso.jpg`:e.includes("BLEU_FONCE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_fonce_verso.jpg`:e.includes("JAUNE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/jaune_verso.jpg`:e.includes("ORANGE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/orange_verso.jpg`:e.includes("VERT")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/vert_verso.jpg`:e.includes("VIOLET")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/violet_verso.jpg`:"",I_=e=>{const n=e.event.volunteerRegistration,t=n.userInfo,s=n.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=t.fields?.cf1019?.value;return(0,i.jsx)(Tl,{css:{background:`url(${p_(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:(0,i.jsx)(Tl,{align:"center",css:{color:"black",fontSize:"16px",fontWeight:"700",height:"39px",left:"29px",position:"absolute",top:"31px",width:"40px"},justify:"center",children:o})})},x_=e=>e.includes("BLEU_CLAIR")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_clair/bleu_clair_recto.jpg`:e.includes("BLEU_FONCE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_fonce/bleu_fonce_recto.jpg`:e.includes("JAUNE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/jaune/jaune_recto.jpg`:e.includes("ORANGE")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/orange/orange_recto.jpg`:e.includes("VERT")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/vert/vert_recto.jpg`:e.includes("VIOLET")?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/violet/violet_recto.jpg`:"",f_=e=>{const n=e.event.volunteerRegistration,t=n.userInfo,s=n.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=(0,wo.A)(n.positionsSlotsUsersInfos.map(e=>e.position.name)),a=s.includes("JAUNE")||s.includes("BLEU_CLAIR")?"black":"white",r=t.fields?.cf20600?.value??"",d=t.fields?.cf21104?.value??"",l=t.fields?.cf21129?.value??[];return(0,i.jsxs)(Tl,{css:{background:`url(${x_(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:[(0,i.jsx)(Mr,{css:{position:"absolute",right:"40px",top:"43px"},height:65,width:65,children:(0,i.jsx)("img",{height:"100%",src:bf(n.ticketId,{height:65,width:65}),width:"100%"})}),(0,i.jsx)(Mr,{css:{borderRadius:"107px",height:"107px",left:"131px",overflow:"hidden",position:"absolute",top:"127px",width:"107px"},children:t.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:t.fields.picture.url,width:"100%"})}),(0,i.jsx)(Mr,{css:{color:a,fontSize:"18px",fontWeight:"700",position:"absolute",textAlign:"center",top:"242px",width:"100%"},children:t.name}),(0,i.jsx)(Tl,{css:{color:a,fontSize:"12px",gap:"2px",position:"absolute",top:"271px",width:"100%"},direction:"column",children:n.state===it.NotApplicable||"Intervenant"===r?(0,i.jsx)(Mr,{textAlign:"center",width:1,children:d}):"Direction"===r?Yo(l)?l.map((e,n)=>(0,i.jsx)(Mr,{textAlign:"center",width:1,children:e},n)):null:o.map((e,n)=>(0,i.jsx)(Mr,{textAlign:"center",width:1,children:e},n))}),(0,i.jsx)(Mr,{css:{color:a,fontSize:"32px",fontWeight:"700",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"364px",width:"100%"},children:r})]})},__=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f_,{event:e.event}),(0,i.jsx)(I_,{event:e.event})]}),j_=e=>{const n=e.psuis[0].position,t=(0,Lm.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=e.userInfo,o=n.leaders[0],a=n.leaders[1];return(0,i.jsxs)(Tl,{css:{background:`url(${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/assignment_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",fontWeight:"500",pageBreakBefore:"always",position:"relative"},height:pf,width:If,children:[(0,i.jsx)(Mr,{css:{borderRadius:"5px",left:"67px",overflow:"hidden",position:"absolute",top:"212px"},height:74,width:74,children:g(s.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:s.fields.picture.url,width:"100%"})}),(0,i.jsx)(Mr,{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)(Tl,{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)(Mr,{children:o.userInfo.firstName}),(0,i.jsx)(Mr,{children:o.userInfo.lastName}),(0,i.jsx)(Mr,{children:o.userInfo.phone?.internationalFormat})]}),a&&(0,i.jsxs)(Tl,{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)(Mr,{children:a.userInfo.firstName}),(0,i.jsx)(Mr,{children:a.userInfo.lastName}),(0,i.jsx)(Mr,{children:a.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Tl,{css:{left:"210px",padding:"24px 40px 0 40px",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Tl,{align:"center",css:{color:"#d7531e",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"},height:38,justify:"center",width:1,children:n.name}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Mr,{css:{fontSize:"16px",fontWeight:"900"},children:"Date de ta mission :"}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Tl,{direction:"column",gap:"1",children:t.map((e,n)=>{const t=e.range.start,s=e.range.end,o=t.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(Mr,{css:{color:"#333333"},children:[t.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})," -"," ",o?s.toFormat("HH:mm"):s.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})]},n)})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:{fontSize:"16px",fontWeight:"900"},children:"DĂ©tails de ta mission :"}),(0,i.jsx)(Pl,{height:"2"}),g(n.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{css:{color:"black","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Rf,{text:n.description})})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:{fontSize:"16px",fontWeight:"900"},children:"Lieu de rendez-vous :"}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{children:n.address}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{height:180,width:1,children:(0,i.jsx)("a",{href:Df(n.latitude,n.longitude),style:{background:`url(${F.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),g(n.fields.cf38416)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Mr,{children:n.fields.cf38416})]})]})]})},v_=e=>{const n=zf(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>e.tags.some(e=>"Fiche personnalisĂ©e"===e.name)),t=(0,Lm.A)(Object.entries((0,fm.A)(n,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:t.map(([n,t],s)=>(0,i.jsx)(j_,{eventId:e.event.id,psuis:t,userInfo:e.event.volunteerRegistration.userInfo},s))})},S_=e=>{const n=e.event.volunteerRegistration,t=n.userInfo;return(0,i.jsxs)(Tl,{css:{background:`url(${s=e.event.id,4183===s?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/accreditation_vip.jpg`:3694===s?`${F.HEAVENT_ASSETS_URL}/badges/paris20km/2024/intervenant.jpg`:""}) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",position:"relative"},height:pf,width:If,children:[(0,i.jsxs)(Tl,{css:{fontSize:"24px",fontWeight:"900",left:"80px",lineHeight:"28px",position:"absolute",top:"261px"},direction:"column",children:[(0,i.jsx)(Mr,{children:t.fields?.firstName?.value||""}),(0,i.jsx)(Mr,{children:t.fields?.lastName?.value||""})]}),(0,i.jsxs)(Mr,{css:{color:"#d8541d",fontSize:"20px",fontWeight:"800",left:"80px",position:"absolute",top:"325px"},children:[(0,i.jsxs)(mf,{css:{color:"black",fontWeight:"400"},children:[4183===e.event.id?"VIP":"Intervenant"," |"]})," ",t.fields.cf21104?.value]}),(0,i.jsx)(Mr,{css:{position:"absolute",right:"80px",top:"261px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:bf(n.ticketId,{height:90,width:90}),width:"100%"})})]});var s},y_=e=>3376===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_reims_v2.jpg`:3827===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_corrida.jpg`:3823===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_semi_boulogne.jpg`:3808===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_toulouse.jpg`:5233===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_unicef.jpg`:5158===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_marseille.jpg`:5644===e||5341===e?`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_montpellier.jpg`:`${F.HEAVENT_ASSETS_URL}/badges/playground/fiche_gcsd_v3.jpg`,C_=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"},b_=e=>3827===e||5233===e?{top:"859px"}:5158===e?{top:"746px"}:5644===e||5341===e?{top:"744px"}:{top:"915px"},A_=e=>{const n=e.vr.userInfo,t=e.positionSlotUserInfo.position,s=e.positionSlotUserInfo.positionSlot,o=t.leaders[0],a=t.leaders[1],r=3376===(d=e.eventId)?{color:"#2b2378",fontFamily:"$movement",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:3827===d?{color:"#434343",fontFamily:"$graphie",fontSize:"16px",fontWeight:"800",textTransform:"uppercase"}:3823===d?{color:"#1d2b71",fontFamily:"$archerBoldPro",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:3808===d?{color:"#161b4a",fontFamily:"$helveticaNeue97BlackCondensed",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:5233===d?{color:"#434343",fontFamily:"$roboto",fontSize:"18px",fontWeight:"800",textTransform:"uppercase"}:5158===d?{color:"#161b4a",fontFamily:"$acumin",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:5644===d||5341===d?{color:"#161b4a",fontFamily:"$chillax",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:{color:"black",fontFamily:"$atrament",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"};var d;return(0,i.jsxs)(Tl,{css:{background:`url(${y_(e.eventId)}) no-repeat`,backgroundSize:"cover",color:"#333333",position:"relative"},direction:"column",height:pf,width:If,children:[(0,i.jsx)(Mr,{css:{color:5233===e.eventId?"white":"#333333",fontSize:"22px",fontWeight:"700",position:"absolute",right:"40px",textTransform:"uppercase",top:"136px"},children:n.name}),(0,i.jsxs)(Tl,{css:{left:"210px",padding:"$7 $8 0 $8",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Mr,{css:C_(e.eventId),textAlign:"center",width:1,children:t.name}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{css:r,children:"DĂ©tails de la mission :"}),(0,i.jsx)(Pl,{height:"2"}),g(t.description)&&(0,i.jsx)(Mr,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Rf,{text:t.description})}),sh(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:r,children:"Lieu de mission :"}),th(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{children:t.address})]}),ih(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{height:180,width:1,children:(0,i.jsx)("a",{href:Df(t.latitude,t.longitude),style:{background:`url(${F.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:r,children:"À cette heure ci :"}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{css:{gap:"22px"},width:1,children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{css:{fontWeight:"700"},children:s.range.start.toFormat("dd MMMM yyyy",{locale:"fr"})}),(0,i.jsxs)(Mr,{children:["De ",s.range.start.toFormat("H'h'mm")," Ă "," ",s.range.end.toFormat("H'h'mm")]})]}),o&&(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{css:{fontWeight:"700"},children:"Mon contact d'urgence"}),(0,i.jsxs)(Mr,{children:[o.userInfo.firstName," :"," ",o.userInfo.phone?.internationalFormat]}),a&&(0,i.jsxs)(Mr,{children:[a.userInfo.firstName," :"," ",a.userInfo.phone?.internationalFormat]})]})]}),(0,i.jsx)(Pl,{height:"6"}),g(t.fields.cf38780)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:r,children:"Transports"}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{dangerouslySetInnerHTML:{__html:t.fields.cf38780.split("\n").join("
")}})]})]}),(0,i.jsx)(Mr,{css:{left:"53px",position:"absolute",...b_(e.eventId)},height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:bf(e.vr.ticketId,{height:104,width:104}),width:"100%"})})]})},E_=e=>{const n=(0,V.useMemo)(()=>(0,Lm.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event.volunteerRegistration.positionsSlotsUsersInfos]);return(0,i.jsx)(i.Fragment,{children:n.map(n=>(0,i.jsx)(A_,{eventId:e.event.id,positionSlotUserInfo:n,vr:e.event.volunteerRegistration},n.positionSlot.id))})},w_="#e30613",$_="#26306b",T_={cf25078:"Parcours",cf25079:"Plan village",cf25080:"Poste vĂ©lo",cf25511:"Poste course Ă  pied",cf25512:"Plan d'accĂšs"},z_=Object.keys(T_),O_=e=>{const n=ki(Jm),t=e.positionSlotUserInfo.position,s=t.category,o=e.positionSlotUserInfo.positionSlot,a=s.leaders[0],r=z_.some(e=>g(t.fields[e]?.url)),d=r||"Restauration athlĂštes"===s.name||"Ravitaillement"===s.name||"Retrait des dossards"===s.name;return(0,i.jsxs)(Tl,{css:{background:"white",fontFamily:"$roboto"},direction:"column",height:pf,width:If,children:[(0,i.jsxs)(Tl,{height:185,width:1,children:[(0,i.jsx)(Tl,{height:1,width:185,children:g(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"100%"})}),(0,i.jsx)(Tl,{css:{padding:"$4 $7"},width:609,children:(0,i.jsxs)(Tl,{direction:"column",justify:"between",width:1,children:[(0,i.jsxs)(Tl,{justify:"between",width:1,children:[(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(Mr,{css:{color:w_,fontSize:"34px",fontWeight:"700",lineHeight:"40px"},children:g(t.acronym)?t.acronym:t.name}),(0,i.jsxs)(Mr,{css:{color:w_,ellipsis:!0,fontSize:"18px",fontWeight:"700"},children:["POSTE / ",s.name]})]}),d&&(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(Mr,{css:{color:w_,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Adresse"}),(0,i.jsx)(Mr,{css:{color:$_,fontSize:"16px",fontWeight:"500",textAlign:"right"},children:t.address})]})]}),d&&(0,i.jsxs)(Tl,{justify:"between",width:1,children:[(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{css:{color:$_,fontSize:"18px",fontWeight:"700"},children:"Point GPS"}),(0,i.jsxs)(Mr,{css:{color:w_,fontSize:"16px",fontWeight:"500"},children:[t.latitude,", ",t.longitude]})]}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{css:{color:$_,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Horaires de mission"}),(0,i.jsxs)(Mr,{css:{color:w_,fontSize:"16px",fontWeight:"500",textAlign:"right",textTransform:"capitalize"},children:[n.toLocaleString(o.range.start,{month:"short",day:"numeric",weekday:"short"})," ","| ",o.range.start.toFormat("HH'h'mm")," -"," ",o.range.end.toFormat("HH'h'mm")]})]})]}),!d&&(0,i.jsx)(Tl,{width:1,children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{css:{color:w_,fontSize:"18px",fontWeight:"700"},children:"Adresse"}),(0,i.jsx)(Mr,{css:{color:$_,fontSize:"16px",fontWeight:"500"},children:t.address})]})})]})})]}),(0,i.jsx)(Mr,{css:{background:w_},height:10,width:1}),(0,i.jsxs)(Tl,{css:{flex:"1",padding:"$6 $7"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Mr,{css:{color:w_,fontSize:"20px",fontWeight:"700"},children:"VOTRE MISSION"}),(0,i.jsx)(Mr,{css:{color:$_,fontSize:"16px",fontWeight:"500","& .h-rich-text > p":{margin:0}},children:(0,i.jsx)(Rf,{text:t.description})})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{background:w_},height:10,width:1}),(0,i.jsx)(Tl,{css:{padding:"$5 $7"},gap:"5",height:335,width:1,children:z_.map(e=>{if(g(t.fields[e]?.url)){const n=T_[e];return(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Mr,{css:{color:w_,fontSize:"20px",fontWeight:"700"},children:n}),(0,i.jsx)(Mr,{height:255,width:1,children:(0,i.jsx)("img",{height:"100%",src:t.fields[e].url,width:"100%"})})]},e)}return null})})]}),(0,i.jsx)(Tl,{align:"center",css:{background:w_,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Vous rencontrez un problĂšme ?"}),(0,i.jsxs)(Tl,{css:{padding:"$4"},direction:"column",height:88,width:1,children:[(0,i.jsx)(Mr,{css:{color:$_,fontSize:"20px",fontWeight:"500",textAlign:"center"},width:1,children:"Contactez votre responsable de secteur"}),a&&(0,i.jsxs)(Mr,{css:{color:$_,fontSize:"20px",fontWeight:"700",textAlign:"center"},width:1,children:[a.userInfo.name," : ",a.userInfo.phone?.internationalFormat]})]}),(0,i.jsx)(Tl,{align:"center",css:{background:$_,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Merci"})]})},R_=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteerRegistration.positionsSlotsUsersInfos.map((n,t)=>(0,i.jsx)(O_,{options:e.options,positionSlotUserInfo:n,userInfo:e.event.volunteerRegistration.userInfo},t))});function D_(e,n,t,s){switch(e){case Ae.Animajeconvention:return(0,i.jsx)(Tf,{event:n});case Ae.Asoassignment:return(0,i.jsx)(Uf,{date:s,event:n,options:t});case Ae.Hbcldc:return(0,i.jsx)(Gf,{event:n});case Ae.Hbclnh:return(0,i.jsx)(Zf,{event:n});case Ae.P2nassignment:return(0,i.jsx)(m_,{event:n});case Ae.P2nassignmentmontagedemontage:return(0,i.jsx)(h_,{event:n});case Ae.Paris20km:return(0,i.jsx)(__,{event:n});case Ae.Paris20kmassignment:return(0,i.jsx)(v_,{date:s,event:n});case Ae.Paris20kmcontremarque:return(0,i.jsx)(S_,{event:n});case Ae.Playground:return(0,i.jsx)(E_,{event:n});case Ae.T24assignment:return(0,i.jsx)(R_,{event:n,options:t});default:return Zl()}}function M_(e){switch(e){case Ae.Animajeconvention:return"Animaje Convention";case Ae.Asoassignment:return"Fiche d'affectation ASO";case Ae.Hbcldc:return"Badge HBC Ligue des Champions";case Ae.Hbclnh:return"Badge HBC LNH";case Ae.P2nassignment:return"Fiche d'affectation P2N (Exploit)";case Ae.P2nassignmentmontagedemontage:return"Fiche d'affectation P2N (Montage/DĂ©montage)";case Ae.Paris20km:return"Badge 20km de Paris";case Ae.Paris20kmassignment:return"Fiche d'affectation 20km de Paris";case Ae.Paris20kmcontremarque:return"Contremarque 20km de Paris";case Ae.Playground:return"Fiche d'affectation Playground";case Ae.T24assignment:return"Fiche d'affectation T24";default:return Zl()}}function P_(e){return"number"==typeof e?.latitude&&"number"==typeof e?.longitude?{lat:e.latitude,lng:e.longitude}:void 0}function k_(e,n,t){const i=Uo.DateOnly.MonthLong;return n.equals(t)?e.toLocaleString(n,i):[e.toLocaleString(n,Uo.DateOnly.MonthShort),e.toLocaleString(t,Uo.DateOnly.MonthShort)].join(" - ")}function F_(e){switch(e){case qe.Archived:case qe.Done:return"error";case qe.Ongoing:return"success";case qe.Upcoming:return"purple";default:return Zl()}}function N_(e,n){const t=Oo.c9.now().setZone("utc",{keepLocalTime:!0}).startOf("day");return Oo.IX.fromDateTimes(e.startOf("day"),n.endOf("day")).contains(t)?t:e}const L_=e=>{const{translate:n}=Kl(),{mutate:t}=function(e={}){return Ui("mutation BackofficeEventUnarchive($eventId: EventId!) {\n backofficeEventUnarchive(eventId: $eventId)\n}\n",e)}();return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{width:100,children:e.event.id}),(0,i.jsx)($m,{children:(0,i.jsx)(Xm,{to:Rs.EVENT({organizationId:e.organizationId,eventId:e.event.id}),children:e.event.name})}),(0,i.jsx)($m,{children:(0,i.jsx)(Ku,{color:F_(e.event.state),children:n(e.event.state)})}),(0,i.jsx)($m,{children:e.event.state===qe.Archived&&(0,i.jsx)(tc,{color:"invisible",onClick:async()=>{await t({eventId:e.event.id}),e.reload()},children:n("d_sarchiver_76082")})})]})},U_=Oo.c9.fromObject({year:2016}),V_=e=>{const{history:n,translate:t}=Kl(),s=Um(),o=ki(cf),a=ki(Ol),{mutate:r}=function(e={}){return Ui("mutation BackofficeOrganizationUpdate(\n $id: OrganizationId!\n $organization: BackofficeOrganizationInput!\n) {\n backofficeOrganizationUpdate(id: $id, organization: $organization) {\n id\n }\n}\n",e)}(),[d,l,c]=Wm(""),[u,m]=(0,V.useState)([]),[h,p]=(0,V.useState)({direction:Gn.Asc,attribute:Ge.Name}),[I,x]=(0,V.useState)(0),{data:f,isLoading:_,reload:j}=Li("query BackofficeEvents(\n $organizationId: OrganizationId!\n $name: String\n $states: [EventState!]\n $sort: EventsSort\n $offset: Int\n) {\n backoffice {\n events(\n organizationId: $organizationId\n name: $name\n states: $states\n sort: $sort\n limit: 25\n offset: $offset\n ) {\n nodes {\n id\n name\n state\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:e.organization.id,name:g(l)?l:void 0,states:Yo(u)?u:void 0,sort:h,offset:I},[]);const{numberOfPages:v,totalCount:S}=Sx(f.backoffice?.events),y=(0,V.useMemo)(()=>(0,Rg.A)(F.ADMINS.concat(e.organization.users).map(e=>({id:e.id,name:e.email})),({id:e})=>e),[e.organization]),C=(0,V.useMemo)(()=>(0,Lm.A)(Dt.map(e=>({value:e,name:M_(e)})),({name:e})=>e),[]),b=e=>{p(e),x(0)};return(0,i.jsx)(xc,{height:1,hideDefaultErrors:!0,initialValues:{organization:o.organizationInputDefault(e.organization)},render:({form:n,handleSubmit:o,submitting:a})=>(0,i.jsx)(Hx,{button:(0,i.jsx)(tc,{isLoading:a,textAlign:"center",onClick:o,children:t("mettre_jour_l_12499")}),category:"Backoffice",fallbackClosePath:yo.BACKOFFICE_ORGANIZATIONS,heading:t("mise_jour_de_17055",e.organization.name),children:(0,i.jsxs)(Gx,{children:[(0,i.jsx)(hc,{}),(0,i.jsx)(Yx,{children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)($c,{label:t("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Qx,{label:t("date_de_fin_de_17750"),min:U_,name:"organization.periodEndAt"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("fonctionnalit_s_47714"),multiple:!0,name:"organization.features",children:Bt.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(of,{isSearchVisible:!0,label:t("badges_personna_27045"),multiple:!0,name:"organization.customBadges",children:C.map(({value:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(of,{isSearchVisible:!0,label:t("utilisateurs_ay_27051"),multiple:!0,name:"organization.usersIds",children:y.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:t("id_de_l_organis_67465"),name:"organization.weezeventOrganizationId",rightIcon:"xmark",shouldParseAsInt:!0,onRightIconClick:()=>{n.change("organization.weezeventOrganizationId",null)}}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Xx,{name:"organization.isBlocked",children:t("bloquer_l_organ_81103")})]})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(sf,{heading:t("facturation_53594"),children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(df,{name:"organization.useOldBilling",children:t("utilise_l_ancie_40491")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)($c,{label:t("nombre_de_membr_16400"),name:"organization.membersLimit",shouldParseAsInt:!0}),(0,i.jsx)(ef,{label:t("prix_par_membre_20633"),name:"organization.pricePerMember"})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{children:t("nombre_de_membr_20439",e.organization.membersStats.numberOfMembers)}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{children:t("nombre_de_membr_54470",e.organization.membersStats2024.numberOfMembers)}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(rf,{label:t("commentaire_sur_40207"),name:"organization.billingComment"})]})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(sf,{heading:t("Event"),children:(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsx)(_m,{isSelectAllVisible:!0,multiple:!0,placeholder:t("State"),values:u,onChange:e=>{m(e),x(0)},children:s(Vt)})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:t("rechercher_un_40024"),value:d,onChange:e=>{c(e),x(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{width:100,children:"ID"}),(0,i.jsx)($x,{attribute:Ge.Name,setSort:b,sort:h,children:t("nom_de_l_v_nem_08711")}),(0,i.jsx)(Gm,{children:t("State")}),(0,i.jsx)(Gm,{})]}),numberOfPages:v,offset:I,rows:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):f.backoffice.events.nodes.map(n=>(0,i.jsx)(L_,{event:n,organizationId:e.organization.id,reload:j},n.id)),setOffset:x,title:t("liste_des_v_ne_29929"),totalCount:S})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:a,textAlign:"center",onClick:o,children:t("mettre_jour_l_12499")})})]})}),validate:a.validateForForm(o.updateOrganizationSchema()),width:1,onSubmit:async t=>{await r({id:e.organization.id,organization:t.organization}),n.goBack(yo.BACKOFFICE)}})},B_=()=>{const{organizationId:e}=Vi(),{data:n,loader:t}=Li(ed,{organizationId:e},[$o.OrganizationBackofficeFragment]);return t||(0,i.jsx)(V_,{organization:n.data.row})},W_=()=>(Au(Fi()("back_office_83072")),(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:yo.BACKOFFICE_ORGANIZATIONS,children:(0,i.jsx)(Bx,{})}),(0,i.jsx)(kr.qh,{exact:!0,path:yo.EDIT_BACKOFFICE_ORGANIZATION(":organizationId"),children:(0,i.jsx)(B_,{})}),(0,i.jsx)(kr.qh,{exact:!0,path:yo.BACKOFFICE_INVOICES,children:(0,i.jsx)(mg,{})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.BACKOFFICE_ORGANIZATIONS,replace:!0})})]})),G_=br(Tl,{backgroundColor:"$blueGray900",".amicale-theme &, .volunteers-theme &":{backgroundColor:"white"},".mso-theme &":{backgroundColor:"$cyan"}}),q_=()=>(0,i.jsx)(Gc,{}),H_=V.forwardRef((e,n)=>(0,i.jsxs)(G_,{ref:n,align:"stretch",css:{overflow:"auto",padding:"$6"},justify:"between",width:1,children:[(0,i.jsx)(Mr,{width:100}),(0,i.jsxs)(Tl,{align:"stretch",css:{height:"fit-content",py:"$2",width:"920px"},direction:"column",gap:"6",children:[(0,i.jsx)(Tl,{css:{marginBottom:"$7","& svg":{height:"100%"}},height:32,justify:"center",children:(0,i.jsx)(q_,{})}),e.children]}),(0,i.jsx)(Tl,{justify:"end",width:100,children:(0,i.jsx)(tc,{color:"gray",leftIcon:"xmark",onClick:e.onClose})})]}));H_.displayName="OnboardingView";const Y_=["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 Z_(e){return"string"!=typeof e||""===e.trim()||c(e.toLowerCase())===e}const K_=["country","code","number"];let X_=class extends Rc{countriesService;constructor(e,n){super(e),this.countriesService=n}basePhoneInputDefault(){return{country:"",code:"",number:""}}phoneInputDefault(e){return{...this.basePhoneInputDefault(),...e.phone}}phoneInputSchema(){return zc.Ik().shape({country:zc.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.countriesCodes,this.t("le_num_ro_de_t_76885")),code:zc.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.phoneCodes,this.t("le_num_ro_de_t_76885")),number:zc.Yj().required(this.t("le_num_ro_de_t_76885"))})}phoneInputSchemaNotRequired(){return zc.Ik().nullable().shape({country:zc.Yj(),code:zc.Yj(),number:zc.Yj()})}};X_=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di,Ig])],X_);let Q_=class extends Rc{countriesService;phoneInputService;constructor(e,n,t){super(t),this.countriesService=e,this.phoneInputService=n}organizationInputDefault(e){const n=this.countriesService.getDefaultCountryValues();return{name:"",adminFirstName:"",adminLastName:"",adminPhone:this.phoneInputService.phoneInputDefault(n),weezeventOrganizationId:e}}organizationInputSchema(e){let n=zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_de_l_org_60618")),adminFirstName:zc.Yj().required(this.t("le_pr_nom_est_r_10935")),adminLastName:zc.Yj().required(this.t("le_nom_est_requ_61536")),adminPhone:this.phoneInputService.phoneInputSchema()});return e||(n=n.shape({termsAccepted:zc.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})),n}createOrganizationSchema(e){return zc.Ik().shape({organization:this.organizationInputSchema(e)})}organizationInfosInputDefault(e){const n=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??n.user.country,timeZone:e.timeZone??Oo.c9.local().zoneName,emailSenderId:e.emailSenderId,dateFormat:e.dateFormat,datetimeFormat:e.datetimeFormat,timeFormat:e.timeFormat}}organizationInfosInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_de_l_org_60618")),adminName:zc.Yj().required(this.t("le_nom_du_respo_43823")),adminEmail:zc.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 Z_(this.parent.adminEmail)}),street:zc.Yj().required(this.t("l_adresse_est_r_40489")),postalCode:zc.Yj().required(this.t("le_code_postal_43189")),city:zc.Yj().required(this.t("la_ville_est_re_35239")),country:zc.Yj().oneOf(this.countriesService.countriesCodes).required(this.t("le_pays_est_req_33749")),emailSenderId:zc.ai().nullable(),dateFormat:zc.Yj().required(this.t("le_format_est_r_17097")),datetimeFormat:zc.Yj().required(this.t("le_format_est_r_17097")),timeFormat:zc.Yj().required(this.t("le_format_est_r_17097"))})}updateOrganizationGeneralSchema(){return zc.Ik().shape({organization:this.organizationInfosInputSchema()})}};Q_=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,X_,Di])],Q_);let J_=class extends Oc{countriesService;organizationInputService;translationService;constructor(e,n,t){super(t),this.countriesService=e,this.organizationInputService=n,this.translationService=t}eventInputDefault(e){const n=this.countriesService.getDefaultCountryValues();return{name:e?.name??"",description:e?.description??"",startAt:e?.startAt??Oo.c9.invalid("Invalid"),endAt:e?.endAt??Oo.c9.invalid("Invalid"),languages:e?.languages??[n.user.language],timeZone:e?.timeZone??Oo.c9.local().zoneName??"utc",country:e?.country??n.user.country,layer:e?.layer??gn.Google,latitude:e?.latitude??43.6087733,longitude:e?.longitude??3.87963579999996,emailSenderId:e?.emailSenderId,dayStartTime:e?.dayStartTime??"00:00",tagsIds:e?.tagsIds??[],fields:e?.fields??{},isWeezeventSynchronized:e?.isWeezeventSynchronized??!0,useAccreditations:e?.useAccreditations??!0,useCampaigns:e?.useCampaigns??!0,useDelegations:e?.useDelegations??!0,useDocuments:e?.useDocuments??!0,useForms:e?.useForms??!0,usePositions:e?.usePositions??!0,useWorkflows:e?.useWorkflows??!0,delegationsSpaceLayoutId:e?.delegationsSpaceLayoutId??null,groupsAccesses:(e?.groupsAccesses??[]).map(({groupId:e,roleId:n})=>({groupId:e,roleId:n}))}}eventGroupAccessDefault(){return{groupId:null,roleId:null}}eventInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("nom_de_l_v_nem_58512")),description:zc.Yj(),startAt:lf.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:lf.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 Oo.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Oo.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),languages:zc.YO().of(zc.Yj().oneOf(ru,this.t("les_langues_doi_27712"))).required(this.t("les_langues_son_53717")).min(1,this.t("vous_devez_s_le_16610")),timeZone:zc.Yj().required(this.t("le_fuseau_horai_37109")).oneOf(Y_,this.t("le_fuseau_horai_37109")),latitude:zc.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:zc.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:zc.ai().nullable(),dayStartTime:zc.Yj().required(this.t("l_heure_laque_87748")),isWeezeventSynchronized:zc.zM().required(),usePositions:zc.zM().required(),useAccreditations:zc.zM().required(),useDelegations:zc.zM().required(),useForms:zc.zM().required(),useDocuments:zc.zM().required(),useWorkflows:zc.zM().required(),groupsAccesses:zc.YO().of(zc.Ik().shape({groupId:zc.ai().nullable().required(this.t("vous_devez_s_le_78671")),roleId:zc.ai().nullable().required(this.t("vous_devez_s_le_18837"))}))})}eventOrganizationInputSchema(e){return zc.Ik().shape({event:this.eventInputSchema(),organization:this.organizationInputService.organizationInputSchema(e)})}createUpdateEventSchema(e){const n=this.eventInputSchema();return zc.Ik().shape({event:e?n.shape({fields:e}):n})}};J_=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Q_,Di])],J_);const ej=e=>{if(0===e.names.length)return e.render(e.fields);{const[n,...t]=e.names;return(0,i.jsx)(Dl.D0,{name:n,render:s=>(0,i.jsx)(ej,{fields:{...e.fields||{},[n]:s},names:t,render:e.render,subscription:e.subscription}),subscription:e.subscription})}},nj=({value:e,onChange:n,css:t,label:s,state:o,description:a,hint:r,...d})=>{const l=Fi(),u=(0,V.useCallback)(e=>{e&&p(e.getBoundingClientRect().width)},[]),m=(0,V.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[h,p]=(0,V.useState)(200),[I,x]=(0,V.useState)(!1),[f,_]=(0,V.useState)(""),j=ki(Ig),v=(0,V.useMemo)(()=>(0,Lm.A)(j.countries.flatMap(e=>Ho(e.phoneCode).map(n=>({...e,phoneCode:n}))),({name:e})=>c(e)),[]),S=(0,V.useMemo)(()=>v.find(({code:n,phoneCode:t})=>n===e.country&&t===e.code),[e.country,e.code]),y=(0,V.useMemo)(()=>v.filter(e=>!g(f)||e.name.toLowerCase().includes(f.trim().toLowerCase())||e.phoneCode.includes(f.trim())),[v,f]),C=(0,V.useMemo)(()=>y.map((t,s)=>(0,i.jsx)(Mu,{onClick:()=>{n({...e,country:t.code,code:t.phoneCode}),_(""),x(!1)},children:(0,i.jsxs)(Tl,{gap:"2",width:1,children:[(0,i.jsx)(Mr,{children:t.emoji}),(0,i.jsx)(Mr,{css:{ellipsis:!0},children:t.name}),(0,i.jsx)(Mr,{color:"gray500",children:t.phoneCode})]})},s)),[y,e,n]),{inputId:b,descId:A,errorId:E}=Sc();return(0,i.jsxs)(Tl,{ref:u,css:t,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:b,children:s}),(0,i.jsx)(yc,{id:A,children:a}),(s||a)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{children:[(0,i.jsxs)(Ou,{disabled:"disabled"===o,isOpen:I,onStateChange:e=>x(e),children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Ec,{css:{borderRight:"none",borderBottomRightRadius:"0",borderTopRightRadius:"0",userSelect:"none",width:"100px","& .styled-input-container-circle-exclamation":{display:"none"},cursor:"disabled"===o?"not-allowed !important":void 0},cursor:"pointer",rightIcon:I?"chevron-up":"chevron-down",state:o,children:S&&(0,i.jsxs)(Mr,{width:1,children:[S.emoji," ",S.phoneCode]})})}),(0,i.jsx)(Fu,{placement:"bottom-start",renderOnPortal:!0,width:h,children:(0,i.jsxs)(Tl,{direction:"column",height:Math.min(201,40*y.length+41),width:1,children:[(0,i.jsx)(Mr,{css:{padding:"$2 $4","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},height:40,children:(0,i.jsx)("input",{ref:m,"aria-label":l("indicatif_t_l_p_02025"),placeholder:l("rechercher_un_p_04678"),type:"text",value:f,onChange:e=>{_(e.target.value)}})}),(0,i.jsx)(sI,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Tl,{css:{height:"calc(100% - 41px)",overflowY:"auto"},direction:"column",children:C})]})})]}),(0,i.jsx)(Ec,{css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0",flex:"1"},cursor:"text",state:o,children:(0,i.jsx)(Mr,{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":a?A:void 0,"aria-errormessage":"error"===o?E:void 0,"aria-invalid":"error"===o,autoComplete:"tel-national",disabled:"disabled"===o,id:b,type:"tel",value:e.number,onChange:t=>{n({...e,number:t.target.value})},...d})})})]}),(0,i.jsx)(Cc,{id:E,state:o,children:r})]})},tj=(0,V.memo)(function({prefix:e,hint:n,state:t,...s}){const{isDisabled:o}=Kx(),a=`${e}country`,r=`${e}code`,d=`${e}number`;return(0,i.jsx)(ej,{names:[a,r,d],render:e=>{const l=_c(e[r].meta)||_c(e[d].meta);return(0,i.jsx)(nj,{hint:l?e[r].meta.error||e[d].meta.error:n,state:l?"error":o?"disabled":t,value:{country:e[a].input.value,code:e[r].input.value,number:e[d].input.value},onChange:n=>{e[a].input.onChange(n.country),e[r].input.onChange(n.code),e[d].input.onChange(n.number)},...s})}})}),ij=(0,V.memo)(function(){const e=Fi();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($c,{label:e("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)($c,{label:e("pr_nom_66988"),name:"organization.adminFirstName"}),(0,i.jsx)($c,{label:e("last_name"),name:"organization.adminLastName"})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(tj,{label:e("Phone"),prefix:"organization.adminPhone."})]})}),sj=()=>{const e=Fi(),{user:n}=Yi();return(0,i.jsx)(Xx,{name:"organization.termsAccepted",children:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("en_cr_ant_votre_88363",gu(cu(n?.language,new URL(location.href).searchParams)),uu)}})})},oj=e=>{const n=Fi(),t=Oo.c9.utc(),{event:s}=e.values;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"event.startAt",children:n=>{n.isValid&&!1===e.form.getFieldState("event.endAt").touched&&e.form.change("event.endAt",n)}}),(0,i.jsx)($c,{label:n("nom_de_l_v_nem_08711"),name:"event.name"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsx)(Qx,{label:n("date_de_d_but_43380"),min:t,name:"event.startAt"}),(0,i.jsx)(Qx,{label:n("date_de_fin_86920"),min:s.startAt&&s.startAt.isValid?s.startAt:t,name:"event.endAt"})]})]})},aj=()=>{const{translate:e,params:{weezeventOrganizationId:n}}=Kl(),t=ki(J_),s=ki(Q_),o=ki(Ol),{mutate:a}=function(e={}){return Ui("mutation EventOrganizationCreate($eventOrganization: EventOrganizationInput!) {\n eventOrganizationCreate(eventOrganization: $eventOrganization) {\n id\n organizationId\n }\n}\n",e)}({redirectOnSuccess:!0}),r=Bi(),d=(0,V.useRef)(null),l=!!Yi().user?.termsAcceptedAt;return(0,i.jsx)(xc,{customErrorRef:d,height:1,initialValues:{event:t.eventInputDefault(),organization:s.organizationInputDefault(n)},render:({form:n,values:t,handleSubmit:s})=>(0,i.jsxs)(H_,{ref:d,onClose:J,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{centerHeader:!0,heading:e("dites_en_nous_u_13238"),subtitle:e("param_trer_votr_94121"),children:(0,i.jsx)(oj,{form:n,values:t})}),(0,i.jsx)(sf,{heading:e("_propos_de_vot_88855"),subtitle:e("ajouter_le_nom_69919"),children:(0,i.jsx)(ij,{})}),(0,i.jsx)(Yx,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[!l&&(0,i.jsx)(sj,{}),(0,i.jsx)(tc,{textAlign:"center",onClick:s,children:e("cr_er_l_v_neme_16731")})]})})]}),validate:o.validateForForm(t.eventOrganizationInputSchema(l)),width:1,onSubmit:async e=>{const{eventOrganizationCreate:{id:n,organizationId:t}}=await a({eventOrganization:e});r.push(Rs.EVENT({organizationId:t,eventId:n}))}})},rj=()=>{const{data:e,loader:n}=Li("query HomeOrganizations {\n user {\n roles {\n organizationId\n }\n }\n}\n",{},[]),t=Bi();return(0,i.jsx)(ju,{loader:n,onLoad:()=>{const n=e.user?.roles?.[0]?.organizationId;n?t.replace(Rs.EVENTS({organizationId:n})):t.replace(yo.CREATE_EVENT_WITH_ORGANIZATION())}})},dj=()=>{const{translate:e,history:n}=Kl(),t=ki(Q_),s=ki(Ol),{mutate:o}=function(e={}){return Ui("mutation OrganizationCreate($organization: OrganizationInput!) {\n organizationCreate(organization: $organization) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),a=(0,V.useRef)(null),{user:r}=Yi(),d=!!r?.termsAcceptedAt;return(0,i.jsx)(xc,{customErrorRef:a,height:1,hideDefaultErrors:!0,initialValues:{organization:t.organizationInputDefault()},render:({handleSubmit:t})=>(0,i.jsxs)(H_,{ref:a,onClose:()=>n.goBack(yo.BACKOFFICE),children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{centerHeader:!0,heading:e("_propos_de_vot_88855"),subtitle:e("ajouter_le_nom_69919"),children:(0,i.jsx)(ij,{})}),(0,i.jsx)(Yx,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[!d&&(0,i.jsx)(sj,{}),(0,i.jsx)(tc,{textAlign:"center",onClick:t,children:e("cr_er_l_organis_55358")})]})})]}),validate:s.validateForForm(t.createOrganizationSchema(d)),width:1,onSubmit:async e=>{const{organizationCreate:{id:t}}=await o({organization:e.organization});n.push(us.ORGANIZATION({organizationId:t}))}})},lj={PLURAL:"custom-fields",SINGLE:"custom-field"},cj="usage",uj=e=>Xi([lj.SINGLE,e]),mj={CUSTOM_FIELDS:({eventId:e,...n})=>Xi([e?Rs.EVENT({...n,eventId:e}):us.ORGANIZATION(n),lj.PLURAL]),CUSTOM_FIELDS_SEGMENT:({segmentId:e,...n})=>Xi([mj.CUSTOM_FIELDS(n),e]),CUSTOM_FIELD:({customFieldId:e,eventId:n,...t})=>Xi([n?Rs.EVENT({...t,eventId:n}):us.ORGANIZATION(t),uj(e)]),CUSTOM_FIELD_USAGE:({customFieldId:e,...n})=>Xi([mj.CUSTOM_FIELDS_SEGMENT(n),cj,e]),CREATE:e=>is(mj.CUSTOM_FIELDS(e)),UPDATE:e=>ss(mj.CUSTOM_FIELD(e))},gj={PLURAL:"members",SINGLE:"member"},hj={PLURAL:"profiles",SINGLE:"profile"},pj="accreditations",Ij="actions",xj="availabilities",fj="campaigns",_j="changes",jj="comments",vj="documents",Sj="events",yj="form",Cj="forms",bj="history",Aj="informations",Ej="messages",wj="positions",$j="scans",Tj="segments",zj=e=>Xi([gj.SINGLE,e]),Oj=e=>Xi([hj.SINGLE,e]),Rj={USER_PROFILE:({userInfoId:e,...n})=>Xi([us.ORGANIZATION(n),Oj(e)]),USER_PROFILES:e=>Xi([us.ORGANIZATION(e),hj.PLURAL]),ORGANIZATION_MEMBERS:e=>Xi([us.ORGANIZATION(e),gj.PLURAL]),MEMBERS:e=>Xi(["delegationId"in e?Js.DELEGATION(e):"eventId"in e&&e.eventId?Rs.EVENT(e):hs.COMMUNITY(e),gj.PLURAL]),MEMBER:({userInfoId:e,...n})=>Xi(["eventId"in n&&n.eventId?Rs.EVENT(n):hs.COMMUNITY(n),zj(e)]),MEMBER_INFORMATION:e=>Xi([Rj.MEMBER(e),Aj]),MEMBER_ACTIONS:e=>Xi([Rj.MEMBER(e),Ij]),MEMBER_AVAILABILITIES:e=>Xi([Rj.MEMBER(e),xj]),MEMBER_COMMENTS:e=>Xi([Rj.MEMBER(e),jj]),MEMBER_HISTORY:e=>Xi([Rj.MEMBER(e),bj]),MEMBER_HISTORY_CHANGES:e=>Xi([Rj.MEMBER(e),bj,_j]),MEMBER_HISTORY_CAMPAIGNS:e=>Xi([Rj.MEMBER(e),bj,fj]),MEMBER_HISTORY_EVENTS:e=>Xi([Rj.MEMBER(e),bj,Sj]),MEMBER_HISTORY_FORMS:e=>Xi([Rj.MEMBER(e),bj,Cj]),MEMBER_HISTORY_SCANS:e=>Xi([Rj.MEMBER(e),bj,$j]),MEMBER_HISTORY_SEGMENTS:e=>Xi([Rj.MEMBER(e),bj,Tj]),MEMBER_POSITIONS:e=>Xi([Rj.MEMBER(e),wj]),MEMBER_ACCREDITATIONS:e=>Xi([Rj.MEMBER(e),pj]),MEMBER_FORMS:e=>Xi([Rj.MEMBER(e),Cj]),MEMBER_FORM:e=>Xi([Rj.MEMBER(e),yj,e.formId]),MEMBER_FORM_EDIT:e=>ss(Rj.MEMBER_FORM(e)),MEMBER_MESSAGES:e=>Xi([Rj.MEMBER(e),Ej]),MEMBER_DOCUMENTS:e=>Xi([Rj.MEMBER(e),vj]),CREATE:e=>is(Rj.MEMBERS(e))};var Dj,Mj;function Pj(){return Pj=Object.assign?Object.assign.bind():function(e){for(var n=1;nfunction(e){return u(e).replace(/[\u2018\u2019]/g,"'")}(e));const Lj={[Fj]:{theme:{blueGray900:"#070F48",primary50:"#EBF1FD",primary100:"#D6E3FB",primary200:"#ABC8F7",primary300:"#79AEF4",primary400:"#3F94E9",primary500:"#337AC1",primary600:"#27619A",primary700:"#1B4876",primary800:"#103253",primary900:"#071C33"},icon:kj,logo:(0,i.jsx)(Mr,{css:{blockSize:"20px","& svg":{blockSize:"100%"}},children:(0,i.jsx)(function(e){return V.createElement("svg",Pj({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180 30.445"},e),Dj||(Dj=V.createElement("defs",null,V.createElement("clipPath",{id:"logoFFSA_svg__a"},V.createElement("path",{fill:"none",d:"M0 0h180v30.445H0z","data-name":"Rectangle 1122"})))),Mj||(Mj=V.createElement("g",{"data-name":"Groupe 2259"},V.createElement("path",{fill:"#fff",d:"M7.118.695.001 29.744h14.033l2.71-11.061H34.92l1.694-6.924H18.438l.884-3.612h21.172L42.327.695Z","data-name":"Trac\\xE9 2777"}),V.createElement("path",{fill:"#fff",d:"m44.737.695-7.111 29.05h14.013l2.717-11.061h18.17l1.7-6.924H56.063l.877-3.612h21.174l1.82-7.453Z","data-name":"Trac\\xE9 2778"}),V.createElement("g",{"data-name":"Groupe 2256"},V.createElement("g",{clipPath:"url(#logoFFSA_svg__a)","data-name":"Groupe 2255"},V.createElement("path",{fill:"#fff",d:"M88.784 19.972a3.36 3.36 0 0 0 .045 1.92c.588 1.746 3.564 2.12 6.17 2.12 2.311 0 5.921-.488 6.456-2.643.369-1.517-1.5-1.923-9-3.345-6.884-1.3-14.805-2.561-13.375-8.426C80.721 2.888 90.414.001 99.8.001c9.886 0 18.033 2.4 16.681 9.475H103.22c.521-1.091-.072-1.821-1.086-2.309a9.2 9.2 0 0 0-3.973-.737c-1.9 0-5.121.326-5.515 1.955-.254 2.067 6.142 2.518 12.3 3.664s12.068 3.052 10.768 8.386c-1.851 7.566-13.356 10.011-23.5 10.011-5.156 0-19.6-1.191-17.458-10.474Z","data-name":"Trac\\xE9 2779"}),V.createElement("path",{fill:"#fff",d:"m141.418 19.374-1.893-8.967h-.122l-6.605 8.967ZM134.962.693h13.7l9.472 29.05h-14.541l-.9-4.155h-14.478l-3.046 4.155h-14.1Z","data-name":"Trac\\xE9 2780"}),V.createElement("path",{fill:"#fff",d:"M162.238.531h5.983L161 30.018l-3.4-10.553Z","data-name":"Trac\\xE9 2781"}),V.createElement("path",{fill:"#d80019",d:"M161 30.019 168.221.532H180l-4.656 19.007S172.953 29.998 161 30.019","data-name":"Trac\\xE9 2782"}),V.createElement("path",{fill:"#004391",d:"M151.499.531h10.74l-4.64 18.93Z","data-name":"Trac\\xE9 2783"}))))))},{})})}};function Uj(e){return"production"===r.Development?F.FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID?Lj[F.FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID]:void 0:Lj[e]}const Vj=e=>{const n=Fi();return(0,i.jsxs)(Tl,{align:"center",direction:"column",children:[(0,i.jsx)(Tl,{align:"center",css:{background:"$primary500",borderRadius:"48px",fontSize:"$textXl",color:"white",height:"48px",width:"48px"},justify:"center",children:(0,i.jsx)(Yl,{icon:e.icon})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textMd",children:e.title||n("la_fonctionnali_59786")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:e.subtitle||n("si_vous_voulez_24448")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(tc,{to:`mailto:${F.EMAIL_FROM}`,children:n("contacter_l_qu_16617")})]})},Bj={PLURAL:"campaigns",SINGLE:"campaign"},Wj={CAMPAIGNS:Bj.PLURAL,CAMPAIGN:e=>Xi([Bj.SINGLE,e])},Gj={CAMPAIGNS:({organizationId:e,eventId:n})=>Xi([n?Rs.EVENT({organizationId:e,eventId:n}):hs.COMMUNITY({organizationId:e}),Wj.CAMPAIGNS]),CAMPAIGNS_SEGMENT:({organizationId:e,segmentId:n})=>Xi([Gj.CAMPAIGNS({organizationId:e}),n]),CAMPAIGN:({organizationId:e,eventId:n,campaignId:t})=>Xi([n?Rs.EVENT({organizationId:e,eventId:n}):hs.COMMUNITY({organizationId:e}),Wj.CAMPAIGN(t)]),CAMPAIGN_DASHBOARD:e=>Xi([Gj.CAMPAIGN(e),ns.DASHBOARD]),CAMPAIGN_PREVIEW:({userInfoId:e,...n})=>Xi([Gj.CAMPAIGN(n),ns.PREVIEW,e]),CREATE(e){const n=is(Gj.CAMPAIGNS(e));return e.options?`${n}/${e.options}`:n},CREATE_TEMPLATE:e=>Xi([is(Gj.CAMPAIGNS(e)),"template"]),UPDATE:e=>ss(Gj.CAMPAIGN(e))},qj={PLURAL:"workflows",SINGLE:"workflow"},Hj=e=>Xi([qj.SINGLE,e]),Yj={WORKFLOWS:({eventId:e,...n})=>Xi([e?Rs.EVENT({...n,eventId:e}):hs.COMMUNITY(n),qj.PLURAL]),WORKFLOWS_SEGMENT:({segmentId:e,...n})=>Xi([Yj.WORKFLOWS(n),e]),WORKFLOW:({workflowId:e,eventId:n,...t})=>Xi([n?Rs.EVENT({...t,eventId:n}):hs.COMMUNITY(t),Hj(e)]),WORKFLOW_DASHBOARD:e=>Xi([Yj.WORKFLOW(e),ns.DASHBOARD]),WORKFLOW_HISTORY:e=>Xi([Yj.WORKFLOW(e),ns.HISTORY]),CREATE:e=>is(Yj.WORKFLOWS(e)),UPDATE:e=>ss(Yj.WORKFLOW(e))},Zj=e=>{const n=(0,V.useRef)(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("details",{ref:n,open:e.showSection,onToggle:n=>{const t=n.currentTarget.open;t!==e.showSection&&(e.setShowSection(t),e.onToggle?.(t))},children:[(0,i.jsx)("summary",{style:{cursor:"pointer"},children:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(ep,{tabIndex:-1,value:e.showSection,onChange:Bc.A}),(0,i.jsx)(rc,{css:{fontWeight:"$medium"},children:e.toggle})]})}),(0,i.jsx)(Tl,{css:{marginBlockStart:"$5",borderBlockStart:"1px solid $gray200",paddingBlockStart:"$6","&:has(> .card)":{borderBlockStart:"unset",marginBlockStart:"$4",paddingBlockStart:"unset"}},direction:"column",gap:"3",children:e.children})]})})},Kj=({css:e,disabled:n,hideHeading:t,isOpen:s,isOpenToggleLabel:o,onToggle:a,...d})=>{const{descId:l}=Sc(),[c,u]=V.useState(s??!1);return"production"!==r.Production&&V.Children.toArray(d.children).filter(e=>["RadioText","Radio"].includes(e.type.name)).length>=2&&"radiogroup"!==d.role&&console.warn('This `` element contains multiple `` components, but does not have `role="radiogroup"` set; this may result in incorrect styling (i.e., too much vertical spacing).'),(0,i.jsx)(Zx.Provider,{value:{isDisabled:n},children:(0,i.jsxs)(Tl,{"aria-describedby":l,as:"fieldset",className:"fieldset--column",css:{border:"unset",padding:"unset",margin:"unset",'&[role="radiogroup"]':{gap:"$2","& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset","& > h2":{fontSize:"$textSm",color:"$gray700"},"& + div":{gap:"$3"}}},"&:disabled :is(input, select, textarea, datalist, button)":{cursor:"not-allowed !important"},...e},direction:"column",disabled:o?!c:void 0,gap:o?"5":"6",...d,children:[(0,i.jsx)(nf,{heading:d.heading}),!t&&(0,i.jsxs)(Tl,{as:El.Header,css:{paddingBlockEnd:o?void 0:"$5",borderBlockEnd:o?void 0:"1px solid $gray200"},direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{gap:"1",children:[(0,i.jsx)(dc,{"aria-hidden":"true",color:"gray800",textStyle:"heading",children:d.heading}),d.tooltip]}),d.subtitle&&(0,i.jsx)(rc,{id:l,textStyle:"subtitle",children:d.subtitle})]}),o?(0,i.jsx)(Zj,{setShowSection:u,showSection:c,toggle:o,onToggle:a,children:d.children}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Tl,{css:{gap:"$6",'&:not(role="radiogroup"):has(> fieldset.fieldset--column + fieldset.fieldset--column)':{gap:"$9"},"&:has(> fieldset.fieldset--row)":{gap:"unset"}},direction:"column",children:d.children})})]})})};var Xj;!function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList"}(Xj||(Xj={}));const Qj=[Xj.Assignments,Xj.Badge,Xj.Certificate,Xj.UserHours,Xj.UserPlanning,Xj.UserPlanningDays,Xj.UserPlanningList];function Jj(e){switch(e){case Ne.AsoPaxManifest:return"PAX Manifest";case Ne.Assignments:return"Assignments";case Ne.Badge:return"Badge";case Ne.Certificate:return"Certificate";case Ne.CustomBadge:return"badges_personna_27045";case Ne.DelegationCalendar:return"planning_des_ac_44426";case Ne.Planning:return"planning_de_l_96909";case Ne.Position:return"fiche_de_missio_61604";case Ne.PositionPlanning:return"plannings_missi_53470";case Ne.PositionsVolunteersPlanning:return"planning_d_un_g_23684";case Ne.UserCustomDocument:return"document_person_69340";case Ne.UserHours:return"UserHours";case Ne.UserPlanning:return"UserPlanning";case Ne.UserPlanningDays:return"UserPlanningDays";case Ne.UserPlanningList:return"UserPlanningList";case Ne.UsersPictures:return"trombinoscope_11316";case Ne.VolunteersListing:return"liste_des_membr_89037";default:return Zl()}}const ev=(e,n)=>{switch(n){case"user":return e("membre_45658");case"userDelegation":case"delegation":return e("Delegation");case"userDocuments":return e("Documents");case"event":return e("_v_nement_22345");case"organization":return e("organisation_71863");case"recipient":return e("destinataire_20445");case"invitedBy":return e("personne_qui_in_11448");case"assignments":return e("affectation_plural");case"accreditations":return e("accr_ditations_39450");case"preassign":return e("pr_affectation_12256");case"wishes":return e("souhaits_16217");case"blocks":return e("blocs_d_taill_s_61273");case"links":return e("liens_26418");case"email":return e("e_mail_13869")}},nv=(e,n=[])=>n.map(({slug:n,name:t})=>[`${e}.${n}`,t]),tv=(e,n)=>[[`${n}.leader.firstName`,e("pr_nom_du_respo_18803")],[`${n}.leader.lastName`,e("nom_du_responsa_41401")],[`${n}.leader.email`,e("e_mail_du_respo_05575")],[`${n}.leader.phone`,e("t_l_phone_du_re_17756")]],iv=(e,n)=>[[`${n}.firstName`,e("pr_nom_66988")],[`${n}.lastName`,e("Name")],[`${n}.name`,e("full_name")],[`${n}.email`,e("e_mail_13869")]],sv=(e,n,t)=>[[`${n}.name`,e("_1_mission_16896",t)],[`${n}.range`,e("_1_cr_neau_99218",t)],[`${n}.dateLong`,e("_1_jour_62088",t)],[`${n}.slot.startTime`,e("_1_heure_de_20695",t)],[`${n}.slot.endTime`,e("_1_heure_de_70993",t)]],ov=(e,n,t)=>[[`${n}.name`,e("_1_accr_dita_60981",t)],[`${n}.fullName`,e("_1_accr_dita_89325",t)],[`${n}.dateLong`,e("_1_jour_62088",t)]],av=e=>[["user.localId",e("id_sur_l_v_nem_01171")],["user.ticketId",e("num_ro_de_bille_41680")],["user.memberCode",e("code_membre_wee_67463")],["user.profile",e("profil_d_accr_d_02274")],["user.profileCategory",e("cat_gorie_du_pr_95638")],["user.qrcode",e("qr_code_du_bill_78196")]],rv=(e,n,t,i)=>{switch(n){case"user":return[["user",[...iv(e,"user"),["user.id",e("id_du_membre_81110")],["user.organizationLocalId",e("id_sur_l_organi_45566")],["user.registrationDate",e("date_d_inscript_31369")],["user.registrationDatetime",e("date_et_heure_d_83806")],...i.has("userRegistration")?av(e):[],...nv("user",t.usersCustomFields)]]];case"userRegistration":return[["user",av(e)]];case"userDelegation":return[["userDelegation",[["user.delegation.name",e("nom_de_la_d_l_g_28087")],...tv(e,"user.delegation"),["user.delegation.spaceLink",e("lien_vers_l_esp_12557")]]]];case"userDocuments":return[["userDocuments",[["user.documents.assignments",e("Assignments")],["user.documents.planning",e("planning_63989")],["user.documents.planningList",e("planning_liste_09911")],["user.documents.planningDays",e("planning_par_j_55733")],["user.documents.badge",e("Badge")],["user.documents.certificate",e("attestation_de_92734")],...(t.customBadges??[]).map(({slug:e,name:n})=>[`user.documents.${e.toLowerCase()}`,n]),...nv("user.documents",t.customDocuments)]]];case"event":return[["event",[["event.name",e("nom_de_l_v_nem_08711")],["event.id",e("id_de_l_v_neme_12637")],["event.startDate",e("date_de_d_but_43380")],["event.endDate",e("date_de_fin_86920")],...nv("event",t.eventsCustomFields)]]];case"organization":return[["organization",[["organization.name",e("nom_de_l_organi_49583")],["organization.id",e("id_de_l_organis_81753")]]]];case"delegation":return[["delegation",[["delegation.name",e("nom_de_la_d_l_g_28087")],["delegation.id",e("id_de_la_d_l_ga_42888")],["delegation.category.name",e("cat_gorie_de_la_03242")],...tv(e,"delegation"),["delegation.formLink",e("lien_vers_le_fo_15097")],["delegation.spaceLink",e("lien_vers_l_esp_12557")],...nv("delegation",t.delegationsCustomFields)]]];case"recipient":return[["recipient",iv(e,"recipient")]];case"invitedBy":return[["invitedBy",iv(e,"invitedBy")]];case"assignments":{const n=e("Mission n°1");return[["assignments",[["positions",e("missions_63972")],["positionsCategories",e("cat_gories_de_m_55263")],["assignmentsDays",e("jours_d_affecta_53288")],["volunteerHours",e("heures_affect_e_34870")],["volunteerMinutes",e("minutes_affect_59494")],...sv(e,"user.firstAssignment",e("premi_re_affect_52057")),...sv(e,"user.lastAssignment",e("derni_re_affect_67044")),["user.positions.1.name",e("_1_nom_24701",n)],["user.positions.1.category.name",e("_1_cat_gorie_86762",n)],["user.positions.1.firstSlot.range",e("_1_premier_c_18598",n)],["user.positions.1.lastSlot.range",e("_1_dernier_c_73972",n)]]]]}case"accreditations":{const n=e("accr_ditation_n_26840");return[["accreditations",[["accreditationsText",e("accr_ditations_39450")],["accreditationsCategories",e("cat_gories_d_ac_73496")],["accreditationsSlots",e("cr_neaux_d_accr_44687")],["accreditationsDates",e("dates_des_accr_21145")],["accreditations.nodate",e("accr_ditations_34318")],["accreditationsSlots.nodate",e("cr_neaux_d_accr_82388")],...ov(e,"user.firstAccreditationSlot",e("premier_cr_neau_83376")),...ov(e,"user.lastAccreditationSlot",e("dernier_cr_neau_48142")),["user.accreditations.1.name",e("_1_nom_24701",n)],["user.accreditations.1.category.name",e("_1_cat_gorie_86762",n)],["user.accreditations.1.firstSlot.dateLong",e("_1_premier_j_44492",n)],["user.accreditations.1.lastSlot.dateLong",e("_1_dernier_j_85172",n)]]]]}case"preassign":return[["preassign",[["preassignPositions",e("missions_pr_af_02950")],["preassignCategories",e("cat_gories_pr_83825")]]]];case"wishes":return[["wishes",[["wishedPositions",e("missions_souhai_23225")],["wishedSlots",e("disponibilit_s_49923")],["wishedAccreditations",e("accr_ditations_74375")],["wishedAccreditationsDates",e("dates_des_accr_59339")]]]];case"assignmentsBlocks":return[["blocks",[["assignments",e("d_tail_des_affe_15729")],["assignmentsLight",e("d_tail_all_g_d_60251")]]]];case"accreditationsBlock":return[["blocks",[["accreditations",e("d_tail_des_accr_36727")]]]];case"formLink":return[["links",[["formLink",e("lien_vers_le_fo_15097")]]]];case"delegationsSpaceLink":return[["links",[["delegationsSpaceLink",e("lien_vers_l_esp_12557")]]]];case"eventUnregister":return[["links",[["user.eventUnregister",e("lien_de_d_sinsc_39363")]]]];case"emailUnregister":return[["links",[["user.emailUnregister",e("lien_de_d_sabon_98323")]]]];case"teamInvite":return[["email",[["invitedBy",e("pr_nom_du_chef_64060")],["teamCode",e("code_de_l_quip_63602")]]]];case"loginCode":return[["email",[["code",e("code_de_connexi_57121")]]]];case"positionLeader":return[["email",[["position.name",e("Position")]]]];case"categoryLeader":return[["email",[["category.name",e("cat_gorie_00291")]]]]}};function dv(e,n){const t=["userRegistration","userDelegation"];return["user","userDocuments",...n?["event"]:[],"organization",...n?["eventUnregister"]:[],...(()=>{switch(e){case Ve.Campaign:return[...t,"delegation","recipient",...n?["assignments","accreditations","assignmentsBlocks","accreditationsBlock"]:[],"preassign","wishes","formLink","delegationsSpaceLink","emailUnregister"];case Ve.VolunteerRegistration:return[...t,"delegation"];case Ve.FormSubmit:return[...t,"delegation","assignments","accreditations","wishes","assignmentsBlocks","accreditationsBlock","formLink"];case Ve.Assignments:return[...t,"delegation","assignments","preassign","wishes","assignmentsBlocks"];case Ve.Refused:case Ve.AccreditationsRefused:return[...t,"delegation","wishes"];case Ve.Accreditations:return[...t,"delegation","accreditations","wishes","accreditationsBlock"];case Ve.FormInvite:return["wishes","formLink","teamInvite"];case Ve.DelegationFormInvite:return["userDelegation","delegation","invitedBy"];case Ve.DelegationLeaderAssign:return[...t,"delegation","formLink","delegationsSpaceLink"];case Ve.DelegationCategoryLeaderAssign:return[...t,"delegation","categoryLeader"];case Ve.PositionLeaderAssign:return["positionLeader"];case Ve.PositionCategoryLeaderAssign:return["categoryLeader"];case Ve.Code:return["loginCode"];default:return[]}})()]}const lv=5e9,cv=2e7;function uv(e){let n=e;try{n=new URL(e).pathname}catch{}if(g(n)){const e=n.split(/[\\/]/).pop(),t=e.lastIndexOf(".");let i=e,s="";return t>=0&&(i=e.substring(0,t),s=e.substring(t+1).toLowerCase()),{path:n,name:i,extension:s}}return{path:"",name:"",extension:""}}const mv=["jpg","png","jpeg","gif"];var gv,hv;function pv(e){return Ho(e).flatMap(e=>{switch(e){case gv.Archives:return["zip"];case gv.Csv:return["csv"];case gv.Gpx:return["gpx"];case gv.Images:return["jpg","png","jpeg","gif"];case gv.Kml:return["kml"];case gv.Pdf:return["pdf"];case gv.SmallImages:return["jpg","png","jpeg"];case gv.Videos:return["mp4","mov","webm","mkv"];default:return Zl()}})}function Iv(e){return Math.min(...Ho(e).flatMap(e=>{switch(e){case gv.Archives:return lv;case gv.Csv:return cv;case gv.Images:case gv.Pdf:return 2e7;case gv.Kml:case gv.Gpx:return 1/0;case gv.SmallImages:return 2e6;case gv.Videos:return 5e7;default:return Zl()}}))}function xv(e){return Ho(e).flatMap(e=>e===gv.Images?"image/*":pv(e).map(e=>`.${e}`)).join(",")}!function(e){e[e.Archives=0]="Archives",e[e.Csv=1]="Csv",e[e.Gpx=2]="Gpx",e[e.Images=3]="Images",e[e.Kml=4]="Kml",e[e.Pdf=5]="Pdf",e[e.SmallImages=6]="SmallImages",e[e.Videos=7]="Videos"}(gv||(gv={})),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"}(hv||(hv={}));const fv=e=>{switch(e.toLowerCase()){case"csv":return hv.Csv;case"xls":case"xlsx":return hv.Excel;case"gif":return hv.Gif;case"jpg":case"jpeg":return hv.Jpeg;case"pdf":return hv.Pdf;case"png":return hv.Png;case"zip":return hv.Zip;default:return hv.Default}};async function _v(e,n,t,i){const s=await X(),{name:o,extension:a}=uv(n.name),r=`organization/${e}/${W()}/${m(o)}.${a}`,{awsS3PostCredentials:{endpointUrl:d,policy:l,amzCredential:c,amzSignature:u,amzDate:g,amzSecurityToken:h}}=await function(e,n){return oa("query AwsS3PostCredentials($organizationId: OrganizationId!, $acl: String!, $key: String!) {\n awsS3PostCredentials(organizationId: $organizationId, acl: $acl, key: $key) {\n endpointUrl\n policy\n amzSignature\n amzCredential\n amzDate\n amzSecurityToken\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({organizationId:e,acl:t,key:r},s),p=new FormData;return p.append("key",r),p.append("acl",t),p.append("success_action_status","201"),p.append("X-Amz-Credential",c),p.append("X-Amz-Algorithm","AWS4-HMAC-SHA256"),p.append("X-Amz-Date",g),h&&p.append("X-Amz-Security-Token",h),p.append("Policy",l),p.append("X-Amz-Signature",u),p.append("Content-Type",fv(a)),p.append("file",n),new Promise((e,s)=>{const o=new XMLHttpRequest;o.upload.onprogress=e=>{if(e.lengthComputable){const n=Math.round(e.loaded/e.total*100);i?.(n)}},o.onerror=()=>{s(new Error("Could not upload file to S3"))},o.onreadystatechange=()=>{if(4===o.readyState){const i=o.responseXML?.querySelector("Error Code");null!==i?(Ki("Could not upload file to S3",{code:i?.textContent??"",message:o.responseXML?.querySelector("Error Message")?.textContent??""}),s(new Error("Could not upload file to S3"))):e({acl:t,key:r,name:n.name,size:n.size})}},o.open("POST",d,!0),o.send(p)})}const jv=e=>{switch(e.split(".").at(-1)){case"csv":return ou.FileCSV;case"jpeg":case"jpg":return ou.FileJPG;case"pdf":return ou.FilePDF;case"png":return ou.FilePNG;case"zip":return ou.FileZIP;default:return ou.FileBlank}};function vv(e,n){return`https://${n}.s3-eu-west-1.amazonaws.com/${e.key}`}function Sv(e){return new Promise((n,t)=>{!function(e,t,i){const s=document.createElement("script");s.onload=()=>{n(!0)},s.onerror=()=>{i&&i()},s.src=e,document.body.appendChild(s)}(e,0,()=>{t(new Error(`Could not load ${e}`))})})}function yv(e,n,t){return 25===e?{transform:`translateX(${n}px) rotate(0.25turn)`,transformOrigin:"top left"}:50===e?{transform:"rotate(0.5turn)"}:75===e?{transform:`translateY(${t}px) rotate(0.75turn)`,transformOrigin:"top left"}:{}}const Cv=br("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"}}}}),bv=br("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 Av;!function(e){e[e.EmptyFile=0]="EmptyFile",e[e.Pdf=1]="Pdf",e[e.Image=2]="Image"}(Av||(Av={}));class Ev extends V.Component{contentRef;renderPagesDebounced;constructor(e){super(e);let n=Av.Image;"string"!=typeof this.props.fileUrl||0===this.props.fileUrl.trim().length?n=Av.EmptyFile:"pdf"===uv(this.props.fileUrl).extension&&(n=Av.Pdf),this.state={image:null,isLoading:!0,fileType:n,pdf:null,rotate:0,zoomLevel:100},this.renderPagesDebounced=(0,Vm.A)(()=>{this.renderPdfPages()},200),this.contentRef=V.createRef()}componentDidMount(){var e;this.state.fileType===Av.Pdf?(e=this.props.fileUrl,(void 0===window.pdfjsLib?Sv("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===Av.Image&&this.loaderImage()}renderPdfPages(){this.state.fileType===Av.Pdf&&async function(e,n,t,i){Array.from(n.childNodes).forEach(e=>{n.removeChild(e)});for(let s=1;s<=e.numPages;s++){const o=await e.getPage(s),a=o.getViewport(t),r=document.createElement("div"),d=document.createElement("canvas"),l=d.getContext("2d"),c=yv(i,a.height,a.width);25===i||75===i?(r.style.height=`${a.width}px`,r.style.width=`${a.height}px`):(r.style.height=`${a.height}px`,r.style.width=`${a.width}px`),d.height=a.height,d.width=a.width,d.style.transform=c.transform||"",d.style.transformOrigin=c.transformOrigin||"",r.appendChild(d),n.appendChild(r),o.render({canvasContext:l,viewport:a})}}(this.state.pdf,this.contentRef.current,this.state.zoomLevel/100,this.state.rotate).then(()=>{this.setState({isLoading:!1})})}loaderImage(){if(this.state.fileType===Av.Image){const e=new Image;e.onload=()=>{const n=this.contentRef.current.getBoundingClientRect(),t=n.height/e.height,i=n.width/e.width,s=Math.min(t,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:Av.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 n=e.rotate+25;return{rotate:n>=100?0:n}}),this.renderPagesDebounced()}render(){return(0,i.jsx)(Pi,{children:({container:e})=>{const n=e.get(Di);return(0,i.jsxs)(Tl,{css:{position:"relative"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Mr,{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===Av.Image&&!1===this.state.isLoading&&(0,i.jsx)(Mr,{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`,...yv(this.state.rotate,this.imageHeight(),this.imageWidth())}})}),!0===this.state.isLoading&&(0,i.jsx)(Mr,{css:{background:"white",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"10"},children:(0,i.jsx)(Ql,{})}),this.state.fileType===Av.EmptyFile&&(0,i.jsx)(Tl,{align:"center",css:{background:"white",fontSize:"22px",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"20"},justify:"center",children:n.translate("aucun_fichier_77247")}),(0,i.jsxs)(Tl,{align:"center",css:{height:"50px",width:"100%"},justify:"center",children:[(0,i.jsxs)(Cv,{controls:!0,children:[(0,i.jsx)("i",{className:"fas fa-minus",onClick:this.zoomMinus.bind(this)}),(0,i.jsx)(bv,{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)(Cv,{rotate:!0,onClick:this.rotate.bind(this),children:(0,i.jsx)("i",{className:"far fa-undo"})})]})]})}})}}const wv=({acl:e,document:n,onDelete:t,...s})=>{const{translate:o}=Kl(),[a,r]=(0,V.useState)(!1),d=Dm(),l="public-read"===e||g(n.url),c=g(n.url)?n.url:vv(n,F.HEAVENT_AWS_UPLOADS_BUCKET),{designSystem:u}=Em();return(0,i.jsxs)(Tl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",fontSize:"$textSm",overflow:"hidden",minHeight:"72px","@tablet":{border:"1px solid $gray300",borderRadius:"$2",fontSize:"$textMd"},...(()=>{switch(u){case Cm:return{padding:"$3","@tablet":{padding:"$3"}};case bm:return{padding:"$4 $6"};default:Zl()}})()},justify:"between",width:1,...d&&{onClick:()=>{!function(e,n){const t=document.createElement("a");t.href=e,t.target="_blank",t.download=n,t.click()}(c,n.name)}},...s,children:[(0,i.jsxs)(Tl,{align:"center",css:{maxInlineSize:"80%"},gap:"4",children:[(0,i.jsx)("img",{src:jv(n.name),style:{color:"black"}}),(0,i.jsx)(rc,{css:{ellipsis:!0,wordBreak:"break-all",...(()=>{if(u===bm)return{fontWeight:"$medium"}})()},children:n.name})]}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsxs)(Tl,{gap:"2",children:[l&&(0,i.jsxs)(i.Fragment,{children:[!1===d&&(0,i.jsx)(tc,{"aria-label":o("view_48132"),color:"white",leftIcon:"eye",onClick:()=>{r(!0)}}),(0,i.jsx)(tc,{"aria-label":o("download_47607"),color:"white",download:n.name,leftIcon:"download",target:"_blank",to:c})]}),t&&(0,i.jsx)(tc,{"aria-label":o("delete_file_40417"),color:"white",leftIcon:"trash-can",onClick:t})]}),a&&(0,St.createPortal)((0,i.jsx)(Tl,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"250"},height:1,width:1,children:(0,i.jsx)(Hx,{heading:n.name,onClose:()=>r(!1),children:(0,i.jsx)(Ev,{fileUrl:c})})}),document.body)]})},$v=br("progress",{}),Tv=e=>(0,i.jsx)($v,{...e,children:e.children}),zv=({name:e,progress:n,...t})=>{const s=Math.min(100,Math.max(0,n)),{inputId:o}=Sc();return(0,i.jsxs)(Tl,{css:{border:"1px solid $gray300",borderRadius:"$2",padding:"$4"},direction:"column",width:1,gap:"2",...t,children:[(0,i.jsx)(bc,{htmlFor:o,children:e}),(0,i.jsxs)(Tv,{id:o,max:"100",value:s,children:[s,"%"]})]})};var Ov=t(3112);let Rv=class{translationService;constructor(e){this.translationService=e}getFormatter(e={}){return Intl.NumberFormat(du(this.translationService.language),{notation:e.notation||"compact",style:e.style||"unit",unit:e.unit||"byte",unitDisplay:e.unitDisplay||"narrow"})}toNumberOrEmpty(e,{prefix:n}={}){return"number"==typeof e?`${n??""}${e.toLocaleString()}`:""}toNumberOrInfinity(e,{prefix:n}={}){return`${n??""}${"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`}};Rv=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Rv),t(8181);var Dv=t(9618);const Mv=({allowCrop:e,onChange:n,hint:t,label:s,...o})=>{const a=Fi(),{isDisabled:r}=Kx(),d=(0,V.useRef)(null),[l,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(null),[g,h]=(0,V.useState)(!1),p=pv(gv.Images),I=e=>{if(e&&e[0]){const n=URL.createObjectURL(e[0]),t=e[0].type,i=new FileReader;i.onload=i=>{m({src:n,type:(0,Ov.h)(i.target?.result,t),name:e[0].name})},i.readAsArrayBuffer(e[0])}h(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{gap:"4",width:1,children:[(0,i.jsx)(Tl,{align:"center",css:{background:l?"$primary50":"$gray50",border:l?"1px solid $primary300":"1px solid $gray200",borderRadius:"$1",cursor:r?"not-allowed":"pointer"},disabled:r,height:126,justify:"center",width:126,onClick:()=>{d.current?.click()},onDragEnter:e=>{jc(e),c(!0)},onDragLeave:e=>{jc(e),c(!1)},onDragOver:e=>{jc(e),l||c(!0)},onDrop:t=>{jc(t),c(!1);const i=t.dataTransfer.files.item(0);i&&p.includes(uv(i.name).extension)&&(e?I(t.dataTransfer.files):n(i))},children:(0,i.jsx)(Tl,{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)(Yl,{icon:"plus"})})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray700",fontWeight:"medium",children:s}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray400",children:t})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:()=>{d.current?.click()},children:a("s_lectionner_un_50712")})})]}),(0,i.jsx)(Mr,{css:{display:"none"},children:(0,i.jsx)("input",{ref:d,accept:xv(gv.Images),type:"file",onChange:t=>{t.target.files?.[0]&&(e?I(t.target.files):n(t.target.files[0]))},...o})})]}),e&&g&&u&&(0,i.jsx)(Pv,{image:u,onChange:n,onClose:()=>h(!1)})]})},Pv=({image:e,onChange:n,onClose:t})=>{const s=Fi(),o=(0,V.useRef)(null);return(0,V.useEffect)(()=>()=>{e&&e.src&&URL.revokeObjectURL(e.src)},[e]),(0,i.jsx)(dg,{size:"md",onClose:t,children:(0,i.jsxs)(Tl,{css:{overflow:"auto"},direction:"column",gap:"3",children:[(0,i.jsx)(Dv.IOb,{ref:o,className:"cropper",defaultSize:({imageSize:e,visibleArea:n})=>({width:(n||e).width,height:(n||e).height}),src:e.src,stencilProps:{aspectRatio:1}}),(0,i.jsx)(tc,{size:"lg",textAlign:"center",onClick:()=>{const i=o.current?.getCanvas();i&&i.toBlob(t=>{if(t){const i=new File([t],e.name,{lastModified:(new Date).getTime(),type:e.type});n(i)}},e.type,.95),t()},children:s("submit_21373")})]})})},kv="dragover",Fv=({accept:e,allowCrop:n,"aria-describedby":t,capture:s,onChange:o,...a})=>{const{translate:r}=Kl(),d=Ni(),{isDisabled:l}=Kx(),c=(0,vc.A)(),u=(0,V.useRef)(null),[m,g]=(0,V.useState)(void 0),[h,p]=(0,V.useState)(null),[I,x]=(0,V.useState)(!1),f=pv(e||[]),_=Iv(e||[]),j=e=>{if(e&&e[0]){const n=URL.createObjectURL(e[0]),t=e[0].type,i=new FileReader;i.onload=i=>{p({src:n,type:(0,Ov.h)(i.target?.result,t),name:e[0].name})},i.readAsArrayBuffer(e[0])}x(!0)},{designSystem:v}=(0,V.useContext)(Am);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("input",{ref:u,accept:e?xv(e):void 0,"aria-describedby":[t,c].join(" "),capture:s,style:{display:"none"},type:"file",onChange:t=>{if(t.target.files?.[0])if(n){if(e!==gv.Images)throw new Error("Crop enabled on non-image file uploader");j(t.target.files)}else o(t.target.files[0])},...a}),(0,i.jsxs)(Tl,{align:"center",className:m,css:{background:"$gray50",borderWidth:"1px",borderColor:"$gray200",borderRadius:"$2",cursor:l?"not-allowed":"pointer",padding:"$4",[`&.${kv}`]:{background:"$primary50",borderColor:"$gray200"},...(()=>{switch(v){case Cm:return{borderStyle:"solid"};case bm:return{borderStyle:"dashed",[`&:hover, &:has( input:focus), &.${kv}`]:{borderStyle:"solid",borderColor:"$primary500"}};default:Zl()}})()},direction:"column",disabled:l,gap:"2",width:1,onClick:()=>u.current?.click(),onDragLeave:()=>{g(void 0)},onDragOver:e=>{jc(e),g(kv)},onDrop:t=>{jc(t),g(void 0);const i=t.dataTransfer.files.item(0);if(i&&(0===f.length||f.includes(uv(i.name).extension)))if(n){if(e!==gv.Images&&e!=gv.SmallImages)throw new Error("Crop enabled on non-image file uploader");j(t.dataTransfer.files)}else o(i)},children:[(0,i.jsx)(Tl,{align:"center","aria-hidden":!0,css:{color:"$gray600",...(()=>{switch(v){case Cm:return{background:"$gray100",borderRadius:"36px"};case bm:return;default:Zl()}})()},height:32,justify:"center",width:32,children:(0,i.jsx)(Yl,{icon:"cloud-arrow-down"})}),(0,i.jsxs)(Tl,{css:{textAlign:"center"},direction:"column",justify:"center",wrap:"wrap",children:[(0,i.jsx)(rc,{textStyle:"subtitle",children:[...d(r("_1_ou_glisser_61813","{1}"),(0,i.jsx)(tc,{color:"invisible",css:{height:"auto",padding:0},id:"clickHereLink",type:"button",children:r("cliquez_ici_98447")}))]}),(0,i.jsx)(rc,{id:c,textStyle:"subtitle",children:[...d(r("_1_accept_2_30390","{1}","{2}"),Yo(f)?f.map((e,n,{length:t})=>(0,i.jsxs)(V.Fragment,{children:[n>0?t-1!==n?", ":" & ":"",(0,i.jsxs)("code",{children:[".",e]})]},e)):r("all_file_format_50211"),_!==1/0?Rv.bytesToMegabytes(_):r("no_55268"))]})]})]}),n&&I&&h&&(0,i.jsx)(Pv,{image:h,onChange:o,onClose:()=>x(!1)})]})};var Nv;!function(e){e[e.File=0]="File",e[e.Uploader=1]="Uploader",e[e.Uploading=2]="Uploading"}(Nv||(Nv={}));const Lv=({acl:e,css:n,descId:t,description:s,errorId:o,inputId:a,label:r,labelId:d,hint:l,onChange:c,organizationId:u,state:m,value:g,...h})=>{const{translate:p}=Kl(),[I,x]=(0,V.useState)(g?Nv.File:Nv.Uploader),[f,_]=(0,V.useState)(""),[j,v]=(0,V.useState)(0);return(0,i.jsxs)(Tl,{"aria-live":"polite",css:n,direction:"column",gap:"1",width:1,children:[(r||s)&&(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(bc,{htmlFor:a,id:d,children:r}),(0,i.jsx)(yc,{id:t,children:s})]}),I===Nv.File&&g?(0,i.jsx)(wv,{acl:e,"aria-label":p("delete_uploaded_14711"),document:g,id:a,role:"button",onDelete:()=>{c(null),x(Nv.Uploader)}}):I===Nv.Uploading?(0,i.jsx)(zv,{"aria-busy":!0,"aria-describedby":t,"aria-label":p("uploading_file_46483"),id:a,name:f,progress:j}):(0,i.jsx)(Fv,{"aria-describedby":t,"aria-errormessage":o,"aria-invalid":"error"===m,"aria-label":p("upload_file_97740"),id:a,onChange:async n=>{x(Nv.Uploading),_(n.name),v(0);try{if(n.size>Iv(h.accept||[]))throw _(""),alert(p("file_is_too_lar_57859")),new Error;const t=await _v(u,n,e,v);c({...t,file:n}),x(Nv.File)}catch{x(Nv.Uploader)}},...h}),(0,i.jsx)(Cc,{state:m,children:l})]})},Uv=e=>{const n=Fi();return(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[e.children,(0,i.jsxs)(Mr,{color:"gray500",fontSize:"textXs",fontWeight:"regular",children:["(",n("facultatif_76747"),")"]})]})},Vv=(0,V.createContext)({}),Bv=br("div",{background:"$gray50",border:"1px solid $gray100",borderRadius:"$2",display:"flex",gap:"$2",height:"44px",minHeight:"44px",padding:"$1",position:"relative",width:"100%"}),Wv=br("div",{alignItems:"center",color:"$gray500",cursor:"pointer",display:"flex",fontWeight:"$medium",height:"100%",justifyContent:"center",userSelect:"none",width:"100%",variants:{color:{white:{},primary:{}},selected:{true:{borderRadius:"6px",boxShadow:"$sm"}}},compoundVariants:[{color:"white",selected:!0,css:{background:"white",color:"$gray700"}},{color:"primary",selected:!0,css:{background:"$primaryCustom500",color:"white"}}]}),Gv=e=>(0,i.jsx)(Vv.Provider,{value:{color:e.color??"white",selectedItem:e.selectedItem,onChange:e.onChange},children:(0,i.jsx)(Bv,{css:e.css,children:e.children})}),qv=e=>{const{color:n,selectedItem:t,onChange:s}=(0,V.useContext)(Vv);return(0,i.jsx)(Wv,{color:n,selected:t===e.item,onClick:()=>{s(e.item)},children:e.children})};var Hv=t(7785),Yv=t(8790),Zv=(t(1036),t(6585)),Kv=t(2230),Xv=t(2910),Qv=t(456);const Jv=(e,n)=>{const t=document.createElement("span");return t.className=e,void 0!==n&&(t.textContent=n),t};class eS extends Yv.k_1{static get pluginName(){return"VariablesMention"}static get requires(){return[Yv.PXQ]}init(){const e=this.editor,n=e.commands.get("mention");this.listenTo(n,"execute",(n,t)=>{const i=t[0];if("{"!==i.marker)return;n.stop();const s=e.model,o=s.document.selection,a="string"==typeof i.mention?i.mention:i.mention.id;s.change(e=>{const n=new Map(o.getAttributes());n.delete("mention"),s.insertContent(e.createText(a,n),i.range??o.getFirstRange())})},{priority:"high"})}}const nS=Tr({".ck.ck-mentions":{maxWidth:"420px"},".ck.ck-mentions .ck-button.rich-editor-variable-item":{alignItems:"stretch",background:"transparent !important",borderRadius:"0 !important",boxShadow:"none !important",color:"$gray800 !important",cursor:"pointer",display:"flex",flexDirection:"column",padding:"0 !important",width:"100%"},".ck.ck-mentions .rich-editor-variable-item-group":{borderTop:"1px solid $gray100",color:"$gray500",cursor:"default",fontSize:"$textXs",fontWeight:"$semiBold",padding:"$2 $3 $1"},".ck.ck-mentions .ck-list__item:first-child .rich-editor-variable-item-group":{borderTop:"none"},".ck.ck-mentions .rich-editor-variable-item-row":{alignItems:"baseline",display:"flex",gap:"$4",justifyContent:"space-between",padding:"$2 $3"},".ck.ck-mentions .rich-editor-variable-item:hover .rich-editor-variable-item-row":{background:"$gray100"},".ck.ck-mentions .ck-mentions__item_focused .rich-editor-variable-item-row":{background:"$primary100",color:"$primary700"},".ck.ck-mentions .rich-editor-variable-item-label":{fontSize:"$textSm",whiteSpace:"nowrap"},".ck.ck-mentions .rich-editor-variable-item-key":{color:"$gray500",fontSize:"$textXs",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),tS=({css:e,label:n,description:t,state:s,initialValue:o,onChange:a,onBlur:r,onFocus:d,hint:l,placeholder:c,value:m,variables:g,...h})=>{const{translate:p,params:{organizationId:I}}=Kl(),{language:x}=ki(Di),f=(0,V.useRef)(g),[_]=(0,V.useState)(void 0!==g);(0,V.useEffect)(()=>{f.current=g},[g]),_&&nS();const j=(0,V.useMemo)(()=>[{color:"white",label:p("blanc_36425")},{color:Ar.colors.gray800.value,label:p("gris_fonc_51159")},{color:Ar.colors.gray400.value,label:p("gris_clair_52465")},{color:Ar.colors.primary900.value,label:p("bleu_fonc_40491")},{color:Ar.colors.primary500.value,label:p("bleu_41949")},{color:Ar.colors.error700.value,label:p("rouge_fonc_45023")},{color:Ar.colors.error500.value,label:p("rouge_75079")},{color:Ar.colors.warning300.value,label:p("jaune_53503")},{color:Ar.colors.warning600.value,label:p("orange_64132")},{color:Ar.colors.success700.value,label:p("vert_fonc_37265")},{color:Ar.colors.success500.value,label:p("vert_27018")},{color:Ar.colors.purple700.value,label:p("violet_fonc_77270")},{color:Ar.colors.purple500.value,label:p("violet_54005")},{color:Ar.colors.pink700.value,label:p("rose_fonc_98996")},{color:Ar.colors.pink500.value,label:p("rose_49360")}],[]);return(0,i.jsxs)(Tl,{css:e,direction:"column",width:1,children:[(0,i.jsx)(bc,{children:n}),(0,i.jsx)(yc,{children:t}),(n||t)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{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:"$primary100",color:"$primary500"}}},"& .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"},...Of("& .ck.ck-content")},width:1,children:(0,i.jsx)(Hv.aF,{config:{licenseKey:"GPL",plugins:[Yv.C1k,Yv.Y0,Yv.yN4,Yv.uwK,Yv.LcX,Yv.rwA,Yv.DZT,Yv._V3,Yv.uXn,Yv.BRX,Yv.J20,Yv.N_E,Yv.B8B,Yv.PXQ,Yv.fzL,Yv.fTX,Yv.z2z,..._?[eS]:[]],mention:_?{feeds:[{marker:"{",dropdownLimit:Number.MAX_SAFE_INTEGER,feed:e=>function(e){return e.map((n,t)=>({id:`{${n.key}}`,text:`{${n.key}}`,variable:n,isFirstOfGroup:0===t||e[t-1].group!==n.group}))}(function(e,n){const t=u(n).split(/\s+/).filter(e=>e.length>0);return n.includes("}")?[]:0===t.length?e:e.filter(e=>{const n=u(`${e.label} ${e.groupLabel} ${e.key}`);return t.every(e=>n.includes(e))})}(f.current??[],e)),itemRenderer:e=>function(e){const n=Jv("rich-editor-variable-item"),t=Jv("rich-editor-variable-item-row");return e.isFirstOfGroup&&n.append(Jv("rich-editor-variable-item-group",e.variable.groupLabel)),t.append(Jv("rich-editor-variable-item-label",e.variable.label),Jv("rich-editor-variable-item-key",e.variable.key)),n.append(t),n}(e)}]}:void 0,translations:[Zv.A,Kv.A,Xv.A,Qv.A],placeholder:c,fontColor:{colors:j},fontBackgroundColor:{colors:j},language:x.toString().toLowerCase(),simpleUpload:{uploadUrl:`${F.HEAVENT_API_URL}/image/upload?organizationId=${I}`},heading:{options:[{model:"headingParagraphSmall",view:{name:"p",classes:"h-small"},title:p("paragraphe_pet_01073"),class:"ck-heading_paragraph_small",converterPriority:"high"},{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading2"}]},toolbar:{items:["bold","italic","underline","|","heading","fontColor","fontBackgroundColor","alignment","|","blockQuote","bulletedList","numberedList","|","link","imageUpload","|","undo","redo"],shouldNotGroupWhenFull:!0}},data:o,editor:Yv.aRV,onBlur:()=>{r?.()},onChange:(e,n)=>{a(n.getData())},onFocus:()=>{d?.()},...h})}),(0,i.jsx)(Cc,{state:s,children:l})]})},iS=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(Dl.D0,{name:e,parse:fc.A,render:o=>{const a=_c(o.meta);return(0,i.jsx)(tS,{hint:a?o.meta.error:n,initialValue:o.input.value,name:e,state:a?"error":t,onChange:e=>{o.input.onChange(e)},...s})}}),sS=["user","userDocuments","event","delegation"];function oS(e,{delegationsCustomFields:n=!0,eventsCustomFields:t=!0,usersCustomFields:i=!0}={}){const{translate:s,params:{organizationId:o,eventId:a,formId:r}}=Kl(),d="form"===i?r:void 0,[l,c]=(0,V.useState)(null),u=e.join(","),m=e.some(e=>sS.includes(e)),g=Array.isArray(i)?i.join(","):i;return(0,V.useEffect)(()=>{let e=!1;return m&&o&&X().then(e=>function(e,n){return oa("query TemplateVariables($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId) {\n organization(id: $organizationId) {\n customBadges\n\n usersCustomFields: customFields(eventId: $eventId, variety: UserInfo) {\n nodes {\n slug\n name\n }\n }\n\n eventsCustomFields: customFields(variety: Event) {\n nodes {\n slug\n name\n }\n }\n\n delegationsCustomFields: customFields(eventId: $eventId, variety: Delegation) {\n nodes {\n slug\n name\n }\n }\n\n # The form renders its texts with the definitions of its fields only.\n form: formMaybe(id: $formId) {\n elements {\n customField {\n slug\n }\n\n conditionCustomField {\n slug\n }\n }\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({organizationId:o,eventId:a,formId:d},e)).then(n=>{e||c(n)},()=>{}),()=>{e=!0}},[m,o,a,d]),(0,V.useMemo)(()=>{const o=l?.organization,a=o?.usersCustomFields.nodes??[],r="form"===i?(o?.form?.elements??[]).flatMap(e=>[e.customField?.slug,e.conditionCustomField?.slug].filter(e=>!!e)):Array.isArray(i)?i:null;return function(e,n,t={}){const i=new Set,s=[],o=new Set(n);for(const n of o)for(const[a,r]of rv(e,n,t,o)){const n=ev(e,a);for(const[e,t]of r)i.has(e)||(i.add(e),s.push({key:e,label:t,group:a,groupLabel:n}))}return[...new Set(s.map(({group:e})=>e))].flatMap(e=>s.filter(n=>n.group===e))}(s,e,{customBadges:(o?.customBadges??[]).map(e=>({slug:e,name:M_(e)})),customDocuments:o?.event?.customDocuments,delegationsCustomFields:n?o?.delegationsCustomFields.nodes:[],eventsCustomFields:t?o?.eventsCustomFields.nodes:[],usersCustomFields:r?a.filter(({slug:e})=>r.includes(e)):i?a:[]})},[l,u,n,t,g])}const aS=({value:e,css:n,label:t,description:s,hint:o,icon:a,onChange:r,state:d,...l})=>{const c=g(e)&&e.length>5?e.substring(0,5):e,{inputId:u,descId:m,errorId:h}=Sc();return(0,i.jsxs)(Tl,{css:n,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:u,children:t}),(0,i.jsx)(yc,{id:m,children:s}),(t||s)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Ec,{cursor:"default",icon:a,state:d,children:(0,i.jsx)(Mr,{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?m:void 0,"aria-errormessage":"error"===d?h:void 0,"aria-invalid":"error"===d,disabled:"disabled"===d,id:u,type:"time",value:c,onChange:e=>{r(e.target.value)},...l})})}),(0,i.jsx)(Cc,{id:h,state:d,children:o})]})},rS=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(Dl.D0,{name:e,render:o=>{const a=_c(o.meta);return(0,i.jsx)(aS,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),dS=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Xx,{name:`${e.prefix}hasCalendarInvite`,children:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[n("ajouter_une_inv_92123"),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{css:{cursor:"help"},children:(0,i.jsx)(Mr,{color:"gray500",children:(0,i.jsx)(Yl,{icon:"circle-exclamation"})})}),(0,i.jsx)(Dx,{placement:"top",children:n("un_fichier_ics_01663")})]})]})}),e.hasCalendarInvite&&(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},width:1,children:(0,i.jsxs)(Tl,{css:{background:"$gray50",bd:!0,padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)($c,{label:n("nom_de_l_v_nem_08711"),name:`${e.prefix}calendarInviteName`}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Qx,{label:n("date_de_d_but_43380"),name:`${e.prefix}calendarInviteStartDate`}),(0,i.jsx)(rS,{label:n("heure_de_d_but_27566"),name:`${e.prefix}calendarInviteStartTime`})]}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Qx,{label:n("date_de_fin_86920"),name:`${e.prefix}calendarInviteEndDate`}),(0,i.jsx)(rS,{label:n("heure_de_fin_95071"),name:`${e.prefix}calendarInviteEndTime`})]})]})})]})};function lS(e){navigator.clipboard.writeText(e)}function cS(){const[e,n]=(0,V.useState)(!1);return{isLoading:e,copy:(0,V.useCallback)(e=>{n(!0),lS(e),setTimeout(()=>n(!1),500)},[])}}const uS=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(null),[o,a]=(0,V.useState)(null),r=(0,V.useMemo)(()=>e.customFields.find(e=>e.slug===t),[e.customFields,t]),d=(0,V.useMemo)(()=>r&&o?`{user.fieldUpdate.${r.slug}.${o}}`:"",[e.customFields,r,o]),{isLoading:l,copy:c}=cS();return(0,i.jsx)(sf,{as:"div",heading:n("s_lectionner_un_93801"),hideHeader:!0,children:(0,i.jsxs)(Tl,{direction:"column",gap:"5",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(rc,{children:n("s_lectionner_un_93801")}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsxs)(Up,{value:t??"-1",onChange:e=>{s(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:n("s_lectionner_un_01451")}),e.customFields.map(e=>(0,i.jsxs)("option",{value:e.slug,children:[e.name,g(e.label)&&` (${e.label})`]},e.slug))]}),(0,i.jsx)(Yl,{icon:"arrow-right"}),r?.fieldType===Qe.Select?(0,i.jsxs)(Up,{state:t?"active":"disabled",value:o??"-1",onChange:e=>{a(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:n("select_value_61735")}),r.values.map(({id:e,value:n},t)=>(0,i.jsx)("option",{value:e,children:n},t))]}):(0,i.jsxs)(Up,{state:t?"active":"disabled",value:o??"-1",onChange:e=>{a(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:n("select_value_61735")}),(0,i.jsx)("option",{value:"true",children:n("true_65165")}),(0,i.jsx)("option",{value:"false",children:n("false_74637")})]})]})]}),o&&(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(rc,{children:n("variable_ins_49519")}),(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsx)(Mr,{css:{flex:"1",bd:!0,borderRadius:"$1",padding:"$2 $3",background:"$white"},children:(0,i.jsx)(rc,{css:{cursor:l?"progress":"copy"},onClick:()=>c(d),children:d})}),(0,i.jsx)(tc,{isLoading:l,onClick:()=>c(d),children:n("copier_75889")})]})]})]})})},mS=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),a=oS(dv(Ve.Campaign,!!s)),[r,d]=(0,V.useState)(e.values.campaign.documents);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($c,{label:o("sujet_36033"),name:"campaign.subject"}),(0,i.jsxs)(Tl,{direction:"column",gap:"8",children:[(0,i.jsxs)(Kj,{heading:o("contenu_29668"),hideHeading:!0,children:[(0,i.jsxs)(Gv,{selectedItem:e.values.textOrHtml,onChange:n=>{e.form.change("textOrHtml",n)},children:[(0,i.jsx)(qv,{item:"text",children:o("contenu_en_vers_04808")}),(0,i.jsx)(qv,{item:"html",children:o("contenu_parti_04631")})]}),"text"===e.values.textOrHtml&&(0,i.jsx)(iS,{hint:(0,i.jsx)(Mr,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:o("vous_pouvez_ajo_23408")}}),label:o("contenu_29668"),name:"campaign.text",variables:a}),"html"===e.values.textOrHtml&&(0,i.jsx)(rf,{hint:(0,i.jsx)(Mr,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:o("vous_pouvez_ajo_23408")}}),label:o("code_html_60711"),name:"campaign.html"})]}),Yo(e.customFields)&&(0,i.jsx)(Kj,{heading:o("attribution_d_u_18785"),isOpen:!1,isOpenToggleLabel:o("je_souhaite_cr_46006"),subtitle:o("cr_ez_une_varia_07170"),children:(0,i.jsx)(uS,{customFields:e.customFields})}),(0,i.jsxs)(Kj,{heading:o("_metteur_de_l_e_26879"),subtitle:o("personnaliser_v_65980"),children:[(0,i.jsx)(of,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:o("_metteur_de_l_e_51616")}),name:"campaign.emailSenderId",onCreateClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t))},children:e.emailsSenders.map(n=>(0,i.jsx)("option",{value:n.id,children:`${n.name} ${n.id===e.emailSenderId?o("_metteur_par_d_03442"):n.isValidToSendEmail?"":o("_e_mail_non_con_07618")}`},n.id))}),(0,i.jsx)($c,{isEmail:!0,label:(0,i.jsx)(Uv,{children:o("adresse_de_r_po_86181")}),name:"campaign.replyTo"})]}),(0,i.jsxs)(Kj,{heading:o("pi_ce_s_jointe_82370"),subtitle:o("int_grer_dans_v_73429"),tooltip:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{css:{cursor:"help"},children:(0,i.jsx)(Mr,{color:"gray500",children:(0,i.jsx)(Yl,{icon:"circle-exclamation"})})}),(0,i.jsx)(Dx,{placement:"bottom",children:o("si_vos_pi_ces_j_95233")})]}),children:[e.canCustomDocuments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(of,{isSearchVisible:!0,label:o("documents_dit_25968"),multiple:!0,name:"campaign.attachments",children:[e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),Qj.map(e=>(0,i.jsx)("option",{value:e,children:o(e)},e))]}),e.hasDuplicatedMembers&&(0,i.jsx)(Xx,{name:"campaign.includeDuplicateMembersAttachments",children:o("inclure_les_doc_76200")})]}),r.map(n=>(0,i.jsx)(Lv,{acl:"public-read",organizationId:t,value:n,onChange:()=>{const t=(0,Ju.A)(r,n);d(t),e.form.change("campaign.documents",t)}},n.key)),(0,i.jsx)(Lv,{acl:"public-read",label:o("fichier_personn_20046"),organizationId:t,value:null,onChange:n=>{const t=[...r,(0,_r.A)(n,"file")];d(t),e.form.change("campaign.documents",t)}})]})]}),(0,i.jsx)(dS,{hasCalendarInvite:e.values.campaign.hasCalendarInvite,prefix:"campaign."})]})},gS=[" ","@","ÂŁ","$","„","Ăš","Ă©","Ăč","ĂŹ","ĂČ","Ç","Ø","Ăž","Å","Ă„","Æ","ĂŠ","ß","É","!",'"',"#","€","%","&","'","(",")","*","+",",","-",".","/","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","Ă€","ö","ñ","ĂŒ","Ă "],hS=["^","{","}","\\","|","[","]","~","€","\n"],pS=gS.concat(hS);function IS(e,n){const t=n?145:160,i=Array.from(e??"").reduce((e,n)=>gS.includes(n)?e+1:hS.includes(n)?e+2:e,0);return i<=t?{numberOfCharacters:i,numberOfSms:1}:{numberOfCharacters:i,numberOfSms:Math.ceil(i/153)}}const xS=e=>(0,i.jsx)(Dl.D0,{name:e.name,render:n=>{const t=n.input.checked?"checked":"unchecked";return(0,i.jsx)(cm,{disabled:e.disabled,size:e.size,state:t,subtext:e.subtext,onClick:()=>{n.input.onChange(e.value)},children:e.children})},type:"radio",value:e.value}),fS=e=>{const n=Fi(),t=e.formRenderProps.values,{numberOfCharacters:s,numberOfSms:o}=IS(t.campaign.text,t.customSender);return(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Kj,{heading:n("voulez_vous_per_07528"),name:"customSender",role:"radiogroup",children:[(0,i.jsx)(xS,{name:"customSender",value:!1,children:n("non_je_souhait_47056")}),(0,i.jsxs)(Kj,{css:{"& > div":{gap:"$2"}},heading:n("custom_sender_90460"),hideHeading:!0,children:[(0,i.jsx)(xS,{name:"customSender",value:!0,children:n("oui_je_souhait_40974")}),e.formRenderProps.values.customSender&&(0,i.jsx)(Mr,{css:{paddingLeft:"$6"},children:(0,i.jsx)($c,{hint:n("doit_commencer_93759"),name:"campaign.sender",placeholder:n("_metteur_du_mes_17005")})})]})]}),(0,i.jsx)(rf,{hint:(0,i.jsx)(Mr,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:(0,i.jsxs)(Tl,{justify:"between",children:[(0,i.jsx)(Mr,{children:n("contenu_29668")}),(0,i.jsx)(Mr,{color:"gray500",children:n("_1_caract_re_04414",s,o)})]}),name:"campaign.text"})]})},_S=e=>{const n=Fi();return(0,i.jsx)(Kj,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},heading:n("contenu_29668"),hideHeading:!0,children:e.formRenderProps.values.campaign.campaignType===ve.Email?(0,i.jsx)(mS,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,customFields:e.customFields,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,form:e.formRenderProps.form,hasDuplicatedMembers:e.hasDuplicatedMembers,values:e.formRenderProps.values}):(0,i.jsx)(fS,{formRenderProps:e.formRenderProps})})},jS=e=>(0,i.jsx)(Ic,{direction:"column",formRenderProps:e.formRenderProps,render:e.render}),vS=e=>{const{translate:n}=Kl(),[t,s]=V.useState(!1),[o,a]=V.useState(0),r=ki(Ol),d=V.Children.toArray(e.children),[l,c]=V.useState(!1);return l?(0,i.jsx)(sf,{heading:n("r_capitulaif_76565"),children:e.summaryStep}):(0,i.jsx)(Dl.lV,{initialValues:e.initialValues,initialValuesEqual:Yr.A,mutators:{...Rl.A,forceErrors:pc},render:n=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Dl.Pc,{subscription:{dirtyFields:!0},children:({dirtyFields:e})=>Object.keys(e).map((e,n)=>(0,i.jsx)(Dl.D0,{name:e,render:()=>null,subscription:{}},n))}),d.map((r,d)=>{const l=o>=d||e.isEdit&&n.valid;if("string"==typeof r||"number"==typeof r||"boolean"==typeof r||!("props"in r))throw new Error("Invalid step passed to wizard");return(0,i.jsxs)(Ml.Provider,{value:{formRenderProps:n,showErrors:t,setShowErrors:s},children:[(0,i.jsx)(sf,{canSelect:l,footerActions:r.props.actions?.(n),headerStyle:tf.Dark,heading:r.props.heading,isCompleted:o>d,isOpen:o===d,stepNumber:d+1,onSelect:()=>{l&&(s(!1),a(d))},children:V.cloneElement(r,{formRenderProps:n})}),(0,i.jsx)(Pl,{height:"6"})]},d)})]}),validate:e=>r.validateForForm(d[o].props.schema)(e),onSubmit:async(n,t)=>{if(o===d.length-1){const i=await e.onSubmit(n,t);return i?(s(!0),e.containerRef&&e.containerRef.current&&(e.containerRef.current.scrollIntoView(),e.containerRef.current.scrollTop=0),i):void c(!0)}return s(!1),void a(o+1)}})},SS=e=>{const n=(0,V.useRef)(null),t=(0,V.useCallback)(e=>{e&&(n.current=e,setTimeout(()=>{e.style.right=Ar.space[6].value},100))},[]),s=(0,V.useCallback)(()=>{n.current.style.right="-400px",e.onClose()},[e.onClose]);return(0,St.createPortal)((0,i.jsxs)(Tl,{ref:t,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)(Tl,{align:"center",css:{color:"white"},justify:"center",children:(0,i.jsx)(Yl,{icon:"black"===e.color?"circle-exclamation":"error"===e.color?"circle-xmark":"circle-check",iconStyle:"solid"})}),(0,i.jsx)(Mr,{color:"white",css:{flex:"1","& a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:e.text},fontWeight:"medium"}),(0,i.jsx)(Tl,{align:"center",css:{color:"white",cursor:"pointer",fontSize:"$textMd"},height:32,justify:"center",width:32,onClick:s,children:(0,i.jsx)(Yl,{icon:"xmark"})})]}),document.body)},yS=2e3,CS=(0,V.createContext)({}),bS=e=>{const n=Fi(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)({color:"success",text:""}),r=(0,V.useCallback)(()=>{setTimeout(()=>{s(!1)},1200)},[s]),d=(0,V.useCallback)(e=>{s(!0),a("string"==typeof e?{text:e}:e),setTimeout(r,Oo.dw.fromObject({seconds:5}).toMillis())},[s,a,r]),{mutate:l}=function(e={}){return Ui("mutation AccreditationsImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n accreditationsImportResult(organizationId: $organizationId, eventId: $eventId, jobId: $jobId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),c=(0,V.useRef)(null),u=(0,V.useCallback)((e,t,i)=>{c.current=window.setInterval(async()=>{const{accreditationsImportResult:{state:s}}=await l({jobId:e,organizationId:t,eventId:i});s===de.Done&&(clearInterval(c.current),d({color:"success",text:n("votre_import_es_60265")}))},yS)},[]),{mutate:m}=function(e={}){return Ui("mutation AccreditationsProfilesImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n accreditationsProfilesImportResult(\n organizationId: $organizationId\n eventId: $eventId\n jobId: $jobId\n ) {\n state\n event {\n name\n }\n }\n}\n",e)}(),g=(0,V.useRef)(null),h=(0,V.useCallback)((e,t,i)=>{g.current=window.setInterval(async()=>{const{accreditationsProfilesImportResult:{state:s}}=await m({jobId:e,organizationId:t,eventId:i});s===de.Done&&(clearInterval(g.current),d({color:"success",text:n("votre_import_es_60265")}))},yS)},[]),{mutate:p}=function(e={}){return Ui("mutation DelegationsImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n delegationsImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),I=(0,V.useRef)(null),x=(0,V.useCallback)((e,t,i)=>{I.current=window.setInterval(async()=>{const{delegationsImportResult:{state:s,event:o}}=await p({jobId:e,organizationId:t,eventId:i});s===Re.Done&&(clearInterval(I.current),d({color:"success",text:n("votre_import_es_98992",o.name)}))},yS)},[]),{mutate:f}=function(e={}){return Ui("mutation EventDocumentsExportResult(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $jobId: JobId!\n) {\n eventDocumentsExportResult(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n jobId: $jobId\n ) {\n state\n url\n }\n}\n",e)}(),_=(0,V.useRef)(null),j=(0,V.useCallback)((e,t,i)=>{_.current=window.setInterval(async()=>{const{eventDocumentsExportResult:s}=await f({jobId:e,organizationId:t,eventId:i});s.state===Ye.Done&&(clearInterval(_.current),d({color:"success",text:n("l_export_de_vos_38257",s.url)}))},yS)},[]),{mutate:v}=function(e={}){return Ui("mutation EventsImportResult($jobId: JobId!, $organizationId: OrganizationId!) {\n eventsImportResult(jobId: $jobId, organizationId: $organizationId) {\n state\n }\n}\n",e)}(),S=(0,V.useRef)(null),y=(0,V.useCallback)((e,t)=>{S.current=window.setInterval(async()=>{const{eventsImportResult:{state:i}}=await v({jobId:e,organizationId:t});i===We.Done&&(clearInterval(S.current),d({color:"success",text:n("votre_import_es_60265")}))},yS)},[]),{mutate:C}=function(e={}){return Ui("mutation ExportResult($jobId: JobId!, $organizationId: OrganizationId!, $eventId: EventId) {\n exportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n url\n }\n}\n",e)}(),b=(0,V.useRef)(null),A=(0,V.useCallback)((e,t,i)=>{b.current=window.setInterval(async()=>{const{exportResult:s}=await C({jobId:e,organizationId:t,eventId:i});s.state===Ye.Done&&(clearInterval(b.current),d({color:"success",text:n("votre_export_es_96069",s.url)}))},yS)},[]),{mutate:E}=function(e={}){return Ui("mutation FilesImportResult($jobId: JobId!, $organizationId: OrganizationId!, $eventId: EventId) {\n filesImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),w=(0,V.useRef)(null),$=(0,V.useCallback)((e,t,i)=>{w.current=window.setInterval(async()=>{const{filesImportResult:{state:s,event:o}}=await E({jobId:e,organizationId:t,eventId:i});s===Je.Done&&(clearInterval(w.current),d({color:"success",text:o?n("votre_import_es_11791",o.name):n("votre_import_es_10672")}))},yS)},[]),{mutate:T}=function(e={}){return Ui("mutation PositionsImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n positionsImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),z=(0,V.useRef)(null),O=(0,V.useCallback)((e,t,i)=>{z.current=window.setInterval(async()=>{const{positionsImportResult:{state:s,event:o}}=await T({jobId:e,organizationId:t,eventId:i});s===yn.Done&&(clearInterval(z.current),d({color:"success",text:n("votre_import_es_11848",o.name)}))},yS)},[]),{mutate:R}=function(e={}){return Ui("mutation VolunteersImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n) {\n volunteersImportResult(\n jobId: $jobId\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n ) {\n state\n event {\n name\n }\n }\n}\n",e)}(),D=(0,V.useRef)(null),M=(0,V.useCallback)((e,t,i,s)=>{D.current=window.setInterval(async()=>{const{volunteersImportResult:{state:o,event:a}}=await R({jobId:e,organizationId:t,eventId:i,delegationId:s});o===st.Done&&(clearInterval(D.current),d({color:"success",text:a?n("votre_import_es_37822",a.name):n("votre_import_es_14145")}))},yS)},[]);return(0,i.jsx)(CS.Provider,{value:{checkAccreditationsImport:u,checkAccreditationsProfilesImport:h,checkDelegationsImport:x,checkDocumentsExport:j,checkEventsImport:y,checkExport:A,checkFilesImport:$,checkPositionsImport:O,checkVolunteersImport:M,showNotification:d},children:(0,i.jsxs)(i.Fragment,{children:[t&&(0,i.jsx)(SS,{color:o.color??"success",text:o.text,onClose:r}),e.children]})})};function AS(){return(0,V.useContext)(CS)}var ES=t(5526);const wS=/^[a-z][a-z0-9]{2,10}$/i;var $S;!function(e){e.Accreditations="accreditations",e.Everyone="everyone",e.Positions="positions",e.Segments="segments",e.States="states",e.Users="users"}($S||($S={}));let TS=class extends Rc{constructor(e){super(e)}createUpdateCampaignValuesDefault(e,n,t,i){const s=this.campaignInputDefault(e,n,t,i);return{campaign:s,recipients:s.sendToEveryone?$S.Everyone:Yo(s.states)?$S.States:Yo(s.segmentsIds)?$S.Segments:Yo(s.accreditationsCategoriesIds)||Yo(s.accreditationsIds)||Yo(s.accreditationsSlotsIds)?$S.Accreditations:Yo(s.positionsCategoriesIds)||Yo(s.positionsIds)||Yo(s.positionsSlotsIds)?$S.Positions:$S.Users,customSender:g(t?.sender),textOrHtml:g(t?.html)?"html":"text"}}campaignStep1Fields(){return{name:zc.Yj().required(this.t("le_nom_de_la_ca_63405")),campaignType:zc.Yj().required(this.t("le_type_de_camp_96559")).oneOf(Ot,this.t("le_type_de_camp_56467"))}}campaignStep1Schema(){return zc.Ik().shape({campaign:zc.Ik().shape({...this.campaignStep1Fields()})})}campaignStep2Fields(){const e=this;return{sender:zc.Yj().test("is-valid",this.t("l_metteur_ne_r_16421"),function(){return!g(this.parent.sender)||wS.test(this.parent.sender)}),text:zc.Yj().test("non-empty-text",this.t("le_contenu_est_45048"),function(){return g(this.parent.text)||g(this.parent.html)}).test("only-valid-characters","",function(){if(this.parent.campaignType===ve.Email)return!0;{const t=(n=this.parent.text,new Set(Array.from(n??"").filter(e=>!pS.includes(e))));return!(t.size>0)||this.createError({message:e.translationService.translate("les_caract_res_84839",Array.from(t).join(", "))})}var n}).test("max-length",this.t("le_contenu_ne_p_25416"),function(){return this.parent.campaignType===ve.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:zc.Yj().when("campaignType",{is:ve.Email,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),html:zc.Yj().test("non-empty-text",this.t(this.t("le_code_html_es_52280")),function(){return g(this.parent.text)||g(this.parent.html)}),replyTo:zc.Yj().email(this.t("l_adresse_de_r_53879")).test("clean-reply-to",this.t("l_adresse_de_r_53879"),function(){return Z_(this.parent.replyTo)}),documents:zc.YO().test("max-size",this.t("l_ensemble_des_32797"),function(){return this.parent.campaignType!==ve.Email||!Yo(this.parent.documents)||(0,ES.A)(this.parent.documents,e=>e.size)<2e7}),emailSenderId:zc.ai().nullable(),attachments:zc.YO().of(zc.Yj()),includeDuplicateMembersAttachments:zc.zM().required(),hasCalendarInvite:zc.zM().required(),calendarInviteName:zc.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:lf.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:zc.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:lf.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:zc.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})}}campaignStep2Schema(){return zc.Ik().shape({campaign:zc.Ik().shape({...this.campaignStep2Fields()})})}campaignStep3Fields(){const e=this,n=function(){return this.parent.state!==je.Draft&&this.parent.state!==je.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:zc.zM().required(this.t("requis_75853")),states:zc.YO().of(zc.Yj()).test("non-empty","",n),positionsCategoriesIds:zc.YO().of(zc.ai()).test("non-empty","",n),positionsIds:zc.YO().of(zc.ai()).test("non-empty","",n),positionsSlotsIds:zc.YO().of(zc.ai()).test("non-empty","",n),tagsIds:zc.YO().of(zc.ai()).test("non-empty","",n),accreditationsCategoriesIds:zc.YO().of(zc.ai()).test("non-empty","",n),accreditationsIds:zc.YO().of(zc.ai()).test("non-empty","",n),accreditationsSlotsIds:zc.YO().of(zc.ai()).test("non-empty","",n),usersInfosIds:zc.YO().of(zc.ai()).test("non-empty","",n),segmentsIds:zc.YO().of(zc.ai()).test("non-empty","",n)}}campaignStep3Schema(){return zc.Ik().shape({campaign:zc.Ik().shape({...this.campaignStep3Fields()})})}campaignStep4Fields(){return{scheduledAtDate:lf.when("scheduleType",{is:fe.Datetime,then:e=>e.required(this.t("la_date_d_envoi_17792")).typeError(this.t("la_date_d_envoi_17792"))}),scheduledAtTime:zc.Yj().when("scheduleType",{is:fe.Datetime,then:e=>e.required(this.t("l_heure_d_envoi_53643")).matches(/\d{2}:\d{2}/,this.t("l_heure_d_envoi_53643"))}),scheduleAnchor:zc.Yj().when("scheduleType",{is:fe.Anchor,then:e=>e.required(this.t("d_but_fin_est_r_67120")).oneOf($t,this.t("d_but_fin_est_r_67120"))}),scheduleOffsetDays:zc.ai().when("scheduleType",{is:fe.Anchor,then:e=>e.required(this.t("le_nombre_de_jo_27562")).min(0,this.t("le_nombre_de_jo_62798"))}),scheduleBeforeAfter:zc.Yj().when("scheduleType",{is:fe.Anchor,then:e=>e.required(this.t("avant_apr_s_est_31173")).oneOf(Tt,this.t("avant_apr_s_est_31173"))}),scheduleSendTime:zc.Yj().when("scheduleType",{is:fe.Anchor,then:e=>e.required(this.t("l_heure_d_envoi_53643")).matches(/\d{2}:\d{2}/,this.t("l_heure_d_envoi_53643"))})}}campaignStep4Schema(){return zc.Ik().shape({campaign:zc.Ik().shape({...this.campaignStep4Fields()})})}campaignInputSchema(){return zc.Ik().shape({...this.campaignStep1Fields(),...this.campaignStep2Fields(),...this.campaignStep3Fields(),...this.campaignStep4Fields()})}createUpdateCampaignSchema(){return zc.Ik().shape({campaign:this.campaignInputSchema()})}campaignInputDefault(e,n,t,i){let s=t?.segmentsIds??[],o=t?.usersInfosIds??[];if(g(i))try{const e=JSON.parse(a(i));e.segmentId&&(s=[e.segmentId]),Yo(e.usersInfosIds)&&(o=e.usersInfosIds)}catch{}const r=!Yo(s)&&!Yo(o)&&(t?.sendToEveryone??!1);return{name:t?.name??"",state:t?t.scheduleType!==fe.NoSchedule&&t.state===je.Draft?je.Scheduled:t.state:e?je.Template:je.Draft,campaignType:t?.campaignType??ve.Email,sender:t?.sender??"",text:t?.text??"",subject:t?.subject??"",html:t?.html??"",replyTo:t?.replyTo??"",sendToEveryone:r,states:t?.states??[],positionsCategoriesIds:t?.positionsCategoriesIds??[],positionsIds:t?.positionsIds??[],positionsSlotsIds:t?.positionsSlotsIds??[],tagsIds:t?.tagsIds??[],accreditationsCategoriesIds:t?.accreditationsCategoriesIds??[],accreditationsIds:t?.accreditationsIds??[],accreditationsSlotsIds:t?.accreditationsSlotsIds??[],usersInfosIds:o,segmentsIds:s,scheduledAtDate:t?.scheduledAt??void 0,scheduledAtTime:t?.scheduledAt?.toFormat("HH:mm")??void 0,documents:t?.documents??[],emailSenderId:t?.emailSenderId??n,attachments:t?.attachments??[],includeDuplicateMembersAttachments:t?.includeDuplicateMembersAttachments??!1,hasCalendarInvite:t?.hasCalendarInvite??!1,calendarInviteName:t?.calendarInviteName??null,calendarInviteStartDate:t?.calendarInviteStartDate??null,calendarInviteStartTime:t?.calendarInviteStartTime??null,calendarInviteEndDate:t?.calendarInviteEndDate??null,calendarInviteEndTime:t?.calendarInviteEndTime??null,scheduleType:t?.scheduleType??fe.NoSchedule,scheduleAnchor:t?.scheduleAnchor??Ie.EventStart,scheduleOffsetDays:t?.scheduleOffsetDays??0,scheduleBeforeAfter:t?.scheduleBeforeAfter??xe.Before,scheduleSendTime:t?.scheduleSendTime??"00:00"}}};function zS(e,n,t){if("positionCategoryId"in t){const i=e.usersPositionsCategories.some(e=>"ANY"===t.positionCategoryId?n===e.roleId:n===e.roleId&&e.positionCategoryId===t.positionCategoryId);if("positionId"in t){const s=e.usersPositions.some(e=>n===e.roleId&&e.positionId===t.positionId);return i||s}return i}return"delegationCategoryId"in t?e.usersDelegationsCategories.some(e=>"ANY"===t.delegationCategoryId?n===e.roleId:n===e.roleId&&e.delegationCategoryId===t.delegationCategoryId):"eventId"in t&&e.usersEvents.some(e=>"ANY"===t.eventId?n===e.roleId:n===e.roleId&&e.eventId===t.eventId)}function OS(e,n,t){const i=t?e.roles.filter(n=>"positionCategoryId"in t||"positionId"in t?n.accessLevel===Un.Position?zS(e,n.id,t):n.accessLevel===Un.Organization||n.accessLevel===Un.Event:"delegationCategoryId"in t?n.accessLevel===Un.DelegationCategory?zS(e,n.id,t):n.accessLevel===Un.Organization||n.accessLevel===Un.Event:"eventId"in t&&(n.accessLevel===Un.Event?zS(e,n.id,t):n.accessLevel===Un.Organization)):e.roles;return n.map(e=>i.some(n=>"1"===n.permissions[e]))}function RS(e,n){return e.roles.filter(e=>e.accessLevel===Un.Organization).some(e=>"1"===e.permissions[n])}TS=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],TS);const DS=V.createContext({}),MS=e=>{const{params:{eventId:n}}=Kl(),t=V.useMemo(()=>e.userPermissions.roles.some(e=>e.accessLevel===Un.Organization||e.accessLevel===Un.Event),[e.userPermissions]);return n?(0,i.jsx)(DS.Provider,{value:{hasEventRole:t,userPermissions:e.userPermissions,hasPermission:(n,t)=>function(e,n,t){return OS(e,[n],t)[0]}(e.userPermissions,n,t),hasPermissions:(n,t)=>OS(e.userPermissions,n,t)},children:e.children}):(0,i.jsx)(i.Fragment,{children:e.children})};function PS(){return V.useContext(DS)}var kS=t(5830);class FS extends kS.Ay{events;forms;organizations;segmentsFolders;constructor(){super("recrewteer"),this.version(6).stores({events:"id",forms:"id",organizations:"id",segmentsFolders:"id"})}}const NS=new FS;var LS=t(8923);const US=V.createContext({}),VS=e=>{const[n,t]=V.useState(e.numberOfWaitingAccreditations),[s,o]=V.useState(e.numberOfWaitingAssigments),[a,r]=V.useState(null),d=V.useCallback(async n=>{const t=(0,LS.A)(a,{id:e.event.id},n);await NS.events.put(t),r(t)},[e.event.id,a,r]),{hasEventRole:l,userPermissions:c,hasPermission:u,hasPermissions:m}=PS();return V.useEffect(()=>{(async()=>{let n;try{const t=await NS.events.get(e.event.id);n=t??{id:e.event.id},t||await NS.events.put(n)}catch{n={id:e.event.id}}r(n)})()},[e.event]),a?.id!==e.event.id?(0,i.jsx)(Ql,{}):(0,i.jsx)(US.Provider,{value:{hasEventRole:l,event:e.event,localEvent:a,numberOfWaitingAccreditations:n,numberOfWaitingAssigments:s,userPermissions:c,hasPermission:u,hasPermissions:m,setNumberOfWaitingAccreditations:t,setNumberOfWaitingAssigments:o,updateLocalEvent:d},children:e.children})};function BS(){return V.useContext(US)}function WS(e){return 1752===e}function GS(e){return 4060===e}const qS=(0,V.createContext)({});function HS(){return(0,V.useContext)(qS)}const YS=({children:e,termsAccepted:n})=>{const{organizationId:t}=Vi(),s=Bi();return n||window.location.pathname.includes(yo.ACCEPT_TERMS_AND_CONDITIONS(t))?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(qi,{path:yo.ACCEPT_TERMS_AND_CONDITIONS(t),state:s.location})},ZS=(0,V.createContext)({}),KS=e=>{const{history:n,params:{organizationId:t},translate:s}=Kl(),{data:o,loader:a,reload:r}=Li('query Organization($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n id\n name\n periodEndAt\n features\n customBadges\n isBlocked\n key\n weezeventOrganizationId\n\n invoices(state: Overdue) {\n invoiceNumber\n url\n insertedAt\n }\n\n events(whereUserIsLeader: true, sort: { attribute: StartAt, direction: Desc }) {\n nodes {\n id\n name\n state\n fields\n weezeventEventId\n }\n }\n\n roles {\n id\n accessLevel\n name\n type\n }\n }\n\n user {\n email\n language\n termsAcceptedAt\n\n roles(organizationId: $organizationId) {\n id\n accessLevel\n type\n permissions\n }\n\n userInfo(organizationId: $organizationId) {\n name\n firstName: fieldValue(slug: "firstName")\n intercomToken\n\n picture {\n url\n }\n }\n }\n}\n',{organizationId:t},[]),{update:d}=HS(),[l,c]=(0,V.useState)(),[m,g]=(0,V.useState)(null),h=(0,V.useCallback)(async e=>{const n=(0,Fl.A)(m,{id:t},e);await NS.organizations.put(n),g(n)},[t,m,g]),p=(0,V.useMemo)(()=>Yo(o.user?.roles??[]),[o.user]),I=(0,V.useMemo)(()=>(o.user?.roles??[]).some(e=>e.accessLevel===Un.Organization),[o.user]),x=(0,V.useMemo)(()=>o.organization?{organizationRoles:(0,Lm.A)(o.organization.roles.filter(e=>e.accessLevel===Un.Organization),e=>u(e.name)),eventRoles:(0,Lm.A)(o.organization.roles.filter(e=>e.accessLevel===Un.Event),e=>u(e.name)),delegationCategoryRoles:(0,Lm.A)(o.organization.roles.filter(e=>e.accessLevel===Un.DelegationCategory),e=>u(e.name)),positionRoles:(0,Lm.A)(o.organization.roles.filter(e=>e.accessLevel===Un.Position),e=>u(e.name))}:{organizationRoles:[],eventRoles:[],delegationCategoryRoles:[],positionRoles:[]},[o.organization]),f=(0,V.useCallback)(e=>!!o.organization&&function(e,n){return e.features.includes(n)}(o.organization,e),[o.organization]);return(0,V.useEffect)(()=>{o.organization&&(async()=>{let e=await NS.organizations.get(t);e||(e={id:t},await NS.organizations.put(e)),g(e)})()},[t,o.organization]),(0,V.useEffect)(()=>{d(o.user?.userInfo.intercomToken)},[o.user,d]),a||(a||o.organization?p?(0,i.jsx)(ZS.Provider,{value:{hasOrganizationRole:I,localOrganization:m,organization:o.organization,roles:x,selectedEventId:l,user:o.user,hasPermission:e=>RS(o.user,e),hasPermissions:e=>function(e,n){return n.map(n=>RS(e,n))}(o.user,e),hasFeature:f,reload:r,setSelectedEventId:c,updateLocalOrganization:h},children:(0,i.jsx)(YS,{termsAccepted:null!==o.user.termsAcceptedAt,children:e.children})}):(0,i.jsx)(dg,{size:"sm",onClose:Bc.A,children:(0,i.jsxs)(Tl,{align:"center",direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{children:s("vous_n_avez_pas_23261")}),(0,i.jsx)(tc,{color:"invisible",onClick:J,children:s("se_d_connecter_74151")})]})}):(setTimeout(()=>{n.replace(yo.HOME)},100),null))};function XS(){return(0,V.useContext)(ZS)}var QS=t(7431);const JS=()=>{const{translate:e}=Kl(),n=ki(Ig),[t,s]=(0,V.useState)(""),o=(0,V.useMemo)(()=>n.countries.filter(e=>"number"==typeof e.smsPrice),[n]),a=(0,V.useMemo)(()=>{if(g(t)){const e=u(t);return o.filter(n=>u(n.name).includes(e)||Ho(n.phoneCode).some(e=>e.includes(t)))}return o},[o,t]);return(0,i.jsxs)(xx,{children:[(0,i.jsx)(fx,{children:(0,i.jsx)(Mr,{color:"primary500",children:e("voir_la_liste_d_69122")})}),(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"message",children:e("liste_des_prix_58579")}),(0,i.jsxs)(hx,{css:{overflow:"auto"},direction:"column",gap:"3",height:300,children:[(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:"Rechercher un pays",state:"search",value:t,onChange:s}),(0,i.jsxs)(ym,{children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:e("Country")}),(0,i.jsx)(Gm,{children:e("indicatif_40634")}),(0,i.jsx)(Gm,{children:e("prix_ht_10965")})]}),a.map(e=>{return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:e.name}),(0,i.jsx)($m,{children:e.phoneCode}),(0,i.jsx)($m,{children:(0,QS.A)((n=e.smsPrice,n*(14/9)),3)})]},e.code);var n})]})]}),(0,i.jsx)(gx,{})]})]})},ey=e=>{const n=Fi(),{hasFeature:t}=XS(),s=t(Ze.Sms);return(0,i.jsxs)(Kj,{heading:e.isTemplate?n("initialisation_84842"):n("initialisation_48904"),hideHeading:!0,children:[(0,i.jsx)(Zr.Yr,{name:"campaign.campaignType",children:n=>{n===ve.Sms?s?(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html","")):e.formRenderProps.form.change("campaign.campaignType",ve.Email):(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html",""))}}),(0,i.jsx)($c,{label:e.isTemplate?n("nom_de_votre_mo_02364"):n("nom_de_votre_ca_08001"),name:"campaign.name"}),!e.isSent&&(0,i.jsxs)(Kj,{heading:e.isTemplate?n("quel_type_de_mo_32965"):n("quel_type_de_ca_11960"),name:"input.mode",role:"radiogroup",children:[(0,i.jsx)(xS,{name:"campaign.campaignType",value:ve.Email,children:n("e_mail_13869")}),(0,i.jsx)(xS,{disabled:!s,name:"campaign.campaignType",value:ve.Sms,children:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{children:"SMS"}),(0,i.jsx)(JS,{}),!s&&(0,i.jsx)(Mr,{color:"gray500",css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:n("contactez_nous_22980",F.EMAIL_FROM,F.EMAIL_FROM)},fontSize:"textXs"})]})})]})]})},ny=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(Dl.D0,{name:e,render:o=>{const a=_c(o.meta);return(0,i.jsx)(Up,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),ty=e=>{const{translate:n}=Kl(),{form:t,handleSubmit:s,values:o}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"campaign.scheduleType",children:e=>{t.change("campaign.state",e===fe.NoSchedule?je.Draft:je.Scheduled)}}),(0,i.jsx)(Mr,{color:"gray800",children:n("quand_voulez_vo_96615")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"campaign.scheduleType",value:fe.NoSchedule,children:n("je_souahite_l_e_46027")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"campaign.scheduleType",value:fe.Datetime,children:n("je_souhaite_pro_98854")}),o.campaign.scheduleType===fe.Datetime&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Qx,{min:Oo.c9.local(),name:"campaign.scheduledAtDate",placeholder:n("choisissez_la_d_30578")}),(0,i.jsx)(rS,{hint:n("le_fuseau_horai_57116",e.timeZone),name:"campaign.scheduledAtTime",placeholder:n("choisissez_l_he_55311")})]})]}),"event"===e.campaignType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"campaign.scheduleType",value:fe.Anchor,children:n("je_souhaite_pro_99169")})]}),o.campaign.scheduleType===fe.Anchor&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{width:80,children:(0,i.jsx)($c,{min:0,name:"campaign.scheduleOffsetDays",shouldParseAsInt:!0})}),(0,i.jsx)(Mr,{children:n("jour_s_06841")}),(0,i.jsx)(Mr,{children:(0,i.jsxs)(ny,{name:"campaign.scheduleBeforeAfter",children:[(0,i.jsx)("option",{value:xe.Before,children:n("avant_91154")}),(0,i.jsx)("option",{value:xe.After,children:n("apr_s_53238")})]})}),(0,i.jsx)(Mr,{children:n("le_95402")}),(0,i.jsx)(Mr,{children:(0,i.jsxs)(ny,{name:"campaign.scheduleAnchor",children:[(0,i.jsx)("option",{value:Ie.EventStart,children:n("d_but_63192")}),(0,i.jsx)("option",{value:Ie.EventEnd,children:n("fin_33487")})]})}),(0,i.jsx)(Mr,{children:n("de_l_v_nement_01521")}),(0,i.jsx)(Mr,{children:(0,i.jsx)(rS,{name:"campaign.scheduleSendTime"})})]})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:s,children:n("suivant_r_cap_22677")})})]})},iy=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),[o,a]=(0,V.useState)(null),{mutate:r}=function(e={}){return Ui("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:d,handleSubmit:l,submitting:c,values:u}=e.formRenderProps,m=(0,V.useMemo)(()=>{if(e.formRenderProps.values.campaign.campaignType===ve.Email){const n=e.emailsSenders.find(n=>n.id===e.formRenderProps.values.campaign.emailSenderId);return n&&!n.isValidToSendEmail}return!1},[e.emailsSenders,e.formRenderProps.values.campaign.emailSenderId]);return(0,V.useEffect)(()=>{r({organizationId:t,eventId:s,campaign:e.formRenderProps.values.campaign}).then(e=>{a(e.campaignEstimate)})},[]),o?(0,i.jsxs)(i.Fragment,{children:[m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{alertStyle:"error",children:(0,i.jsx)(uc,{children:n("vous_ne_pouvez_33410")})}),(0,i.jsx)(Pl,{height:"4"})]}),(0,i.jsxs)(Tl,{gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("nombre_de_desti_22505")}),(0,i.jsx)(Mr,{color:"gray800",children:n("_1_membre_49737",o.numberOfRecipients)})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsxs)(Tl,{gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("prix_total_03054")}),(0,i.jsx)(Mr,{color:"gray800",children:0===o.price?n("gratuit_13712"):`${o.price}€`})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(tc,{disabled:m,isLoading:c,onClick:()=>{u.campaign.state!==je.Scheduled&&d.change("campaign.state",je.InProgress),l()},children:u.campaign.state===je.Scheduled?n("programmer_la_c_01938"):e.isEdit?n("mettre_jour_l_63945"):n("cr_er_et_envoye_81501")}),(0,i.jsx)(tc,{color:"white",isLoading:c,onClick:()=>{d.change("campaign.state",je.Draft),l()},children:n("enregistrer_en_81222")})]})]}):(0,i.jsx)(Ql,{})};var sy;function oy(){const{hasFeature:e,hasPermission:n}=XS(),{event:t,hasPermission:i}=BS();return(0,V.useMemo)(()=>{const s=e=>n(e)||(i?.(e)??!1),o=e(Ze.Accreditation)&&(t?.useAccreditations??!1),a=t?.useCampaigns??!0,r=e(Ze.Delegation)&&(t?.useDelegations??!0),d=(e(Ze.Documents)||e(Ze.CustomDocument))&&(t?.useDocuments??!1),l=t?.useForms??!0,c=t?.usePositions??!1,u=e(Ze.Weezevent)&&(t?.isWeezeventSynchronized??!1),m=t?.useWorkflows??!0;return{canAccreditationEdit:o&&s(sy.ACCREDITATION_EDIT),canAccreditationRead:o&&s(sy.ACCREDITATION_READ),canCampaignRead:a&&s(sy.CAMPAIGN_READ),canCampaignSend:a&&s(sy.CAMPAIGN_SEND),canCommentAdd:s(sy.COMMENT_ADD),canCommentRead:s(sy.COMMENT_READ),canCustomFieldEdit:s(sy.CUSTOM_FIELD_EDIT),canCustomFieldRead:s(sy.CUSTOM_FIELD_READ),canCustomFieldDecrypt:s(sy.CUSTOM_FIELD_DECRYPT),canDelegationEdit:r&&s(sy.DELEGATION_EDIT),canDelegationRead:r&&s(sy.DELEGATION_READ),canDelegationsSpaceParamRead:r&&s(sy.DELEGATIONS_SPACE_PARAM_READ),canDelegationsSpaceParamEdit:r&&s(sy.DELEGATIONS_SPACE_PARAM_EDIT),canDocumentEdit:d&&s(sy.DOCUMENT_EDIT),canDocumentRead:d&&s(sy.DOCUMENT_READ),canEmailEdit:s(sy.EMAIL_EDIT),canEventEdit:s(sy.EVENT_EDIT),canFormEdit:l&&s(sy.FORM_EDIT),canFormRead:l&&s(sy.FORM_READ),canMemberAccredit:o&&s(sy.MEMBER_ACCREDIT),canMemberAssign:c&&s(sy.MEMBER_ASSIGN),canMemberAssignmentStateEdit:c&&s(sy.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:s(sy.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:s(sy.MEMBER_CREATE),canMemberDelete:s(sy.MEMBER_DELETE),canMemberEdit:s(sy.MEMBER_EDIT),canOrganizationParamEdit:s(sy.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:s(sy.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:s(sy.ORGANIZATION_USER_EDIT),canOrganizationUserRead:s(sy.ORGANIZATION_USER_READ),canPositionEdit:c&&s(sy.POSITION_EDIT),canPositionRead:c&&s(sy.POSITION_READ),canPrint:s(sy.PRINT),canPrintConfigEdit:s(sy.PRINT_CONFIG_EDIT),canPrintConfigRead:s(sy.PRINT_CONFIG_READ),canSegmentEdit:s(sy.SEGMENT_EDIT),canTicketIdRegenerate:s(sy.TICKET_ID_REGENERATE),canWeezeventEdit:u&&s(sy.WEEZEVENT_EDIT),canWeezeventRead:u&&s(sy.WEEZEVENT_READ),canWorkflowEdit:m&&s(sy.WORKFLOW_EDIT),canWorkflowRead:m&&s(sy.WORKFLOW_READ)}},[e,t,n,i])}function ay(){const{hasFeature:e,hasPermission:n}=XS();return(0,V.useMemo)(()=>{const t=e(Ze.Accreditation),i=e(Ze.Delegation),s=e(Ze.CustomDocument),o=e(Ze.Weezevent);return{canAccreditationEdit:t&&n(sy.ACCREDITATION_EDIT),canAccreditationRead:t&&n(sy.ACCREDITATION_READ),canCampaignRead:n(sy.CAMPAIGN_READ),canCampaignSend:n(sy.CAMPAIGN_SEND),canCommentAdd:n(sy.COMMENT_ADD),canCommentRead:n(sy.COMMENT_READ),canCustomFieldEdit:n(sy.CUSTOM_FIELD_EDIT),canCustomFieldRead:n(sy.CUSTOM_FIELD_READ),canCustomFieldDecrypt:n(sy.CUSTOM_FIELD_DECRYPT),canDelegationEdit:i&&n(sy.DELEGATION_EDIT),canDelegationRead:i&&n(sy.DELEGATION_READ),canDelegationsSpaceParamRead:i&&n(sy.DELEGATIONS_SPACE_PARAM_READ),canDelegationsSpaceParamEdit:i&&n(sy.DELEGATIONS_SPACE_PARAM_EDIT),canDocumentEdit:s&&n(sy.DOCUMENT_EDIT),canDocumentRead:s&&n(sy.DOCUMENT_READ),canEmailEdit:n(sy.EMAIL_EDIT),canEventEdit:n(sy.EVENT_EDIT),canFormEdit:n(sy.FORM_EDIT),canFormRead:n(sy.FORM_READ),canMemberAccredit:n(sy.MEMBER_ACCREDIT),canMemberAssign:n(sy.MEMBER_ASSIGN),canMemberAssignmentStateEdit:n(sy.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:n(sy.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:n(sy.MEMBER_CREATE),canMemberDelete:n(sy.MEMBER_DELETE),canMemberEdit:n(sy.MEMBER_EDIT),canOrganizationParamEdit:n(sy.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:n(sy.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:n(sy.ORGANIZATION_USER_EDIT),canOrganizationUserRead:n(sy.ORGANIZATION_USER_READ),canPositionEdit:n(sy.POSITION_EDIT),canPositionRead:n(sy.POSITION_READ),canPrint:n(sy.PRINT),canPrintConfigEdit:n(sy.PRINT_CONFIG_EDIT),canPrintConfigRead:n(sy.PRINT_CONFIG_READ),canSegmentEdit:n(sy.SEGMENT_EDIT),canTicketIdRegenerate:n(sy.TICKET_ID_REGENERATE),canWeezeventEdit:o&&n(sy.WEEZEVENT_EDIT),canWeezeventRead:o&&n(sy.WEEZEVENT_READ),canWorkflowEdit:n(sy.WORKFLOW_EDIT),canWorkflowRead:n(sy.WORKFLOW_READ)}},[e,n])}function ry(){const{eventId:e}=Vi(),{canCustomFieldEdit:n}=ay(),{canCustomFieldEdit:t}=oy();return(0,V.useCallback)(i=>n||!!i.eventId&&i.eventId===e&&t,[n,t,e])}!function(e){e[e.POSITION_READ=0]="POSITION_READ",e[e.POSITION_EDIT=1]="POSITION_EDIT",e[e.MEMBER_EDIT=2]="MEMBER_EDIT",e[e.MEMBER_ASSIGNMENT_STATE_EDIT=3]="MEMBER_ASSIGNMENT_STATE_EDIT",e[e.COMMENT_READ=4]="COMMENT_READ",e[e.COMMENT_ADD=5]="COMMENT_ADD",e[e.MEMBER_AVAILABILITIES_EDIT=6]="MEMBER_AVAILABILITIES_EDIT",e[e.MEMBER_ASSIGN=7]="MEMBER_ASSIGN",e[e.CAMPAIGN_SEND=8]="CAMPAIGN_SEND",e[e.ACCREDITATION_READ=9]="ACCREDITATION_READ",e[e.ACCREDITATION_EDIT=10]="ACCREDITATION_EDIT",e[e.MEMBER_ACCREDIT=11]="MEMBER_ACCREDIT",e[e.DELEGATION_READ=12]="DELEGATION_READ",e[e.DELEGATION_EDIT=13]="DELEGATION_EDIT",e[e.FORM_READ=14]="FORM_READ",e[e.FORM_EDIT=15]="FORM_EDIT",e[e.EMAIL_EDIT=16]="EMAIL_EDIT",e[e.CAMPAIGN_READ=17]="CAMPAIGN_READ",e[e.DOCUMENT_READ=18]="DOCUMENT_READ",e[e.DOCUMENT_EDIT=19]="DOCUMENT_EDIT",e[e.WORKFLOW_READ=20]="WORKFLOW_READ",e[e.WORKFLOW_EDIT=21]="WORKFLOW_EDIT",e[e.CUSTOM_FIELD_READ=22]="CUSTOM_FIELD_READ",e[e.CUSTOM_FIELD_EDIT=23]="CUSTOM_FIELD_EDIT",e[e.SEGMENT_EDIT=24]="SEGMENT_EDIT",e[e.MEMBER_CREATE=25]="MEMBER_CREATE",e[e.MEMBER_DELETE=26]="MEMBER_DELETE",e[e.EVENT_EDIT=27]="EVENT_EDIT",e[e.ORGANIZATION_PARAM_READ=28]="ORGANIZATION_PARAM_READ",e[e.ORGANIZATION_PARAM_EDIT=29]="ORGANIZATION_PARAM_EDIT",e[e.ORGANIZATION_USER_READ=30]="ORGANIZATION_USER_READ",e[e.ORGANIZATION_USER_EDIT=31]="ORGANIZATION_USER_EDIT",e[e.CUSTOM_FIELD_DECRYPT=32]="CUSTOM_FIELD_DECRYPT",e[e.WEEZEVENT_READ=33]="WEEZEVENT_READ",e[e.WEEZEVENT_EDIT=34]="WEEZEVENT_EDIT",e[e.DELEGATIONS_SPACE_PARAM_READ=35]="DELEGATIONS_SPACE_PARAM_READ",e[e.DELEGATIONS_SPACE_PARAM_EDIT=36]="DELEGATIONS_SPACE_PARAM_EDIT",e[e.PRINT_CONFIG_READ=37]="PRINT_CONFIG_READ",e[e.PRINT_CONFIG_EDIT=38]="PRINT_CONFIG_EDIT",e[e.PRINT=39]="PRINT",e[e.TICKET_ID_REGENERATE=40]="TICKET_ID_REGENERATE"}(sy||(sy={}));const dy=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Jm),[o,a]=(0,V.useState)(!0),[r,d]=(0,V.useState)(!0),[l,c]=(0,V.useState)([]),[u,m]=(0,V.useState)([]),[g,h]=(0,V.useState)(!1),[p,I]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if("accreditations"===e.recipients&&o){const e=await(n={eventId:t},i=await X(),oa("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:n,token:i||void 0,fragments:[]}));c((0,Lm.A)(e.event.accreditationsCategories,e=>e.name)),m(Object.entries((0,fm.A)(e.event.accreditations.nodes,e=>e.accreditationCategoryName))),h(Yo(e.event.accreditations.nodes.flatMap(e=>e.slots))),I(e.event.accreditations.nodes.map(e=>{const n=e.slots.map(n=>{const t=n.date?s.toLocaleString(n.date,Uo.DateOnly.MonthLong):"",i=n.date?`${n.name} - ${t} - ${e.name}`:`${n.name} - ${e.name}`;return{id:n.id,name:i}});return[e.name,n]})),a(!1),d(!1)}var n,i})()},[e.recipients,o]),e.recipients===$S.Accreditations?(0,i.jsx)(Tl,{css:{marginLeft:"$2"},direction:"column",gap:"2",children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsCategoriesIds",placeholder:n("ajouter_des_cat_17200"),children:l.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsIds",placeholder:n("ajouter_des_acc_26514"),children:u.map(([e,n],t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t))}),g&&(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsSlotsIds",placeholder:n("ajouter_des_cr_25566"),children:p.map(([e,n],t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t))})]})}):null},ly=e=>{const n=XS(),t=BS(),s=V.useMemo(()=>(n?.user?.roles.map(e=>e.type)||[]).concat(t?.userPermissions?.roles.map(e=>e.type)||[]),[n,t]);return V.useMemo(()=>"function"==typeof t?.hasPermissions&&Yo(Ho(e.permissions))?t.hasPermissions(Ho(e.permissions),e.scope).some(e=>e):!!Yo(Ho(e.permissions))&&n.hasPermissions(Ho(e.permissions)).some(e=>e),[e.permissions,e.scope,s,t])?(0,i.jsx)(i.Fragment,{children:e.children}):null},cy=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Bg),{hasEventRole:a}=BS(),[r,d]=(0,V.useState)(!0),[l,c]=(0,V.useState)(!0),[u,m]=(0,V.useState)([]),[h,p]=(0,V.useState)([]),[I,x]=(0,V.useState)([]),[f,_]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if("positions"===e.recipients&&r){const e=await(n={organizationId:t,eventId:s},i=await X(),oa("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:n,token:i||void 0,fragments:[]}));m((0,Lm.A)(e.event.positionsCategories,e=>e.name)),p(Object.entries((0,fm.A)(e.event.positions.nodes,e=>e.positionCategoryName))),x(e.event.positions.nodes.map(e=>{const n=e.slots.map(n=>{const t=g(n.name)?`${n.name} - `:"",i=o.toDisplayString(n.range,{formats:{displayWeekday:!0}});return{id:n.id,name:`${t}${i} - ${e.name}`}});return[e.name,n]})),_(e.organization.tags.nodes),d(!1),c(!1)}var n,i})()},[e.recipients,r]),e.recipients===$S.Positions?(0,i.jsx)(Tl,{css:{marginLeft:"$6"},direction:"column",gap:"2",children:l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ly,{permissions:sy.CAMPAIGN_SEND,scope:{positionCategoryId:"ANY"},children:(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsCategoriesIds",placeholder:n("ajouter_des_cat_15537"),children:u.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})}),(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsIds",placeholder:n("ajouter_des_mis_44522"),children:h.map(([e,n],t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t))}),(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsSlotsIds",placeholder:n("ajouter_des_cr_25566"),children:I.map(([e,n],t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t))}),a&&(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.tagsIds",placeholder:n("ajouter_des_tag_57392"),children:f.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]})}):null},uy=e=>{const{translate:n,params:{eventId:t}}=Kl(),[s,o]=(0,V.useState)(!0),[a,r]=(0,V.useState)(!0),[d,l]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await(n={eventId:t},i=await X(),oa("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:n,token:i||void 0,fragments:[]}));l(e.event.segmentsFolders),o(!1),r(!1)}var n,i})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsx)(Mr,{css:{marginLeft:"$6"},children:a?(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:n("ajouter_des_vue_58990"),children:d.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 my({eventId:e,hasSelected:n,includePhone:t,nameDebounced:s,organizationId:o,populationsIds:a,reloadKey:r,userInfoIds:d}){const[l,c]=V.useState(!1),[m,h]=V.useState(null),p=V.useMemo(()=>(0,Lm.A)((0,Rg.A)((m?.usersInfos.nodes??[]).concat(m?.selectedUsersInfos?.nodes??[]),e=>e.id),e=>u(e.name)),[m]),I=V.useMemo(()=>p.map(e=>(0,i.jsxs)("option",{value:e.id,children:[g(e.name)?e.name:"-"," (",t?e.phone?.internationalFormat||"-":e.email,")"]},e.id)),[p]);return V.useEffect(()=>{(async()=>{c(!0);const{organization:i}=await(r={organizationId:o,eventId:e,hasSelected:n,includePhone:t||!1,userInfoIds:d,name:g(s)?s:void 0,populationsIds:a},l=await X(),oa('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:r,token:l||void 0,fragments:[]}));var r,l;h(i),c(!1)})()},[o,e,t,s,a,r]),{usersInfos:p,usersInfosOptions:I,isLoading:l}}const gy=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl(),[o,a,r]=Wm(""),{usersInfosOptions:d,isLoading:l}=my({organizationId:n,eventId:t,includePhone:e.campaignType===ve.Sms,hasSelected:Yo(e.usersInfosIds),nameDebounced:a,userInfoIds:e.usersInfosIds});return"users"===e.recipients?(0,i.jsx)(Mr,{css:{marginLeft:"$6"},children:(0,i.jsx)(of,{isSearchLoading:l,isSearchVisible:!0,multiple:!0,name:"campaign.usersInfosIds",placeholder:s("ajouter_des_mem_58427"),searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",name:o,placeholder:s("rechercher_un_m_05904"),state:"search",onChange:r}),children:d})}):null},hy=e=>{const{translate:n}=Kl(),{event:t,hasEventRole:s,hasPermission:o}=BS(),{canAccreditationRead:a}=oy(),{form:r,values:d}=e.formRenderProps,l=t.usePositions,c=a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.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)(Zr.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)(Zr.Yr,{name:"campaign.positionsCategoriesIds",children:()=>{d.campaign.sendToEveryone&&d.campaign.positionsCategoriesIds.length>0&&r.change("campaign.positionsCategoriesIds",[])}}),(0,i.jsx)(Zr.Yr,{name:"campaign.positionsIds",children:()=>{d.campaign.sendToEveryone&&d.campaign.positionsIds.length>0&&r.change("campaign.positionsIds",[])}}),(0,i.jsx)(Zr.Yr,{name:"campaign.positionsSlotsIds",children:()=>{d.campaign.sendToEveryone&&d.campaign.positionsSlotsIds.length>0&&r.change("campaign.positionsSlotsIds",[])}}),(0,i.jsx)(Zr.Yr,{name:"campaign.tagsIds",children:()=>{d.campaign.sendToEveryone&&d.campaign.tagsIds.length>0&&r.change("campaign.tagsIds",[])}}),(0,i.jsx)(Zr.Yr,{name:"campaign.usersInfosIds",children:()=>{d.campaign.sendToEveryone&&d.campaign.usersInfosIds.length>0&&r.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Zr.Yr,{name:"campaign.segmentsIds",children:()=>{d.campaign.sendToEveryone&&d.campaign.segmentsIds.length>0&&r.change("campaign.segmentsIds",[])}}),(0,i.jsxs)(Kj,{heading:n("_qui_voulez_vo_96064"),name:"recipients",role:"radiogroup",children:[o(sy.CAMPAIGN_SEND,{eventId:t.id})&&l&&(0,i.jsx)(xS,{name:"recipients",value:"everyone",children:n("_tous_vos_memb_31761")}),o(sy.CAMPAIGN_SEND,{eventId:t.id})&&l&&(0,i.jsxs)(Kj,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_m_11119"),hideHeading:!0,children:[(0,i.jsx)(xS,{name:"recipients",value:"states",children:n("_certains_memb_35722")}),"states"===d.recipients&&(0,i.jsx)(Mr,{css:{marginLeft:"$6"},children:(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.states",placeholder:n("ajouter_des_sta_70922"),children:vi.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))})})]}),l&&(0,i.jsxs)(Kj,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_c_37426"),hideHeading:!0,children:[(0,i.jsx)(xS,{name:"recipients",value:"positions",children:s?n("_certaines_cat_59188"):o(sy.CAMPAIGN_SEND,{positionCategoryId:"ANY"})?n("_certaines_cat_22161"):n("_certaines_mis_80674")}),(0,i.jsx)(cy,{recipients:d.recipients})]}),c&&(0,i.jsxs)(Kj,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_c_03754"),hideHeading:!0,children:[(0,i.jsx)(xS,{name:"recipients",value:"accreditations",children:n("_certaines_cat_14293")}),(0,i.jsx)(dy,{recipients:d.recipients})]}),(0,i.jsxs)(Kj,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_m_11119"),hideHeading:!0,children:[(0,i.jsx)(xS,{name:"recipients",value:"users",children:n("_certains_memb_91094")}),(0,i.jsx)(gy,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:d.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds})]}),(0,i.jsxs)(Kj,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_v_99730"),hideHeading:!0,children:[(0,i.jsx)(xS,{name:"recipients",value:"segments",children:n("_certaines_vue_55512")}),(0,i.jsx)(uy,{recipients:d.recipients})]})]})]})},py=e=>{const{translate:n,params:{organizationId:t}}=Kl(),[s,o]=(0,V.useState)(!0),[a,r]=(0,V.useState)(!0),[d,l]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await(n={organizationId:t},i=await X(),oa("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:n,token:i||void 0,fragments:[]}));l(e.organization.segmentsFolders),o(!1),r(!1)}var n,i})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsx)(Mr,{css:{marginLeft:"$6"},children:a?(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:n("ajouter_des_vue_58990"),children:d.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},Iy=e=>{const n=Fi(),{form:t,values:s}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"recipients",children:e=>{if("everyone"===e)t.change("campaign.sendToEveryone",!0),t.change("campaign.usersInfosIds",[]),t.change("campaign.segmentsIds",[]);else if("users"===e)t.change("campaign.sendToEveryone",!1),t.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);t.change("campaign.sendToEveryone",!1),t.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Zr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(t.change("campaign.segmentsIds",[]),t.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Zr.Yr,{name:"campaign.usersInfosIds",children:()=>{s.campaign.sendToEveryone&&s.campaign.usersInfosIds.length>0&&t.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Zr.Yr,{name:"campaign.segmentsIds",children:()=>{s.campaign.sendToEveryone&&s.campaign.segmentsIds.length>0&&t.change("campaign.segmentsIds",[])}}),(0,i.jsxs)(Kj,{heading:n("_qui_voulez_vo_96064"),name:"recipients",role:"radiogroup",children:[(0,i.jsx)(xS,{name:"recipients",value:"everyone",children:n("_tous_vos_memb_83616")}),(0,i.jsxs)(Kj,{css:{"& > div":{gap:"$2"}},heading:"",hideHeading:!0,children:[(0,i.jsx)(xS,{name:"recipients",value:"users",children:n("_certains_memb_91094")}),(0,i.jsx)(gy,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:s.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds})]}),(0,i.jsxs)(Kj,{css:{"& > div":{gap:"$2"}},heading:"",hideHeading:!0,children:[(0,i.jsx)(xS,{name:"recipients",value:"segments",children:n("_certaines_vue_55512")}),(0,i.jsx)(py,{recipients:s.recipients})]})]})]})},xy=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),{showNotification:a}=AS(),r=ki(TS),d=e.initialValues.campaign.state===je.Template,l=(0,V.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.campaign.name):o(d?"cr_ation_d_un_m_50096":"cr_ation_d_une_80936"),[e.isEdit,e.initialValues,d]);Au(l);const c=[je.Done,je.InProgress].includes(e.initialValues.campaign.state),u=Gj.CAMPAIGNS({organizationId:t,eventId:s}),m=(0,V.useRef)(null);return(0,i.jsx)(Am.Provider,{value:{designSystem:bm},children:(0,i.jsx)(Hx,{category:l,fallbackClosePath:u,heading:e.isEdit?e.initialValues.campaign.name:o(d?"nouveau_mod_le_74336":"nouvelle_campag_28814"),children:(0,i.jsx)(Gx,{ref:m,children:(0,i.jsxs)(vS,{containerRef:m,initialValues:e.initialValues,isEdit:e.isEdit,onSubmit:async t=>{await e.mutate(t.campaign),a(e.isEdit?o("la_campagne_a_50262"):o("la_campagne_a_02968")),n.goBack(u)},children:[(0,i.jsx)(jS,{heading:o(d?"initialisation_84842":"initialisation_48904"),render:e=>(0,i.jsxs)(Tl,{direction:"column",gap:"7",children:[(0,i.jsx)(ey,{formRenderProps:e,isSent:c,isTemplate:d}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:e.handleSubmit,children:o(d?"suivant_conte_33443":"suivant_conte_90603")})})]}),schema:r.campaignStep1Schema()}),(0,i.jsx)(jS,{heading:o("contenu_29668"),render:n=>(0,i.jsxs)(Tl,{direction:"column",gap:"7",children:[(0,i.jsx)(_S,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,customFields:e.customFields,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,formRenderProps:n,hasDuplicatedMembers:e.hasDuplicatedMembers,isSent:c,isTemplate:d}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:n.submitting,onClick:n.handleSubmit,children:d?e.isEdit?o("mettre_jour_l_13576"):o("cr_er_le_mod_le_06346"):o(c?"mettre_jour_l_32694":"suivant_desti_10756")})})]}),schema:r.campaignStep2Schema()}),!d&&!c&&(0,i.jsx)(jS,{heading:o("destinataires_19592"),render:n=>(0,i.jsxs)(Tl,{direction:"column",gap:"7",children:["event"===e.campaignType?(0,i.jsx)(hy,{formRenderProps:n}):(0,i.jsx)(Iy,{formRenderProps:n}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:n.handleSubmit,children:o("suivant_livra_97068")})})]}),schema:r.campaignStep3Schema()}),!d&&!c&&(0,i.jsx)(jS,{heading:o("livraison_86944"),render:n=>(0,i.jsx)(ty,{campaignType:e.campaignType,formRenderProps:n,timeZone:e.timeZone}),schema:r.campaignStep4Schema()}),!d&&!c&&(0,i.jsx)(jS,{heading:o("r_capitulatif_a_79107"),render:n=>(0,i.jsx)(iy,{emailsSenders:e.emailsSenders,formRenderProps:n,isEdit:e.isEdit}),schema:r.createUpdateCampaignSchema()})]})})})})},fy=e=>{const{organizationId:n,eventId:t,options:s}=Vi(),o=ki(TS),{data:a,loader:r}=ya({organizationId:n,eventId:t}),{mutate:d}=va(),{event:l}=BS();return r||(0,i.jsx)(xy,{campaignType:t?"event":"organization",canCustomDocuments:l?.useDocuments??!1,customDocuments:a.organization?.event?.customDocuments??[],customFields:a.organization.customFields.nodes,emailSenderId:a.organization?.event?.emailSender?.id??a.organization.emailSenderId,emailsSenders:a.organization.emailsSenders,hasDuplicatedMembers:a.organization?.event?.hasDuplicatedMembers??!1,initialValues:o.createUpdateCampaignValuesDefault(e.isTemplate,a.organization.emailSenderId,null,s),isEdit:!1,mutate:async e=>{const{campaignCreate:{id:i}}=await d({organizationId:n,eventId:t,campaign:e});return i},timeZone:a.organization?.event?.timeZone??a.organization.timeZone})},_y=()=>{const{organizationId:e,eventId:n,campaignId:t}=Vi(),{data:s,loader:o}=Li("query CampaignEventToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $campaignId: CampaignId!\n) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n }\n\n event(id: $eventId) {\n hasDuplicatedMembers\n timeZone\n\n campaign(id: $campaignId) {\n ...CampaignEdit\n }\n\n customDocuments {\n slug\n name\n }\n\n emailSender {\n ... on EmailsSender {\n id\n }\n }\n }\n}\n",{organizationId:e,eventId:n,campaignId:t},[$o.CustomFieldFragment,$o.CreateCampaignEmailSenderFragment,$o.CampaignEditFragment]),a=ki(TS),{mutate:r}=Sa(),{event:d}=BS();return o||(0,i.jsx)(xy,{campaignType:"event",canCustomDocuments:d.useDocuments,customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,emailSenderId:s.event.emailSender?.id,emailsSenders:s.organization.emailsSenders,hasDuplicatedMembers:s.event.hasDuplicatedMembers,initialValues:a.createUpdateCampaignValuesDefault(!1,s.event.emailSender?.id,s.event.campaign,null),isEdit:!0,mutate:async i=>{const{campaignUpdate:{id:s}}=await r({organizationId:e,eventId:n,campaignId:t,campaign:i});return s},timeZone:s.event.timeZone})},jy=()=>{const{organizationId:e,campaignId:n}=Vi(),{data:t,loader:s}=Li("query CampaignOrganizationToEdit($organizationId: OrganizationId!, $campaignId: CampaignId!) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n campaign(id: $campaignId) {\n ...CampaignEdit\n }\n\n customFields(\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n }\n}\n",{organizationId:e,campaignId:n},[$o.CampaignEditFragment,$o.CustomFieldFragment,$o.CreateCampaignEmailSenderFragment]),o=ki(TS),{mutate:a}=Sa();return s||(0,i.jsx)(xy,{campaignType:"organization",canCustomDocuments:!1,customDocuments:[],customFields:t.organization.customFields.nodes,emailSenderId:t.organization.emailSenderId,emailsSenders:t.organization.emailsSenders,hasDuplicatedMembers:!1,initialValues:o.createUpdateCampaignValuesDefault(!1,t.organization.emailSenderId,t.organization.campaign,null),isEdit:!0,mutate:async t=>{const{campaignUpdate:{id:i}}=await a({organizationId:e,campaignId:n,campaign:t});return i},timeZone:t.organization.timeZone})},vy=({children:e,...n})=>(0,i.jsx)(rc,{as:"abbr",textStyle:"abbreviation",...n,children:e}),Sy=e=>(0,i.jsx)(Tl,{as:El.Header,...wl(e),css:{background:"white",borderBottom:e.hideBorder?"":"1px solid $gray200",padding:"$6 $7","& :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$displayXs",lineHeight:"32px"},...e.css},children:e.children}),yy=e=>(0,i.jsx)(Tl,{...wl(e),css:{background:"$gray50",flex:"1",padding:"$7",...e.css},direction:"column",children:e.children}),Cy=e=>(0,i.jsx)(Sy,{align:"center",css:{paddingBlockEnd:"$4"},gap:"4",hideBorder:!0,children:e.isLoading?(0,i.jsx)(qm,{}):(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:1,children:[e.breadcrumbs,(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsxs)(Tl,{css:{alignItems:"center",alignSelf:"stretch",flex:"1"},gap:"4",children:[e.icon&&(0,i.jsx)(Tl,{align:"center",justify:"center",children:(0,i.jsx)(xI,{color:e.color??void 0,css:{inlineSize:"56px",blockSize:"56px"},icon:e.icon})}),(0,i.jsxs)(Tl,{css:{alignItems:"flex-start"},direction:"column",justify:"center",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(dc,{children:e.name}),g(e.acronym)&&(0,i.jsx)(vy,{css:{position:"relative",top:"6px"},children:e.acronym}),e.nameSuffix]}),e.subtext&&(0,i.jsx)(rc,{textStyle:"subtitle",children:e.subtext})]})]}),e.buttons]})]})}),by=Sy,Ay=e=>(0,i.jsx)(Tl,{css:e.css,direction:"column",height:1,width:1,children:e.children}),Ey=e=>{const n=Wi().pathname.includes(e.basePath||e.path);return(0,i.jsxs)(i.Fragment,{children:[e.disabled?(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"grayCustom500",css:{borderBottom:"unset",paddingBlock:"$3",fontWeight:"$medium"},children:e.children})}),(0,i.jsx)(Dx,{placement:"top",children:e.disabledMessage})]}):(0,i.jsx)(ql,{replace:!0,to:e.path,children:(0,i.jsx)(Mr,{color:n?"primaryCustom500":"grayCustom500",css:{borderBottom:n?"2px solid $primaryCustom500":"unset",cursor:n?"inherit":"pointer",paddingBlock:"$3","&:hover":{color:n?"$primaryCustom600":"$grayCustom800"},fontWeight:"$medium"},children:e.children})}),(0,i.jsx)(Mr,{width:24})]})},wy=e=>(0,i.jsxs)(Tl,{"aria-orientation":"horizontal",as:El.Nav,css:{borderBottom:"1px solid $gray200",...e.css},width:1,children:[e.center&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{css:{flex:"1"}})}),e.children,(0,i.jsx)(Mr,{css:{flex:"1"}})]}),$y=e=>(0,i.jsx)(i.Fragment,{children:e.children});$y.displayName="TabPanel";const Ty=e=>{const[n,t]=(0,Ph.A)(V.Children.toArray(e.children),e=>V.isValidElement(e)&&e.type===$y);return(0,i.jsxs)(Tl,{direction:"column",width:1,...wl(e),children:[t,(0,i.jsx)(kr.dO,{children:n.map((e,n)=>(0,i.jsx)(kr.qh,{path:e.props.path,children:e},n))})]})},zy=V.createContext({}),Oy=e=>(0,i.jsx)(zy.Provider,{value:{...e},children:e.children}),Ry=e=>(0,i.jsxs)(Mr,{css:{background:"white",bd:!0,padding:"$6",width:"100%"},children:[(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:e.title}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:e.content})]}),Dy=br(Tl,{gap:"$3",variants:{avatarOnTop:{true:{flexDirection:"column",gap:"$2"},false:{alignItems:"center",flexDirection:"row"}}}}),My=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),s=V.useMemo(()=>g(e.userInfo.name)?e.userInfo.name:"-",[e.userInfo.name]),o=()=>(0,i.jsx)(Mr,{color:e.disabled?"gray300":"gray800",css:{ellipsis:""},disabled:e.disabled,fontWeight:"medium",title:s,children:s});return(0,i.jsxs)(Dy,{avatarOnTop:{"@initial":!!e.badge,"@tablet":!1},width:1,children:[(0,i.jsx)(t_,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:e.size||40}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",justify:"center",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[e.isClickDisabled?o():(0,i.jsx)(Xm,{to:e.clickPath??Rj.MEMBER_INFORMATION({organizationId:n,eventId:t,userInfoId:e.userInfo.id}),children:o()}),(0,i.jsx)(Mr,{css:{flexShrink:0},children:e.badge})]}),(0,i.jsx)(Mr,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.email,children:e.areContactLinksEnabled?(0,i.jsx)(Xm,{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)(Mr,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.phone?.internationalFormat,children:e.areContactLinksEnabled?(0,i.jsx)(Xm,{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 Py(e){switch(e){case Le.Waiting:case Le.Queued:return{color:"warning",leftIcon:"hourglass-empty"};case Le.Bounced:return{color:"error",leftIcon:"circle-exclamation"};default:return{color:"success",leftIcon:"check"}}}const ky=e=>{const{translate:n,params:{organizationId:t,eventId:s,campaignId:o}}=Kl(),a=ki(Jm),{mutate:r}=pr(),{mutate:d}=ir();return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(My,{userInfo:e.email.userInfo})}),(0,i.jsx)($m,{children:e.email.sentAt?a.toLocaleString(e.email.sentAt.toLocal(),Uo.DateTime):""}),(0,i.jsxs)($m,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Ku,{...Py(e.email.state),children:n(e.email.state)}),e.email.state===Le.Bounced&&g(e.email.infos?.bounceDiagnosticCode)&&(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.email.infos.bounceDiagnosticCode,width:1,children:e.email.infos.bounceDiagnosticCode})]}),(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsx)(Km,{children:(0,i.jsx)(Pu,{icon:"paper-plane",onClick:async()=>{e.emailType?await d({organizationId:t,eventId:s,userInfoId:e.email.userInfo.id,emailType:e.emailType}):await r({organizationId:t,eventId:s,campaignId:o,selecteds:{ids:[e.email.userInfo.id]}}),e.reload()},children:n("r_envoyer_90741")})})})]})},Fy=e=>{const{params:{organizationId:n,campaignId:t},translate:s}=Kl(),[o,a,r]=Wm(""),[d,l]=(0,V.useState)(""),[c,u]=(0,V.useState)(0),{data:m,isLoading:h,reload:p}=Li("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:n,campaignId:t,name:g(a)?a:void 0,state:""!==d?d:void 0,offset:c},[$o.EmailRecipientFragment]);const I=Um();return(0,i.jsxs)(yy,{direction:"column",gap:"7",children:[(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsx)(Ry,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(Ry,{content:e.campaign.numberOfOpen??0,title:s("nombre_d_ouvert_84187")}),(0,i.jsx)(Ry,{content:e.campaign.numberOfClick??0,title:s("nombre_de_clics_64232")})]}),(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{value:d,onChange:e=>{l(e),u(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),I(Lt.filter(e=>e!==Le.Queued))]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{r(e),u(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Gm,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Gm,{children:s("State")}),(0,i.jsx)(Gm,{width:100})]}),numberOfPages:m.organization?.campaign.emails.numberOfPages??0,offset:c,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:m.organization.campaign.emails.nodes.map((e,n)=>(0,i.jsx)(ky,{email:e,emailType:null,reload:p},n))}),setOffset:u,title:s("liste_des_desti_16448"),totalCount:m.organization?.campaign.emails.totalCount??0})]})},Ny=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,userInfoId:a}}=Kl(),[r,d,l]=Wm(""),{usersInfosOptions:c,isLoading:u}=my({organizationId:s,eventId:o,hasSelected:!0,nameDebounced:d,userInfoIds:[a],populationsIds:e.populationsIds});return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7",...e.css},gap:"4",children:[(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_le_81451")}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(_m,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",name:r,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:l}),values:[a],onChange:t=>{Yo(t)&&n.replace(e.getPath(t[0]))},children:c})}),g(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})]})};function Ly(e){switch(e){case it.Assigned:return{color:"success",leftIcon:"check"};case it.Refused:return{color:"error",leftIcon:"xmark"};case it.PreAssigned:return{color:"pink",leftIcon:"wand-magic-sparkles"};case it.WaitingAssignment:return{color:"warning",leftIcon:"hourglass-empty"};case it.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return Zl()}}function Uy(e){switch(e){case ge.Accredited:return{color:"success",leftIcon:"check"};case ge.AutoAccredited:return{color:"success",leftIcon:"bolt-auto"};case ge.Refused:return{color:"error",leftIcon:"xmark"};case ge.WaitingAccreditation:return{color:"warning",leftIcon:"hourglass-empty"};case ge.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return Zl()}}const Vy=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{getVolunteersSegmentPath:a}=V.useContext(zy),r=(0,V.useMemo)(()=>e.campaign.positionsCategories.map(e=>({id:`pc-${e.id}`,name:e.name,link:oo.POSITION_CATEGORY({organizationId:s,eventId:o,positionCategoryId:e.id})})).concat(e.campaign.positions.map(e=>({id:`p-${e.id}`,name:e.name,link:oo.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:oo.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]),d=(0,V.useMemo)(()=>e.campaign.accreditationsCategories.map(e=>({id:`ac-${e.id}`,name:e.name,link:""})).concat(e.campaign.accreditations.map(e=>({id:`a-${e.id}`,name:e.name,link:Ws.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:Ws.ACCREDITATION({organizationId:s,eventId:o,accreditationId:e.accreditation.id})}))),[e.campaign]),l=(0,V.useMemo)(()=>d.length+r.length,[d,r]);return(0,i.jsxs)(Tl,{gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:t("_96502")}),e.campaign.sendToEveryone?(0,i.jsx)(Mr,{color:"gray800",children:t("tous_vos_membre_30731")}):Yo(e.campaign.states)?(0,i.jsx)(Tl,{css:{flex:"1"},gap:"2",wrap:"wrap",children:e.campaign.states.map(e=>(0,i.jsx)(Ku,{...Ly(e),children:t(e)},e))}):Yo(e.campaign.usersInfos)?(0,i.jsx)(Tl,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.usersInfos.map((t,a)=>(0,i.jsxs)(Mr,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{n.push(Rj.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:t.id}))},children:[t.nameOrEmail,a!==e.campaign.usersInfos.length-1&&", "]},t.id))}):Yo(e.campaign.segments)?(0,i.jsx)(Tl,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.segments.map((t,s)=>(0,i.jsxs)(Mr,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{n.push(a(t.id))},children:[t.name,s!==e.campaign.segments.length-1&&", "]},t.id))}):(0,i.jsx)(Tl,{css:{flex:"1"},gap:"1",wrap:"wrap",children:r.concat(d).map((e,t)=>(0,i.jsxs)(Mr,{color:g(e.link)?"primary500":"gray800",css:{cursor:g(e.link)?"pointer":"initial",textDecoration:"underline"},onClick:()=>{g(e.link)&&n.push(e.link)},children:[e.name,t!==l-1?", ":""]},e.id))})]})},By=e=>{const n=Fi(),t=(0,V.useCallback)(e=>{e&&(e.onload=()=>{const n=e.contentDocument.body.scrollHeight;e.style.height=`${n}px`,e.contentDocument.body.style.margin="0",e.contentDocument.body.style.overflow="hidden",e.parentElement.style.height=`${n+64}px`})},[]);return(0,i.jsx)(Tl,{css:{background:"$gray50",minHeight:"100%",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Tl,{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)(Tl,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("cr_e_par_16667")}),(0,i.jsx)(Mr,{color:"gray800",children:e.createdBy})]}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.from&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("de_70487")}),(0,i.jsx)(Mr,{color:"gray800",children:e.from})]}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.to&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{margin:"0 $6"},width:1,children:(0,i.jsx)(Vy,{campaign:e.to})}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.subject&&(0,i.jsxs)(Tl,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("objet_86482")}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:e.subject})]}),e.content&&(0,i.jsxs)(Tl,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",flexGrow:"1",padding:"$7"},direction:"column",gap:"6",children:[(0,i.jsx)(Mr,{css:{minHeight:"300px",marginTop:"$3","& iframe":{background:"white",border:"none",borderRadius:"$2",overflow:"hidden",width:"100%"}},width:1,children:(0,i.jsx)("iframe",{ref:t,srcDoc:e.content})}),(Yo(e.attachments)||Yo(e.documents))&&(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textXl semiBold",children:n("pi_ces_jointes_36761")}),(0,i.jsx)(Tl,{gap:"2",children:(e.attachments||[]).map(e=>(0,i.jsx)(Ku,{color:"white",size:"md",children:Qj.includes(e)?n(e):Dt.includes(e)?M_(e):e},e))}),(0,i.jsx)(Tl,{direction:"column",gap:"3",children:(e.documents||[]).map(e=>(0,i.jsx)(wv,{acl:"public-read",document:e},e.id))})]})]})]})})},Wy=()=>{const{params:{organizationId:e,eventId:n,campaignId:t,userInfoId:s}}=Kl(),{data:o,loader:a}=_d({organizationId:e,campaignId:t,userInfoId:s}),r=(0,V.useMemo)(()=>o.organization?.campaign.createdBy?`${o.organization.campaign.createdBy.name} (${o.organization.campaign.createdBy.email})`:null,[o.organization]),d=(0,V.useMemo)(()=>o.organization?.campaign.emailSender?`${o.organization.campaign.emailSender.fromName} (${o.organization.campaign.emailSender.fromEmail})`:F.EMAIL_FROM,[o.organization]);return a||(0,i.jsx)(yy,{children:(0,i.jsx)(By,{attachments:o.organization.campaign.attachments,content:o.organization.campaign.preview,createdBy:r,documents:o.organization.campaign.documents,from:d,subject:o.organization.campaign.subject,to:o.organization.campaign,userSelector:(0,i.jsx)(Ny,{css:{border:"none",px:"$6"},getPath:i=>Gj.CAMPAIGN_PREVIEW({organizationId:e,eventId:n,campaignId:t,userInfoId:i})})})})},Gy=({children:e,color:n,fontWeight:t,returnPathFallback:s})=>{const o=Bi();return(0,i.jsxs)(Tl,{align:"center",css:{color:"primary"===n?"$primary500":"$gray900",cursor:"pointer",fontSize:"textXl",fontWeight:t??"normal",padding:0},gap:"2",onClick:()=>o.goBack(s),children:[(0,i.jsx)(Yl,{icon:"arrow-left"}),e]})},qy=e=>{const{translate:n,params:{organizationId:t,eventId:s,campaignId:o}}=Kl(),{canCampaignSend:a}=oy();return(0,i.jsxs)(by,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Gy,{returnPathFallback:Gj.CAMPAIGNS({organizationId:t,eventId:s})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.campaign.name}),a&&(0,i.jsx)(tc,{to:Gj.UPDATE({organizationId:t,eventId:s,campaignId:o}),children:n("_diter_la_campa_04069")})]})};function Hy(e){switch(e){case Kn.Waiting:return{color:"warning",leftIcon:"hourglass-empty"};case Kn.Sent:case Kn.Delivered:return{color:"success",leftIcon:"check"};default:return{color:"error",leftIcon:"circle-exclamation"}}}const Yy=e=>(0,i.jsx)(Mr,{color:"gray800",css:{borderBottom:"1px solid $gray200",padding:"$6"},fontSize:"textXl",fontWeight:"medium",children:e.children}),Zy=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"3",width:1,children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[e.message.createdBy&&(0,i.jsx)(Mr,{color:"gray800",textAlign:"end",children:e.message.createdBy.name}),(0,i.jsx)(Mr,{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)(Mr,{children:(0,i.jsx)(t_,{email:e.message.createdBy.email,image:e.message.createdBy.picture?.url,name:e.message.createdBy.name,size:40})})]}),e.message.replies.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"3",width:1,children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(t_,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:40})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",children:e.userInfo.name}),(0,i.jsx)(Mr,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},width:1,children:unescape(n)})]})]})]},t))]}),Ky=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("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,V.useState)(""),{numberOfCharacters:a,numberOfSms:r}=IS(s,!1),d=g(s);return(0,i.jsxs)(Tl,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(af,{label:(0,i.jsxs)(Tl,{justify:"between",children:[(0,i.jsx)(Mr,{children:n("contenu_de_la_r_08075")}),(0,i.jsx)(Mr,{color:"gray500",children:n("_1_caract_re_04414",a,r)})]}),value:s,onChange:o}),(0,i.jsx)(Tl,{justify:"end",children:(0,i.jsx)(tc,{disabled:!d,onClick:async()=>{await t({organizationId:e.organizationId,eventId:e.eventId,parentId:e.parentId,content:s}),e.reload()},children:n("envoyer_le_mess_41092")})})]})},Xy=e=>{const n=Fi(),{data:t,loader:s,reload:o}=Li("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},[$o.CreatedByFragment]);const a=(0,V.useMemo)(()=>(0,Lm.A)([{text:e.text,replies:t.organization?.textMessage.replies??[],sentAt:e.textMessage.sentAt,createdBy:e.createdBy}].concat(t.organization?.textMessage.children??[]),e=>e.sentAt.toMillis()),[t.organization]);return(0,i.jsxs)(gp,{size:"sm",onClose:e.onClose,children:[(0,i.jsx)(Yy,{children:n("r_ponse_de_1_77675",e.userInfo.name)}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(hp,{children:[a.map((n,t)=>(0,i.jsx)(Zy,{message:n,userInfo:e.userInfo},t)),(0,i.jsx)(Pl,{height:"6"})]}),(0,i.jsx)(pp,{children:(0,i.jsx)(Ky,{eventId:e.eventId,organizationId:e.organizationId,parentId:e.textMessage.id,reload:o})})]})]})},Qy=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Jm),{mutate:a}=function(e={}){return Ui("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)}(),[r,d]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(km,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},children:[(0,i.jsx)($m,{children:(0,i.jsx)(My,{userInfo:e.textMessage.userInfo})}),(0,i.jsx)($m,{children:e.textMessage.userInfo.phone?.internationalFormat??""}),(0,i.jsx)($m,{children:e.textMessage.sentAt?o.toLocaleString(e.textMessage.sentAt,Uo.DateTime):""}),(0,i.jsx)($m,{children:(0,i.jsx)(Ku,{...Hy(e.textMessage.state),children:n(e.textMessage.state)})}),(0,i.jsx)($m,{children:e.textMessage.numberOfReplies>0?(0,i.jsx)(tc,{color:"white",size:"sm",onClick:async n=>{jc(n),await a({organizationId:t,eventId:s,textMessageId:e.textMessage.id}),d(!0)},children:n("voir_la_reponse",e.textMessage.numberOfReplies)}):""})]}),r&&(0,i.jsx)(Xy,{createdBy:e.createdBy,eventId:s,organizationId:t,text:e.text,textMessage:e.textMessage,userInfo:e.textMessage.userInfo,onClose:()=>{d(!1)}})]})},Jy=e=>{const{params:{organizationId:n,campaignId:t},translate:s}=Kl(),[o,a,r]=Wm(""),[d,l]=(0,V.useState)(""),[c,u]=(0,V.useState)(""),[m,h]=(0,V.useState)(0),{data:p,isLoading:I}=Li("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:n,campaignId:t,name:g(a)?a:void 0,state:""!==d?d:void 0,replies:""!==c?c:void 0,offset:m},[$o.CreatedByFragment,$o.CampaignUserInfoFragment]);const x=Um(),{numberOfPages:f,totalCount:_}=Sx(p.organization?.campaign.textMessages);return(0,i.jsxs)(yy,{direction:"column",gap:"7",children:[(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsx)(Ry,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(Ry,{content:e.campaign.numberOfDelivery??0,title:s("nombre_de_messa_93859")}),(0,i.jsx)(Ry,{content:e.campaign.cost,title:s("co_t_de_la_camp_54312")})]}),(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{value:d,onChange:e=>{l(e),h(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),x(fi)]})}),(0,i.jsx)(Mr,{width:240,children:(0,i.jsxs)(Up,{value:c,onChange:e=>{u(e),h(0)},children:[(0,i.jsx)("option",{value:"",children:s("avec_et_sans_r_23765")}),x(xi)]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{r(e),h(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Gm,{children:s("Phone")}),(0,i.jsx)(Gm,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Gm,{children:s("State")}),(0,i.jsx)(Gm,{children:s("r_ponses_97000")})]}),numberOfPages:f,offset:m,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:p.organization.campaign.textMessages.nodes.map((n,t)=>(0,i.jsx)(Qy,{createdBy:p.organization.campaign.createdBy,text:e.campaign.text,textMessage:n},t))}),setOffset:h,title:s("liste_des_desti_16448"),totalCount:_})]})},eC=()=>{const{params:{organizationId:e,eventId:n,campaignId:t,userInfoId:s}}=Kl(),o=ki(Jm),{data:a,loader:r}=_d({organizationId:e,campaignId:t,userInfoId:s}),d=a.organization?.campaign.sentAt?.setZone(Oo.c9.local().zone);return r||(0,i.jsx)(yy,{children:(0,i.jsx)(Tl,{css:{background:"$gray50",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Tl,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",overflow:"hidden",paddingBottom:"$6"},direction:"column",gap:"3",width:640,children:[(0,i.jsx)(Ny,{css:{border:"none",px:"$6"},getPath:i=>Gj.CAMPAIGN_PREVIEW({organizationId:e,eventId:n,campaignId:t,userInfoId:i})}),(0,i.jsx)(Mr,{css:{px:"$6"},children:(0,i.jsx)(Vy,{campaign:a.organization.campaign})}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",height:"1px",px:"$6"}}),(0,i.jsxs)(Tl,{css:{px:"$6"},gap:"3",width:1,children:[a.organization.campaign.createdBy&&(0,i.jsx)(Mr,{children:(0,i.jsx)(t_,{email:a.organization.campaign.createdBy.email,image:a.organization.campaign.createdBy.picture?.url,name:a.organization.campaign.createdBy.name,size:40})}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(a.organization.campaign.createdBy||d)&&(0,i.jsxs)(Tl,{gap:"3",width:1,children:[a.organization.campaign.createdBy&&(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:a.organization.campaign.createdBy.name}),d&&(0,i.jsx)(Mr,{color:"gray500",children:o.toLocaleString(d,Uo.DateTime)})]}),(0,i.jsx)(Mr,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},dangerouslySetInnerHTML:{__html:a.organization.campaign.preview}})]})]})]})})})},nC=()=>{const{params:{organizationId:e,eventId:n,campaignId:t},translate:s}=Kl(),{data:o,loader:a}=Li("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:n,campaignId:t},[]),r=(0,V.useMemo)(()=>o.organization?n?o.organization.event?.volunteersRegistrations.nodes[0]?.userInfoId:o.organization.usersInfos.nodes[0].id:-1,[n,o.organization]);Au(`${o.organization?.campaign.name??""} ${s("campagne_97871")}`);const d=i=>({organizationId:i?":organizationId":e,eventId:n?i?":eventId":n:void 0,campaignId:i?":campaignId":t}),l=e=>({...d(e),userInfoId:e?":userInfoId":r}),c=Xi([Gj.CAMPAIGN(d(!1)),ns.PREVIEW]);return a||(0,i.jsxs)(Ay,{children:[(0,i.jsx)(qy,{campaign:o.organization.campaign}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:Gj.CAMPAIGN_DASHBOARD(d(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{basePath:c,disabled:!r,disabledMessage:s("vous_devez_avoir_2345"),path:Gj.CAMPAIGN_PREVIEW(l(!1)),children:s("aper_u_25595")})]}),(0,i.jsx)($y,{path:Gj.CAMPAIGN_DASHBOARD(d(!0)),children:o.organization?.campaign.campaignType===ve.Email?(0,i.jsx)(Fy,{campaign:o.organization?.campaign}):(0,i.jsx)(Jy,{campaign:o.organization?.campaign})}),(0,i.jsx)($y,{path:Gj.CAMPAIGN_PREVIEW(l(!0)),children:o.organization?.campaign.campaignType===ve.Email?(0,i.jsx)(Wy,{}):(0,i.jsx)(eC,{})})]})]})},tC=()=>{const{organizationId:e,eventId:n}=Vi();return(0,i.jsx)(Oy,{getVolunteersSegmentPath:t=>yo.VOLUNTEERS_SEGMENT(e,n,t),isOrganizationCampaign:!1,children:(0,i.jsx)(nC,{})})},iC=()=>{const{organizationId:e}=Vi();return(0,i.jsx)(Oy,{getVolunteersSegmentPath:n=>yo.COMMUNITY_USERS_SEGMENT(e,n),isOrganizationCampaign:!0,children:(0,i.jsx)(nC,{})})};function sC(e){switch(e){case Me.Expired:return{color:"error",leftIcon:"clock"};case Me.Full:return{color:"error",leftIcon:"hundred-points"};case Me.Locked:return{color:"error",leftIcon:"lock-keyhole"};case Me.Ongoing:return{color:"success",leftIcon:"check"};default:return Zl()}}let oC=class extends Rc{constructor(e){super(e)}createUpdateDelegationValuesDefault(e,n){return{delegation:this.delegationInputDefault(e,n),selectedAccreditationsSlotsIds:[]}}delegationInputDefault(e,n){const t=n?.forms&&n?.parentDelegation?n.forms.find(e=>e.name===n.parentDelegation?.form.name):null,i=e?.formId??t?.id??-1,s=Yo(n?.delegationsCategories)&&n?.parentDelegation?n.delegationsCategories.find(e=>e.name===n.parentDelegation?.delegationCategory.name):null;let o=e?.delegationCategoryId??s?.id??n?.delegationCategoryId;return Number.isInteger(o)||(o=null),{...this.getDefaultAccreditations(e),delegationCategoryId:o,parentId:e?.parentId??n?.parentId??null,name:e?.name??"",description:e?.description??"",leadersIds:e?.leadersIds??n?.parentDelegation?.leadersIds??[],formId:i,deadlineDate:e?.deadlineDate??null,maxResources:e?.maxResources??null,showInDelegationSpace:e?.showInDelegationSpace??!0,showFormLinkInDelegationSpace:e?.showFormLinkInDelegationSpace??!0,delegationsSpaceLayoutId:e?.delegationsSpaceLayoutId??null,columns:e?.columns??n?.parentDelegation?.columns??["name","accreditations","accreditation_state"],canLeadersAddMembers:e?.canLeadersAddMembers??!0,canLeadersDeleteMembers:e?.canLeadersDeleteMembers??!0,canLeadersDuplicateMembers:e?.canLeadersDuplicateMembers??!1,canLeadersEditColumns:e?.canLeadersEditColumns??!0,canLeadersEditCustomFields:e?.canLeadersEditCustomFields??!0,canLeadersEditMembers:e?.canLeadersEditMembers??!0,canLeadersImportMembers:e?.canLeadersImportMembers??!1,canLeadersSeeHiddenAccreditationsSlots:e?.canLeadersSeeHiddenAccreditationsSlots??!1,privateNote:e?.privateNote??n?.parentDelegation?.privateNote??"",addDefaultAccreditationsByAvailability:e?.addDefaultAccreditationsByAvailability??!1,showAllAccreditations:e?.showAllAccreditations??!1,tagsIds:e?.tagsIds??n?.parentDelegation?.tagsIds??[],customFields:e?.customFields||[],fields:e?.fields??{},campaignsIds:e?.campaignsIds??[],customDocumentsSlugs:e?.customDocumentsSlugs??[],usedCustomFieldsIds:e?.usedCustomFieldsIds??[],accreditationsProfiles:e?.accreditationsProfiles??[]}}delegationInputSchema(){return zc.Ik().shape({parentId:zc.ai().nullable(),name:zc.Yj().when("parentId",{is:null,then:e=>e.required(this.t("le_nom_de_la_d_10042"))}),description:zc.Yj(),delegationCategoryId:zc.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:zc.YO().of(zc.ai()),formId:zc.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:lf.typeError(this.t("la_date_limite_91708")).nullable(),maxResources:zc.ai().min(0).nullable(),showInDelegationSpace:zc.zM().required(),showFormLinkInDelegationSpace:zc.zM().required(),columns:zc.YO().of(zc.Yj()).required(this.t("vous_devez_choi_82605")).min(1,this.t("vous_devez_choi_82605")),canLeadersAddMembers:zc.zM().required(),canLeadersDeleteMembers:zc.zM().required(),canLeadersEditColumns:zc.zM().required(),canLeadersEditMembers:zc.zM().required(),canLeadersEditCustomFields:zc.zM().required(),canLeadersImportMembers:zc.zM().required(),canLeadersSeeHiddenAccreditationsSlots:zc.zM().required(),privateNote:zc.Yj(),accreditations:zc.YO().of(zc.Ik().shape({accreditationCategoryId:zc.ai().required(),accreditationId:zc.ai().required(),maxResources:zc.gl().nullable(),willAutoAccredit:zc.zM().required()})),accreditationsSlots:zc.YO().of(zc.Ik().shape({accreditationCategoryId:zc.ai().required(),accreditationId:zc.ai().required(),accreditationSlotId:zc.ai().required(),isDefault:zc.zM().required(),maxResources:zc.gl().nullable()})),accreditationsProfiles:zc.YO().of(zc.Ik().shape({accreditationProfileId:zc.ai().required(),maxResources:zc.gl().nullable(),willAutoAccredit:zc.zM().required()})),campaignsIds:zc.YO().of(zc.ai()),customDocumentsSlugs:zc.YO().of(zc.gl()),usedCustomFieldsIds:zc.YO().of(zc.ai())})}delegationUpdateFieldsSchema(e){return zc.Ik().shape({fields:e})}createUpdateDelegationSchema(e){const n=this.delegationInputSchema();return zc.Ik().shape({delegation:e?n.shape({fields:e}):n})}adminAddSchema(){return zc.Ik().shape({usersInfosIds:zc.YO().of(zc.ai())})}getDefaultAccreditations(e){let n=e?.accreditationsCategories||[],t=e?.accreditations||[];const i=e?.accreditationsSlots||[];return Yo(i)&&(n=(0,Rg.A)(n.concat(i.map(e=>({accreditationCategoryId:e.accreditationCategoryId,maxResources:null}))),e=>e.accreditationCategoryId)),Yo(i)&&(t=(0,Rg.A)(t.concat(i.map(e=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,maxResources:null,willAutoAccredit:!1}))),e=>e.accreditationId)),{accreditationsCategories:n,accreditations:t,accreditationsSlots:i}}};oC=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],oC);var aC=t(2662);const rC=/^[0-9]{11}$/i,dC=Oo.c9.now().year-2e3;function lC(e){if(g(e)&&rC.test(e)){const n=(0,aC.A)(e.substring(0,2),10);let t=(0,aC.A)(e.substring(0,9),10);const i=(0,aC.A)(e.substring(9),10);return n<=dC&&(t=2e9+t),i===97-t%97}return!1}const cC=/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/,uC={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},mC=[Qe.Checkbox,Qe.Select,Qe.Validation];function gC(e,n){switch(n){case Te.Accreditation:return e("accr_ditations_39450");case Te.Delegation:return e("d_l_gations_78318");case Te.Event:return e("Event");case Te.Position:return e("missions_63972");case Te.UserInfo:return e("membres_11310");default:return Zl()}}function hC(e){return g(e.label)?`${e.name} (${e.label})`:e.name}function pC(e){return e.fieldType===Qe.Select&&e.canSelectMultiple}const IC=["default","regex"],xC=["all","numbers","noSymbols","uppercase","lowercase"],fC=["any","past","between"];function _C(e){switch(e.fieldType){case Qe.Text:return e.fieldSubtype===Xe.Freeform?"text":null;case Qe.Textarea:return"text";case Qe.Number:return"number";case Qe.Date:case Qe.Datetime:return e.fieldProperty===Ke.DateOfBirth?null:"date";default:return null}}function jC(e){switch(e){case"text":return{mode:"default",allowedCharacters:"all"};case"date":return{range:"any"};default:return{}}}const vC=[{key:"addressPostalCodeCustomFieldId",fieldType:Qe.Text},{key:"addressCityCustomFieldId",fieldType:Qe.Text},{key:"addressCountryCustomFieldId",fieldType:Qe.Country}];function SC(e,n){return n.organizationId===e.organizationId&&n.variety===e.variety&&(!n.eventId||n.eventId===e.eventId)}const yC=[Qe.Checkbox,Qe.Country,Qe.Language,Qe.Nationality,Qe.Select];let CC=class{countriesService;dateTimeService;translationService;constructor(e,n,t){this.countriesService=e,this.dateTimeService=n,this.translationService=t}getValueString(e,n,t={}){switch(e.fieldType){case Qe.Text:return this.getTextValue(e,n);case Qe.Textarea:case Qe.Time:case Qe.Address:return n[e.slug]||"";case Qe.Sex:return this.getSexValue(e,n);case Qe.Language:return this.getLanguageValue(e,n);case Qe.Nationality:return this.getNationalityValue(e,n);case Qe.Country:return this.getCountryValue(e,n);case Qe.Select:return this.getSelectValue(e,n);case Qe.Checkbox:case Qe.Validation:return this.getBooleanValue(e,n);case Qe.Date:return this.getDateValue(e,n,t.dateFormat);case Qe.Datetime:return this.getDatetimeValue(e,n,t.datetimeFormat);case Qe.File:return"name"===t.fileReturnValue?n[e.slug]?.name||"":n[e.slug]?.url||"";case Qe.Phone:return this.getPhoneValue(e,n);case Qe.Number:return this.getIntValue(e,n);default:return Zl(e.fieldType)}}getValue(e,n){return n[e.slug]}getSelectValues(e,n){const t=Ho(this.getValue(e,n)??[]);return(0,kl.A)(t.map(n=>e.values.find(e=>e.id===n)?.value))}getSelectCustomFieldValues(e,n){const t=Ho(this.getValue(e,n)??[]);return(0,kl.A)(t.map(n=>e.values.find(e=>e.id===n)))}getTextValue(e,n){const t=this.getValue(e,n);return g(t)?function(e,n){return"firstName"===e.slug||"lastName"===e.slug?f(n):e.fieldSubtype===Xe.Avs?function(e){const n=e.replace(/\D/g,"");return 13===n.length&&n.startsWith("756")?`756.${n.substring(3,7)}.${n.substring(7,11)}.${n.substring(11)}`:e}(n):e.fieldSubtype===Xe.Iban?function(e){const n=e.toUpperCase().trim().replace(/\s+/g,"");return cC.test(n)&&n.length===uC[n.substring(0,2)]?n.match(/.{1,4}/g).join(" "):e}(n):n}(e,t):t||""}getSexValue(e,n){return this.translationService.translate(this.getValue(e,n)??"")}getLanguageValue(e,n){return this.translationService.translate(this.getValue(e,n)??"")}getNationalityValue(e,n){return this.countriesService.getNationality(this.getValue(e,n)??"")??""}getCountryValue(e,n){return this.countriesService.getName(this.getValue(e,n)??"")??""}getBooleanValue(e,n){const t=this.getValue(e,n);return!0===t?this.translationService.translate("oui_54361"):!1===t?this.translationService.translate("non_33516"):""}getDateValue(e,n,t){let i=this.getValue(e,n);return g(i)&&(i=Oo.c9.fromISO(i,{zone:"utc"})),Oo.c9.isDateTime(i)&&i.isValid?g(t)?i.toFormat(t):this.dateTimeService.toLocaleString(i,Uo.DateOnly.MonthLong):""}getDatetimeValue(e,n,t){let i=this.getValue(e,n);return g(i)&&(i=Oo.c9.fromISO(i,{zone:"utc"})),Oo.c9.isDateTime(i)&&i.isValid?g(t)?i.toFormat(t):this.dateTimeService.toLocaleString(i,Uo.DateTime):""}getPhoneValue(e,n){return this.getValue(e,n)?.internationalFormat??""}getIntValue(e,n){return this.getValue(e,n)?.toString()??""}getSelectValue(e,n){const t=Ho(this.getValue(e,n)??[]);return(0,kl.A)(t.map(n=>e.values.find(e=>e.id===n)?.value)).join(", ")}};CC=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],CC);const bC=[Qe.Country,Qe.Language,Qe.Nationality,Qe.Select];function AC(e,n,t){if(e.hasCondition&&e.conditionCustomField){const i=t.find(n=>n.id===e.conditionCustomField.id);if(i){if(AC(i,n,t)){const t=n[e.conditionCustomField.slug];return"boolean"==typeof t&&e.conditionCustomField.fieldType===Qe.Checkbox?t===e.conditionValue:!(!bC.includes(e.conditionCustomField.fieldType)||!Yo(e.conditionValue))&&(0,mm.A)(Ho(t),e.conditionValue).length>0}return!1}return!1}return!0}const EC=["key","name","acl"];let wC=class extends Rc{constructor(e){super(e)}documentInputDefault(){return{key:"",name:"",acl:""}}documentInputSchema(e){const n=g(e)?this.t("_1_est_requis_99856",e):this.t("le_document_est_86403");return zc.Ik().shape({key:zc.Yj().required(n),name:zc.Yj().required(n),acl:zc.Yj().required(n)})}documentInputSchemaNotRequired(){return zc.Ik().shape({key:zc.Yj(),name:zc.Yj(),acl:zc.Yj()})}};wC=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],wC);const $C=Uo.DateOnly.Numeric,TC=ru.concat(Qt);let zC=class extends Rc{countriesService;dateTimeService;documentInputService;phoneInputService;translationService;constructor(e,n,t,i,s){super(s),this.countriesService=e,this.dateTimeService=n,this.documentInputService=t,this.phoneInputService=i,this.translationService=s}fieldsUpdateInputDefault(e,n,t,i){return Object.fromEntries(n.map(n=>{const s=this.getFieldValue(e,n);return[n.slug,s??this.fieldUpdateInputDefault(n,t,i)]}))}getValidationRuleError(e,n,t){switch(_C(e)){case"text":return g(n)?this.textValidationRuleError(e.name,e.validationRules,n):null;case"number":return"number"==typeof n?this.numberValidationRuleError(e.name,e.validationRules,n):null;case"date":{const i=g(n)||Oo.c9.isDateTime(n)?Vo(n):null;return i?.isValid?this.dateValidationRuleError(e.name,e.validationRules,i,t):null}default:return null}}changedFieldsSchema(e,n,t){return zc.Ik().shape(Object.fromEntries(e.filter(({slug:e})=>!(0,Yr.A)(t[e],n[e])).map(e=>[e.slug,this.fieldSchema(e,!1)])))}fieldSchema(e,n){const t=n=>n.test("validation-rules","",(n,t)=>{const i=this.getValidationRuleError(e,n);return!i||t.createError({message:i})}),i=(i,s)=>{const o=()=>t(i()),a=()=>t(s());if(e.conditionCustomField)return zc.Ik().when(e.conditionCustomField.slug,([t])=>n&&(e.conditionCustomField.fieldType===Qe.Checkbox&&t===e.conditionValue||bC.includes(e.conditionCustomField.fieldType)&&Yo(e.conditionValue)&&(0,mm.A)(Ho(t),e.conditionValue).length>0)?o():a());{let e;return e=n?o():a(),e}};switch(e.fieldType){case Qe.File:return i(()=>this.documentInputService.documentInputSchema(e.name),()=>this.documentInputService.documentInputSchemaNotRequired());case Qe.Phone:return i(()=>this.phoneInputService.phoneInputSchema(),()=>this.phoneInputService.phoneInputSchemaNotRequired());case Qe.Text:case Qe.Textarea:case Qe.Time:case Qe.Address:return e.fieldProperty===Ke.Eid?i(()=>zc.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).test("valid-eid",this.t("le_num_ro_de_re_71488"),e=>!(!g(e)||12!==e.length||!e.startsWith("********"))||lC(e)),()=>zc.Yj()):e.fieldSubtype!==Xe.Freeform?i(()=>zc.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),n=>{if(g(n)&&12===n.length&&n.startsWith("********"))return!0;switch(e.fieldSubtype){case Xe.Eid:return lC(n);case Xe.Avs:return function(e){if(g(e)){const n=e.replace(/\D/g,"");if(13===n.length&&n.startsWith("756")){const e=n.substring(0,12).split("").reduce((e,n,t)=>t%2==0?e+Number(n):e+3*Number(n),0)%10;return(0===e?0:10-e)===Number(n[12])}return!1}return!1}(n);case Xe.Iban:return function(e){if(g(e)){const n=e.toUpperCase().trim().replace(/\s+/g,"");if(cC.test(n)){const e=n.substring(0,2);if(n.length===uC[e]){const e=`${n.substring(4)}${n.substring(0,4)}`;let t="";for(const n of e)t=/[A-Z]/.test(n)?`${t}${n.charCodeAt(0)-55}`:`${t}${n}`;return BigInt(t)%97n==1n}return!1}return!1}return!1}(n);case Xe.Freeform:return!0;default:return Zl(e.fieldSubtype)}}),()=>zc.Yj()):i(()=>zc.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>zc.Yj());case Qe.Number:return i(()=>zc.ai().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>zc.ai().nullable());case Qe.Checkbox:return i(()=>zc.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>zc.zM());case Qe.Validation:return i(()=>zc.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)),()=>zc.zM());case Qe.Select:return e.canSelectMultiple?i(()=>zc.YO().of(zc.ai().required()).required(this.t("_1_est_requis_99856",e.name)).min(1,this.t("vous_devez_s_le_55757",e.name)),()=>zc.YO().of(zc.ai())):i(()=>zc.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)),()=>zc.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))));case Qe.Date:case Qe.Datetime:return e.fieldProperty===Ke.DateOfBirth?i(()=>lf.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)).test("valid-date-of-birth",this.t("la_date_de_nais_19129"),e=>!(!Oo.c9.isDateTime(e)||!e.isValid)&&e>=Sp&&e<=yp),()=>zc.gl().nullable().test("valid-date-of-birth",this.t("la_date_de_nais_19129"),e=>!Oo.c9.isDateTime(e)||!e.isValid||e>=Sp&&e<=yp)):i(()=>lf.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)),()=>zc.gl().nullable());case Qe.Sex:return i(()=>zc.Yj().oneOf(pi,this.oneOfMessage(e.name,pi)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>zc.Yj().oneOf(pi,this.oneOfMessage(e.name,pi)));case Qe.Language:return i(()=>zc.Yj().oneOf(TC,this.oneOfMessage(e.name,TC)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>zc.Yj().oneOf(TC,this.oneOfMessage(e.name,TC)));case Qe.Nationality:case Qe.Country:return i(()=>zc.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)),()=>zc.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)));default:return Zl(e.fieldType)}}textValidationRuleError(e,n,t){if("regex"===n.mode)return g(n.regex)&&!new RegExp(n.regex).test(t)?n.regexMessage||this.t("_1_n_a_pas_le_68593",e):null;if(n.noLeadingTrailingSpaces&&t!==t.trim())return this.t("_1_ne_doit_pas_16247",e);if(n.noSpaces&&/\s/.test(t))return this.t("_1_ne_doit_pas_30149",e);if("number"==typeof n.minLength&&t.lengthn.maxLength)return this.t("_1_doit_conten_24426",e,n.maxLength);switch(n.allowedCharacters){case"numbers":return/^[0-9.,]*$/.test(t)?null:this.t("_1_ne_doit_con_32219",e);case"noSymbols":return/^[\p{L}\p{N}\s]*$/u.test(t)?null:this.t("_1_ne_doit_con_83191",e);case"uppercase":return t===t.toLocaleUpperCase()?null:this.t("_1_ne_doit_con_44580",e);case"lowercase":return t===t.toLocaleLowerCase()?null:this.t("_1_ne_doit_con_13605",e);default:return null}}numberValidationRuleError(e,n,t){return"number"==typeof n.min&&tn.max?this.t("_1_doit_tre_i_05381",e,n.max):null}dateValidationRuleError(e,n,t,i){const s=t.toISODate();if("past"===n.range)return s>Oo.c9.now().setZone(i??t.zone).toISODate()?this.t("_1_doit_tre_u_03177",e):null;if("between"===n.range){const t=n.start?Vo(n.start):null,i=n.end?Vo(n.end):null;return t?.isValid&&si.toISODate()?this.t("_1_doit_tre_c_56697",e,t?this.dateTimeService.toLocaleString(t,$C):"",i?this.dateTimeService.toLocaleString(i,$C):""):null}return null}fieldUpdateInputDefault(e,n,t){switch(e.fieldType){case Qe.Checkbox:case Qe.Validation:return!!t&&void 0;case Qe.File:return this.documentInputService.documentInputDefault();case Qe.Phone:return this.phoneInputService.phoneInputDefault(n);case Qe.Select:return e.canSelectMultiple?[]:void 0;case Qe.Address:case Qe.Date:case Qe.Datetime:case Qe.Language:case Qe.Number:case Qe.Sex:case Qe.Text:case Qe.Textarea:case Qe.Time:return;case Qe.Country:return n.user.country;case Qe.Nationality:return n.user.nationality;default:return Zl(e.fieldType)}}getFieldValue(e,n){const t=e[n.slug];return n.fieldType===Qe.Phone&&t?(0,Fr.A)(t,K_):n.fieldType===Qe.File?(0,Fr.A)(t,EC):n.fieldType===Qe.Date&&t?Oo.c9.fromISO(t,{zone:"UTC"}):t}};zC=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,wC,X_,Di])],zC);const OC=(0,V.forwardRef)(({borderRadius:e,size:n,value:t,onChange:s,...o},a)=>{const r=(0,V.useMemo)(()=>e??4,[e]),d=(0,V.useMemo)(()=>n??24,[n]),l=(0,V.useMemo)(()=>(0,Vm.A)(e=>{s(e)},500),[s]);return(0,i.jsx)(Mr,{css:{background:t,borderRadius:`${r}px`,height:`${d}px`,overflow:"hidden",width:`${d}px`,"& input":{background:"transparent",border:"none",borderRadius:"$1",cursor:"pointer",height:`${d}px`,padding:"0",width:`${d}px`,"&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"$1",border:"none"},"&::-moz-color-swatch":{border:"none"}}},children:(0,i.jsx)("input",{ref:a,type:"color",value:t,onChange:e=>{l(e.target.value)},...o})})});OC.displayName="ColorPicker";const RC=({onChange:e,css:n,label:t,description:s,value:o,hint:a,state:r,initialValue:d,icon:l,...c})=>{const u=Fi(),m=(0,V.useRef)(null),{inputId:g,descId:h,errorId:p}=Sc();return(0,i.jsxs)(Tl,{css:n,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:g,isClickable:!1,children:t}),(0,i.jsx)(yc,{id:h,children:s}),(t||s)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Ec,{cursor:"default",icon:l,state:r,onClick:()=>{m.current?.click()},children:[(0,i.jsxs)(Tl,{align:"center",css:{flex:"1"},height:1,children:[(0,i.jsx)(OC,{ref:m,"aria-describedby":s?h:void 0,"aria-errormessage":"error"===r?p:void 0,"aria-invalid":"error"===r,id:g,value:o,onChange:e,...c}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(Mr,{"aria-hidden":!0,color:"gray800",css:{flex:"1","& input[type=text]":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},height:1,onClick:jc,children:(0,i.jsx)("input",{disabled:"disabled"===r,id:g,type:"text",value:o,onChange:n=>{e(n.target.value)},...c})})]}),d&&o!==d&&(0,i.jsx)(tc,{color:"invisible",css:{color:"$primary500"},onClick:n=>{jc(n),e(d)},children:u("remettre_sa_v_90478")})]}),(0,i.jsx)(Cc,{id:p,state:r,children:a})]})},DC=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(Dl.D0,{name:e,render:o=>{const a=_c(o.meta);return(0,i.jsx)(RC,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onChange:e=>{o.input.onChange(e)},...s})}}),MC=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(Dl.D0,{name:e,render:o=>{const a=o.meta.data?.forceDisplayError&&o.meta.invalid||o.meta.touched&&o.meta.invalid;return(0,i.jsx)(Kp,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),PC=({onChange:e,prefix:n,state:t,withFileField:s,...o})=>{const a=`${n}key`,r=`${n}name`,d=`${n}acl`,l=[a,r,d];let c;return s&&(c=`${n}file`,l.push(c)),(0,i.jsx)(ej,{names:l,render:n=>{let l=null;g(n[a].input.value)&&g(n[r].input.value)&&g(n[d].input.value)&&(l={key:n[a].input.value,name:n[r].input.value,acl:n[d].input.value});const{invalid:u,hint:m}=Object.values(n).reduce((e,n)=>e.invalid?e:_c(n.meta)?{invalid:!0,hint:n.meta.error||n.meta.submitError}:e,{invalid:!1,hint:void 0});return(0,i.jsx)(Lv,{hint:m,state:u?"error":t,value:l,onChange:t=>{n[a].input.onChange(t?.key??""),n[a].input.onBlur(),n[r].input.onChange(t?.name??""),n[r].input.onBlur(),n[d].input.onChange(t?.acl??""),n[d].input.onBlur(),s&&(n[c].input.onChange(t?.file),n[c].input.onBlur(),t?.file&&e?.(t.file))},...o})}})},kC=br("div",{alignItems:"center",borderRadius:"$1",color:"$gray600",cursor:"pointer",display:"flex",height:"40px",justifyContent:"center",width:"40px",variants:{active:{true:{background:"$primary100",color:"$primary500"},false:{"&:hover":{background:"$gray200",color:"$gray800"}}}}}),FC=({css:e,label:n,description:t,value:s,height:o,renderOnPortal:a,onChange:r,...d})=>{const l=Fi(),[c,u]=(0,V.useState)(!1),m=(0,V.useMemo)(()=>(0,Lm.A)(Zt.map(e=>({value:e,name:l(e)})),e=>e.name),[]);return(0,i.jsxs)(Tl,{css:e,direction:"column",width:1,children:[(0,i.jsx)(bc,{children:n}),(0,i.jsx)(yc,{children:t}),(n||t)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Ou,{isOpen:c,onStateChange:u,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Ec,{cursor:"pointer",icon:Hl(s),rightIcon:c?"chevron-up":"chevron-down",...d,children:(0,i.jsx)(Mr,{css:{flex:"1"},children:l(s)})})}),(0,i.jsx)(Fu,{maxHeight:300,placement:"bottom",renderOnPortal:a,width:"match",children:(0,i.jsx)(Tl,{css:{px:"$2"},gap:"2",width:1,wrap:"wrap",children:m.map(e=>(0,i.jsx)(kC,{active:s===e.value,onClick:()=>{u(!1),r(e.value)},children:(0,i.jsx)(Yl,{icon:Hl(e.value)})},e.value))})})]})]})},NC=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(Dl.D0,{name:e,render:o=>{const a=_c(o.meta);return(0,i.jsx)(FC,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),LC=e=>{const n=Fi(),[t,s]=(0,V.useState)(!1);return(0,i.jsxs)(Tl,{gap:"4",width:1,children:[(0,i.jsx)(Mr,{css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",cursor:e.allowCrop?"pointer":void 0},height:126,width:126,onClick:e.allowCrop?()=>s(!0):void 0,children:(0,i.jsx)("img",{src:e.url,style:{objectFit:"cover",inlineSize:"100%",blockSize:"100%"}})}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray400",children:e.hint})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Mr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",onClick:e.onDelete,children:n("supprimer_43083")})]}),e.allowCrop&&t&&(0,i.jsx)(Pv,{image:{name:e.url.split("/").pop().split(".").join("-cropped."),src:`${e.url}?cacheblock=true`},onChange:e.onChange,onClose:()=>s(!1)})]})},UC=e=>(0,i.jsxs)(Tl,{gap:"4",width:1,children:[(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,children:(0,i.jsx)(Tl,{height:64,width:64,children:(0,i.jsx)(Xl,{color:Ar.colors.gray900.value,height:"64px",strokeWidth:"4",width:"64px"})})}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray400",children:e.hint})]})]})]}),VC=({allowCrop:e,value:n,onChange:t,label:s,hint:o,organizationId:a,...r})=>{const[d,l]=(0,V.useState)(n?Nv.File:Nv.Uploader),c=async e=>{l(Nv.Uploading);try{const n=await _v(a,e,"public-read");t(n),l(Nv.File)}catch{l(Nv.Uploader)}};return d===Nv.File&&n?(0,i.jsx)(LC,{allowCrop:e,hint:o,label:s,url:vv(n,F.HEAVENT_AWS_UPLOADS_BUCKET),onChange:c,onDelete:()=>{t(null),l(Nv.Uploader)}}):d===Nv.Uploading?(0,i.jsx)(UC,{hint:o,label:s}):(0,i.jsx)(Mv,{allowCrop:e,hint:o,label:s,onChange:c,...r})},BC=({prefix:e,...n})=>{const t=`${e}key`,s=`${e}name`,o=`${e}acl`;return(0,i.jsx)(ej,{names:[t,s,o],render:e=>{let a=null;return g(e[t].input.value)&&g(e[s].input.value)&&g(e[o].input.value)&&(a={key:e[t].input.value,name:e[s].input.value,acl:e[o].input.value}),(0,i.jsx)(VC,{value:a,onChange:n=>{e[t].input.onChange(n?.key??""),e[s].input.onChange(n?.name??""),e[o].input.onChange(n?.acl??"")},...n})}})};function WC(e,n){const t=ki(Ig),s=Um();return(0,V.useMemo)(()=>e?e.fieldType===Qe.Country?t.getCountriesIdName(n).map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e)):e.fieldType===Qe.Language?e.fieldProperty===Ke.Language?s(ru):s(Qt):e.fieldType===Qe.Nationality?t.getNationalitiesIdName(n).map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e)):e.fieldType===Qe.Sex?s(pi):e.values.map(({id:n,value:t,color:s})=>(0,i.jsx)("option",{"data-badge":e.listType===un.Badge,"data-color":e.listType===un.Default?void 0:s,value:n,children:t},n)):(0,i.jsx)(i.Fragment,{}),[e,n])}const GC=e=>{const{translate:n,params:{organizationId:t}}=Kl(),s=ki(wC),o=ki(X_),a=WC(e.customField),r=(0,V.useMemo)(()=>wi.filter(e=>e!==gt.Error),[]);if((0,V.useEffect)(()=>{e.slug===ae.Acronym||e.slug===ae.Address||e.slug===ae.Color||e.slug===ae.Description||e.slug===ae.Icon||e.slug===ae.Name||e.slug===vn.Acronym||e.slug===vn.Address||e.slug===vn.Color||e.slug===vn.Description||e.slug===vn.Icon||e.slug===vn.Name||e.slug===ze.Description||e.slug===ze.Name||e.customField?.fieldType===Qe.Address||e.customField?.fieldType===Qe.Country||e.customField?.fieldType===Qe.Language||e.customField?.fieldType===Qe.Nationality||e.customField?.fieldType===Qe.Sex||e.customField?.fieldType===Qe.Text||e.customField?.fieldType===Qe.Textarea||e.customField?.fieldType===Qe.Time?"string"!=typeof e.value&&e.change(e.name,""):e.slug===ae.AutoAccredit||e.slug===ae.WeezeventIsSynchronized||e.slug===we.Privacy||e.slug===ze.IsLocked||e.slug===ze.ShowInDelegationSpace||e.slug===ze.CanLeadersAddMembers||e.slug===ze.CanLeadersEditCustomFields||e.slug===ze.CanLeadersEditMembers||e.slug===ze.CanLeadersDeleteMembers||e.slug===ze.CanLeadersDuplicateMembers||e.slug===ze.CanLeadersEditColumns||e.slug===ze.CanLeadersImportMembers||e.slug===ze.CanLeadersSeeHiddenAccreditationsSlots||e.slug===ze.ShowAllAccreditations||e.slug===ze.ShowFormLinkInDelegationSpace||e.slug===vn.WeezeventIsSynchronized||e.customField?.fieldType===Qe.Checkbox||e.customField?.fieldType===Qe.Validation?"boolean"!=typeof e.value&&e.change(e.name,!1):e.slug===ae.Category||e.slug===ze.Category||e.slug===vn.Category?"number"!=typeof e.value&&e.change(e.name,e.categories[0]?.id):e.slug===ae.Index||e.slug===ae.Latitude||e.slug===ae.Longitude||e.slug===vn.Latitude||e.slug===vn.Longitude||e.slug===vn.Zoom||e.slug===ze.MaxResources||e.customField?.fieldType===Qe.Number?"number"!=typeof e.value&&e.change(e.name,0):e.slug===ae.Tag||e.slug===vn.Tag||e.slug===ze.Campaigns||e.slug===ze.Documents||e.slug===ze.Tag||e.slug===vn.Traces?Array.isArray(e.value)||e.change(e.name,[]):e.slug===ze.DeadlineDate||e.customField?.fieldType===Qe.Date||e.customField?.fieldType===Qe.Datetime?Oo.c9.isDateTime(e.value)||g(e.value)||e.change(e.name,Oo.c9.invalid("Invalid")):e.customField?.fieldType===Qe.File?null!==e.value&&"object"==typeof e.value||e.change(e.name,s.documentInputDefault()):e.customField?.fieldType===Qe.Phone?null!==e.value&&"object"==typeof e.value||e.change(e.name,o.basePhoneInputDefault()):e.customField?.fieldType===Qe.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===ze.Form?"number"!=typeof e.value&&e.change("massEdit.value",e.forms[0].id):e.slug===ze.DelegationsSpaceLayout?"number"!=typeof e.value&&Yo(e.delegationsSpaceLayouts)&&e.change("massEdit.value",e.delegationsSpaceLayouts[0].id):e.slug===vn.Layer?ei.includes(e.value)||e.change("massEdit.value",gn.Google):e.slug===ct.State?r.includes(e.value)||e.change("massEdit.value",r[0]):e.slug===ct.Frequency&&(Ci.includes(e.value)||e.change("massEdit.value",dt.Every10Minutes))},[e.customField,e.slug]),e.slug===ae.Acronym||e.slug===vn.Acronym||e.slug===ae.Address||e.slug===vn.Address||e.customField?.fieldType===Qe.Address||e.customField?.fieldType===Qe.Text)return(0,i.jsx)($c,{name:e.name});if(e.slug===ae.AutoAccredit||e.slug===ae.WeezeventIsSynchronized||e.slug===ze.IsLocked||e.slug===ze.ShowFormLinkInDelegationSpace||e.slug===ze.ShowInDelegationSpace||e.slug===ze.CanLeadersAddMembers||e.slug===ze.CanLeadersEditCustomFields||e.slug===ze.CanLeadersEditMembers||e.slug===ze.CanLeadersDeleteMembers||e.slug===ze.CanLeadersDuplicateMembers||e.slug===ze.CanLeadersEditColumns||e.slug===ze.CanLeadersImportMembers||e.slug===ze.CanLeadersSeeHiddenAccreditationsSlots||e.slug===ze.ShowAllAccreditations||e.slug===vn.WeezeventIsSynchronized||e.customField?.fieldType===Qe.Checkbox||e.customField?.fieldType===Qe.Validation)return(0,i.jsxs)(ny,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]});if(e.slug===we.Privacy)return(0,i.jsxs)(ny,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:n("Private")}),(0,i.jsx)("option",{value:"false",children:n("Public")})]});if(e.slug===ae.Category||e.slug===ze.Category||e.slug===vn.Category)return(0,i.jsx)(of,{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===ae.Color||e.slug===vn.Color)return(0,i.jsx)(DC,{name:e.name});if(e.slug===ae.Description||e.slug===ze.Description||e.slug===vn.Description)return(0,i.jsx)(Mr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(iS,{name:e.name})});if(e.slug===ae.Icon||e.slug===vn.Icon)return(0,i.jsx)(NC,{name:e.name});if(e.slug===ae.Latitude||e.slug===vn.Latitude)return(0,i.jsx)(ef,{name:e.name});if(e.slug===ae.Longitude||e.slug===vn.Longitude)return(0,i.jsx)(ef,{name:e.name});if(e.slug===ae.Name||e.slug===vn.Name||e.slug===ct.Name)throw new Error("Should not happen");return e.slug===ct.State?(0,i.jsx)(ny,{name:e.name,children:r.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}):e.slug===ct.Frequency?(0,i.jsx)(ny,{name:e.name,children:Ci.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}):e.slug===ze.Campaigns?(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===ze.Documents?(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))}):e.slug===ae.Tag||e.slug===vn.Tag||e.slug===ze.Tag?(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.tags.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===vn.Traces?(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===ae.Index||e.slug===ze.MaxResources||e.slug===vn.Zoom||e.customField?.fieldType===Qe.Number?(0,i.jsx)($c,{name:e.name,shouldParseAsInt:!0}):e.customField?.fieldType===Qe.Country?(0,i.jsx)(of,{isSearchVisible:!0,name:e.name,children:a}):e.slug===ze.DeadlineDate||e.customField?.fieldType===Qe.Date?(0,i.jsx)(Qx,{name:e.name}):e.customField?.fieldType===Qe.Datetime?(0,i.jsx)(MC,{name:e.name}):e.customField?.fieldType===Qe.File?e.customField.fileType===en.Picture?(0,i.jsx)(BC,{allowCrop:!0,organizationId:t,prefix:`${e.name}.`}):(0,i.jsx)(PC,{accept:[gv.Images,gv.Pdf],acl:"private",organizationId:t,prefix:`${e.name}.`}):e.customField?.fieldType===Qe.Language?(0,i.jsxs)(ny,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:n("s_lectionnez_un_31086")}),a]}):e.customField?.fieldType===Qe.Nationality?(0,i.jsx)(of,{isSearchVisible:!0,name:e.name,children:a}):e.customField?.fieldType===Qe.Phone?(0,i.jsx)(tj,{prefix:`${e.name}.`}):e.customField?.fieldType===Qe.Select?e.customField.canSelectMultiple?(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:e.name,children:a}):(0,i.jsx)(of,{isSearchVisible:!0,name:e.name,placeholder:n("s_lectionnez_un_44130"),children:a}):e.customField?.fieldType===Qe.Sex?(0,i.jsxs)(ny,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:n("s_lectionnez_un_43620")}),a]}):e.customField?.fieldType===Qe.Textarea?(0,i.jsx)(rf,{name:e.name}):e.customField?.fieldType===Qe.Time?(0,i.jsx)(rS,{name:e.name}):e.slug===ze.Form?(0,i.jsx)(of,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===ze.DelegationsSpaceLayout?(0,i.jsx)(of,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.delegationsSpaceLayouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===vn.Layer?(0,i.jsxs)(ny,{name:e.name,children:[(0,i.jsx)("option",{value:gn.Google,children:"Plan"}),(0,i.jsx)("option",{value:gn.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:gn.IgnPlan,children:"IGN Plan"})]}):null},qC=e=>(0,i.jsxs)(Yx,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsx)(dc,{css:{flex:"1",textTransform:"uppercase"},textStyle:"smallcapsheading",children:e.title}),e.buttons]}),e.children]});function HC(e){return(0,Lm.A)(e,e=>u(e.name))}function YC(e){const n=(0,fm.A)(e,e=>e.category.id);return HC((0,Rg.A)(e.map(e=>e.category),e=>e.id)).map(e=>({category:e,items:(0,Lm.A)(n[e.id],e=>u(e.name))}))}function ZC(e,n){switch(e){case Qe.Text:case Qe.Textarea:return"text";case Qe.Checkbox:return"square-check";case Qe.Validation:return"check";case Qe.Select:return"population"===n?"users":"list-ul";case Qe.Date:return"calendar";case Qe.Datetime:return"calendar-day";case Qe.Time:return"clock";case Qe.File:return"file";case Qe.Phone:return"phone";case Qe.Language:return"language";case Qe.Number:return"00";case Qe.Sex:return"venus-mars";case Qe.Nationality:case Qe.Country:return"flag";case Qe.Address:return"map-location";default:return Zl()}}function KC(e){return(0,Lm.A)(Object.entries((0,fm.A)(e,e=>e.category.name)),([e])=>e).flatMap(([e,n])=>[{id:W(),elementType:tn.Section,section:e,hasCondition:!1,conditionValue:!1}].concat(n.map(e=>({id:W(),elementType:tn.Field,customField:e,hasCondition:!1,conditionValue:!1}))))}function XC(e,n=e=>e.id){return YC(e).map(({category:e,items:t})=>(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{"data-subtext":e.label,value:n(e),children:e.name},e.id))},e.id))}const QC=/^\{user\.(.+)\}$/,JC=e=>{const{translate:n}=Kl(),t=e.customFields.find(n=>n.id===e.customFieldValues.customFieldId),s=!0===e.canLinkToField&&t?.fieldType!==Qe.Select,o=s&&(e.customFieldValues.fromField??(g(e.customFieldValues.value)&&QC.test(e.customFieldValues.value.trim()))),a=(0,V.useMemo)(()=>t?e.customFields.filter(e=>e.fieldType===t.fieldType&&e.id!==t.id):[],[e.customFields,t]),r=(0,V.useMemo)(()=>XC(e.customFields),[e.customFields]),d=(0,V.useMemo)(()=>XC(a,e=>`{user.${e.slug}}`),[a]),l=t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(GC,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:t,delegationsSpaceLayouts:[],forms:[],name:`${e.field}.value`,slug:t.slug,tags:[],traces:[],value:e.customFieldValues.value}),pC(t)&&(0,i.jsx)(Xx,{name:`${e.field}.addValues`,children:n("ajouter_les_val_22996")})]}),c=n=>{n!==o&&(e.change(`${e.field}.fromField`,n),e.change(`${e.field}.value`,void 0),e.change(`${e.field}.addValues`,!1))};return(0,i.jsx)(qC,{buttons:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),(0,i.jsx)(Dx,{placement:"top",children:n("supprimer_43083")})]}),title:n("champ_de_formul_73221",e.index+1),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsxs)(of,{isSearchVisible:!0,label:n("CustomField"),name:`${e.field}.customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:n("s_lectionner_un_48159")}),r]}),t&&(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("nouvelle_valeur_39039",t.name)}),s?(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(cm,{state:o?"unchecked":"checked",onClick:()=>c(!1),children:n("saisir_une_nouv_92931")}),!o&&(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},direction:"column",gap:"1",children:l}),(0,i.jsx)(cm,{state:o?"checked":"unchecked",onClick:()=>c(!0),children:n("lier_un_autre_51509")}),o&&(0,i.jsx)(Mr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(of,{isSearchVisible:!0,name:`${e.field}.value`,placeholder:n("choisir_un_cham_67587"),children:d})})]}):l]})]})})},eb=e=>{const n=Fi();return(0,i.jsx)(Tl,{direction:"column",gap:"3",children:Yo(e.values)?(0,i.jsxs)(i.Fragment,{children:[e.values.map((n,t)=>{const s=`${e.name}[${t}]`;return(0,i.jsx)(Tl,{direction:"column",children:(0,i.jsx)(Tl,{gap:"3",children:(0,i.jsx)(JC,{canLinkToField:e.canLinkToField,change:e.change,customFieldValues:e.values[t],customFields:e.customFields,field:s,index:t,remove:()=>{e.change(e.name,Jo(e.values,t))}})})},t)}),(0,i.jsx)(tc,{color:"invisible",css:{"::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:n("ajouter_un_nouv_22370")})]}):(0,i.jsx)(Yx,{align:"center",css:{background:"$gray50",textAlign:"center"},gap:"2",children:(0,i.jsxs)(Tl,{align:"center",css:{textAlign:"center"},direction:"column",gap:"2",children:[(0,i.jsx)(rc,{css:{fontWeight:"$medium"},children:n("aucun_champ_est_98607")}),(0,i.jsx)(tc,{color:"invisible",css:{inlineSize:"fit-content","::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:n("_lier_un_champ_52842")})]})})})},nb=e=>(0,i.jsx)(Tl,{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)(Tl,{align:"center",css:{background:`$${e.color}100`,borderRadius:"32px"},height:32,justify:"center",width:32,children:(0,i.jsx)(Yl,{icon:e.icon})})}),tb=e=>{const n=Fi(),t=ki(Ol),s=Sc();return(0,i.jsx)(dg,{size:e.size||"sm",onClose:e.onClose,children:(0,i.jsx)(xc,{css:{overflow:"hidden"},direction:"column",height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:t=>{const{handleSubmit:o,submitting:a}=t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:e.icon})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{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)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",id:s.descId,textAlign:"center",children:e.subtitle})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(hc,{}),(0,i.jsx)(Tl,{css:{overflowY:"auto"},direction:"column",children:"function"==typeof e.children?e.children(t):e.children}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{isLoading:a,onClick:o,children:e.buttonText}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},validate:n=>e.schema?t.validateForForm(e.schema)(n):{},onSubmit:e.onSubmit})})},ib=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("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)(tb,{buttonText:n("cr_er_82895"),icon:"tag",initialValues:{name:""},title:n("cr_er_un_tag_59505"),onClose:e.onClose,onSubmit:async n=>{const{tagCreate:i}=await t({organizationId:e.organizationId,tag:n.name});e.onSuccess(i),e.onClose()},children:(0,i.jsx)($c,{label:n("nom_du_tag_95054"),name:"name"})})},sb=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.tags),[o,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(of,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:n("tags_79499")}),multiple:!0,name:`${e.name}tagsIds`,onCreateClick:()=>{a(!0)},children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),o&&(0,i.jsx)(ib,{organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:n=>{s([...t,n]),e.change(`${e.name}tagsIds`,[...e.tagsIds,n.id])}})]})},ob=({formattedAddressProps:e,getAddress:n,hint:t,latitudeProps:s,longitudeProps:o,onPlaceChange:a,state:r,...d})=>{const l=Fi(),c=(0,V.useRef)(null),u=(0,V.useRef)({getAddress:n,onPlaceChange:a});u.current={getAddress:n,onPlaceChange:a};const m=_c(e.meta);return(0,V.useEffect)(()=>{const n=new google.maps.places.Autocomplete(c.current,{types:["geocode"]});n.addListener("place_changed",()=>{const t=n.getPlace();if(t.geometry?.location){const n=t.geometry.location.lat(),i=t.geometry.location.lng();e.input.onChange(u.current.getAddress?.(t)??t.formatted_address),s?.input.onChange(n),o?.input.onChange(i),u.current.onPlaceChange?.(t)}})},[]),(0,i.jsx)(wc,{ref:c,hint:m?e.meta.error||e.meta.submitError:t,placeholder:l("indiquez_un_lie_85634"),state:m?"error":r,value:e.input.value,onBlur:e.input.onBlur,onChange:e.input.onChange,onFocus:e.input.onFocus,...d})},ab=({addressName:e,latitudeName:n,longitudeName:t,...s})=>{const o=[e];return n&&o.push(n),t&&o.push(t),(0,i.jsx)(ej,{names:o,render:o=>(0,i.jsx)(ob,{formattedAddressProps:o[e],latitudeProps:n?o[n]:void 0,longitudeProps:t?o[t]:void 0,...s})})};function rb(e,n){const t=n=>e.address_components?.find(({types:e})=>e.includes(n)),i=t("country")?.short_name;return{street:e.name,postalCode:t("postal_code")?.long_name,city:t("locality")?.long_name,countryCode:n.countryCodeExists(i)?i:void 0}}const db=e=>{const{translate:n}=Kl(),t=ki(Ig),s=ki(zC),o=WC(e.field,e.countryCode),a=e.isMandatory?e.field.name:(0,i.jsx)(Uv,{children:e.field.name}),r=`${e.prefix}${e.field.slug}`,d=e.field.description,l=(0,V.useMemo)(()=>r.startsWith("formRegister.userInfo.fields."),[r]),c=function({change:e,field:n,prefix:t}){const i=ki(Ig),s=(0,Dl.mN)();return(0,V.useMemo)(()=>{const o=function(e){return e.fieldProperty===Ke.Street?{isCity:!1,postalCode:"postalCode",city:"city",country:"country",latitude:"latitude",longitude:"longitude"}:e.fieldProperty===Ke.BirthCity?{isCity:!0,postalCode:"birthPostalCode",city:null,country:"birthCountry",latitude:null,longitude:null}:e.addressPostalCodeCustomField||e.addressCityCustomField||e.addressCountryCustomField?{isCity:!1,postalCode:e.addressPostalCodeCustomField?.slug??null,city:e.addressCityCustomField?.slug??null,country:e.addressCountryCustomField?.slug??null,latitude:null,longitude:null}:null}(n);if(o){const n=(n,i,o=!1)=>{if(n&&void 0!==i){const a=`${t}${n}`;(o||s.getFieldState(a))&&e(a,i)}};return{getAddress(e){const n=rb(e,i);return(o.isCity?n.city:n.street)??e.formatted_address??""},onPlaceChange(e){const t=rb(e,i);n(o.postalCode,t.postalCode),n(o.city,t.city),n(o.country,t.countryCode),n(o.latitude,e.geometry?.location?.lat(),!0),n(o.longitude,e.geometry?.location?.lng(),!0)}}}return{}},[e,i,n,s,t])}(e);if((0,V.useEffect)(()=>{e.display||e.change(r,s.fieldUpdateInputDefault(e.field,t.getDefaultCountryValues()))},[e.display,e.field,e.change]),!e.display)return null;switch(e.field.fieldType){case Qe.Text:return(0,i.jsx)($c,{description:d,disabled:e.disabled,label:a,name:r});case Qe.Textarea:return(0,i.jsx)(rf,{description:d,disabled:e.disabled,label:a,name:r});case Qe.Checkbox:return(0,i.jsx)(Xx,{disabled:e.disabled,name:r,subtext:d,children:a});case Qe.Validation:return(0,i.jsx)(Xx,{disabled:e.disabled,name:r,subtext:(0,i.jsxs)(i.Fragment,{children:[g(d)&&(0,i.jsx)("span",{children:d}),g(d)&&e.field.document&&(0,i.jsx)("br",{}),e.field.document&&(0,i.jsx)(Xm,{css:{color:"$primary500"},download:e.field.document.name,to:e.field.document.url,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:n("consulter_le_do_69928")})]}),children:a});case Qe.Select:return e.field.canSelectMultiple?(0,i.jsx)(of,{description:d,disabled:e.disabled,isSearchVisible:!0,isSelectAllVisible:!0,label:a,multiple:!0,name:r,children:o}):(0,i.jsx)(of,{description:d,disabled:e.disabled,isSearchVisible:!0,label:a,name:r,placeholder:n("choisir_une_val_00277"),children:o});case Qe.Date:return"dateOfBirth"===e.field.slug?(0,i.jsx)(Qx,{autoComplete:l?"bday":void 0,description:d,disabled:e.disabled,label:a,max:yp,min:Sp,name:r}):(0,i.jsx)(Qx,{description:d,disabled:e.disabled,label:a,name:r});case Qe.Datetime:return(0,i.jsx)(MC,{description:d,disabled:e.disabled,label:a,name:r});case Qe.Time:return(0,i.jsx)(rS,{description:d,disabled:e.disabled,label:a,name:r});case Qe.Phone:return(0,i.jsx)(tj,{description:d,disabled:e.disabled,label:a,prefix:`${r}.`});case Qe.Number:return(0,i.jsx)($c,{description:d,disabled:e.disabled,label:a,name:r,shouldParseAsInt:!0});case Qe.Sex:return(0,i.jsxs)(ny,{autoComplete:l?"sex":void 0,description:d,disabled:e.disabled,label:a,name:r,children:[(0,i.jsx)("option",{disabled:!0,value:"",children:n("choisir_une_val_00277")}),o]});case Qe.Language:return(0,i.jsx)(of,{autoComplete:l?"language":void 0,description:d,disabled:e.disabled,isSearchVisible:!0,label:a,name:r,placeholder:n("choisir_une_val_00277"),children:o});case Qe.Nationality:return(0,i.jsx)(of,{description:d,disabled:e.disabled,isSearchVisible:!0,label:a,name:r,placeholder:n("choisir_une_val_00277"),children:o});case Qe.Address:return(0,i.jsx)(ab,{addressName:r,autoComplete:l?"street-address":void 0,description:d,disabled:e.disabled,label:a,...c});case Qe.Country:return(0,i.jsx)(of,{autoComplete:l?"country":void 0,description:d,disabled:e.disabled,isSearchVisible:!0,label:a,name:r,placeholder:n("choisir_une_val_00277"),children:o});case Qe.File:return e.field.fileType===en.Picture?(0,i.jsx)(BC,{allowCrop:!0,disabled:e.disabled,hint:d,label:a,organizationId:e.organizationId,prefix:`${r}.`}):(0,i.jsx)(PC,{accept:[gv.Images,gv.Pdf,gv.Videos],acl:e.fileAcl??"private",description:d,disabled:e.disabled,label:a,organizationId:e.organizationId,prefix:`${r}.`});default:return Zl(e.field.fieldType)}},lb=e=>{const n=Fi(),[t,s]=(0,V.useState)(""),o=(0,V.useMemo)(()=>{if(g(t)){const n=u(t);return e.customFields.filter(e=>u(e.name).includes(n)||g(e.label)&&u(e.label).includes(n))}return e.customFields},[e.customFields,t]),a=(0,V.useMemo)(()=>YC(o),[o]);return(0,i.jsxs)(Tl,{css:{padding:"$3"},direction:"column",width:1,children:[(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_c_86475"),state:"search",value:t,onChange:s}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Mr,{css:{maxHeight:"300px",overflowY:"auto"},children:a.map(({category:t,items:s},o)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(am,{index:o,children:t.name}),s.map(t=>t.conditionCustomField&&!e.selectedCustomFieldsIds.has(t.conditionCustomField.id)?(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsxs)(Tl,{align:"center",css:{px:"$3"},gap:"3",height:40,width:1,children:[(0,i.jsx)(sm,{disabled:!0,shouldPreventDefault:!1,state:"unchecked",onClick:Bc.A}),(0,i.jsx)(Mr,{color:"gray400",css:{ellipsis:!0,flex:"1"},title:t.name,children:t.name})]},t.id)}),(0,i.jsx)(Dx,{placement:"top-start",children:n("ce_champ_d_pend_31209",t.conditionCustomField?.name)})]},t.id):(0,i.jsx)(um,{isCheckbox:!0,isRadio:!1,isSelected:e.selectedCustomFieldsIds.has(t.id),subtext:t.label,value:t.id,onClick:()=>{e.toggle(t)},children:t.name},t.id))]},t.id))})]})},cb=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:n("ajouter_97327")})}),(0,i.jsx)(Fu,{placement:"top-start",width:400,children:(0,i.jsx)(lb,{customFields:e.customFields,selectedCustomFieldsIds:e.usedCustomFieldsIds,toggle:e.toggle})})]})},ub=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("aucun_champ_per_21094")}),(0,i.jsx)(cb,{customFields:e.customFields,toggle:e.toggle,usedCustomFieldsIds:e.usedCustomFieldsIds})]})},mb=e=>{const{params:{organizationId:n}}=Kl(),t=(0,V.useMemo)(()=>e.customFields.filter(n=>e.usedCustomFieldsIds.includes(n.id)),[e.customFields,e.usedCustomFieldsIds]),s=(0,V.useMemo)(()=>new Set(e.usedCustomFieldsIds),[e.usedCustomFieldsIds]),o=(0,V.useCallback)(n=>{s.has(n.id)?e.change(`${e.prefix}usedCustomFieldsIds`,e.usedCustomFieldsIds.filter(e=>e!==n.id)):e.change(`${e.prefix}usedCustomFieldsIds`,[...e.usedCustomFieldsIds,n.id])},[e.prefix,e.usedCustomFieldsIds,s]);return(0,i.jsx)(Tl,{children:Yo(e.usedCustomFieldsIds)?(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"4",children:[t.map(s=>{const a=AC(s,e.fields,t),r=(0,i.jsx)(db,{change:e.change,display:a,field:s,fileAcl:"public-read",isMandatory:!1,organizationId:n,prefix:`${e.prefix}fields.`});return a?(0,i.jsxs)(Tl,{align:"end",gap:"3",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:r}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",onClick:()=>o(s)})]},s.id):(0,i.jsx)(V.Fragment,{children:r},s.id)}),(0,i.jsx)(cb,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})]}):(0,i.jsx)(ub,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})})};function gb(e){return(0,Lm.A)(e,e=>u(e.name)).filter(e=>Yo(e.accreditationsProfiles)).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Lm.A)(e.accreditationsProfiles,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))}const hb=e=>(0,i.jsx)(Tl,{css:{background:"$gray50",overflowX:"auto",padding:"$6",...e.css},direction:"column",gap:"4",height:1,width:1,children:e.children}),pb=e=>(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Tl,{align:"center",css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$medium"},gap:"3",children:e.category}),(0,i.jsx)(Tl,{direction:"column",gap:"3",children:e.children})]}),Ib=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>rh(e.accreditation),[e.accreditation]),[s,o]=(0,V.useState)(!0),a=e.displaySlots||"function"==typeof e.renderCheckbox;return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",css:{cursor:a?"pointer":"default",padding:"$3 $4"},gap:"2",onClick:()=>{o(!s),e.onClick?.()},children:[e.displaySlots&&(0,i.jsx)(Tl,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(Yl,{icon:s?"chevron-down":"chevron-right"})}),e.renderCheckbox?.(),(0,i.jsx)(xI,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:t}),e.badge]}),e.displayNumberOfSlots&&(0,i.jsx)(Mr,{color:"gray500",children:n("creneau",e.numberOfSlots)})]}),e.renderActions?.()]}),(e.displayFormCustomFields||e.displaySlots&&s)&&(0,i.jsx)(Tl,{css:{borderTop:"1px solid $gray200"},direction:"column",children:e.children})]})},xb=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(e.maxResources);return(0,i.jsxs)(xx,{children:[(0,i.jsx)(fx,{children:(0,i.jsx)(Mr,{css:{cursor:"pointer"},children:(0,i.jsx)(Yl,{icon:"gear"})})}),(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"badge-check",children:n("ajout_d_un_quot_09767",e.name)}),(0,i.jsx)(hx,{children:(0,i.jsx)(wc,{hint:n("laissez_vide_po_88385"),label:n("quel_quota_voul_63115"),min:1,rightIcon:"xmark",shouldParseAsInt:!0,value:t||"",onChange:s,onRightIconClick:()=>s(null)})}),(0,i.jsx)(gx,{children:s=>(0,i.jsx)(tc,{onClick:()=>{e.onChange(t),s()},children:n("ajouter_le_quot_40849")})})]})]})};function fb(e,n,t,i){const s=(0,wo.A)(n.map(e=>e.accreditationId)).map(t=>e.accreditations.find(e=>e.accreditationId===t)??{accreditationCategoryId:n.find(e=>e.accreditationId===t).accreditationCategoryId,accreditationId:t,maxResources:null,willAutoAccredit:!0});i(`${t}accreditationsCategories`,(0,wo.A)(n.map(e=>e.accreditationCategoryId)).map(n=>e.accreditationsCategories.find(e=>e.accreditationCategoryId===n)??{accreditationCategoryId:n,maxResources:null})),i(`${t}accreditations`,s),i(`${t}accreditationsSlots`,n)}const _b=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(void 0),o=`${e.prefix}accreditationsSlots`,a=(0,V.useCallback)(n=>{e.change(o,(0,dp.jM)(e.delegationAccreditations.accreditationsSlots,t=>{t.forEach(t=>{e.slotsIds.includes(t.accreditationSlotId)&&(t.maxResources=n)})})),s(n)},[o,e.slotsIds,e.delegationAccreditations,e.change,s]),r=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.find(n=>n.accreditationSlotId===e.selectedSlotsIds[0]),[e.selectedSlotsIds,e.delegationAccreditations.accreditationsSlots]),d=r?.isDefault??!1,l=r?.isVisible??!0,c=(0,V.useCallback)(()=>{e.change(o,(0,dp.jM)(e.delegationAccreditations.accreditationsSlots,n=>{n.forEach(n=>{e.selectedSlotsIds.includes(n.accreditationSlotId)&&(d?(n.isDefault=!1,n.isVisible=!0):n.isDefault=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[o,e.selectedSlotsIds,e.delegationAccreditations,e.change,d]),u=(0,V.useCallback)(()=>{e.change(o,(0,dp.jM)(e.delegationAccreditations.accreditationsSlots,n=>{n.forEach(n=>{e.selectedSlotsIds.includes(n.accreditationSlotId)&&(l?(n.isDefault=!0,n.isVisible=!1):n.isVisible=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[o,e.selectedSlotsIds,e.delegationAccreditations,e.change,l]),m=(0,V.useCallback)(()=>{e.change("selectedAccreditationsSlotsIds",(0,em.A)(e.selectedAccreditationsSlotsIds,e.selectedSlotsIds)),fb(e.delegationAccreditations,e.delegationAccreditations.accreditationsSlots.filter(n=>!e.selectedSlotsIds.includes(n.accreditationSlotId)),e.prefix,e.change)},[e.selectedSlotsIds,e.selectedAccreditationsSlotsIds,e.delegationAccreditations,e.prefix,e.change]);return Yo(e.selectedSlotsIds)?(0,i.jsxs)(Tl,{gap:"3",onClick:jc,children:[(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:c,children:[(0,i.jsx)(Mr,{fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:"badge"})}),(0,i.jsx)(Mr,{fontWeight:"medium",children:n(d?"ne_pas_pr_coch_91856":"pr_cocher_par_18369")})]}),(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:u,children:[(0,i.jsx)(Mr,{fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:l?"eye-slash":"eye"})}),(0,i.jsx)(Mr,{fontWeight:"medium",children:n(l?"masquer_34645":"rendre_visible_37057")})]}),(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",children:[(0,i.jsx)(Mr,{fontWeight:"medium",children:n("total_07173")}),(0,i.jsx)(Mr,{width:100,children:(0,i.jsx)(wc,{min:0,rightIcon:"xmark",shouldParseAsInt:!0,value:t??"",onChange:a,onRightIconClick:()=>a(void 0)})})]}),(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:m,children:[(0,i.jsx)(Mr,{fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:"trash-can"})}),(0,i.jsx)(Mr,{fontWeight:"medium",children:n("supprimer_43083")})]})]}):(0,i.jsxs)(Tl,{align:"center",gap:"6",onClick:jc,children:[(0,i.jsx)(df,{name:`${e.prefix}accreditations[${e.accreditationIndex}].willAutoAccredit`,children:n("attribuer_autom_13895")}),e.hasSlots&&(0,i.jsx)(xb,{maxResources:e.accreditationInput.maxResources,name:e.accreditation.name,onChange:n=>{e.change(`${e.prefix}accreditations[${e.accreditationIndex}].maxResources`,n)}})]})},jb=e=>{const{translate:n}=Kl(),t=ki(Jm),s=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.findIndex(n=>n.accreditationSlotId===e.slot.id),[e.delegationAccreditations.accreditationsSlots,e.slot]),o=e.delegationAccreditations.accreditationsSlots[s],a=`${e.prefix}accreditationsSlots[${s}].`,r=o?.isDefault?"checked":"unchecked",d=(0,V.useMemo)(()=>e.selectedAccreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked",[e.slot,e.selectedAccreditationsSlotsIds]),l=(0,V.useCallback)(n=>{e.change(`${a}isDefault`,"checked"===n),"checked"===n&&e.delegationAccreditations.accreditationsSlots.forEach((n,t)=>{n.accreditationSlotId!==o.accreditationSlotId&&n.accreditationId===o.accreditationId&&e.change(`${e.prefix}accreditationsSlots[${t}].isDefault`,!1)}),"unchecked"===n&&e.change(`${a}isVisible`,!0)},[a,o,e.delegationAccreditations,e.change]),c=(0,V.useCallback)(n=>{e.change(`${a}isDefault`,"checked"===n),"unchecked"===n&&e.change(`${a}isVisible`,!0)},[a,e.change]),u=(0,V.useCallback)(n=>{e.change("selectedAccreditationsSlotsIds",Ko(e.selectedAccreditationsSlotsIds,e.slot.id,"checked"===n))},[e.slot,e.selectedAccreditationsSlotsIds,e.change]);return(0,i.jsxs)(km,{children:[e.displaySelectedCheckbox&&(0,i.jsx)($m,{width:48,children:(0,i.jsx)(sm,{state:d,onClick:u})}),(0,i.jsx)($m,{css:{textTransform:"capitalize"},children:e.slot.date?t.toLocaleString(e.slot.date,Uo.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)($m,{children:g(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)($m,{children:e.accreditationDisplay===oe.Radio?(0,i.jsx)(cm,{state:r,onClick:l,children:n("pr_cocher_par_18369")}):(0,i.jsx)(om,{state:r,onClick:c,children:n("pr_cocher_par_18369")})}),(0,i.jsx)($m,{width:100,children:(0,i.jsx)(tc,{color:"white",disabled:!o.isDefault,leftIcon:o.isVisible?"eye":"eye-slash",onClick:()=>{e.change(`${a}isVisible`,!o.isVisible)}})}),(0,i.jsx)($m,{width:130,children:(0,i.jsx)($c,{min:0,name:`${a}maxResources`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})},vb=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.delegationAccreditations.accreditations.findIndex(n=>n.accreditationId===e.accreditation.id),[e.delegationAccreditations.accreditations,e.accreditation]),s=(0,V.useMemo)(()=>e.delegationAccreditations.accreditations[t],[t,e.delegationAccreditations.accreditations]),o=(0,V.useMemo)(()=>Vh(e.slots.filter(n=>n.accreditationId===e.accreditation.id)),[e.slots,e.accreditation]),a=(0,V.useMemo)(()=>o.map(e=>e.id),[o]),r=(0,V.useMemo)(()=>{if(e.accreditation.hasSlots){const n=(0,wo.A)(o.map(n=>e.selectedAccreditationsSlotsIds.includes(n.id)));return 2===n.length?"indeterminate":n[0]?"checked":"unchecked"}return"unchecked"},[e.accreditation,e.selectedAccreditationsSlotsIds,o]),d=(0,V.useMemo)(()=>a.filter(n=>e.selectedAccreditationsSlotsIds.includes(n)),[e.selectedAccreditationsSlotsIds,a]),l=(0,V.useCallback)(n=>{"checked"===n?e.change("selectedAccreditationsSlotsIds",(0,wo.A)(e.selectedAccreditationsSlotsIds.concat(a))):e.change("selectedAccreditationsSlotsIds",(0,em.A)(e.selectedAccreditationsSlotsIds,a))},[e.selectedAccreditationsSlotsIds,e.change,a]);return(0,i.jsx)(Ib,{accreditation:e.accreditation,badge:"number"==typeof s.maxResources&&(0,i.jsx)(Ku,{color:"primary",leftIcon:"badge-check",children:n("quota_sur_l_acc_12936",s.maxResources)}),displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:o.length,renderActions:()=>(0,i.jsx)(_b,{accreditation:e.accreditation,accreditationIndex:t,accreditationInput:s,change:e.change,delegationAccreditations:e.delegationAccreditations,hasSlots:e.accreditation.hasSlots,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,selectedSlotsIds:d,slotsIds:a}),children:(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[e.accreditation.hasSlots&&(0,i.jsx)(Gm,{width:48,children:(0,i.jsx)(sm,{state:r,onClick:l})}),(0,i.jsx)(Gm,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Gm,{children:n("nom_du_cr_neau_54351")}),(0,i.jsx)(Gm,{children:n("s_lection_par_d_61556")}),(0,i.jsx)(Gm,{width:100,children:n("Privacy")}),(0,i.jsx)(Gm,{width:130,children:n("total_07173")})]}),o.map((n,t)=>(0,i.jsx)(jb,{accreditationDisplay:e.accreditation.accreditationDisplay,change:e.change,delegationAccreditations:e.delegationAccreditations,displaySelectedCheckbox:e.accreditation.hasSlots,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slot:n},`${n.id}-${t}`))]})})},Sb=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsCategories.findIndex(n=>n.accreditationCategoryId===e.category.id),[e.delegationAccreditations.accreditationsCategories,e.category]),s=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsCategories[t],[t,e.delegationAccreditations.accreditationsCategories]),o=(0,V.useMemo)(()=>uh(e.accreditations.filter(n=>n.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(pb,{category:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{children:e.category.name}),"number"==typeof s.maxResources&&(0,i.jsx)(Ku,{color:"primary",leftIcon:"badge-check",children:n("quota_sur_la_ca_14699",s.maxResources)}),(0,i.jsx)(xb,{maxResources:s.maxResources,name:e.category.name,onChange:n=>{e.change(`${e.prefix}accreditationsCategories[${t}].maxResources`,n)}})]}),children:o.map((n,t)=>(0,i.jsx)(vb,{accreditation:n,change:e.change,delegationAccreditations:e.delegationAccreditations,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slots:e.slots},`${n.id}-${t}`))})},yb=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsCategories.map(e=>e.accreditationCategoryId),[e.delegationAccreditations.accreditationsCategories]),s=(0,V.useMemo)(()=>e.delegationAccreditations.accreditations.map(e=>e.accreditationId),[e.delegationAccreditations.accreditations]),o=(0,V.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.map(e=>e.accreditationSlotId),[e.delegationAccreditations.accreditationsSlots]),a=(0,V.useMemo)(()=>(0,Lm.A)(e.accreditationCategories.filter(e=>t.includes(e.id)),e=>u(e.name)),[e.accreditationCategories,t]),r=(0,V.useMemo)(()=>e.accreditationCategories.flatMap(e=>e.accreditations).filter(e=>s.includes(e.id)),[e.accreditationCategories,s]),d=(0,V.useMemo)(()=>r.flatMap(e=>e.slots).filter(e=>o.includes(e.id)),[r,o]);return Yo(a)?(0,i.jsx)(hb,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:a.map(n=>(0,i.jsx)(Sb,{accreditations:r,category:n,change:e.change,delegationAccreditations:e.delegationAccreditations,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slots:d},n.id))}):(0,i.jsx)(Tl,{css:{background:"$gray50",bd:!0,padding:"$6"},justify:"center",children:n("aucune_accr_dit_27643")})},Cb=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.accreditationsProfiles.findIndex(n=>n.accreditationProfileId===e.accreditationProfile.id),[e.accreditationProfile,e.accreditationsProfiles]),s=(0,V.useMemo)(()=>e.accreditationsProfiles[t],[t,e.accreditationsProfiles]);return(0,i.jsx)(Ib,{accreditation:e.accreditationProfile,badge:!e.hideActions&&"number"==typeof s.maxResources&&(0,i.jsx)(Ku,{color:"primary",leftIcon:"badge-check",children:n("quota_sur_le_pr_57811",s.maxResources)}),displayNumberOfSlots:!1,displaySlots:!1,numberOfSlots:0,renderActions:e.hideActions?void 0:()=>(0,i.jsxs)(Tl,{align:"center",gap:"6",children:[(0,i.jsx)(df,{name:`${e.prefix}accreditationsProfiles[${t}].willAutoAccredit`,children:n("attribuer_autom_13895")}),(0,i.jsx)(xb,{maxResources:s.maxResources,name:e.accreditationProfile.name,onChange:n=>{e.change(`${e.prefix}accreditationsProfiles[${t}].maxResources`,n)}})]})})},bb=e=>{const n=(0,V.useMemo)(()=>e.category.accreditationsProfiles.filter(n=>e.accreditationsProfiles.some(e=>e.accreditationProfileId===n.id)),[e.category.accreditationsProfiles,e.accreditationsProfiles]);return(0,i.jsx)(pb,{category:e.category.name,children:n.map(n=>(0,i.jsx)(Cb,{accreditationProfile:n,accreditationsProfiles:e.accreditationsProfiles,change:e.change,hideActions:e.hideActions,prefix:e.prefix},n.id))})},Ab=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>(0,Lm.A)(e.accreditationsProfilesCategories.filter(n=>n.accreditationsProfiles.some(n=>e.accreditationsProfiles.some(e=>e.accreditationProfileId===n.id))),e=>u(e.name)),[e.accreditationsProfilesCategories,e.accreditationsProfiles]);return Yo(e.accreditationsProfiles)?(0,i.jsx)(hb,{css:{border:"1px solid $gray200",borderRadius:"$1"},children:t.map(n=>(0,i.jsx)(bb,{accreditationsProfiles:e.accreditationsProfiles,category:n,change:e.change,hideActions:e.hideActions,prefix:e.prefix},n.id))}):(0,i.jsx)(Tl,{css:{background:"$gray50",bd:!0,padding:"$6"},justify:"center",children:n("aucun_profil_d_18230")})},Eb=({accreditationsProfilesCategories:e,allAccreditationCategories:n,change:t,values:s})=>{const{translate:o}=Kl(),a=ki(Jm),r=(0,V.useMemo)(()=>gb(e),[e]),d=(0,V.useMemo)(()=>s.delegation.accreditationsProfiles.map(e=>e.accreditationProfileId),[s.delegation.accreditationsProfiles]),l=(0,V.useCallback)(e=>{const n=e.filter(e=>!s.delegation.accreditationsProfiles.some(n=>n.accreditationProfileId===e)),i=s.delegation.accreditationsProfiles.filter(n=>e.includes(n.accreditationProfileId)).concat(n.map(e=>({accreditationProfileId:e,willAutoAccredit:!0})));t("delegation.accreditationsProfiles",i)},[t,s.delegation.accreditationsProfiles]),c=(0,V.useMemo)(()=>Bh(a,n),[a,n]),u=(0,V.useMemo)(()=>new Map(n.flatMap(e=>e.accreditations.flatMap(n=>n.slots.map(t=>[t.id,{accreditationCategoryId:e.id,accreditationId:n.id}])))),[n]),m=(0,V.useMemo)(()=>s.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),[s.delegation.accreditationsSlots]),g=(0,V.useCallback)(e=>{const{accreditationsSlots:n}=s.delegation,i=e.filter(e=>!n.some(n=>n.accreditationSlotId===e)),o=n.filter(n=>e.includes(n.accreditationSlotId)).concat(i.flatMap(e=>{const n=u.get(e);return n?[{...n,accreditationSlotId:e,isDefault:!1,isVisible:!0}]:[]}));fb(s.delegation,o,"delegation.",t)},[t,u,s.delegation]),h=(0,V.useMemo)(()=>s.delegation.accreditationsSlots.some(({isDefault:e})=>e),[s]);return(0,i.jsxs)(Tl,{direction:"column",children:[Yo(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:o("liste_des_profi_98974")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Ab,{accreditationsProfiles:s.delegation.accreditationsProfiles,accreditationsProfilesCategories:e,change:t,prefix:"delegation."}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:o("ajouter_des_pro_61834")}),values:d,onChange:l,children:r}),(0,i.jsx)(Pl,{height:"7"})]}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:o("liste_des_accr_46997")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(yb,{accreditationCategories:n,change:t,delegationAccreditations:s.delegation,prefix:"delegation.",selectedAccreditationsSlotsIds:s.selectedAccreditationsSlotsIds}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:o("AddAccreditations")}),values:m,onChange:g,children:c}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:o("attribution_des_59896")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(df,{name:"delegation.addDefaultAccreditationsByAvailability",children:o("s_lectionner_pa_51634")})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:o("affichage_des_a_55224")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(df,{name:"delegation.showAllAccreditations",subtext:o("afficher_galem_82855"),children:o("ShowAllAccreditations")})]})},wb=({disabled:e,...n})=>{const{descId:t}=Sc();return(0,i.jsx)(Zx.Provider,{value:{isDisabled:e},children:(0,i.jsxs)(Tl,{"aria-describedby":t,as:"fieldset",className:"fieldset--row",css:{border:"unset",padding:"unset",margin:"unset","&:disabled :is(input, select, button)":{cursor:"not-allowed !important"},"& + &":{borderBlockStart:"1px solid $gray200",marginBlockStart:"$5",paddingBlockStart:"$5"},"& fieldset.fieldset--column":{gap:"$2","& header":{paddingBlockEnd:"unset",borderBlockEnd:"unset !important","& > div > :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$textSm !important",fontWeight:"$medium !important"}}}},direction:"row",gap:"7",...n,children:[(0,i.jsx)(nf,{heading:n.heading}),(0,i.jsxs)(Tl,{as:El.Header,direction:"row",gap:"1",width:280,children:[(0,i.jsx)(dc,{"aria-hidden":"true",color:"gray800",css:{fontSize:"$textSm"},textStyle:"subheading",children:n.heading}),(0,i.jsx)(rc,{id:t,textStyle:"subtitle",children:n.subtitle})]}),(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",gap:"4",children:n.children})]})})},$b=e=>{const{translate:n,params:{organizationId:t}}=Kl(),s=ki(Oh),[o,a]=(0,V.useState)(!1),r=(0,V.useMemo)(()=>s.getDelegationMembersPossibleColumns(t,e.customFields,{forDelegationsSpace:!0,isWeezeventConnected:!0,positionDisplay:Fn.Position,slotDisplay:Ln.Custom}),[t,s,e.customFields]),d=(0,V.useMemo)(()=>(0,kl.A)(e.columns.map(e=>r.find(n=>n.slug===e))),[r,e.columns]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Tl,{css:{background:"$gray50",borderBottom:"1px solid $gray200",color:"$gray500",padding:"$3 $6"},children:n("liste_des_colon_20101")}),(0,i.jsxs)(Tl,{css:{padding:"$4"},direction:"column",gap:"4",children:[(0,i.jsx)(Tl,{direction:"column",gap:"2",children:d.map(n=>(0,i.jsxs)(Tl,{align:"center",css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",padding:"$3"},gap:"3",children:[(0,i.jsx)(Mr,{color:"gray700",css:{flex:"1"},children:n.name}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change(`${e.prefix}columns`,(0,Ju.A)(e.columns,n.slug))}})]},n.slug))}),(0,i.jsx)(tc,{color:"invisible",leftIcon:"gear",onClick:()=>{a(!0)},children:n("_diter_les_colo_39630")})]})]}),o&&(0,i.jsx)(jp,{columns:r,initialSelectedColumns:e.columns,saveButtonText:n("_diter_62574"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_96096"),title:n("_dition_des_col_70300"),onClose:()=>a(!1),onSave:n=>{e.change(`${e.prefix}columns`,n)}})]})},Tb=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!!e.values.delegation.delegationsSpaceLayoutId),o=(0,V.useCallback)(n=>{s(n),n?(e.change("delegation.campaignsIds",[]),e.change("delegation.customDocumentsSlugs",[])):e.change("delegation.delegationsSpaceLayoutId",null)},[s]);return(0,i.jsxs)(Tl,{direction:"column",children:["event"===e.delegationType&&(0,i.jsx)(wb,{heading:n("DelegationsSpaceLayout"),children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(np,{value:t,onChange:o,children:n("utiliser_un_lay_31575")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(of,{label:n("choisissez_le_l_54992"),name:"delegation.delegationsSpaceLayoutId",children:e.layouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})}),!t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wb,{heading:n("liste_des_colon_20101"),children:(0,i.jsx)($b,{change:e.change,columns:e.values.delegation.columns,customFields:e.customFields,prefix:"delegation."})}),(0,i.jsx)(wb,{heading:n("communication_05277"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("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)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("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))})]})})]})]})},zb=e=>{const n=Fi(),t=(0,V.useMemo)(()=>zc.Ik().shape({name:zc.Yj().required(n("le_nom_est_requ_61536"))}),[]);return(0,i.jsx)(tb,{buttonText:e.isEdit?n("renommer_42135"):n("cr_er_82895"),icon:"pen",initialValues:{name:e.initialName},schema:t,title:e.isEdit?n("renommer_1_40542",e.initialName):n("cr_er_une_nouve_72722"),onClose:e.onClose,onSubmit:async n=>{const t=await e.mutate(n.name);e.onClose(),e.onSuccess(t)},children:(0,i.jsx)($c,{label:n("nom_de_la_cat_g_03860"),name:"name"})})},Ob=e=>{const{mutate:n}=Pd();return(0,i.jsx)(zb,{initialName:"",isEdit:!1,mutate:async t=>(await n({organizationId:e.organizationId,eventId:e.eventId,delegationCategory:{name:t}})).delegationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},Rb=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),[o,a]=(0,V.useState)(!1),[r,d]=(0,V.useState)(HC(e.categories)),[l,c]=(0,V.useState)(!!e.initialParentId),u=(0,V.useCallback)(n=>{n||e.change("delegation.parentId",null),c(n)},[e.change,c]);return(0,i.jsxs)(i.Fragment,{children:["event"===e.delegationType&&Yo(e.organizationDelegations)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(np,{value:l,onChange:u,children:n("lier_cette_d_l_78975")}),(0,i.jsx)(Pl,{height:"6"})]}),l?(0,i.jsx)(of,{isSearchVisible:!0,label:n("_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)($c,{label:n("nom_de_votre_d_69290"),name:"delegation.name"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(of,{isCreateVisible:!0,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"delegation.delegationCategoryId",onCreateClick:()=>a(!0),children:r.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),o&&(0,i.jsx)(Ob,{eventId:s,organizationId:t,onClose:()=>a(!1),onSuccess:n=>{d(HC([...r,n])),e.change("delegation.delegationCategoryId",n.id)}})]})},Db=e=>(0,i.jsx)(Rb,{categories:e.categories,change:e.change,delegationType:"event",initialParentId:e.initialParentId,organizationDelegations:e.organizationDelegations}),Mb=e=>(0,i.jsx)(Rb,{categories:e.categories,change:e.change,delegationType:"organization",initialParentId:null,organizationDelegations:[]}),Pb=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{mutate:o}=ll(),a=(0,V.useMemo)(()=>({email:"",formRegister:{forOther:!0,userInfo:{fields:{firstName:"",lastName:""}},sendNotificationEmail:!1}}),[]),r=(0,V.useMemo)(()=>zc.Ik().shape({email:zc.Yj().required(n("l_e_mail_est_re_04856")).email(n("l_e_mail_est_re_04856"))}),[]);return(0,i.jsx)(xc,{height:1,initialValues:a,render:({handleSubmit:t,submitting:o})=>(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"user-plus",children:"Nouveau membre"}),(0,i.jsx)(hx,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)($c,{isEmail:!0,label:n("Email"),name:"email"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:n("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:n("last_name")}),name:"formRegister.userInfo.fields.lastName"})]}),(0,i.jsx)(of,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:n("population_38615")}),multiple:e.canSelectMultiple,name:"formRegister.userInfo.fields.population",children:e.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),s&&(0,i.jsx)(Xx,{name:"formRegister.sendNotificationEmail",children:n("envoyer_l_email_75574")})]})}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{isLoading:o,onClick:t,children:n("ajouter_le_memb_57505")})})]}),schema:r,width:1,onSubmit:async n=>{const{userInfoAdminCreate:{id:i}}=await o({organizationId:t,eventId:s,email:n.email,userInfo:n.formRegister.userInfo,sendNotificationEmail:n.formRegister.sendNotificationEmail});e.onUserCreate(i),e.onClose()}})},kb=e=>{const{params:{organizationId:n}}=Kl(),{data:t}=Li('query CreateUserInfosLight($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n population: customFieldBySlug(slug: "population") {\n canSelectMultiple\n\n values {\n id\n value\n }\n }\n }\n}\n',{organizationId:n},[]);return(0,i.jsx)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsx)(Pb,{canSelectMultiple:t.organization?.population.canSelectMultiple??!1,values:t.organization?.population.values??[],onClose:e.onClose,onUserCreate:e.onUserCreate})})},Fb=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{canMemberCreate:s}=oy(),[o,a,r]=Wm(""),{usersInfosOptions:d,isLoading:l}=my({organizationId:t,eventId:null,hasSelected:Yo(e.leadersIds),nameDebounced:a,reloadKey:e.reloadKey,userInfoIds:e.leadersIds}),[c,u]=(0,V.useState)(!1),m=(0,V.useCallback)(n=>{e.change("delegation.leadersIds",e.leadersIds.concat([n])),e.setRelodaKey(e=>e+1)},[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(wb,{heading:n("reponsable_82458_plural"),children:(0,i.jsx)(of,{createText:n("cr_er_un_membre_38547"),isCreateVisible:s,isSearchLoading:l,isSearchVisible:!0,label:n("s_lectionnez_le_30900"),multiple:!0,name:"delegation.leadersIds",searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_05904"),state:"search",value:o,onChange:r}),onCreateClick:()=>u(!0),children:d})}),(0,i.jsx)(wb,{heading:n("droits_des_resp_01552"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(df,{name:"delegation.showFormLinkInDelegationSpace",children:n("afficher_le_lie_05841")}),(0,i.jsx)(df,{name:"delegation.canLeadersAddMembers",children:n("CanLeadersAddMembers")}),(0,i.jsx)(df,{name:"delegation.canLeadersImportMembers",children:n("CanLeadersImportMembers")}),(0,i.jsx)(df,{name:"delegation.canLeadersEditMembers",children:n("CanLeadersEditMembers")}),(0,i.jsx)(df,{name:"delegation.canLeadersDeleteMembers",children:n("CanLeadersDeleteMembers")}),(0,i.jsx)(df,{name:"delegation.canLeadersDuplicateMembers",children:n("CanLeadersDuplicateMembers")}),(0,i.jsx)(df,{name:"delegation.canLeadersEditColumns",children:n("CanLeadersEditColumns")}),(0,i.jsx)(df,{name:"delegation.canLeadersEditCustomFields",children:n("CanLeadersEditCustomFields")}),(0,i.jsx)(df,{name:"delegation.canLeadersSeeHiddenAccreditationsSlots",children:n("CanLeadersSeeHiddenAccreditationsSlots")})]})})]}),c&&(0,i.jsx)(kb,{isOpen:c,onClose:()=>u(!1),onUserCreate:m})]})},Nb=e=>{const n=Fi(),t=(0,V.useMemo)(()=>(0,Lm.A)(e.forms,e=>e.name),[e.forms]),[s,o]=(0,V.useState)(!!e.initialValues.delegation.deadlineDate),[a,r]=(0,V.useState)(Number.isInteger(e.initialValues.delegation.maxResources));return(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(wb,{heading:n("Form"),children:(0,i.jsx)(of,{isSearchVisible:!0,label:n("avec_quel_formu_60160"),name:"delegation.formId",placeholder:n("s_lectionnez_un_77066"),children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(wb,{heading:n("inscription_dan_16147"),children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:n("les_inscription_64653")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(cm,{state:s?"checked":"unchecked",onClick:()=>{o(!0)},children:n("oui_il_y_a_une_68479")}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Qx,{name:"delegation.deadlineDate"}),(0,i.jsx)(Pl,{height:"3"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:s?"unchecked":"checked",onClick:()=>{o(!1),e.change("delegation.deadlineDate",null)},children:n("non_les_inscri_87979")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:n("les_inscription_76218")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(cm,{state:a?"checked":"unchecked",onClick:()=>{r(!0)},children:n("oui_il_y_a_une_02976")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)($c,{name:"delegation.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(Pl,{height:"3"})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:a?"unchecked":"checked",onClick:()=>{r(!1),e.change("delegation.maxResources",null)},children:n("non_les_inscri_07566")})]})})]})},Lb=e=>{const{translate:n}=Kl();return(0,i.jsx)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"triangle-exclamation",children:n("accr_ditations_34551")}),(0,i.jsx)(hx,{children:(0,i.jsxs)(Tl,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:n("voulez_vous_met_24993")}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("les_accr_ditati_76418",e.deletedAccreditationsSlots.join(", "))})]})}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n("mettre_jour_l_69948")})})]})})},Ub=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=oS(["delegation"],{delegationsCustomFields:!1}),[a,r]=(0,V.useState)(0),d=(0,V.useMemo)(()=>g(e.initialValues.delegation.description)||g(e.initialValues.delegation.privateNote),[e.initialValues]),l=(0,V.useMemo)(()=>e.isEdit&&(Yo(e.initialValues.delegation.accreditationsSlots)||Yo(e.initialValues.delegation.accreditationsProfiles)||e.initialValues.delegation.showAllAccreditations),[e.initialValues,e.isEdit]),c=(0,V.useMemo)(()=>e.isEdit&&Yo(e.initialValues.delegation.usedCustomFieldsIds),[e.initialValues,e.isEdit]),u=(0,V.useMemo)(()=>e.isEdit&&Yo(e.initialValues.delegation.customFields),[e.initialValues,e.isEdit]),m=(0,V.useMemo)(()=>Yo(e.initialValues.delegation.tagsIds),[e.initialValues]),h=function(e,n,t){const i=ki(Jm),s=(0,V.useMemo)(()=>{const e=n.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),i=t.delegation.accreditationsSlots.map(e=>e.accreditationSlotId);return(0,em.A)(e,i)},[n,t]);return(0,V.useMemo)(()=>e.flatMap(e=>e.accreditations.flatMap(e=>e.slots.flatMap(n=>s.includes(n.id)?[Uh(i,n,e.name,{accreditation:{includeName:!0}})]:[]))),[s,e])}("event"===e.delegationType?e.accreditationsCategories:[],e.initialValues,e.values),[p,I]=(0,V.useState)(!1),x=(0,V.useCallback)(()=>{Yo(h)?I(!0):e.handleSubmit()},[h,I,e.handleSubmit]),f=(0,V.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.delegation.name):n("cr_ation_d_une_07120"),[e.initialValues,e.isEdit]);Au(f);const _=(0,V.useCallback)(n=>{const t=e.organizationDelegations.find(e=>e.id===n);t&&(e.form.change("delegation.leadersIds",t.leadersIds),r(e=>e+1))},[e.organizationDelegations,e.values.delegation.leadersIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"delegation.parentId",children:_}),(0,i.jsx)(Hx,{button:e.isEdit?(0,i.jsx)(tc,{isLoading:e.submitting,onClick:x,children:n("mettre_jour_l_69948")}):null,category:f,color:"dark",fallbackClosePath:Js.DELEGATIONS({organizationId:t,eventId:s}),heading:e.isEdit?e.initialValues.delegation.name:n("nouvelle_d_l_ga_42871"),children:(0,i.jsxs)(Gx,{ref:e.centeredContainerRef,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{heading:n("informations_su_34607"),children:"event"===e.delegationType?(0,i.jsx)(Db,{categories:e.categories,change:e.form.change,initialParentId:e.initialValues.delegation.parentId,organizationDelegations:e.organizationDelegations}):(0,i.jsx)(Mb,{categories:e.categories,change:e.form.change})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("param_tres_de_l_81810"),children:(0,i.jsx)(Nb,{change:e.form.change,forms:e.forms,initialValues:e.initialValues})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("reponsable_82458_plural"),children:(0,i.jsx)(Fb,{change:e.form.change,leadersIds:e.values.delegation.leadersIds,reloadKey:a,setRelodaKey:r})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("espace_d_l_gati_59251"),initialIsOpen:e.values.delegation.showInDelegationSpace,isToggleable:!0,subtitle:n("param_trer_les_35157"),onToggle:n=>{n||(e.form.change("delegation.delegationsSpaceLayoutId",null),e.form.change("delegation.campaignsIds",[]),e.form.change("delegation.customDocumentsSlugs",[])),e.form.change("delegation.showInDelegationSpace",n)},children:(0,i.jsx)(Tb,{campaigns:e.campaigns,change:e.form.change,customDocuments:"event"===e.delegationType?e.customDocuments:[],customFields:e.customFields,delegationType:e.delegationType,layouts:e.layouts,values:e.values})}),(0,i.jsx)(Pl,{height:"5"}),"event"===e.delegationType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sf,{heading:n("accr_ditations_39450"),initialIsOpen:l,isToggleable:!0,subtitle:n("delegation_accreditations_desc"),onToggle:n=>{n||(e.form.change("delegation.accreditationsCategories",[]),e.form.change("delegation.accreditations",[]),e.form.change("delegation.accreditationsSlots",[]),e.form.change("delegation.accreditationsProfiles",[]),e.form.change("delegation.showAllAccreditations",!1))},children:(0,i.jsx)(Eb,{accreditationsProfilesCategories:e.accreditationsProfilesCategories,allAccreditationCategories:e.accreditationsCategories,change:e.form.change,values:e.values})}),(0,i.jsx)(Pl,{height:"5"})]}),(0,i.jsx)(sf,{heading:n("champs_de_formu_64126"),initialIsOpen:c,isToggleable:!0,subtitle:n("ajouter_des_inf_57824"),onToggle:n=>{n||(e.form.change("delegation.usedCustomFieldsIds",[]),e.form.change("delegation.fields",(0,_r.A)(e.values.delegation.fields,e.delegationCustomFields.map(e=>e.slug))))},children:(0,i.jsx)(mb,{change:e.form.change,customFields:e.delegationCustomFields,fields:e.values.delegation.fields,prefix:"delegation.",usedCustomFieldsIds:e.values.delegation.usedCustomFieldsIds})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("d_finir_la_vale_27863"),initialIsOpen:u,isToggleable:!0,subtitle:n("choisissez_une_24029"),onToggle:n=>{n||e.form.change("delegation.customFields",[])},children:(0,i.jsx)(eb,{change:e.form.change,customFields:e.customFields,name:"delegation.customFields",values:e.values.delegation.customFields})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("description_et_59312"),initialIsOpen:d,isToggleable:!0,subtitle:n("ajoutez_une_des_54307"),onToggle:n=>{n||(e.form.change("delegation.description",""),e.form.change("delegation.privateNote",""))},children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)(iS,{label:(0,i.jsx)(Uv,{children:n("description_58935")}),name:"delegation.description",variables:o}),(0,i.jsx)(iS,{label:(0,i.jsx)(Uv,{children:n("note_priv_e_06303")}),name:"delegation.privateNote"})]})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("tags_79499"),initialIsOpen:m,isToggleable:!0,subtitle:n("ajouter_des_tag_35833"),onToggle:n=>{n||e.form.change("delegation.tagsIds",[])},children:(0,i.jsx)(sb,{change:e.form.change,name:"delegation.",organizationId:t,tags:e.tags,tagsIds:e.values.delegation.tagsIds})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:e.submitting,textAlign:"center",onClick:x,children:e.isEdit?n("mettre_jour_l_69948"):n("cr_er_la_d_l_ga_53268")})})]})}),(0,i.jsx)(Lb,{deletedAccreditationsSlots:h,handleSubmit:e.handleSubmit,isOpen:p,submitting:e.submitting,onClose:()=>{I(!1)}})]})},Vb=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{showNotification:a}=AS(),r=ki(Ol),d=ki(zC),l=ki(oC),c=(0,V.useRef)(null),u=(0,V.useCallback)(n=>r.validateForForm(l.createUpdateDelegationSchema(d.changedFieldsSchema(e.delegationCustomFields,e.initialValues.delegation.fields,n.delegation.fields)))(n),[e.delegationCustomFields,e.initialValues]);return(0,i.jsx)(xc,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(Ub,{...e,centeredContainerRef:c,form:n,handleSubmit:t,submitting:s,values:o}),validate:u,width:1,onSubmit:async i=>{await e.mutate({organizationId:s,eventId:o,delegation:i.delegation}),a(e.isEdit?t("la_d_l_gation_a_86694"):t("la_d_l_gation_a_01157")),n.goBack(Js.DELEGATIONS({organizationId:s,eventId:o}))}})},Bb=(e,n)=>{try{if(g(e)&&!isNaN((0,aC.A)(e,10)))return{delegationCategoryId:(0,aC.A)(e,10)};if(g(e)){const t=JSON.parse(a(e)),i=t.parentId,s=t.applyParentSettings?n.find(e=>e.id===i):null;return{parentId:i,parentDelegation:s}}return{}}catch{return{}}},Wb=()=>{const{params:{organizationId:e,eventId:n,options:t}}=Kl(),s=ki(oC),{data:o,isLoading:a}=Li("query DelegationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(\n eventId: $eventId\n variety: Delegation\n privacy: Public\n ) {\n nodes {\n ...AttachCustomField\n }\n }\n\n delegations(level: Organization) {\n nodes {\n id\n name\n privateNote\n leadersIds\n tagsIds\n columns\n\n delegationCategory {\n name\n }\n\n form {\n name\n }\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n }\n}\n",{organizationId:e,eventId:n},[$o.CreatePositionTagsFragment,$o.OrganizationCustomFieldsFragment,$o.AttachCustomFieldFragment,$o.CreateDelegationEventFragment]),{mutate:r}=wd(),{mutate:d}=Pd(),[l,c]=(0,V.useState)(!0),[u,m]=(0,V.useState)({});return(0,V.useEffect)(()=>{(async()=>{if(o.organization){const{delegationCategoryId:i,parentId:a,parentDelegation:r}=Bb(t,o.organization.delegations.nodes),l=o.organization.delegationsCategories.nodes;if(a&&r&&!l.find(e=>e.name==r.delegationCategory.name)){const{delegationCategoryCreate:t}=await d({organizationId:e,eventId:n,delegationCategory:{name:r.delegationCategory.name}});l.push(t)}m(s.createUpdateDelegationValuesDefault(null,{delegationCategoryId:i,delegationsCategories:l,forms:o.event.forms.nodes,parentId:a,parentDelegation:r})),c(!1)}})()},[t,o]),a||l?(0,i.jsx)(Ql,{}):(0,i.jsx)(Vb,{accreditationsCategories:o.event.accreditationsCategories,accreditationsProfilesCategories:o.event.accreditationsProfilesCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:Js.DELEGATIONS({organizationId:e,eventId:n}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",forms:o.event.forms.nodes,initialValues:u,isEdit:!1,layouts:o.event.delegationsSpaceLayouts,mutate:r,organizationDelegations:o.organization.delegations.nodes,tags:o.organization.tags.nodes})},Gb=()=>{const{params:{organizationId:e,options:n}}=Kl(),t=ki(oC),{data:s,loader:o}=Li("query DelegationOrganizationInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n campaigns(level: Organization, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...CreateDelegationForm\n }\n }\n }\n}\n",{organizationId:e},[$o.CreatePositionTagsFragment,$o.OrganizationCustomFieldsFragment,$o.AttachCustomFieldFragment,$o.CreateDelegationFormFragment]),{mutate:a}=wd(),r=(0,V.useMemo)(()=>{const{delegationCategoryId:e}=Bb(n,[]);return t.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e})},[]);return o||(0,i.jsx)(Vb,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:yo.COMMUNITY_DELEGATIONS(e),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:r,isEdit:!1,layouts:[],mutate:a,organizationDelegations:qo,tags:s.organization.tags.nodes})},qb=()=>{const{params:{organizationId:e,eventId:n,delegationId:t}}=Kl(),s=ki(oC),{data:o,loader:a}=Li("query DelegationEventToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(\n eventId: $eventId\n variety: Delegation\n privacy: Public\n ) {\n nodes {\n ...AttachCustomField\n }\n }\n\n delegations(level: Organization) {\n nodes {\n id\n name\n leadersIds\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n\n delegation(id: $delegationId) {\n name\n description\n delegationCategoryId\n parentId\n leadersIds\n formId\n deadlineDate\n maxResources\n delegationsSpaceLayoutId\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showAllAccreditations\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersDuplicateMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersEditMembers\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n campaignsIds\n customDocumentsSlugs\n usedCustomFieldsIds\n\n customFields {\n addValues\n customFieldId\n value\n }\n\n accreditationsCategories {\n accreditationCategoryId\n maxResources\n }\n\n accreditations {\n accreditationCategoryId\n accreditationId\n maxResources\n willAutoAccredit\n }\n\n accreditationsSlots {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n maxResources\n isVisible\n }\n\n accreditationsProfiles {\n accreditationProfileId\n maxResources\n willAutoAccredit\n }\n }\n }\n}\n",{organizationId:e,eventId:n,delegationId:t},[$o.CreatePositionTagsFragment,$o.OrganizationCustomFieldsFragment,$o.AttachCustomFieldFragment,$o.CreateDelegationEventFragment]),{mutate:r}=$d(),d=(0,V.useMemo)(()=>s.createUpdateDelegationValuesDefault(o.event?.delegation,null),[o.event]);return a||(0,i.jsx)(Vb,{accreditationsCategories:o.event.accreditationsCategories,accreditationsProfilesCategories:o.event.accreditationsProfilesCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:Js.DELEGATION({organizationId:e,eventId:n,delegationId:t}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",forms:o.event.forms.nodes,initialValues:d,isEdit:!0,layouts:o.event.delegationsSpaceLayouts,mutate:async e=>await r({...e,delegationId:t}),organizationDelegations:o.organization.delegations.nodes,tags:o.organization.tags.nodes})},Hb=()=>{const{params:{organizationId:e,delegationId:n}}=Kl(),t=ki(oC),{data:s,loader:o}=Li("query DelegationOrganizationToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n campaigns(level: Organization, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n delegation(id: $delegationId) {\n name\n description\n delegationCategoryId\n leadersIds\n formId\n deadlineDate\n maxResources\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showAllAccreditations\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersDuplicateMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersEditMembers\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n campaignsIds\n customDocumentsSlugs\n usedCustomFieldsIds\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,delegationId:n},[$o.CreatePositionTagsFragment,$o.OrganizationCustomFieldsFragment,$o.AttachCustomFieldFragment,$o.CreateDelegationFormFragment]),{mutate:a}=$d(),r=(0,V.useMemo)(()=>t.createUpdateDelegationValuesDefault(s.organization?{...s.organization.delegation,accreditationsCategories:[],accreditations:[],accreditationsSlots:[],accreditationsProfiles:[]}:null,null),[s.organization]);return o||(0,i.jsx)(Vb,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:yo.COMMUNITY_DELEGATION(e,n),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:r,isEdit:!0,layouts:[],mutate:async e=>await a({...e,delegationId:n}),organizationDelegations:qo,tags:s.organization.tags.nodes})};function Yb(e,n,t,i){const{getLocalOrganization:s,updateLocalOrganization:o}=function(e){const n=(0,V.useCallback)(async()=>{let n=await NS.organizations.get(e);return n||(n={id:e},await NS.organizations.put(n)),n},[e]),t=(0,V.useCallback)(async t=>{const i=await n(),s=(0,LS.A)(i,{id:e},t);return await NS.organizations.put(s),s},[e,n]);return{getLocalOrganization:n,updateLocalOrganization:t}}(e),[a,r]=(0,V.useState)(t),[d,l]=(0,V.useState)(!0),c=(0,V.useCallback)(async e=>{r(e),await o({[n]:e})},[n,r,o]);return(0,V.useEffect)(()=>{(async()=>{const e=await s();e[n]&&(i?.includes(e[n])??1)&&r(e[n]),l(!1)})()},[e,i,s,r,l]),[a,c,d]}function Zb(e,n,t,i,s,o){const a=Yb(t,i,s,o);return(0,V.useMemo)(()=>e?[n(e),Bc.A,!1]:a,[e,a])}function Kb(e){return(0,V.useMemo)(()=>new Map(e.map(e=>[e.slug,e])),[e])}let Xb=class{translationService;constructor(e){this.translationService=e}minutesToHoursMinutesString(e){const n=Oo.dw.fromObject({minutes:e},{locale:du(this.translationService.language)}).shiftTo("hours","minutes");return 0===n.minutes?n.shiftTo("hours").toHuman({unitDisplay:"narrow"}):0===n.hours?n.shiftTo("minutes").toHuman({unitDisplay:"narrow"}):n.toHuman({unitDisplay:"narrow"})}};function Qb(e,n,t){if(n.startsWith("form_inserted_at")){const i=parseInt(n.substring(17),10);if(isNaN(i))return"";{const n=t.find(({form:e})=>e?.id===i);return n?e.toLocaleString(n.insertedAt.toLocal(),Uo.DateTime):""}}return""}Xb=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Xb);const Jb=e=>{const n=ki(CC),{isEditMode:t}=pg(),s=n.getValue(e.customField,e.fields),o=n.getValueString(e.customField,e.fields),a=!0===s?"checked":!1===s?"unchecked":"indeterminate";return t&&e.updatable?(0,i.jsxs)($m,{css:{border:"2px solid transparent","& > .h-checkbox-cell-hover":{display:"none"},"&:hover":{border:"2px solid $primary500"},"&:hover > .h-checkbox-cell-default":{display:"none"},"&:hover > .h-checkbox-cell-hover":{display:"block"}},minWidth:e.column.minWidth,width:e.column.width,onClick:jc,children:[(0,i.jsx)(Mr,{className:"h-checkbox-cell-default",children:o}),(0,i.jsx)(Mr,{className:"h-checkbox-cell-hover",children:(0,i.jsx)(sm,{state:a,onClick:async n=>{await e.mutate("checked"===n,e.customField.slug),e.reload()}})})]}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:o})};class eA extends Error{}function nA(e,n){const t=ki(zC);return(0,V.useCallback)(i=>{const s=t.getValidationRuleError(e,i);return s?Promise.reject(new eA(s)):n(i,e.slug)},[e,n])}const tA="h-update-cell-open",iA=e=>{const n=Fi(),t=(0,V.useRef)(W()),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(e.initialValue),[d,l]=(0,V.useState)(!1),[c,u]=(0,V.useState)(null),m=(0,V.useCallback)(e=>{r(e),u(null)},[]),g=(0,V.useCallback)(n=>{o(n),document.body.dispatchEvent(new CustomEvent(tA,{bubbles:!0,detail:{uuid:t.current}})),e.onStateChange?.(n)},[o,e.onStateChange]),h=(0,V.useCallback)(e=>{e.detail.uuid!==t.current&&o(!1)},[o]),p=(0,V.useCallback)(()=>{g(!1),m(e.initialValue)},[e.initialValue,g,m]),I=(0,V.useCallback)(async()=>{l(!0);try{await e.onSave(a)}catch(e){if(!(e instanceof eA))throw e;u(e.message)}finally{l(!1)}},[e.onSave,a]);return(0,V.useEffect)(()=>(document.addEventListener(tA,h),()=>{document.removeEventListener(tA,h)}),[h]),(0,i.jsxs)(Ou,{doNotCloseOnOtherOpen:!0,isOpen:s,onStateChange:g,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)($m,{css:{...e.css,border:"2px solid transparent",cursor:"text","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:jc,children:"function"==typeof e.renderValue?e.renderValue():e.renderValue})}),(0,i.jsxs)(Fu,{css:{padding:"0",overflowBlock:"auto",maxBlockSize:"50vh"},placement:"bottom-start",width:380,children:[(0,i.jsx)(Tl,{css:{padding:"$4 $6"},onKeyDown:e=>{"Enter"===e.key&&I()},children:e.renderInput(a,r,c)}),(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:p,children:n("annuler_48254")}),(0,i.jsx)(tc,{isLoading:d,size:"sm",onClick:I,children:n("appliquer_05753")})]})]})]})},sA=e=>{const{isEditMode:n}=pg();return n&&e.updatable?(0,i.jsx)(iA,{column:e.column,initialValue:e.initialValue,renderInput:e.renderInput,renderValue:e.renderValue,onSave:async n=>{await e.mutate(n),e.reload()}}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:"function"==typeof e.renderValue?e.renderValue():e.renderValue})},oA=e=>{const n=ki(CC),t=n.getValueString(e.customField,e.fields),s=(0,V.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return g(t)?Oo.c9.fromISO(t,{zone:"utc"}):t},[]),o=nA(e.customField,e.mutate);return(0,i.jsx)(sA,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(Wp,{hint:s,label:e.customField.name,state:g(s)?"error":"active",value:n,onChange:t}),renderValue:t,updatable:e.updatable})},aA=e=>{const n=ki(CC),t=n.getValueString(e.customField,e.fields),s=(0,V.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return g(t)?Oo.c9.fromISO(t,{zone:"utc"}):t},[]),o=nA(e.customField,e.mutate);return(0,i.jsx)(sA,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(Kp,{hint:s,label:e.customField.name,state:g(s)?"error":"active",value:n,onChange:t}),renderValue:t,updatable:e.updatable})},rA=e=>{const{params:{organizationId:n}}=Kl(),t=ki(CC),s=t.getValueString(e.customField,e.fields,{fileReturnValue:"name"}),o=t.getValueString(e.customField,e.fields,{fileReturnValue:"url"}),a=(0,V.useMemo)(()=>t.getValue(e.customField,e.fields),[e.customField,e.fields]),r=nA(e.customField,e.mutate),d=e.customField.fileType===en.Picture,l=e.customField.fieldProperty===Ke.Picture?e.avatarUser:void 0;return(0,i.jsx)(sA,{column:e.column,initialValue:a,mutate:r,reload:e.reload,renderInput:(t,s)=>d?(0,i.jsx)(VC,{allowCrop:!0,label:e.customField.name,organizationId:n,value:t,onChange:s}):(0,i.jsx)(Lv,{accept:[gv.Images,gv.Pdf],acl:"private",label:e.customField.name,organizationId:n,value:t,onChange:s}),renderValue:()=>d?(g(o)||l)&&(0,i.jsx)(t_,{email:l?.email,image:o,name:l?.name,size:32}):(0,i.jsx)(Xm,{css:{fontWeight:"$regular"},to:o,children:s}),updatable:e.updatable})},dA=e=>{const n=ki(CC),t=n.getValueString(e.customField,e.fields),s=(0,V.useMemo)(()=>n.getValue(e.customField,e.fields)||0,[e.customField,e.fields]),o=nA(e.customField,e.mutate);return(0,i.jsx)(sA,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(wc,{hint:s,label:e.customField.name,shouldParseAsInt:!0,state:g(s)?"error":"active",value:n,onChange:t}),renderValue:t,updatable:e.updatable})},lA=e=>{const n=ki(CC),t=ki(X_),s=n.getValueString(e.customField,e.fields),o=(0,V.useMemo)(()=>{const i=n.getValue(e.customField,e.fields),s=t.basePhoneInputDefault();return{country:i?.country||s.country,code:i?.code||s.code,number:i?.number||s.number}},[e.fields]),a=nA(e.customField,e.mutate);return(0,i.jsx)(sA,{column:e.column,initialValue:o,mutate:a,reload:e.reload,renderInput:(n,t)=>(0,i.jsx)(nj,{label:e.customField.name,value:n,onChange:t}),renderValue:s,updatable:e.updatable})},cA=e=>(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{css:{background:e.color,borderRadius:"16px",flex:"0 0 auto",overflow:"hidden"},height:16,width:16}),(0,i.jsx)(Mr,{css:{clamp:2,minWidth:0,wordBreak:"break-word"},title:e.children,children:e.children})]});let uA=null;function mA(e,{fontSize:n,fontWeight:t}={}){uA||=document.createElement("canvas");const i=uA.getContext("2d");return i.font=`${t||"400"} ${n||"14px"} 'Open Sans`,i.measureText(e).width}const gA=({badge:e})=>(0,i.jsx)(Ku,{color:e.color,count:e.count,css:{cursor:e.onClick?"pointer":"inherit"},leftIcon:e.icon?Zt.includes(e.icon)?Hl(e.icon):e.icon:void 0,size:"md",onClick:e.onClick,children:e.text}),hA=({badges:e})=>(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Ku,{cursor:"pointer",size:"md",children:`+${e.length}`})}),(0,i.jsx)(Fu,{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)(Tl,{children:(0,i.jsx)(gA,{badge:e})},e.id))})]}),pA=e=>{const[n,t]=(0,V.useState)(0),s=(0,V.useCallback)(e=>{e&&t(e.getBoundingClientRect().width)},[]),o=(0,V.useMemo)(()=>e.badges.some(e=>"number"==typeof e.count||"string"==typeof e.count),[e.badges]),a=(0,V.useMemo)(()=>e.badges.some(e=>!!e.icon),[e.badges]),r=(0,V.useMemo)(()=>(o?28:0)+(a?12:0)+20,[o,a]),d=(0,V.useMemo)(()=>{const n=e.badges.map(e=>({...e,textWidth:Math.floor(mA(e.text,{fontSize:"12px"}))+r}));return!0===e.doNotSort?n:(0,Lm.A)(n,({textWidth:e})=>e)},[r,e.badges,e.doNotSort]),[l,c]=(0,V.useMemo)(()=>{let e=37;const t=[],i=[];for(const s of d)e+=s.textWidth+8,eYo(c),[c]);return(0,i.jsxs)(Tl,{ref:s,align:"center",css:{cursor:e.onClick?"pointer":"inherit","&:hover":{color:"black"}},gap:"2",height:1,width:1,onClick:n=>{e.onClick&&Yo(d)&&(jc(n),e.onClick())},children:[l.map(e=>(0,i.jsx)(gA,{badge:e},e.id)),u&&(e.onClick?(0,i.jsx)(Ku,{css:{cursor:"pointer"},size:"md",children:"+"+(d.length-l.length)}):(0,i.jsx)(hA,{badges:c}))]})},IA=e=>{const n=Fi(),t=ki(CC),s=(0,V.useMemo)(()=>{if(e.customField.canSelectMultiple){const n=t.getSelectCustomFieldValues(e.customField,e.fields);if(e.customField.listType==un.Dot)return(0,i.jsx)(Tl,{align:"center",gap:"3",wrap:"wrap",children:n.map(({value:e,color:n},t)=>(0,i.jsx)(cA,{color:n||"",children:e},t))});{const t=n.map(({value:n,color:t})=>({id:n,color:e.customField.listType===un.Badge?t||"":"gray",icon:null,text:n}));return(0,i.jsx)(pA,{badges:t})}}{const n=t.getValueString(e.customField,e.fields);if(g(n)){if(e.customField.listType===un.Default)return n;{const s=t.getValue(e.customField,e.fields),o=e.customField.values.find(({id:e})=>e===s)?.color??"";return e.customField.listType===un.Dot?(0,i.jsx)(cA,{color:o,children:n}):(0,i.jsx)(Ku,{color:o,children:n})}}return""}},[t,e.customField,e.fields]),o=(0,V.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return e.customField.canSelectMultiple?Yo(n)?n:[]:n||""},[t,e.customField,e.fields]),a=WC(e.customField),r=nA(e.customField,e.mutate);return(0,i.jsx)(sA,{column:e.column,initialValue:o,mutate:r,reload:e.reload,renderInput:(t,s)=>e.customField.canSelectMultiple?(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.customField.name,multiple:!0,renderOnPortal:!0,values:t,onChange:s,children:a}):(0,i.jsx)(_m,{isSearchVisible:!0,label:e.customField.name,multiple:!1,placeholder:n("choisir_une_val_00277"),renderOnPortal:!0,values:[t],onChange:e=>{Yo(e)&&s(e[0])},children:a}),renderValue:s,updatable:e.updatable})},xA=e=>{const n=ki(CC).getValueString(e.customField,e.fields),t=nA(e.customField,e.mutate);return(0,i.jsx)(sA,{column:e.column,initialValue:n,mutate:t,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(af,{hint:s,label:e.customField.name,state:g(s)?"error":"active",value:n,onChange:t,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),renderValue:n,updatable:e.updatable})},fA=e=>{const n=ki(CC).getValueString(e.customField,e.fields),t=nA(e.customField,e.mutate),{isEditMode:s}=pg(),o="string"==typeof e.clickPath&&(e.column.slug===Ke.FirstName||e.column.slug===Ke.LastName),a=o&&!s;return(0,i.jsx)(sA,{column:e.column,initialValue:n,mutate:t,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(wc,{autoFocus:!0,hint:s,label:e.customField.name,state:g(s)?"error":"active",value:n,onChange:t}),renderValue:()=>a?(0,i.jsx)(Xm,{to:e.clickPath,children:n}):(0,i.jsx)(Mr,{fontWeight:o?"medium":"inherit",children:n}),updatable:e.updatable})},_A=e=>{const n=ki(CC),t=n.getValueString(e.customField,e.fields),s=(0,V.useMemo)(()=>n.getValueString(e.customField,e.fields),[]),o=nA(e.customField,e.mutate);return(0,i.jsx)(sA,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(n,t)=>(0,i.jsx)(aS,{label:e.customField.name,value:n,onChange:t}),renderValue:t,updatable:e.updatable})},jA=e=>{const n=ki(CC);return e.customField?.fieldType===Qe.Checkbox?(0,i.jsx)(Jb,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.Date?(0,i.jsx)(oA,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.Phone?(0,i.jsx)(lA,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.Select||e.customField?.fieldType===Qe.Country||e.customField?.fieldType===Qe.Language||e.customField?.fieldType===Qe.Sex||e.customField?.fieldType===Qe.Nationality?(0,i.jsx)(IA,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.Text?(0,i.jsx)(fA,{clickPath:e.clickPath,column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.Textarea?(0,i.jsx)(xA,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.Number?(0,i.jsx)(dA,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.File?(0,i.jsx)(rA,{avatarUser:e.avatarUser,column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.Datetime?(0,i.jsx)(aA,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Qe.Time?(0,i.jsx)(_A,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):(0,i.jsx)($m,{children:e.customField?n.getValueString(e.customField,e.fields,{fileReturnValue:"name"}):""})},vA=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),{isEditMode:s}=pg(),{mutate:o}=Xa(),a=(0,V.useCallback)(i=>o({organizationId:n,eventId:t,userInfoId:e.userInfo.id,email:i}),[e.userInfo,o]);return(0,i.jsx)(sA,{column:e.column,initialValue:e.userInfo.email,mutate:a,reload:e.reload,renderInput:(n,t)=>(0,i.jsx)(wc,{isEmail:!0,label:e.column.name,value:n,onChange:t}),renderValue:()=>"string"!=typeof e.clickPath||s?(0,i.jsx)(Mr,{fontWeight:"medium",children:e.userInfo.email}):(0,i.jsx)(Xm,{to:e.clickPath,children:e.userInfo.email}),updatable:e.updatable})},SA=e=>{const{translate:n}=Kl(),{isEditMode:t}=pg(),s=(0,V.useMemo)(()=>({firstName:e.userInfo.fields.firstName||"",lastName:e.userInfo.fields.lastName||""}),[e.userInfo]),o=(0,V.useCallback)(async n=>{await e.mutate(n.firstName,"firstName"),await e.mutate(n.lastName,"lastName"),e.reload()},[e.mutate,e.reload]);return t&&e.updatable?(0,i.jsx)(iA,{column:e.column,initialValue:s,renderInput:(e,t)=>(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(wc,{label:n("pr_nom_66988"),value:e.firstName,onChange:n=>{t({...e,firstName:n})}}),(0,i.jsx)(wc,{label:n("last_name"),value:e.lastName,onChange:n=>{t({...e,lastName:n})}})]}),renderValue:()=>(0,i.jsx)(My,{clickPath:e.clickPath,isClickDisabled:!0,size:32,userInfo:e.userInfo}),onSave:o}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(My,{clickPath:e.clickPath,size:32,userInfo:e.userInfo})})};function yA(e,n){if(e){const t=(e.usersOrganizations||[]).map(e=>({id:`uo-${e.id}`,color:"gray",icon:e.role.type===Vn.OrganizationAdmin?"gem":"glasses-round",text:`${e.role.name}`})).concat((e.usersEvents||[]).map(e=>({id:`ue-${e.id}`,color:"gray",icon:e.role.type===Vn.EventAdmin?"gem":"glasses-round",text:`${e.event.name} - ${e.role.name}`}))).concat((e.usersDelegations||[]).map(e=>({id:`ud-${e.id}`,color:"gray",icon:"user-group",text:`${e.delegation.name} - ${n("responsable_de_70462")}`}))).concat((e.usersDelegationsCategories||[]).map(e=>({id:`udc-${e.id}`,color:"gray",icon:"user-group",text:`${e.delegationCategory.name} - ${e.role.name}`}))).concat((e.usersPositions||[]).map(e=>({id:`up-${e.id}`,color:"gray",icon:"sitemap",text:`${e.position.name} - ${e.role.name}`}))).concat((e.usersPositionsCategories||[]).map(e=>({id:`upc-${e.id}`,color:"gray",icon:"sitemap",text:`${e.positionCategory.name} - ${e.role.name}`})));return(0,Rg.A)(t,({text:e})=>e)}return[]}const CA=e=>{const n=Fi(),t=(0,V.useMemo)(()=>yA(e.userPermissions,n),[e.userPermissions]);return(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(pA,{badges:t,doNotSort:!0})})};function bA(e){return(0,Lm.A)(e.map(e=>({id:e.id,category:e.accreditationProfileCategory.name,text:g(e.acronym)?e.acronym:e.name,color:e.color,icon:e.icon})),({category:e,text:n})=>[u(e),u(n)])}const AA=e=>{const{translate:n}=Kl(),{mutate:t}=fa(),{isEditMode:s}=pg(),o=(0,V.useMemo)(()=>(0,kl.A)([e.volunteerRegistration.accreditationProfile?.id]),[e.volunteerRegistration]),[a,r]=(0,V.useState)(!0),[d,l]=(0,V.useState)(null),c=(0,V.useMemo)(()=>bA((0,kl.A)([e.volunteerRegistration.accreditationProfile])),[e.volunteerRegistration.accreditationProfile]),u=(0,V.useCallback)(async n=>{if(n&&a){const{event:n}=await(t={eventId:e.eventId},i=await X(),oa(ma,{variables:t,token:i||void 0,fragments:[]})),s=gb(n.accreditationsProfilesCategories);l(s),r(!1)}var t,i},[e.eventId,a]),m=(0,V.useCallback)(async n=>{Zo(n)?await t({eventId:e.eventId,massProfileUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:hn.Delete}}):await t({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:n[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:hn.Replace}}),e.reload()},[t,e.eventId,e.volunteerRegistration,e.reload]);return s&&e.updatable?(0,i.jsx)(iA,{column:e.column,css:{gap:"$2"},initialValue:o,renderInput:(e,t)=>a?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("profil_d_accr_d_02274"),multiple:!1,renderOnPortal:!0,values:e,onChange:t,children:d}),renderValue:()=>(0,i.jsx)(pA,{badges:c}),onSave:m,onStateChange:u}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:c})})},EA=({column:e,eventId:n,onClick:t,reload:s,updatable:o,volunteerRegistration:a})=>{const r=Fi(),{mutate:d}=ja(),{mutate:l}=ar(),c=ki(Jm),{isEditMode:u}=pg(),[m,g]=(0,V.useState)(!0),[h,p]=(0,V.useState)(null),I=(0,V.useMemo)(()=>a?.accreditationsUsersInfos||[],[a]),x=(0,V.useMemo)(()=>dh(I),[I]),f=(0,V.useMemo)(()=>I.map(e=>e.accreditationSlot.id),[I]),_=(0,V.useCallback)(async e=>{if(e&&m){const{event:e}=await er({eventId:n,loadIsBlocked:!0},await X()),t=Bh(c,e.accreditationsCategories,{useAccreditationDisplay:!0,useIsBlocked:!0});p(t),g(!1)}},[c,n,m]),j=(0,V.useCallback)(async e=>{Yo(e)?await d({eventId:n,massAccredit:{accreditationsSlotsIds:e,selecteds:{ids:[a.userInfo.id]},strategy:hn.Replace}}):await l({eventId:n,massStateUpdate:{selecteds:{ids:[a.userInfo.id]},state:ge.WaitingAccreditation}}),s()},[n,a,d,s]);return u&&o?(0,i.jsx)(iA,{column:e,css:{gap:"$2"},initialValue:f,renderInput:(e,n)=>m?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:r("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:n,children:h}),renderValue:()=>(0,i.jsx)(pA,{badges:x,doNotSort:!0}),onSave:j,onStateChange:_}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(pA,{badges:x,doNotSort:!0,onClick:t})})},wA=e=>{const n=(0,V.useMemo)(()=>(0,Rg.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)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},$A=e=>{const n=Fi(),{mutate:t}=mr();return(0,i.jsx)(Tl,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await t({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"accreditation_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(Ku,{...Uy(e.state),children:n(e.state)})})},TA=e=>{const n=Fi(),{isEditMode:t}=pg(),[s,o]=(0,V.useState)(!1),a=(0,V.useCallback)(e=>{t&&o(e)},[t,o]),r=(0,V.useCallback)(()=>{a(!1)},[a]);return t&&e.updatable?(0,i.jsx)($m,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary500"}},minWidth:e.column.minWidth,width:e.column.width,onClick:jc,children:(0,i.jsxs)(Ou,{isOpen:s,onStateChange:a,children:[(0,i.jsx)(Nu,{children:(0,i.jsxs)(Tl,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(Ku,{...Uy(e.state),cursor:"text",children:n(e.state)}),s&&(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"chevron-down"})})]})}),(0,i.jsxs)(Fu,{offset:2,placement:"bottom",width:240,children:[e.state!==ge.WaitingAccreditation&&(0,i.jsx)($A,{close:r,eventId:e.eventId,reload:e.reload,state:ge.WaitingAccreditation,volunteerRegistrationId:e.volunteerRegistrationId}),e.state!==ge.NotApplicable&&(0,i.jsx)($A,{close:r,eventId:e.eventId,reload:e.reload,state:ge.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})]})}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ku,{...Uy(e.state),children:n(e.state)})})},zA=e=>{const n=ki(Jm),t=ki(Bg),s=(0,V.useMemo)(()=>function(e,n,t){return(0,Lm.A)((t||[]).flatMap(e=>(e.slots||[]).map(n=>({range:n.range,display:e.form.slotDisplay}))),({range:e})=>e.start.toMillis()).map(t=>t.display===Ln.Calendar||t.display===Ln.DisplayDays?e.toLocaleString(t.range.start,Uo.DateOnly.Numeric):n.toDisplayString(t.range,{formats:{localeFormat:Uo.DateOnly.Numeric}}))}(n,t,e.volunteerRegistration.userInfo.formsUsersInfos).map((e,n)=>({id:n,color:"gray",icon:null,text:e})),[e.volunteerRegistration.userInfo.formsUsersInfos]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:s,doNotSort:!0,onClick:e.onClick})})},OA=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.volunteerRegistration.delegationBannerNumber||0,[e.volunteerRegistration]),s=e.volunteerRegistration.delegationBannerNumber?.toString(10)||"",o=(0,V.useCallback)(n=>e.mutate(n,"banner_number"),[e.mutate]);return(0,i.jsx)(sA,{column:e.column,initialValue:t,mutate:o,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("num_ro_de_bande_16203"),shouldParseAsInt:!0,value:e,onChange:t}),renderValue:s,updatable:e.updatable})},RA=e=>{const{translate:n}=Kl();return(0,i.jsxs)(xx,{children:[(0,i.jsx)(fx,{children:(0,i.jsx)(Mr,{css:{cursor:"pointer"},height:e.size,width:e.size,children:(0,i.jsx)("img",{height:"100%",src:bf(e.value,{height:e.size,width:e.size}),width:"100%"})})}),(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"qrcode",children:n("code_barres_1_82428",e.name)}),(0,i.jsxs)(hx,{align:"center",css:{padding:"$4"},gap:"3",justify:"center",children:[(0,i.jsx)(Mr,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:bf(e.value,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(Mr,{children:e.value})]}),(0,i.jsx)(gx,{})]})]})},DA=e=>{const n=e.volunteerRegistration.ticketId;return(0,i.jsxs)($m,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(RA,{name:e.volunteerRegistration.userInfo.nameOrEmail,size:30,value:e.volunteerRegistration.ticketId}),g(e.volunteerRegistration.weezeventTicketUrl)?(0,i.jsx)(Xm,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventTicketUrl,children:n}):n]})},MA=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>(e.volunteerRegistration.userInfo.emails??[]).map(e=>{const{color:t,leftIcon:i}=Py(e.state);return{id:e.id,color:t,icon:i,text:`${e.campaign?.name??""} - ${n(e.state)}`}}),[e.volunteerRegistration]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:t})})},PA=e=>{const n=(0,V.useMemo)(()=>(e.volunteerRegistration.positionsSlotsUsersInfos||[]).filter(e=>e.state!==ye.Waiting),[e.volunteerRegistration]),t=(0,V.useMemo)(()=>oh(n),[n]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:t,doNotSort:!0,onClick:e.onClick})})},kA=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)("");return(0,i.jsx)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"print",children:n("impression_du_d_03836",e.customDocumentName)}),(0,i.jsxs)(hx,{gap:"6",children:[(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("le_document_a_d_84754")}),(0,i.jsx)(uc,{children:n("afin_de_r_dite_85227")})]}),(0,i.jsx)(af,{label:n("raison_de_l_imp_75064"),value:t,onChange:s})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:h(t),onClick:()=>e.onPrint(t),children:n("imprimer_le_doc_75788")})})]})})},FA=e=>{const{mutate:n}=function(e={}){return Ui("mutation VolunteerRegistrationCustomDocumentPrint(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $customDocumentSlug: String!\n $reason: String!\n) {\n link: volunteerRegistrationCustomDocumentPrint(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n customDocumentSlug: $customDocumentSlug\n reason: $reason\n )\n}\n",e)}(),t=(0,V.useMemo)(()=>!!e.customDocument&&wh(e.customDocument.populationsIds??[],e.volunteerRegistration.userInfo.fields?.population),[e.customDocument,e.volunteerRegistration]),s=(0,V.useMemo)(()=>(e.volunteerRegistration.exportedCustomDocumentsSlugs??[]).includes(e.customDocument?.slug??"")&&(e.customDocument?.shouldRegenerateTicketIdOnDownload??!1),[e.customDocument,e.volunteerRegistration]),[o,a]=(0,V.useState)(!1),[r,d]=(0,V.useState)(!1),{name:l,clearName:c}=e.search,u=(0,V.useCallback)(()=>{l.startsWith("185")&&c()},[l,c]),m=(0,V.useCallback)(async(t="")=>{d(!0),a(!1);try{await async function(i,s){const o=window.open("about:blank","_blank");if(!o)throw new Error("Could not open print window, it has probably been blocked");try{const i=await(async()=>{const{link:i}=await n({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistration.id,customDocumentSlug:e.customDocument?.slug??"",reason:t});return Ef(i,"html",{lang:e.volunteerRegistration.userInfo.fields?.language})})(),a=await fetch(i,{method:"GET"});if(!a.ok)throw new Error(`Could not load document to print: ${a.status}`);const r=await a.text();o.document.write(r),o.document.close(),await Promise.all(Array.from(o.document.images).map(e=>new Promise(n=>{e.complete?n():(e.addEventListener("load",()=>n(),{once:!0}),e.addEventListener("error",()=>n(),{once:!0}))}))),await(o.document.fonts?.ready),o.addEventListener("afterprint",()=>{s?.(),o.close()},{once:!0}),o.focus(),o.print()}catch(e){throw o.close(),e}}(0,u)}catch(e){console.error(`Could not print custom document: ${e.toString()}`)}finally{d(!1),e.reload()}},[n,u,e.customDocument,e.eventId,e.volunteerRegistration,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:t&&(0,i.jsx)(tc,{color:"white",css:{overflow:"hidden","& .h-button-content":{overflow:"hidden"}},isLoading:r,leftIcon:"print",size:"sm",onClick:()=>s?a(!0):m(),children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name})})}),o&&(0,i.jsx)(kA,{customDocumentName:e.customDocument?.name??"",isOpen:o,onClose:()=>a(!1),onPrint:m})]})},NA=e=>{const{clearNameCursors:n,name:t}=pg();return(0,i.jsx)(FA,{column:e.column,customDocument:e.column.customDocument,eventId:e.eventId,reload:e.reload,search:{name:t,clearName:n},volunteerRegistration:e.volunteerRegistration})},LA=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{mutate:o}=dr(),{mutate:a}=Na(),{isEditMode:r}=pg(),d=(0,V.useMemo)(()=>e.volunteerRegistration.delegation,[e.volunteerRegistration.delegation]),l=(0,V.useMemo)(()=>d?[d.id]:[],[d]),[c,u]=(0,V.useState)(!0),[m,g]=(0,V.useState)([]),h=(0,V.useCallback)(async e=>{if(e&&c){const{event:{delegations:e}}=await ur({eventId:s},await X());g(e.nodes),u(!1)}},[c]),p=(0,V.useCallback)(async n=>{Yo(n)?await o({eventId:s,delegationId:n[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]}}):d&&await a({organizationId:t,eventId:s,delegationId:d.id,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},deleteFromEvent:!1}),e.reload()},[s,e.volunteerRegistration]);return r&&e.updatable?(0,i.jsx)(iA,{column:e.column,css:{gap:"$2"},initialValue:l,renderInput:(e,t)=>c?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("Delegation"),renderOnPortal:!0,values:e,onChange:t,children:m.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),renderValue:()=>d?(0,i.jsx)(Ku,{cursor:"pointer",ellipsis:!0,title:d.name,children:d.name}):null,onSave:p,onStateChange:h}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:d&&(0,i.jsx)(Ku,{cursor:"pointer",ellipsis:!0,title:d.name,children:(0,i.jsx)(ql,{to:Js.DELEGATION({organizationId:t,eventId:s,delegationId:d.id}),children:d.name})})})},UA=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),s=e.volunteerRegistration.delegation?.delegationCategory;return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:s&&(0,i.jsx)(Ku,{cursor:"pointer",ellipsis:!0,title:s.name,children:(0,i.jsx)(ql,{to:Js.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:s.id}),children:s.name})})})},VA=e=>{const{history:n,params:{organizationId:t,eventId:s}}=Kl(),o=(0,V.useMemo)(()=>(e.volunteerRegistration.userInfo?.formsUsersInfos??[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name,onClick(){n.push($s.FORM_ELEMENTS({organizationId:t,eventId:s,formId:e.form.id}))}}]:[]),[e.volunteerRegistration.userInfo]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:o})})},BA=e=>{const n=(0,V.useMemo)(()=>function(e,n){const t=(0,Lm.A)((0,Rg.A)(e.filter(e=>n.includes(e.accreditationCategoryId)),e=>e.accreditation.id),e=>e.accreditation.fields.cf50732).map(e=>e.accreditation.name.substring(9));return t[0]||""}((e.volunteerRegistration.accreditationsUsersInfos||[]).map(e=>({accreditationCategoryId:e.accreditationSlot.accreditationCategory.id,accreditation:e.accreditationSlot.accreditation})),[6870,5709]),[e.volunteerRegistration.accreditationsUsersInfos]);return(0,i.jsx)($m,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:n})},WA=e=>{const n=Fi(),{mutate:t}=rr(),{mutate:s}=lr(),o=ki(Bg),{isEditMode:a}=pg(),r=(0,V.useMemo)(()=>e.volunteerRegistration?.positionsSlotsUsersInfos||[],[e.volunteerRegistration]),d=(0,V.useMemo)(()=>oh(r),[r]),l=(0,V.useMemo)(()=>r.map(e=>e.positionSlot.id),[r]),[c,u]=(0,V.useState)(!0),[m,g]=(0,V.useState)([]),h=(0,V.useCallback)(async n=>{if(n&&c){const{event:n}=await nr({eventId:e.eventId},await X());g(Wh(o,n.positionsCategories,{usePositionDisplay:!0})),u(!1)}},[c]),p=(0,V.useCallback)(async n=>{Yo(n)?await t({eventId:e.eventId,massAssign:{positionsSlotsIds:n,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:hn.Replace}}):await s({eventId:e.eventId,massStateUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},state:it.WaitingAssignment}}),e.reload()},[e.eventId,e.volunteerRegistration,t,e.reload]);return a&&e.updatable?(0,i.jsx)(iA,{column:e.column,css:{gap:"$2"},initialValue:l,renderInput:(e,t)=>c?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("missions_63972"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:m}),renderValue:()=>(0,i.jsx)(pA,{badges:d,doNotSort:!0}),onSave:p,onStateChange:h}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:d,doNotSort:!0,onClick:e.onClick})})},GA=e=>{const n=(0,V.useMemo)(()=>(0,Rg.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)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},qA=e=>{const n=(0,V.useMemo)(()=>(e.volunteerRegistration?.preassignPositions||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},HA=e=>{const n=(0,V.useMemo)(()=>(e.volunteerRegistration?.preassignPositionsCategories||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},YA=e=>{const n=(0,V.useMemo)(()=>(e.volunteerRegistration.accreditationsUsersInfos||[]).filter(e=>e.checkInAt?.isValid),[e.volunteerRegistration]),t=(0,V.useMemo)(()=>dh(n),[n]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:t,doNotSort:!0,onClick:e.onClick})})},ZA=e=>(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:g(e.volunteerRegistration.shortTag)&&g(e.volunteerRegistration.weezeventPayUrl)?(0,i.jsx)(Xm,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventPayUrl,children:e.volunteerRegistration.shortTag}):e.volunteerRegistration.shortTag||""}),KA=(...e)=>({name:"canCommentFn",args:e}),XA=(...e)=>({name:"canRegistrationStateUpdateFn",args:e}),QA=(...e)=>({name:"canUserInfoSlotsUpdateFn",args:e});async function JA(e){try{const n=await X(),t=await function(e,n){return oa("query UserPermission($checks: [PermissionCheck!]!) {\n user {\n permission(checks: $checks)\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}(e,n);return t.user.permission}catch{return e.checks.map(e=>!1)}}const eE=new Map;function nE({checks:e}){const n=e.map(e=>[e,JSON.stringify(e)]),t=n.filter(([e,n])=>!eE.has(n));if(t.length>0){const e=JA({checks:t.map(([e,n])=>e)});t.forEach(([n,t],i)=>{eE.set(t,e.then(e=>e[i]))})}return Promise.all(n.map(([e,n])=>eE.get(n)))}function tE({withCaching:e,checks:n}){const[{isLoading:t,permissions:i},s]=(0,V.useState)({isLoading:!0,permissions:new Array(n.length).fill(!1)}),o=e?nE:JA;return(0,V.useEffect)(()=>{o({checks:n}).then(e=>{s({isLoading:!1,permissions:e})},()=>{s({isLoading:!1,permissions:i})})},[]),{isLoading:t,permissions:i}}function iE(...e){return tE({withCaching:!0,checks:e})}const sE=e=>{const n=Fi(),{mutate:t}=mr();return(0,i.jsx)(Tl,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await t({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"volunteer_registration_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(Ku,{cursor:"pointer",...Ly(e.state),children:n(e.state)})})},oE=e=>{const{permissions:[n,t],isLoading:s}=function(...e){return tE({withCaching:!1,checks:e})}(XA(e.eventId,it.PreAssigned,e.volunteerRegistrationId),XA(e.eventId,it.Assigned,e.volunteerRegistrationId));return s?null:(0,i.jsxs)(i.Fragment,{children:[t&&e.state!==it.WaitingAssignment&&(0,i.jsx)(sE,{close:e.close,eventId:e.eventId,reload:e.reload,state:it.WaitingAssignment,volunteerRegistrationId:e.volunteerRegistrationId}),n&&(0,i.jsx)(sE,{close:e.close,eventId:e.eventId,reload:e.reload,state:it.PreAssigned,volunteerRegistrationId:e.volunteerRegistrationId}),t&&e.state!==it.Refused&&(0,i.jsx)(sE,{close:e.close,eventId:e.eventId,reload:e.reload,state:it.Refused,volunteerRegistrationId:e.volunteerRegistrationId}),t&&e.state!==it.NotApplicable&&(0,i.jsx)(sE,{close:e.close,eventId:e.eventId,reload:e.reload,state:it.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})},aE=e=>{const n=Fi(),{isEditMode:t}=pg(),[s,o]=(0,V.useState)(!1),a=(0,V.useCallback)(e=>{t&&o(e)},[t,o]),r=(0,V.useCallback)(()=>{a(!1)},[a]);return t&&e.updatable?(0,i.jsx)($m,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary500"}},minWidth:e.column.minWidth,width:e.column.width,onClick:jc,children:(0,i.jsxs)(Ou,{isOpen:s,onStateChange:a,children:[(0,i.jsx)(Nu,{children:(0,i.jsxs)(Tl,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(Ku,{...Ly(e.state),cursor:"text",ellipsis:!0,children:n(e.state)}),s&&(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"chevron-down"})})]})}),(0,i.jsx)(Fu,{offset:2,placement:"bottom",width:230,children:(0,i.jsx)(oE,{close:r,...e})})]})}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ku,{...Ly(e.state),children:n(e.state)})})},rE=e=>{const n=(0,V.useMemo)(()=>e.volunteerRegistration.userInfo.tags||[],[e.volunteerRegistration]),t=(0,V.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:t})})},dE=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=Kl(),{isEditMode:r}=pg(),{mutate:d}=mr(),l=(0,V.useMemo)(()=>e.volunteerRegistration.teams||[],[e.volunteerRegistration]),c=(0,V.useMemo)(()=>l.map(({teamCode:t})=>({id:t,color:"gray",icon:null,text:t,onClick:r?void 0:()=>{n.push(yo.VOLUNTEERS_LIST_USER_PANEL_TEAM(s,o,a,e.volunteerRegistration.userInfo.id,t))}})),[l,r]);return 1===l.length&&r?(0,i.jsx)(iA,{column:e.column,css:{gap:"$2"},initialValue:l[0].teamCode,renderInput:(e,n)=>(0,i.jsx)(wc,{label:t("code_quipe_14296"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(pA,{badges:c}),onSave:async n=>{await d({eventId:o,volunteerRegistrationId:e.volunteerRegistration.id,slug:"team_code",value:n}),e.reload()}}):(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:c})})},lE=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),s=(0,V.useMemo)(()=>(0,Lm.A)(e.teamMembers,e=>u(e.name)),[e.teamMembers]);return(0,i.jsx)(Tl,{children:s.map((e,s)=>(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{css:{cursor:"pointer",position:"relative",left:-4*s+"px"},children:(0,i.jsx)(ql,{to:Rj.MEMBER_INFORMATION({organizationId:n,eventId:t,userInfoId:e.id}),children:(0,i.jsx)(t_,{email:e.email,image:e.picture?.url,name:e.name,size:24})})})}),(0,i.jsx)(Dx,{placement:"top",children:e.name})]},e.id))})},cE=e=>{const n=(0,V.useMemo)(()=>(e.volunteerRegistration.userInfo.formsUsersInfos||[]).flatMap(e=>e.teamMembers||[]),[e.volunteerRegistration]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(lE,{teamMembers:n})})},uE=e=>{const n=(0,V.useMemo)(()=>(e.volunteerRegistration.weezaccessChecklists||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},mE=e=>{const n=(0,V.useMemo)(()=>bA((e.volunteerRegistration.userInfo.formsUsersInfos??[]).flatMap(e=>e.accreditationProfile?[e.accreditationProfile]:[])),[e.volunteerRegistration]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n,doNotSort:!0})})},gE=e=>{const n=(0,V.useMemo)(()=>lh(e.volunteerRegistration?.accreditationsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n,doNotSort:!0,onClick:e.onClick})})},hE=e=>{const n=ki(Bg),t=(0,V.useMemo)(()=>ah(n,e.volunteerRegistration?.positionsCategories||[],e.volunteerRegistration?.positions||[],e.volunteerRegistration?.positionsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:t,onClick:e.onClick})})},pE=e=>{const{history:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Jm),a=ki(Xb),r=(0,V.useMemo)(()=>function(e,n){return n.flatMap(n=>n.form?[`${n.form.name} : ${e.toLocaleString(n.insertedAt.toLocal(),Uo.DateTime)}`]:[]).join(", ")}(o,e.row.userInfo.formsUsersInfos||[]),[e.row]),{mutate:d}=mr(),l=(0,V.useCallback)((n,t)=>d({eventId:e.eventId,volunteerRegistrationId:e.row.id,slug:t,value:n}),[e.eventId,e.row,d]),c=e.row.userInfo;switch(e.column.slug){case Th.AccreditationProfile:return(0,i.jsx)(AA,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAccredit,volunteerRegistration:e.row});case Th.Accreditations:return(0,i.jsx)(EA,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAccredit,volunteerRegistration:e.row,onClick:g(e.accreditationsPanelPath)?()=>{n.push(`${e.accreditationsPanelPath}/assigned`)}:void 0});case Th.AccreditationsCategories:return(0,i.jsx)(wA,{column:e.column,volunteerRegistration:e.row});case Th.AccreditationState:return(0,i.jsx)(TA,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.accreditationState,updatable:e.canMemberAccredit,volunteerRegistrationId:e.row.id});case Th.ScannedAccreditations:return(0,i.jsx)(YA,{column:e.column,volunteerRegistration:e.row,onClick:g(e.accreditationsPanelPath)?()=>{n.push(`${e.accreditationsPanelPath}/scanned`)}:void 0});case"bracelet_a_delivrer":return(0,i.jsx)(BA,{column:e.column,volunteerRegistration:e.row});case Th.Availability:return(0,i.jsx)(zA,{column:e.column,volunteerRegistration:e.row,onClick:g(e.availabilitiesPanelPath)?()=>{n.push(e.availabilitiesPanelPath)}:void 0});case Th.Comments:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:Yo(c.comments)?c.comments.map(e=>e.content).join("; "):""});case Th.CampaignsStates:return(0,i.jsx)(MA,{column:e.column,volunteerRegistration:e.row});case Th.CheckedInPositions:return(0,i.jsx)(PA,{column:e.column,volunteerRegistration:e.row,onClick:g(e.positionsPanelPath)?()=>{n.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Th.CompletedForms:return(0,i.jsx)(VA,{column:e.column,volunteerRegistration:e.row});case Th.FormsInsertedAt:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:r,children:r})});case Th.Delegations:return(0,i.jsx)(LA,{column:e.column,reload:e.reloadRow,updatable:e.canChangeDelegation,volunteerRegistration:e.row});case Th.DelegationBannerNumber:return(0,i.jsx)(OA,{column:e.column,mutate:l,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,volunteerRegistration:e.row});case Th.DuplicatedFrom:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.duplicatedFrom?(0,i.jsx)(My,{size:32,userInfo:e.row.duplicatedFrom.userInfo}):null});case Th.DelegationCategory:return(0,i.jsx)(UA,{column:e.column,volunteerRegistration:e.row});case Th.Email:return(0,i.jsx)(vA,{clickPath:e.informationPanelPath??Rj.MEMBER_INFORMATION({organizationId:t,eventId:s,userInfoId:e.row.userInfo.id}),column:e.column,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:c});case Th.Id:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:c.id});case Th.LocalId:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId});case Th.OrganizationLocalId:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:c.localId});case Th.InsertedAt:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:o.toLocaleString(e.row.insertedAt.toLocal(),Uo.DateTime)});case Th.Name:return(0,i.jsx)(SA,{clickPath:e.informationPanelPath,column:e.column,mutate:l,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:e.row.userInfo});case Th.NumberOfAccreditations:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAccreditations});case Th.NumberOfAssignments:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignments});case Th.NumberOfAssignmentsDays:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignmentsDays});case Th.NumberOfAvailableDays:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAvailableDays});case Th.Positions:return(0,i.jsx)(WA,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAssign,volunteerRegistration:e.row,onClick:g(e.positionsPanelPath)?()=>{n.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Th.PositionsCategories:return(0,i.jsx)(GA,{column:e.column,volunteerRegistration:e.row});case Th.PreassignedPositions:return(0,i.jsx)(qA,{column:e.column,volunteerRegistration:e.row});case Th.PreassignedPositionsCategories:return(0,i.jsx)(HA,{column:e.column,volunteerRegistration:e.row});case Th.Roles:return(0,i.jsx)(CA,{minWidth:e.column.minWidth,userPermissions:e.row.userInfo,width:e.column.width});case Th.Tags:return(0,i.jsx)(rE,{column:e.column,volunteerRegistration:e.row});case Th.TeamCode:return(0,i.jsx)(dE,{column:e.column,reload:e.reloadRow,volunteerRegistration:e.row});case Th.TeamMembers:return(0,i.jsx)(cE,{column:e.column,volunteerRegistration:e.row});case Th.VolunteerMinutes:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:a.minutesToHoursMinutesString(e.row.volunteerMinutes)});case Th.VolunteerRegistrationState:return(0,i.jsx)(aE,{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 Th.WishedAccreditationProfile:return(0,i.jsx)(mE,{column:e.column,volunteerRegistration:e.row});case Th.WishedAccreditationSlots:return(0,i.jsx)(gE,{column:e.column,volunteerRegistration:e.row,onClick:g(e.accreditationsPanelPath)?()=>{n.push(`${e.accreditationsPanelPath}/wished`)}:void 0});case Th.WishedPositions:return(0,i.jsx)(hE,{column:e.column,volunteerRegistration:e.row,onClick:g(e.positionsPanelPath)?()=>{n.push(`${e.positionsPanelPath}/wished`)}:void 0});case Th.WeezaccessChecklists:return(0,i.jsx)(uE,{column:e.column,volunteerRegistration:e.row});case Th.WeezeventBarcodeId:return(0,i.jsx)(DA,{column:e.column,volunteerRegistration:e.row});case Th.WeezeventBarcodeVersion:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.ticketIdVersion});case Th.WeezeventPairedAt:return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.pairedAt?.isValid?o.toLocaleString(e.row.pairedAt.toLocal(),Uo.DateTime):""});case Th.WeezeventShortTag:return(0,i.jsx)(ZA,{column:e.column,volunteerRegistration:e.row});default:return Object.values(Th).includes(e.column.slug)?(console.error(`003: Unhandled default column ${e.column.slug}`),(0,i.jsx)($m,{children:"ERR"})):e.column.slug.startsWith("form_inserted_at")?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:Qb(o,e.column.slug,e.row.userInfo.formsUsersInfos||[])}):Eh(e.column.slug)?(0,i.jsx)(NA,{column:e.column,eventId:e.eventId,reload:e.reloadRow,volunteerRegistration:e.row}):(0,i.jsx)(jA,{avatarUser:e.row.userInfo,clickPath:e.informationPanelPath??Rj.MEMBER_INFORMATION({organizationId:t,eventId:s,userInfoId:e.row.userInfo.id}),column:e.column,customField:e.customField,fields:e.row.userInfo.fields,mutate:l,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0})}},IE=({title:e,subtitle:n})=>(0,i.jsx)(km,{css:{height:"fit-content"},children:(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{align:"center",css:{padding:"$8 0"},direction:"column",justify:"center",width:1,children:[(0,i.jsx)(nb,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:e}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n})]})})}),xE=(0,V.createContext)({}),fE=e=>{const{mutate:n}=ja(),{mutate:t}=Ir(),[s,o]=(0,V.useState)(e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot)),a=(0,V.useMemo)(()=>s.map(({id:e})=>e),[s]),[r,d]=(0,V.useState)(e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlot]:[])),[l,c]=(0,V.useState)(e.volunteerRegistration.accreditationsSlots),u=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(s.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[s]),m=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(r.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[r]),g=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(l.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[l]),h=(0,V.useMemo)(()=>(0,Rg.A)(s.map(e=>e.accreditation),e=>e.id),[s]),p=(0,V.useMemo)(()=>(0,Rg.A)(r.map(e=>e.accreditation),e=>e.id),[r]),I=(0,V.useMemo)(()=>(0,Rg.A)(l.map(e=>e.accreditation),e=>e.id),[l]),x=(0,V.useCallback)(async t=>{await n({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:hn.Delete}}),o(e=>e.filter(e=>e.id!==t)),d(e=>e.filter(e=>e.id!==t))},[e.eventId,e.userInfoId,o,d]),f=(0,V.useCallback)(async n=>{await t({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:hn.Delete}}),c(e=>e.filter(e=>e.id!==n))},[e.eventId,e.delegationId,e.userInfoId]),_=(0,V.useCallback)(async t=>{await n({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:hn.Add}});const i=l.find(e=>e.id===t);o(e=>[...e,i])},[e.eventId,e.volunteerRegistration,l,o]),j=(0,V.useCallback)(n=>e.volunteerRegistration.accreditationsUsersInfos.find(e=>e.accreditationSlot.id===n).checkInAt,[e.volunteerRegistration]);return(0,i.jsx)(xE.Provider,{value:{assignSlot:_,assignedAccreditations:h,assignedCategories:u,assignedSlots:s,assignedSlotsIds:a,canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,deleteAssignedSlot:x,deleteWishedSlot:f,scannedAccreditations:p,scannedCategories:m,scannedSlots:r,wishedAccreditations:I,wishedCategories:g,wishedSlots:l,getScannedAt:j},children:e.children})};function _E(){return(0,V.useContext)(xE)}const jE=e=>{const{translate:n}=Kl(),t=ki(Jm),{assignSlot:s,assignedSlotsIds:o,canMemberAccredit:a,canWishedAccreditationsEdit:r,defaultHiddenAccreditationsSlotsIds:d,deleteAssignedSlot:l,deleteWishedSlot:c,getScannedAt:u}=_E(),[m,g]=(0,V.useState)(!1);return"assigned"===e.state&&!e.isBlocked&&a?(0,i.jsx)(Tl,{css:{flex:"1",px:"$4"},justify:"end",children:m?(0,i.jsx)(Qu,{borderRadius:"$1",height:20,children:n("retirer_05155")}):(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{g(!0),await l(e.accreditationSlotId)},children:n("retirer_05155")})}):"wished"===e.state&&a?(0,i.jsx)(Tl,{css:{flex:"1",px:"$4"},justify:"end",children:o.includes(e.accreditationSlotId)?(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[(0,i.jsx)(Mr,{color:"success500",children:(0,i.jsx)(Yl,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:n("d_j_attribu_e_06450")})]}):e.isBlocked?null:(0,i.jsx)(tc,{isLoading:m,size:"sm",onClick:async()=>{g(!0),await s(e.accreditationSlotId),g(!1)},children:n("ajouter_97327")})}):"wished"!==e.state||!r||e.isBlocked||d.includes(e.accreditationSlotId)?"scanned"===e.state?(0,i.jsx)(Tl,{css:{flex:"1",px:"$4"},children:(0,i.jsx)(Mr,{css:{ellipsis:!0},children:t.toLocaleString(u(e.accreditationSlotId),Uo.DateTime)})}):(0,i.jsx)(Tl,{css:{flex:"1",px:"$4"}}):(0,i.jsx)(Tl,{css:{flex:"1",px:"$4"},justify:"end",children:m?(0,i.jsx)(Qu,{borderRadius:"$1",height:20,children:n("retirer_05155")}):(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{g(!0),await c(e.accreditationSlotId)},children:n("retirer_05155")})})},vE=e=>{const n=ki(Jm),{canDeleteCheckedIn:t,canMemberAccredit:s,canWishedAccreditationsEdit:o,scannedSlots:a}=_E(),r="assigned"===e.state&&s||"scanned"===e.state||"wished"===e.state&&(s||o),d=g(e.slot.name)?e.slot.name:"-",l=(0,V.useMemo)(()=>e.slot.isBlocked?e.slot.isBlocked:!t&&a.some(n=>n.id===e.slot.id),[t,e.slot,a]);return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{css:{textTransform:"capitalize"},children:e.slot.date?n.toLocaleString(e.slot.date,Uo.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:d,width:1,children:d})}),r&&(0,i.jsx)(jE,{accreditationSlotId:e.slot.id,isBlocked:l,state:e.state})]})},SE=e=>{const{translate:n}=Kl(),{assignedSlots:t,canDeleteCheckedIn:s,canMemberAccredit:o,canWishedAccreditationsEdit:a,scannedSlots:r,wishedSlots:d}=_E(),l=(0,V.useMemo)(()=>(0,Lm.A)(("assigned"===e.state?t:"scanned"===e.state?r:d).filter(n=>n.accreditationId===e.accreditation.id),e=>[e.date?.toMillis()??1,e.name?.toLowerCase()||""]),[t,r,d,e.accreditation,e.state]),c=(0,V.useMemo)(()=>!s&&r.some(n=>n.id===e.accreditation.hiddenSlotId),[s,e.accreditation,r]),u="assigned"===e.state&&o||"scanned"===e.state||"wished"===e.state&&(o||a);return(0,i.jsx)(Ib,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:e.accreditation.hasSlots,numberOfSlots:l.length,renderActions:!e.accreditation.hasSlots&&u?()=>(0,i.jsx)(jE,{accreditationSlotId:e.accreditation.hiddenSlotId,isBlocked:c,state:e.state}):void 0,children:(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Gm,{children:n("nom_du_cr_neau_54351")}),u&&(0,i.jsx)(Gm,{children:"scanned"===e.state&&n("scann_e_le_27812")})]}),l.map(n=>(0,i.jsx)(vE,{slot:n,state:e.state},n.id))]})})},yE=e=>{const{assignedAccreditations:n,scannedAccreditations:t,wishedAccreditations:s}=_E(),o=(0,V.useMemo)(()=>uh(("assigned"===e.state?n:"scanned"===e.state?t:s).filter(n=>n.accreditationCategoryId===e.category.id)),[n,s,e.category,e.state]);return(0,i.jsx)(pb,{category:e.category.name,children:o.map(n=>(0,i.jsx)(SE,{accreditation:n,state:e.state},n.id))})},CE=e=>{const n=Fi(),{assignedCategories:t,scannedCategories:s,wishedCategories:o}=_E(),a="assigned"===e.state?t:"scanned"===e.state?s:o;return(0,i.jsx)(hb,{children:Yo(a)?a.map(n=>(0,i.jsx)(yE,{category:n,state:e.state},n.id)):(0,i.jsx)(IE,{title:n("no_accreditations")})})},bE=e=>{const{translate:n}=Kl();return(0,i.jsx)(fE,{canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.volunteerRegistration.userInfo.id,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(gp,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Yy,{children:n("accr_ditations_04710",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(hp,{css:{padding:"0"},children:(0,i.jsxs)(Ty,{height:1,children:[(0,i.jsxs)(wy,{center:!0,children:[(0,i.jsx)(Ey,{path:`${e.basePath}/assigned`,children:n("attribu_es_48167")}),(0,i.jsx)(Ey,{path:`${e.basePath}/wished`,children:n("souhait_es_78101")}),(0,i.jsx)(Ey,{path:`${e.basePath}/scanned`,children:n("scann_es_13169")})]}),(0,i.jsx)($y,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(CE,{state:"assigned"})}),(0,i.jsx)($y,{path:`${e.basePath}/wished`,children:(0,i.jsx)(CE,{state:"wished"})}),(0,i.jsx)($y,{path:`${e.basePath}/scanned`,children:(0,i.jsx)(CE,{state:"scanned"})})]})})]})})};function AE(e,n){return{name:n("commentaire_r_12290"),slug:`form${e}`,fieldType:Qe.Textarea,listType:un.Default,values:[]}}const EE=br(Mr,{overflow:"hidden",textOverflow:"ellipsis",color:"$gray500",fontSize:"$textSm",fontWeight:"$regular","@tablet":{fontSize:"$textSm"}}),wE=e=>{const n=ki(CC);switch(e.field.fieldType){case Qe.File:{const t=n.getValue(e.field,e.fields);return t?(0,i.jsx)(wv,{acl:"public-read",document:t}):(0,i.jsx)(EE,{children:"-"})}case Qe.Phone:{const t=n.getValueString(e.field,e.fields);return(0,i.jsx)(EE,{children:g(t)?(0,i.jsx)(Xm,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:`tel:${t}`,children:t}):"-"})}case Qe.Select:{const t=n.getSelectCustomFieldValues(e.field,e.fields);return(0,i.jsx)(Tl,{align:"center",gap:"3",wrap:"wrap",children:t.map(({value:n,color:t},s)=>e.field.listType===un.Dot?(0,i.jsx)(cA,{color:t||"",children:n},s):(0,i.jsx)(Ku,{color:e.field.listType===un.Badge?t||"":"gray",children:n},s))})}default:{const t=n.getValueString(e.field,e.fields);return(0,i.jsx)(EE,{children:g(t)?URL.canParse(t)?(0,i.jsx)(Xm,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:t,children:t}):t:"-"})}}},$E=e=>(0,i.jsx)(Mr,{color:"gray800",css:{overflow:"hidden",textOverflow:"ellipsis",...e.css},fontSize:"textSm",fontWeight:"medium",children:e.children}),TE=e=>(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)($E,{children:e.field.name}),(0,i.jsx)(wE,{field:e.field,fields:e.fields})]}),zE=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.form.elements.flatMap(e=>e.elementType===tn.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.form]),s=(0,V.useMemo)(()=>e.form.elements.filter(n=>n.elementType===tn.Field?AC(n.customField,e.userInfo.fields,t):n.elementType===tn.Section&&AC(n,e.userInfo.fields,t)),[t,e.form.elements,e.userInfo.fields]),o="all"!==e.form.id?AE(e.form.id,n):null;return(0,i.jsxs)(Tl,{css:e.css,direction:"column",children:[s.map((n,t)=>{switch(n.elementType){case tn.Field:return(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(TE,{field:n.customField,fields:e.userInfo.fields}),t!==s.length-1&&(0,i.jsx)(Pl,{height:"6"})]},n.id);case tn.Section:return(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:n.section}),t!==s.length-1&&(0,i.jsx)(Pl,{height:"4"})]},n.id);case tn.Text:return null;default:return Zl(n.elementType)}}),o&&g(e.userInfo.fields[o.slug])&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:n("inscription_en_49989")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(TE,{field:o,fields:e.userInfo.fields})]})]})},OE=e=>{const{data:n,loader:t}=Li("query DelegationMemberRightPanel(\n $organizationId: OrganizationId!\n $userInfoId: UsersInfoId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n id\n name\n email\n fields\n picture {\n url\n }\n\n formUserInfo(formId: $formId) {\n insertedAt\n form {\n ...FormMemberRegistration\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,userInfoId:e.userInfoId,formId:e.delegation.form.id},[$o.FormMemberRegistrationFragment]);return(0,i.jsx)(gp,{returnToFallback:e.returnPathFallback,size:"md",children:t||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yy,{children:(0,i.jsx)(My,{areContactLinksEnabled:!0,isClickDisabled:!0,size:48,userInfo:n.organization.userInfo})}),(0,i.jsx)(hp,{css:{background:"$gray50",py:"$6"},children:(0,i.jsx)(Yx,{children:(0,i.jsx)(zE,{form:n.organization.userInfo.formUserInfo.form,userInfo:n.organization.userInfo})})})]})})},RE=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:e.isChecked?"checked":"unchecked",onClick:e.onClick,children:e.text}),e.isChecked&&e.children&&(0,i.jsx)(Tl,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"4",children:e.children})]}),DE=e=>{const{translate:n}=Kl(),{mutate:t}=Ua(),[s,o]=(0,V.useState)(Ce.CheckInOut),[a,r]=(0,V.useState)(e.positionSlotUserInfo.checkInAt?.toLocal()),[d,l]=(0,V.useState)(e.positionSlotUserInfo.checkOutAt?.toLocal()),[c,u]=(0,V.useState)(e.positionSlotUserInfo.breakTime),[m,g]=(0,V.useState)(!1),h=(0,V.useMemo)(()=>Bo(),[]),p=s===Ce.Reset||a?.isValid&&d?.isValid&&d>a||a?.isValid&&!d?.isValid;return(0,i.jsx)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"sliders",children:n("mise_jour_du_76261")}),(0,i.jsxs)(hx,{gap:"2",children:[(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("que_souhaitez_v_87607")}),(0,i.jsxs)(RE,{isChecked:s===Ce.CheckInOut,text:n("mettre_jour_l_00128"),onClick:()=>{o(Ce.CheckInOut)},children:[(0,i.jsx)(Kp,{hint:n("date_et_heure_d_93417"),rightIcon:"xmark",value:a,zone:h,onChange:r,onRightIconClick:()=>r(null)}),(0,i.jsx)(Kp,{hint:n("date_et_heure_d_65738"),rightIcon:"xmark",value:d,zone:h,onChange:l,onRightIconClick:()=>l(null)}),(0,i.jsx)(wc,{hint:n("temps_de_pause_00051"),shouldParseAsInt:!0,value:c,onChange:u})]}),(0,i.jsx)(RE,{isChecked:s===Ce.Reset,text:n("remettre_z_ro_11572"),onClick:()=>{o(Ce.Reset)}})]}),(0,i.jsx)(gx,{children:o=>(0,i.jsx)(tc,{disabled:!p,isLoading:m,onClick:async()=>{g(!0),await t({eventId:e.positionSlotUserInfo.eventId,checkIn:{breakTime:c,checkInAt:a?.toUTC(),checkOutAt:d?.toUTC(),strategy:s,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),o()},children:n("mettre_jour_85141")})})]})})},ME=e=>{const{translate:n}=Kl(),{mutate:t}=Ua(),{mutate:s}=rr(),[o,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{triggerElem:e.triggerElem,children:[e.canCheckIn&&(0,i.jsx)(Pu,{icon:"circle-check",onClick:()=>a(!0),children:n("mettre_jour_l_00128")}),e.canCheckIn&&e.psui.state!==ye.Waiting&&(0,i.jsx)(Pu,{icon:"arrows-rotate",onClick:async()=>{await t({eventId:e.psui.eventId,checkIn:{strategy:Ce.Reset,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reloadCheckIn(e.psui.id)},children:n("remettre_z_ro_11572")}),e.canDelete&&(0,i.jsx)(Pu,{color:"red",icon:"user-xmark",onClick:async()=>{await s({eventId:e.psui.eventId,massAssign:{positionsSlotsIds:[e.psui.positionSlotId],selecteds:{ids:[e.psui.userInfoId]},strategy:hn.Delete}}),e.onDelete(e.psui.id)},children:n("d_saffecter_du_47122")})]}),(0,i.jsx)(DE,{isOpen:o,positionSlotUserInfo:e.psui,onClose:()=>{e.reloadCheckIn(e.psui.id),a(!1)}})]})},PE=e=>{const{translate:n}=Kl(),t=ki(Jm),s=ki(Xb),o=ki(Bg),{mutate:a}=Ua(),r=Dm(),d=(0,V.useMemo)(()=>{const n=e.positionSlotUserInfo.positionSlot;return g(n.name)?`${n.name} - ${o.toDisplayString(n.range)}`:o.toDisplayString(n.range)},[e.positionSlotUserInfo.positionSlot]),l=()=>(0,i.jsxs)(Tl,{align:"center",css:{padding:"$3","@tablet":{padding:"$3 $4"}},gap:"3",width:1,wrap:"wrap",children:[(0,i.jsx)(xI,{color:e.positionSlotUserInfo.position.color,icon:e.positionSlotUserInfo.position.icon}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",css:{fontWeight:"$medium",overflow:"hidden",textOverflow:"ellipsis","@tablet":{fontWeight:"$semiBold"}},children:e.positionSlotUserInfo.position.name}),(0,i.jsx)(Mr,{color:"gray500",fontSize:"textSm",children:d})]})]});return(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs","@tablet":{borderRadius:"$2"}},direction:"column",width:1,children:[e.canCheckIn?(0,i.jsx)(ql,{to:oo.POSITION({organizationId:e.positionSlotUserInfo.organizationId,eventId:e.positionSlotUserInfo.eventId,positionId:e.positionSlotUserInfo.position.id}),children:l()}):l(),(e.canCheckIn||e.canDelete)&&(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$3","@tablet":{padding:"$3 $4"}},justify:"between",width:1,children:[e.positionSlotUserInfo.state===ye.CheckedOut?(0,i.jsx)(Ku,{leftIcon:"clock",children:n("temps_total_79448",s.minutesToHoursMinutesString(e.positionSlotUserInfo.timeDifferenceMinutes))}):e.positionSlotUserInfo.state===ye.CheckedIn?(0,i.jsx)(Ku,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:n("point_le_1_63576",t.toLocaleString(e.positionSlotUserInfo.checkInAt.toLocal(),r?Uo.ShortDateTime:Uo.DateTime))}):(0,i.jsx)(Ku,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:n("non_point_42145")}),(0,i.jsxs)(Tl,{gap:"3",children:[e.canCheckIn&&e.positionSlotUserInfo.state===ye.Waiting&&(0,i.jsx)(tc,{size:"sm",onClick:async()=>{await a({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:Ce.CheckIn,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:n("pointer_80927")}),e.canCheckIn&&e.positionSlotUserInfo.state===ye.CheckedIn&&(0,i.jsx)(tc,{color:"white",size:"sm",onClick:async()=>{await a({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:Ce.CheckOut,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:n("d_pointer_25328")}),(0,i.jsx)(ME,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,psui:e.positionSlotUserInfo,reloadCheckIn:e.reloadCheckIn,triggerElem:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",rightIcon:"ellipsis-vertical",size:"sm"})}),onDelete:e.onDelete})]})]})]})},kE=(0,V.createContext)({}),FE=e=>{const{data:n}=Va({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id}),[t,s]=(0,V.useState)(e.volunteerRegistration.positionsSlotsUsersInfos),o=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(t.map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[t]),a=(0,V.useCallback)(e=>{s(n=>n.filter(n=>n.id!==e))},[s]),r=(0,V.useCallback)(async n=>{const i=t.find(e=>e.id===n),{event:{volunteerRegistration:{positionSlotUserInfo:o}}}=await(a={eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistration.id,positionSlotId:i.positionSlot.id},r=await X(),oa("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:a,token:r||void 0,fragments:[$o.UserPositionSlotUserInfoFragment]}));var a,r;s(e=>e.map(e=>e.id===n?o:e))},[e.eventId,e.volunteerRegistration,t,s]);return(0,i.jsx)(kE.Provider,{value:{assignedCategories:o,assignedPsuis:t,canCheckIn:e.canCheckIn,canDelete:e.canDelete,formsUsersInfos:n.organization?.userInfo.formsUsersInfos??[],onAssignedPsuiDelete:a,reloadCheckIn:r},children:e.children})};function NE(){return(0,V.useContext)(kE)}const LE=()=>{const{assignedCategories:e,assignedPsuis:n,canCheckIn:t,canDelete:s,onAssignedPsuiDelete:o,reloadCheckIn:a}=NE(),r=(0,V.useMemo)(()=>(0,fm.A)(n,e=>e.positionCategory.id),[n]);return(0,i.jsx)(hb,{children:e.map(e=>{const n=r[e.id];return(0,i.jsx)(pb,{category:e.name,children:n.map(e=>(0,i.jsx)(PE,{canCheckIn:"function"==typeof t?t(e.positionCategoryId,e.position.id):t,canDelete:s(e.positionCategoryId,e.position.id),positionSlotUserInfo:e,reloadCheckIn:a,onDelete:o},e.id))},e.id)})})},UE=e=>(0,i.jsxs)(Tl,{align:"center",css:e.css,direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Mr,{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??ou.WeezeventBlankPerson,width:"100%"})}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold","@tablet":{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}},textAlign:"center",children:e.title}),g(e.subtitle)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{color:"gray500",fontSize:"textSm",textAlign:"center",children:e.subtitle})]}),e.button&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Tl,{justify:"center",children:e.button})]})]}),VE=({message:e,title:n})=>(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n}),(0,i.jsx)(uc,{children:e})]});function BE(e,n,t,i){return(0,Lm.A)(e.map(e=>{const s=e.positions.map((s,o)=>({name:s.name,category:s.category.name,range:s.range?n.toDisplayString(s.range):"-",path:oo.POSITION({organizationId:t,eventId:i,positionId:s.id}),form:e.form,rank:o+1})),o=e.positionsCategories.map((s,o)=>({name:s.name,category:"",range:s.range?n.toDisplayString(s.range):"-",path:oo.POSITION_CATEGORY({organizationId:t,eventId:i,positionCategoryId:s.id}),form:e.form,rank:o+1})),a=e.positionsSlots.map((n,s)=>({name:n.position.name,category:n.positionCategory.name,range:n.nameOrRange,path:oo.POSITION({organizationId:t,eventId:i,positionId:n.position.id}),form:e.form,rank:s+1}));return s.concat(o).concat(a)}).flat(),[e=>e.form.name,(e,n)=>n])}const WE=({editDisabled:e,eventId:n,form:t,organizationId:s})=>{const o=Bi();return(0,i.jsx)(Ku,{color:"primary",cursor:e?"default":"pointer",onContentClick:()=>{e||o.push($s.FORM_ELEMENTS({organizationId:s,eventId:n??void 0,formId:t.id}))},children:t.name})},GE=({canMemberAssign:e,editPath:n,formsUsersInfos:t,isEditDisabled:s=!1})=>{const{history:o,params:{organizationId:a,eventId:r},translate:d}=Kl(),l=ki(Bg),c=(0,V.useMemo)(()=>BE(t,l,a,r),[t]),u=Dm();return(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:1,children:[s&&(0,i.jsx)(VE,{message:d("you_are_already_assigned_to_missions"),title:d("wished_positions_can_no_longer_be_changed")}),(0,i.jsx)(Nm,{filters:e&&g(n)&&(0,i.jsx)(tc,{color:"white",disabled:s,size:"sm",to:n,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:d("nom_de_la_missi_64605")}),!u&&(0,i.jsx)(Gm,{children:d("Date")}),!u&&(0,i.jsx)(Gm,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Yo(c)?c.map((e,n)=>(0,i.jsxs)(km,{children:[(0,i.jsxs)($m,{align:"start",direction:"column",gap:"1",justify:"center",children:[g(e.category)&&(0,i.jsx)(Mr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray900 textSm medium",onClick:()=>{o.push(e.path)},children:e.name}),e.form.positionRanking===sn.Ranked&&(0,i.jsx)(Mr,{color:"gray500",children:d("choix_n_1_00613",e.rank)}),u&&(0,i.jsx)(Mr,{color:"gray500",children:e.range})]}),!u&&(0,i.jsx)($m,{children:e.range}),!u&&(0,i.jsx)($m,{children:(0,i.jsx)(WE,{editDisabled:s,eventId:r,form:e.form,organizationId:a})})]},n)):(0,i.jsx)(km,{css:{height:"200px"},children:(0,i.jsx)($m,{children:(0,i.jsx)(UE,{title:d("aucune_mission_61179")})})})}),setOffset:Bc.A,title:d("missions_souhai_23225"),totalCount:0})]})},qE=()=>{const{formsUsersInfos:e}=NE();return(0,i.jsx)(Tl,{css:{background:"$gray50",padding:"$6"},height:1,width:1,children:(0,i.jsx)(GE,{canMemberAssign:!1,formsUsersInfos:e})})},HE=e=>{const{translate:n}=Kl();return(0,i.jsx)(FE,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(gp,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Yy,{children:n("missions_de_1_99317",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(hp,{css:{padding:"0"},children:(0,i.jsxs)(Ty,{height:1,children:[(0,i.jsxs)(wy,{center:!0,children:[(0,i.jsx)(Ey,{path:`${e.basePath}/assigned`,children:n("attribu_es_48167")}),(0,i.jsx)(Ey,{path:`${e.basePath}/wished`,children:n("souhait_es_78101")})]}),(0,i.jsx)($y,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(LE,{})}),(0,i.jsx)($y,{path:`${e.basePath}/wished`,children:(0,i.jsx)(qE,{})})]})})]})})},YE=V.createContext({}),ZE=e=>{const{data:n,loader:t}=Li("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},[$o.UserInfoTeamRightPanelFragment]);const{mutate:s}=rr(),[o,a]=V.useState([]),r=V.useMemo(()=>{const e=o.flatMap(e=>e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(n=>({...n,position:(0,Fr.A)(e,["id","name","icon","color"])}))))),n=o.flatMap(e=>e.positions.flatMap(e=>e.slots.map(n=>({...n,position:(0,Fr.A)(e,["id","name","icon","color"])})))),t=o.flatMap(e=>e.positionsSlots);return(0,Rg.A)(e.concat(n).concat(t),e=>e.id)},[o]),d=V.useMemo(()=>(0,Rg.A)(o.flatMap(e=>e.positionsSlotsUsersInfos.map(e=>({...e.positionSlot,position:e.position}))),e=>e.id),[o]),l=V.useMemo(()=>(0,Lm.A)((0,Rg.A)(r.concat(d),e=>e.id),e=>[e.position.name.toLowerCase(),e.range.start.toMillis()]),[r,d]),c=V.useMemo(()=>Object.fromEntries(o.map(e=>{const n=(0,wo.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,n]})),[o]),u=V.useMemo(()=>Object.fromEntries(o.map(e=>{const n=e.positionsSlotsUsersInfos.map(e=>e.positionSlot.id);return[e.userInfo.id,n]})),[o]),m=V.useCallback(async(n,t)=>{await s({eventId:e.eventId,massAssign:{positionsSlotsIds:[t],selecteds:{ids:[n]},strategy:hn.Add}});const{event:i}=await function(e,n){return oa("query TeamRightPanelMember($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...UserInfoTeamRightPanel\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.UserInfoTeamRightPanelFragment]})}({eventId:e.eventId,userInfoId:n},await X());a(e=>e.map(e=>e.userInfo.id===n?i.volunteerRegistration:e))},[e.eventId,a]);return V.useEffect(()=>{a(n.event?.team?.members??[])},[n.event,a]),(0,i.jsx)(YE.Provider,{value:{allSlots:l,form:n.event?.team?.form,loader:t,memberIdToAssignedSlotsIds:u,memberIdToWishedSlotsIds:c,members:o,assign:m},children:e.children})};function KE(){return V.useContext(YE)}const XE=e=>{const{translate:n}=Kl(),{assign:t,memberIdToAssignedSlotsIds:s,memberIdToWishedSlotsIds:o}=KE(),[a,r]=(0,V.useState)(!1),d=s[e.member.userInfo.id].includes(e.slot.id),l=o[e.member.userInfo.id].includes(e.slot.id);return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(My,{size:32,userInfo:e.member.userInfo})}),(0,i.jsx)($m,{justify:"end",children:d?(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[(0,i.jsx)(Mr,{color:"success500",children:(0,i.jsx)(Yl,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:n("d_j_affect_71706")})]}):l?(0,i.jsx)(tc,{isLoading:a,size:"sm",onClick:()=>{r(!0),t(e.member.userInfo.id,e.slot.id)},children:n("affecter_94255")}):(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[(0,i.jsx)(Mr,{color:"error500",children:(0,i.jsx)(Yl,{icon:"circle-xmark",iconStyle:"solid"})}),(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:n("non_souhait_46147")})]})})]})},QE=e=>{const{translate:n}=Kl(),{members:t}=KE(),s=ki(Bg),o=(0,V.useMemo)(()=>Zg(s,e.slot,e.slot.position.name,{slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Tl,{css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(xI,{color:e.slot.position.color,icon:e.slot.position.icon}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:e.slot.position.name}),(0,i.jsx)(Mr,{color:"gray500",children:o})]})]}),(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:n("full_name")}),(0,i.jsx)(Gm,{})]}),t.map(n=>(0,i.jsx)(XE,{member:n,slot:e.slot},n.userInfo.id))]})]})},JE=()=>{const{allSlots:e}=KE();return(0,i.jsx)(Tl,{direction:"column",gap:"3",width:1,children:e.map(e=>(0,i.jsx)(QE,{slot:e},e.id))})},ew=e=>{const{translate:n}=Kl(),{form:t,loader:s}=KE();return(0,i.jsxs)(gp,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Yy,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{children:n("_quipe_1_19590",e.teamCode)}),(0,i.jsx)(Mr,{color:"gray500",fontSize:"textSm",children:n("formulaire_1_39637",t?.name)})]})}),(0,i.jsx)(hp,{css:{background:"$gray50",py:"$6"},children:s||(0,i.jsx)(JE,{})})]})},nw=e=>(0,i.jsx)(ZE,{eventId:e.eventId,teamCode:e.teamCode,children:(0,i.jsx)(ew,{...e})}),tw=({editPath:e,eventId:n,organizationId:t,formsUsersInfos:s,showEditButton:o,isEditDisabled:a=!1})=>{const{translate:r}=Kl(),d=ki(Jm),l=ki(Bg),c=(0,V.useMemo)(()=>(0,Lm.A)(s.flatMap(e=>e.slots.map(n=>({range:n.range,display:e.form.slotDisplay,form:e.form}))),({range:e})=>e.start.toMillis()),[s]),u=Dm(),m=(0,V.useCallback)((e,n)=>{switch(n){case Ln.Calendar:case Ln.DisplayDays:return(0,i.jsx)(Mr,{children:d.toLocaleString(e.start,Uo.DateOnly.MonthLong)});case Ln.Display:case Ln.Custom:return(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{css:{lineHeight:"20px"},children:l.toDisplayString(e,{hideTime:!0})}),(0,i.jsx)(Mr,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:l.toDisplayString(e,{hideDate:!0})})]});case Ln.Hide:return null;default:return Zl()}},[]);return(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[a&&(0,i.jsx)(VE,{message:r("you_are_already_assigned_to_missions"),title:r("availabilities_can_no_longer_be_changed")}),(0,i.jsx)(Nm,{filters:o&&(0,i.jsx)(tc,{color:"white",disabled:a,size:"sm",to:e,children:r("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:r("Date")}),!u&&(0,i.jsx)(Gm,{children:r("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Yo(c)?c.map((e,s)=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:m(e.range,e.display)}),!u&&(0,i.jsx)($m,{children:(0,i.jsx)(WE,{editDisabled:a,eventId:n,form:e.form,organizationId:t})})]},s)):(0,i.jsx)(km,{css:{height:"200px"},children:(0,i.jsx)($m,{children:(0,i.jsx)(UE,{title:r("aucune_disponib_15602")})})})}),setOffset:Bc.A,title:r("disponibilit_s_49923"),totalCount:0})]})},iw=e=>{const n=Fi(),{data:t,loader:s}=sr({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.userInfoId}),{permissions:[o],isLoading:a}=iE(QA({eventId:e.eventId,userInfoId:e.userInfoId}));return(0,i.jsxs)(gp,{returnToFallback:e.returnPathFallback,size:"md",children:[(0,i.jsx)(Yy,{children:n("disponibilit_s_49923")}),(0,i.jsx)(hp,{children:s||a?s:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(tw,{editPath:yo.EDIT_USER_SLOTS(e.organizationId,e.eventId,e.userInfoId),eventId:e.eventId,formsUsersInfos:t.organization.userInfo.formsUsersInfos,organizationId:e.organizationId,showEditButton:o}),(0,i.jsx)(Pl,{height:"6"})]})})]})},sw=e=>{const{history:n,params:{organizationId:t}}=Kl();return(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:e.accreditationsPanelPath,children:(0,i.jsx)(bE,{basePath:e.accreditationsPanelPath,canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegation?.id,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),n.goBack(e.returnPathFallback)}})}),(0,i.jsx)(kr.qh,{path:e.availabilitiesPanelPath,children:(0,i.jsx)(iw,{delegationId:e.delegation?.id,eventId:e.eventId,organizationId:e.organizationId,returnPathFallback:e.availabilitiesPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),e.informationPanelPath&&e.delegation&&(0,i.jsx)(kr.qh,{path:e.informationPanelPath,children:(0,i.jsx)(OE,{delegation:e.delegation,organizationId:t,returnPathFallback:e.informationPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),(0,i.jsx)(kr.qh,{path:e.positionsPanelPath,children:(0,i.jsx)(HE,{basePath:e.positionsPanelPath,canCheckIn:e.canCheckIn,canDelete:e.canDeletePosition,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),n.goBack(e.returnPathFallback)}})}),(e.teamsPanelsPath||[]).map((t,s)=>(0,i.jsx)(kr.qh,{path:t,children:(0,i.jsx)(nw,{eventId:e.eventId,teamCode:(e.volunteerRegistration.teams||[])[s].teamCode,onClose:()=>{e.reloadRow(),n.goBack(e.returnPathFallback)}})},s))]})},ow=e=>{const n=Fi(),[t,s]=V.useState(!1),o=V.useCallback(async()=>{let n=!0;return s(!0),await e.onDelete(),n&&s(!1),()=>{n=!1}},[e.onDelete,t,s]);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(Tl,{align:"center",css:{background:"$error100",borderRadius:"48px",color:"$error600",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(Yl,{icon:"circle-exclamation",iconStyle:"light"})})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray900 textLg regular",textAlign:"center",title:e.text,children:e.text}),"subtext"in e&&Ho(e.subtext).map((e,n)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:e})]},n)),"children"in e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{color:"gray500",css:{alignSelf:"center"},children:e.children})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{color:"error",isLoading:t,onClick:o,children:e.buttonText}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},aw=e=>(0,i.jsx)(Mr,{css:{padding:"$2 $3"},font:"gray500 textXs semiBold",children:e.children}),rw=br("div",{display:"flex",flexDirection:"column","& + &":{borderTop:"1px solid $gray100"}}),dw=e=>V.Children.toArray(e).some(e=>(0,V.isValidElement)(e)&&e.type===V.Fragment?dw(e.props.children):Boolean(e)),lw=e=>dw(e.children)?(0,i.jsxs)(rw,{"aria-label":e.title,role:"group",children:[g(e.title)&&(0,i.jsx)(aw,{children:e.title}),e.children]}):null,cw=e=>{const{translate:n,params:{eventId:t,delegationId:s}}=Kl(),{mutate:o}=tr(),[a,r]=(0,V.useState)(1),[d,l]=(0,V.useState)(!1);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"clone",children:n("dupliquer_un_me_90016")}),(0,i.jsx)(hx,{children:(0,i.jsx)(wc,{label:n("nombre_de_copie_37518"),min:1,shouldParseAsInt:!0,value:a,onChange:r})}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{isLoading:d,onClick:async()=>{l(!0),await o({eventId:t,delegationId:s,selecteds:{ids:[e.userInfoId]},numberOfCopies:a}),e.onClose(),e.reload()},children:n("dupliquer_1_94438",e.name)})})]})})},uw=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=Kl(),{user:a}=Yi(),{mutate:r}=or(),{mutate:d}=Na(),{mutate:l}=Ga(),[c,u]=(0,V.useState)(!1),[m,g]=(0,V.useState)(!1),[h,p]=(0,V.useState)(!1),I=(0,V.useMemo)(()=>e.customDocuments.filter(n=>wh(n.populationsIds,e.member.fields.population)),[e.customDocuments,e.member]),x=s&&e.canMemberAccredit&&e.accreditationState===ge.WaitingAccreditation,f=s&&e.showDocumentsDownload&&void 0!==e.member.links&&Yo(e.allowedCustomDocuments),_=f?e.allowedCustomDocuments.map((t,s)=>{const o=I.find(e=>e.slug===t);return o?(0,i.jsx)(Pu,{download:`${e.member.nameOrEmail}-${o.name}`,icon:"arrow-down-to-bracket",target:"_blank",to:Ef(e.member.links?.userCustomDocumentLinks[t],"pdf",{lang:a?.language}),children:n("t_l_charger_1_80752",o.name)},s):Dt.includes(t)?(0,i.jsx)(Pu,{download:`${e.member.nameOrEmail}-custom-badge`,icon:"arrow-down-to-bracket",target:"_blank",to:Ef(e.member.links?.userCustomBadgeLinks[t],"pdf",{lang:a?.language}),children:n("t_l_charger_1_80752",M_(t))},s):null}):[];return x||f||e.canDuplicate||e.canDelete||e.showDeleteFromEvent?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(lw,{children:x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pu,{icon:"check",onClick:async()=>{await r({eventId:s,delegationId:o,selecteds:{ids:[e.member.id]}}),e.reload()},children:n("valider_les_acc_80801")}),(0,i.jsx)(Pu,{icon:"badge-check",to:yo.ACCREDIT(t,s,e.member.id),children:n("accr_diter_70543")})]}):null}),(0,i.jsx)(lw,{children:_}),(0,i.jsxs)(lw,{children:[e.canDuplicate&&(0,i.jsx)(Pu,{icon:"clone",onClick:()=>u(!0),children:n("dupliquer_28256")}),e.canDelete&&(0,i.jsx)(Pu,{color:"red",icon:"user-xmark",onClick:()=>g(!0),children:n("retirer_de_la_d_64963")})]}),(0,i.jsx)(lw,{children:e.showDeleteFromEvent&&(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>p(!0),children:n("delete_from_eve_69290")})})]}),m&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_sur_d_88752")],text:n("suppression_de_73669",e.member.nameOrEmail),onClose:()=>g(!1),onDelete:async()=>{await d({organizationId:t,eventId:s,delegationId:o,selecteds:{ids:[e.member.id]},deleteFromEvent:e.deleteFromEvent}),e.reload()}}),e.canDuplicate&&c&&(0,i.jsx)(cw,{name:e.member.nameOrEmail,reload:e.reload,userInfoId:e.member.id,onClose:()=>u(!1)}),h&&e.volunteerRegistrationId&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:[n("are_you_sure_yo_46668")],text:n("suppression_de_73669",e.member.nameOrEmail),onClose:()=>p(!1),onDelete:async()=>{await l({eventId:s,selecteds:{ids:[e.member.id]}}),e.reload()}})]}):null},mw=({displayName:e,isAddDeleteVisible:n,isResetVisible:t,massEditFieldInput:s,reset:o,strategy:a,change:r})=>{const{translate:d}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:d("que_souhaitez_v_87607")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(cm,{state:o||a!==hn.Replace?"unchecked":"checked",onClick:()=>{r("massEdit.reset",!1),r("massEdit.strategy",hn.Replace)},children:d("remplacer_les_v_78885")}),!o&&a===hn.Replace&&s,(0,i.jsx)(Pl,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:o||a!==hn.Add?"unchecked":"checked",onClick:()=>{r("massEdit.reset",!1),r("massEdit.strategy",hn.Add)},children:d("ajouter_des_val_80159")}),!o&&a===hn.Add&&s,(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:o||a!==hn.Delete?"unchecked":"checked",onClick:()=>{r("massEdit.reset",!1),r("massEdit.strategy",hn.Delete)},children:d("supprimer_des_v_96120")}),!o&&a===hn.Delete&&s,(0,i.jsx)(Pl,{height:"3"})]}),t&&(0,i.jsx)(cm,{state:o?"checked":"unchecked",onClick:()=>r("massEdit.reset",!0),children:d("r_initialiser_42983",e)})]})},gw=e=>{const n=Fi(),t=ki(zC),s=(0,V.useMemo)(()=>(0,Lm.A)(e.customFields??[],e=>e.name.toLowerCase()),[e.customFields]),o=(0,V.useMemo)(()=>(0,Lm.A)([...s.map(e=>({slug:e.slug,name:e.name,label:e.label})),...e.properties.map(e=>({slug:e,name:n(e),label:null}))],e=>e.name.toLowerCase()),[s,e.properties]);return(0,i.jsx)(dg,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Dl.lV,{initialValues:{massEdit:{reset:!1,selecteds:e.selecteds,slug:"",value:"",strategy:hn.Replace}},initialValuesEqual:Yr.A,render:({form:t,handleSubmit:a,submitting:r,values:d})=>{const{reset:l,slug:c,strategy:u}=d.massEdit,m=o.find(e=>e.slug===c),h=s.find(e=>e.slug===c),p=g(c)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(GC,{campaigns:e.campaigns,categories:e.categories,change:t.change,customDocuments:e.customDocuments,customField:h,delegationsSpaceLayouts:e.delegationsSpaceLayouts,forms:e.forms,name:"massEdit.value",slug:c,tags:e.tags,traces:e.traces,value:d.massEdit.value})})]}):null,I=c===ae.Tag||c===ze.Campaigns||c===ze.Documents||!0===h?.canSelectMultiple,x=c!==ae.Category&&c!==we.Category&&c!==ze.Category&&c!==vn.Category&&c!==vn.Layer&&c!==vn.Zoom&&c!==ae.WeezeventIsSynchronized&&c!==we.Privacy&&c!==ze.Form&&c!==ze.IsLocked&&c!==ze.ShowFormLinkInDelegationSpace&&c!==ze.ShowInDelegationSpace&&c!==ze.CanLeadersAddMembers&&c!==ze.CanLeadersEditCustomFields&&c!==ze.CanLeadersEditMembers&&c!==ze.CanLeadersDeleteMembers&&c!==ze.CanLeadersDuplicateMembers&&c!==ze.CanLeadersEditColumns&&c!==ze.CanLeadersImportMembers&&c!==ze.CanLeadersSeeHiddenAccreditationsSlots&&c!==ze.ShowAllAccreditations&&c!==vn.WeezeventIsSynchronized&&c!==ct.Frequency&&c!==ct.State;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("_dition_de_la_v_67585")}),(0,i.jsx)(Pl,{height:"7"}),e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(of,{isSearchVisible:!0,label:n("quel_est_le_cha_81138"),name:"massEdit.slug",placeholder:n("s_lectionnez_un_82446"),children:o.map(e=>(0,i.jsx)("option",{value:e.slug,children:hC(e)},e.slug))}),m&&(0,i.jsx)(mw,{change:t.change,displayName:m.name,isAddDeleteVisible:I,isResetVisible:x,massEditFieldInput:p,reset:l,strategy:u}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:(f=d.massEdit,_=h,!(f.reset||!_||_.fieldType!==Qe.Select||_.canSelectMultiple||"number"==typeof f.value&&!isNaN(f.value))),isLoading:r,onClick:a,children:n("modifier_la_val_07602")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]});var f,_},validate:e=>{const n=s.find(n=>n.slug===e.massEdit.slug),i=n&&!e.massEdit.reset?t.getValidationRuleError(n,e.massEdit.value):null;return i?{massEdit:{value:i}}:{}},onSubmit:async n=>{const t=(await e.mutate(n.massEdit)).numberOfEdited;e.onSuccess(t),e.onClose()}})})},hw=e=>{const{data:n,isLoading:t}=Li("query PositionsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: Position\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n\n traces {\n id\n name\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[$o.MassEditCustomFieldFragment]);const s=(0,V.useMemo)(()=>oi.filter(e=>e!==vn.Name),[]);return(0,i.jsx)(gw,{campaigns:[],categories:n.event?.positionsCategories??[],customDocuments:[],customFields:n.organization?.customFields.nodes??qo,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:n.organization?.tags.nodes??[],traces:n.event?.traces??[],onClose:e.onClose,onSuccess:e.onSuccess})},pw=e=>{const{data:n,isLoading:t}=Li("query AccreditationsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: Accreditation\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[$o.MassEditCustomFieldFragment]);const s=(0,V.useMemo)(()=>bt.filter(e=>e!==ae.Name),[]);return(0,i.jsx)(gw,{campaigns:[],categories:n.event?.accreditationsCategories??[],customDocuments:[],customFields:n.organization?.customFields.nodes??qo,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:n.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},Iw=e=>{const{data:n,isLoading:t}=Li("query AccreditationsProfilesMassEditInfos($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n }\n }\n}\n",{eventId:e.eventId},[]);const s=(0,V.useMemo)(()=>At.filter(e=>e!==le.Name),[]);return(0,i.jsx)(gw,{campaigns:[],categories:n.event?.accreditationsProfilesCategories??[],customDocuments:[],customFields:qo,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},xw=e=>{const{data:n,isLoading:t}=(s={organizationId:e.organizationId},Li(ra,s,[]));var s;const o=(0,V.useMemo)(()=>Mt.filter(e=>e!==we.Label&&e!==we.Name),[]);return(0,i.jsx)(gw,{campaigns:[],categories:n.organization?.customFieldsCategories.nodes??[],customDocuments:[],customFields:qo,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},fw=e=>{const{data:n,isLoading:t}=(s={organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?xn.Event:xn.Organization},Li(da,s,[$o.MassEditCustomFieldFragment]));var s;const o=(0,V.useMemo)(()=>kt.filter(e=>e!==ze.Name&&e!==ze.Columns&&e!==ze.Parent),[]);return(0,i.jsx)(gw,{campaigns:n.organization?.campaigns.nodes??[],categories:n.organization?.delegationsCategories.nodes??[],customDocuments:n.organization?.event?.customDocuments??[],customFields:n.organization?.customFields.nodes??qo,delegationsSpaceLayouts:n.organization?.event?.delegationsSpaceLayouts??[],forms:n.organization?.forms.nodes??[],isLoading:t,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:n.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},_w=e=>{const{data:n,isLoading:t}=Li("query UsersInfosMassEditInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[$o.MassEditCustomFieldFragment]);return(0,i.jsx)(gw,{campaigns:[],categories:[],customDocuments:[],customFields:n.organization?.customFields.nodes??qo,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:qo,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},jw=e=>(0,i.jsx)(gw,{campaigns:[],categories:[],customDocuments:[],customFields:e.customFields,delegationsSpaceLayouts:[],forms:[],isLoading:!1,mutate:e.mutate,properties:qo,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess}),vw=e=>{const n=(0,V.useMemo)(()=>Ai.filter(n=>n!==ct.Name&&(e.canAccessBackoffice||n!==ct.Frequency)),[e.canAccessBackoffice]);return(0,i.jsx)(gw,{campaigns:[],categories:[],customDocuments:[],customFields:qo,delegationsSpaceLayouts:[],forms:[],isLoading:!1,mutate:e.mutate,properties:n,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})};let Sw=class extends Rc{translationService;constructor(e){super(e),this.translationService=e}step1Schema(){return zc.Ik().shape({[this.inputName]:zc.Ik().shape(this.step1Fields())})}step2Schema(){return zc.Ik().shape({[this.inputName]:zc.Ik().shape(this.step2Fields())})}schema(){return zc.Ik().shape({...this.step1Fields(),...this.step2Fields()})}strategyField(e=ni){return zc.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(e,this.t("la_strat_gie_es_82287"))}};Sw=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Sw);let yw=class extends Sw{translationService;inputName="massAccredit";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsSlotsIds:zc.YO().of(zc.ai()).required(this.t("vous_devez_s_le_72138")).when("accreditationProfile",{is:e=>!e,then:e=>e.min(1,this.t("vous_devez_s_le_72138"))})}}};yw=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],yw);const Cw=e=>(0,St.createPortal)((0,i.jsx)(Mr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"50",...e.css},height:1,width:1,children:e.children}),document.body),bw=({children:e,handleSubmit:n,nextText:t,prefix:s,strategies:o})=>{const a=Fi();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:a("que_souhaitez_v_87607")}),o.map(({label:e,value:n})=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:`${s}strategy`,value:n,children:e})]},n)),e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),e]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:n,children:t})})]})},Aw=e=>{const n=Fi();return(0,i.jsx)(bw,{handleSubmit:e.handleSubmit,nextText:n("suivant_accr_25709"),prefix:"massAccredit.",strategies:[{label:n("ajouter_des_acc_17744"),value:hn.Add},{label:n("remplacer_les_a_92733"),value:hn.Replace},{label:n("supprimer_des_a_04246"),value:hn.Delete}]})};var Ew=t(9120);const ww=e=>(0,Lm.A)(e,e=>e.toMillis()),$w=br("div",{alignItems:"center",borderRadius:"$2",color:"$gray400",display:"flex",fontWeight:"$medium",height:"32px",justifyContent:"center",userSelect:"none",width:"32px",variants:{isSelectable:{true:{color:"$gray800",cursor:"pointer","&:hover":{background:"$primary500",color:"white"}}},isSelected:{true:{background:"$primary500",color:"white",cursor:"pointer"}}},compoundVariants:[{isSelectable:!0,isSelected:!0,css:{background:"$primary500",color:"white",cursor:"pointer"}}]}),Tw=({datesToTitle:e,disabledDates:n,firstDayOfMonth:t,max:s,min:o,onChange:a,startHour:r,values:d})=>{const l=Fi(),c=ki(Jm),u=(0,V.useMemo)(()=>t.minus({day:t.weekday-1}),[t]),m=(0,V.useMemo)(()=>t.endOf("month"),[t]),g=(0,V.useMemo)(()=>{const e=m.plus({day:7-m.weekday});return Math.ceil(e.diff(u,"days").days)},[m]),h=(0,V.useMemo)(()=>(0,Om.A)(0,g).map(e=>{const i=u.plus({day:e}).set({hour:r||0}),a=i.toMillis(),l=d.some(e=>e.toMillis()===a),c=!!Yo(n)&&n.some(e=>e.toMillis()===a);return{day:i,isSelected:l,isDisabled:c,isSelectable:!c&&i.month===t.month&&i>=o&&i<=s}}),[u,g,d,n,r]),p=(0,V.useMemo)(()=>!h.some(({isSelectable:e,isSelected:n})=>e&&!n),[h]),I=(0,V.useCallback)(()=>{a(p?[]:h.flatMap(({day:e,isSelectable:n,isSelected:t})=>n||t?[e]:[]))},[h,p,a]);return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$5 $4"},direction:"column",children:[(0,i.jsx)(Mr,{css:{textTransform:"capitalize"},font:"gray800 textXl semiBold",textAlign:"center",width:1,children:c.toLocaleString(t,{month:"long",year:"numeric"})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(eu,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:(0,Om.A)(0,7).map(e=>{const n=u.plus({day:e});return(0,i.jsx)(Mr,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",width:32,children:c.toLocaleString(n,{weekday:"short"})},e)})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(eu,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:h.map(({day:n,isSelected:t,isSelectable:s},o)=>(0,i.jsx)($w,{isSelectable:s,isSelected:t,title:e?.[n.toMillis()],onClick:e=>{if(s&&t)a(ww((0,Ew.A)(d,[n],e=>e.toMillis())));else if(s&&!t){const t=d.findLast(e=>et.plus({day:e+1}));a(ww([...d,...i]))}else a(ww([...d,n]))}},children:n.day},o))}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(tc,{color:"white",textAlign:"center",onClick:I,children:l(p?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})};function zw(e,n,t){const i=t-n;return i<=0?e("quota_atteint_12838"):e("quota_1_2_23970",n,t,i)}const Ow=e=>{const{translate:n}=Kl();return(0,V.useMemo)(()=>{const t=e.getAssignedMaxRemaining(e.slotId);return t?t.remaining<=0?(0,i.jsx)(Ku,{color:"error",leftIcon:"circle-xmark",size:"sm",children:zw(n,t.assignedResources,t.maxResources)}):(0,i.jsx)(Ku,{color:"white",size:"sm",children:zw(n,t.assignedResources,t.maxResources)}):null},[e.slotId,e.getAssignedMaxRemaining,n])},Rw=e=>{const{translate:n}=Kl(),{minDate:t,maxDate:s,numberOfMonths:o,totalDaysDiff:a}=(0,V.useMemo)(()=>function(e){const n=e.filter(e=>e.date?.isValid),t=(0,Dg.A)(n.map(e=>e.date),e=>e.toMillis()),i=(0,Mg.A)(n.map(e=>e.date),e=>e.toMillis()),s=Math.ceil(i.endOf("month").diff(t.startOf("month"),"months").months),o=Math.ceil(i.diff(t,"days").days);return{minDate:t,maxDate:i,numberOfMonths:s,totalDaysDiff:o}}(e.slots),[e.slots]),r=(0,V.useMemo)(()=>e.slots.flatMap(n=>n.date?.isValid&&e.accreditationsSlotsIds.includes(n.id)?[n.date]:[]),[e.slots,e.accreditationsSlotsIds]),d=(0,V.useMemo)(()=>(0,Om.A)(0,a).flatMap(n=>{const i=t.plus({day:n});return e.slots.some(e=>e.date?.isValid&&e.date.toMillis()===i.toMillis())?[]:[i]}),[t,a,e.slots]),l=(0,V.useMemo)(()=>Object.fromEntries(e.slots.flatMap(t=>{const i=e.slotIdToDas?.[t.id];return t.date?.isValid&&"number"==typeof i?.maxResources?[[t.date.toMillis(),zw(n,i.assignedResources,i.maxResources)]]:[]})),[e.slotIdToDas,e.slots,n]);return(0,i.jsx)(Tl,{gap:"4",wrap:"wrap",children:(0,Om.A)(0,o).map(n=>{const a=t.plus({month:n}).startOf("month"),c=0===n?t:a,u=n===o-1?s:a.endOf("month"),m=r.filter(e=>e.startOf("month").equals(a));return(0,i.jsx)(Tw,{datesToTitle:l,disabledDates:d,firstDayOfMonth:a,max:u,min:c,values:m,onChange:n=>{e.onChange(function(e,n,t,i){const s=(0,em.A)(e,n.flatMap(e=>e.date?.isValid&&t.equals(e.date.startOf("month"))?[e.id]:[]));return n.flatMap(e=>i.some(n=>e.date?.isValid&&n.startOf("day").equals(e.date.startOf("day")))?[e.id]:[]).concat(s)}(e.accreditationsSlotsIds,e.slots,a,n))}},n)})})},Dw=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.slots.filter(e=>e.date?.isValid),[e.slots]);return Yo(t)?(0,i.jsx)(Rw,{...e,slots:t}):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})},Mw=e=>{const{translate:n}=Kl(),t=ki(Rv),s=(0,V.useMemo)(()=>rh(e.accreditation),[e.accreditation]),o=(0,V.useMemo)(()=>e.das?.assignedResources??e.slot.assignedResources,[e.das,e.slot]),a=(0,V.useMemo)(()=>e.das?.maxResources??e.slot.maxResources,[e.das,e.slot]),r=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",px:"$4",userSelect:"none"},gap:"2",height:64,onClick:()=>{e.onClick(e.slot.id,"unchecked"===r)},children:[(0,i.jsx)(sm,{shouldPreventDefault:!1,state:r,onClick:Bc.A}),(0,i.jsx)(xI,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Tl,{css:{px:"$3"},width:310,children:(0,i.jsx)(Ku,{color:o>=(a||1/0)?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",o,t.toNumberOrInfinity(a))})})]})},Pw=e=>{const n=Fi(),t=ki(Jm),s=ki(Rv),o=(0,V.useMemo)(()=>e.das?.assignedResources??e.slot.assignedResources,[e.das,e.slot]),a=(0,V.useMemo)(()=>e.das?.maxResources??e.slot.maxResources,[e.das,e.slot]),r=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(km,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===r)},children:[(0,i.jsx)($m,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(sm,{shouldPreventDefault:!1,state:r,onClick:Bc.A}):(0,i.jsx)(lm,{shouldPreventDefault:!1,state:r,onClick:Bc.A})}),(0,i.jsx)($m,{children:g(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)($m,{children:e.slot.date?.isValid?t.toLocaleString(e.slot.date,Uo.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)($m,{children:(0,i.jsx)(Ku,{color:o>=(a||1/0)?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",o,s.toNumberOrInfinity(a))})})]})},kw=e=>{const n=Fi(),t=(0,V.useMemo)(()=>(0,Lm.A)(e.slots.filter(n=>n.accreditation.id===e.accreditation.id),e=>(0,kl.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.slots,e.accreditation]),s=(0,V.useMemo)(()=>t.map(e=>e.id),[t]),o=(0,V.useMemo)(()=>Object.fromEntries(e.delegationAccreditationsSlots.map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),a=(0,V.useMemo)(()=>{const n=(0,mm.A)(e.accreditationsSlotsIds,s);return n.length===s.length?"checked":0===n.length?"unchecked":"indeterminate"},[s,e.accreditationsSlotsIds]),r=(0,V.useCallback)((n,t)=>{if(e.accreditation.accreditationDisplay===oe.Radio){const i=(0,em.A)(e.accreditationsSlotsIds,s).concat(t?[n]:[]);e.change("massAccredit.accreditationsSlotsIds",i)}else e.change("massAccredit.accreditationsSlotsIds",Ko(e.accreditationsSlotsIds,n,t))},[e.accreditation,e.accreditationsSlotsIds,e.change,s]),d=(0,V.useCallback)(n=>{e.change("massAccredit.accreditationsSlotsIds",n)},[e.change]),l=e.accreditation.accreditationDisplay===oe.List||e.strategy===hn.Delete;return e.accreditation.hasSlots?(0,i.jsx)(Ib,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:t.length,children:e.accreditation.accreditationDisplay===oe.Calendar?(0,i.jsx)(Tl,{css:{background:"$gray50",padding:"$4"},children:(0,i.jsx)(Dw,{accreditationsSlotsIds:e.accreditationsSlotsIds,slots:t,onChange:d})}):(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{justify:"center",width:48,children:l&&(0,i.jsx)(sm,{state:a,onClick:n=>{"checked"===n?e.change("massAccredit.accreditationsSlotsIds",(0,wo.A)(e.accreditationsSlotsIds.concat(s))):e.change("massAccredit.accreditationsSlotsIds",(0,em.A)(e.accreditationsSlotsIds,s))}})}),(0,i.jsx)(Gm,{children:n("nom_du_cr_neau_54351")}),(0,i.jsx)(Gm,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Gm,{})]}),t.map(n=>(0,i.jsx)(Pw,{accreditationsSlotsIds:e.accreditationsSlotsIds,das:o[n.id]??null,shouldDisplayList:l,slot:n,onClick:r},n.id))]})}):(0,i.jsx)(Mw,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,das:o[t[0].id]??null,slot:t[0],onClick:r})},Fw=e=>{const n=(0,V.useMemo)(()=>uh(e.accreditations.filter(n=>n.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(pb,{category:e.category.name,children:n.map(n=>(0,i.jsx)(kw,{accreditation:n,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,slots:e.slots,strategy:e.strategy},n.id))})},Nw=e=>{const n=Fi();return(0,i.jsxs)(Ou,{doNotCloseOnOtherOpen:!0,isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Mr,{children:(0,i.jsxs)(tc,{color:e.color,leftIcon:"bars-filter",children:[n("filtres_64574")," ",(e.numberOfAppliedFilters||0)>0?`(${e.numberOfAppliedFilters})`:""]})})}),(0,i.jsx)(Fu,{placement:"bottom-end",width:385,children:(0,i.jsxs)(Tl,{direction:"column",onChange:jc,children:[(0,i.jsxs)(Tl,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("liste_des_filtr_75605")}),e.children]}),e.showButtons&&(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:e.reinit,children:n("r_initialiser_77538")}),(0,i.jsx)(tc,{size:"sm",onClick:e.apply,children:n("appliquer_05753")})]})]})})]})},Lw=e=>{const n=Fi(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(e.excludeEmpty?"checked":"unchecked"),[r,d]=(0,V.useState)(e.excludeFull?"checked":"unchecked"),[l,c]=(0,V.useState)(e.excludePast?"checked":"unchecked"),u=(e.excludeEmpty?1:0)+(e.excludeFull?1:0)+(e.excludePast?1:0);return(0,i.jsxs)(Tl,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_une_65646"),value:e.name,onChange:n=>{e.setName(n)}})}),(0,i.jsxs)(Nw,{apply:()=>{e.setExcludeEmpty("checked"===o),e.setExcludeFull("checked"===r),e.setExcludePast("checked"===l),s(!1)},color:"white",isOpen:t,numberOfAppliedFilters:u,reinit:()=>{e.setExcludeEmpty(!1),a("unchecked"),e.setExcludeFull(!1),d("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsx)(om,{state:o,onClick:a,children:n("cacher_les_cr_n_76382")}),(0,i.jsx)(om,{state:r,onClick:d,children:n("cacher_les_cr_n_31908")}),(0,i.jsx)(om,{state:l,onClick:c,children:n("masquer_les_cr_05336")})]})]})},Uw=e=>{const n=Fi(),[t,s,o]=Wm(""),[a,r]=(0,V.useState)(!1),[d,l]=(0,V.useState)(!1),[c,m]=(0,V.useState)(!1),{data:h,loader:p}=Li("query MassAccreditSlots(\n $eventId: EventId!\n $delegationId: DelegationId\n $accreditationName: String\n $excludeFull: Boolean\n $excludeEmpty: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n delegation: delegationMaybe(id: $delegationId) {\n accreditationsSlots {\n accreditationSlotId\n assignedResources\n maxResources\n }\n }\n\n accreditationsSlots(\n delegationId: $delegationId\n accreditationName: $accreditationName\n includeHidden: true\n excludeFull: $excludeFull\n excludeEmpty: $excludeEmpty\n excludePast: $excludePast\n ) {\n nodes {\n id\n accreditationId\n name\n assignedResources\n maxResources\n date\n isBlocked\n isFull\n\n accreditation {\n id\n accreditationCategoryId\n accreditationCategoryName\n name\n accreditationDisplay\n hasSlots\n color\n icon\n index\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationName:g(s)?s:void 0,excludeEmpty:a,excludeFull:d,excludePast:c},[]);const I=(0,V.useMemo)(()=>(h.event?.accreditationsSlots.nodes??[]).filter(e=>!e.isBlocked),[h.event]),x=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(I.map(e=>e.accreditationCategory),e=>e.id),e=>u(e.name)),[I]),f=(0,V.useMemo)(()=>(0,Rg.A)(I.map(e=>e.accreditation),e=>e.id),[I]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lw,{excludeEmpty:a,excludeFull:d,excludePast:c,name:t,setExcludeEmpty:r,setExcludeFull:l,setExcludePast:m,setName:o}),(0,i.jsx)(Pl,{height:"6"}),p||(0,i.jsx)(hb,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:x.map(n=>(0,i.jsx)(Fw,{accreditations:f,accreditationsSlotsIds:e.values.massAccredit.accreditationsSlotsIds,category:n,change:e.change,delegationAccreditationsSlots:h.event.delegation?.accreditationsSlots??[],slots:I,strategy:e.values.massAccredit.strategy},n.id))}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:e.submitting,onClick:e.handleSubmit,children:g(e.buttonText)?e.buttonText:n(e.values.massAccredit.strategy===hn.Add?"accr_diter_les_78545":e.values.massAccredit.strategy===hn.Replace?"r_accr_diter_le_34059":"d_saccr_diter_l_28590",e.numberOfSelected)})})]})},Vw=({eventId:e,numberOfSelected:n,onClose:t,onSuccess:s,selecteds:o})=>{const a=Fi(),r=ki(yw),{mutate:d}=ja();return(0,i.jsx)(Cw,{children:(0,i.jsx)(Hx,{category:a("Accreditation"),heading:a("accr_diter_les_48281"),onClose:t,children:(0,i.jsx)(Gx,{children:(0,i.jsxs)(vS,{initialValues:{massAccredit:{selecteds:o,strategy:hn.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await d({eventId:e,massAccredit:n.massAccredit})).numberOfMembers;s(a("_1_membres_ont_05068",i)),t()},children:[(0,i.jsx)(jS,{heading:a("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(Aw,{handleSubmit:e}),schema:r.step1Schema()}),(0,i.jsx)(jS,{heading:a("accr_ditations_39450"),render:({form:t,handleSubmit:s,submitting:o,values:a})=>(0,i.jsx)(Uw,{change:t.change,delegationId:null,eventId:e,handleSubmit:s,numberOfSelected:n,submitting:o,values:a}),schema:r.step2Schema()})]})})})})},Bw=e=>{const{history:n,translate:t}=Kl(),{mutate:s,isLoading:a}=pr(),[r,d]=(0,V.useState)([]),l=Yo(r);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:t("SendCampaign")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:t("campagne_97871"),values:r,onChange:d,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)(Pl,{height:"2"}),(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>{const t=o(JSON.stringify({usersInfosIds:e.selecteds.ids}));n.push(Gj.CREATE({organizationId:e.organizationId,eventId:e.eventId||void 0,options:t}))},children:t("cr_er_une_nouve_86635")})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:!l,isLoading:a,onClick:async()=>{if(Yo(r)){const n=e.campaigns.find(e=>e.id===r[0]),i=(await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,selecteds:e.selecteds,campaignId:r[0]})).numberOfMembers;e.onSuccess(t("la_campagne_1_62015",n.name,i)),e.onClose()}},children:t("envoyer_26609")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},Ww=e=>{const{data:n}=Li("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?xn.Event:xn.Organization,eventId:e.eventId},[]);return(0,i.jsx)(Bw,{campaigns:n.organization?.campaigns.nodes??[],canCreate:!0,delegationId:null,eventId:e.eventId,organizationId:e.organizationId,selecteds:e.selecteds,onClose:e.onClose,onSuccess:e.onSuccess})};let Gw=class extends Rc{translationService;constructor(e){super(e),this.translationService=e}default(e){return{...e,groupId:void 0,customDocumentId:void 0,eventDocumentId:void 0,zplDocumentId:void 0}}schema(){const e=this;return zc.Ik().shape({input:zc.Ik().shape({groupId:zc.Yj().required(this.t("le_lieu_d_impre_60407")),customDocumentId:zc.ai().nullable(),eventDocumentId:zc.ai().nullable(),zplDocumentId:zc.ai().nullable()}).test({name:"exactly-one-document",test:({customDocumentId:n,eventDocumentId:t,zplDocumentId:i},s)=>1===[n,t,i].filter(Boolean).length||s.createError({message:e.t("a_wristband_to_25340"),path:"input.zplDocumentId"})})})}};Gw=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Gw);const qw=e=>(0,i.jsx)(Tl,{css:{alignSelf:"stretch",alignItems:"start",padding:"$6",overflowY:"auto",...e.css},direction:"column",gap:"6",children:e.children}),Hw=({handleSubmit:e,isLoading:n=!1,isSubmitDisabled:t=!1,setIsOpen:s,submitStyle:o,submitText:a,...r})=>{const{translate:d}=Kl();return(0,i.jsxs)(Tl,{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)(Tl,{align:"center",gap:"4",justify:"end",children:[(0,i.jsx)(tc,{color:"white",onClick:()=>s(!1),children:d("annuler_48254")}),(0,i.jsx)(tc,{color:o,disabled:t,isLoading:n,onClick:()=>e(),children:a??d("submit_21373")})]}),r.children]})},Yw=({heading:e,leftIcon:n,leftIconColor:t,leftIconBorder:s,leftIconCss:o,setIsOpen:a,...r})=>{const{translate:d}=Kl();return(0,i.jsxs)(Tl,{as:"header",css:{alignItems:"flex-start",alignSelf:"stretch",background:"$white",borderBlockEnd:"1px solid $gray200"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Tl,{css:{alignItems:"center",alignSelf:"stretch",padding:"$6 $7 $5 $7"},gap:"4",children:[n&&(0,i.jsx)(Tl,{align:"center",css:{padding:"$3",bd:!0,border:s,...o},justify:"center",children:(0,i.jsx)(Tl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Yl,{className:"fa-xl",color:t,icon:n})})}),(0,i.jsx)(Tl,{css:{alignItems:"flex-start",flex:1},direction:"column",justify:"center",children:e})]}),(0,i.jsx)(Tl,{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)(tc,{"aria-label":d("close_dialog_50926"),color:"invisible",css:{color:"$gray500",width:"$space$6",height:"$space$6",padding:0},textAlign:"center",onClick:()=>a(!1),children:(0,i.jsx)("i",{className:"far fa-xmark"})})}),r.children]})},Zw=({children:e,descId:n,labelId:t,isOpen:s,size:o,setIsOpen:a,...r})=>(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)(_I,{"aria-describedby":n,"aria-labelledby":t,"data-testid":"modal-body",isOpen:s,setIsOpen:a,style:{border:"none",borderRadius:"var(--radii-3)",padding:0,inlineSize:"70vw",blockSize:"fit-content",maxWidth:"688px"},onClose:r.onClose,children:(0,i.jsx)(Tl,{align:"center",direction:"column",...r,children:e})})]}),Kw=({eventId:e,selecteds:n,sort:t,isOpen:s,setIsOpen:o})=>{const{translate:a}=Kl(),r=ki(Gw),{data:d,isLoading:l}=Li("query MassPrintGroupsAndDocuments($eventId: EventId!) {\n event(id: $eventId) {\n printerGroups {\n __typename\n\n ... on PrinterGroupList {\n nodes {\n id\n name\n }\n }\n\n ... on PrinterGroupError {\n message\n }\n }\n zplDocuments {\n nodes {\n id\n name\n }\n }\n }\n}\n",{eventId:e},[]),{mutate:c}=function(e={}){return Ui("mutation VolunteersRegistrationsMassPrint($eventId: EventId!, $input: MassPrintInput!) {\n count: volunteersRegistrationsMassPrint(eventId: $eventId, input: $input)\n}\n",e)}(),u=Sc(),m=(0,V.useRef)(null),g=l?null:d.event.printerGroups,h="PrinterGroupError"===g?.__typename,p="PrinterGroupError"===g?.__typename?g.message:0===g?.nodes.length?a("no_printing_loc_73059"):void 0;return(0,i.jsx)(xc,{css:{dialog:{overflow:"visible"},footer:{borderBottomLeftRadius:"$3",borderBottomRightRadius:"$3"},header:{borderTopLeftRadius:"$3",borderTopRightRadius:"$3"}},customErrorRef:m,initialValues:{input:r.default({selecteds:n,sort:t})},render:({handleSubmit:e,submitting:n})=>(0,i.jsx)(Xw,{disabled:l||n||h,ids:u,isOpen:s,setIsOpen:o,onSubmit:()=>{l||n||h||e()},children:l?(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:"100%",children:[(0,i.jsx)(Qu,{borderRadius:"$1",css:{marginTop:"$6"},height:40,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",css:{marginTop:"$6"},height:40,width:1})]}):(0,i.jsxs)(Mr,{width:"100%",children:[(0,i.jsx)(Mr,{ref:m,children:(0,i.jsx)(Am.Provider,{value:{designSystem:bm},children:(0,i.jsx)(hc,{})})}),(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[p&&(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:a("incomplete_prin_64421")}),(0,i.jsx)(uc,{children:p})]}),(0,i.jsx)(of,{label:a("wristband_to_pr_39675"),name:"input.zplDocumentId",children:d.event.zplDocuments.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(of,{label:a("printing_locati_10729"),name:"input.groupId",state:h?"disabled":void 0,children:("PrinterGroupList"===g?.__typename?g.nodes:[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})}),schema:r.schema(),onSubmit:async({input:n},t)=>{if(!t.getState().invalid)try{await c({eventId:e,input:n})}finally{o(!1)}}})},Xw=({children:e,disabled:n,ids:t,isOpen:s,onSubmit:o,setIsOpen:a})=>{const{translate:r}=Kl();return(0,i.jsxs)(Zw,{descId:t.descId,isOpen:s,labelId:t.labelId,role:"dialog",setIsOpen:a,size:"md",onClose:()=>{a(!1)},children:[(0,i.jsx)(Yw,{heading:(0,i.jsx)(dc,{id:t.labelId,children:r("imprimer_un_bra_94539")}),id:t.labelId,leftIcon:"hand-back-fist",leftIconColor:"gray800",setIsOpen:a}),(0,i.jsx)(qw,{css:{backgroundColor:"white"},id:t.descId,children:e}),(0,i.jsx)(Hw,{handleSubmit:o,isSubmitDisabled:n,setIsOpen:a,submitText:r("print_37582")})]})},Qw=e=>{const{translate:n}=Kl(),t=ki(yw),{mutate:s}=Ir();return(0,i.jsx)(Cw,{children:(0,i.jsx)(Hx,{category:n("Accreditation"),heading:n("update_desired_accreditations"),onClose:e.onClose,children:(0,i.jsx)(Gx,{css:{py:"$7"},children:(0,i.jsxs)(vS,{initialValues:{massAccredit:{selecteds:e.selecteds,strategy:hn.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async n=>{await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massAccredit:n.massAccredit}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(jS,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(Aw,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(jS,{heading:n("accr_ditations_39450"),render:({form:t,handleSubmit:s,values:o,submitting:a})=>(0,i.jsx)(Uw,{buttonText:o.massAccredit.strategy===hn.Delete?n("supprimer_les_a_93519"):n("update_desired_accreditations"),change:t.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:s,numberOfSelected:e.numberOfSelected,submitting:a,values:o}),schema:t.step2Schema()})]})})})})};let Jw=class extends Sw{translationService;inputName="massProfileUpdate";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField([hn.Replace,hn.Delete])}}step2Fields(){return{accreditationProfileId:zc.ai().nullable().when("strategy",{is:e=>e!==hn.Delete,then:e=>e.required(this.t("vous_devez_s_le_07918"))})}}};Jw=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Jw);const e$=e=>{const n=Fi();return(0,i.jsx)(bw,{handleSubmit:e.handleSubmit,nextText:n("suivant_62774"),prefix:"massProfileUpdate.",strategies:[{label:n("remplacer_le_pr_39873"),value:hn.Replace},{label:n("supprimer_le_pr_54358"),value:hn.Delete}]})},n$=e=>{const n=Fi(),{data:t,loader:s}=Li("query MassWishedProfileUpdateProfiles($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsProfiles {\n accreditationProfile {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId},[]);const{accreditationProfileId:o,strategy:a}=e.values.massProfileUpdate,r=a===hn.Delete,d=(0,V.useMemo)(()=>(t.event?.delegation.accreditationsProfiles??[]).map(e=>e.accreditationProfile),[t.event]),l=(0,V.useMemo)(()=>Object.values((0,fm.A)(d,e=>e.accreditationProfileCategory.id)).map(e=>({...e[0].accreditationProfileCategory,accreditationsProfiles:e})),[d]),c=(0,V.useMemo)(()=>gb(l),[l]);return s||(0,i.jsxs)(i.Fragment,{children:[!r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:n("profil_d_accr_d_63000"),multiple:!1,placeholder:n("s_lectionner_un_45763"),values:(0,kl.A)([o]),onChange:n=>{e.change("massProfileUpdate.accreditationProfileId",n[0]??null)},children:c}),(0,i.jsx)(Pl,{height:"7"})]}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n(r?"supprimer_le_pr_87965":"mettre_jour_l_05683",e.numberOfSelected)})})]})},t$=e=>{const{translate:n}=Kl(),t=ki(Jw),{mutate:s}=xr();return(0,i.jsx)(Cw,{children:(0,i.jsx)(Hx,{category:n("Accreditation"),heading:n("mettre_jour_l_03244"),onClose:e.onClose,children:(0,i.jsx)(Gx,{css:{py:"$7"},children:(0,i.jsxs)(vS,{initialValues:{massProfileUpdate:{accreditationProfileId:null,selecteds:e.selecteds,strategy:hn.Replace}},isEdit:!1,onSubmit:async n=>{await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massProfileUpdate:n.massProfileUpdate}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(jS,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(e$,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(jS,{heading:n("profil_d_accr_d_02274"),render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(n$,{change:n.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:t,numberOfSelected:e.numberOfSelected,submitting:s,values:o}),schema:t.step2Schema()})]})})})})},i$=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=Kl(),{mutate:a}=Ra(),{mutate:r}=or(),{mutate:d}=Na(),[l,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1),[g,h]=(0,V.useState)(!1),[p,I]=(0,V.useState)(!1),[x,f]=(0,V.useState)(!1),[_,j]=(0,V.useState)(!1),[v,S]=(0,V.useState)(!1),y=e.massActions.getSelectedsInput(e.predicates,e.scope),C=e.massActions.isAllSelected?e.totalCount:e.massActions.numberOfSelected,b=e.showAccreditationsValidate||Yo(e.campaigns)||e.showDelete;return(0,i.jsxs)(i.Fragment,{children:[e.canMemberEdit&&(0,i.jsx)(tc,{color:"invisible-gray",leftIcon:"pen",onClick:()=>c(!0),children:n("_diter_un_champ_64621")}),e.showWishedAccreditationsEdit&&(0,i.jsx)(tc,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>m(!0),children:n("_diter_les_accr_41957")}),e.showWishedProfileEdit&&(0,i.jsx)(tc,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>h(!0),children:n("_diter_le_profi_54032")}),e.showAccreditationsEdit&&(0,i.jsx)(tc,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>I(!0),children:n("_diter_les_accr_86042")}),b&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"invisible-gray",rightIcon:"chevron-down",children:n("plus_77692")})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[e.showAccreditationsValidate&&(0,i.jsx)(Pu,{icon:"check",onClick:async()=>{await r({eventId:s,delegationId:o,selecteds:y}),e.onMassEditSuccess()},children:n("valider_les_acc_80801")}),e.showPrint&&(0,i.jsx)(Pu,{icon:"hand-back-fist",onClick:()=>S(!0),children:n("imprimer_un_bra_94539")}),Yo(e.campaigns)&&(0,i.jsx)(Pu,{icon:"paper-plane",onClick:()=>f(!0),children:n("SendCampaign")}),e.showDelete&&(0,i.jsx)(Pu,{color:"red",icon:"user-xmark",onClick:()=>j(!0),children:n("retirer_de_la_d_64963")})]})]}),l&&(0,i.jsx)(jw,{customFields:e.customFields,mutate:e=>a({organizationId:t,eventId:s,delegationId:o,massEdit:e}),selecteds:y,onClose:()=>c(!1),onSuccess:e.onMassEditSuccess}),u&&(0,i.jsx)(Qw,{delegationId:o,eventId:s,numberOfSelected:C,organizationId:t,selecteds:y,onClose:()=>m(!1),onSuccess:e.onMassEditSuccess}),g&&(0,i.jsx)(t$,{delegationId:o,eventId:s,numberOfSelected:C,organizationId:t,selecteds:y,onClose:()=>h(!1),onSuccess:e.onMassEditSuccess}),p&&(0,i.jsx)(Vw,{eventId:s,numberOfSelected:C,selecteds:y,onClose:()=>I(!1),onSuccess:e.onMassEditSuccess}),x&&(0,i.jsx)(Bw,{campaigns:e.campaigns,canCreate:!1,delegationId:o,eventId:s,organizationId:t,selecteds:y,onClose:()=>f(!1),onSuccess:e.onMassEditSuccess}),_&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_sur_d_29974"),text:n("suppression_de_57689",C),onClose:()=>j(!1),onDelete:async()=>{await d({organizationId:t,eventId:s,delegationId:o,selecteds:y,deleteFromEvent:e.deleteFromEvent}),e.onMassEditSuccess()}}),v&&(0,i.jsx)(Kw,{eventId:s,isOpen:v,selecteds:y,setIsOpen:S,sort:e.sort})]})},s$=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(e.selectedSlotsIds),[o,a]=(0,V.useState)(e.selectedProfilesIds),[r,d]=(0,V.useState)(e.rendering),[l,c]=(0,V.useState)(e.showAccreditations),[u,m]=(0,V.useState)(e.showProfiles),[g,h]=(0,V.useState)(e.showQuota);return(0,i.jsxs)(Tl,{direction:"column",onChange:jc,children:[(0,i.jsxs)(Tl,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(np,{value:l,onChange:c,children:n("afficher_les_ac_56952")}),l&&(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:t,onChange:s,children:e.accreditationsOptions}),e.accreditationsProfilesOptions&&(0,i.jsx)(np,{value:u,onChange:m,children:n("afficher_les_pr_62371")}),e.accreditationsProfilesOptions&&u&&(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("profils_d_accr_27825"),multiple:!0,renderOnPortal:!0,values:o,onChange:a,children:e.accreditationsProfilesOptions}),(0,i.jsxs)(Up,{label:n("grouper_les_acc_40252"),value:r,onChange:d,children:[(0,i.jsx)("option",{value:mh.Category,children:n("cat_gorie_00291")}),(0,i.jsx)("option",{value:mh.Date,children:n("Date")})]}),!e.hideQuotaOption&&(0,i.jsx)(np,{value:g,onChange:h,children:n("afficher_les_qu_20761")})]}),(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:n("r_initialiser_77538")}),(0,i.jsx)(tc,{size:"sm",onClick:()=>{e.setShowAccreditations(l),e.setSelectedSlotsIds(t),e.setShowProfiles(u),e.setSelectedProfilesIds(o),e.setRendering(r),e.hideQuotaOption||e.setShowQuota(g),e.close()},children:n("appliquer_05753")})]})]})};function o$(e){const n=a$(e);return(0,Lm.A)((0,Rg.A)(e,e=>e.accreditationCategory.id).map(e=>({...e.accreditationCategory,accreditations:n.filter(n=>n.accreditationCategory.id===e.accreditationCategory.id)})),e=>u(e.name))}function a$(e){return uh((0,Rg.A)(e,e=>e.accreditation.id).map(n=>({...n.accreditation,accreditationCategory:n.accreditationCategory,slots:Vh(e.filter(e=>e.accreditation.id===n.accreditation.id))})))}function r$(e){return(0,Lm.A)((0,Rg.A)(e.map(e=>e.accreditationProfileCategory),e=>e.id),e=>u(e.name)).map(n=>(0,i.jsx)("optgroup",{label:n.name,children:(0,Lm.A)(e.filter(e=>e.accreditationProfileCategory.id===n.id),e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n.id))}function d$(e,n){return e.flatMap(e=>{const t=e.slots.map(e=>e.id),i=Zo(n)?e.slots.length:(0,mm.A)(t,n).length;return 0===i?[]:[{...e,numberOfSlots:i}]})}function l$(e,n,t){const i=e.flatMap(e=>e.slots.filter(e=>Zo(n)||n.includes(e.id)));return t===mh.Category?i:(0,Lm.A)(i,e=>e.date?.isValid?e.date.toMillis():Number.POSITIVE_INFINITY)}const c$=e=>{const{translate:n}=Kl(),t=V.useRef(null),s=ki(Jm),o=ki(Rv),a=(0,V.useMemo)(()=>(0,Rg.A)((0,Lm.A)(e.slots.flatMap(e=>e.date?.isValid?[e.date]:[]),e=>e.toMillis()),e=>e.toMillis()),[e.filteredAccreditations]),r=(0,V.useMemo)(()=>(0,xm.A)((0,fm.A)(e.slots,e=>e.date?.isValid?e.date.toMillis():"nodate"),e=>e.length),[e.slots]),d=(0,V.useMemo)(()=>Bh(s,e.allCategories),[s,e.allCategories]),l=(0,V.useMemo)(()=>Yo(e.allAccreditationsProfiles)?r$(e.allAccreditationsProfiles):null,[e.allAccreditationsProfiles]),[c,u]=(0,V.useState)(!1),m=(0,V.useCallback)(()=>{e.setShowAccreditations(!0),e.setSelectedSlotsIds([]),e.setShowProfiles(!0),e.setSelectedProfilesIds([]),e.setRendering(mh.Category),e.hideQuotaOption||e.setShowQuota(!1)},[e.hideQuotaOption,e.setRendering,e.setSelectedProfilesIds,e.setSelectedSlotsIds,e.setShowAccreditations,e.setShowProfiles,e.setShowQuota]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{ref:t,css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsxs)(Tl,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},gap:"3",width:1,children:!e.hideOptions&&(0,i.jsxs)(Ou,{doNotCloseOnOtherOpen:!0,isOpen:c,onStateChange:u,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"bars-filter",size:"sm",children:n("filtres_64574")})})}),(0,i.jsx)(Fu,{placement:"bottom-start",width:385,children:(0,i.jsx)(s$,{accreditationsOptions:d,accreditationsProfilesOptions:l,close:()=>u(!1),hideQuotaOption:e.hideQuotaOption,rendering:e.rendering,reset:m,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setRendering:e.setRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:e.setShowQuota,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:e.showQuota})})]})}),(0,i.jsx)(Tl,{css:{borderRight:"1px solid $gray200",height:"$cellHeightSm"},width:1,onClick:()=>{t.current?.requestFullscreen()}}),e.showQuota&&(0,i.jsx)(Tl,{css:{borderRight:"1px solid $gray200",height:"32px"},width:1}),e.data.map(n=>e.renderLeftColumn(n))]}),(0,i.jsx)(Tl,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsxs)(Tl,{css:{borderBottom:"1px solid $gray200",height:"$cellHeightSm"},children:[Yo(e.accreditationsProfiles)&&(0,i.jsx)(Tl,{css:{background:"$gray700",borderRight:"1px solid $gray200",color:"white",fontSize:"$textSm",fontWeight:"$medium",px:"$4",textAlign:"center",textTransform:"uppercase",width:`calc(${e.accreditationsProfiles.length} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:n("profils_09110")}),e.rendering===mh.Category&&e.filteredAccreditations.map(n=>{const t=g(n.acronym)?n.acronym:n.name;return(0,i.jsxs)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${n.numberOfSlots} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t,width:1,children:t}),(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n.accreditationCategory.name,width:1,children:n.accreditationCategory.name})]},n.id)}),e.rendering===mh.Date&&a.map(n=>{const t=n.toMillis(),o=r[t],a=s.toLocaleString(n,Uo.DateOnly.MonthLong);return(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${o} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:a,width:1,children:a})},t)}),e.rendering===mh.Date&&(r.nodate??0)>0&&(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${r.nodate} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",width:1,children:"-"})})]}),(0,i.jsxs)(Tl,{css:{height:"$cellHeightSm"},children:[e.accreditationsProfiles.map(n=>(0,i.jsxs)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:n.name,width:1,children:n.name}),(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n.accreditationProfileCategory.name,width:1,children:n.accreditationProfileCategory.name})]},n.id)),e.slots.map(n=>{const t=e.rendering===mh.Category?n.name||"-":g(n.accreditation.acronym)?n.accreditation.acronym:n.accreditation.name,o=n.date?.isValid?s.toLocaleString(n.date,Uo.DateOnly.Numeric):"-";return(0,i.jsxs)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t,width:1,children:t}),e.rendering===mh.Category&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:o,width:1,children:o}),e.rendering===mh.Date&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n.accreditationCategory.name,width:1,children:n.accreditationCategory.name})]},n.id)})]}),e.showQuota&&(0,i.jsxs)(Tl,{height:32,children:[e.accreditationsProfiles.map(t=>{const s=t.maxResources??Number.POSITIVE_INFINITY,a=t.assignedResources/s;return(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",width:`${e.cellWidth}px`},height:1,justify:"center",children:(0,i.jsx)(Ku,{color:Yu(a,{higherIsBetter:!1}),size:"sm",children:n("_1_2_membres_04485",t.assignedResources,o.toNumberOrInfinity(s))})},t.id)}),e.slots.map(t=>{const s=t.maxResources??Number.POSITIVE_INFINITY,a=t.assignedResources/s;return(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",width:`${e.cellWidth}px`},height:1,justify:"center",children:(0,i.jsx)(Ku,{color:Yu(a,{higherIsBetter:!1}),size:"sm",children:n("_1_2_membres_04485",t.assignedResources,o.toNumberOrInfinity(s))})},t.id)})]}),e.data.map(n=>e.renderRow(n))]})})]}),(0,i.jsx)(Fm,{children:(0,i.jsx)(Pm,{limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,setLimit:e.setLimit,setOffset:e.setOffset,showLimits:!0,totalCount:e.totalCount})})]})},u$=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[e.accreditationSlotId]:[]),[e.vr]),s=(0,V.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[]:[e.accreditationSlotId]),[e.vr]),o=(0,V.useMemo)(()=>(e.vr.matrixWishedSlots||[]).map(e=>e.id),[e.vr]),a=(0,V.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlotId]:[]),[e.vr]),r=(0,V.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.accreditationProfileId?[e.accreditationSlotId]:[]),[e.vr]);return(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[e.accreditationsProfiles.map(t=>{const s=e.vr.accreditationProfileId===t.id,o=e.vr.wishedAccreditationProfileId===t.id,a=e.isEditMode&&("assigned"===e.editMode&&s||"wished"===e.editMode&&o),r=e.isEditMode&&("assigned"===e.editMode&&!s||"wished"===e.editMode&&!o);return(0,i.jsxs)(Tl,{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:[a&&(0,i.jsx)(Tl,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$error200",bd:"error500 1",color:"$error700",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.deleteAccreditationProfile(e.vr.userInfo.id,t.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Yl,{icon:"trash-can"})}),r&&(0,i.jsx)(Tl,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary100",bd:"primary500 1",color:"$primary500",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationProfile(e.vr.userInfo.id,t.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Yl,{icon:"plus"})}),s?(0,i.jsx)(Tl,{align:"center",className:r||a?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Yl,{icon:"check"})}):o?(0,i.jsx)(Tl,{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)(Mr,{font:"gray800 textXs medium",children:n("souhait_19593")})}):null]},t.id)}),e.slots.map(d=>{const l=t.includes(d.id),c=s.includes(d.id),u=o.includes(d.id),m=r.includes(d.id),g=e.isEditMode&&!d.isBlocked&&!m&&(e.canDeleteCheckedIn||!a.includes(d.id))&&("assigned"===e.editMode&&(l||c)||"wished"===e.editMode&&u),h=e.isEditMode&&!d.isBlocked&&("assigned"===e.editMode&&!l&&!c||"wished"===e.editMode&&!u);return(0,i.jsxs)(Tl,{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:[g&&(0,i.jsx)(Tl,{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,d.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Yl,{icon:"trash-can"})}),h&&(0,i.jsx)(Tl,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary100",bd:"primary500 1",color:"$primary500",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationSlot(e.vr.userInfo.id,d.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(Yl,{icon:"plus"})}),l||c?(0,i.jsx)(Tl,{align:"center",className:h||g?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Yl,{icon:m?"layer-group":l?"bolt-auto":"check"})}):u?(0,i.jsx)(Tl,{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)(Mr,{font:"gray800 textXs medium",children:n("souhait_e_52100")})}):null]},d.id)})]})},m$=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>o$(e.allAccreditationsSlots),[e.allAccreditationsSlots]),s=(0,V.useMemo)(()=>a$(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,V.useMemo)(()=>e.showAccreditations?d$(s,e.selectedSlotsIds):[],[s,e.selectedSlotsIds,e.showAccreditations]),a=(0,V.useMemo)(()=>l$(o,e.selectedSlotsIds,e.rendering),[o,e.selectedSlotsIds,e.rendering]),r=(0,V.useMemo)(()=>(0,Lm.A)(e.allAccreditationsProfiles.filter(n=>e.showProfiles&&(Zo(e.selectedProfilesIds)||e.selectedProfilesIds.includes(n.id))),e=>[u(e.accreditationProfileCategory.name),u(e.name)]),[e.allAccreditationsProfiles,e.selectedProfilesIds,e.showProfiles]),d=(0,V.useCallback)(n=>e.isRowLoading(n.id)?(0,i.jsx)(qm,{css:{border:"none",borderTop:"1px solid $gray200",height:"$cellHeightSm"}},n.userInfo.id):(0,i.jsx)(u$,{accreditationsProfiles:r,addAccreditationProfile:e.addAccreditationProfile,addAccreditationSlot:e.addAccreditationSlot,canDeleteCheckedIn:e.canDeleteCheckedIn,deleteAccreditationProfile:e.deleteAccreditationProfile,deleteAccreditationSlot:e.deleteAccreditationSlot,editMode:e.editMode,isEditMode:e.isEditMode,reloadRow:e.reloadRow,slots:a,vr:n},n.userInfo.id),[e.addAccreditationProfile,e.addAccreditationSlot,e.deleteAccreditationProfile,e.deleteAccreditationSlot,e.editMode,e.isEditMode,e.isRowLoading,e.reloadRow,r,a]);return(0,i.jsx)(Tl,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(Ql,{}):Zo(e.members)||Zo(o)&&Zo(r)?(0,i.jsx)(Tl,{css:{background:"white",border:"1px solid $gray200"},height:400,children:Zo(e.members)?(0,i.jsx)(UE,{imageSrc:su.Blanks.Member,title:n("aucun_membre_ne_07054")}):Yo(e.selectedSlotsIds)||Yo(e.selectedProfilesIds)||!e.showAccreditations||!e.showProfiles?(0,i.jsx)(Tl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(tc,{color:"white",leftIcon:"broom-wide",onClick:()=>{e.setShowAccreditations(!0),e.setSelectedSlotsIds([]),e.setShowProfiles(!0),e.setSelectedProfilesIds([])},children:n("remettre_les_fi_83263")})}):(0,i.jsx)(UE,{imageSrc:su.Blanks.Accreditation,title:n("aucune_accr_dit_97505")})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(c$,{accreditationsProfiles:r,allAccreditations:s,allAccreditationsProfiles:e.allAccreditationsProfiles,allCategories:t,cellWidth:120,data:e.members,filteredAccreditations:o,hideOptions:e.hideOptions,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:n=>(0,i.jsx)(Tl,{css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(My,{isClickDisabled:!!e.getInformationPanelPath,size:32,userInfo:n.userInfo})},n.userInfo.id),renderRow:d,rendering:e.rendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setRendering:e.setRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:e.setShowQuota,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:e.showQuota,slots:a,totalCount:e.totalCount})})})},g$=e=>{const{params:{organizationId:n,eventId:t,delegationId:s}}=Kl(),{data:o,idToLoading:a,isEditMode:r,isLoading:d,limit:l,numberOfPages:c,offset:u,reloadRow:m,setLimit:g,setOffset:h,totalCount:p}=pg(),{mutate:I}=Ir(),{mutate:x}=xr(),{data:f,isLoading:_,reload:j}=Li("query DelegationMembersAccreditationsMatrix($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsProfiles {\n assignedResources\n maxResources\n\n accreditationProfile {\n ...AccreditationProfileMatrix\n }\n }\n\n allAccreditationsSlots(onlyVisible: true) {\n assignedResources\n maxResources\n\n accreditationSlot {\n ...AccreditationSlotMatrix\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:s},[$o.AccreditationProfileMatrixFragment,$o.AccreditationSlotMatrixFragment]),v=(0,V.useMemo)(()=>(f.event?.delegation.allAccreditationsSlots??[]).map(e=>({...e.accreditationSlot,assignedResources:e.assignedResources,maxResources:e.maxResources})),[f]),S=(0,V.useMemo)(()=>(f.event?.delegation.accreditationsProfiles??[]).map(e=>({...e.accreditationProfile,assignedResources:e.assignedResources,maxResources:e.maxResources})),[f]),y=(0,V.useCallback)(e=>a[e]??!1,[a]),C=(0,V.useCallback)(async(i,o)=>{await x({organizationId:n,eventId:t,delegationId:s,massProfileUpdate:{accreditationProfileId:o,selecteds:{ids:[i]},strategy:hn.Replace}}),e.matrixShowQuota&&j()},[j,s,t,x,n,e.matrixShowQuota]),b=(0,V.useCallback)(async(i,o)=>{await I({organizationId:n,eventId:t,delegationId:s,massAccredit:{accreditationsSlotsIds:[o],selecteds:{ids:[i]},strategy:hn.Add}}),e.matrixShowQuota&&j()},[j,s,t,I,n,e.matrixShowQuota]),A=(0,V.useCallback)(async(i,o)=>{await x({organizationId:n,eventId:t,delegationId:s,massProfileUpdate:{accreditationProfileId:o,selecteds:{ids:[i]},strategy:hn.Delete}}),e.matrixShowQuota&&j()},[j,s,t,x,n,e.matrixShowQuota]),E=(0,V.useCallback)(async(i,o)=>{await I({organizationId:n,eventId:t,delegationId:s,massAccredit:{accreditationsSlotsIds:[o],selecteds:{ids:[i]},strategy:hn.Delete}}),e.matrixShowQuota&&j()},[j,s,t,I,n,e.matrixShowQuota]);return(0,i.jsx)(m$,{addAccreditationProfile:C,addAccreditationSlot:b,allAccreditationsProfiles:S,allAccreditationsSlots:v,canDeleteCheckedIn:!1,deleteAccreditationProfile:A,deleteAccreditationSlot:E,editMode:"wished",getInformationPanelPath:e.getInformationPanelPath,hideOptions:e.hideOptions,isEditMode:r,isLoading:d||_,isRowLoading:y,limit:l,members:o,numberOfPages:c,offset:u,reloadRow:m,rendering:e.matrixRendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:g,setOffset:h,setRendering:e.setMatrixRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setMatrixShowAccreditations,setShowProfiles:e.setMatrixShowProfiles,setShowQuota:e.setMatrixShowQuota,showAccreditations:e.matrixShowAccreditations,showProfiles:e.matrixShowProfiles,showQuota:e.matrixShowQuota,totalCount:p})},h$=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=Kl(),a=ki(Oh),r=Gi(),[d,l,c]=Zb(e.delegationsSpaceLayoutTab,e=>e.infos?.columns??[],t,"eventDelegationMembers.columns",e.columns),u=(0,V.useMemo)(()=>e.canEditColumns||e.delegationsSpaceLayoutTab?d:e.columns,[d,e.canEditColumns,e.columns,e.delegationsSpaceLayoutTab]),[m,g,h]=Yb(t,"eventDelegationMembers.limit",Tm),[p,I,x]=Yb(t,"eventDelegationMembers.predicates",[]),f=(0,V.useMemo)(()=>xg(p),[p]),_=(0,V.useMemo)(()=>e.delegationsSpaceLayoutTab?.rendering===xh.List&&Yo(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds)?xg([{slug:"accreditationSlotId",operator:$n.Is,value:e.delegationsSpaceLayoutTab.infos.accreditationsSlotsIds}]):f,[e.delegationsSpaceLayoutTab,f]),[j,v,S]=Zb(e.delegationsSpaceLayoutTab,e=>e.rendering,t,"eventDelegationMembers.rendering",xh.List),[y,C,b]=Zb(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixRendering||mh.Category,t,"eventDelegationMembers.matrixRendering",mh.Category),[A,E,w]=Zb(e.delegationsSpaceLayoutTab,e=>e.infos?.accreditationsSlotsIds||[],t,"eventDelegationMembers.selectedSlotsIds",[]),[$,T,z]=Zb(e.delegationsSpaceLayoutTab,e=>e.infos?.accreditationsProfilesIds||[],t,"eventDelegationMembers.selectedProfilesIds",[]),[O,R,D]=Zb(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowAccreditations??!0,t,"eventDelegationMembers.matrixShowAccreditations",!0),[M,P,k]=Zb(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowProfiles??!0,t,"eventDelegationMembers.matrixShowProfiles",!0),[N,L,U]=Zb(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowQuota??!1,t,"eventDelegationMembers.matrixShowQuota",!1),[B,W,G]=Yb(t,"eventDelegationMembers.sort",null),{data:q,isLoading:H}=Li("query EventDelegationMembersInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n\n customDocuments {\n ...CustomDocumentPopulation\n }\n\n delegation(id: $delegationId) {\n id\n numberOfDelegationsAccreditationsSlots\n numberOfDelegationsAccreditationsProfiles\n\n accreditationsSlots(onlyDefault: true, onlyHidden: true) {\n accreditationSlotId\n }\n\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n id\n positionDisplay\n slotDisplay\n\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:s,delegationId:o,privacy:e.customFieldsPrivacy},[$o.SegmentCustomFieldFragment,$o.CustomDocumentPopulationFragment]);const Y=c||h||x||S||b||w||z||D||k||U||G||H,Z=(0,V.useMemo)(()=>e.customFieldsPrivacy===Ee.All?q.organization?.customFields.nodes??[]:(0,Rg.A)((0,kl.A)((q.event?.delegation.form.elements.map(e=>e.customField)||[]).concat(q.event?.delegation.columnsCustomFields||[])),e=>e.slug),[e.customFieldsPrivacy,q.organization,q.event]),K=Kb(Z),X=(0,V.useMemo)(()=>q.event?a.getDelegationMembersFilters(t,s,Z,q.event,q.event.delegation.form,q.event.isWeezeventConnected):[],[s,Z,q.event]),Q=(0,V.useMemo)(()=>q.event?a.getDelegationMembersPossibleColumns(t,Z,{customDocuments:e.showCustomDocumentsColumns?q.event.customDocuments:[],forDelegationsSpace:e.forDelegationsSpace,isWeezeventConnected:q.event.isWeezeventConnected,positionDisplay:q.event.delegation.form.positionDisplay,slotDisplay:q.event.delegation.form.slotDisplay}):[],[e.forDelegationsSpace,e.showCustomDocumentsColumns,t,Z,q.event]),J=(0,V.useMemo)(()=>(q.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlotId),[q.event]),ee=(0,V.useMemo)(()=>"function"==typeof e.showEditMode?e.showEditMode(j):e.showEditMode,[e.showEditMode,j]),ne=(0,V.useMemo)(()=>Zo(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds||[]),[e.delegationsSpaceLayoutTab]),te=(0,V.useMemo)(()=>Zo(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds||[]),[e.delegationsSpaceLayoutTab]),ie=(0,V.useMemo)(()=>e.delegationsSpaceLayoutTab?void 0:[xh.List,xh.AccreditationsMatrix],[e.delegationsSpaceLayoutTab]),se=3695!==t&&(q.event?.delegation.numberOfDelegationsAccreditationsSlots??0)>0,oe=(q.event?.delegation.numberOfDelegationsAccreditationsProfiles??0)>0,ae=window.location.origin===F.HEAVENT_PUBLIC_URL.origin?n=>`${window.location.origin}${Js.DELEGATION_MEMBER_INFORMATION({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id})}`:void 0;return(0,V.useEffect)(()=>{r.setItem(Tc.DELEGATIONS_SPACE_TAB,"members")},[]),Y?(0,i.jsx)(Ql,{}):(0,i.jsx)(Cx,{columns:u,columnsSearch:[],columnsToIncludes:zh,eventId:s,filters:X,getMassActionId:e=>e.userInfo.id,limit:m,loadDataList:hr,loadDataListParams:{delegationId:o,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:gr,loadRowParams:{delegationId:o,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:Q,possibleRenderings:ie,predicates:_,renderActions:(n,t,s)=>(0,i.jsx)(i$,{campaigns:e.campaigns,canMemberEdit:e.canMemberEdit,customFields:Z,deleteFromEvent:e.deleteFromEvent,massActions:n,predicates:_,scope:{delegationId:o},showAccreditationsEdit:e.showAccreditationsEdit,showAccreditationsValidate:e.showAccreditationsValidate,showDelete:e.canMemberDelete,showPrint:e.showPrint,showWishedAccreditationsEdit:se,showWishedProfileEdit:oe,sort:B,totalCount:t,onMassEditSuccess:s}),renderAllSelectedText:e=>n("les_1_membres_71180",e),renderPageSelectedText:e=>n("les_1_membres_00895",e),renderSelectAllText:e=>n("s_lectionner_le_45277",e),rendering:j,setColumns:l,setLimit:g,setPredicates:I,setRendering:v,setSort:W,showEditColumns:j===xh.List&&e.canEditColumns,showEditMode:ee,showFilters:ne,showMassActions:e.canMemberEdit||e.canMemberAccredit,showPredicatesBadges:te,showRowDropdown:!0,showRowEdit:e.canMemberEdit,showSearchColumns:!1,showSelectAll:!0,sort:B,children:j===xh.AccreditationsMatrix?(0,i.jsx)(g$,{getInformationPanelPath:ae,hideOptions:!!e.delegationsSpaceLayoutTab,matrixRendering:y,matrixShowAccreditations:O,matrixShowProfiles:M,matrixShowQuota:N,selectedProfilesIds:$,selectedSlotsIds:A,setMatrixRendering:C,setMatrixShowAccreditations:R,setMatrixShowProfiles:P,setMatrixShowQuota:L,setSelectedProfilesIds:T,setSelectedSlotsIds:E}):(0,i.jsx)(kx,{getEditPath:e.getEditPath,renderCell:(n,a,r)=>(0,i.jsx)(pE,{accreditationsPanelPath:Js.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:a.userInfo.id}),availabilitiesPanelPath:Js.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:a.userInfo.id}),canChangeDelegation:!1,canMemberAccredit:e.canMemberAccredit,canMemberAssign:!1,column:n,customField:K.get(n.slug),eventId:s,informationPanelPath:ae?.(a),positionsPanelPath:Js.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:a.userInfo.id}),reloadRow:r,row:a}),renderRowDropdown:(n,t)=>(0,i.jsx)(uw,{accreditationState:n.accreditationState,allowedCustomDocuments:e.customBadges,canDelete:e.canMemberDelete&&n.canDelete,canDuplicate:e.canDuplicateMembers,canMemberAccredit:e.canMemberAccredit,customDocuments:q.event?.customDocuments??qo,deleteFromEvent:e.deleteFromEvent,member:n.userInfo,reload:t,showDeleteFromEvent:e.showDeleteFromEvent,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:n.id}),renderRowPanels:(n,a)=>(0,i.jsx)(sw,{accreditationsPanelPath:Js.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id}),availabilitiesPanelPath:Js.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id}),canCheckIn:!1,canDeleteCheckedIn:!1,canDeletePosition:()=>!1,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:!0,defaultHiddenAccreditationsSlotsIds:J,delegation:q.event.delegation,eventId:s,informationPanelPath:Js.DELEGATION_MEMBER_INFORMATION({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id}),organizationId:t,positionsPanelPath:Js.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id}),reloadRow:a,returnPathFallback:e.delegationsSpaceLayoutTab?Js.DELEGATION_TAB({organizationId:t,eventId:s,slug:e.delegationsSpaceLayoutTab?.slug,delegationId:o}):Js.DELEGATION_MEMBERS({organizationId:t,eventId:s,delegationId:o}),volunteerRegistration:n})})})};function p$(e){return{includeComments:e.includes("comments"),includeDelegations:e.includes("delegations")||e.includes("delegations_categories"),includeDuplicatedFrom:e.includes("duplicatedFrom"),includeEmails:e.includes("campaigns_states"),includeEvents:e.includes("events")||e.includes("number_of_events"),includeForms:e.includes("forms")||e.includes("forms_inserted_at"),includeTags:e.includes("tags"),includeRoles:e.includes("roles")}}let I$=class extends Og{constructor(e,n,t){super(e,n,t)}getOrganizationUsersFilters(e,n,t){return[...this.getBaseFilters(t.customFields.nodes),...this.getEventsFilters(e),...this.getFormsFilters(e),...this.getPositionsFilters(),...this.getDelegationsFilters(e),...this.getEmailsFilters(e),...this.getCommentsFilters(e),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:nn.Select,needLoading:!0,organizationId:e,tagContext:Yn.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:nn.Number,hideEmpty:!0},{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("autres_99130"),fieldType:nn.Select,values:t.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==n),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_administrat_15766"),category:this.t("autres_99130"),fieldType:nn.Checkbox},{slug:"isLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:nn.Checkbox},{slug:"roles",name:this.t("r_les_61679"),category:this.t("autres_99130"),fieldType:nn.Select,needLoading:!0,organizationId:e}]}getDelegationMembersFilters(e){return this.getBaseFilters(e)}getOrganizationUsersPossibleColumns(e){return[...this.getBaseColumns(),{slug:"duplicatedFrom",name:this.t("dupliqu_de_28582"),minWidth:240},{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:tt.InsertedAt,width:230},{slug:"last_seen_at",name:this.t("date_de_derni_r_38795"),isSortable:!0,sortAttribute:tt.LastSeenAt,width:230},{slug:"campaigns_states",name:this.t("statut_des_camp_25280"),minWidth:320},{slug:"tags",name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:"comments",name:this.t("commentaires_96492"),isSearchable:!0,minWidth:320},{slug:"roles",name:this.t("r_les_61679"),minWidth:320},...this.customFieldsToPossibleColumns(e)]}getDelegationMembersPossibleColumns(e){return[...this.getBaseColumns(),...this.customFieldsToPossibleColumns(e)]}getBaseColumns(){return[{slug:"name",name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:tt.Name,minWidth:240},{slug:"email",name:this.t("e_mail_du_membr_69509"),isSearchable:!0,isSortable:!0,sortAttribute:tt.Email,minWidth:180},{slug:"id",name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:tt.Id,width:100},{slug:"local_id",name:this.t("id_sur_l_organi_45566"),isSearchable:!0,isSortable:!0,sortAttribute:tt.LocalId,width:100}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:nn.Text,hideEmpty:!0},{slug:"registrationDate",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:nn.Date,hideEmpty:!0},{slug:"id",name:this.t("id_51738"),category:this.t("champs_de_formu_64126"),fieldType:nn.Number,hideEmpty:!0},{slug:"local_id",name:this.t("id_sur_l_organi_45566"),category:this.t("champs_de_formu_64126"),fieldType:nn.Number,hideEmpty:!0},{slug:"lastSeenAt",name:this.t("date_de_derni_r_38795"),category:this.t("champs_de_formu_64126"),fieldType:nn.Datetime},{slug:"duplicatedFrom",name:this.t("est_dupliqu_62764"),category:this.t("champs_de_formu_64126"),fieldType:nn.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(e)]}getEventsFilters(e){return[{slug:"event",name:this.t("_v_nement_22345"),category:this.t("Event"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"numberOfEvents",name:this.t("nombre_d_v_nem_14214"),category:this.t("Event"),fieldType:nn.Number,hideEmpty:!0}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:nn.Select,needLoading:!0,organizationId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:nn.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:nn.Text,hideEmpty:!0},{slug:"positionCategoryName",name:this.t("nom_de_la_cat_g_57279"),category:this.t("missions_63972"),fieldType:nn.Text,hideEmpty:!0},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0}]}getDelegationsFilters(e){return[{slug:"delegation",name:this.t("fait_partie_de_32196"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,organizationId:e},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:nn.Select,needLoading:!0,organizationId:e},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:nn.Checkbox}]}getEmailsFilters(e){return[{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:nn.Campaign,needLoading:!0,organizationId:e},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:nn.Checkbox,hideEmpty:!0}]}getCommentsFilters(e){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:nn.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:nn.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e}]}};I$=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],I$);const x$=e=>{const{history:n,params:{organizationId:t}}=Kl(),s=(0,V.useMemo)(()=>(e.user.events||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name,onClick(){n.push(Rs.EVENT({organizationId:t,eventId:e.id}))}})),[e.user]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:s})})},f$=e=>{const{translate:n,params:{organizationId:t}}=Kl(),s=ki(Jm),{mutate:o}=Ha(),a=(0,V.useCallback)((n,i)=>o({organizationId:t,userInfoId:e.row.id,slug:i,value:n}),[e.row,o]),r=(0,V.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.row.formsUsersInfos]),d=(0,V.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[`${e.form.name} : ${s.toLocaleString(e.insertedAt.toLocal(),Uo.DateTime)}`]:[]).join(", "),[e.row.formsUsersInfos]),l=(0,V.useMemo)(()=>(e.row.delegations||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.delegations]),c=(0,V.useMemo)(()=>(0,Rg.A)(e.row.delegations||[],e=>e.delegationCategory.id).map(e=>({id:e.delegationCategory.id,color:"gray",icon:null,text:e.delegationCategory.name})),[e.row.delegations]),u=(0,V.useMemo)(()=>(e.row.emails??[]).map(e=>{const{color:t,leftIcon:i}=Py(e.state);return{id:e.id,color:t,icon:i,text:`${e.campaign?.name??""} - ${n(e.state)}`}}),[e.row.emails]),m=(0,V.useMemo)(()=>(e.row.tags||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.tags]);return"name"===e.column.slug?(0,i.jsx)(SA,{clickPath:e.informationPanelPath,column:e.column,mutate:a,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"id"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"local_id"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId}):"duplicatedFrom"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.duplicatedFrom?(0,i.jsx)(My,{size:32,userInfo:e.row.duplicatedFrom}):null}):"email"===e.column.slug?(0,i.jsx)(vA,{clickPath:e.informationPanelPath??Rj.MEMBER_INFORMATION({organizationId:t,userInfoId:e.row.id}),column:e.column,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"events"===e.column.slug?(0,i.jsx)(x$,{column:e.column,user:e.row}):"number_of_events"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.events?.length??0}):"forms"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:r})}):"forms_inserted_at"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:d,children:d})}):"delegations"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:l})}):"delegations_categories"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:c})}):"inserted_at"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:s.toLocaleString(e.row.insertedAt.toLocal(),Uo.DateTime)}):"last_seen_at"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.lastSeenAt?.isValid?s.toLocaleString(e.row.lastSeenAt.toLocal(),Uo.DateTime):""}):"campaigns_states"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:u})}):"tags"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:m})}):"comments"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:Yo(e.row.comments)?e.row.comments.map(e=>e.content).join("; "):""}):"roles"===e.column.slug?(0,i.jsx)(CA,{minWidth:e.column.minWidth,userPermissions:e.row,width:e.column.width}):(0,i.jsx)(jA,{avatarUser:e.row,clickPath:e.informationPanelPath??Rj.MEMBER_INFORMATION({organizationId:t,userInfoId:e.row.id}),column:e.column,customField:e.customField,fields:e.row.fields,mutate:a,reload:e.reloadRow,updatable:e.updatable})},_$=e=>{const{params:{organizationId:n}}=Kl();return(0,i.jsx)(kr.dO,{children:e.informationPanelPath&&e.delegation&&(0,i.jsx)(kr.qh,{path:e.informationPanelPath,children:(0,i.jsx)(OE,{organizationId:n,delegation:e.delegation,userInfoId:e.userInfo.id,returnPathFallback:e.informationPanelPath})})})},j$=e=>{const{translate:n,params:{organizationId:t,delegationId:s}}=Kl(),o=ki(I$),a=Gi(),[r,d,l]=Yb(t,"organizationDelegationMembers.columns",e.columns),[c,u,m]=Yb(t,"organizationDelegationMembers.limit",Tm),[g,h,p]=Yb(t,"organizationDelegationMembers.predicates",[]),I=(0,V.useMemo)(()=>xg(g),[g]),[x,f,_]=Yb(t,"organizationDelegationMembers.sort",null),{data:j,isLoading:v}=Li("query OrganizationDelegationMembersInfos(\n $organizationId: OrganizationId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegation(id: $delegationId) {\n id\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n id\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,privacy:e.canCustomFieldRead?Ee.All:Ee.Public,delegationId:s},[$o.SegmentCustomFieldFragment]);const S=l||m||p||_||v,y=(0,V.useMemo)(()=>e.canCustomFieldRead?j.organization?.customFields.nodes??[]:(0,kl.A)((j.organization?.delegation.form.elements.map(e=>e.customField)||[]).concat(j.organization?.delegation.columnsCustomFields??[])),[j.organization]),C=Kb(y),b=(0,V.useMemo)(()=>o.getDelegationMembersFilters(y),[y]),A=(0,V.useMemo)(()=>o.getDelegationMembersPossibleColumns(y),[y]);return(0,V.useEffect)(()=>{a.setItem(Tc.DELEGATIONS_SPACE_TAB,"members")},[]),S?(0,i.jsx)(Ql,{}):(0,i.jsx)(Cx,{columns:e.canEditColumns?r:e.columns,columnsSearch:[],columnsToIncludes:p$,eventId:null,filters:b,limit:c,loadDataList:Ya,loadDataListParams:{delegationId:s},loadRow:qa,organizationId:t,possibleColumns:A,predicates:I,renderActions:(n,t,o)=>(0,i.jsx)(i$,{campaigns:e.campaigns,canMemberEdit:e.canMemberEdit,customFields:y,deleteFromEvent:!1,massActions:n,predicates:I,scope:{delegationId:s},showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:e.canMemberDelete,showPrint:!1,showWishedAccreditationsEdit:!1,showWishedProfileEdit:!1,sort:x,totalCount:t,onMassEditSuccess:o}),renderAllSelectedText:e=>n("les_1_membres_71180",e),renderPageSelectedText:e=>n("les_1_membres_00895",e),renderSelectAllText:e=>n("s_lectionner_le_45277",e),rendering:xh.List,setColumns:d,setLimit:u,setPredicates:h,setSort:f,showEditColumns:e.canEditColumns,showEditMode:e.showEditMode,showFilters:!0,showMassActions:!0,showPredicatesBadges:!0,showRowDropdown:!0,showRowEdit:e.canMemberEdit,showSearchColumns:!1,showSelectAll:!0,sort:x,children:(0,i.jsx)(kx,{getEditPath:e.getEditPath,renderCell:(n,o,a)=>(0,i.jsx)(f$,{column:n,customField:C.get(n.slug),informationPanelPath:s?`${window.location.origin}${Js.DELEGATION_MEMBER_INFORMATION({organizationId:t,delegationId:s,userInfoId:o.id})}`:void 0,reloadRow:a,row:o,updatable:e.canMemberEdit}),renderRowDropdown:(n,t)=>(0,i.jsx)(uw,{accreditationState:null,allowedCustomDocuments:e.customBadges,canDelete:e.canMemberDelete,canDuplicate:!1,canMemberAccredit:!1,customDocuments:qo,deleteFromEvent:!1,member:n,reload:t,showDeleteFromEvent:!1,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:null}),renderRowPanels:e=>(0,i.jsx)(_$,{delegation:j.organization.delegation,informationPanelPath:Js.DELEGATION_MEMBER_INFORMATION({organizationId:t,delegationId:s,userInfoId:e.id}),userInfo:e})})})},v$=e=>(0,i.jsx)(Tl,{align:"end",css:{background:"gray"===e.background?"$gray50":"none",borderRight:"1px solid $gray200",overflow:"hidden",px:"$4"},direction:"column",height:1,justify:"center",width:1,children:e.children}),S$=(0,V.createContext)({});function y$(){return(0,V.useContext)(S$)}const C$=e=>{const{translate:n}=Kl(),t=ki(Rv),{accreditationIdToOpen:s,accreditationIdToValues:o,accreditationKeyToStats:a,accreditationValueKeyToStats:r,dates:d,hasNoDate:l,hasScanned:c,showTotal:u}=y$(),m=a[`a${e.accreditation.id}__no_date`],g=o[e.accreditation.id]||[],h=Yo(g),p=s[e.accreditation.id]??!0,{assignedTotal:I,scannedTotal:x}=(0,V.useMemo)(()=>{const n=(0,kl.A)(d.map(n=>a[`a${e.accreditation.id}__${n.toSQLDate()}`]));return{assignedTotal:(0,ES.A)(n,e=>e.assigned??0)+(l?m?.assigned??0:0),scannedTotal:(0,ES.A)(n,e=>e.scanned??0)+(l?m?.scanned??0:0)}},[a,m,d,l,e.accreditation]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[d.map(s=>{const o=`a${e.accreditation.id}__${s.toSQLDate()}`,r=a[o];return e.accreditation.hasDateSlots?(0,i.jsxs)(v$,{background:"none",children:[(0,i.jsxs)(Mr,{children:[r?.assigned??0,t.toNumberOrInfinity(r?.max,{prefix:"/"})]}),c&&(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:r?.scanned?n("_1_scann_e_19753",r.scanned):"-"})]},s.toISO()):(0,i.jsx)(v$,{background:"none"},s.toISO())}),l&&(e.accreditation.hasDateSlots?(0,i.jsx)(v$,{background:"none"}):(0,i.jsxs)(v$,{background:"none",children:[(0,i.jsxs)(Mr,{children:[m?.assigned??0,t.toNumberOrInfinity(m?.max,{prefix:"/"})]}),c&&(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:m?.scanned?n("_1_scann_e_19753",m.scanned):"-"})]})),u&&(0,i.jsxs)(v$,{background:"none",children:[(0,i.jsxs)(Mr,{children:[I,t.toNumberOrEmpty(e.accreditation.maxResources,{prefix:"/"})]}),c&&(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:x>0?n("_1_scann_e_19753",x):"-"})]})]}),p&&h&&g.map(({id:t})=>{const s=r[`a${e.accreditation.id}__${t}__no_date`];return(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[d.map(s=>{const o=`a${e.accreditation.id}__${t}__${s.toSQLDate()}`,a=r[o];return e.accreditation.hasDateSlots?(0,i.jsxs)(v$,{background:"none",children:[(0,i.jsx)(Mr,{children:a?.assigned??0}),c&&(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:a?.scanned?n("_1_scann_e_19753",a.scanned):"-"})]},s.toISO()):(0,i.jsx)(v$,{background:"none"},s.toISO())}),l&&(e.accreditation.hasDateSlots?(0,i.jsx)(v$,{background:"none"}):(0,i.jsxs)(v$,{background:"none",children:[(0,i.jsx)(Mr,{children:s?.assigned??0}),c&&(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:s?.scanned?n("_1_scann_e_19753",s.scanned):"-"})]})),u&&(0,i.jsx)(v$,{background:"none"})]},t)})]})},b$=e=>{const{translate:n}=Kl(),t=ki(Rv),{categoryIdToAccreditations:s,categoryIdToOpen:o,categoryKeyToStats:a,dates:r,hasNoDate:d,hasScanned:l,showTotal:c}=y$(),u=(0,V.useMemo)(()=>s[e.category.id],[s,e.category.id]),m=o[e.category.id]??!0,g=a[`c${e.category.id}__no_date`],{assignedTotal:h,scannedTotal:p}=(0,V.useMemo)(()=>{const n=(0,kl.A)(r.map(n=>a[`c${e.category.id}__${n.toSQLDate()}`]));return{assignedTotal:(0,ES.A)(n,e=>e.assigned??0)+(d?g?.assigned??0:0),scannedTotal:(0,ES.A)(n,e=>e.scanned??0)+(d?g?.scanned??0:0)}},[a,r,d,g,e.category]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[r.map(t=>{const s=`c${e.category.id}__${t.toSQLDate()}`,o=a[s];return(0,i.jsxs)(v$,{background:"gray",children:[(0,i.jsx)(Mr,{children:o?.assigned??0}),l&&(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:o?.scanned?n("_1_scann_e_19753",o.scanned):"-"})]},t.toISO())}),d&&(0,i.jsxs)(v$,{background:"gray",children:[(0,i.jsx)(Mr,{children:g?.assigned??0}),l&&(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:g?.scanned?n("_1_scann_e_19753",g.scanned):"-"})]}),c&&(0,i.jsxs)(v$,{background:"gray",children:[(0,i.jsxs)(Mr,{children:[h,t.toNumberOrEmpty(e.category.maxResources,{prefix:"/"})]}),l&&(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:p>0?n("_1_scann_e_19753",p):"-"})]})]}),m?u.map(e=>(0,i.jsx)(C$,{accreditation:e},e.id)):null]})},A$=e=>{const{translate:n}=Kl(),{categories:t,categoryIdToAccreditations:s,customFields:o,links:a,setLinks:r}=y$(),[d,l]=(0,V.useState)(a),c=(0,V.useMemo)(()=>(0,Lm.A)(o,e=>u(e.name)).filter(e=>!e.canSelectMultiple).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id)),[o]),m=(0,V.useCallback)((e,n)=>{l((0,dp.jM)(t=>{t[e].customFieldSlug=n}))},[l]),g=(0,V.useCallback)((e,n)=>{l((0,dp.jM)(t=>{t[e].accreditationsIds=n}))},[l]),h=d.every(e=>""!==e.customFieldSlug&&Yo(e.accreditationsIds));return(0,i.jsxs)(gp,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Yy,{children:n("ventiler_les_st_00770")}),(0,i.jsx)(hp,{css:{padding:"$6"},children:(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[d.map((e,o)=>(0,i.jsxs)(Tl,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$5 $6 $4 $6"},gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textMd medium",children:n("liaison_n_1_48160",o+1)}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>l(Jo(d,o))})]}),(0,i.jsxs)(Tl,{css:{padding:"$4 $6 $6 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:n("CustomField"),values:[e.customFieldSlug],onChange:e=>{Yo(e)&&m(o,e[0])},children:c}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("accr_ditations_39450"),multiple:!0,values:e.accreditationsIds,onChange:e=>g(o,e),children:t.map(e=>{const n=s[e.id];return(0,i.jsx)("optgroup",{label:e.name,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)})})]})]},o)),(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>l([...d,{accreditationsIds:[],customFieldSlug:""}]),children:n("ajouter_une_lia_43639")})]})}),(0,i.jsx)(pp,{children:(0,i.jsxs)(Tl,{gap:"3",justify:"end",width:1,children:[(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")}),(0,i.jsx)(tc,{disabled:!h,onClick:()=>{r(d),e.onClose()},children:n("ventiler_10014")})]})})]})},E$=e=>{const{accreditationIdToOpen:n,accreditationIdToValues:t,setAccreditationIdToOpen:s}=y$(),o=t[e.accreditation.id]||[],a=Yo(o),r=n[e.accreditation.id]??!0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",cursor:a?"pointer":"default",height:"$cellHeightSm",paddingLeft:"$6",paddingRight:"$4",userSelect:"none"},gap:"2",onClick:()=>{a&&s(n=>({...n,[e.accreditation.id]:!(n[e.accreditation.id]??1)}))},children:[(0,i.jsx)(Mr,{css:{visibility:a?"visible":"hidden"},children:(0,i.jsx)(Yl,{icon:r?"chevron-up":"chevron-right"})}),(0,i.jsx)(xI,{color:e.accreditation.color,icon:e.accreditation.icon,size:"sm"}),(0,i.jsx)(Tl,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,wrap:"wrap",children:(0,i.jsx)(Mr,{color:"gray800",title:e.accreditation.name,children:e.accreditation.name})})]}),r&&a&&o.map(({id:e,value:n})=>(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",paddingLeft:"88px",paddingRight:"$4",userSelect:"none"},gap:"2",children:n},e))]})},w$=e=>{const{categoryIdToAccreditations:n,categoryIdToOpen:t,setCategoryIdToOpen:s}=y$(),o=(0,V.useMemo)(()=>n[e.category.id],[n,e.category.id]),a=t[e.category.id]??!0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",cursor:"pointer",height:"$cellHeightSm",px:"$4",userSelect:"none"},gap:"2",onClick:()=>s(n=>({...n,[e.category.id]:!(n[e.category.id]??1)})),children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:a?"chevron-up":"chevron-right"})}),(0,i.jsx)(Mr,{css:{textTransform:"uppercase"},font:"gray800 textXs medium",children:e.category.name})]}),a?o.map(e=>(0,i.jsx)(E$,{accreditation:e},e.id)):null]})},$$=()=>{const{translate:e}=Kl(),{categories:n,links:t,hideOptions:s}=y$(),[o,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:!s&&(0,i.jsx)(tc,{color:"white",size:"sm",onClick:()=>a(!0),children:`${e("ventiler_par_ch_78972")} (${t.length})`})}),n.map(e=>(0,i.jsx)(w$,{category:e},e.id))]}),o&&(0,i.jsx)(A$,{onClose:()=>a(!1)})]})},T$=e=>{const{translate:n}=Kl(),t=ki(Jm),s=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(e.slots.flatMap(e=>e.date?.isValid?[e.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),[e.slots]),o=(0,V.useMemo)(()=>e.slots.some(e=>!e.date?.isValid),[e.slots]),a=(0,V.useMemo)(()=>e.slots.some(e=>(e.scannedResources??0)>0),[e.slots]),r=(0,V.useMemo)(()=>e.showTotal&&(Yo(s)||e.categories.some(e=>"number"==typeof e.maxResources)||e.accreditations.some(e=>"number"==typeof e.maxResources)),[s,e.accreditations,e.categories,e.showTotal]),d=(0,V.useMemo)(()=>(0,Lm.A)(e.categories,e=>u(e.name)),[e.categories]),[l,c]=(0,V.useState)({}),[m,g]=(0,V.useState)({}),h=(0,V.useMemo)(()=>(0,fm.A)(uh(e.accreditations),e=>e.accreditationCategoryId),[e.accreditations]),p=(0,V.useMemo)(()=>Object.fromEntries(e.accreditations.map(n=>{const t=e.links.find(e=>e.accreditationsIds.includes(n.id));if(t){const i=(0,Lm.A)(e.customFields.find(e=>e.slug===t.customFieldSlug)?.values??[],e=>u(e.value));return[n.id,i]}return[n.id,[]]})),[e.accreditations,e.customFields,e.links]),I=(0,V.useMemo)(()=>(0,xm.A)((0,fm.A)(e.slots,e=>{const n=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return`c${e.accreditationCategoryId}__${n}`}),e=>({assigned:(0,ES.A)(e,e=>e.assignedResources),scanned:(0,ES.A)(e,e=>e.scannedResources??0)})),[e.slots]),x=(0,V.useMemo)(()=>Object.fromEntries(e.slots.map(e=>{const n=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return[`a${e.accreditationId}__${n}`,{assigned:e.assignedResources,max:e.maxResources,scanned:e.scannedResources??0}]})),[e.slots]),f=(0,V.useMemo)(()=>Object.fromEntries(e.slots.flatMap(e=>Object.entries(e.resourcesByFields).flatMap(([n,t])=>{const i=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return t.map(({customFieldValueId:n,assignedResources:t,scannedResources:s})=>[`a${e.accreditationId}__${n}__${i}`,{assigned:t,scanned:s}])}))),[e.slots]);return(0,i.jsx)(S$.Provider,{value:{accreditationKeyToStats:x,accreditationValueKeyToStats:f,accreditationIdToOpen:m,accreditationIdToValues:p,categories:d,categoryIdToAccreditations:h,categoryIdToOpen:l,categoryKeyToStats:I,customFields:e.customFields,dates:s,hasNoDate:o,hasScanned:a,hideOptions:e.hideOptions,links:e.links,showTotal:r,setAccreditationIdToOpen:g,setCategoryIdToOpen:c,setLinks:e.setLinks},children:(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsx)($$,{}),(0,i.jsx)(Tl,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsxs)(Tl,{css:{height:"$cellHeightSm"},children:[s.map(e=>(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:t.toLocaleString(e,Uo.DateOnly.MonthShort)})},e.toISO())),o&&(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(Mr,{font:"gray800 textSm medium",textAlign:"center",children:n("tout_l_v_nemen_70929")})}),r&&(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("total_07173")})})]}),d.map(e=>(0,i.jsx)(b$,{category:e},e.id))]})})]})})},z$=e=>{const n=fI(),t=(0,V.useMemo)(()=>e.min.startOf("week").equals(e.value.startOf("week")),[e.min,e.value]),s=(0,V.useMemo)(()=>e.max.endOf("week").equals(e.value.endOf("week")),[e.max,e.value]);return(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsx)(tc,{color:"white",disabled:t,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.value.minus(n?{week:1}:{day:1}))}}),(0,i.jsx)(Mr,{width:160,children:(0,i.jsx)(Wp,{...e})}),(0,i.jsx)(tc,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.value.plus(n?{week:1}:{day:1}))}})]})},O$=(0,V.createContext)({}),R$=e=>{const{days:n,interval:t}=(0,V.useContext)(O$),s=n[0],o=n[6]??n[0],a=(0,V.useMemo)(()=>(e.startAt??Oo.c9.max(s,t.start)).startOf("day"),[e.startAt,s,t]),r=(0,V.useMemo)(()=>(e.endAt??Oo.c9.min(o,t.end)).endOf("day"),[e.endAt,o,t]),d=(0,V.useMemo)(()=>"number"==typeof e.startHour&&e.startHour>0&&e.startAt?.isValid&&e.startAt.hour{const e=Math.max(a.diff(s,"days").days+1,1);return d?e-1:e},[d,a,s]),c=(0,V.useMemo)(()=>{const e=Math.min(Math.ceil(r.diff(s,"days").days)+1,8);return d?e-1:e},[d,r,s]);return a>o||r{const n=(0,V.useMemo)(()=>{if("week"===e.display){const n=e.date.startOf("week");return(0,Om.A)(0,7).map(e=>n.plus({day:e}))}return[e.date]},[e.date]),t=(0,V.useMemo)(()=>Oo.IX.fromDateTimes(e.minDate.startOf("day"),e.maxDate.endOf("day")),[e.minDate,e.maxDate]),[s,o]=(0,V.useState)(300),a=(0,V.useCallback)(e=>{if(e){const n=Math.max(Math.ceil(e.getBoundingClientRect().height),300);o(n)}},[e.date,o]),r=e.showBorder?{bd:!0,overflow:"hidden"}:{};return(0,i.jsx)(O$.Provider,{value:{days:n,interval:t},children:(0,i.jsxs)(Tl,{css:{...r,...e.css},direction:"column",children:[(0,i.jsx)(Tl,{css:{borderBottom:"1px solid $gray200"},height:60,width:1,children:n.map(e=>(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Mr,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",children:e.toLocaleString({weekday:"long"})}),(0,i.jsx)(Mr,{font:"gray800 textXl semiBold",children:e.day})]},e.toISO()))}),(0,i.jsxs)(Tl,{className:"h-calendar-events-container",css:{position:"relative"},direction:"column",height:s,width:1,children:[(0,i.jsx)(eu,{css:{flex:"1","& > div:last-child":{borderRight:"none"}},gridtemplatecolumns:"week"===e.display?"repeat(7, minmax(0, 1fr))":"1",gridtemplaterows:"1fr",width:1,children:n.map((e,n)=>(0,i.jsx)(Tl,{css:{background:t.contains(e)?"white":"$primary50",borderRight:"1px solid $gray200",gridColumn:`${n+1} / ${n+2}`,gridRow:"1 / 2"}},e.toISO()))}),(0,i.jsx)(eu,{ref:a,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})]})]})})},M$=e=>(0,i.jsxs)(Tl,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:e.icon})}),(0,i.jsx)(Mr,{css:{flex:"1"},fontSize:"textXs",children:e.text}),(0,i.jsx)(Tl,{align:"center",css:{background:e.background,borderRadius:"$1",fontSize:"$textXs",fontWeight:"$medium",padding:"2px 8px",minWidth:"30px"},justify:"center",children:e.count})]}),P$=t.p+"img/unavailableCell-148d1ec075614a0e294d.png",k$=br(Mr,{alignItems:"center",color:"$gray900",display:"flex",height:"40px",justifyContent:"center",variants:{border:{gray100:{borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100"},gray200:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200"}}},defaultVariants:{border:"gray100"}}),F$=br(Mr,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",display:"flex",gap:"$2",height:"48px",px:"$4",width:"200px"}),N$=br(Mr,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray800",display:"flex",height:"48px",padding:"$2",width:"100px","& > div":{alignItems:"center",background:"$success400",borderRadius:"$1",display:"flex",height:"100%",justifyContent:"center",width:"100%","& svg":{height:"50%"}}}),L$=br(Mr,{background:`url(${P$}) no-repeat`,borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",height:"48px",width:"100px"}),U$=e=>{const{translate:n}=Kl();return(0,i.jsx)(km,{children:(0,i.jsxs)($m,{children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(My,{userInfo:e.userInfo})}),(0,i.jsx)(Tl,{align:"center",gap:"3",children:e.isAssigned?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[(0,i.jsx)(Mr,{color:"success500",children:(0,i.jsx)(Yl,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:e.assignedText})]}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsx)(Fu,{placement:"bottom-end",children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e.onDelete,children:e.deleteText})})]})]}):(0,i.jsx)(tc,{size:"sm",onClick:e.onAdd,children:n("ajouter_97327")})})]})})},V$=e=>{const{translate:n}=Kl();return(0,i.jsx)(Tl,{css:{background:"white",bd:!0,padding:"$4 $6"},direction:"column",gap:"2",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"badge-check"})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:n("attribu_es_48167")}),(0,i.jsx)(Mr,{children:e.stats.assignedResources})]}),(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"hand-holding-heart"})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:n("souhait_es_78101")}),(0,i.jsx)(Mr,{children:e.stats.wishedResources})]}),void 0!==e.stats.scannedResources&&(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"scanner-gun"})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:n("scann_es_13169")}),(0,i.jsx)(Mr,{children:e.stats.scannedResources})]})]})})},B$=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(e.stats),[r,d]=(0,V.useState)((0,Lm.A)(e.members,e=>u(e.userInfo.name))),[l,c]=(0,V.useState)({}),m=(0,V.useCallback)(async n=>{s(!0),c(e=>({...e,[n]:!0}));const{member:t,stats:i}=await e.reloadMember(n);d(e=>e.flatMap(e=>e.userInfo.id===n?t?[t]:[]:[e])),a(i),c(e=>({...e,[n]:!1})),s(!1)},[e.reloadMember,s,a,c,d]),g=(0,V.useCallback)(async n=>{c(e=>({...e,[n]:!0})),await e.add(n),await m(n)},[e.add,m,c]),h=(0,V.useCallback)(async n=>{c(e=>({...e,[n]:!0})),await e.delete(n),await m(n)},[e.delete,m,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yy,{children:e.name}),(0,i.jsxs)(hp,{css:{background:"$gray50",gap:"$6",padding:"$6"},children:[(0,i.jsx)(V$,{isLoading:t,stats:o}),(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{children:(0,i.jsx)(k$,{children:n("nom_du_membre_69353")})}),r.map(n=>l[n.userInfo.id]?(0,i.jsx)(qm,{bx:!0},n.id):(0,i.jsx)(U$,{assignedText:e.assignedText,deleteText:e.deleteText,isAssigned:e.isAssigned(n),userInfo:n.userInfo,onAdd:()=>g(n.userInfo.id),onDelete:()=>h(n.userInfo.id)},n.id))]})]})]})},W$=e=>{const{params:{eventId:n,delegationId:t},translate:s}=Kl(),{mutate:o}=ja(),a=(0,V.useMemo)(()=>`${e.accreditation.name}${g(e.accreditationSlot.name)?` - ${e.accreditationSlot.name}`:""}`,[e.accreditation,e.accreditationSlot]),r=(0,V.useCallback)(n=>n.accreditationsUsersInfos.some(n=>n.accreditationSlotId===e.accreditationSlotId),[e.accreditationSlotId]),d=(0,V.useCallback)(async i=>{const{event:s}=await(o={eventId:n,delegationId:t,accreditationSlotId:e.accreditationSlotId,userInfoId:i},a=await X(),oa("query CalendarAccreditationSlotMember(\n $eventId: EventId!\n $delegationId: DelegationId\n $accreditationSlotId: AccreditationsSlotId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...AccreditationSlotStats\n }\n\n delegationMaybe(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n }\n }\n\n member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n}\n",{variables:o,token:a||void 0,fragments:[$o.AccreditationSlotStatsFragment,$o.DelegationAccreditationSlotStatsFragment,$o.VolunteerRegistrationDelegationAccreditationSlotFragment]}));var o,a;const d=s.member.accreditationsSlots.some(n=>n.id===e.accreditationSlotId);return{member:r(s.member)||d?s.member:null,stats:s.delegationMaybe?.accreditationSlot??s.accreditationSlot}},[e.accreditationSlotId,t,n,r]),l=(0,V.useCallback)((t,i)=>o({eventId:n,massAccredit:{accreditationsSlotsIds:[e.accreditationSlotId],selecteds:{ids:[t]},strategy:i}}),[n,o,e.accreditationSlotId]),c=(0,V.useCallback)(e=>l(e,hn.Add),[l]),u=(0,V.useCallback)(e=>l(e,hn.Delete),[l]);return(0,i.jsx)(B$,{add:c,assignedText:s("d_j_attribu_e_06450"),delete:u,deleteText:s("retirer_l_accr_62187"),isAssigned:r,members:e.volunteersRegistrations,name:a,reloadMember:d,stats:e.stats})},G$=e=>{const{data:n,loader:t}=Li("query AccreditationSlotMembers($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...AccreditationSlotStats\n date\n name\n\n accreditation {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n }\n}\n",{eventId:e.eventId,accreditationSlotId:e.accreditationSlotId},[$o.AccreditationSlotStatsFragment,$o.VolunteerRegistrationDelegationAccreditationSlotFragment]);return(0,i.jsx)(gp,{size:"md",onClose:e.onClose,children:t||(0,i.jsx)(W$,{accreditation:n.event.accreditationSlot.accreditation,accreditationSlot:n.event.accreditationSlot,accreditationSlotId:e.accreditationSlotId,stats:n.event.accreditationSlot,volunteersRegistrations:n.event.accreditationSlot.volunteersRegistrations})})},q$=e=>{const{data:n,loader:t}=Li("query DelegationAccreditationSlotMembers(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n\n accreditationSlot {\n date\n name\n }\n\n accreditation {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlotId},[$o.DelegationAccreditationSlotStatsFragment,$o.VolunteerRegistrationDelegationAccreditationSlotFragment]);return(0,i.jsx)(gp,{size:"md",onClose:e.onClose,children:t||(0,i.jsx)(W$,{accreditation:n.event.delegation.accreditationSlot.accreditation,accreditationSlot:n.event.delegation.accreditationSlot.accreditationSlot,accreditationSlotId:e.accreditationSlotId,stats:n.event.delegation.accreditationSlot,volunteersRegistrations:n.event.delegation.accreditationSlot.volunteersRegistrations})})},H$=e=>{const{translate:n,params:{eventId:t,delegationId:s}}=Kl(),[o,a]=(0,V.useState)(e.stats),r=(0,V.useMemo)(()=>Gu(e.accreditation.color),[e.accreditation]),d=(0,V.useMemo)(()=>({background:r[50],border:`1px solid ${r[500]}`,color:r[700]}),[r]),l=(0,V.useMemo)(()=>`${e.accreditation.name}${g(e.accreditationSlot.name)?` - ${e.accreditationSlot.name}`:""}`,[e.accreditation,e.accreditationSlot]),c=(0,V.useCallback)(async()=>{if(s){const{event:{delegation:n}}=await Pa({eventId:t,delegationId:s,accreditationSlotId:e.accreditationSlot.id},await X());a(n.accreditationSlot)}else{const{event:{accreditationSlot:s}}=await(n={eventId:t,accreditationSlotId:e.accreditationSlot.id},i=await X(),oa("query AccreditationSlotStats($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n assignedResources\n maxResources\n scannedResources\n wishedResources\n }\n }\n}\n",{variables:n,token:i||void 0,fragments:[]}));a(s)}var n,i},[e.accreditationSlot,a]),[u,m]=(0,V.useState)(!1),h=o.maxResources?`/${o.maxResources}`:"",p=`${o.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"start",css:{...d,borderRadius:"$1",cursor:e.canMemberAccredit?"pointer":"default",minHeight:"32px",padding:"$2"},direction:"column",gap:"2",width:1,onClick:()=>{e.canMemberAccredit&&m(!0)},children:[(0,i.jsx)(Mr,{css:{flex:"1"},fontSize:"textXs",fontWeight:"medium",children:l}),(0,i.jsx)(M$,{background:r[100],count:p,icon:"badge-check",text:n("attribu_es_48167")}),e.showWished&&"number"==typeof o.wishedResources&&(0,i.jsx)(M$,{background:r[100],count:o.wishedResources,icon:"hand-holding-heart",text:n("souhait_es_78101")}),"number"==typeof o.scannedResources&&(0,i.jsx)(M$,{background:r[100],count:o.scannedResources,icon:"scanner-gun",text:n("scann_es_13169")})]}),e.canMemberAccredit&&u?s?(0,i.jsx)(q$,{accreditationSlotId:e.accreditationSlot.id,delegationId:s,eventId:t,onClose:()=>(m(!1),c())}):(0,i.jsx)(G$,{accreditationSlotId:e.accreditationSlot.id,eventId:t,onClose:()=>(m(!1),c())}):null]})},Y$=e=>{const n=fI(),t=(0,V.useMemo)(()=>(0,Lm.A)(e.accreditationsSlots.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,ch(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),s=(0,V.useMemo)(()=>(0,Lm.A)(e.accreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,ch(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),o=(0,V.useMemo)(()=>Object.fromEntries(e.accreditations.map(e=>[e.accreditationId,e.willAutoAccredit||e.accreditation.willAutoAccredit])),[e.accreditations]);return(0,i.jsxs)(D$,{css:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:n?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[t.map(n=>(0,i.jsx)(R$,{children:(0,i.jsx)(H$,{accreditation:n.accreditation,accreditationSlot:n.accreditationSlot,canMemberAccredit:e.canMemberAccredit,showWished:!o[n.accreditationId],stats:n})},n.accreditationSlot.id)),s.map(n=>(0,i.jsx)(R$,{endAt:n.accreditationSlot.date,startAt:n.accreditationSlot.date,children:(0,i.jsx)(H$,{accreditation:n.accreditation,accreditationSlot:n.accreditationSlot,canMemberAccredit:e.canMemberAccredit,showWished:!o[n.accreditationId],stats:n})},n.accreditationSlot.id))]})},Z$=e=>{const{translate:n,params:{organizationId:t}}=Kl(),[s,o]=(0,V.useState)(""),[a,r]=Zb(e.delegationsSpaceLayoutTab,e=>e.rendering,t,"eventDelegationAccreditations.rendering",gh.WeeklyCalendar,[gh.Table,gh.WeeklyCalendar]),[d,l]=(0,V.useState)(e.event.delegation.minAccreditationSlotDate),c=(0,V.useMemo)(()=>d?.isValid?d:e.event.startAt,[e.event,d]),[m,h]=(0,V.useState)(null),p=(0,V.useMemo)(()=>{const n=u(s||""),t=e.delegationsSpaceLayoutTab?.infos.accreditationsSlotsIds;return e.event.delegation.allAccreditationsSlots.filter(e=>{const i=!g(n)||u(e.accreditation.name).includes(n)||u(e.accreditationSlot.name).includes(n)||a===gh.Table&&u(e.accreditationCategory.name).includes(n),s=!m?.isValid||!!e.accreditationSlot.date?.isValid&&m.toSQLDate()===e.accreditationSlot.date.toSQLDate(),o=!Yo(t)||t.includes(e.accreditationSlotId);return i&&s&&o})},[e.delegationsSpaceLayoutTab,e.event,s,a,m]),I=(0,V.useMemo)(()=>p.map(e=>({accreditationCategoryId:e.accreditationCategory.id,accreditationId:e.accreditationSlot.accreditationId,date:e.accreditationSlot.date,assignedResources:e.assignedResources,maxResources:e.maxResources,resourcesByFields:e.resourcesByFields,scannedResources:e.scannedResources})),[p]),x=(0,V.useMemo)(()=>{const n=p.map(e=>e.accreditationId);return e.event.delegation.allAccreditations.filter(e=>n.includes(e.accreditationId))},[e.event,p]),f=(0,V.useMemo)(()=>x.map(e=>({id:e.accreditation.id,accreditationCategoryId:e.accreditation.accreditationCategoryId,index:e.accreditation.index,name:e.accreditation.name,color:e.accreditation.color,icon:e.accreditation.icon,hasDateSlots:e.accreditation.hasDateSlots,maxResources:e.maxResources})),[x]),_=(0,V.useMemo)(()=>{const n=p.map(e=>e.accreditationCategoryId);return e.event.delegation.allAccreditationsCategories.filter(e=>n.includes(e.accreditationCategoryId)).map(e=>({id:e.accreditationCategory.id,name:e.accreditationCategory.name,maxResources:e.maxResources}))},[p,e.event]),j=(0,V.useMemo)(()=>!e.delegationsSpaceLayoutTab,[e.delegationsSpaceLayoutTab]),v=(0,V.useMemo)(()=>g(e.delegationsSpaceLayoutTab?.infos.customFieldSlug)&&Yo(f)?[{accreditationsIds:f.map(e=>e.id),customFieldSlug:e.delegationsSpaceLayoutTab.infos.customFieldSlug}]:[],[e.delegationsSpaceLayoutTab,f]);return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Tl,{css:{background:"white",padding:"$5 $5"},gap:"3",children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_une_65646"),value:s,onChange:o})}),(0,i.jsx)(Mr,{css:{flex:"1"}}),a===gh.WeeklyCalendar&&(0,i.jsx)(z$,{max:e.event.endAt,min:e.event.startAt,value:c,onChange:l}),a===gh.Table&&(0,i.jsx)(Mr,{width:160,children:(0,i.jsx)(Wp,{max:e.event.endAt,min:e.event.startAt,value:m,onChange:h})}),j&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:fh(a),children:_h(n,a)})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(Pu,{icon:fh(gh.WeeklyCalendar),onClick:()=>r(gh.WeeklyCalendar),children:_h(n,gh.WeeklyCalendar)}),(0,i.jsx)(Pu,{icon:fh(gh.Table),onClick:()=>r(gh.Table),children:_h(n,gh.Table)})]})]})]}),a===gh.Table?(0,i.jsx)(T$,{accreditations:f,categories:_,customFields:e.organization.customFields.nodes,hideOptions:!0,links:v,setLinks:Bc.A,showTotal:!0,slots:I}):(0,i.jsx)(Y$,{accreditations:x,accreditationsSlots:p,canMemberAccredit:e.canMemberAccredit,event:e.event,selectedDay:c})]})},K$=()=>{const e=Fi();return(0,i.jsx)(Tl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},height:1,justify:"center",width:1,children:(0,i.jsx)(Mr,{height:250,width:1,children:(0,i.jsx)(UE,{title:e("aucune_accr_dit_27643")})})})},X$=e=>{const{params:{organizationId:n,eventId:t,delegationId:s}}=Kl(),{data:o,loader:a}=Li("query DelegationAccreditations(\n $organizationId : OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n organization(id: $organizationId){\n customFields(eventId: $eventId, fieldTypes: [Select], variety: UserInfo, privacy: Public){\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n delegation(id: $delegationId) {\n minAccreditationSlotDate\n\n allAccreditationsCategories {\n accreditationCategoryId\n maxResources\n\n accreditationCategory {\n id\n name\n }\n }\n\n allAccreditations {\n accreditationId\n accreditationCategoryId\n willAutoAccredit\n maxResources\n\n accreditation {\n id\n accreditationCategoryId\n name\n color\n icon\n hasSlots\n index\n willAutoAccredit\n hasDateSlots\n }\n }\n\n allAccreditationsSlots(onlyVisible: $onlyVisible) {\n ...DelegationAccreditationSlotStats\n\n accreditationSlot {\n id\n accreditationId\n date\n name\n }\n\n accreditation {\n name\n color\n index\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:n,eventId:t,delegationId:s,onlyVisible:e.onlyVisible},[$o.ConditionCustomFieldFragment,$o.DelegationAccreditationSlotStatsFragment]);return a||(Zo(o.event?.delegation.allAccreditationsSlots)?(0,i.jsx)(K$,{}):(0,i.jsx)(Z$,{canMemberAccredit:e.canMemberAccredit,delegationsSpaceLayoutTab:e.delegationsSpaceLayoutTab,event:o.event,organization:o.organization}))},Q$=e=>{const{params:{organizationId:n,eventId:t,delegationId:s},translate:o}=Kl(),{mutate:a,isLoading:r}=Fa(),d=(0,V.useMemo)(()=>e.customDocuments.filter(n=>n.slug===e.slug),[e.customDocuments,e.slug]),l=(0,V.useMemo)(()=>Yo(d)?d.map(e=>e.name).join(", "):Dt.includes(e.slug)?M_(e.slug):null,[d,e.slug]),c=Yo(d);return l?(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Tl,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(Yl,{icon:"file-lines"})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 textSm medium",children:l}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",isLoading:r,leftIcon:"download",onClick:()=>a({organizationId:n,eventId:t,delegationId:s,documentsExport:{badgeType:c?null:e.slug,customDocumentSlug:c?e.slug:null,documentType:c?Ne.UserCustomDocument:Ne.CustomBadge,language:Hn.Fr,oneFile:!1,segmentsIds:[],strategy:ke.OnePerPage}})})})}),(0,i.jsx)(Dx,{placement:"top",children:o("recevoir_les_do_31669")})]})]}):null},J$=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("documents_dispo_46996")}),(0,i.jsx)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:e.delegationsSpaceCustomBadges.map(n=>(0,i.jsx)(Q$,{customDocuments:e.customDocuments,slug:n},n))})]})};var eT=t(6502),nT=t(2716);const tT=e=>{tm("common-front/src/designSystem/components/__deprecated/progressGauge.tsx","common-front/src/designSystem/components/progressGauge.tsx");const n=(0,V.useMemo)(()=>(0,nT.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(Math.PI/2),[]),t=(0,V.useMemo)(()=>e.total===1/0?1:0===e.total?1/0:e.count/e.total,[e.count,e.total]),s=(0,V.useMemo)(()=>{const e=(0,eT.A)().domain([0,1]).range([-Math.PI/2,Math.PI/2]);return(0,nT.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(e(t<=1?t:1))},[t]);return(0,i.jsxs)(Mr,{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:n(void 0),fill:Ar.colors.gray100.value}),(0,i.jsx)("path",{d:s(void 0),fill:Yu(t)})]})}),(0,i.jsxs)(Tl,{align:"baseline",css:{bottom:"0",left:"0",position:"absolute"},gap:"2",justify:"center",width:1,children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:e.count}),(0,i.jsxs)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:["/",e.total===1/0?"∞":e.total]})]})]})},iT=e=>{const{designSystem:n}=Em(),t=n===bm?({children:e})=>(0,i.jsx)(Tl,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e}):({children:e})=>(0,i.jsx)(Mr,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e});return(0,i.jsx)(Tl,{css:{background:"white",bd:!0,...e.css},direction:"column",width:1,children:(0,i.jsxs)(Tl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Tl,{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)(dc,{css:{flex:"1",alignContent:"center"},children:e.title}),e.rightIcon&&(0,i.jsx)(Mr,{color:"gray900",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"semiBold",textAlign:"center",width:20,onClick:n=>{e.rightIconClick?.(n)},children:(0,i.jsx)(Yl,{icon:e.rightIcon})}),e.select]}),(0,i.jsx)(t,{children:e.children})]})})},sT=({css:e,title:n,children:t})=>(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n}),(0,i.jsx)(Tl,{css:{bd:!0,padding:"$4",...e},direction:"column",children:t})]}),oT=({children:e,...n})=>Dm()?(0,i.jsx)(sT,{...n,children:e}):(0,i.jsx)(iT,{...n,children:e});var aT=t(141),rT=t(9385);const dT=(e,n=null,t={})=>(Object.entries(e).forEach(([e,i])=>{const s=n?`${n}.${e}`:e;"object"!=typeof i||null===i||Array.isArray(i)?t[s]=i:dT(i,s,t)}),t);const lT=/(\{([\w\.]+)\})/g,cT=/^user\.(accreditations|accreditationsSlots|firstAccreditationSlot|lastAccreditationSlot|positions|assignments|firstAssignment|lastAssignment)\./,uT=/^\d+$/,mT="nodate",gT=Number.MAX_SAFE_INTEGER;let hT=class{fieldService;dateTimeService;intervalService;constructor(e,n,t){this.fieldService=e,this.dateTimeService=n,this.intervalService=t}renderText(e,n={},t="HTML"){const i=n.separator??"
",s=n.delegation?this.getDelegation(n.delegation,n):n.volunteerRegistration?.delegation?this.getDelegation(n.volunteerRegistration.delegation,n):void 0,o=this.getFormats(n),a=n.assignments?this.getAssignments(n.assignments,o):void 0,r=n.accreditations?this.getAccreditations(n.accreditations,o,n):void 0,d={organization:n.organization||void 0,event:n.event?this.getEvent(n.event,n):void 0,delegation:s,team:s,invitedBy:n?.invitedBy?this.getUser(n.invitedBy,null,n):void 0,recipient:n?.recipient?this.getUser(n.recipient,null,n):void 0,user:n.userInfo?{...this.getUser(n.userInfo,s,n),...this.getUserAccreditations(r??[]),...this.getUserAssignments(a??[])}:void 0,...a?this.getAssignmentsVariables(a,i):{},...r?this.getAccreditationsVariables(r,i,n):{},...n.extraInfos},l=("HTML"===t?this.replaceVariables(e,dT(d)):(0,aT.A)(e,{interpolate:/{([\s\S]+?)}/g})(d)).replace(lT,(e,t,i)=>{if(cT.test(i))return"";const[s,o,a,r]=i.split("."),d=n?.userInfo?{lang:this.getLanguage(n.userInfo)}:{};if(8===r?.length?d.date=r:16===r?.length&&(d.date=r.substring(0,8),d.endDate=r.substring(8)),n.userInfo?.links){const e=n.userInfo.links;return i.includes("planningDays")?Ef(e.userPlanningDaysLink,"pdf",d):i.includes("planningList")?Ef(e.userPlanningListLink,"pdf",d):i.includes("planning")?Ef(e.userPlanningLink,"pdf",d):i.includes("assignments")?Ef(e.userAssignmentsLink,"pdf",d):i.includes("paris20kmassignment")&&e?.userCustomBadgeLinks[Ae.Paris20kmassignment]?Ef(e.userCustomBadgeLinks[Ae.Paris20kmassignment],"pdf",d):""}return""});return l}replaceVariables(e,n){return e.replace(lT,(e,t,i)=>{const s=Object.hasOwn(n,i)?n[i]:void 0;return void 0===s||Array.isArray(s)?e:String(s)})}getDelegation(e,n){const t=n.customFields||[],i=this.getFields(e.fields,t);return{...e,...i,leader:{email:e.leaders?.[0]?.email??"",firstName:e.leaders?.[0]?.firstName??"",lastName:e.leaders?.[0]?.lastName??"",phone:e.leaders?.[0]?.phone?.internationalFormat??""},formLink:yf({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.id,formId:e.formId}),spaceLink:Sf(e.organizationId,ts(us.ORGANIZATION_DELEGATIONS({organizationId:e.organizationId})))}}getEvent(e,n){const t=n.customFields||[],i=this.getFields(e.fields,t),s=n.organization?.dateFormat??"yyyy-MM-dd";return{id:e.id,name:e.name,...i,startDate:e.startAt?.toFormat(s)??"",endDate:e.endAt?.toFormat(s)??""}}getFormats(e){return{date:e.organization?.dateFormat||"yyyy-MM-dd",datetime:e.organization?.datetimeFormat||"yyyy-MM-dd HH:mm",time:e.organization?.timeFormat||"HH:mm"}}getAssignments(e,n){return(0,Lm.A)(e,e=>e.positionSlot.range.start.toMillis()).map(({id:e,position:t,positionSlot:i})=>{const s=i.range.start,o=i.range.end,a={id:t.category.id,name:t.category.name};return{acronym:t.acronym??"",category:a,date:s.toFormat(n.date),dateKey:s.toFormat("yyyyMMdd"),dateLong:this.dateTimeService.toLocaleString(s,Uo.DateOnly.WeekdayLongMonthLong),endDate:o.toFormat(n.date),endDatetime:o.toFormat(n.datetime),id:e,leaders:this.getLeaders((0,Rg.A)(t.category.leaders.concat(t.leaders),e=>e.userInfo.id)),name:t.name,position:{acronym:t.acronym??"",address:t.address??"",category:a,color:t.color,description:t.description,id:t.id,name:t.name},range:this.intervalService.toDisplayString(i.range,{formats:{displayWeekday:!0}}),slot:{durationHours:(0,QS.A)(i.timeDifferenceMinutes/60,1),durationMinutes:i.timeDifferenceMinutes,endTime:o.toFormat(n.time),id:i.id,name:i.name,startTime:s.toFormat(n.time)},startDate:s.toFormat(n.date),startDatetime:s.toFormat(n.datetime)}})}getAssignmentsVariables(e,n){const t=Object.fromEntries(Object.values((0,fm.A)(e,e=>e.dateKey)).map(e=>[`positions.${e[0].dateKey}`,(0,Lm.A)((0,wo.A)(e.map(({position:e})=>e.name))).join(n)])),i=(0,ES.A)(e,({slot:e})=>e.durationMinutes);return{assignmentsDays:(0,Rg.A)(e,({dateKey:e})=>e).map(({dateLong:e})=>e).join(", "),positionsCategories:(0,Lm.A)((0,wo.A)(e.map(({position:e})=>e.category.name))).join(", "),positions:(0,Lm.A)((0,wo.A)(e.map(({position:e})=>e.name))).join(", "),volunteerMinutes:i,volunteerHours:(0,QS.A)(i/60,1),...t}}getAccreditations(e,n,t){const i=!!t.organization&&yh(t.organization.id);return(0,Lm.A)(e,e=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date.toMillis():gT).map(({accreditation:e,accreditationCategory:t,accreditationSlot:s})=>{const o=s.date?.isValid??!1,a=n=>Uh(this.dateTimeService,s,e.name,{accreditation:{includeName:n},date:{localeFormat:Uo.DateOnly.WeekdayLongMonthLong}});return{accreditation:{acronym:e.acronym??"",address:e.address??"",color:e.color,description:e.description,icon:e.icon,id:e.id,name:e.name},acronym:e.acronym??"",category:{id:t.id,name:t.name},date:o?s.date.toFormat(n.date):"",dateKey:o?s.date.toFormat("yyyyMMdd"):mT,dateLong:o?this.dateTimeService.toLocaleString(s.date,Uo.DateOnly.WeekdayLongMonthLong):"",displayName:a(!i),fullName:a(!0),hasDate:o,name:e.name,slot:{id:s.id,name:s.name}}})}getAccreditationsVariables(e,n,t){const[i,s]=(0,Ph.A)(e,({hasDate:e})=>e),o=Object.values((0,fm.A)(i,({dateKey:e})=>e)),a=Object.fromEntries(o.map(e=>[`accreditations.${e[0].dateKey}`,(0,Lm.A)((0,wo.A)(e.map(({name:e})=>e))).join(n)])),r=Object.fromEntries(o.map(e=>[`accreditationsSlots.${e[0].dateKey}`,e.map(({fullName:e})=>e).join(n)]));return{accreditationsCategories:(0,Lm.A)((0,wo.A)(e.map(({category:e})=>e.name))).join(n),accreditationsDates:(0,Rg.A)(i,({dateKey:e})=>e).map(({dateLong:e})=>e).join(n),accreditationsText:(0,Lm.A)((0,wo.A)(e.map(({name:e})=>e))).join(n),accreditationsSlots:(0,Lm.A)(e.map(({displayName:e})=>e)).join(n),[`accreditations.${mT}`]:(0,Lm.A)((0,wo.A)(s.map(({name:e})=>e))).join(n),[`accreditationsSlots.${mT}`]:(0,Lm.A)((0,wo.A)(s.map(({fullName:e})=>e))).join(n),omFonction:this.getOmFonction(t),...a,...r}}getUserAccreditations(e){const n=this.getDistinct(e,e=>e.accreditation.id,(e,n,t)=>({...e.accreditation,category:e.category,firstSlot:n,lastSlot:t}),e=>this.getLastAccreditationSlot(e));return{accreditations:this.toKeyedItems(n,({acronym:e})=>e),accreditationsSlots:this.toKeyedItems(e),firstAccreditationSlot:e[0],lastAccreditationSlot:this.getLastAccreditationSlot(e)}}getUserAssignments(e){const n=this.getDistinct(e,e=>e.position.id,(e,n,t)=>({...e.position,firstSlot:n,lastSlot:t}),lg.A);return{positions:this.toKeyedItems(n,({acronym:e})=>e),assignments:this.toKeyedItems(e),firstAssignment:e[0],lastAssignment:(0,lg.A)(e)}}getDistinct(e,n,t,i){return(0,Rg.A)(e,n).map(s=>{const o=e.filter(e=>n(e)===n(s));return t(s,o[0],i(o))})}getLastAccreditationSlot(e){return(0,rT.A)(e,({hasDate:e})=>e)??(0,lg.A)(e)}toKeyedItems(e,n){const t={};if(n)for(const i of e){const e=m(n(i),{replacer:d.Underscore});!g(e)||uT.test(e)||Object.hasOwn(t,e)||(t[e]=i)}return{...t,...Object.fromEntries(e.map((e,n)=>[`${n+1}`,e]))}}getOmFonction(e){return e.organization&&3953===e.organization.id?(e.accreditations??[]).find(e=>50851===e.accreditation.fields.cf74460)?.accreditation.name??e.userInfo?.fields?.cf73819?.value??"":""}getLeaders(e){return e.map(({userInfo:e})=>({email:e.email,firstName:e.firstName??"",lastName:e.lastName??"",name:e.name,phone:e.phone?.internationalFormat??""}))}getUser(e,n,t){const i=t.customFields||[],s=this.getFields(e.fields,i),o=this.getLanguage(e),a=o?{lang:o.toString()}:{},r=e.links?Ef(e.links.userAssignmentsLink,"pdf",a):"",d=e.links?Ef(e.links.userPlanningLink,"pdf",a):"",l=e.links?Ef(e.links.userPlanningListLink,"pdf",a):"",c=e.links?Ef(e.links.userPlanningDaysLink,"pdf",a):"",u=e.links?{assignments:r,badge:Ef(e.links.userBadgeLink,"pdf",a),certificate:Ef(e.links.userCertificateLink,"pdf",a),planning:d,planningList:l,planningDays:c,...Object.fromEntries(Object.entries(e.links.userCustomBadgeLinks).map(([e,n])=>[e.toLowerCase(),Ef(n,"pdf",a)])),...Object.fromEntries(Object.entries(e.links.userCustomDocumentLinks).map(([e,n])=>[e,Ef(n,"pdf",a)]))}:{},m=t.volunteerRegistration?.ticketId??"",g=(e.fields.isExpanded?e.fields?.firstName?.value:e.fields.firstName)||"",h=(e.fields.isExpanded?e.fields?.lastName?.value:e.fields.lastName)||"",p=`
\n \n
`;return{id:e.id,organizationLocalId:e.localId,localId:t.volunteerRegistration?.localId||"",email:e.email,...s,firstName:g,lastName:h,ticketId:m,qrcode:p,memberCode:t.volunteerRegistration?.weezevent?.memberCode||"",name:Kf({firstName:g,lastName:h}),registrationDate:e.registrationDate?.toFormat(t.organization?.dateFormat??"yyyy-MM-dd")??"",registrationDatetime:e.registrationDate?.toFormat(t.organization?.datetimeFormat??"yyyy-MM-dd HH:mm")??"",assignmentSheet:t.event?r:"",documents:u,team:n,delegation:{...n,name:n?.name??"",leader:{email:n?.leader?.email??"",firstName:n?.leader?.firstName??"",lastName:n?.leader?.lastName??"",phone:n?.leader?.phone??""},spaceLink:n?.spaceLink??""},weezevent:{barcode:m,qrcode:p,identificationNumber:""},profile:t.volunteerRegistration?.accreditationProfile?.name??"",profileCategory:t.volunteerRegistration?.accreditationProfile?.accreditationProfileCategory.name??""}}getFields(e,n){return e.isExpanded?Object.fromEntries(Object.entries(e).flatMap(([e,{label:n,value:t}])=>{const i=Yo(t)?t.join(", "):g(t)?t:"";return(0,kl.A)([[e,i],g(n)?[m(n,{replacer:d.Underscore}),i]:null])})):Object.fromEntries(n.flatMap(n=>{const t=this.fieldService.getValueString(n,e);return(0,kl.A)([[n.slug,t],g(n.label)?[m(n.label,{replacer:d.Underscore}),t]:null])}))}getLanguage(e){return e.fields.isExpanded?e.fields?.language?.rawValue:e.fields?.language}};hT=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[CC,Jm,Bg])],hT);const pT={DESIGN:"design",LAYOUTS:{PLURAL:"layouts",SINGLE:"layout"}},IT="delegations-space",xT={DELEGATIONS_SPACE:e=>Xi([Rs.EVENT(e),IT]),DELEGATIONS_SPACE_DESIGN:e=>Xi([xT.DELEGATIONS_SPACE(e),pT.DESIGN]),DELEGATIONS_SPACE_LAYOUTS:e=>Xi([xT.DELEGATIONS_SPACE(e),pT.LAYOUTS.PLURAL]),DELEGATIONS_SPACE_LAYOUTS_CREATE:e=>is(xT.DELEGATIONS_SPACE_LAYOUTS(e)),DELEGATIONS_SPACE_LAYOUTS_UPDATE:e=>ss(Xi([xT.DELEGATIONS_SPACE(e),pT.LAYOUTS.SINGLE,e.delegationsSpaceLayoutId]))},fT=({description:e})=>{const n=Fi();return(0,i.jsx)(oT,{title:n("description_58935"),children:g(e)?(0,i.jsx)(Rf,{text:e}):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_descript_25737")})})},_T=({privateNote:e})=>{const n=Fi();return(0,i.jsx)(oT,{title:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Yl,{icon:"lock"}),(0,i.jsx)(Mr,{children:n("note_priv_e_06303")})]}),children:g(e)?(0,i.jsx)(Rf,{text:e}):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_note_pri_86832")})})};let jT=class extends Rc{constructor(e){super(e)}associateTagsIdsSchema(){return zc.Ik().shape({tagsIds:zc.YO().of(zc.ai())})}};jT=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],jT);const vT=e=>{const n=Fi(),t=ki(jT),[s,o]=(0,V.useState)(e.tags),[a,r]=(0,V.useState)(!1);return(0,i.jsx)(tb,{buttonText:n("enregistrer_06519"),icon:"tag",initialValues:{tagsIds:e.tagsIds},schema:t.associateTagsIdsSchema(),size:"md",subtitle:e.subtitle,title:n("ajout_d_un_ou_p_17767"),onClose:e.onClose,onSubmit:async n=>{e.onSave(n.tagsIds)},children:({form:n,values:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(of,{isCreateVisible:!0,isSearchVisible:!0,multiple:!0,name:"tagsIds",onCreateClick:()=>{r(!0)},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.name))}),a&&(0,i.jsx)(ib,{organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:e=>{o([...s,e]),n.change("tagsIds",[...t.tagsIds,e.id])}})]})})},ST=e=>{const{data:n,loader:t}=(s={organizationId:e.organizationId},Li(ua,s,[]));var s;return t?null:(0,i.jsx)(vT,{organizationId:e.organizationId,subtitle:e.subtitle,tags:n.organization.tags.nodes,tagsIds:e.tagsIds,onClose:e.onClose,onSave:e.onSave})},yT=e=>{const n=Fi(),{organizationId:t}=Vi(),[s,o]=(0,V.useState)(!1);return"associateTags"in e?(0,i.jsxs)(oT,{rightIcon:"pen",rightIconClick:()=>{o(!0)},title:n("tags_79499"),children:[Yo(e.tags)?(0,i.jsx)(Tl,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(Ku,{children:e.name},e.id))}):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_tag_ajout_63348")}),s&&(0,i.jsx)(ST,{organizationId:t,subtitle:e.modalSubtitle,tagsIds:e.tags.map(({id:e})=>e),onClose:()=>{o(!1)},onSave:async n=>{await e.associateTags(n),e.reload(),o(!1)}})]}):(0,i.jsx)(oT,{title:n("tags_79499"),children:Yo(e.tags)?(0,i.jsx)(Tl,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(Ku,{children:e.name},e.id))}):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_tag_ajout_63348")})})},CT=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=Kl(),{hasFeature:a}=XS(),r=ki(Jm),d=ki(hT),{canDelegationRead:l}=ay(),{mutate:c}=$a(),u=(0,V.useMemo)(()=>yf({organizationId:t,eventId:s,delegationId:o,formId:e.delegation?.form.id}),[e.delegation]),m=(0,V.useMemo)(()=>Sf(t,Js.DELEGATION({organizationId:t,eventId:s,delegationId:o})),[e.delegation]),h=(0,V.useMemo)(()=>g(e.delegation.description)?d.renderText(e.delegation.description,{delegation:e.delegation}):"",[e.delegation]),p=(0,V.useMemo)(()=>e.delegation.usedCustomFields.concat(e.customFields),[e.customFields,e.delegation]),I=(e,n)=>(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Mr,{textAlign:"start",children:e}),(0,i.jsx)(Mr,{css:{borderBlockEnd:"2px dotted $gray500",flex:"1",marginBlockEnd:"$1"}}),(0,i.jsx)(Mr,{color:"gray900",css:{fontSize:"$textMd"},textAlign:"end",children:n})]});return(0,i.jsx)(yy,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsx)(Tl,{css:{flex:"3",height:"100%"},direction:"column",gap:"6",children:(0,i.jsx)(oT,{css:{flex:"1 1"},title:n("limite_de_membr_42978"),children:(0,i.jsxs)(Tl,{css:{justifyContent:"space-between"},direction:"column",height:1,children:[(0,i.jsx)(Mr,{css:{margin:"auto"},children:(0,i.jsx)(tT,{count:e.delegation.numberOfResources,total:e.delegation.maxResources??1/0})}),(0,i.jsx)(Tl,{direction:"column",gap:"4",children:a(Ze.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray700",css:{fontSize:"$textXs",fontWeight:600,fontFamily:"Open Sans",lineHeight:"18px",textTransform:"uppercase"},children:n("dont_76603")}),(0,i.jsxs)(Tl,{color:"gray500",css:{fontSize:"$textSm",fontWeight:"$medium",lineHeight:"20px",justifyContent:"space-between"},direction:"column",gap:"2",children:[I(n("membres_accr_di_73664"),e.delegation.numberOfMembersAccredited),I(n("membres_en_atte_57336"),e.delegation.numberOfMembersWaitingAccreditation),I(n("membres_refus_31757"),e.delegation.numberOfMembersRefusedAccreditation)]})]})})]})})}),(0,i.jsx)(Tl,{css:{flex:"6"},direction:"column",gap:"6",children:(0,i.jsx)(oT,{title:n("param_tres_78420"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Tl,{gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("cat_gorie_00291")}),(0,i.jsx)(Mr,{children:(0,i.jsx)(Xm,{to:Js.DELEGATION_CATEGORY({organizationId:t,eventId:s,delegationCategoryId:e.delegation.category.id}),children:e.delegation.category.name})})]}),(0,i.jsx)(sI,{direction:"horizontal"}),l&&e.delegation.parent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("d_l_gation_pare_68507")}),(0,i.jsx)(Tl,{align:"center",css:{color:"$primary500",fontWeight:"$medium","&:hover":{textDecoration:"underline"}},gap:"2",children:(0,i.jsx)(ql,{to:Js.DELEGATION({organizationId:t,delegationId:e.delegation.parent.id}),children:(0,i.jsx)(Ku,{color:"white",cursor:"pointer",size:"md",children:e.delegation.parent.name},e.delegation.parent.id)})})]}),(0,i.jsx)(sI,{direction:"horizontal"})]}),(0,i.jsxs)(Tl,{gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("State")}),(0,i.jsx)(Mr,{color:"gray800",children:(0,i.jsx)(Ku,{color:"success",children:n(e.delegation.state)})})]}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(Tl,{gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("date_limite_d_i_79779")}),(0,i.jsx)(Mr,{color:"gray800",children:e.delegation.deadlineDate?r.toLocaleString(e.delegation.deadlineDate,Uo.DateOnly.MonthLong):"-"})]}),e.delegation.delegationsSpaceLayout&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(Tl,{gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("DelegationsSpaceLayout")}),(0,i.jsx)(Xm,{to:xT.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:t,eventId:s,delegationsSpaceLayoutId:e.delegation.delegationsSpaceLayout.id}),children:e.delegation.delegationsSpaceLayout.name})]})]}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(Tl,{gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("Form")}),(0,i.jsx)(Xm,{css:{color:"$primary500"},to:u,children:e.delegation.form.name})]}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(Tl,{gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("DelegationSpaceLink")}),(0,i.jsx)(Xm,{css:{color:"$primary500"},to:m,children:n("portail_d_l_gat_06817")})]})]})})})]}),Yo(p)&&(0,i.jsx)(oT,{title:n("champs_de_formu_64126"),children:(0,i.jsx)(Tl,{direction:"column",gap:"4",width:1,children:p.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(Tl,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",css:{flex:"1"},children:n.name}),(0,i.jsx)(Tl,{justify:"end",width:300,children:(0,i.jsx)(wE,{field:n,fields:e.delegation.fields})})]})]},n.slug))})}),(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(oT,{title:n("reponsable_82458_plural"),children:Yo(e.delegation.leaders)?e.delegation.leaders.map((e,n)=>(0,i.jsxs)(V.Fragment,{children:[0!==n&&(0,i.jsx)(oI,{height:"4"}),(0,i.jsx)(My,{userInfo:e})]},e.id)):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_reponsabl_38504")})}),(0,i.jsx)(yT,{associateTags:e=>c({organizationId:t,eventId:s,massEdit:{reset:!1,selecteds:{ids:[o]},slug:ze.Tag,strategy:hn.Replace,value:e}}),modalSubtitle:n("ajouter_des_tag_35833"),reload:e.reload,tags:e.delegation.tags})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(fT,{description:h}),(0,i.jsx)(_T,{privateNote:e.delegation.privateNote})]})]})]})})},bT=()=>{const{params:{organizationId:e,eventId:n,delegationId:t}}=Kl(),{data:s,loader:o,reload:a}=Li('query DelegationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: Delegation, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n delegation(id: $delegationId) {\n id\n organizationId\n eventId\n formId\n name\n description\n deadlineDate\n privateNote\n state\n numberOfResources\n maxResources\n numberOfMembersAccredited\n numberOfMembersWaitingAccreditation\n numberOfMembersRefusedAccreditation\n fields\n\n category: delegationCategory {\n id\n name\n }\n\n parent {\n id\n name\n }\n\n delegationsSpaceLayout {\n id\n name\n }\n\n form {\n id\n name\n }\n\n leaders {\n id\n email\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n\n picture {\n url\n }\n }\n\n tags {\n id\n name\n }\n\n usedCustomFields {\n ...CustomFieldWithCondition\n }\n }\n }\n}\n',{organizationId:e,eventId:n,delegationId:t},[$o.CustomFieldWithConditionFragment]);return o||(0,i.jsx)(CT,{customFields:s.organization.customFields.nodes,delegation:s.organization.delegation,reload:a})},AT=({children:e,isCurrent:n,to:t})=>{const s=n?"$primary500":"$gray500";return t?(0,i.jsx)(Xm,{css:{color:s},to:t,children:e}):(0,i.jsx)(Mr,{as:"span",css:{color:s},children:e})},ET=({css:e,children:n})=>{const t=V.Children.toArray(n).filter(V.isValidElement);return(0,i.jsx)(Tl,{align:"center",as:"nav",css:{color:"$gray300",fontSize:"$textSm",fontWeight:"$medium","& i":{fontSize:"12px"},...e},gap:"2",children:t.map((e,n)=>(0,i.jsxs)(V.Fragment,{children:[n>0&&(0,i.jsx)(Yl,{icon:"chevron-right",role:"presentation"}),e]},e.key??n))})},wT=e=>{switch(e){case $T.Event:return{color:"success",leftIcon:"calendar"};case $T.ParentDelegation:return{color:"pink",leftIcon:"people-group"};default:return Zl()}};var $T;!function(e){e.Event="event",e.ParentDelegation="parent-delegation"}($T||($T={}));const TT=({state:e,userInfo:n,onClick:t})=>{const s=Fi(),o=g(n.name);return(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},onClick:t,children:[(0,i.jsx)(sm,{shouldPreventDefault:!1,state:e,onClick:Bc.A}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(t_,{email:n.email,image:n.picture?.url,name:n.name,size:40}),(0,i.jsx)(Pl,{width:"4"}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Mr,{ellipsis:!0,color:"gray700",children:o?n.name:n.email}),o&&(0,i.jsx)(Mr,{ellipsis:!0,color:"gray500",children:n.email})]}),n.source&&(0,i.jsx)(Mr,{children:(0,i.jsx)(Ku,{...wT(n.source),leftIconStyle:"solid",children:n.source===$T.Event?s("_v_nement_22345"):s("d_l_gation_pare_68507")})})]})},zT=({availableMembers:e,select:n,usersInfosIds:t})=>(0,i.jsx)(i.Fragment,{children:e.map(e=>{const s=t.includes(e.id)?"checked":"unchecked";return(0,i.jsx)(TT,{state:s,userInfo:e,onClick:()=>{n(e.id)}},e.id)})}),OT=({delegationId:e,nameOrEmail:n,organizationId:t,usersInfosIds:s,select:o})=>{const{data:a,loader:r}=gl({organizationId:t,excludedDelegationId:e,name:g(n)?n:null});return r||(0,i.jsx)(zT,{availableMembers:a.organization.usersInfos.nodes,select:o,usersInfosIds:s})},RT=({delegationId:e,eventId:n,nameOrEmail:t,usersInfosIds:s,select:o})=>{const{data:a,loader:r}=Li("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:n,delegationId:e,name:g(t)?t:null},[$o.ExistingVolunteerFragment]);const d=(0,V.useMemo)(()=>{if(a.event){const e=a.event.volunteersRegistrations.nodes.map(e=>({...e.userInfo,source:$T.Event})),n=e.map(({id:e})=>e),t=a.event.delegation.parentUsersInfos.flatMap(e=>n.includes(e.id)?[]:[{...e,source:$T.ParentDelegation}]);return e.concat(t)}return[]},[a.event]);return r||(0,i.jsx)(zT,{availableMembers:d,select:o,usersInfosIds:s})},DT=({delegationId:e,eventId:n,organizationId:t,onClose:s,reload:o})=>{const a=Fi(),r=ki(oC),[d,l,c]=Wm(""),{mutate:u}=dr(),{mutate:m}=fl();return(0,i.jsx)(tb,{buttonText:a("ajouter_un_memb_33261"),icon:"sliders",initialValues:{usersInfosIds:[]},schema:r.adminAddSchema(),size:"md",subtitle:a(n?"ajouter_un_memb_95658":"ajouter_un_memb_89696"),title:a("add_member_to_delegation"),onClose:s,onSubmit:async i=>{n?await u({eventId:n,delegationId:e,selecteds:{ids:i.usersInfosIds}}):await m({organizationId:t,delegationId:e,selecteds:{ids:i.usersInfosIds}}),s(),o()},children:({form:s,values:o})=>{const r=e=>{s.change("usersInfosIds",Xo(o.usersInfosIds,e))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:a("rechercher_un_m_05904"),value:d,onChange:c}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(hc,{}),(0,i.jsx)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:n?(0,i.jsx)(RT,{delegationId:e,eventId:n,nameOrEmail:l,select:r,usersInfosIds:o.usersInfosIds}):(0,i.jsx)(OT,{delegationId:e,nameOrEmail:l,organizationId:t,select:r,usersInfosIds:o.usersInfosIds})})]})}})},MT=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{showNotification:o}=AS(),{mutate:a}=Rd();return(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_66412"),text:n("suppression_de_73669",e.delegation.name),onClose:e.onClose,onDelete:async()=>{await a({organizationId:t,eventId:s,selecteds:{ids:[e.delegation.id]}}),o(n("la_d_l_gation_31201",e.delegation.name)),e.onSuccess()}})},PT=e=>{const{params:{organizationId:n,eventId:t,delegationId:s},translate:o}=Kl();return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:Js.DELEGATIONS({organizationId:n,eventId:t}),children:o("d_l_gations_78318")}),(0,i.jsx)(AT,{to:Js.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name}),(0,i.jsx)(AT,{isCurrent:!0,to:Js.DELEGATION({organizationId:n,eventId:t,delegationId:s}),children:e.delegation.name})]})},kT=({delegation:e,reload:n})=>{const{history:t,translate:s,params:{organizationId:o,eventId:a,delegationId:r}}=Kl(),d=ki(Rv),{user:l}=Yi(),{showNotification:c}=AS(),{canDelegationEdit:u,canMemberAccredit:m,canMemberCreate:g}=oy(),{mutate:h}=Td(),{mutate:p}=or(),{mutate:I}=$a(),{mutate:x}=Dd(),[f,_]=(0,V.useState)(!1),[j,v]=(0,V.useState)(!1),S=e.lockedAt?.isValid;return(0,i.jsx)(Cy,{breadcrumbs:(0,i.jsx)(PT,{delegation:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[g&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",disabled:e.numberOfResources>=(e.maxResources??1/0),children:s("ajouter_un_memb_33261")})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(Pu,{icon:"user-plus",onClick:()=>{t.push(Rj.CREATE({organizationId:o,eventId:a,delegationId:r}))},children:s("ajouter_un_nouv_29283")}),(0,i.jsx)(Pu,{icon:"user-group",onClick:e=>{Tu(e.target),v(!0)},children:s("ajouter_des_mem_06922")})]})]}),u&&(0,i.jsx)(tc,{to:ss(Js.DELEGATION({organizationId:o,eventId:a,delegationId:e.id})),children:s("_diter_la_d_l_g_30300")}),(u||m)&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[a&&(0,i.jsx)(Pu,{download:`${e.name}-delegation-calendar`,icon:"arrow-down-to-bracket",target:"_blank",to:Ef(e.links.delegationCalendarLink,"pdf",{lang:l?.language}),children:s("t_l_charger_le_85972")}),m&&a&&(0,i.jsx)(Pu,{icon:"check",onClick:async()=>{await p({eventId:a,delegationId:e.id,selecteds:{scope:{delegationId:e.id}}}),n()},children:s("valider_les_acc_80801")}),u&&(0,i.jsx)(Pu,{icon:"paper-plane",onClick:()=>(async()=>{await x({organizationId:o,eventId:a,selecteds:{ids:[r]}}),c(s("l_e_mail_d_invi_08417"))})(),children:s("envoyer_l_e_mai_17491")}),u?S?(0,i.jsx)(Pu,{icon:"lock-keyhole-open",onClick:async()=>{await I({organizationId:o,eventId:a,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:ze.IsLocked,strategy:hn.Replace,value:!1}}),n()},children:s("d_verrouiller_67042")}):(0,i.jsx)(Pu,{icon:"lock-keyhole",onClick:async()=>{await I({organizationId:o,eventId:a,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:ze.IsLocked,strategy:hn.Replace,value:!0}}),n()},children:s("verrouiller_24528")}):null,u&&(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{const{delegationDuplicate:n}=await h({organizationId:o,eventId:a,delegationId:e.id});t.push(ss(Js.DELEGATION({organizationId:o,eventId:a,delegationId:n.id})))},children:s("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:u&&(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{_(!0)},children:s("supprimer_43083")})})]})]}),f&&(0,i.jsx)(MT,{delegation:e,onClose:()=>_(!1),onSuccess:()=>t.replace(a?Js.DELEGATIONS({organizationId:o,eventId:a}):yo.COMMUNITY_DELEGATIONS(o))}),j&&(0,i.jsx)(DT,{delegationId:e.id,eventId:a,organizationId:o,reload:n,onClose:()=>{v(!1)}})]}),name:e.name,nameSuffix:S&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"error600",fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"lock-keyhole"})})}),(0,i.jsx)(Dx,{placement:"top",children:s("cette_d_l_gatio_29556")})]}),subtext:s("_1_2_membres_04485",e.numberOfResources,d.toNumberOrInfinity(e.maxResources))})};var FT=t(6349);const NT=e=>({title:{display:!0,font:{weight:500},padding:{bottom:30},text:e}}),LT=()=>({border:{display:!1},grid:{color:Ar.colors.gray100.value}}),UT=({datasets:e,labels:n,options:t})=>{const s=(0,V.useMemo)(()=>(0,vc.A)("chart-"),[]),o=(0,V.useRef)(null),a={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:LT()}};return(0,V.useEffect)(()=>{o.current&&o.current.destroy(),o.current=new FT.Ay(document.getElementById(s),{type:"bar",options:(0,Fl.A)(a,t),data:{labels:n,datasets:e}})},[e,n,t]),(0,i.jsx)(Mr,{height:1,width:1,children:(0,i.jsx)("canvas",{id:s})})},VT=e=>{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>Vh(e.slots),[e.slots]),o=(0,V.useMemo)(()=>e.accreditation.hasSlots?s.map(e=>Uh(t,e,"",{accreditation:{includeName:!1}})):[e.accreditation.name],[s,e.accreditation]),a=(0,V.useMemo)(()=>{const t=s.some(e=>"number"==typeof e.maxResources),i=s.some(e=>"number"==typeof e.delegationsTotalResources&&e.delegationsTotalResources>0);return(0,kl.A)([e.accreditation.willAutoAccredit?null:{label:n("souhait_es_78101"),data:s.map(e=>e.wishedResources),backgroundColor:t?s.map(e=>e.assignedResources+e.wishedResources<=(e.maxResources??1/0)?Ar.colors.primary400.value:Vu(Ar.colors.primary400.value,.5)):Ar.colors.primary400.value},{label:n("affect_es_00048"),data:s.map(e=>e.assignedResources),backgroundColor:t?s.map(e=>e.assignedResources<=(e.maxResources??1/0)?Ar.colors.primary500.value:Vu(Ar.colors.error500.value,.7)):Ar.colors.primary500.value},{label:n("scann_es_13169"),data:s.map(e=>e.scannedResources),backgroundColor:Ar.colors.primary900.value},t?{label:n("maximum_56225"),data:s.map(e=>e.maxResources??1/0),backgroundColor:Ar.colors.gray200.value}:null,i?{label:n("total_attribu_e_97130"),data:s.map(e=>e.delegationsTotalResources??0),backgroundColor:Ar.colors.gray400.value}:null])},[s]);return(0,i.jsx)(UT,{datasets:a,labels:o,options:{scales:{y:{...LT(),ticks:{precision:0},...NT(n("nb_d_accr_dita_23359"))},x:{grid:{display:!1},...NT(n(e.accreditation.hasSlots?"slots_05517":"Accreditation"))}}}})},BT=e=>{const n=(0,V.useMemo)(()=>e.event.delegation.allAccreditationsSlots.filter(n=>n.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)(oT,{title:e.accreditation.name,children:(0,i.jsx)(Mr,{height:380,width:1,children:(0,i.jsx)(VT,{accreditation:e.accreditation,slots:n})})})},WT=e=>{const n=(0,V.useMemo)(()=>uh((0,Rg.A)(e.event.delegation.allAccreditations.map(e=>{const n=e.willAutoAccredit||e.accreditation.willAutoAccredit;return{...e.accreditation,willAutoAccredit:n}}),e=>e.id)),[e.event]);return(0,i.jsx)(Tl,{direction:"column",gap:"4",children:Yo(n)?n.map(n=>(0,i.jsx)(BT,{accreditation:n,event:e.event},n.id)):(0,i.jsx)(K$,{})})},GT=()=>{const{params:{eventId:e,delegationId:n}}=Kl(),{data:t,loader:s}=Li("query DelegationReporting($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n allAccreditations {\n accreditationId\n willAutoAccredit\n\n accreditation {\n id\n name\n accreditationCategoryName\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n allAccreditationsSlots {\n accreditationId\n maxResources\n assignedResources\n scannedResources\n wishedResources\n\n accreditationSlot {\n name\n date\n }\n }\n }\n }\n}\n",{eventId:e,delegationId:n},[]);return s||(0,i.jsx)(WT,{event:t.event})},qT=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=Kl(),{hasFeature:a}=XS(),{canAccreditationRead:r,canCustomFieldRead:d,canDocumentRead:l,canMemberAccredit:c,canMemberDelete:u,canMemberEdit:m,canPrint:g}=oy(),h=(0,V.useMemo)(()=>e.organization.allowDelegationSpaceDownload||Yo(e.organization.delegation.customDocuments??[]),[e.organization]),p=(0,V.useMemo)(()=>g&&!!e.organization.delegation.event?.weezeventEventId&&!!e.organization.delegation.event?.numberOfZplDocuments,[g,e.organization]),I=(0,V.useMemo)(()=>(e.organization.delegationsSpaceCustomBadges??[]).concat(e.organization.delegation.customDocuments.map(e=>e.slug)??[]),[e.organization]),x=(0,V.useMemo)(()=>e.organization.delegation.event?.customDocuments??[],[e.organization]),f=e=>({organizationId:e?":organizationId":t,eventId:s?e?":eventId":s:void 0,delegationId:e?":delegationId":o});return Au(e.organization.delegation.name),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(kT,{delegation:e.organization.delegation,reload:e.reload}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:Js.DELEGATION_DASHBOARD(f(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:Js.DELEGATION_MEMBERS(f(!1)),children:n("membres_125561",e.organization.delegation.numberOfResources)}),s&&a(Ze.Accreditation)&&(0,i.jsx)(Ey,{path:Js.DELEGATION_ACCREDITATIONS(f(!1)),children:n("accr_ditations_39450")}),s&&a(Ze.Accreditation)&&(0,i.jsx)(Ey,{path:Js.DELEGATION_REPORTING(f(!1)),children:"Reporting"}),s&&h&&(0,i.jsx)(Ey,{path:Js.DELEGATION_DOCUMENTS(f(!1)),children:n("Documents")})]}),(0,i.jsx)($y,{path:Js.DELEGATION_DASHBOARD(f(!0)),children:(0,i.jsx)(bT,{})}),(0,i.jsx)($y,{path:Js.DELEGATION_MEMBERS(f(!0)),children:s?(0,i.jsx)(yy,{children:(0,i.jsx)(h$,{campaigns:e.organization.delegation.campaigns,canDuplicateMembers:m,canEditColumns:!0,canMemberAccredit:c,canMemberDelete:u,canMemberEdit:m,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,customFieldsPrivacy:Ee.All,deleteFromEvent:!1,forDelegationsSpace:!1,getEditPath:n=>yo.EDIT_USER_FORM(t,s,n.userInfo.id,e.organization.delegation.formId),onlyVisibleAccreditationsSlots:!r,showAccreditationsEdit:c,showAccreditationsValidate:c,showCustomDocumentsColumns:l,showDeleteFromEvent:u,showDocumentsDownload:!0,showEditMode:m,showPrint:p})}):(0,i.jsx)(yy,{children:(0,i.jsx)(j$,{campaigns:e.organization.delegation.campaigns,canCustomFieldRead:d,canEditColumns:!0,canMemberDelete:u,canMemberEdit:m,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,getEditPath:e=>yo.COMMUNITY_EDIT_USER(t,e.id),showDocumentsDownload:!0,showEditMode:m})})}),(0,i.jsx)($y,{path:Js.DELEGATION_ACCREDITATIONS(f(!0)),children:(0,i.jsx)(yy,{children:(0,i.jsx)(X$,{canMemberAccredit:c,onlyVisible:!r})})}),(0,i.jsx)($y,{path:Js.DELEGATION_REPORTING(f(!0)),children:(0,i.jsx)(yy,{children:(0,i.jsx)(GT,{})})}),(0,i.jsx)($y,{path:Js.DELEGATION_DOCUMENTS(f(!0)),children:(0,i.jsx)(yy,{children:(0,i.jsx)(J$,{customDocuments:x,delegationsSpaceCustomBadges:I})})})]})]})},HT=()=>{const{params:{organizationId:e,eventId:n,delegationId:t}}=Kl(),{data:s,loader:o,reload:a}=Li("query Delegation(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n delegation(id: $delegationId) {\n id\n name\n formId\n numberOfResources\n maxResources\n columns\n parentId\n lockedAt\n\n delegationCategory {\n id\n name\n }\n\n campaigns {\n id\n name\n }\n\n customDocuments {\n slug\n name\n }\n\n event {\n customDocuments {\n slug\n name\n }\n numberOfZplDocuments\n weezeventEventId\n }\n\n links {\n delegationCalendarLink\n }\n }\n }\n}\n",{organizationId:e,eventId:n,delegationId:t},[$o.OrganizationCustomFieldsFragment]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:Js.DELEGATION({organizationId:":organizationId",eventId:n?":eventId":void 0,delegationId:":delegationId"}),children:(0,i.jsx)(qi,{path:Js.DELEGATION_DASHBOARD({organizationId:e,eventId:n,delegationId:t}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qT,{organization:s.organization,reload:a})})]})},YT=({backgroundColor:e,button:n,iconColor:t,value:s,icon:o,text:a})=>(0,i.jsxs)(Tl,{css:{backgroundColor:e??"$white",bd:!0,flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Tl,{css:{borderBottom:n?"1px solid $gray200":"none",padding:"$6"},direction:"column",children:[o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nb,{color:t??"primary",icon:o}),(0,i.jsx)(Pl,{height:"6"})]}),(0,i.jsx)(Mr,{color:"gray500",children:a}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:s})]}),n&&(0,i.jsx)(Tl,{css:{background:"$gray50",padding:"$4 $6"},gap:"4",justify:"end",children:n})]}),ZT=e=>{const n=Fi(),[t,s,o]=Wm(""),{data:a,loader:r}=Li("query CollaboratorsVolunteers($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n event(id: $eventId) {\n collaborators(name: $name) {\n userInfo(organizationId: $organizationId) {\n ...LeaderUserInfo\n }\n }\n\n volunteersRegistrations(name: $name, limit: 50) {\n nodes {\n userInfo {\n ...LeaderUserInfo\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,name:g(s)?s:void 0},[$o.LeaderUserInfoFragment]);const[d,l]=(0,V.useState)(!1),[c,u]=(0,V.useState)(null),[m,h]=(0,V.useState)(null),{styles:p,attributes:I,update:x}=(0,ku.E)(c,m,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,8]}}]}),f=(0,V.useMemo)(()=>c?.getBoundingClientRect().width??100,[c]),_=(0,V.useMemo)(()=>{const n=n=>void 0!==e.currentLeaders.find(e=>e.userInfo.id===n),t=(a.event?.collaborators??[]).map(({userInfo:e})=>e.id);return(a.event?.collaborators??[]).map(({userInfo:e})=>({...e,isAdmin:!0,isDisabled:n(e.id)})).concat((a.event?.volunteersRegistrations.nodes??[]).filter(({userInfo:e})=>!t.includes(e.id)).map(({userInfo:e})=>({...e,isAdmin:!1,isDisabled:n(e.id)})))},[a.event,e.currentLeaders]);return(0,V.useEffect)(()=>{x?.()},[x,d,c,_]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tl,{ref:u,onClick:e=>{jc(e),l(!d)},children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_17775"),value:t,onChange:o})}),(0,i.jsx)(Tl,{ref:h,css:{background:"white",border:"1px solid $gray100",borderRadius:"$2",boxShadow:"$md",display:d?"flex":"none",maxHeight:"360px",overflowY:"auto",py:"$2",zIndex:1e3,...p.popper},direction:"column",width:f,onClick:e=>{jc(e)},...I.poppeer,children:r||_.map(t=>(0,i.jsxs)(Tl,{align:"center",css:{cursor:t.isDisabled?"initial":"pointer",padding:"10px $4",userSelect:"none","&:hover":{background:t.isDisabled?"inherit":"$primary100"}},gap:"3",children:[(0,i.jsx)(My,{badge:t.isAdmin&&(0,i.jsx)(Ku,{color:"primary",children:n("administrateur_38490")}),disabled:t.isDisabled,userInfo:t}),!t.isDisabled&&(0,i.jsx)(tc,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(t)}})]},t.id))})]})},KT=e=>{const n=Fi();return(0,i.jsxs)(Tl,{align:"center",gap:"5",children:[(0,i.jsx)(Mr,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(My,{userInfo:e.leader.userInfo})}),(0,i.jsx)(Mr,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(Up,{shouldParseAsInt:!0,value:e.leader.role.id,onChange:n=>{e.onRoleChange(n)},children:e.roles.map((e,t)=>(0,i.jsx)("option",{value:e.id,children:n(e.name)},t))})}),(0,i.jsx)(Mr,{color:"gray500",css:{cursor:"pointer",width:"$6",padding:"$1"},onClick:e.onDelete,children:(0,i.jsx)(Yl,{icon:"trash-can"})})]})},XT=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.currentLeaders),o=e.roles[0];return(0,i.jsxs)(dg,{size:"lg",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"user-gear"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("modification_de_24714")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("les_responsable_92946")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(ZT,{currentLeaders:t,eventId:e.eventId,organizationId:e.organizationId,onAdd:e=>{s(t.concat([{userInfo:e,role:o}]))}}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:t.map((n,o)=>(0,i.jsx)(KT,{leader:n,roles:e.roles,onDelete:()=>{s((0,Ju.A)(t,n))},onRoleChange:n=>{s((0,dp.jM)(t=>{t[o].role=e.roles.find(e=>e.id===n)}))}},n.userInfo.id))}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{onClick:()=>{e.onSave(t.map(e=>({userInfoId:e.userInfo.id,roleId:e.role.id})))},children:n("enregistrer_06519")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},QT=({leaders:e})=>{const{translate:n}=Kl(),{designSystem:t}=Em(),s=t===bm?({children:e})=>(0,i.jsx)(Tl,{direction:"column",width:1,children:e}):({children:e})=>(0,i.jsx)(i.Fragment,{children:e});return Yo(e)?(0,i.jsx)(s,{children:e.map((e,t)=>(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(oI,{height:"4"}),(0,i.jsx)(My,{badge:(0,i.jsx)(Ku,{color:"gray",children:n(e.role.name)}),userInfo:e.userInfo})]},e.userInfo.id))}):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_reponsabl_38504")})},JT=e=>{const{translate:n,params:t,params:{organizationId:s,eventId:o}}=Kl(),{canPositionEdit:a,canDelegationEdit:r}=oy(),d=(0,V.useMemo)(()=>(t.positionId||t.positionCategoryId)&&a||(t.delegationId||t.delegationCategoryId)&&r,[r,a,t]),[l,c]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oT,{rightIcon:d?"pen":void 0,rightIconClick:()=>{c(!0)},title:n("reponsable_82458_plural"),children:(0,i.jsx)(QT,{leaders:e.leaders})}),d&&l&&(0,i.jsx)(XT,{currentLeaders:e.leaders,eventId:o,organizationId:s,roles:e.roles,onClose:()=>{c(!1)},onSave:async n=>{await e.onSave(n),e.reload()}})]})},ez=e=>{const n=Fi();return"onSave"in e?(0,i.jsx)(JT,{...e}):(0,i.jsx)(oT,{title:n("reponsable_82458_plural"),children:(0,i.jsx)(QT,{leaders:e.leaders})})},nz=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,delegationCategoryId:o}}=Kl(),[a,r,d]=Wm(""),[l,c]=(0,V.useState)(0),{data:u,isLoading:m}=Li("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:t,eventId:s,level:s?xn.Event:xn.Organization,delegationCategoryId:o,name:g(r)?r:void 0,offset:l},[]);const{numberOfPages:h,totalCount:p}=Sx(u.organization?.delegations);return(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_une_31213"),value:a,onChange:d})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("nom_de_la_d_l_g_28087")}),(0,i.jsx)(Gm,{children:n("State")})]}),numberOfPages:h,offset:l,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):u.organization.delegations.nodes.map(o=>(0,i.jsxs)(km,{css:{cursor:"pointer"},onClick:()=>{e.push(Js.DELEGATION({organizationId:t,eventId:s,delegationId:o.id}))},children:[(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:o.name})}),(0,i.jsx)($m,{children:(0,i.jsx)(Ku,{...sC(o.state),children:n(o.state)})})]},o.id)),setOffset:c,title:n("liste_des_d_l_g_86270"),totalCount:p})},tz=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationCategoryId:o}}=Kl(),{roles:a}=XS(),{mutate:r}=function(e={}){return Ui("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)(yy,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{gap:"6",width:1,children:[(0,i.jsx)(YT,{text:n("nombre_de_d_l_g_45708"),value:e.delegationCategory.numberOfDelegations}),(0,i.jsx)(YT,{text:n("number_of_membe_24698"),value:e.delegationCategory.numberOfResources})]}),(0,i.jsx)(Tl,{children:(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(nz,{})})}),s&&(0,i.jsx)(Tl,{children:(0,i.jsx)(ez,{leaders:e.delegationCategory.leaders,reload:e.reload,roles:a.delegationCategoryRoles,onSave:e=>r({organizationId:t,eventId:s,massLeaders:{leaders:e,selecteds:{ids:[o]},strategy:hn.Replace}})})})]})})},iz=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("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)(ow,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954"),n("cela_supprimera_35330")],text:n("suppression_de_73669",e.delegationCategory.name),onClose:e.onClose,onDelete:async()=>{await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategoryId:e.delegationCategory.id}),e.onSuccess()}})},sz=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl();return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:Js.DELEGATIONS({organizationId:n,eventId:t}),children:s("d_l_gations_78318")}),(0,i.jsx)(AT,{isCurrent:!0,to:Js.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:e.category.id}),children:e.category.name})]})},oz=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{canDelegationEdit:a}=oy(),{mutate:r}=function(e={}){return Ui("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,l]=(0,V.useState)(!1);return(0,i.jsx)(Cy,{breadcrumbs:(0,i.jsx)(sz,{category:e.category}),buttons:(0,i.jsxs)(i.Fragment,{children:[a&&(0,i.jsx)(tc,{color:"white",onClick:()=>n.push(Js.DELEGATION_CATEGORY_UPDATE({organizationId:s,eventId:o,delegationCategoryId:e.category.id})),children:t("_diter_62574")}),a&&(0,i.jsx)(tc,{onClick:()=>{n.push(o?yo.CREATE_DELEGATION(s,o,e.category.id):yo.COMMUNITY_CREATE_DELEGATION(s,e.category.id))},children:t("ajouter_une_d_l_79133")}),a&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"copy",onClick:async()=>{const{delegationCategoryDuplicate:{id:t}}=await r({organizationId:s,eventId:o,delegationCategoryId:e.category.id});n.push(Js.DELEGATION_CATEGORY({organizationId:s,eventId:o,delegationCategoryId:t}))},children:t("dupliquer_28256")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:t("supprimer_43083")})})]})]}),d&&(0,i.jsx)(iz,{delegationCategory:e.category,eventId:o,organizationId:s,onClose:()=>{l(!1)},onSuccess:()=>{n.replace(Js.DELEGATIONS({organizationId:s,eventId:o}))}})]}),name:e.category.name,subtext:t("_1_d_l_gation_80027_plural",e.category.numberOfDelegations)})},az=()=>{const{translate:e,params:{organizationId:n,eventId:t,delegationCategoryId:s}}=Kl(),o=ki(Oh),a=ki(I$),{canDocumentRead:r,canMemberAccredit:d,canMemberDelete:l,canMemberEdit:c}=oy(),[u,m,g]=Yb(n,"delegationCategoryMembers.columns",["name","delegations"]),[h,p,I]=Yb(n,"delegationCategoryMembers.limit",Tm),[x,f,_]=Yb(n,"delegationCategoryMembers.predicates",[]),j=(0,V.useMemo)(()=>xg(x),[x]),[v,S,y]=Yb(n,"delegationCategoryMembers.sort",null),{data:C,isLoading:b}=Li("query DelegationCategoryMembersInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $loadCustomDocuments: Boolean!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n customDocuments @include(if: $loadCustomDocuments) {\n ...CustomDocumentPopulation\n }\n }\n }\n}\n",{organizationId:n,eventId:t,loadCustomDocuments:!!t&&r},[$o.SegmentCustomFieldFragment,$o.CustomDocumentPopulationFragment]),A=g||I||_||y||b,E=(0,V.useMemo)(()=>C.organization?.customFields.nodes??[],[C.organization]),w=Kb(E),$=(0,V.useMemo)(()=>C.organization?t?o.getDelegationCategoryMembersFilters(n,t,E,C.organization.event,C.organization?.event?.isWeezeventConnected??!1):a.getDelegationMembersFilters(E):[],[t,E]),T=(0,V.useMemo)(()=>t?o.getDelegationCategoryMembersPossibleColumns(n,E,C.organization?.event?.customDocuments??[],{hasCustomDocuments:r,isWeezeventConnected:C.organization?.event?.isWeezeventConnected??!1}):a.getDelegationMembersPossibleColumns(E),[n,t,E,C,r]);return A?(0,i.jsx)(Ql,{}):(0,i.jsx)(yy,{children:(0,i.jsx)(Cx,{columns:u,columnsSearch:[],columnsToIncludes:t?zh:p$,eventId:t,filters:$,getMassActionId:e=>t?e.userInfo.id:e.id,limit:h,loadDataList:t?hr:Ya,loadDataListParams:{delegationCategoryId:s,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:t?gr:qa,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:n,possibleColumns:T,predicates:j,renderActions:(e,n,o)=>(0,i.jsx)(i$,{campaigns:[],canMemberEdit:c,customFields:E,deleteFromEvent:!1,massActions:e,predicates:j,scope:{delegationCategoryId:s},showAccreditationsEdit:!1,showAccreditationsValidate:!!t&&d,showDelete:!!t&&l,showPrint:!1,showWishedAccreditationsEdit:!1,showWishedProfileEdit:!1,sort:v,totalCount:n,onMassEditSuccess:o}),renderAllSelectedText:n=>e("les_1_membres_80039",n),renderPageSelectedText:n=>e("les_1_membres_00895",n),renderSelectAllText:n=>e("s_lectionner_le_81345",n),rendering:xh.List,setColumns:m,setLimit:p,setPredicates:f,setSort:S,showEditColumns:!0,showEditMode:c,showFilters:!0,showMassActions:c,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,showSelectAll:!0,sort:v,children:(0,i.jsx)(kx,{renderCell:(e,n,s)=>t?(0,i.jsx)(pE,{canChangeDelegation:!0,canMemberAccredit:!0,canMemberAssign:!1,column:e,customField:w.get(e.slug),eventId:t,reloadRow:s,row:n}):(0,i.jsx)(f$,{column:e,customField:w.get(e.slug),reloadRow:s,row:n,updatable:!0})})})})},rz=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationCategoryId:o}}=Kl(),a=e=>({organizationId:e?":organizationId":t,eventId:s?e?":eventId":s:void 0,delegationCategoryId:e?":delegationCategoryId":o}),r=e.organization.delegationCategory;return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(oz,{category:r,reload:e.reload}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:Js.DELEGATION_CATEGORY_DASHBOARD(a(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:Js.DELEGATION_CATEGORY_MEMBERS(a(!1)),children:n("membres_125561",r.numberOfResources)})]}),(0,i.jsx)($y,{path:Js.DELEGATION_CATEGORY_DASHBOARD(a(!0)),children:(0,i.jsx)(tz,{delegationCategory:r,reload:e.reload})}),(0,i.jsx)($y,{path:Js.DELEGATION_CATEGORY_MEMBERS(a(!0)),children:(0,i.jsx)(az,{})})]})]})},dz=e=>{const{params:{organizationId:n,eventId:t,delegationCategoryId:s}}=Kl(),{data:o,loader:a,reload:r}=Li("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:n,delegationCategoryId:s},[$o.LeaderInfosFragment]);return a||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:Js.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(qi,{path:Js.DELEGATION_CATEGORY_DASHBOARD({organizationId:n,eventId:t,delegationCategoryId:s}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(rz,{organization:o.organization,reload:r})})]})},lz=()=>{const e=Fi();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{alertStyle:"primary",children:(0,i.jsx)(uc,{children:e("votre_import_es_05273")})}),(0,i.jsx)(Pl,{height:"6"})]})};let cz=class extends Rc{constructor(e){super(e)}schema(){const e=this.t("le_document_est_86403");return zc.Ik().shape({acl:zc.Yj().required(e),key:zc.Yj().required(e).test("is-a-zip",this.t("le_fichier_n_es_91526"),e=>fv(uv(e).extension)===hv.Zip),name:zc.Yj().required(e),file:zc.gl().test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],cz);let uz=class extends Rc{documentInputService;archiveInputService;constructor(e,n,t){super(t),this.documentInputService=e,this.archiveInputService=n}default(){return{input:{archive:this.documentInputService.documentInputDefault(),fieldId:-1}}}schema(){return zc.Ik().shape({input:zc.Ik().shape({archive:this.archiveInputService.schema(),fieldId:zc.Yj().required(this.t("le_champ_person_80074")).typeError(this.t("le_champ_person_80074"))})})}};uz=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[wC,cz,Di])],uz);const mz=()=>{const{translate:e,params:{organizationId:n}}=Kl();return(0,i.jsx)(sf,{heading:e("votre_fichier_d_51776"),subtitle:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("s_lectionnez_vo_27155",Rv.bytesToGigabytes(lv),Rv.bytesToMegabytes(2e7))}}),children:(0,i.jsx)(PC,{accept:gv.Archives,acl:"private",organizationId:n,prefix:"input.archive.",withFileField:!0})})},gz=({customFields:e})=>{const n=Fi();return(0,i.jsx)(sf,{heading:n("correspondance_10480"),subtitle:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:n("_ditez_la_corre_24969")}}),children:(0,i.jsxs)(ny,{label:n("sur_quel_champ_17516"),name:"input.fieldId",children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionnez_un_82446")}),e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})},hz=({customFileFields:e})=>(0,i.jsx)(gz,{customFields:e}),pz=e=>!!e.getFieldState("input.archive.key")?.valid&&!!e.getFieldState("input.archive.file")?.valid,Iz=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl(),s=ki(uz),o=ki(Ol),a=(0,V.useRef)(null),{data:r,loader:d}=Li("query FilesImportCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFileFields: customFields(eventId: $eventId, variety: UserInfo, fieldTypes: [File]) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n}\n",{organizationId:n,eventId:t},[$o.CustomFieldImportFragment]),{mutate:l}=function(e={}){return Ui("mutation FilesImport(\n $organizationId: OrganizationId!\n $eventId: EventId\n $input: FilesImportInput!\n) {\n jobId: filesImport(organizationId: $organizationId, eventId: $eventId, input: $input)\n}\n",e)}(),{checkFilesImport:c}=AS();return d||(0,i.jsx)(xc,{customErrorRef:a,height:1,initialValues:{input:s.default().input},render:({form:s,handleSubmit:o,submitting:d,values:l})=>(0,i.jsx)(Hx,{button:(0,i.jsx)(tc,{isLoading:d,onClick:o,children:e("importer_la_lis_12866")}),category:e("importe_des_fic_85041"),color:"dark",fallbackClosePath:t?yo.VOLUNTEERS(n,t):hs.COMMUNITY_USERS({organizationId:n}),heading:e("nouvel_import_48306"),children:(0,i.jsxs)(Gx,{ref:a,children:[s.getState().submitSucceeded&&(0,i.jsx)(lz,{}),(0,i.jsx)(hc,{}),(0,i.jsxs)(Tl,{direction:"column",gap:"5",children:[(0,i.jsx)(mz,{}),l.input.archive?.file&&pz(s)&&(0,i.jsx)(hz,{customFileFields:r.organization.customFileFields.nodes})]})]})}),validate:o.validateForForm(s.schema()),onSubmit:async({input:e})=>{const i=(e=>{const n={...e.archive};return delete n.file,{...e,archive:n}})(e);try{const{jobId:e}=await l({organizationId:n,eventId:t,input:i});a.current&&(a.current.scrollTop=0),c(e,n,t)}catch{}}})},xz=e=>{const{translate:n}=Kl(),{data:t}=ka({organizationId:e.organizationId}),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)([]),d=(0,V.useMemo)(()=>(0,Lm.A)((t.organization?.events.nodes??[]).filter(n=>n.id!==e.eventId),e=>u(e.name)),[t.organization,e.eventId]);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"clone",children:n("dupliquer_vers_48809")}),(0,i.jsxs)(hx,{gap:"6",children:[(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("toutes_les_info_60876")}),(0,i.jsx)(uc,{children:n("certains_param_76352")})]}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("sur_quel_v_nem_94155"),renderOnPortal:!0,values:a,onChange:r,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:Zo(a),isLoading:s,onClick:async()=>{o(!0),await e.onSuccess(a[0]),e.onClose()},children:n("dupliquer_28256")})})]})})},fz=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{canFormEdit:o}=ay(),{showNotification:a}=AS(),{mutate:r}=function(e={}){return Ui("mutation FormDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $newEventId: EventId\n) {\n formDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n newEventId: $newEventId\n ) {\n id\n }\n}\n",e)}(),{mutate:d}=function(e={}){return Ui("mutation FormDelete($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n formDelete(organizationId: $organizationId, eventId: $eventId, formId: $formId) {\n id\n }\n}\n",e)}(),[l,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1),g=(0,V.useCallback)(n=>r({organizationId:t,eventId:s,formId:e.form.id,newEventId:n}),[s,r,t,e.form]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"6",width:1,children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(Xm,{to:$s.FORM_ELEMENTS({organizationId:t,eventId:s,formId:e.form.id}),children:e.form.name})}),(0,i.jsxs)(Mr,{color:"gray500",children:[n("nombre_de_champ_91879")," ",(0,i.jsx)(mf,{color:"gray800",children:e.form.numberOfCustomFields})]}),(0,i.jsx)(ly,{permissions:sy.FORM_EDIT,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[e.canDuplicate&&(0,i.jsx)(Pu,{icon:"clone",onClick:async n=>{jc(n),await r({organizationId:t,eventId:s,formId:e.form.id}),e.reload()},children:n("dupliquer_28256")}),o&&s&&e.canDuplicate&&(0,i.jsx)(Pu,{icon:"clone",onClick:()=>c(!0),children:n("dupliquer_sur_u_11076")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{jc(e),m(!0)},children:n("supprimer_43083")})})]})]})})]}),l&&(0,i.jsx)(xz,{eventId:s,organizationId:t,onClose:()=>c(!1),onSuccess:g}),u&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_75358"),text:n("suppression_de_73669",e.form.name),onClose:()=>m(!1),onDelete:async()=>{await d({organizationId:t,eventId:s,formId:e.form.id}),a(n("le_formulaire_76783",e.form.name)),e.reload()}})]})};let _z=class extends Rc{constructor(e){super(e)}formInputDefault(){return{name:""}}formInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_est_requ_61536"))})}createFormSchema(){return zc.Ik().shape({form:this.formInputSchema()})}};_z=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],_z);const jz=e=>{const n=Fi(),t=ki(_z),{mutate:s}=function(e={}){return Ui("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)(tb,{buttonText:n("cr_er_le_formul_42369"),icon:"sliders",initialValues:{form:t.formInputDefault()},schema:t.createFormSchema(),size:"md",title:n("nouveau_formula_44488"),onClose:e.onClose,onSubmit:async n=>{const{formCreate:t}=await s({organizationId:e.organizationId,eventId:e.eventId,form:n.form});e.onSuccess(t.id)},children:(0,i.jsx)($c,{label:n("nom_du_formulai_14952"),name:"form.name"})})},vz=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{canFormEdit:a}=oy(),[r,d]=(0,V.useState)(e.isCreateOpen);return(0,i.jsxs)(by,{gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:t("Form_plural")}),e.isSearchVisible&&(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:t("rechercher_un_f_28561"),value:e.name,onChange:e.setName})}),a&&e.canCreateNewForm&&(0,i.jsx)(tc,{onClick:()=>{d(!0)},children:t("cr_er_un_formul_78352")}),r&&(0,i.jsx)(jz,{eventId:o,organizationId:s,onClose:()=>{d(!1)},onSuccess:e=>{n.push($s.FORM_ELEMENTS({organizationId:s,eventId:o,formId:e}))}})]})},Sz=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$2",height:72,width:1})]}),yz=e=>{const{translate:n}=Kl(),{event:t}=BS(),{hasFeature:s}=XS();Au(`${t?.name??n("communaut_20896")} ${n("Form_plural")}`);const[o,a]=(0,V.useState)(""),r=(0,V.useMemo)(()=>g(o)?e.forms.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.id.toString(10)===o):e.forms,[e.forms,o]),d=(0,V.useMemo)(()=>0===e.forms.length||s(Ze.Multiform),[e.forms]);return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(vz,{canCreateNewForm:d,isCreateOpen:e.isCreateOpen,isSearchVisible:Yo(e.forms),name:o,setName:a}),(0,i.jsx)(yy,{children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Sz,{})]}):0===e.forms.length?(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(UE,{subtitle:n("cr_er_vos_formu_26049"),title:n("aucun_formulair_74743")})}):(0,i.jsxs)(i.Fragment,{children:[!d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("vous_avez_attei_23858")}),(0,i.jsx)(uc,{children:n("votre_abonnemen_18069")})]}),(0,i.jsx)(Pl,{height:"7"})]}),r.map(n=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(fz,{canDuplicate:d,form:n,reload:e.reload}),(0,i.jsx)(Pl,{height:"3"})]},n.id))]})})]})},Cz=e=>{const{organizationId:n,eventId:t}=Vi(),{data:s,isLoading:o,reload:a}=Nd({organizationId:n,level:xn.Event,eventId:t}),r=(0,V.useMemo)(()=>(0,Lm.A)(s.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[s.organization]);return(0,i.jsx)(yz,{forms:r,isCreateOpen:e.isCreateOpen,isLoading:o,reload:a})},bz=e=>{const{organizationId:n}=Vi(),{data:t,isLoading:s,reload:o}=Nd({organizationId:n,level:xn.Organization}),a=(0,V.useMemo)(()=>(0,Lm.A)(t.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[t.organization]);return(0,i.jsx)(yz,{forms:a,isCreateOpen:e.isCreateOpen,isLoading:s,reload:o})};var Az=t(5848);const Ez=e=>{const{translate:n}=Kl(),{isLoading:t,copy:s}=cS(),o=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("script",{async:!0,defer:!0,src:`https://${F.HEAVENT_PUBLIC_URL.subdomain}.${F.WEEZEVENT_DOMAIN}/weez.js`,type:"text/javascript"}),(0,i.jsx)("a",{className:"weezevent-widget-integration grootlink","data-iframe-background":"transparent","data-type":"groot",href:e.link,children:"WeezCrew"})]});return(0,i.jsxs)(Tl,{direction:"column",gap:"7",children:[e.alert,(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(dc,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.iframeLabel}),(0,i.jsx)(Mr,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)("code",{children:(0,Az.renderToStaticMarkup)((0,i.jsx)(o,{}))})})]}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:t,leftIcon:"copy",onClick:()=>s((0,Az.renderToStaticMarkup)((0,i.jsx)(o,{}))),children:n("copier_75889")})})]})]})},wz=e=>{const{translate:n}=Kl(),{isLoading:t,copy:s}=cS();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"end",gap:"5",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(dc,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.heading}),(0,i.jsx)(Mr,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)(Xm,{css:{inlineSize:"max-content",fontWeight:"normal",textDecoration:"underline"},hideIcon:!0,to:e.link,children:e.link})})]}),(0,i.jsx)(tc,{isLoading:t,leftIcon:"copy",onClick:()=>s(e.link),children:n("copier_75889")})]}),(0,i.jsxs)(Tl,{align:"center",css:{bd:!0,borderRadius:"$1",padding:"$6 $8"},direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{align:"center",direction:"column",children:[(0,i.jsx)(dc,{children:n("qr_code_60722")}),(0,i.jsx)(rc,{textStyle:"subtitle",children:e.qrCodeDescription})]}),(0,i.jsx)(Mr,{height:120,width:120,children:(0,i.jsx)("img",{height:"100%",src:bf(e.link,{height:120,width:120}),width:"100%"})}),(0,i.jsx)(tc,{download:"qr-code",to:bf(e.link,{height:120,width:120}),children:n("t_l_charger_le_18439")})]})]})},$z=({children:e,isActive:n,onClick:t,replace:s=!0,to:o})=>{const a=Wi(),r=n?.(a.pathname)??a.pathname===o;return(0,i.jsx)(Tl,{align:"center",css:{borderBottom:r?"2px solid $primary500":"2px solid transparent",borderTop:"2px solid transparent",color:r?"$primary500":"$gray500",fontWeight:"$medium",px:"$3",userSelect:"none"},height:1,children:(0,i.jsx)(ql,{height:1,replace:s,to:o,width:1,onClick:async()=>{t&&await t()},children:e})})},Tz=e=>(0,i.jsx)(Tl,{as:El.Nav,css:{borderBottom:"1px solid $gray200"},gap:"2",height:e.height,justify:"center",role:"menubar",width:e.width,children:e.children}),zz=()=>{const{translate:e,params:n}=Kl();return(0,i.jsxs)(Tz,{height:1,width:1,children:[(0,i.jsx)($z,{to:$s.FORM_ELEMENTS(n),children:e("champs_91671")}),(0,i.jsx)($z,{isActive:e=>null!==e.match(/\/form\/\d+\/parameters/),to:$s.FORM_PARAMETERS_GENERAL(n),children:e("param_tres_78420")}),(0,i.jsx)($z,{to:$s.FORM_INTEGRATION(n),children:e("int_gration_10662")}),(0,i.jsx)($z,{to:$s.FORM_EMAILS(n),children:e("mod_les_e_mail_91257")}),(0,i.jsx)($z,{to:$s.FORM_PREVIEW(n),children:e("aper_u_25595")})]})},Oz=e=>{const{translate:n}=Kl(),{canFormEdit:t}=oy();return(0,i.jsx)(Hx,{button:t&&e.button,category:n("cr_ation_d_un_f_67278"),color:"dark",heading:e.title,onClose:e.onClose,children:(0,i.jsxs)(eu,{gridtemplatecolumns:"1fr",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(zz,{}),(0,i.jsx)(Mr,{css:{overflowY:"auto"},children:e.children})]})})},Rz=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,formId:o}}=Kl(),{data:a}=Ld({organizationId:t,formId:o});Au(a.organization?.form.name??"");const r=yf({organizationId:t,eventId:s,formId:o});return(0,i.jsx)(Oz,{title:a.organization?.form.name??"-",onClose:()=>{e.push($s.FORMS({organizationId:t,eventId:s}))},children:(0,i.jsx)(Tl,{justify:"center",width:1,children:(0,i.jsxs)(Tl,{css:{paddingBlockStart:"$8"},gap:"8",width:"$container",children:[(0,i.jsx)(Tl,{direction:"column",gap:"6",children:(0,i.jsx)(wz,{heading:n("FormLink"),link:r,qrCodeDescription:n("facilitez_la_co_59826")})}),(0,i.jsx)(Tl,{direction:"column",gap:"6",children:(0,i.jsx)(Ez,{alert:(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("comment_marche_73229")}),(0,i.jsx)(uc,{children:n("ce_code_va_vous_31197")})]}),heading:n("iframe_27513"),iframeLabel:n("code_html_pour_12471"),link:r})})]})})})},Dz=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,formId:o}}=Kl(),{data:a}=Ld({organizationId:t,formId:o});Au(a.organization?.form.name??"");const[r,d]=(0,V.useState)("opened"),l=yf({organizationId:t,eventId:s,formId:o,query:{preview:!0,previewState:r}});return(0,i.jsx)(Oz,{title:a.organization?.form.name??"-",onClose:()=>{e.push($s.FORMS({organizationId:t,eventId:s}))},children:(0,i.jsxs)(Tl,{align:"center",direction:"column",height:1,width:1,children:[(0,i.jsxs)(Tl,{direction:"column",width:"$container",children:[(0,i.jsx)(Pl,{height:"8"}),(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textLg semiBold",children:n("aper_u_du_formu_51076")}),(0,i.jsx)(Mr,{color:"gray500",children:n("pr_visualiser_v_58073")})]}),(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{value:r,onChange:e=>{d(e)},children:[(0,i.jsx)("option",{value:"opened",children:n("Opened")}),(0,i.jsx)("option",{value:"closed",children:n("cl_tur_79063")}),(0,i.jsx)("option",{value:"blocked",children:n("acc_s_r_fus_68875")})]})})]})]}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)("iframe",{height:"100%",src:l,style:{border:"none"},width:"100%"})})]})})},Mz=e=>{const{history:n,translate:t}=Kl();return(0,i.jsx)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"triangle-exclamation",children:t("changements_non_17558")}),(0,i.jsx)(hx,{children:(0,i.jsxs)(Tl,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:t("voulez_vous_qui_84408")}),(0,i.jsx)(Mr,{color:"gray500",children:t("des_donn_es_ne_27178")})]})}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{color:"error",onClick:()=>n.goBack(e.fallbackPath),children:t("quitter_sans_sa_28486")})})]})})},Pz=e=>(0,St.createPortal)((0,i.jsx)(Mr,{css:{background:"$gray50",inset:0,position:"fixed",zIndex:"100"},children:e.children}),document.body),kz=br("div",{alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",overflow:"hidden",userSelect:"none",variants:{color:{primary:{background:"$primary500",color:"white","& > .h-button-dropdown-content":{border:"1px solid $primary500",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $primary500",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0",borderLeft:"1px solid $primary600"},"& > .h-button-dropdown-content:hover":{background:"$primary600",border:"1px solid $primary600",borderRight:"none"},"& > .h-button-dropdown-icon:hover":{background:"$primary600",border:"1px solid $primary600"}},white:{background:"white",color:"$gray700","& > .h-button-dropdown-content":{border:"1px solid $gray300",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $gray300",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},"& > .h-button-dropdown-content:hover":{background:"$gray50",color:"$gray800"},"& > .h-button-dropdown-icon:hover":{background:"$gray50",color:"$gray800"}}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}}},defaultVariants:{color:"primary",size:"md"}}),Fz=V.forwardRef((e,n)=>{const{history:t}=Kl();return(0,i.jsxs)(kz,{color:e.color,size:e.size,children:[(0,i.jsx)(Tl,{ref:n,align:"center",className:"h-button-dropdown-content",css:{flex:"1",px:"$4"},height:1,onClick:n=>{e.onClick&&e.onClick(n),g(e.path)&&t.push(e.path)},children:e.children}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Tl,{align:"center",className:"h-button-dropdown-icon",height:40,justify:"center",width:40,children:(0,i.jsx)(Yl,{icon:"chevron-down"})})}),(0,i.jsx)(Fu,{placement:"bottom-end",renderOnPortal:!0,children:e.menu})]})]})});Fz.displayName="ButtonDropdown";let Nz=class extends Rc{documentInputService;constructor(e,n){super(n),this.documentInputService=e}customFieldInputDefault(e,n){const t=e?.fieldType??Qe.Text,i=e?.fieldSubtype??Xe.Freeform;return{name:e?.name??"",label:e?.label??"",customFieldCategoryId:e?.customFieldCategoryId??n[0].id,description:e?.description??"",variety:e?.variety??Te.UserInfo,fieldType:t,fieldSubtype:i,listType:e?.listType??un.Default,fileType:e?.fileType??en.Default,isPrivate:e?.isPrivate??!1,values:Yo(e?.values)?e.values:[],hasCondition:e?.hasCondition??!1,conditionCustomFieldId:e?.conditionCustomFieldId??null,conditionValue:e?.conditionValue??!1,canSelectMultiple:e?.canSelectMultiple??!1,document:e?.document||this.documentInputService.documentInputDefault(),isEncrypted:e?.isEncrypted??!1,canBeUpdatedByUrl:e?.canBeUpdatedByUrl??!1,validationRules:{...jC(_C({fieldType:t,fieldSubtype:i,fieldProperty:e?.fieldProperty})),...e?.validationRules},addressPostalCodeCustomFieldId:e?.addressPostalCodeCustomFieldId??null,addressCityCustomFieldId:e?.addressCityCustomFieldId??null,addressCountryCustomFieldId:e?.addressCountryCustomFieldId??null}}customFieldInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_du_champ_17959")),label:zc.Yj(),customFieldCategoryId:zc.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:zc.Yj().required(this.t("le_type_est_req_41180")).oneOf(Gt,this.t("le_type_est_req_41180")),fieldSubtype:zc.Yj().required(this.t("le_sous_type_es_85221")).oneOf(Wt,this.t("le_sous_type_es_85221")),listType:zc.Yj().required(this.t("le_style_des_op_46016")).oneOf(Jt,this.t("le_style_des_op_46016")),fileType:zc.Yj().required(this.t("l_affichage_du_11344")).oneOf(qt,this.t("l_affichage_du_11344")),isPrivate:zc.zM().nullable(),hasCondition:zc.zM().nullable(),values:zc.YO().when("fieldType",{is:Qe.Select,then:e=>e.of(zc.Ik().shape({id:zc.ai(),value:zc.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:zc.ai().when("hasCondition",{is:!0,then:e=>e.required(),otherwise:e=>e.nullable()}),conditionValue:zc.gl(),canSelectMultiple:zc.zM().nullable(),document:this.documentInputService.documentInputSchemaNotRequired(),isEncrypted:zc.zM().required(),canBeUpdatedByUrl:zc.zM().required(),validationRules:zc.Ik().required().when(["fieldType","fieldSubtype"],([e,n])=>this.validationRulesSchema(e,n)),addressPostalCodeCustomFieldId:zc.ai().nullable(),addressCityCustomFieldId:zc.ai().nullable(),addressCountryCustomFieldId:zc.ai().nullable()})}validationRulesSchema(e,n){const t=()=>zc.ai().nullable().integer(this.t("ce_nombre_doit_35487")),i=e=>t().min(e,this.t("ce_nombre_doit_66066",e)),s=(e,n)=>e.when(n,([e],n)=>"number"==typeof e?n.min(e,this.t("le_maximum_doit_04562")):n);switch(_C({fieldType:e,fieldSubtype:n})){case"text":return zc.Ik().shape({mode:zc.Yj().oneOf([...IC]),minLength:i(0),maxLength:s(i(1),"minLength"),allowedCharacters:zc.Yj().oneOf([...xC]),regex:zc.Yj().when("mode",{is:"regex",then:e=>e.required(this.t("l_expression_r_88693")).test("valid-regex",this.t("l_expression_r_68347"),e=>function(e){try{return new RegExp(e??""),!0}catch{return!1}}(e))}),regexMessage:zc.Yj().when("mode",{is:"regex",then:e=>e.required(this.t("le_message_d_er_84907"))})});case"number":return zc.Ik().shape({min:t(),max:s(t(),"min")});case"date":return zc.Ik().shape({range:zc.Yj().oneOf([...fC]),start:lf.nullable().when("range",{is:"between",then:e=>e.required(this.t("la_date_de_d_bu_05030"))}),end:lf.nullable().when("range",{is:"between",then:e=>e.required(this.t("la_date_de_fin_32246"))}).test("end-after-start",this.t("la_date_de_fin_21930"),function(e){const n=this.parent.start;return!n||!e||Vo(e)>=Vo(n)})});default:return zc.Ik()}}createUpdateCustomFieldSchema(){return zc.Ik().shape({customField:this.customFieldInputSchema()})}};Nz=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[wC,Di])],Nz);const Lz=({name:e,...n})=>(0,i.jsx)(Dl.D0,{name:e,render:e=>(0,i.jsx)(OC,{value:e.input.value,onChange:n=>{e.input.onChange(n)},...n})}),Uz=e=>{const{user:n}=Yi(),{setNodeRef:t,style:s,handleProps:o}=up(e.value.id);return(0,i.jsxs)(Tl,{ref:t,align:"center",gap:"4",style:s,children:[(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...o,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})}),e.isEdit&&(a=n.email,["ben.goldsworthy@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(a))&&(0,i.jsx)(Mr,{css:{width:"fit-content"},fontSize:"textXs",textAlign:"center",children:e.value.id}),e.showColor&&(0,i.jsx)(Mr,{children:(0,i.jsx)(Lz,{borderRadius:16,name:`customField.values[${e.index}].color`,size:16})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)($c,{name:`customField.values[${e.index}].value`})}),(0,i.jsx)(Mr,{color:"gray500",css:{cursor:"pointer"},onClick:e.onDelete,children:(0,i.jsx)(Yl,{icon:"trash-can"})})]});var a},Vz=e=>{const n=Fi(),t=(0,V.useCallback)((n,t)=>{e.change("customField.values",Qo(e.values,n,t))},[e.values,e.change]),s=!e.isEdit||e.isSelectV2;return(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("valeurs_de_la_l_43599")}),(0,i.jsxs)(Tl,{css:{background:"$gray100",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[s?(0,i.jsx)(_p,{ids:e.values.map(e=>e.id),onReorder:t,children:(0,i.jsx)(Tl,{direction:"column",gap:"3",children:e.values.map((n,t)=>(0,i.jsx)(Uz,{index:t,isEdit:e.isEdit,showColor:e.showColor,value:n,onDelete:()=>{e.change("customField.values",Jo(e.values,t))}},n.id))})}):e.values.map((e,n)=>(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)($c,{name:`customField.values[${n}].value`})},n)),(0,i.jsxs)(Mr,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:()=>{const n=Math.min(0,...e.values.map(e=>e.id??0))-1;e.change("customField.values",e.values.concat([{id:n,value:""}]))},children:["+ ",n("ajouter_une_nou_98358")]})]})]})},Bz=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>({organizationId:e.organizationId,eventId:e.eventId,variety:e.customField.variety}),[e.customField.variety,e.eventId,e.organizationId]),s=n=>(0,Lm.A)(e.linkableCustomFields.filter(e=>function(e,n,t){return SC(e,n)&&n.fieldType===vC.find(e=>e.key===t).fieldType}(t,e,n)),e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:hC(e)},e.id));return(o={fieldType:e.customField.fieldType,fieldProperty:e.fieldProperty}).fieldType===Qe.Address&&o.fieldProperty===Ke.Custom?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("champs_li_s_63973"),subtitle:n("quand_une_adres_32686"),children:(0,i.jsxs)(wb,{heading:n("champs_li_s_63973"),children:[(0,i.jsx)(of,{isSearchVisible:!0,label:n("code_postal_40328"),name:"customField.addressPostalCodeCustomFieldId",placeholder:n("aucun_93456"),children:s("addressPostalCodeCustomFieldId")}),(0,i.jsx)(of,{isSearchVisible:!0,label:n("ville_67740"),name:"customField.addressCityCustomFieldId",placeholder:n("aucun_93456"),children:s("addressCityCustomFieldId")}),(0,i.jsx)(of,{isSearchVisible:!0,label:n("Country"),name:"customField.addressCountryCustomFieldId",placeholder:n("aucun_93456"),children:s("addressCountryCustomFieldId")})]})})]}):null;var o},Wz=br("div",{alignItems:"center",borderRadius:"$2",cursor:"pointer",display:"flex",gap:"$4",padding:"$4",userSelect:"none","&:hover":{boxShadow:"$xs"},"& .radio-row-text":{flex:1,fontWeight:"$medium"},"& .radio-row-button":{alignItems:"center",borderRadius:"16px",color:"white",display:"flex",fontSize:"10px",height:"16px",justifyContent:"center",width:"16px"},variants:{state:{unchecked:{background:"white",border:"1px solid $gray200","&:hover":{background:"$gray50"},"& .radio-row-text":{color:"$gray700"},"& .radio-row-button":{background:"white",border:"1px solid $gray300"}},checked:{background:"$primary50",border:"1px solid $primary500",boxShadow:"$xs","& .radio-row-text":{color:"$primary800"},"& .radio-row-button":{background:"$primary500",border:"1px solid $primary500"}}}},defaultVariants:{state:"unchecked"}}),Gz=e=>(tm("common-front/src/designSystem/components/radioRow.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button"),(0,i.jsxs)(Wz,{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)(Yl,{icon:"check"})})]})),qz=({description:e,label:n,name:t,value:s})=>{const{inputId:o,descId:a}=Sc();return(0,i.jsx)(Dl.D0,{name:t,render:t=>{const r=t.input.checked?"checked":"unchecked";return(0,i.jsx)(Gz,{descId:a,inputId:o,state:r,onClick:()=>{t.input.onChange(s)},children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(bc,{htmlFor:o,children:(0,i.jsx)(Mr,{children:n})}),e&&(0,i.jsx)(Mr,{fontWeight:"regular",id:a,children:e})]})})},type:"radio",value:s})},Hz="customField.validationRules",Yz=e=>{const{translate:n}=Kl(),t=_C({...e.customField,fieldProperty:e.fieldProperty});if(null===t)return null;{const s=e.customField.validationRules,o=e.customField.validationRules;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"5"}),(0,i.jsxs)(sf,{heading:n("r_gles_de_valid_33082"),subtitle:n("les_valeurs_sai_90911"),children:["text"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(wb,{heading:n("type_de_r_gles_26838"),children:[(0,i.jsx)(qz,{label:n("r_gles_par_d_fa_31067"),name:`${Hz}.mode`,value:"default"}),(0,i.jsx)(qz,{description:n("la_valeur_doit_29705"),label:n("expression_r_gu_99597"),name:`${Hz}.mode`,value:"regex"})]}),"regex"===s.mode?(0,i.jsxs)(wb,{heading:n("expression_r_gu_99597"),children:[(0,i.jsx)($c,{label:n("expression_r_gu_99597"),name:`${Hz}.regex`,placeholder:"^[A-Z]{2}[0-9]{4}$"}),(0,i.jsx)($c,{label:n("message_d_erreu_68530"),name:`${Hz}.regexMessage`})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(wb,{heading:n("espaces_22926"),children:[(0,i.jsx)(Xx,{name:`${Hz}.noLeadingTrailingSpaces`,children:n("pas_d_espace_au_17159")}),(0,i.jsx)(Xx,{name:`${Hz}.noSpaces`,children:n("aucun_espace_57608")})]}),(0,i.jsx)(wb,{heading:n("nombre_de_carac_58931"),children:(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)($c,{label:n("minimum_26731"),name:`${Hz}.minLength`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)($c,{label:n("maximum_56225"),name:`${Hz}.maxLength`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})}),(0,i.jsx)(wb,{heading:n("caract_res_auto_81544"),children:(0,i.jsxs)(ny,{label:n("caract_res_auto_81544"),name:`${Hz}.allowedCharacters`,children:[(0,i.jsx)("option",{value:"all",children:n("tous_les_caract_05992")}),(0,i.jsx)("option",{value:"numbers",children:n("chiffres_unique_20331")}),(0,i.jsx)("option",{value:"noSymbols",children:n("pas_de_symboles_28799")}),(0,i.jsx)("option",{value:"uppercase",children:n("majuscules_uniq_62106")}),(0,i.jsx)("option",{value:"lowercase",children:n("minuscules_uniq_30465")})]})})]})]}),"number"===t&&(0,i.jsx)(wb,{heading:n("valeur_22437"),children:(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)($c,{label:n("minimum_26731"),name:`${Hz}.min`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)($c,{label:n("maximum_56225"),name:`${Hz}.max`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})}),"date"===t&&(0,i.jsxs)(wb,{heading:n("dates_accept_es_28396"),children:[(0,i.jsx)(qz,{label:n("toutes_les_date_15702"),name:`${Hz}.range`,value:"any"}),(0,i.jsx)(qz,{label:n("dates_pass_es_u_19138"),name:`${Hz}.range`,value:"past"}),(0,i.jsx)(qz,{label:n("entre_deux_date_48809"),name:`${Hz}.range`,value:"between"}),"between"===o.range&&(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(Qx,{label:n("d_but_41840"),name:`${Hz}.start`})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(Qx,{label:n("fin_60104"),name:`${Hz}.end`})})]})]})]})]})}};var Zz;!function(e){e.Basic="Basic",e.Advanced="Advanced"}(Zz||(Zz={}));const Kz=e=>{const{translate:n}=Kl(),{showNotification:t}=AS(),s=ki(Nz),o=Um(),a=ki(Ol),{mutate:r}=function(e={}){return Ui("mutation CustomFieldCategoryCreate(\n $organizationId: OrganizationId!\n $category: CustomFieldsCategoryInput!\n) {\n customFieldCategoryCreate(organizationId: $organizationId, customFieldCategory: $category) {\n id\n name\n }\n}\n",e)}(),{canCustomFieldEdit:d}=ay(),l=(0,V.useRef)(null);Au((0,V.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.customField.name):n("nouveau_champ_p_27686"),[e.isEdit,e.initialValues]));const c=(0,V.useMemo)(()=>(0,Lm.A)(e.organization.customFields.nodes.filter(n=>n.id!==e.customFieldId),e=>e.name.toLowerCase()),[e.customFieldId,e.organization]),[u,m]=(0,V.useState)(HC(e.organization.customFieldsCategories.nodes)),[h,p]=(0,V.useState)(e.initialValues.customField.fieldType),[I,x]=(0,V.useState)(e.initialValues.customField.hasCondition),[f,_]=(0,V.useState)(c.find(n=>n.id===e.initialValues.customField.conditionCustomFieldId)),[j,v]=(0,V.useState)(e.isEdit&&((S=e.initialValues.customField).variety!==Te.UserInfo||g(S.label)||S.fieldSubtype!==Xe.Freeform||S.listType!==un.Default||S.fileType!==en.Default||S.isEncrypted||S.canBeUpdatedByUrl||!0===S.isPrivate||!0===S.hasCondition||function(e){const n=e,t=e,i=e;return"regex"===n.mode||!0===n.noLeadingTrailingSpaces||!0===n.noSpaces||"number"==typeof n.minLength||"number"==typeof n.maxLength||void 0!==n.allowedCharacters&&"all"!==n.allowedCharacters||"number"==typeof t.min||"number"==typeof t.max||void 0!==i.range&&"any"!==i.range}(S.validationRules)||vC.some(({key:e})=>S[e]))?Zz.Advanced:Zz.Basic);var S;const[y,C]=(0,V.useState)(!1),b=j===Zz.Advanced,A=!e.isFromForm,E=f?.fieldType===Qe.Checkbox,w=WC(f);return(0,i.jsx)(xc,{customErrorRef:l,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:s,submitting:a,values:g})=>{const S=()=>{vC.forEach(({key:e})=>{t.change(`customField.${e}`,null)})},$=(n,i)=>{t.batch(()=>{t.change("customField.fieldType",n),t.change("customField.fieldSubtype",i),t.change("customField.validationRules",jC(_C({fieldType:n,fieldSubtype:i,fieldProperty:e.fieldProperty}))),S()})},T=(g.customField.variety===Te.Delegation||g.customField.variety===Te.UserInfo)&&h===Qe.Text,z=e.isEdit||g.customField.fieldSubtype!==Xe.Freeform,O=(g.customField.variety===Te.Delegation||g.customField.variety===Te.UserInfo)&&h!==Qe.Validation&&!0!==e.isFromForm,R=c.filter(n=>function(e,n){return n.id!==e.id&&SC(e,n)&&yC.includes(n.fieldType)}({organizationId:e.organizationId,eventId:e.customFieldEventId,variety:g.customField.variety},n)),D=(g.customField.variety===Te.Delegation||g.customField.variety===Te.UserInfo)&&Yo(R),M=b&&g.customField.fieldType===Qe.Text,P=b&&g.customField.fieldType===Qe.Select,k=b&&g.customField.fieldType===Qe.File,F=e.isEdit&&!0===e.initialValues.customField.canSelectMultiple&&!0!==g.customField.canSelectMultiple,N=g.customField.variety===Te.UserInfo&&mC.includes(h);return(0,i.jsx)(Hx,{button:e.isEdit?(0,i.jsx)(tc,{isLoading:a,onClick:s,children:n("mettre_jour_85141")}):null,category:e.isEdit?n("CustomFieldUpdate"):n("CustomFieldCreate"),color:"dark",heading:e.isEdit?e.initialValues.customField.name:n("nouveau_champ_p_27686"),onClose:e.onClose,children:(0,i.jsxs)(Gx,{ref:l,children:[(0,i.jsx)(Zr.Yr,{name:"customField.fieldType",children:e=>{p(e),e===Qe.Validation&&t.change("customField.isPrivate",!1)}}),(0,i.jsx)(Zr.Yr,{name:"customField.variety",children:()=>{t.batch(()=>{S(),t.change("customField.hasCondition",!1),t.change("customField.conditionCustomFieldId",null)}),_(void 0)}}),(0,i.jsx)(Zr.Yr,{name:"customField.fieldSubtype",children:e=>{t.change("customField.isEncrypted",e!==Xe.Freeform)}}),(0,i.jsx)(Zr.Yr,{name:"customField.hasCondition",children:e=>{t.change("customField.conditionCustomFieldId",R[0]?.id??null),x(e)}}),(0,i.jsx)(Zr.Yr,{name:"customField.conditionCustomFieldId",children:e=>{const n=R.find(n=>n.id===e);n&&(t.change("customField.conditionValue",n.fieldType===Qe.Checkbox||[]),_(n))}}),(0,i.jsx)(hc,{}),(0,i.jsxs)(sf,{heading:n("informations_su_14015"),children:[(0,i.jsxs)(wb,{heading:n("initialisation_38640"),children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("type_de_cr_atio_50953")}),(0,i.jsxs)(Gv,{selectedItem:j,onChange:e=>{v(e)},children:[(0,i.jsx)(qv,{item:Zz.Basic,children:n("basique_25478")}),(0,i.jsx)(qv,{item:Zz.Advanced,children:n("avanc_08814")})]})]}),b&&A&&(0,i.jsxs)(ny,{label:n("typologie_34041"),name:"customField.variety",state:e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:Te.Accreditation,children:n("accr_ditations_39450")}),(0,i.jsx)("option",{value:Te.Delegation,children:n("d_l_gations_78318")}),!e.eventId&&(0,i.jsx)("option",{value:Te.Event,children:n("Event")}),(0,i.jsx)("option",{value:Te.Position,children:n("missions_63972")}),(0,i.jsx)("option",{value:Te.UserInfo,children:n("membres_11310")})]}),(0,i.jsx)(of,{isCreateVisible:d,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"customField.customFieldCategoryId",placeholder:n("rechercher_ou_c_16469"),onCreateClick:()=>{C(!0)},children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(wb,{heading:n("nom_du_champ_48329"),children:[(0,i.jsx)($c,{hint:n("titre_de_la_que_69079"),label:n("nom_du_champ_48329"),name:"customField.name"}),(0,i.jsx)($c,{hint:n("sous_titre_de_l_90967"),label:(0,i.jsx)(Uv,{children:n("sous_titre_97472")}),name:"customField.description"}),b&&(0,i.jsx)($c,{hint:n("nom_technique_u_74183"),label:(0,i.jsx)(Uv,{children:n("label_08243")}),name:"customField.label"})]}),(0,i.jsxs)(wb,{heading:n("type_de_champ_47485"),children:[(0,i.jsx)(Up,{label:n("type_35427"),state:e.isEdit?"disabled":"active",value:g.customField.fieldType,onChange:e=>{$(e,g.customField.fieldSubtype)},children:o(Gt)}),M&&(0,i.jsx)(Up,{label:n("sous_type_de_ch_73883"),state:e.isEdit?"disabled":"active",value:g.customField.fieldSubtype,onChange:e=>{$(g.customField.fieldType,e)},children:o(Wt)}),P&&(0,i.jsx)(ny,{label:n("style_des_optio_82329"),name:"customField.listType",children:o(Jt)}),k&&(0,i.jsx)(ny,{label:n("affichage_du_fi_79168"),name:"customField.fileType",children:o(qt)}),h===Qe.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vz,{change:t.change,isEdit:e.isEdit,isSelectV2:e.isSelectV2,showColor:g.customField.listType!==un.Default,values:g.customField.values}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("est_ce_qu_il_es_10680")}),(0,i.jsx)(Xx,{name:"customField.canSelectMultiple",children:n("oui_il_est_pos_25233")})]}),F&&(0,i.jsx)(lc,{alertStyle:"warning",children:(0,i.jsx)(uc,{children:n("les_valeurs_mul_56587")})})]}),h===Qe.Validation&&(0,i.jsx)(PC,{accept:[gv.Images,gv.Pdf],acl:"public-read",label:(0,i.jsx)(Uv,{children:n("document_87149")}),organizationId:e.organizationId,prefix:"customField.document."})]}),b&&T&&(0,i.jsx)(wb,{heading:n("chiffrement_des_84602"),children:(0,i.jsx)(df,{disabled:z,name:"customField.isEncrypted",subtext:n("seuls_les_4_der_85542"),children:n("les_donn_es_son_85588")})}),b&&N&&(0,i.jsx)(wb,{heading:n("modification_pa_97786"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("la_valeur_de_ce_49938")}),(0,i.jsx)(Xx,{name:"customField.canBeUpdatedByUrl",children:n("oui_la_valeur_72738")})]})})]}),b&&(O||D)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"5"}),(0,i.jsxs)(sf,{heading:n("affichage_du_ch_62974"),children:[O&&(0,i.jsx)(wb,{heading:n("Privacy"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("ce_champ_est_il_98722")}),(0,i.jsx)(Xx,{name:"customField.isPrivate",children:n("oui_le_champ_n_99925")})]})}),D&&(0,i.jsxs)(wb,{heading:n("d_pendance_du_c_85763"),children:[(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("l_affichage_de_99189")}),(0,i.jsx)(Xx,{name:"customField.hasCondition",children:n("oui_le_champ_d_00513")})]}),I&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",gap:"4",children:[(0,i.jsx)(of,{isSearchVisible:!0,label:n("nom_du_champ_do_17104"),name:"customField.conditionCustomFieldId",children:R.map(e=>(0,i.jsx)("option",{value:e.id,children:hC(e)},e.id))}),f&&(E?(0,i.jsxs)(ny,{label:n("pour_quelle_val_60529",f.name),name:"customField.conditionValue",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]}):(0,i.jsx)(of,{isSearchVisible:!0,label:n("pour_quelle_val_60529",f.name),multiple:!0,name:"customField.conditionValue",children:w},f.id))]})]})]})]}),b&&(0,i.jsx)(Yz,{customField:g.customField,fieldProperty:e.fieldProperty}),b&&(0,i.jsx)(Bz,{customField:g.customField,eventId:e.customFieldEventId,fieldProperty:e.fieldProperty,linkableCustomFields:e.organization.addressLinksCustomFields.nodes,organizationId:e.organizationId}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:a,onClick:s,children:(0,i.jsx)(Mr,{textAlign:"center",children:e.isEdit?n("mettre_jour_l_31784"):n("cr_er_le_champ_05516")})})}),y&&(0,i.jsx)(zb,{initialName:"",isEdit:!1,mutate:async n=>{const{customFieldCategoryCreate:t}=await r({organizationId:e.organizationId,category:{name:n}});return t},onClose:()=>{C(!1)},onSuccess:e=>{m(HC([...u,e])),t.change("customField.customFieldCategoryId",e.id)}})]})})},validate:a.validateForForm(s.createUpdateCustomFieldSchema()),width:1,onSubmit:async i=>{const{customField:s}=await e.mutate({organizationId:e.organizationId,eventId:e.eventId,customField:{...i.customField,description:i.customField.description||"",values:i.customField.values.map(e=>(e.id??0)<0?{...e,id:void 0}:e)}});t(e.isEdit?n("le_champ_person_31517"):n("le_champ_person_90348")),e.onClose(),e.onSuccess(s)}})},Xz=e=>{const n=ki(Nz),{data:t,loader:s}=Li("query OrganizationInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[$o.CreateCustomFieldInfosFragment]);const{mutate:o}=function(e={}){return Ui("mutation CustomFieldCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customField: CustomFieldInput!\n) {\n customField: customFieldCreate(\n organizationId: $organizationId\n eventId: $eventId\n customField: $customField\n ) {\n id\n slug\n name\n label\n fieldType\n listType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return s||(0,i.jsx)(Kz,{customFieldEventId:e.eventId,customFieldId:null,eventId:e.eventId,fieldProperty:Ke.Custom,initialValues:{customField:n.customFieldInputDefault(null,t.organization.customFieldsCategories.nodes)},isEdit:!1,isFromForm:e.isFromForm,isSelectV2:!0,mutate:o,organization:t.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},Qz=e=>{const n=ki(Nz),{data:t,loader:s}=Li("query CustomFieldToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customFieldId: CustomFieldId!\n) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n\n customField(id: $customFieldId) {\n eventId\n name\n label\n customFieldCategoryId\n description\n variety\n fieldType\n fieldSubtype\n fieldProperty\n listType\n fileType\n isPrivate\n hasCondition\n conditionCustomFieldId\n canSelectMultiple\n conditionValue\n isSelectV2\n isEncrypted\n canBeUpdatedByUrl\n validationRules\n addressPostalCodeCustomFieldId\n addressCityCustomFieldId\n addressCountryCustomFieldId\n\n document {\n acl\n name\n key\n }\n\n values {\n id\n value\n color\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,customFieldId:e.customFieldId},[$o.CreateCustomFieldInfosFragment]);const{mutate:o}=function(e={}){return Ui("mutation CustomFieldUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customFieldId: CustomFieldId!\n $customField: CustomFieldInput!\n) {\n customField: customFieldUpdate(\n organizationId: $organizationId\n eventId: $eventId\n customFieldId: $customFieldId\n customField: $customField\n ) {\n id\n slug\n name\n label\n fieldType\n listType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return s||(0,i.jsx)(Kz,{customFieldEventId:t.organization.customField.eventId,customFieldId:e.customFieldId,eventId:e.eventId,fieldProperty:t.organization.customField.fieldProperty,initialValues:{customField:n.customFieldInputDefault(t.organization.customField,t.organization.customFieldsCategories.nodes)},isEdit:!0,isSelectV2:t.organization.customField.isSelectV2,mutate:n=>o({...n,customFieldId:e.customFieldId}),organization:t.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},Jz=()=>{const{history:e,params:{organizationId:n,eventId:t}}=Kl();return(0,i.jsx)(Xz,{eventId:t,organizationId:n,onClose:()=>{e.goBack(mj.CUSTOM_FIELDS({organizationId:n,eventId:t}))},onSuccess:Bc.A})},eO=()=>{const{history:e,params:{organizationId:n,eventId:t,customFieldId:s}}=Kl();return(0,i.jsx)(Qz,{customFieldId:s,eventId:t,organizationId:n,onClose:()=>{e.goBack(mj.CUSTOM_FIELDS({organizationId:n,eventId:t}))},onSuccess:Bc.A})},nO=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.initialName);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("nouvelle_sectio_88105")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("ajouter_des_sec_58545")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(wc,{label:n("nom_de_la_secti_38728"),value:t,onChange:s}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{onClick:()=>{e.onAdd(t),e.onClose()},children:g(e.initialName)?n("renommer_la_sec_00650"):n("cr_er_la_sectio_96175")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},tO=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=oS(["user",...t?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:e.customFieldsSlugs}),[o,a]=(0,V.useState)(e.initialText);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("champ_texte_lib_91587")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("ajouter_des_cha_68672")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(tS,{initialValue:o,variables:s,onChange:a})}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{onClick:()=>{e.onAdd(o),e.onClose()},children:g(e.initialText)?n("mettre_jour_l_69246"):n("ajouter_le_cham_74670")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},iO=e=>{const{translate:n,params:{organizationId:t}}=Kl(),s=ry(),[o,a]=(0,V.useState)(!1),{setNodeRef:r,style:d,handleProps:l}=up(e.elementId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{ref:r,align:"center",css:{bd:!0,padding:"$4 $6",...e.css},gap:"5",style:d,children:[(0,i.jsx)(ly,{permissions:sy.FORM_EDIT,children:(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...l,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:e.field.name}),e.field.conditionCustomField&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Yl,{icon:"split"})})}),(0,i.jsx)(Dx,{placement:"top",children:n("ce_champ_d_pend_31209",e.field.conditionCustomField?.name)})]})]}),(0,i.jsx)(Mr,{color:"gray500",children:n(e.field.fieldType)})]}),(0,i.jsxs)(ly,{permissions:sy.FORM_EDIT,children:[(0,i.jsx)(np,{value:e.isMandatory,onChange:n=>{e.toggleIsMandatory(e.index,n)},children:n("obligatoire_35326")}),(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(e.index)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("supprimer_le_ch_99740")})]}),e.showEdit&&s(e.field)&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_le_champ_78018")})]})]})]})]}),o&&(0,i.jsx)(Pz,{children:(0,i.jsx)(Qz,{customFieldId:e.field.id,eventId:e.field.eventId,organizationId:t,onClose:()=>a(!1),onSuccess:e.updateCustomField})})]})},sO=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.conditionCustomFields.map(e=>(0,i.jsx)("option",{value:e.id,children:hC(e)},e.id)),[e.conditionCustomFields]),s=e.conditionCustomFields.find(n=>n.id===e.conditionCustomFieldId),o=WC(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:n("champ_sur_leque_68198"),renderOnPortal:!0,values:e.conditionCustomFieldId?[e.conditionCustomFieldId]:[],onChange:n=>{Yo(n)?e.setConditionCustomFieldId(n[0]):e.setConditionCustomFieldId(null)},children:t}),s&&(0,i.jsx)(i.Fragment,{children:s.fieldType===Qe.Checkbox?(0,i.jsxs)(Up,{label:n("pour_quelle_val_60529",s.name),shouldParseAsBoolean:!0,value:e.conditionValue,onChange:e.setConditionValue,children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("pour_quelle_val_60529",s.name),multiple:!0,renderOnPortal:!0,values:e.conditionValue,onChange:e.setConditionValue,children:o},s.id)})]})},oO=e=>{const{translate:n}=Kl(),[t,s]=V.useState(e.element.conditionCustomFieldId),[o,a]=V.useState(e.element.conditionValue),r=null!==t&&("boolean"==typeof o||Yo(o));return(0,i.jsx)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"split",children:n("ajouter_une_con_66324")}),(0,i.jsx)(hx,{gap:"4",children:(0,i.jsx)(sO,{conditionCustomFieldId:t,conditionCustomFields:e.conditionCustomFields,conditionValue:o,setConditionCustomFieldId:n=>{const t=e.conditionCustomFields.find(e=>e.id===n);t&&(a(t.fieldType===Qe.Checkbox||[]),s(n))},setConditionValue:a})}),(0,i.jsxs)(gx,{hideCancelButton:!0,children:[(0,i.jsx)(tc,{disabled:!r,onClick:()=>{e.onConditionAdd(e.index,t,o),e.onClose()},children:n("ajouter_une_con_66324")}),(0,i.jsx)(tc,{color:"white",onClick:()=>{e.onConditionDelete(e.index),e.onClose()},children:n("supprimer_la_co_57888")})]})]})})},aO=e=>{const n=Fi(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(!1),r=(0,V.useMemo)(()=>e.conditionCustomFields.find(n=>n.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]),{setNodeRef:d,style:l,handleProps:c}=up(e.element.id);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{ref:d,align:"center",css:{background:"$gray900",bd:"gray900 2",color:"white",marginBottom:"$2",marginTop:"$5",padding:"$4 $6"},gap:"5",style:l,children:[(0,i.jsx)(ly,{permissions:sy.FORM_EDIT,children:(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...c,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Tl,{css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Mr,{fontWeight:"semiBold",children:e.element.section||""}),r&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"white",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Yl,{icon:"split"})})}),(0,i.jsx)(Dx,{placement:"top",children:n("cette_section_d_50768",r.name)})]})]}),(0,i.jsx)(ly,{permissions:sy.FORM_EDIT,children:(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"split",size:"sm",onClick:()=>a(!0)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("ajouter_une_con_66324")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("supprimer_43083")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("renommer_42135")})]})]})})]}),t&&(0,i.jsx)(nO,{initialName:e.element.section||"",onAdd:n=>{e.onRename(e.index,n)},onClose:()=>{s(!1)}}),o&&(0,i.jsx)(oO,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>a(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},rO=e=>{const n=Fi(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(!1),r=(0,V.useMemo)(()=>e.conditionCustomFields.find(n=>n.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]),{setNodeRef:d,style:l,handleProps:c}=up(e.element.id);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{ref:d,align:"center",css:{bd:!0,padding:"$4 $6"},gap:"5",style:l,children:[(0,i.jsx)(ly,{permissions:sy.FORM_EDIT,children:(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...c,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Tl,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Rf,{text:e.element.text||""})}),r&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Yl,{icon:"split"})})}),(0,i.jsx)(Dx,{placement:"top",children:n("ce_texte_d_pend_87251",r.name)})]})]}),(0,i.jsx)(ly,{permissions:sy.FORM_EDIT,children:(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"split",size:"sm",onClick:()=>a(!0)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("ajouter_une_con_66324")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("supprimer_43083")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]})]})})]}),t&&(0,i.jsx)(tO,{customFieldsSlugs:e.customFieldsSlugs,initialText:e.element.text||"",onAdd:n=>{e.onEdit(e.index,n)},onClose:()=>s(!1)}),o&&(0,i.jsx)(oO,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>a(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},dO=e=>{const n=(0,V.useMemo)(()=>Object.fromEntries(e.customFields.map(e=>[e.id,e])),[e.customFields]),t=(0,V.useMemo)(()=>e.customFields.filter(e=>[Qe.Checkbox,Qe.Country,Qe.Language,Qe.Nationality,Qe.Select].includes(e.fieldType)),[e.customFields]);return(0,i.jsx)(_p,{ids:e.elements.map(e=>e.id),onReorder:e.onReorder,children:(0,i.jsx)(Tl,{direction:"column",gap:"3",width:1,children:e.elements.map((s,o)=>{switch(s.elementType){case tn.Field:{const t=n[s.customFieldId];return t?(0,i.jsx)(iO,{elementId:s.id,field:t,index:o,isMandatory:s.isMandatory,showEdit:!0,toggleIsMandatory:e.fieldsToggleMandatory,updateCustomField:e.updateCustomField,onDelete:e.onDelete},s.id):null}case tn.Section:return(0,i.jsx)(aO,{conditionCustomFields:t,element:s,index:o,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onRename:e.sectionOnRename},s.id);case tn.Text:return(0,i.jsx)(rO,{conditionCustomFields:t,customFieldsSlugs:e.customFieldsSlugs,element:s,index:o,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onEdit:e.textOnEdit},s.id);default:return Zl(s.elementType)}})})})},lO=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{canCustomFieldEdit:o}=oy(),[a,r]=(0,V.useState)(!1),[d,l]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1),[m,g]=(0,V.useState)(e.customFields),h=(0,V.useMemo)(()=>new Set(e.elements.flatMap(e=>e.elementType===tn.Field?[e.customFieldId]:[])),[e.elements]),p=(0,V.useMemo)(()=>{const n=new Map(m.map(e=>[e.id,e.slug]));return e.elements.flatMap(e=>e.elementType===tn.Field?[e.customFieldId,e.conditionCustomFieldId].flatMap(e=>{const t=e?n.get(e):void 0;return t?[t]:[]}):[])},[m,e.elements]),I=(0,V.useCallback)((n,t)=>{e.setElements(Qo(e.elements,n,t))},[e.elements,e.setElements]),x=(0,V.useCallback)(n=>{h.has(n.id)?e.setElements(e.elements.filter(e=>!e.customFieldId||e.customFieldId!==n.id)):e.setElements([...e.elements,{id:W(),elementType:tn.Field,customFieldId:n.id,isMandatory:!0,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements,h]),f=(0,V.useCallback)((n,t)=>{e.setElements((0,dp.jM)(e=>{e[n].isMandatory=t}))},[e.setElements]),_=(0,V.useCallback)(n=>{e.setElements([...e.elements,{id:W(),elementType:tn.Section,section:n,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),j=(0,V.useCallback)((n,t)=>{e.setElements((0,dp.jM)(e=>{e[n].section=t}))},[e.setElements]),v=(0,V.useCallback)(n=>{e.setElements([...e.elements,{id:W(),elementType:tn.Text,text:n,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),S=(0,V.useCallback)((n,t)=>{e.setElements((0,dp.jM)(e=>{e[n].text=t}))},[e.setElements]),y=(0,V.useCallback)(n=>{e.setElements((0,dp.jM)(e=>{e.splice(n,1)}))},[e.setElements]),C=(0,V.useCallback)(e=>{g(m.map(n=>n.id===e.id?e:n))},[m]),b=(0,V.useCallback)((n,t,i)=>{e.setElements((0,dp.jM)(e=>{e[n].hasCondition=!0,e[n].conditionCustomFieldId=t,e[n].conditionValue=i}))},[e.setElements]),A=(0,V.useCallback)(n=>{e.setElements((0,dp.jM)(e=>{e[n].hasCondition=!1,e[n].conditionCustomFieldId=null,e[n].conditionValue=!1}))},[e.setElements]);return(0,i.jsxs)(i.Fragment,{children:[0===e.elements.length?(0,i.jsx)(Mr,{height:.5,width:1,children:(0,i.jsx)(UE,{subtitle:n("ajouter_des_cha_37944"),title:n("aucun_champ_ou_18338")})}):(0,i.jsx)(dO,{customFields:m,customFieldsSlugs:p,elements:e.elements,fieldsToggleMandatory:f,sectionOnRename:j,textOnEdit:S,updateCustomField:C,onConditionAdd:b,onConditionDelete:A,onDelete:y,onReorder:I}),(0,i.jsxs)(ly,{permissions:sy.FORM_EDIT,children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"4",justify:0===e.elements.length?"center":"start",width:1,children:[(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:o?(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"pen-field",onClick:()=>{u(!0)},children:n("cr_eer_un_champ_08883")}),children:n("ajouter_des_cha_35843")}):(0,i.jsx)(tc,{children:n("ajouter_des_cha_35843")})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(lb,{customFields:m,selectedCustomFieldsIds:h,toggle:x})})]}),(0,i.jsx)(tc,{color:"white",onClick:()=>{r(!0)},children:n("ajouter_une_sec_90063")}),(0,i.jsx)(tc,{color:"white",onClick:()=>{l(!0)},children:n("ajouter_un_cham_31151")})]})]}),a&&(0,i.jsx)(nO,{initialName:"",onAdd:_,onClose:()=>{r(!1)}}),d&&(0,i.jsx)(tO,{customFieldsSlugs:p,initialText:"",onAdd:v,onClose:()=>{l(!1)}}),c&&(0,i.jsx)(Pz,{children:(0,i.jsx)(Xz,{eventId:s,isFromForm:!0,organizationId:t,onClose:()=>u(!1),onSuccess:async n=>{g([...m,n]),setTimeout(()=>{x(n),e.onSave()}),u(!1)}})})]})},cO=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$2",height:76,width:1})]}),uO=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,formId:o}}=Kl(),{data:a,isLoading:r}=Li("query FormElements($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n organization(id: $organizationId) {\n ...FormCustomFields\n\n form(id: $formId) {\n name\n\n elements {\n ...FormElementsElement\n }\n }\n }\n}\n",{organizationId:t,eventId:s,formId:o},[$o.FormCustomFieldsFragment,$o.FormElementsElementFragment]);Au(a.organization?.form.name??"");const{mutate:d,isLoading:l}=function(e={}){return Ui("mutation FormElementsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $elements: [FormsElementInput!]!\n) {\n formElementsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n elements: $elements\n ) {\n id\n }\n}\n",e)}(),[c,u]=(0,V.useState)([]),[m,g]=(0,V.useState)(""),h=(0,V.useCallback)(async()=>{await d({organizationId:t,eventId:s,formId:o,elements:c.map((e,n)=>({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:n}))}),g(JSON.stringify(c))},[d,c]),[p,I]=(0,V.useState)(!1),x=(0,V.useCallback)(()=>{JSON.stringify(c)===m?e.push($s.FORMS({organizationId:t,eventId:s})):I(!0)},[c,m]);return(0,V.useEffect)(()=>{u(a.organization?.form.elements??[]),g(JSON.stringify(a.organization?.form.elements??[]))},[a.organization]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Oz,{button:(0,i.jsx)(tc,{isLoading:l,onClick:h,children:n("enregistrer_06519")}),title:a.organization?.form.name??"-",onClose:x,children:(0,i.jsx)(Tl,{justify:"center",width:1,children:(0,i.jsxs)(Tl,{direction:"column",width:"$container",children:[(0,i.jsx)(Pl,{height:"8"}),r?(0,i.jsx)(cO,{}):(0,i.jsx)(lO,{customFields:a.organization.formCustomFields.nodes,elements:c,setElements:u,onSave:h}),(0,i.jsx)(Pl,{height:"8"})]})})}),(0,i.jsx)(Mz,{fallbackPath:$s.FORMS({organizationId:t,eventId:s}),isOpen:p,onClose:()=>{I(!1)}})]})},mO=e=>(0,i.jsx)(km,{css:{background:e.isSelected?"$primary50":"white",cursor:"pointer","&:hover":{background:"$gray100"}},onClick:e.onClick,children:(0,i.jsxs)($m,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",children:e.title}),(0,i.jsx)(Mr,{color:"gray500",children:e.subtitle})]})});let gO=class extends Rc{constructor(e){super(e)}emailTemplateDefault(e,n,t,i,s){const o=this.emailTypeToDefault(e,n,i,s);return t&&(o.subject=t.subject,o.content=t.content),{useDefault:t?.useDefault??!0,emailType:e,emailSenderId:t?.emailSenderId,attachments:t?.attachments??[],hasCalendarInvite:t?.hasCalendarInvite??!1,calendarInviteName:t?.calendarInviteName??null,calendarInviteStartDate:t?.calendarInviteStartDate??null,calendarInviteStartTime:t?.calendarInviteStartTime??null,calendarInviteEndDate:t?.calendarInviteEndDate??null,calendarInviteEndTime:t?.calendarInviteEndTime??null,...o}}emailTemplateSchema(){return zc.Ik().shape({useDefault:zc.zM().required(""),emailType:zc.Yj().required(this.t("le_type_d_e_mai_84281")).oneOf(Ut,this.t("le_type_d_e_mai_84281")),subject:zc.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),content:zc.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===Ve.Code)||this.parent.content.includes("{code}")})}),attachments:zc.YO().of(zc.Yj()),hasCalendarInvite:zc.zM().required(),calendarInviteName:zc.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:lf.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:zc.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:lf.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:zc.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})})}updateEmailTemplateSchema(){return zc.Ik().shape({emailTemplate:this.emailTemplateSchema()})}emailTypeToDefault(e,n,t,i){switch(e){case Ve.Accreditations:return this.accreditationsDefault();case Ve.AccreditationsRefused:return this.accreditationsRefusedDefault();case Ve.Assignments:return this.assignmentsDefault();case Ve.Code:return this.codeDefault(t,i);case Ve.FormInvite:return this.formInviteDefault();case Ve.FormSubmit:return this.formSubmitDefault(t);case Ve.NotifyLeaders:return this.notifyLeadersDefault(n);case Ve.DelegationCategoryLeaderAssign:return this.delegationCategoryLeaderAssign(n);case Ve.DelegationFormInvite:return this.delegationFormInviteDefault();case Ve.DelegationLeaderAssign:return this.delegationLeaderAssign();case Ve.PositionCategoryLeaderAssign:return this.positionCategoryLeaderAssignDefault(n);case Ve.PositionLeaderAssign:return this.positionLeaderAssign(n);case Ve.Refused:return this.refusedDefault();case Ve.VolunteerRegistration:return this.volunteerRegistrationDefault();case Ve.Campaign:case Ve.AccreditationsImport:case Ve.AccreditationsProfilesImport:case Ve.DelegationsImport:case Ve.EventsImport:case Ve.FilesImport:case Ve.Documents:case Ve.EventInvite:case Ve.Export:case Ve.MembersImport:case Ve.NewMember:case Ve.OrganizationInvite:case Ve.PositionsImport:throw new Error("Impossible to change this email");default:return Zl()}}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,n){return{subject:e&&!n?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,uu)}}delegationCategoryLeaderAssign(e){return{subject:this.t("_event_name_69973"),content:this.t("_p_bonjour_use_97817",uu,e.href,uu)}}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",uu,e.href,uu)}}positionLeaderAssign(e){return{subject:this.t("_event_name_60486"),content:this.t("leader_assign_default_1",uu,e.href,uu)}}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")}}};gO=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],gO);const hO=e=>{const{history:n,translate:t}=Kl(),{organization:s}=XS(),{event:o}=BS(),{data:a,loader:r}=Li("query EmailTemplate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId\n $source: LoginCodeSource\n $emailType: EmailType!\n) {\n organization(id: $organizationId) {\n emailsSenders(isValidToSendEmail: true) {\n id\n name\n }\n\n customFields(\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n\n emailTemplate(emailType: $emailType, eventId: $eventId, formId: $formId, source: $source) {\n emailType\n useDefault\n subject\n content\n emailSenderId\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailType:e.emailType},[$o.CustomFieldFragment]);const{mutate:d,isLoading:l}=function(e={}){return Ui("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=ki(gO),u=ki(Ol),m=oS(dv(e.emailType,!!e.eventId)),g=o?.useDocuments&&(e.emailType===Ve.Accreditations||e.emailType===Ve.Assignments||e.emailType===Ve.FormSubmit&&e.eventId),h=e.emailType===Ve.Accreditations||e.emailType===Ve.Assignments||e.emailType===Ve.FormSubmit||e.emailType===Ve.VolunteerRegistration;return r||(0,i.jsx)(xc,{direction:"column",initialValues:{emailTemplate:c.emailTemplateDefault(e.emailType,F.HEAVENT_APP_URL,a.organization.emailTemplate,e.eventId,e.formId)},render:({handleSubmit:o,values:r})=>(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)(dc,{children:t("contenu_de_l_e_19848")}),(0,i.jsx)(Xx,{name:"emailTemplate.useDefault",children:t("utiliser_le_mod_93521")}),!r.emailTemplate.useDefault&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($c,{label:t("sujet_de_l_e_ma_66809"),name:"emailTemplate.subject"}),(0,i.jsx)(of,{hint:t("cet_metteur_se_80394"),isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:t("_metteur_de_l_e_51616")}),name:"emailTemplate.emailSenderId",onCreateClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:(a.organization?.emailsSenders??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(iS,{hint:(0,i.jsx)(Mr,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:t("vous_pouvez_ajo_23408")}}),label:t("contenu_de_l_e_19848"),name:"emailTemplate.content",variables:m}),Yo(a.organization.customFields.nodes)&&(0,i.jsx)(Kj,{heading:t("attribution_d_u_18785"),isOpen:!1,isOpenToggleLabel:t("je_souhaite_cr_46006"),subtitle:t("cr_ez_une_varia_07170"),children:(0,i.jsx)(uS,{customFields:a.organization.customFields.nodes})}),g&&(0,i.jsxs)(of,{isSearchVisible:!0,label:t("pi_ce_s_jointe_82370"),multiple:!0,name:"emailTemplate.attachments",children:[(a.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:M_(e)},e)),Qj.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))]}),h&&(0,i.jsx)(dS,{hasCalendarInvite:r.emailTemplate.hasCalendarInvite,prefix:"emailTemplate."})]}),(0,i.jsx)(ly,{permissions:sy.EMAIL_EDIT,children:(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:l,onClick:o,children:t("enregistrer_le_77369")})})})]}),validate:u.validateForForm(c.updateEmailTemplateSchema()),width:1,onSubmit:async n=>{await d({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailTemplate:n.emailTemplate})}})},pO=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,formId:o}}=Kl(),{data:a}=Ld({organizationId:t,formId:o});Au(a.organization?.form.name??"");const[r,d]=(0,V.useState)(Ve.FormSubmit);return(0,i.jsx)(Oz,{title:a.organization?.form.name??"-",onClose:()=>{e.push($s.FORMS({organizationId:t,eventId:s}))},children:(0,i.jsx)(Tl,{justify:"center",width:1,children:(0,i.jsxs)(Tl,{direction:"column",width:"$container",children:[(0,i.jsx)(Pl,{height:"8"}),(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("liste_des_e_mai_73508")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{children:(0,i.jsx)(Gm,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(mO,{isSelected:r===Ve.FormSubmit,subtitle:n("cet_e_mail_est_29404"),title:n("remplissage_du_09925"),onClick:()=>d(Ve.FormSubmit)}),(0,i.jsx)(mO,{isSelected:r===Ve.Code,subtitle:n("cet_e_mail_est_49525"),title:n("code_20843"),onClick:()=>d(Ve.Code)}),s&&(0,i.jsx)(mO,{isSelected:r===Ve.FormInvite,subtitle:n("cet_email_est_e_46197"),title:n("invitation_d_un_88753"),onClick:()=>d(Ve.FormInvite)})]})]}),(0,i.jsx)(Mr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Tl,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(hO,{emailType:r,eventId:s,formId:o,organizationId:t,source:null})})]}),(0,i.jsx)(Pl,{height:"8"})]})})})};let IO=class extends Rc{constructor(e){super(e)}formParametersBroadcastInputDefault(e){return{segmentsIds:(e?.segments??[]).map(e=>e.segmentId),noAccessTitle:e?.noAccessTitle||"",noAccessMessage:e?.noAccessMessage||""}}formParametersBroadcastInputSchema(){return zc.Ik().shape({segmentsIds:zc.YO().of(zc.ai())})}updateFormParametersBroadcastSchema(){return zc.Ik().shape({form:this.formParametersBroadcastInputSchema()})}};IO=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],IO);const xO=({children:e,isActive:n,replace:t=!0,to:s})=>{const o=Wi(),a=n?.(o.pathname)??o.pathname===s;return(0,i.jsx)(Mr,{css:{background:a?"$primary50":"transparent",borderRadius:"6px",color:a?"$primary500":"$gray500",cursor:a?"default":"pointer",padding:"$2 $3"},children:(0,i.jsx)(ql,{replace:t,to:s,children:e})})},fO=e=>(0,i.jsx)(Tl,{"aria-orientation":"vertical",as:El.Nav,direction:"column",gap:"2",role:"menubar",width:1,children:e.children}),_O=e=>{const{translate:n,params:t}=Kl(),{hasFeature:s}=XS(),{event:o}=BS();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eu,{css:{py:"$8"},gridtemplatecolumns:"1fr 210px 80px 880px 1fr",gridtemplaterows:"1fr",width:1,children:[(0,i.jsx)(Mr,{css:{gridColumn:"2 / 3"},children:(0,i.jsxs)(fO,{children:[(0,i.jsx)(xO,{to:$s.FORM_PARAMETERS_GENERAL(t),children:n("g_n_ral_64953")}),(0,i.jsx)(xO,{to:$s.FORM_PARAMETERS_DESIGN(t),children:n("design_15043")}),t.eventId&&(0,i.jsx)(xO,{to:$s.FORM_PARAMETERS_AVAILABILITIES(t),children:n("disponibilit_s_49923")}),t.eventId&&o.usePositions&&(0,i.jsx)(xO,{to:$s.FORM_PARAMETERS_MISSIONS(t),children:n("missions_63972")}),t.eventId&&o.useAccreditations&&s(Ze.Accreditation)&&(0,i.jsx)(xO,{to:$s.FORM_PARAMETERS_ACCREDITATIONS(t),children:n("accr_ditations_39450")}),(0,i.jsx)(xO,{to:$s.FORM_PARAMETERS_BROADCAST(t),children:n("diffusion_56689")}),(0,i.jsx)(xO,{to:$s.FORM_PARAMETERS_STATE(t),children:n("cl_turer_88223")})]})}),(0,i.jsx)(Mr,{css:{gridColumn:"4 / 5"},width:1,children:e.children})]}),(0,i.jsx)(Mz,{fallbackPath:$s.FORMS({organizationId:t.organizationId,eventId:t.eventId}),isOpen:e.isNotSavedOpen,onClose:e.onNotSavedClose})]})};function jO(e,n,t){const{history:i,params:{organizationId:s,eventId:o}}=Kl(),[a,r]=(0,V.useState)(!1),[d,l]=(0,V.useState)(JSON.stringify(e)),c=(0,V.useCallback)(()=>{const e=JSON.stringify(n);d===e?i.push($s.FORMS({organizationId:s,eventId:o})):r(!0)},[d,n]),u=(0,V.useCallback)(()=>{r(!1)},[r]),m=(0,V.useCallback)(()=>{t(),l(JSON.stringify(n))},[t,n]);return(0,V.useEffect)(()=>{l(JSON.stringify(e))},[e]),{isNotSavedModalOpen:a,onClose:c,onNotSavedClose:u,onSave:m}}const vO=e=>{const n=Fi(),{isNotSavedModalOpen:t,onClose:s,onNotSavedClose:o,onSave:a}=jO(e.initialValues,e.values,e.handleSubmit),[r,d]=V.useState(Yo(e.initialValues.form.segmentsIds)),l=V.useMemo(()=>Yo(e.eventSegments)&&Yo(e.organizationSegments)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("optgroup",{label:n("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:n("vues_de_l_organ_32624"),children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}):Yo(e.eventSegments)?(0,i.jsx)(i.Fragment,{children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):Yo(e.organizationSegments)?(0,i.jsx)(i.Fragment,{children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsx)(i.Fragment,{}),[e.eventSegments,e.organizationSegments]);return V.useEffect(()=>{d(Yo(e.initialValues.form.segmentsIds))},[e.initialValues.form.segmentsIds]),(0,i.jsx)(Oz,{button:(0,i.jsx)(tc,{isLoading:e.isMutateLoading,onClick:a,children:n("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(_O,{isNotSavedOpen:t,onNotSavedClose:o,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("diffusion_du_fo_47764")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnalisez_l_57514")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("_qui_s_adresse_82507")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:r?"unchecked":"checked",onClick:()=>{d(!1),e.change("form.segmentsIds",[])},children:n("_tout_le_monde_35921")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:r?"checked":"unchecked",onClick:()=>{d(!0)},children:n("_certaines_vue_55512")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(of,{isSearchVisible:!0,multiple:!0,name:"form.segmentsIds",children:l})]}),(0,i.jsx)(oI,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("nom_de_l_tape_85862"),name:"form.noAccessTitle"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(iS,{label:n("message_affich_57692"),name:"form.noAccessMessage"})]})]})})})},SO=e=>{const{params:{organizationId:n,eventId:t,formId:s}}=Kl(),o=ki(Ol),a=ki(IO),{mutate:r,isLoading:d}=function(e={}){return Ui("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)}(),l=V.useMemo(()=>({form:a.formParametersBroadcastInputDefault(e.form)}),[e.form]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:l,render:({form:n,handleSubmit:t,values:s})=>(0,i.jsx)(vO,{change:n.change,eventSegments:e.eventSegments,handleSubmit:t,initialValues:l,isMutateLoading:d,loader:e.loader,name:e.form?.name??"",organizationSegments:e.organizationSegments,values:s}),validate:o.validateForForm(a.updateFormParametersBroadcastSchema()),width:1,onSubmit:e=>r({organizationId:n,eventId:t,formId:s,form:e.form})})},yO=()=>{const{params:{organizationId:e,formId:n}}=Kl(),{data:t,loader:s}=Li("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:n},[]);return Au(t.organization?.form.name??""),(0,i.jsx)(SO,{eventSegments:qo,form:t.organization?.form,loader:s,organizationSegments:t.organization?.segments??qo})},CO=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=Kl(),{data:s,loader:o}=Li("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:n,formId:t},[]);return Au(s.organization?.form.name??""),(0,i.jsx)(SO,{eventSegments:s.event?.segments??qo,form:s.organization?.form,loader:o,organizationSegments:s.organization?.segments??qo})};function bO(e){return"production"===r.Development&&F.HIGHLIGHT_CUSTOM_COLOURS?{blueGray900:"#ff03ee",primary50:"#ffbbfa",primary100:"#ecbbe9",primary200:"#d8bbd7",primary300:"#c4bbc3",primary400:"#b37eaf",primary500:"#9cff66",primary600:"#61fc0d",primary700:"#b35bad",primary800:"#b32eaa",primary900:"#b30da7"}:{blueGray900:e?.blueGray900??Ar.colors.blueGray900.value,primary50:e?.primary50??Ar.colors.primary50.value,primary100:e?.primary100??Ar.colors.primary100.value,primary200:e?.primary200??Ar.colors.primary200.value,primary300:e?.primary300??Ar.colors.primary300.value,primary400:e?.primary400??Ar.colors.primary400.value,primary500:e?.primary500??Ar.colors.primary500.value,primary600:e?.primary600??Ar.colors.primary600.value,primary700:e?.primary700??Ar.colors.primary700.value,primary800:e?.primary800??Ar.colors.primary800.value,primary900:e?.primary900??Ar.colors.primary900.value,primaryCustom500:e?.primary500??Ar.colors.primary500.value,primaryCustom600:e?.primary600??Ar.colors.primary600.value}}function AO(e){return"production"===r.Development&&F.HIGHLIGHT_CUSTOM_COLOURS?{grayCustom50:"#fabbf6",grayCustom500:"#fa5aef",grayCustom700:"#ff3df2",grayCustom800:"#fc23ee",grayCustom900:"#ff03ee",primaryCustom500:"#9cff66",primaryCustom600:"#61fc0d"}:{grayCustom50:e?.grayCustom50??Ar.colors.gray50.value,grayCustom500:e?.grayCustom500??Ar.colors.gray500.value,grayCustom700:e?.grayCustom700??Ar.colors.gray700.value,grayCustom800:e?.grayCustom800??Ar.colors.gray800.value,grayCustom900:e?.grayCustom900??Ar.colors.gray900.value,primaryCustom500:e?.primaryCustom500??Ar.colors.primary500.value,primaryCustom600:e?.primaryCustom600??Ar.colors.primary600.value}}let EO=class extends Rc{documentInputService;constructor(e,n){super(n),this.documentInputService=e}designInputDefault(e,n){return{banner:n?.banner??e?.banner??this.documentInputService.documentInputDefault(),logo:n?.logo??e?.logo??this.documentInputService.documentInputDefault(),colors:AO(n?.colors??e?.colors)}}formParametersDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),colors:AO(e?.colors)}}};var wO;EO=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[wC,Di])],EO),function(e){e.Background="background",e.Titles="titles",e.Subtitles="subtitles",e.Text="text"}(wO||(wO={}));const $O=({initialValues:e,customiseableColorsToShow:n=Object.values(wO)})=>{const{translate:t}=Kl();return(0,i.jsxs)(Kj,{heading:t("charte_graphiqu_02725"),children:[n.includes(wO.Background)&&(0,i.jsx)(wb,{heading:t("couleur_de_fond_75677"),children:(0,i.jsx)(DC,{initialValue:e?.grayCustom50??Ar.colors.gray50.value,label:t("couleur_de_fond_75677"),name:"design.colors.grayCustom50"})}),n.some(e=>[wO.Titles,wO.Subtitles,wO.Text].includes(e))&&(0,i.jsx)(wb,{heading:t("textes_07935"),children:(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"4",children:[n.includes(wO.Text)&&(0,i.jsx)(DC,{initialValue:e?.grayCustom800??Ar.colors.gray800.value,label:t("couleur_du_text_32021"),name:"design.colors.grayCustom800"}),n.includes(wO.Titles)&&(0,i.jsx)(DC,{initialValue:e?.grayCustom900??Ar.colors.gray900.value,label:t("couleur_des_tit_58918"),name:"design.colors.grayCustom900"}),n.includes(wO.Subtitles)&&(0,i.jsx)(DC,{initialValue:e?.grayCustom500??Ar.colors.gray500.value,label:t("couleur_des_sou_18968"),name:"design.colors.grayCustom500"})]})}),(0,i.jsx)(wb,{heading:t("boutons_35604"),children:(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(DC,{initialValue:e?.primaryCustom500??Ar.colors.primary500.value,label:t("couleur_des_bou_24410"),name:"design.colors.primaryCustom500"}),(0,i.jsx)(DC,{initialValue:e?.primaryCustom600??Ar.colors.primary600.value,label:t("couleur_des_bou_16515"),name:"design.colors.primaryCustom600"})]})})]})},TO=e=>{const{params:{organizationId:n},translate:t}=Kl();return(0,i.jsxs)(Kj,{heading:e.heading,hideHeading:e.hideHeading,children:[e.showLogo&&(0,i.jsx)(wb,{heading:t("logo_18191"),children:(0,i.jsx)(BC,{hint:t("nous_recommando_20904"),label:t("s_lectionnez_un_82734"),organizationId:n,prefix:"design.logo."})}),(0,i.jsx)(wb,{heading:t("banni_re_86634"),children:(0,i.jsx)(BC,{hint:t("taille_de_l_ima_84109"),label:t("s_lectionnez_un_82734"),organizationId:n,prefix:"design.banner."})})]})},zO=()=>{const{translate:e}=Kl();return(0,i.jsxs)(Kj,{heading:e("design_du_formu_57145"),subtitle:e("personnalisez_l_27035"),children:[(0,i.jsx)(TO,{heading:e("banni_re_du_for_40749"),hideHeading:!0,showLogo:!1}),(0,i.jsx)($O,{customiseableColorsToShow:[wO.Titles,wO.Background]})]})},OO=e=>{const n=Fi(),{isNotSavedModalOpen:t,onClose:s,onNotSavedClose:o,onSave:a}=jO(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(Oz,{button:(0,i.jsx)(tc,{isLoading:e.isMutateLoading,onClick:a,children:n("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(_O,{isNotSavedOpen:t,onNotSavedClose:o,children:e.loader||(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(zO,{})})})})},RO=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=Kl(),{data:s,loader:o}=Li("query FormParametersDesign($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n\n design {\n banner {\n acl\n name\n key\n }\n\n ...DesignColors\n }\n }\n }\n}\n",{organizationId:e,formId:t},[$o.DesignColorsFragment]);Au(s.organization?.form.name??"");const a=ki(EO),{mutate:r,isLoading:d}=function(e={}){return Ui("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)}(),l=V.useMemo(()=>({design:a.formParametersDesignInputDefault(s.organization?.form.design)}),[s.organization]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:l,render:({handleSubmit:n,values:t})=>(0,i.jsx)(OO,{handleSubmit:n,initialValues:l,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",organizationId:e,values:t}),width:1,onSubmit:i=>r({organizationId:e,eventId:n,formId:t,design:i.design})})};let DO=class extends Rc{constructor(e){super(e)}formParametersGeneralInputDefault(e){return{name:e?.name??"",setAssignmentStateToWaiting:e?.setAssignmentStateToWaiting??!1,setAccreditationStateToWaiting:e?.setAccreditationStateToWaiting??!1,allowMultiProfiles:e?.allowMultiProfiles??!1,canRefill:e?.canRefill??!1,description:e?.description||"",successTitle:e?.successTitle||"",successMessage:e?.successMessage||"",customFields:e?.customFields||[],areTeamsAllowed:e?.areTeamsAllowed??!1,maxTeamMembers:e?.maxTeamMembers,teamMemberFillFullForm:e?.teamMemberFillFullForm??!0,emailTitle:e?.emailTitle||"",informationTitle:e?.informationTitle||"",registerButtonText:e?.registerButtonText||"",isEditableInMemberSpace:e?.isEditableInMemberSpace??!0,ticketUrl:e?.ticketUrl||""}}formParametersGeneralInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_est_requ_61536")),allowMultiProfiles:zc.zM().required(),setAssignmentStateToWaiting:zc.zM().required(),setAccreditationStateToWaiting:zc.zM().required(),description:zc.Yj(),successTitle:zc.Yj(),successMessage:zc.Yj(),areTeamsAllowed:zc.zM().required(),maxTeamMembers:zc.ai().nullable(),teamMemberFillFullForm:zc.zM().required(),informationTitle:zc.Yj(),registerButtonText:zc.Yj(),ticketUrl:zc.Yj().test("valid-ticket-url",this.t("le_lien_doit_co_30275"),e=>!g(e)||e.startsWith("https://"))})}updateFormParametersGeneralSchema(){return zc.Ik().shape({form:this.formParametersGeneralInputSchema()})}};DO=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],DO);const MO=e=>{const n=Fi(),[t,s]=V.useState(Yo(e.values)),o=V.useCallback(n=>{s(n),n||e.change(e.name,[])},[e.name,e.change,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("d_finir_la_vale_27863")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("choisissez_une_24029")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(np,{value:t,onChange:o,children:n("je_souhaite_d_f_72912")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(eb,{...e})]})]})},PO=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=oS([...t?["event"]:[],"organization"],{eventsCustomFields:!1}),o=oS(["user",...t?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:"form"}),{isNotSavedModalOpen:a,onClose:r,onNotSavedClose:d,onSave:l}=jO(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(Oz,{button:(0,i.jsx)(tc,{isLoading:e.isMutateLoading,onClick:l,children:n("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(_O,{isNotSavedOpen:a,onNotSavedClose:d,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"hasWeezTicketForm",children:n=>{n||e.change("form.ticketUrl","")}}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("initialisation_29288")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_27381")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("nom_du_formulai_14952"),name:"form.name"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:n("affectation_des_81808")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Xx,{name:"form.setAssignmentStateToWaiting",children:n("les_membres_ser_52180")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:n("accr_ditation_d_48426")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Xx,{name:"form.setAccreditationStateToWaiting",children:n("les_membres_ser_34727")})]}),(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("param_trage_de_41992")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("donner_la_possi_56694")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:n("inscriptions_mu_35073")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(df,{name:"form.allowMultiProfiles",children:n("autoriser_les_i_26880")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:n("remplissages_mu_72343")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(df,{name:"form.canRefill",subtext:n("permet_aux_memb_26701"),children:n("autoriser_les_m_44818")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:n("inscriptions_en_77739")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(df,{name:"form.areTeamsAllowed",children:n("permettre_aux_m_56083")}),e.values.form.areTeamsAllowed&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(df,{name:"form.teamMemberFillFullForm",children:n("tous_les_membre_59937")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("nombre_maximum_14615"),name:"form.maxTeamMembers",shouldParseAsInt:!0})]})]}),(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(MO,{change:e.change,customFields:e.customFields,name:"form.customFields",values:e.values.form.customFields}),(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("texte_de_l_tap_00197")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_68212")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)($c,{name:"form.emailTitle"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("description_de_80800")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("la_description_13257")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(iS,{name:"form.description",variables:s}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("texte_de_l_tap_92536")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_66470")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)($c,{name:"form.informationTitle"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("texte_du_bouton_05866")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_02611")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)($c,{name:"form.registerButtonText"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("texte_de_l_tap_59788")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_10000")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)($c,{name:"form.successTitle"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("message_de_succ_99510")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_55334")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(iS,{name:"form.successMessage",variables:o}),e.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("int_gration_10662")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(lc,{alertStyle:"primary",children:[(0,i.jsx)(cc,{children:n("comment_l_int_g_52949")}),(0,i.jsx)(uc,{children:n("le_widget_sera_08013")})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(df,{name:"hasWeezTicketForm",children:n("ajouter_un_widg_55295")}),e.values.hasWeezTicketForm&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(rf,{label:n("lien_vers_le_wi_55308"),name:"form.ticketUrl"})]})]}),(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("_dition_des_inf_90758")}),(0,i.jsx)(Mr,{color:"gray500",children:n("donner_la_possi_56683")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:n("espace_membre_06532")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(df,{name:"form.isEditableInMemberSpace",children:n("permettre_aux_m_40630")})]})})})},kO=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=Kl(),{data:s,loader:o}=Li("query FormParametersGeneral($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n isWeezeventConnected\n }\n\n form(id: $formId) {\n name\n setAssignmentStateToWaiting\n setAccreditationStateToWaiting\n allowMultiProfiles\n canRefill\n description\n successTitle\n successMessage\n areTeamsAllowed\n maxTeamMembers\n teamMemberFillFullForm\n emailTitle\n informationTitle\n registerButtonText\n isEditableInMemberSpace\n ticketUrl\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,eventId:n,formId:t},[$o.MassEditCustomFieldFragment]);Au(s.organization?.form.name??"");const a=ki(Ol),r=ki(DO),{mutate:d,isLoading:l}=function(e={}){return Ui("mutation FormParametersGeneralUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersGeneralInput!\n) {\n formParametersGeneralUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=V.useMemo(()=>{const e=r.formParametersGeneralInputDefault(s.organization?.form);return{form:e,hasWeezTicketForm:g(e.ticketUrl)}},[s.organization]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(xc,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:t})=>(0,i.jsx)(PO,{change:e.change,customFields:s.organization?.customFields.nodes??[],handleSubmit:n,initialValues:c,isMutateLoading:l,isWeezeventConnected:s.organization?.event?.isWeezeventConnected??!1,loader:o,name:s.organization?.form.name??"",values:t}),validate:a.validateForForm(r.updateFormParametersGeneralSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:{...i.form,description:i.form.description||"",successMessage:i.form.successMessage||""}})})})};let FO=class extends Rc{constructor(e){super(e)}formParametersStateInputDefault(e){return{state:e?.state||an.Open,closedTitle:e?.closedTitle||"",closedMessage:e?.closedMessage||"",closedAt:e?.closedAt||null}}formParametersStateInputSchema(){return zc.Ik().shape({state:zc.Yj().required(this.t("cl_turer_le_for_10541")).oneOf(Yt,this.t("cl_turer_le_for_10541")),closedMessage:zc.Yj(),closedAt:lf.when("state",{is:an.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 zc.Ik().shape({form:this.formParametersStateInputSchema()})}};FO=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],FO);const NO=e=>{const{translate:n,params:{eventId:t}}=Kl(),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:a,onSave:r}=jO(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(Oz,{button:(0,i.jsx)(tc,{isLoading:e.isMutateLoading,onClick:r,children:n("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(_O,{isNotSavedOpen:s,onNotSavedClose:a,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"form.state",children:n=>{n!==an.ClosedAt&&e.change("form.closedAt",null)}}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("cl_turer_le_for_46483")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("choisir_si_le_f_14519")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(xS,{name:"form.state",value:an.Open,children:n("ne_pas_cl_turer_46870")}),(0,i.jsx)(Pl,{height:"3"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xS,{name:"form.state",value:an.CloseWhenEventDone,children:n("cl_turer_le_for_61719")}),(0,i.jsx)(Pl,{height:"3"})]}),(0,i.jsx)(xS,{name:"form.state",value:an.Closed,children:n("cl_turer_le_for_10120")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"form.state",value:an.ClosedAt,children:n("cl_turer_le_for_19176")}),e.values.form.state===an.ClosedAt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(MC,{name:"form.closedAt"})]})]}),e.values.form.state!==an.Open&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("nom_de_l_tape_85862"),name:"form.closedTitle"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(iS,{hint:n("ce_message_sera_03472"),label:n("message_de_cl_t_95276"),name:"form.closedMessage"})]})]})})})},LO=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=Kl(),{data:s,loader:o}=Li("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:t},[]);Au(s.organization?.form.name??"");const a=ki(Ol),r=ki(FO),{mutate:d,isLoading:l}=function(e={}){return Ui("mutation FormParametersStateUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersStateInput!\n) {\n formParametersStateUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=V.useMemo(()=>({form:r.formParametersStateInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:t})=>(0,i.jsx)(NO,{change:e.change,handleSubmit:n,initialValues:c,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",values:t}),validate:a.validateForForm(r.updateFormParametersStateSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:i.form})})},UO="custom-document",VO="documents",BO="position",WO="user",GO="preview",qO=({userInfoId:e,...n})=>Xi([YO.DOCUMENTS(n),WO,e]),HO=({positionId:e,...n})=>Xi([YO.DOCUMENTS(n),BO,e]),YO={DOCUMENTS:e=>Xi([Rs.EVENT(e),VO]),CREATE_CUSTOM_DOCUMENT:e=>is(YO.DOCUMENTS(e)),EDIT_CUSTOM_DOCUMENT:({customDocumentId:e,...n})=>ss(Xi([Rs.EVENT(n),UO,e])),USER_CUSTOM_DOCUMENT:({customDocumentId:e,...n})=>Xi([qO(n),UO,e]),USER_CUSTOM_DOCUMENT_PREVIEW:e=>Xi([YO.USER_CUSTOM_DOCUMENT(e),GO]),USER_CUSTOM_DOCUMENT_HISTORY:e=>Xi([YO.USER_CUSTOM_DOCUMENT(e),ns.HISTORY]),USER_PLANNING:e=>Xi([qO(e),"planning"]),USER_PLANNING_LIST:e=>Xi([qO(e),"planning-list"]),USER_PLANNING_DAYS:e=>Xi([qO(e),"planning-days"]),USER_ASSIGNMENTS:e=>Xi([qO(e),"assignments"]),USER_BADGE:({badgeType:e,...n})=>Xi([qO(n),"badge",e]),USER_CERTIFICATE:e=>Xi([qO(e),"certificate"]),USER_HOURS:e=>Xi([qO(e),"hours"]),USERS_LISTING:({segmentId:e,...n})=>Xi([YO.DOCUMENTS(n),"users-listing",e]),POSITIONS_PLANNING:({segmentId:e,...n})=>Xi([YO.DOCUMENTS(n),"positions-planning",e]),POSITIONS_VOLUNTEERS_PLANNING:({segmentId:e,...n})=>Xi([YO.DOCUMENTS(n),"positions-volunteers-planning",e]),USERS_PICTURES:({segmentId:e,...n})=>Xi([YO.DOCUMENTS(n),"users-pictures",e]),POSITION_SHEET:e=>Xi([HO(e),"sheet"]),POSITION_PLANNING:e=>Xi([HO(e),"planning"]),ASO_PAX_MANIFEST:({accreditationSlotId:e,...n})=>Xi([YO.DOCUMENTS(n),"aso-pax-manifest",e]),DELEGATION_CALENDAR:({delegationId:e,...n})=>Xi([YO.DOCUMENTS(n),"delegation",e,"calendar"])},ZO={PLURAL:"accreditation-profile-categories",SINGLE:"accreditation-profile-category"},KO={PLURAL:"accreditation-profiles",SINGLE:"accreditation-profile"},XO=e=>Xi([ZO.SINGLE,e]),QO=e=>Xi([KO.SINGLE,e]),JO={ACCREDITATIONS_PROFILES_IMPORT:e=>Xi([Rs.EVENT(e),KO.PLURAL,es.IMPORT]),ACCREDITATIONS_PROFILE_CREATE:({accreditationProfileCategoryId:e,...n})=>Xi([Rs.EVENT(n),KO.PLURAL,es.CREATE,...e?[e]:[]]),ACCREDITATIONS_PROFILES:e=>Xi([Rs.EVENT(e),KO.PLURAL]),ACCREDITATIONS_PROFILES_SEGMENT:({segmentId:e,...n})=>Xi([JO.ACCREDITATIONS_PROFILES(n),e]),ACCREDITATIONS_PROFILE:({accreditationProfileId:e,...n})=>Xi([Rs.EVENT(n),QO(e)]),ACCREDITATIONS_PROFILE_DASHBOARD:e=>Xi([JO.ACCREDITATIONS_PROFILE(e),ns.DASHBOARD]),ACCREDITATIONS_PROFILE_MEMBERS:e=>Xi([JO.ACCREDITATIONS_PROFILE(e),ns.MEMBERS]),ACCREDITATIONS_PROFILE_CATEGORY:({accreditationProfileCategoryId:e,...n})=>Xi([Rs.EVENT(n),XO(e)]),ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD:e=>Xi([JO.ACCREDITATIONS_PROFILE_CATEGORY(e),ns.DASHBOARD]),ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS:e=>Xi([JO.ACCREDITATIONS_PROFILE_CATEGORY(e),ns.MEMBERS]),ACCREDITATIONS_PROFILE_EDIT:({accreditationProfileId:e,...n})=>Xi([Rs.EVENT(n),QO(e),es.EDIT])};function eR(e,n,t){return(0,kl.A)([t.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:Rj.CREATE({organizationId:n})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:hs.COMMUNITY_USERS({organizationId:n})},t.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:yo.CREATE_EVENT(n)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${us.ORGANIZATION({organizationId:n})}/events`},t.canCustomFieldEdit?{icon:"text",text:e("cr_eer_un_champ_08883"),link:mj.CREATE({organizationId:n})}:null,t.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:mj.CUSTOM_FIELDS({organizationId:n})}:null,t.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:$s.CREATE({organizationId:n})}:null,t.canFormEdit?{icon:"file-lines",text:e("voir_les_formul_55824"),link:$s.FORMS({organizationId:n})}:null,t.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:yo.COMMUNITY_CREATE_DELEGATION(n)}:null,t.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:Js.DELEGATIONS({organizationId:n})}:null,t.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:Gj.CREATE({organizationId:n})}:null,t.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:Gj.CAMPAIGNS({organizationId:n})}:null,t.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:Yj.CREATE({organizationId:n})}:null,t.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:Yj.WORKFLOWS({organizationId:n})}:null])}function nR(e,n,t,i){return(0,kl.A)([i.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:Rj.CREATE({organizationId:n,eventId:t})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:yo.VOLUNTEERS(n,t)},i.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:yo.CREATE_EVENT(n)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${us.ORGANIZATION({organizationId:n})}/events`},i.canCustomFieldEdit?{icon:"text",text:e("cr_eer_un_champ_08883"),link:mj.CREATE({organizationId:n,eventId:t})}:null,i.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:mj.CUSTOM_FIELDS({organizationId:n,eventId:t})}:null,i.canPositionEdit?{icon:"sitemap",text:e("cr_er_une_missi_66818"),link:yo.CREATE_POSITION(n,t)}:null,i.canPositionRead?{icon:"sitemap",text:e("voir_les_missio_71964"),link:oo.POSITIONS({organizationId:n,eventId:t})}:null,i.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:$s.CREATE({organizationId:n,eventId:t})}:null,i.canFormRead?{icon:"file-lines",text:e("voir_les_formul_55824"),link:$s.FORMS({organizationId:n,eventId:t})}:null,i.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_une_accr_33475"),link:yo.CREATE_ACCREDITATION(n,t)}:null,i.canAccreditationRead?{icon:"badge-check",text:e("voir_les_accr_d_34867"),link:Ws.ACCREDITATIONS({organizationId:n,eventId:t})}:null,i.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_un_profil_01464"),link:JO.ACCREDITATIONS_PROFILE_CREATE({organizationId:n,eventId:t})}:null,i.canAccreditationRead?{icon:"badge-check",text:e("voir_les_profil_55935"),link:JO.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t})}:null,i.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:yo.CREATE_DELEGATION(n,t)}:null,i.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:Js.DELEGATIONS({organizationId:n,eventId:t})}:null,i.canDelegationsSpaceParamEdit?{icon:"brush",text:e("cr_er_un_layout_13164"),link:xT.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:n,eventId:t})}:null,i.canDelegationsSpaceParamRead?{icon:"brush",text:e("voir_les_layout_36965"),link:xT.DELEGATIONS_SPACE_LAYOUTS({organizationId:n,eventId:t})}:null,i.canCustomDocumentEdit?{icon:"file",text:e("cr_er_un_docume_92512"),link:YO.CREATE_CUSTOM_DOCUMENT({organizationId:n,eventId:t})}:null,i.canDocumentRead?{icon:"file",text:e("voir_les_docume_33988"),link:YO.DOCUMENTS({organizationId:n,eventId:t})}:null,i.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:Gj.CREATE({organizationId:n,eventId:t})}:null,i.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:Gj.CAMPAIGNS({organizationId:n,eventId:t})}:null,i.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:Yj.CREATE({organizationId:n,eventId:t})}:null,i.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:Yj.WORKFLOWS({organizationId:n,eventId:t})}:null])}function tR(e){switch(e.segmentType){case Bn.Accreditations:return e.eventId?yo.ACCREDITATIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case Bn.AccreditationsProfiles:return e.eventId?JO.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:e.organizationId,eventId:e.eventId,segmentId:e.id}):"";case Bn.Campaigns:return Gj.CAMPAIGNS_SEGMENT({organizationId:e.organizationId,segmentId:e.id});case Bn.CustomFields:return mj.CUSTOM_FIELDS_SEGMENT({organizationId:e.organizationId,eventId:e.eventId??void 0,segmentId:e.id});case Bn.Delegations:return e.eventId?yo.DELEGATIONS_SEGMENT(e.organizationId,e.eventId,e.id):yo.COMMUNITY_DELEGATIONS_SEGMENT(e.organizationId,e.id);case Bn.Events:return yo.EVENTS_SEGMENT(e.organizationId,e.id);case Bn.Positions:return e.eventId?yo.POSITIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case Bn.Volunteers:return e.eventId?yo.VOLUNTEERS_SEGMENT(e.organizationId,e.eventId,e.id):yo.COMMUNITY_USERS_SEGMENT(e.organizationId,e.id);case Bn.Workflows:return Yj.WORKFLOWS_SEGMENT({organizationId:e.organizationId,eventId:e.eventId??void 0,segmentId:e.id});default:return Zl(e.segmentType)}}const iR=e=>(0,i.jsx)(Xm,{css:{"&:hover":{textDecoration:"none"}},hideIcon:!0,to:e.link,width:1,onClick:()=>{e.onClose()},children:(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",px:"$4","&:hover":{background:"$gray100"}},gap:"2",height:40,width:1,children:[e.avatar,e.icon&&(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:e.icon})}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:e.children})]})}),sR=e=>(0,i.jsx)(Tl,{css:{px:"$4"},children:(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:e.children})}),oR=e=>(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(sR,{children:e.title}),e.children]}),aR="h-open-omnibar",rR=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{hasFeature:o}=XS(),a=ay(),r=oy(),d=(0,V.useMemo)(()=>({...r,canCustomDocumentEdit:o(Ze.CustomDocument)&&r.canDocumentEdit}),[r,o]),l=ry(),[c,m]=(0,V.useState)(!1),[h,p]=(0,V.useState)(!1),[I,x,f]=Wm(""),[_,j]=(0,V.useState)([]),[v,S]=(0,V.useState)([]),[y,C]=(0,V.useState)([]),[b,A]=(0,V.useState)([]),[E,w]=(0,V.useState)([]),[$,T]=(0,V.useState)([]),[z,O]=(0,V.useState)([]),[R,D]=(0,V.useState)([]),[M,P]=(0,V.useState)([]),[k,F]=(0,V.useState)([]),[N,L]=(0,V.useState)([]),[U,B]=(0,V.useState)([]),[W,G]=(0,V.useState)([]),[q,H]=(0,V.useState)([]),[Y,Z]=(0,V.useState)(s?nR(n,t,s,d):eR(n,t,a)),K=(0,V.useMemo)(()=>Zo(Y)&&Zo(_)&&Zo(v)&&Zo(y)&&Zo(b)&&Zo(E)&&Zo($)&&Zo(z)&&Zo(R)&&Zo(M)&&Zo(k)&&Zo(N)&&Zo(U)&&Zo(W)&&Zo(q),[Y,_,v,y,b,E,$,z,R,M,k,N,U,W,q]),Q=(0,V.useCallback)(()=>{Z(s?nR(n,t,s,d):eR(n,t,a)),j([]),S([]),C([]),A([]),w([]),T([]),O([]),D([]),P([]),F([]),L([]),B([]),G([]),H([])},[t,s,a,d,Z,j,S,C,A,w,T,O,D,P,F,L,B,G,H]),J=(0,V.useCallback)(e=>{jc(e),p(!1),f(""),Q(),m(e=>!e)},[m,p,f,Q]),ee=(0,V.useCallback)(()=>{m(!1)},[m]);return ip("k",J),wu(ee),Eu(ee),(0,V.useEffect)(()=>(document.addEventListener(aR,J),()=>{document.removeEventListener(aR,J)}),[J]),(0,V.useEffect)(()=>{(async()=>{if(g(x)){if(p(!0),s){const{organization:o,event:a}=await(e={organizationId:t,eventId:s,name:x},i=await X(),oa('query EventOmnibar($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, name: $name, limit: 5) {\n nodes {\n id\n eventId\n name\n }\n }\n\n events(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n accreditations(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n accreditationsProfiles(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n campaigns(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customDocuments {\n id\n name\n }\n\n delegations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n delegationsSpaceLayouts(name: $name) {\n id\n name\n }\n\n forms(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n positions(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\n }\n\n teams(name: $name, limit: 5) {\n nodes {\n teamCode\n }\n }\n\n volunteersRegistrations(\n columnsSearch: [\n "email"\n "id"\n "name"\n "phone"\n "teamCode"\n "weezevent_barcode_id"\n "weezevent_short_tag"\n ]\n name: $name\n limit: 5\n ) {\n nodes {\n userInfo {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n }\n\n workflows(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{variables:e,token:i||void 0,fragments:[]}));Z(nR(n,t,s,d).filter(e=>u(e.text).includes(u(x)))),j(a.volunteersRegistrations.nodes.map(e=>e.userInfo)),S(r.canEventEdit?o.events.nodes:[]),C(o.customFields.nodes.filter(l)),A(r.canPositionRead?a.positions.nodes:[]),w(r.canFormRead?a.forms.nodes:[]),T(r.canDocumentEdit?a.customDocuments.filter(e=>u(e.name).includes(u(x))).slice(0,5):[]),O(r.canAccreditationRead?a.accreditations.nodes:[]),D(r.canAccreditationRead?a.accreditationsProfiles.nodes:[]),P(r.canDelegationRead?a.delegations.nodes:[]),F(r.canDelegationsSpaceParamEdit?a.delegationsSpaceLayouts:[]),L(r.canCampaignRead?a.campaigns.nodes:[]),B(r.canWorkflowRead?a.workflows.nodes:[]),G(a.segments),H(r.canMemberAssign?a.teams.nodes:[])}else{const{organization:e}=await function(e,n){return oa("query OrganizationOmnibar($organizationId: OrganizationId!, $name: String) {\n organization(id: $organizationId) {\n accreditations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n accreditationsProfiles(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n campaigns(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFields(name: $name, limit: 5) {\n nodes {\n id\n eventId\n name\n }\n }\n\n delegations(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n events(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n forms(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n positions(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\n }\n\n usersInfos(name: $name, limit: 5) {\n nodes {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n\n workflows(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[]})}({organizationId:t,name:x},await X());Z(eR(n,t,a).filter(e=>u(e.text).includes(u(x)))),j(e.usersInfos.nodes),S(e.events.nodes),C(a.canCustomFieldRead?e.customFields.nodes:[]),A(a.canPositionRead?e.positions.nodes:[]),w(a.canFormRead?e.forms.nodes:[]),T([]),O(a.canAccreditationRead?e.accreditations.nodes:[]),D(a.canAccreditationRead?e.accreditationsProfiles.nodes:[]),P(a.canDelegationRead?e.delegations.nodes:[]),F([]),L(a.canCampaignRead?e.campaigns.nodes:[]),B(a.canWorkflowRead?e.workflows.nodes:[]),G(e.segments)}p(!1)}else Q();var e,i})()},[t,s,a,r,d,l,x,p,Z,j,S,C,A,w,T,O,D,P,F,L,B,G,H,Q]),c&&("organization"===e.level&&!s||"event"===e.level&&s)?(0,St.createPortal)((0,i.jsx)(Tl,{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)(Tl,{css:{background:"white",borderRadius:"$3",overflow:"hidden"},direction:"column",width:640,onClick:e=>jc(e),children:[(0,i.jsx)(Mr,{css:{"& .h-styled-input-container":{height:"48px"}},height:48,children:(0,i.jsx)(wc,{autoFocus:!0,css:{borderBottom:"1px solid $gray200","& .h-styled-input-container":{border:"none"}},height:"fluid",icon:"magnifying-glass",placeholder:n("rechercher_un_m_45772"),value:I,onChange:f})}),(0,i.jsx)(Tl,{css:{overflowY:"auto",py:"$4"},direction:"column",height:350,children:h?(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:36}),(0,i.jsx)(Qu,{borderRadius:"$1",height:36}),(0,i.jsx)(Qu,{borderRadius:"$1",height:36})]}):K?(0,i.jsxs)(Tl,{align:"center",direction:"column",gap:"4",height:1,justify:"center",children:[(0,i.jsx)(Tl,{align:"center",css:{bd:!0,fontSize:"$textMd"},height:48,justify:"center",width:48,children:(0,i.jsx)(Yl,{icon:"magnifying-glass"})}),(0,i.jsx)(Mr,{font:"gray900 textSm semiBold",children:n("aucun_r_sultat_73664",x)})]}):(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[Yo(Y)&&(0,i.jsx)(oR,{title:n("actions_rapides_42479"),children:Y.map((e,n)=>(0,i.jsx)(iR,{icon:e.icon,link:e.link,onClose:ee,children:e.text},n))}),Yo(_)&&(0,i.jsx)(oR,{title:n("membres_11310"),children:_.map(e=>(0,i.jsx)(iR,{avatar:(0,i.jsx)(t_,{email:e.email,image:e.picture?.url,name:e.name,size:24}),link:Rj.MEMBER_INFORMATION({organizationId:t,eventId:s,userInfoId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(v)&&(0,i.jsx)(oR,{title:n("Event"),children:v.map(e=>(0,i.jsx)(iR,{icon:"cake-candles",link:Rs.EVENT({organizationId:t,eventId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(y)&&(0,i.jsx)(oR,{title:n("champs_de_formu_64126"),children:y.map(e=>(0,i.jsx)(iR,{icon:"text",link:mj.UPDATE({organizationId:t,eventId:e.eventId??void 0,customFieldId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(b)&&(0,i.jsx)(oR,{title:n("missions_63972"),children:b.map(e=>(0,i.jsx)(iR,{icon:"sitemap",link:oo.POSITION({organizationId:t,eventId:s,positionId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(E)&&(0,i.jsx)(oR,{title:n("Form_plural"),children:E.map(e=>(0,i.jsx)(iR,{icon:"file-lines",link:$s.FORM_ELEMENTS({organizationId:t,eventId:s,formId:e.id}),onClose:ee,children:e.name},e.id))}),Yo($)&&(0,i.jsx)(oR,{title:n("documents_perso_87374"),children:$.map(e=>(0,i.jsx)(iR,{icon:"file",link:YO.EDIT_CUSTOM_DOCUMENT({organizationId:t,eventId:s,customDocumentId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(z)&&(0,i.jsx)(oR,{title:n("accr_ditations_39450"),children:z.map(e=>(0,i.jsx)(iR,{icon:"badge-check",link:Ws.ACCREDITATION({organizationId:t,eventId:s,accreditationId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(R)&&(0,i.jsx)(oR,{title:n("profils_d_accr_27825"),children:R.map(e=>(0,i.jsx)(iR,{icon:"badge-check",link:JO.ACCREDITATIONS_PROFILE({organizationId:t,eventId:s,accreditationProfileId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(M)&&(0,i.jsx)(oR,{title:n("d_l_gations_78318"),children:M.map(e=>(0,i.jsx)(iR,{icon:"users",link:Js.DELEGATION({organizationId:t,eventId:s,delegationId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(k)&&(0,i.jsx)(oR,{title:n("layouts_27757"),children:k.map(e=>(0,i.jsx)(iR,{icon:"brush",link:xT.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:t,eventId:s,delegationsSpaceLayoutId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(N)&&(0,i.jsx)(oR,{title:n("Campaigns"),children:N.map(e=>(0,i.jsx)(iR,{icon:"paper-plane",link:Gj.CAMPAIGN_DASHBOARD({organizationId:t,eventId:s,campaignId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(U)&&(0,i.jsx)(oR,{title:n("automatisations_60045"),children:U.map(e=>(0,i.jsx)(iR,{icon:"hand-sparkles",link:Yj.WORKFLOW({organizationId:t,eventId:s,workflowId:e.id}),onClose:ee,children:e.name},e.id))}),Yo(W)&&(0,i.jsx)(oR,{title:n("vues_personnali_80652"),children:W.map(e=>(0,i.jsx)(iR,{link:tR(e),onClose:ee,children:e.name},e.id))}),Yo(q)&&(0,i.jsx)(oR,{title:n("_quipes_18817"),children:q.map(e=>(0,i.jsx)(iR,{link:yo.TEAM_ASSIGNMENT(t,s,e.teamCode),onClose:ee,children:e.teamCode},e.teamCode))})]})})]})}),document.body):null},dR=(0,V.memo)(function(){const{translate:e}=Kl(),{pathname:n}=Wi(),{organization:t,selectedEventId:s}=XS(),[o,a]=(0,V.useState)(!1),r=n===Rs.EVENTS({organizationId:t.id})||null!==n.match(/\/events/)||null!==n.match(/\/event\/\d+/),d=(0,Lm.A)(t.events.nodes.filter(e=>e.state===qe.Ongoing||e.state===qe.Upcoming),e=>e.name),l=t.events.nodes.find(e=>e.id===s);return(0,i.jsxs)(Ou,{onStateChange:a,children:[(0,i.jsx)(Nu,{children:(0,i.jsxs)(Tl,{align:"center","aria-expanded":o,"aria-label":e("ouvrir_la_liste_52670"),"aria-selected":o,css:{blockSize:"100%",color:"white",opacity:r?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},gap:"2",role:"button",onClick:e=>{e.nativeEvent.stopImmediatePropagation(),document.getElementById("events-menu")?.focus()},children:[l?l.name:e("_v_nements_53672"),o?(0,i.jsx)(Yl,{icon:"angle-up"}):(0,i.jsx)(Yl,{icon:"angle-down"})]})}),(0,i.jsxs)(Fu,{"aria-orientation":"vertical",id:"events-menu",maxHeight:300,offset:-10,placement:"bottom-start",children:[(0,i.jsx)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:d.map(e=>(0,i.jsx)(Mu,{to:Rs.EVENT({organizationId:t.id,eventId:e.id}),onClick:e=>{Tu(e.target),document.getElementById("main")?.focus()},children:e.name},e.id))}),(0,i.jsx)(sI,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Mu,{to:Rs.EVENTS({organizationId:t.id}),onClick:e=>{Tu(e.target),document.getElementById("main")?.focus()},children:e("tous_les_v_nem_16033")})]})]})});var lR,cR;function uR(){return uR=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const{translate:n,params:{eventId:t}}=Kl(),{organization:s}=XS(),o=(0,V.useMemo)(()=>{let n=`https://admin.${F.WEEZEVENT_DOMAIN}/ticket/O${e.weezeventOrganizationId}`;if(t){const e=s.events.nodes.find(e=>e.id===t);"number"==typeof e?.weezeventEventId&&(n+=`/E${e.weezeventEventId}`)}return n},[t,s]),a=`https://admin.${F.WEEZEVENT_DOMAIN}/access/O${e.weezeventOrganizationId}`,r=`https://admin.${F.WEEZEVENT_DOMAIN}/pay/#!/${e.weezeventOrganizationId}`;return(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Tl,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",children:(0,i.jsx)(Tl,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(Yl,{icon:"grid",iconStyle:"solid"})})})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Tl,{css:{padding:"$3 $4"},direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("passer_75488")}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(ql,{to:o,children:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(Mr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(jR,{})}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:"WeezTicket"}),(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:n("billetterie_53780")})]})]})}),(0,i.jsx)(ql,{to:a,children:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(Mr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(mR,{})}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:"WeezAccess"}),(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:n("contr_le_d_acc_03854")})]})]})}),(0,i.jsx)(ql,{to:r,children:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(Mr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(IR,{})}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:"WeezPay"}),(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:"Cashless"})]})]})})]})]})})]})},SR=({to:e,children:n,isActive:t,onClick:s})=>{const{pathname:o}=Wi(),a=t?t(o):e===o;return(0,i.jsx)(Tl,{"aria-selected":a,css:{alignItems:"center",blockSize:"100%",color:"white",cursor:"pointer",opacity:a?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},height:1,role:"menuitem",children:(0,i.jsx)(ql,{height:1,to:e,width:1,onClick:s,children:n})})},yR=(0,V.memo)(function(){const{translate:e,params:{organizationId:n}}=Kl(),{organization:t,user:s,updateLocalOrganization:o,hasOrganizationRole:a}=XS(),{canShow:r,show:d}=HS(),{canCustomFieldRead:l}=ay(),{data:c}=Vd({}),[u,m]=(0,V.useState)(!1),h=(0,V.useMemo)(()=>{const e=(0,fm.A)(c.user?.roles??[],e=>e.organizationId);return(0,Lm.A)((c.organizations||[]).filter(n=>Yo(e[n.id])),e=>e.name)},[c.organizations,c.user]);return(0,i.jsxs)(Tl,{align:"center",css:{background:"$blueGray900",color:"white",cursor:"pointer",position:"relative",px:"$6"},height:1,justify:"between",width:1,children:[(0,i.jsx)(Tl,{align:"center","aria-label":e("page_d_accueil_12532"),css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(ql,{height:1,to:Rs.EVENTS({organizationId:n}),children:Uj(n)?.logo??(0,i.jsx)(Gc,{})})}),(0,i.jsx)(Tl,{"aria-label":e("menu_de_l_organ_58508"),as:El.Nav,height:1,children:(0,i.jsxs)(Tl,{align:"center",justify:"center",role:"menubar",children:[(0,i.jsx)(dR,{}),l&&(0,i.jsx)(SR,{isActive:e=>e.startsWith(mj.CUSTOM_FIELDS({organizationId:n})),to:mj.CUSTOM_FIELDS({organizationId:n}),onClick:async()=>await o({customFieldsSegmentId:null}),children:e("champs_de_formu_64126")}),a&&(0,i.jsx)(SR,{isActive:e=>e.startsWith(hs.COMMUNITY({organizationId:n})),to:hs.COMMUNITY_USERS({organizationId:n}),children:e("communaut_20896")}),(0,i.jsx)(SR,{isActive:e=>e.startsWith(yo.ORGANIZATION_PARAMETERS(n)),to:yo.ORGANIZATION_PARAMETERS_PROFILE(n),children:e("param_tres_78420")})]})}),(0,i.jsxs)(Tl,{align:"center",gap:"6",justify:"end",width:300,children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Tl,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",role:"button",onClick:()=>{window.open("https://upmoon.app/weezevent?labels=weezcrew","_blank")},children:(0,i.jsx)(Tl,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(Yl,{icon:"megaphone"})})}),r&&(0,i.jsx)(Tl,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",role:"button",onClick:d,children:(0,i.jsx)(Tl,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(Yl,{icon:"messages-question"})})}),"number"==typeof t.weezeventOrganizationId&&(0,i.jsx)(vR,{weezeventOrganizationId:t.weezeventOrganizationId})]}),(0,i.jsxs)(Ou,{"aria-label":e("menu_utilisateu_40033"),"aria-orientation":"vertical",isOpen:u,onStateChange:m,children:[(0,i.jsx)(Nu,{children:(0,i.jsxs)(Tl,{align:"center","aria-expanded":u,"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)(t_,{email:s.email,image:s.userInfo.picture?.url,name:s.userInfo.name,size:32}),(0,i.jsxs)(Mr,{css:{maxWidth:"calc(100% - 66px)"},children:[(0,i.jsx)(Mr,{css:{ellipsis:!0},fontWeight:"semiBold",children:s.userInfo.firstName||s.email}),(0,i.jsx)(Mr,{css:{ellipsis:!0},fontSize:"textXs",children:t.name})]}),(0,i.jsx)("div",{children:u?(0,i.jsx)("i",{className:"far fa-angle-up"}):(0,i.jsx)("i",{className:"far fa-angle-down"})})]})}),(0,i.jsxs)(Fu,{"aria-orientation":"vertical",id:"user-menu",maxHeight:500,placement:"bottom-end",width:300,children:[(0,i.jsx)(Mu,{children:(0,i.jsxs)(Tl,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(t_,{email:s.email,image:s.userInfo.picture?.url,name:s.userInfo.name,size:32}),(0,i.jsxs)(Mr,{css:{width:"calc(100% - 44px)"},children:[(0,i.jsx)(Mr,{css:{ellipsis:!0},fontWeight:"semiBold",children:s.userInfo.name||s.email}),g(s.userInfo.name)&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},children:s.email})]})]})}),(0,i.jsx)(sI,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Tl,{as:El.Nav,direction:"column",role:"menubar",children:[h.map(({id:e,name:n})=>(0,i.jsx)(Mu,{onClick:async()=>{await o({eventsSegmentId:null}),location.href=`${F.HEAVENT_APP_URL.pathname}${Rs.EVENTS({organizationId:e})}`,document.getElementById("main")?.focus()},children:n},e)),(0,i.jsx)(sI,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Mu,{to:yo.ORGANIZATION_PARAMETERS_PROFILE(n),onClick:()=>{m(!1),document.getElementById("main")?.focus()},children:e("mon_profil_48224")}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Mu,{to:yo.ORGANIZATION_PARAMETERS_INFOS(n),onClick:()=>{m(!1),document.getElementById("main")?.focus()},children:e("organisation_71863")})}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Mu,{to:yo.ORGANIZATION_PARAMETERS_TEAM(n),onClick:()=>{m(!1),document.getElementById("main")?.focus()},children:e("utilisateurs_04975")})}),(0,i.jsx)(sI,{color:"gray100",direction:"horizontal"}),Ym(s.email)&&(0,i.jsx)(Mu,{to:yo.BACKOFFICE,onClick:()=>{document.getElementById("main")?.focus()},children:e("back_office_83072")}),(0,i.jsx)(Mu,{color:"red",onClick:J,children:e("se_d_connecter_74151")})]})]})]})]})]})}),CR=[1033,1538,1787,2574,2954,3059,3854,3900].concat([1823,2659]),bR=e=>{const{translate:n,params:{organizationId:t}}=Kl(),s=Wi(),{organization:o}=XS(),[a,r]=V.useState(!1),d=function(e){return Math.ceil(e.periodEndAt.diff(Oo.c9.utc(),"days").days)}(o),l=(c=d)>0&&c<=15;var c;const u=o.invoices.length>0,m=V.useCallback(()=>{r(!0)},[r]);if(V.useEffect(()=>(document.addEventListener(sa,m),()=>{document.removeEventListener(sa,m)}),[]),o.isBlocked&&!s.pathname.endsWith(ds))return(0,i.jsx)(qi,{path:us.IS_BLOCKED(us.ORGANIZATION({organizationId:t}))});if(!o.isBlocked&&s.pathname.endsWith(ds))return(0,i.jsx)(qi,{path:us.ORGANIZATION({organizationId:t})});if(d<=0&&!s.pathname.endsWith(ls))return(0,i.jsx)(qi,{path:us.IS_EXPIRED(us.ORGANIZATION({organizationId:t}))});if(d>0&&s.pathname.endsWith(ls))return(0,i.jsx)(qi,{path:us.ORGANIZATION({organizationId:t})});{const s=u&&!CR.includes(t),c=64+(a?40:0)+(l||s?64:0);return(0,i.jsxs)(Tl,{css:{overflow:"hidden"},direction:"column",height:1,role:"presentation",width:1,children:[a&&(0,i.jsxs)(Tl,{align:"center",css:{background:"$primary100",px:"$6"},gap:"1",height:40,justify:"between",role:"alert",width:1,children:[(0,i.jsx)(Mr,{}),(0,i.jsxs)(Tl,{gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",children:n("une_nouvelle_ve_69718")}),(0,i.jsx)(tc,{color:"invisible",css:{height:"auto",padding:0},type:"button",onClick:()=>{window.location.reload()},children:n("cliquez_pour_re_36838")})]}),(0,i.jsx)(Mr,{color:"white",css:{cursor:"pointer"},fontSize:"textMd",onClick:()=>{r(!1)},children:(0,i.jsx)(Yl,{icon:"xmark"})})]}),l&&!s&&(0,i.jsx)(Tl,{align:"center",css:{background:"$primary500",color:"white"},dangerouslySetInnerHTML:{__html:`

${n("trial_remaining_days",d,`${F.EMAIL_FROM}`,uu)}

`},height:64,justify:"center",width:1}),s&&(0,i.jsx)(Tl,{align:"center",css:{background:"$primary500",color:"white","& > a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:n("sauf_erreur_de_03325",o.invoices[0].url,o.invoices[0].invoiceNumber)},height:64,justify:"center",width:1}),(0,i.jsx)(Mr,{as:El.Header,height:64,width:1,children:(0,i.jsx)(yR,{})}),(0,i.jsx)(Mr,{as:El.Main,css:{height:`calc(100% - ${c}px)`},id:"main",tabIndex:-1,width:1,children:e.children}),(0,i.jsx)(rR,{level:"organization"})]})}};let AR=class extends Rc{countriesService;documentInputService;fieldInputService;phoneInputService;constructor(e,n,t,i,s){super(e),this.countriesService=n,this.documentInputService=t,this.fieldInputService=i,this.phoneInputService=s}userInfoUpdateInputDefault(e,n,t={}){const i=this.countriesService.getDefaultCountryValues(t.countryCode);return{id:e?.id??null,fields:this.fieldInputService.fieldsUpdateInputDefault(e?.fields||{},n,i,t.checkboxDefaultEmpty)}}updateUserInfoChangedFieldsSchema(e,n,t){return zc.Ik().shape({userInfo:zc.Ik().shape({fields:this.fieldInputService.changedFieldsSchema(e,n,t)})})}formUserInfoInputSchema(e){return zc.Ik().shape({fields:zc.Ik().shape(Object.fromEntries(e.map(({isMandatory:e,customField:n})=>[n.slug,this.fieldInputService.fieldSchema(n,e)])))})}userInfoProfileInputDefault(e){const n=this.countriesService.getDefaultCountryValues();return{email:e.email,fields:{firstName:e.userInfo?.fields?.firstName??"",lastName:e.userInfo?.fields?.lastName??"",language:e.language??e.userInfo?.fields?.language??n.user.language??Hn.En,picture:e.userInfo.fields.picture?(0,Fr.A)(e.userInfo.fields.picture,EC):this.documentInputService.documentInputDefault(),phone:e.userInfo.fields.phone?(0,Fr.A)(e.userInfo.fields.phone,K_):this.phoneInputService.phoneInputDefault(n)}}}userInfoFields(){return{fields:zc.Ik().shape({firstName:zc.Yj().nullable(),lastName:zc.Yj().nullable(),picture:this.documentInputService.documentInputSchemaNotRequired(),language:zc.Yj().required(this.t("les_langues_doi_27712")).oneOf(ru,this.t("les_langues_doi_27712")),phone:this.phoneInputService.phoneInputSchemaNotRequired()})}}userInfoProfileInputSchema(){return zc.Ik().shape({email:zc.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),...this.userInfoFields()})}updateProfileSchema(){return zc.Ik().shape({userInfo:this.userInfoProfileInputSchema()})}userInfoAndTermsInputDefault(e){return{...(0,_r.A)(e.userInfo,["id"]),termsAccepted:!1}}userInfoAndTermsInputSchema(){return zc.Ik().shape({firstName:zc.Yj().nullable(),lastName:zc.Yj().nullable(),phone:this.phoneInputService.phoneInputSchemaNotRequired(),termsAccepted:zc.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})}updateUserInfoAndTermsSchema(){return zc.Ik().shape({userInfoAndTerms:this.userInfoAndTermsInputSchema()})}};AR=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di,Ig,wC,zC,X_])],AR);let ER=class extends Rc{constructor(e){super(e)}volunteersRegistrationsSlotInputDefault(e){return{startDate:e||Oo.c9.invalid("Invalid"),startTime:"",endDate:e||Oo.c9.invalid("Invalid"),endTime:""}}volunteersRegistrationsSlotInputSchema(e,n){const t=n.plus({day:1}).endOf("day");return zc.Ik().shape({startDate:lf.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()),n=>n>=e),startTime:zc.Yj().required(this.t("heure_de_d_but_90785")),endDate:lf.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,n)=>Oo.c9.isDateTime(n.parent.startDate)&&n.parent.startDate.isValid&&Oo.c9.isDateTime(n.parent.endDate)&&n.parent.endDate.isValid&&n.parent.endDate>=n.parent.startDate).test("before-event-end-date",this.t("la_date_de_fin_49125",n.toLocaleString()),e=>e<=t),endTime:zc.Yj().required(this.t("l_heure_de_fin_78626"))})}};ER=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],ER);let wR=class extends Rc{translationService;volunteerRegistrationSlotInputService;constructor(e,n){super(e),this.translationService=e,this.volunteerRegistrationSlotInputService=n}slotsFields(e,n,t,i,s){switch(e){case Ln.Display:case Ln.DisplayDays:case Ln.Calendar:case Ln.Custom:return{slots:zc.YO().of(this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputSchema(t,i)).min(s?0:n,this.t("vous_devez_ajou_68961",n))};case Ln.Hide:return{};default:return Zl()}}volunteersRegistrationsSlotsUpdateInputDefault(e){return Yo(e)?e.map(e=>({startDate:e.startDate,startTime:e.startTime,endDate:e.endDate,endTime:e.endTime})):[]}volunteersRegistrationsWishedPositionsInputDefault(){return{positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[]}}volunteersRegistrationsWishedPositionsUpdateInputDefault(e){return e?{positionsCategoriesIds:e?.positionsCategoriesIds,positionsIds:e?.positionsIds,positionsSlotsIds:e?.positionsSlotsIds}:this.volunteersRegistrationsWishedPositionsInputDefault()}wishedPositionsFields(e,n,t){if(e===sn.Ranked){if(n===Fn.Category)return{positionsCategoriesIds:zc.YO().of(zc.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_32044")).test("different",this.t("les_missions_so_04441"),e=>{const n=(0,kl.A)((e||[]).filter(e=>-1!==e));return Yo(n)&&(0,wo.A)(n).length===n.length})};if(n===Fn.Position)return{positionsIds:zc.YO().of(zc.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const n=(0,kl.A)((e||[]).filter(e=>-1!==e));return Yo(n)&&(0,wo.A)(n).length===n.length})};if(n===Fn.Slot)return{positionsSlotsIds:zc.YO().of(zc.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const n=(0,kl.A)((e||[]).filter(e=>-1!==e));return Yo(n)&&(0,wo.A)(n).length===n.length})};throw new Error("Should not happen")}switch(n){case Fn.Category:return{positionsCategoriesIds:zc.YO().of(zc.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_32044"))};case Fn.Position:return{positionsIds:zc.YO().of(zc.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_89603"))};case Fn.Slot:return{positionsSlotsIds:zc.YO().of(zc.ai()).min(t?0:1,this.t("vous_devez_s_le_89603"))};case Fn.None:return{};default:return Zl()}}volunteersRegistrationsWishedAccreditationsInputDefault(){return{accreditationsSlotsIds:[]}}volunteersRegistrationsWishedAccreditationsUpdateInputDefault(e){return e?{accreditationProfileId:e.accreditationProfileId,accreditationsSlotsIds:e.accreditationsSlotsIds}:this.volunteersRegistrationsWishedAccreditationsInputDefault()}accreditationProfileFields(e,n){return e&&Yo(n)?{accreditationProfileId:zc.ai().required(this.t("vous_devez_s_le_07918"))}:{}}accreditationsFields(e,n,t){if(n)return{};switch(e){case Pn.Accreditation:return{accreditationsSlotsIds:zc.YO().of(zc.ai().typeError(this.t("s_lectionner_un_96571"))).min(t?0:1,this.t("vous_devez_s_le_72138"))};case Pn.None:return{};default:return Zl()}}userInfoAccreditationsSchema(e){return zc.Ik().shape({userInfo:zc.Ik().shape({accreditations:zc.YO().of(zc.Ik().shape({formId:zc.ai().required(),...this.accreditationsFields(e,null)}))})})}adminAddSchema(){return zc.Ik().shape({usersInfosIds:zc.YO().of(zc.ai()).min(1,this.t("vous_devez_s_le_83608")),sendVolunteerRegistrationEmail:zc.zM().required()})}};wR=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di,ER])],wR);let $R=class extends Rc{fieldInputService;userInfoInputService;volunteerRegistrationInputService;volunteerRegistrationSlotInputService;constructor(e,n,t,i,s){super(e),this.fieldInputService=n,this.userInfoInputService=t,this.volunteerRegistrationInputService=i,this.volunteerRegistrationSlotInputService=s}formRegisterInputDefault(e,n,t,i){return{autoAccredit:!1,forOther:i.forOther,positionsSlotsIds:i.team?.positionsSlotsIds??[],positionsIds:i.team?.positionsIds??[],positionsCategoriesIds:i.team?.positionsCategoriesIds??[],accreditationProfileId:null,accreditationsSlotsIds:(i.delegationAccreditationsSlots??[]).filter(e=>e.isDefault).map(e=>e.accreditationSlotId),userInfo:this.userInfoInputService.userInfoUpdateInputDefault(n,t,{countryCode:i.countryCode}),sendNotificationEmail:i.sendNotificationEmail,slots:i.team?.slots??(i.slotDisplay===Ln.Display?[this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputDefault(i.eventStartDate)]:[]),source:e}}formRegisterInformationsSchema(e){return zc.Ik().shape({formRegister:zc.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e)})})}formRegisterSlotsSchema(e,n,t,i){return zc.Ik().shape({formRegister:zc.Ik().shape({...this.volunteerRegistrationInputService.slotsFields(e,n,t,i)})})}formRegisterPositionsSchema(e,n){return zc.Ik().shape({formRegister:zc.Ik().shape({...this.volunteerRegistrationInputService.wishedPositionsFields(e,n)})})}formRegisterAccreditationsSchema(e,n,t,i){const s=function(e){return Object.values(e.reduce((e,n)=>{if(e[n.customField.slug]){const t=e[n.customField.slug];return{...e,[n.customField.slug]:{accreditationsSlotsIds:t.accreditationsSlotsIds.concat(n.accreditationsSlotsIds),customField:n.customField,isMandatory:t.isMandatory||n.isMandatory}}}return{...e,[n.customField.slug]:{accreditationsSlotsIds:n.accreditationsSlotsIds,customField:n.customField,isMandatory:n.isMandatory}}},{}))}(t);return zc.Ik().shape({formRegister:zc.Ik().shape({...this.volunteerRegistrationInputService.accreditationsFields(e,i),userInfo:zc.Ik().shape({fields:zc.Ik().shape(Object.fromEntries(s.map(e=>{const t=e.isMandatory&&Yo((0,mm.A)(e.accreditationsSlotsIds,n));return[e.customField.slug,this.fieldInputService.fieldSchema(e.customField,t)]})))})})})}formRegisterSchema(e,{accreditationDisplay:n,areSectionsDisabled:t,delegationAccreditationsProfiles:i,delegationId:s,eventEndDate:o,eventStartDate:a,minNumberOfSlots:r,positionDisplay:d,positionRanking:l,slotDisplay:c}){return zc.Ik().shape({email:zc.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),formRegister:zc.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e),...this.volunteerRegistrationInputService.slotsFields(c,r,a,o,t?.isWishedAssignmentsDisabled),...this.volunteerRegistrationInputService.wishedPositionsFields(l,d,t?.isWishedAssignmentsDisabled),...this.volunteerRegistrationInputService.accreditationsFields(n,s,t?.isWishedAccreditationsDisabled),...this.volunteerRegistrationInputService.accreditationProfileFields(s,i)})})}};$R=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di,zC,AR,wR,ER])],$R);const TR=e=>{const n=(0,V.useMemo)(()=>e.elements.flatMap(e=>e.elementType===tn.Field?(0,kl.A)([e.customField,e.conditionCustomField]):e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]).map(n=>yh(e.organizationId)&&Ch().includes(n.id)&&Yo(e.asoBannersColors)?{...n,values:n.values.filter(({id:n})=>e.asoBannersColors?.includes(n))}:n),[e.elements]),t=(0,V.useMemo)(()=>Object.fromEntries(n.map(e=>[e.id,e])),[n]);return(0,i.jsx)(Mr,{children:e.elements.map((s,o)=>{switch(s.elementType){case tn.Field:{const a=t[s.customField.id],r=AC(a,e.values,n);return(0,i.jsxs)(V.Fragment,{children:[r&&0!==o&&(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(db,{change:e.change,countryCode:e.countryCode,disabled:Nj.includes(a.id),display:r,field:a,isMandatory:!0===s.isMandatory,organizationId:e.organizationId,prefix:e.prefix},o)]},o)}case tn.Section:return AC(s,e.values,n)?(0,i.jsx)(V.Fragment,{children:"function"==typeof e.renderSection?e.renderSection(s.section,o):(0,i.jsxs)(i.Fragment,{children:[e.featureFlags?.isV4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Pl,{height:"5"})]}):0!==o&&(0,i.jsx)(Pl,{height:"8"}),(0,i.jsx)(Mr,{font:"grayCustom900 textMd semiBold",children:"function"==typeof e.renderText?e.renderText(s.section):s.section})]})},o):null;case tn.Text:return AC(s,e.values,n)?(0,i.jsx)(V.Fragment,{children:(0,i.jsxs)(i.Fragment,{children:[0!==o&&(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Rf,{text:"function"==typeof e.renderText?e.renderText(s.text):s.text})]})},o):null;default:return Zl(s.elementType)}})})},zR=e=>{const n=Fi();return(0,i.jsxs)(dg,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(tc,{onClick:e.onClose,children:n("fermer_62479")})}),size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",width:1,children:(0,i.jsx)(nb,{color:"primary",icon:"circle-info"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",width:1,children:n("informations_su_86120",e.name)}),(0,i.jsx)(Pl,{height:"7"}),g(e.description)&&(0,i.jsxs)(Tl,{css:{overflowY:"auto"},direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:n("description_58935")}),(0,i.jsx)(Rf,{text:e.description})]}),(0,i.jsx)(Pl,{height:"4"})]})},OR=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),o=(0,V.useMemo)(()=>g(e.profile.description)&&e.showDescription,[e.profile,e.showDescription]),a=(0,V.useMemo)(()=>(e.delegationAccreditationsProfiles||[]).find(({accreditationProfileId:n})=>n===e.profile.id),[e.delegationAccreditationsProfiles,e.profile]),r=(0,V.useCallback)(()=>"number"==typeof a?.maxResources?{assignedResources:a.assignedResources,maxResources:a.maxResources,remaining:a.maxResources-a.assignedResources}:null,[a]),d=(0,V.useMemo)(()=>!!a&&a.isFull&&e.alreadyAssignedProfileId!==e.profile.id,[e.alreadyAssignedProfileId,a,e.profile]),l=(0,V.useMemo)(()=>(0,i.jsx)(Ow,{getAssignedMaxRemaining:r,slotId:e.profile.id}),[r,e.profile]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ib,{accreditation:e.profile,badge:l,displayNumberOfSlots:!1,displaySlots:!1,numberOfSlots:0,renderActions:()=>o&&(0,i.jsx)(tc,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s(!0)},children:n("voir_la_descrip_62304")}),renderCheckbox:()=>(0,i.jsx)(lm,{disabled:d,shouldPreventDefault:!1,state:e.profile.id===e.accreditationProfileId?"checked":"unchecked",onClick:Bc.A}),onClick:()=>{d||e.setAccreditationProfileId(e.profile.id===e.accreditationProfileId?null:e.profile.id)}}),t&&(0,i.jsx)(zR,{description:e.profile.description,name:e.profile.name,onClose:()=>s(!1)})]})},RR=e=>{const{translate:n}=Kl(),t=(0,V.useCallback)(n=>{e.change(`${e.prefix}accreditationProfileId`,n)},[e.prefix,e.change]);return(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{font:"gray800 textMd semiBold",children:n("quel_profil_vou_78626")}),(0,i.jsx)(Tl,{css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"3",children:e.accreditationsProfiles.map(n=>(0,i.jsx)(OR,{accreditationProfileId:e.accreditationProfileId,alreadyAssignedProfileId:e.alreadyAssignedProfileId,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,profile:n,setAccreditationProfileId:t,showDescription:e.options.showAccreditationDescription},n.id))})]})},DR=e=>{const{translate:n}=Kl(),t=ki(Jm);return(0,i.jsx)(i.Fragment,{children:Yo(e.slots)?e.slots.map(n=>(0,i.jsx)(om,{disabled:e.getDisabled(n.id),state:e.accreditationsSlotsIds.includes(n.id)?"checked":"unchecked",onClick:t=>{e.onChange(Ko(e.accreditationsSlotsIds,n.id,"checked"===t))},children:(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[(0,i.jsx)(Mr,{css:{textTransform:"capitalize"},children:Uh(t,n,e.accreditation.name,{date:{localeFormat:Uo.DateOnly.WeekdayLongMonthLong}})}),(0,i.jsx)(Ow,{getAssignedMaxRemaining:e.getAssignedMaxRemaining,slotId:n.id})]})},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},MR=e=>{const{translate:n}=Kl(),t=ki(Jm),s=(0,V.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]);return(0,i.jsx)(i.Fragment,{children:Yo(e.slots)?e.slots.map(n=>(0,i.jsx)(cm,{disabled:e.getDisabled(n.id),state:e.accreditationsSlotsIds.includes(n.id)?"checked":"unchecked",onClick:t=>{const i=[...e.accreditationsSlotsIds.filter(e=>!s.includes(e)),..."checked"===t?[n.id]:[]];e.onChange(i)},children:(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[(0,i.jsx)(Mr,{css:{textTransform:"capitalize"},children:Uh(t,n,e.accreditation.name,{date:{localeFormat:Uo.DateOnly.WeekdayLongMonthLong}})}),(0,i.jsx)(Ow,{getAssignedMaxRemaining:e.getAssignedMaxRemaining,slotId:n.id})]})},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},PR=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]),s=(0,V.useMemo)(()=>e.accreditation.accreditationDisplay===oe.List&&e.slots.every(n=>e.accreditationsSlotsIds.includes(n.id)),[e.accreditation,e.accreditationsSlotsIds,e.slots]),o=(0,V.useCallback)(()=>{s?e.onChange((0,em.A)(e.accreditationsSlotsIds,t)):e.onChange((0,wo.A)(e.accreditationsSlotsIds.concat(t)))},[s,e.accreditationsSlotsIds,e.onChange,t]);return e.accreditation.accreditationDisplay===oe.List?(0,i.jsx)(Tl,{css:{borderTop:"1px solid $gray200",padding:"$4"},children:(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:o,children:n(s?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})}):null},kR=e=>{const{params:{organizationId:n},translate:t}=Kl(),[s,o]=(0,V.useState)(!1),a=(0,V.useMemo)(()=>g(e.accreditation.description)&&e.options.showAccreditationDescription,[e.accreditation,e.options]),r=(0,V.useMemo)(()=>{const n=e.accreditation.hasSlots?e.slots.map(e=>e.id):[e.accreditation.hiddenSlotId];return e.displayFormCustomFields&&Yo(e.accreditation.formCustomFields)&&Yo((0,mm.A)(n,e.accreditationsSlotsIds))},[e.accreditation,e.accreditationsSlotsIds,e.displayFormCustomFields,e.slots]),d=(0,V.useMemo)(()=>Object.fromEntries(e.delegationAccreditationsSlots.map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),l=(0,V.useCallback)(e=>{const n=d[e];return"number"==typeof n?.maxResources?{assignedResources:n.assignedResources,maxResources:n.maxResources,remaining:n.maxResources-n.assignedResources}:null},[d]),c=(0,V.useCallback)(n=>{const t=d[n];return!!t&&t.isFull&&t.willAutoAccredit&&!e.alreadyAssignedSlotsIds.includes(n)},[e.alreadyAssignedSlotsIds,d]),u=(0,V.useMemo)(()=>e.accreditation.hasSlots?null:(0,i.jsx)(Ow,{getAssignedMaxRemaining:l,slotId:e.accreditation.hiddenSlotId}),[l,e.accreditation]),m=(0,V.useCallback)(n=>{e.change(`${e.prefix}accreditationsSlotsIds`,n)},[e.prefix,e.change]),h=e.accreditationsSlotsIds.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ib,{accreditation:e.accreditation,badge:u,displayFormCustomFields:r,displayNumberOfSlots:!1,displaySlots:e.accreditation.hasSlots,numberOfSlots:0,renderActions:()=>a&&(0,i.jsx)(tc,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(!0)},children:t("voir_la_descrip_62304")}),renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(sm,{disabled:c(e.accreditation.hiddenSlotId),shouldPreventDefault:!1,state:h,onClick:Bc.A}),onClick:()=>{e.accreditation.hasSlots||c(e.accreditation.hiddenSlotId)||e.change(`${e.prefix}accreditationsSlotsIds`,Ko(e.accreditationsSlotsIds,e.accreditation.hiddenSlotId,"unchecked"===h))},children:(0,i.jsxs)(Tl,{css:{background:"white",padding:"$4"},direction:"column",gap:"3",children:[e.accreditation.hasSlots?e.accreditation.accreditationDisplay===oe.Calendar?(0,i.jsx)(Dw,{accreditationsSlotsIds:e.accreditationsSlotsIds,slotIdToDas:d,slots:e.slots,onChange:m}):(0,i.jsxs)(Tl,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsx)(Tl,{css:{padding:"$4"},direction:"column",gap:"3",children:e.accreditation.accreditationDisplay===oe.Radio?(0,i.jsx)(MR,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,getAssignedMaxRemaining:l,getDisabled:c,slots:e.slots,onChange:m}):(0,i.jsx)(DR,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,getAssignedMaxRemaining:l,getDisabled:c,slots:e.slots,onChange:m})}),(0,i.jsx)(PR,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,slots:e.slots,onChange:m})]}):null,r&&(0,i.jsx)(Tl,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.formCustomFields.map(({customField:t,isMandatory:s})=>(0,i.jsx)(db,{change:e.change,display:!0,field:t,isMandatory:s,organizationId:n,prefix:`${e.prefix}userInfo.fields.`},t.id))})]})}),s&&(0,i.jsx)(zR,{description:e.accreditation.description,name:e.accreditation.name,onClose:()=>o(!1)})]})},FR=e=>{const{translate:n}=Kl();return(0,i.jsx)(pb,{category:e.category.name,children:Yo(e.accreditations)?e.accreditations.map(n=>(0,i.jsx)(kR,{accreditation:n,accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.accreditationIdToSelectableSlots[n.id]},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},NR=e=>{const{translate:n}=Kl();return(0,i.jsx)(hb,{css:{background:"transparent",padding:"0"},children:Yo(e.categories)?(0,i.jsxs)(i.Fragment,{children:[e.categories.map(n=>(0,i.jsx)(FR,{accreditationIdToSelectableSlots:e.accreditationIdToSelectableSlots,accreditations:e.categoryIdToSelectableAccreditations[n.id],accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,category:n,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix},n.id)),e.showAutoAccredit&&(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:n("attribution_des_59896")}),(0,i.jsx)(df,{name:`${e.prefix}autoAccredit`,children:n("attribuer_les_a_75431")})]})]}):Yo(e.delegationAccreditationsProfiles)?null:(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},LR=(0,V.memo)(e=>{const{accreditationIdToSelectableSlots:n,categoryIdToSelectableAccreditations:t,selectableCategories:s,selectableProfiles:o}=(0,V.useMemo)(()=>{const n=Ug(e.slots.map(Fo)),t=e.event.accreditationsProfilesCategories.flatMap(n=>n.accreditationsProfiles.filter(n=>function(e,n,t){return n.some(n=>n.accreditationProfileId===e.id&&(t===n.accreditationProfileId||!n.isFull))}(n,e.delegationAccreditationsProfiles,e.alreadyAssignedProfileId))),i=e.event.accreditationsCategories.flatMap(t=>t.accreditations.flatMap(t=>t.slots.filter(t=>function(e,n,t,i,s,o){const a=t.slotDisplay===Ln.Hide||t.accreditationFilter===Nn.None||!e.date||n.some(n=>Lo(n,e.date)),r=t.showFullAccreditation||o.includes(e.id),d=t.accreditationDisplay!==Pn.None&&!t.hiddenAccreditationsSlotsIds.includes(e.id)&&(0===t.displayedAccreditationsSlotsIds.length||t.displayedAccreditationsSlotsIds.includes(e.id))&&(r||!e.isFull),l=i.some(n=>n.accreditationSlotId===e.id&&(r||!n.isFull&&!e.isFull));return!s.includes(e.id)&&!e.isBlocked&&a&&(d||l)}(t,n,e.options,e.delegationAccreditationsSlots,e.scannedSlotsIds,e.alreadyAssignedSlotsIds)))),s=i.map(e=>e.id),o=(0,xm.A)((0,fm.A)(i,e=>e.accreditationId),e=>(0,Lm.A)(e,e=>(0,kl.A)([e.date?.toMillis(),u(e.name)]))),a=e.event.accreditationsCategories.flatMap(n=>n.accreditations.filter(n=>function(e,n,t,i,s){return i.accreditationDisplay!==Pn.None&&!i.hiddenAccreditationsIds.includes(e.id)&&(0===i.displayedAccreditationsIds.length||i.displayedAccreditationsIds.includes(e.id))&&nh(e,t)&&e.slots.some(e=>n.includes(e.id))||s.some(i=>i.accreditationId===e.id&&nh(e,t)&&e.slots.some(e=>n.includes(e.id)))}(n,s,e.userInfosFields,e.options,e.delegationAccreditationsSlots))),r=a.map(e=>e.id),d=(0,xm.A)((0,fm.A)(a,e=>e.accreditationCategoryId),e=>uh(e)),l=(0,Lm.A)(e.event.accreditationsCategories.filter(n=>function(e,n,t,i){return t.accreditationDisplay!==Pn.None&&!t.hiddenAccreditationsCategoriesIds.includes(e.id)&&(0===t.displayedAccreditationsCategoriesIds.length||t.displayedAccreditationsCategoriesIds.includes(e.id))&&e.accreditations.some(e=>n.includes(e.id))||i.some(t=>t.accreditationCategoryId===e.id&&e.accreditations.some(e=>n.includes(e.id)))}(n,r,e.options,e.delegationAccreditationsSlots)),e=>u(e.name));return{selectableCategories:l,selectableProfiles:t,categoryIdToSelectableAccreditations:d,accreditationIdToSelectableSlots:o}},[e.alreadyAssignedProfileId,e.alreadyAssignedSlotsIds,e.delegationAccreditationsProfiles,e.delegationAccreditationsSlots,e.event.accreditationsCategories,e.event.accreditationsProfilesCategories,e.options,e.scannedSlotsIds,e.slots,e.userInfosFields]);return(0,V.useEffect)(()=>{const n=e.event.accreditationsCategories.flatMap(n=>n.accreditations.filter(n=>!nh(n,e.userInfosFields)).flatMap(e=>e.slots.map(e=>e.id))),t=e.accreditationsSlotsIds.filter(t=>!n.includes(t)||e.alreadyAssignedSlotsIds.includes(t));t.length!==e.accreditationsSlotsIds.length&&e.change(`${e.prefix}accreditationsSlotsIds`,t)},[e.accreditationsSlotsIds,e.alreadyAssignedSlotsIds,e.event.accreditationsCategories,e.userInfosFields]),Yo(o)||Yo(e.delegationAccreditationsSlots)||e.options.accreditationDisplay===Pn.Accreditation?(0,i.jsxs)(Tl,{direction:"column",gap:"9",children:[Yo(e.delegationAccreditationsProfiles)&&(0,i.jsx)(RR,{accreditationProfileId:e.accreditationProfileId,accreditationsProfiles:o,alreadyAssignedProfileId:e.alreadyAssignedProfileId,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,options:e.options,prefix:e.prefix}),(0,i.jsx)(NR,{accreditationIdToSelectableSlots:n,accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,categories:s,categoryIdToSelectableAccreditations:t,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,showAutoAccredit:e.showAutoAccredit})]}):null}),UR=e=>{const[n,t]=(0,V.useState)(!1),s=g(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(om,{css:{alignItems:"center"},state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:n=>{e.change(`${e.prefix}positionsCategoriesIds`,Ko(e.positionsCategoriesIds,e.category.id,"checked"===n))},children:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{children:e.category.name}),s&&(0,i.jsx)(Mr,{onClick:e=>{jc(e),t(!0)},children:(0,i.jsx)(Yl,{icon:"circle-info"})})]})}),n&&(0,i.jsx)(zR,{description:e.category.description,name:e.category.name,onClose:()=>{t(!1)}})]})},VR=e=>{const{translate:n}=Kl();return(0,i.jsx)(i.Fragment,{children:Yo(e.categories)?e.categories.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(UR,{category:n,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix})]},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},BR=e=>{const[n,t]=(0,V.useState)(!1),s=g(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(om,{css:{alignItems:"center"},state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:n=>{e.change(`${e.prefix}positionsIds`,Ko(e.positionsIds,e.position.id,"checked"===n))},children:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{children:e.position.name}),s&&(0,i.jsx)(Mr,{onClick:e=>{jc(e),t(!0)},children:(0,i.jsx)(Yl,{icon:"circle-info"})})]})}),n&&(0,i.jsx)(zR,{description:e.position.description,name:e.position.name,onClose:()=>{t(!1)}})]})},WR=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),o=g(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"semiBold",children:e.category.name}),o&&(0,i.jsx)(Mr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(Yl,{icon:"circle-info"})})]}),(0,i.jsx)(Pl,{height:"2"}),Yo(e.positions)?e.positions.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(BR,{change:e.change,options:e.options,position:n,positionsIds:e.positionsIds,prefix:e.prefix})]},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),t&&(0,i.jsx)(zR,{description:e.category.description,name:e.category.name,onClose:()=>{s(!1)}})]})},GR=e=>{const{translate:n}=Kl();return(0,i.jsx)(i.Fragment,{children:Yo(e.categories)?e.categories.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(WR,{category:n,change:e.change,options:e.options,positions:e.categoryIdToSelectablePositions[n.id],positionsIds:e.positionsIds,prefix:e.prefix})]},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},qR=e=>{const n=Fi(),t=fI(),s=(0,V.useMemo)(()=>e.categories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[Yo(s)?t?(0,i.jsxs)(_m,{isSearchVisible:!0,label:n("souhait_n_1_47211",e.index+1),values:[e.positionsCategoriesIds?.[e.index]??-1],onChange:n=>{Yo(n)&&e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,n[0])},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(Up,{label:n("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsCategoriesIds?.[e.index]??-1,onChange:n=>{e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,n)},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),s]}):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Pl,{height:"4"})]})},HR=e=>{const{translate:n}=Kl(),t=fI(),s=(0,V.useMemo)(()=>e.categories.map(n=>{const t=e.categoryIdToSelectablePositions[n.id];return(0,i.jsx)("optgroup",{label:n.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n.id)}),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[Yo(s)?t?(0,i.jsxs)(_m,{isSearchVisible:!0,label:n("souhait_n_1_47211",e.index+1),values:[e.positionsIds?.[e.index]??-1],onChange:n=>{Yo(n)&&e.change(`${e.prefix}positionsIds[${e.index}]`,n[0])},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(Up,{label:n("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsIds?.[e.index]??-1,onChange:n=>{e.change(`${e.prefix}positionsIds[${e.index}]`,n)},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),s]}):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Pl,{height:"4"})]})},YR=e=>{const{translate:n}=Kl(),t=ki(Bg),s=fI(),o=(0,V.useMemo)(()=>{const n=e.categories.map(n=>{const t=e.categoryIdToSelectablePositions[n.id];return{...n,positions:t.map(n=>{const t=e.positionIdToSelectableSlots[n.id];return{...n,slots:t}})}});return Wh(t,n)},[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[Yo(o)?s?(0,i.jsxs)(_m,{isSearchVisible:!0,label:n("souhait_n_1_47211",e.index+1),values:[e.positionsSlotsIds?.[e.index]??-1],onChange:n=>{Yo(n)&&e.change(`${e.prefix}positionsSlotsIds[${e.index}]`,n[0])},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),o]}):(0,i.jsxs)(Up,{label:n("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsSlotsIds?.[e.index]??-1,onChange:n=>{e.change(`${e.prefix}positionsSlotsIds[${e.index}]`,n)},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),o]}):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Pl,{height:"4"})]})},ZR=e=>{const{translate:n}=Kl();return(0,i.jsx)(i.Fragment,{children:Yo(e.categories)?(0,Om.A)(0,e.options.positionLimit).map(n=>e.options.positionDisplay===Fn.Category?(0,i.jsx)(qR,{categories:e.categories,change:e.change,index:n,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix},n):e.options.positionDisplay===Fn.Position?(0,i.jsx)(HR,{categories:e.categories,categoryIdToSelectablePositions:e.categoryIdToSelectablePositions,change:e.change,index:n,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix},n):e.options.positionDisplay===Fn.Slot?(0,i.jsx)(YR,{categories:e.categories,categoryIdToSelectablePositions:e.categoryIdToSelectablePositions,change:e.change,index:n,options:e.options,positionIdToSelectableSlots:e.positionIdToSelectableSlots,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix},n):null):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})};function KR(e){const n=ki(Bg),t=(0,V.useMemo)(()=>n.toDisplayString(e.range,{formats:{displayWeekday:!0}}),[e]),i=g(e.name);return{isRenamed:i,finalName:i?e.name:t,rangeString:t}}const XR=e=>{const{translate:n}=Kl(),{rangeString:t,finalName:s,isRenamed:o}=KR(e.slot),a=e.position.positionDisplay===jn.Radio,r=a?cm:om,d=(0,V.useMemo)(()=>e.position.slots.map(e=>e.id),[e.position.slots]),l=(0,V.useMemo)(()=>{if(e.options.willAutoAssign){const n=e.allSlots.filter(n=>e.positionsSlotsIds.includes(n.id)&&(!a||!d.includes(n.id)));return Kg(e.slot,n)}return!1},[e.options.willAutoAssign,e.allSlots,e.positionsSlotsIds,a,d]);return(0,i.jsxs)(V.Fragment,{children:[0!==e.index&&(0,i.jsx)(Pl,{height:"3"}),l?(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(r,{disabled:!0,shouldPreventDefault:!1,state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?t:void 0,onClick:Bc.A,children:s})})}),(0,i.jsx)(Dx,{placement:"top-start",children:n("ce_cr_neau_en_c_55775")})]}):(0,i.jsx)(r,{state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?t:void 0,onClick:n=>{const t="checked"===n;a?e.change(`${e.prefix}positionsSlotsIds`,[...e.positionsSlotsIds.filter(e=>!d.includes(e)),...t?[e.slot.id]:[]]):e.change(`${e.prefix}positionsSlotsIds`,Ko(e.positionsSlotsIds,e.slot.id,t))},children:s})]},e.slot.id)},QR=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),o=g(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"semiBold",children:e.position.name}),o&&(0,i.jsx)(Mr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(Yl,{icon:"circle-info"})})]}),(0,i.jsx)(Pl,{height:"2"}),Yo(e.slots)?e.slots.map((n,t)=>(0,i.jsx)(XR,{allSlots:e.allSlots,change:e.change,index:t,options:e.options,position:e.position,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slot:n},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),t&&(0,i.jsx)(zR,{description:e.position.description,name:e.position.name,onClose:()=>{s(!1)}})]})},JR=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),o=g(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray500",css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.category.name}),o&&(0,i.jsx)(Mr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(Yl,{icon:"circle-info"})})]}),Yo(e.positions)?e.positions.map(n=>(0,i.jsx)(QR,{allSlots:e.allSlots,change:e.change,options:e.options,position:n,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.positionIdToSelectableSlots[n.id]},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),t&&(0,i.jsx)(zR,{description:e.category.description,name:e.category.name,onClose:()=>{s(!1)}})]})},eD=e=>{const{translate:n}=Kl();return(0,i.jsx)(i.Fragment,{children:Yo(e.categories)?e.categories.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(JR,{allSlots:e.allSlots,category:n,change:e.change,options:e.options,positionIdToSelectableSlots:e.positionIdToSelectableSlots,positions:e.categoryIdToSelectablePositions[n.id],positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix},n.id)]},n.id)):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},nD=(0,V.memo)(e=>{const{categoryIdToSelectablePositions:n,positionIdToSelectableSlots:t,selectableCategories:s,selectableSlots:o}=(0,V.useMemo)(()=>{const n=Ug(e.slots.map(Fo)),t=e.event.positionsCategories.flatMap(t=>t.positions.flatMap(t=>t.slots.filter(t=>function(e,n,t){return!t.hiddenPositionsSlotsIds.includes(e.id)&&(0===t.displayedPositionsSlotsIds.length||t.displayedPositionsSlotsIds.includes(e.id))&&(t.showFullPosition||!e.isFull)&&(t.slotDisplay===Ln.Hide||t.positionFilter===Nn.None||n.some(n=>n.engulfs(e.range)))}(t,n,e.options)))),i=t.map(e=>e.id),s=(0,xm.A)((0,fm.A)(t,e=>e.positionId),e=>(0,Lm.A)(e,e=>[e.range.start.toMillis(),e.nameOrRange])),o=e.event.positionsCategories.flatMap(n=>n.positions.filter(n=>function(e,n,t,i){return!i.hiddenPositionsIds.includes(e.id)&&(0===i.displayedPositionsIds.length||i.displayedPositionsIds.includes(e.id))&&(0===i.hiddenPositionsTagsIds.length||Zo((0,mm.A)(i.hiddenPositionsTagsIds,e.tagsIds)))&&(0===i.displayedPositionsTagsIds.length||Yo((0,mm.A)(i.displayedPositionsTagsIds,e.tagsIds)))&&nh(e,t)&&e.slots.some(e=>n.includes(e.id))}(n,i,e.userInfoFields,e.options))),a=o.map(e=>e.id),r=(0,xm.A)((0,fm.A)(o,e=>e.positionCategoryId),e=>(0,Lm.A)(e,e=>u(e.name))),d=(0,Lm.A)(e.event.positionsCategories.filter(n=>function(e,n,t){return!t.hiddenPositionsCategoriesIds.includes(e.id)&&(0===t.displayedPositionsCategoriesIds.length||t.displayedPositionsCategoriesIds.includes(e.id))&&e.positions.some(e=>n.includes(e.id))}(n,a,e.options)),e=>u(e.name));return{selectableCategories:d,selectableSlots:t,categoryIdToSelectablePositions:r,positionIdToSelectableSlots:s}},[e.event.positionsCategories,e.options,e.slots,e.userInfoFields]);if((0,V.useEffect)(()=>{const n=e.event.positionsCategories.flatMap(n=>n.positions.filter(n=>!nh(n,e.userInfoFields)).map(e=>e.id));if(Yo(n)){const t=e.event.positionsCategories.flatMap(e=>e.positions.filter(e=>n.includes(e.id)).flatMap(e=>e.slots.map(e=>e.id))),i=e.positionsIds.filter(e=>!n.includes(e)),s=e.positionsSlotsIds.filter(e=>!t.includes(e));i.length!==e.positionsIds.length&&e.change(`${e.prefix}positionsIds`,i),s.length!==e.positionsSlotsIds.length&&e.change(`${e.prefix}positionsSlotsIds`,s)}},[e.event.positionsCategories,e.positionsIds,e.positionsSlotsIds,e.userInfoFields]),e.options.positionRanking===sn.Ranked)return(0,i.jsx)(ZR,{categories:s,categoryIdToSelectablePositions:n,change:e.change,options:e.options,positionIdToSelectableSlots:t,positionsCategoriesIds:e.positionsCategoriesIds,positionsIds:e.positionsIds,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix});switch(e.options.positionDisplay){case Fn.Category:return(0,i.jsx)(VR,{categories:s,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix});case Fn.Position:return(0,i.jsx)(GR,{categories:s,categoryIdToSelectablePositions:n,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case Fn.Slot:return(0,i.jsx)(eD,{allSlots:o,categories:s,categoryIdToSelectablePositions:n,change:e.change,options:e.options,positionIdToSelectableSlots:t,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix});case Fn.None:return null;default:return Zl(e.options.positionDisplay)}}),tD=e=>{const n=(0,V.useMemo)(()=>Yg(e.dayStartTime)?.[0]??0,[e.dayStartTime]),[t,s]=(0,V.useMemo)(()=>kh(e.startAt,e.endAt,e.ranges,e.daysDisplay,n),[e.startAt,e.endAt,e.ranges,e.daysDisplay,n]),o=(0,V.useMemo)(()=>(0,Dg.A)(t,e=>e.toMillis()),[t]),a=(0,V.useMemo)(()=>(0,Mg.A)(t,e=>e.toMillis()),[t]),r=(0,V.useMemo)(()=>o?.isValid&&a?.isValid?Math.ceil(a.endOf("month").diff(o.startOf("month"),"months").months):0,[o,a]),d=(0,V.useCallback)((n,t)=>{const i=e.currentSlots.filter(e=>e.startDate.year!==n.year||e.startDate.month!==n.month).concat(t.map(e=>No(Oo.IX.fromDateTimes(e,e.plus({day:1})))));e.change(`${e.prefix}slots`,i)},[e.currentSlots,e.prefix,e.change]);return o?.isValid&&a?.isValid&&r>0?(0,i.jsx)(Tl,{gap:"6",wrap:"wrap",children:(0,Om.A)(0,r).map(t=>{const l=o.plus({month:t}).startOf("month"),c=0===t?o:l,u=t===r-1?a:l.endOf("month"),m=e.currentSlots.flatMap(e=>e.startDate.year===l.year&&e.startDate.month===l.month?[e.startDate.startOf("day").set({hour:n||0})]:[]);return(0,i.jsx)(Tw,{disabledDates:s,firstDayOfMonth:l,max:u,min:c,startHour:n,values:m,onChange:e=>{d(l,e)}},t)})}):null},iD=e=>{const{intervals:n,minDate:t,maxDate:s,numberOfMonths:o}=(0,V.useMemo)(()=>{const n=e.intervalsGrouped.flatMap(([e,n])=>n.map(({interval:e})=>e)),t=(0,Dg.A)(n,e=>e.start.toMillis()).start.startOf("day"),i=(0,Mg.A)(n,e=>e.end.toMillis()).end.endOf("day"),s=Math.ceil(i.endOf("month").diff(t.startOf("month"),"months").months);return{intervals:n,minDate:t,maxDate:i,numberOfMonths:s}},[e.intervalsGrouped]),a=n.flatMap(n=>e.isSelected(n)?[n.start.startOf("day")]:[]);return(0,i.jsx)(Tl,{gap:"6",wrap:"wrap",children:(0,Om.A)(0,o).map(r=>{const d=t.plus({month:r}).startOf("month"),l=0===r?t:d,c=r===o-1?s:d.endOf("month"),u=a.filter(e=>e.month===d.month&&e.year===d.year);return(0,i.jsx)(Tw,{firstDayOfMonth:d,max:c,min:l,values:u,onChange:t=>{((t,i)=>{e.setSelectedBatch(n.flatMap(e=>{if(e.start.startOf("month").equals(t)){const n=i.some(n=>n.equals(e.start.startOf("day")));return[{interval:e,isSelected:n}]}return[]}))})(d,t)}},r)})})},sD=e=>{const[n,t]=(0,V.useState)(e.intervals.some(({interval:n})=>e.isSelected(n))?"checked":"unchecked"),s=(0,V.useCallback)(()=>{const i="checked"===n?"unchecked":"checked";t(i),"unchecked"===i&&e.intervals.forEach(({interval:n})=>{e.setSelected(n,!1)})},[e.intervals,n,t,e.setSelected]);return(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",padding:"$4 $5"},gap:"2",onClick:s,children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:"checked"===n?"chevron-down":"chevron-right"})}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:e.day})]}),"checked"===n&&(0,i.jsx)(Tl,{css:{borderTop:"1px solid $gray200",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervals.map(({name:n,interval:t},s)=>(0,i.jsx)(om,{state:e.isSelected(t)?"checked":"unchecked",onClick:n=>{e.setSelected(t,"checked"===n)},children:Nh(n,t)},s))})]})},oD=e=>(0,i.jsx)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervalsGrouped.map(([n,[{name:t,interval:s}]],o)=>{const a=`${t} ${s.toFormat("HH:mm")}`.trim(),r=`${n} ${e.hideNameDates?"":`(${a})`}`.trim();return(0,i.jsx)(om,{state:e.isSelected(s)?"checked":"unchecked",onClick:n=>{e.setSelected(s,"checked"===n)},children:r},o)})}),aD=({customSlotPeriod:e,daysDisplay:n,event:t,isSelected:s,setSelected:o,setSelectedBatch:a})=>{const r=ki(Jm),d=(0,V.useMemo)(()=>Fh(e.startDate??t.startAt,e.endDate??t.endAt,e.customSlots,t.ranges,n),[e,t,n]),l=(0,V.useMemo)(()=>(0,Lm.A)(Object.entries((0,fm.A)(d,({interval:e})=>r.toLocaleString(e.start.startOf("day"),Uo.DateOnly.WeekdayLongMonthLong))),([e,[{interval:n}]])=>n.start.startOf("day").toMillis()),[d]);return(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[g(e.name)&&(0,i.jsx)(Mr,{font:"gray900 textSm semiBold",children:e.name}),1===e.customSlots.length?0===l.length?null:e.displayAsCalendar?(0,i.jsx)(iD,{intervalsGrouped:l,isSelected:s,setSelectedBatch:a}):(0,i.jsx)(oD,{hideNameDates:e.hideNameDates,intervalsGrouped:l,isSelected:s,setSelected:o}):l.map(([e,n],t)=>(0,i.jsx)(sD,{day:e,intervals:n,isSelected:s,setSelected:o},t))]})},rD=e=>{const n=(0,V.useMemo)(()=>e.customSlotsPeriods.flatMap(n=>Fh(n.startDate??e.event.startAt,n.endDate??e.event.endAt,n.customSlots,e.event.ranges,e.daysDisplay)).map(({interval:e})=>e),[e.customSlotsPeriods,e.event,e.daysDisplay]),[t,s]=(0,V.useState)(Object.fromEntries(n.map(n=>{const t=e.currentSlots.some(e=>ko(e).equals(n));return[n.toISO(),t]}))),o=(0,V.useCallback)(e=>t[e.toISO()],[t]),a=(0,V.useCallback)((n,t)=>{const i=n.toISO();s(e=>({...e,[i]:t})),e.change(`${e.prefix}slots`,Lh(e.currentSlots,n,t))},[e.currentSlots,s]),r=(0,V.useCallback)(n=>{const t=n.reduce((e,{interval:n,isSelected:t})=>{const i=n.toISO();return s(e=>({...e,[i]:t})),Lh(e,n,t)},e.currentSlots);e.change(`${e.prefix}slots`,t)},[e.currentSlots,s]),d=(0,V.useMemo)(()=>e.elements.flatMap(e=>e.elementType===tn.Field?(0,kl.A)([e.customField,e.conditionCustomField]):e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.elements]);return(0,i.jsx)(Tl,{direction:"column",gap:"6",children:e.customSlotsPeriods.map(n=>AC(n,e.userInfoFields,d)?(0,i.jsx)(aD,{customSlotPeriod:n,daysDisplay:e.daysDisplay,event:e.event,isSelected:o,setSelected:a,setSelectedBatch:r},n.id):null)})},dD=e=>{const{translate:n}=Kl(),[t]=(0,V.useMemo)(()=>kh(e.startAt,e.endAt,e.ranges,e.daysDisplay,Yg(e.dayStartTime)?.[0]??0),[e.startAt,e.endAt,e.ranges,e.daysDisplay,e.dayStartTime]),s=(0,V.useMemo)(()=>t.filter(n=>(e.blockedSlots??[]).some(e=>Lo(e,n))),[e.blockedSlots,t]),o=ki(Jm),[a,r]=(0,V.useState)(Object.fromEntries(t.map((n,t)=>{const i=Oo.IX.fromDateTimes(n,n.plus({day:1}));return[`day${t}`,void 0!==e.currentSlots.find(e=>ko(e).equals(i))]})));return(0,i.jsx)(i.Fragment,{children:t.map((t,d)=>{const l=s.includes(t);return(0,i.jsxs)(V.Fragment,{children:[0!==d&&(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{disabled:l,state:a[`day${d}`]?"checked":"unchecked",onClick:n=>{r({...a,[`day${d}`]:"checked"===n}),e.change(`${e.prefix}slots`,Lh(e.currentSlots,Oo.IX.fromDateTimes(t,t.plus({day:1})),"checked"===n))},children:l?(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(rc,{children:o.toLocaleString(t,Uo.DateOnly.WeekdayLongMonthLong)})}),(0,i.jsx)(Dx,{placement:"right",children:n("vous_avez_d_j_92810")})]}):o.toLocaleString(t,Uo.DateOnly.WeekdayLongMonthLong)})]},d)})})};var lD=t(3088);const cD=e=>{const n=Fi();return(0,i.jsx)(qC,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),title:n("disponibilit_n_50484",e.index+1),children:(0,i.jsxs)(Tl,{direction:{"@initial":"column","@desktop":"row"},gap:"4",children:[(0,i.jsx)(Qx,{label:n("date_de_d_but_43380"),max:e.max,min:e.min,name:`${e.prefix}startDate`}),(0,i.jsx)(rS,{label:n("heure_de_d_but_27566"),name:`${e.prefix}startTime`}),(0,i.jsx)(Qx,{label:n("date_de_fin_86920"),max:e.max,min:e.min,name:`${e.prefix}endDate`}),(0,i.jsx)(rS,{label:n("heure_de_fin_95071"),name:`${e.prefix}endTime`})]})})},uD=e=>{const n=Fi(),t=ki(ER),s=(0,V.useMemo)(()=>e.max.endOf("day"),[e.max]);return(0,i.jsx)(lD.ED,{name:`${e.prefix}slots`,children:({fields:o})=>(0,i.jsxs)(i.Fragment,{children:[o.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[0!==t&&(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(cD,{index:t,max:s,min:e.min,prefix:`${n}.`,remove:()=>{o.remove(t)}})]},t)),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>{o.push(t.volunteersRegistrationsSlotInputDefault(e.min))},children:n("ajouter_une_dis_96540")})]})})},mD=(0,V.memo)(e=>{switch(e.slotDisplay){case Ln.Display:return(0,i.jsx)(uD,{max:e.event.endAt,min:e.event.startAt,prefix:e.prefix});case Ln.DisplayDays:return(0,i.jsx)(dD,{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 Ln.Calendar:return(0,i.jsx)(tD,{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 Ln.Custom:return(0,i.jsx)(rD,{change:e.change,currentSlots:e.currentSlots,customSlotsPeriods:e.customSlotsPeriods,daysDisplay:e.daysDisplay,elements:e.elements,event:e.event,prefix:e.prefix,userInfoFields:e.userInfoFields});case Ln.Hide:return null;default:return Zl(e.slotDisplay)}}),gD=e=>(0,i.jsx)(sf,{disabled:e.disabled,heading:e.heading,hideHeader:e.hideHeader,children:(0,i.jsx)(Tl,{direction:"column",children:e.children})}),hD=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(hT),a=(0,V.useMemo)(()=>g(e.form.description)?o.renderText(e.form.description,{event:e.event,organization:e.organization}):"",[e.event,e.form.description,e.organization]),r=(0,V.useMemo)(()=>s&&e.form.slotDisplay!==Ln.Hide,[e.form,s]),d=(0,V.useMemo)(()=>s&&e.form.positionDisplay!==Fn.None,[e.form,s]),l=(0,V.useMemo)(()=>s&&(e.form.accreditationDisplay!==Pn.None||Yo(e.delegationAccreditationsSlots)||Yo(e.delegationAccreditationsProfiles)),[e.delegationAccreditationsProfiles,e.delegationAccreditationsSlots,e.form,s]),c=(0,V.useMemo)(()=>e.userInfo?.volunteerRegistration?.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlotId]:[])??[],[e.userInfo]),u=function(e,n=300){const[t,i]=(0,V.useState)(e),s=Bm(i,n);return(0,V.useEffect)(()=>{s(e)},[e]),t}(e.values.formRegister.userInfo.fields);return(0,i.jsxs)(i.Fragment,{children:[e.showEmail&&(0,i.jsxs)(gD,{hideHeader:!0,children:[g(a)&&(0,i.jsx)(Rf,{text:a}),(0,i.jsx)($c,{isEmail:!0,label:n("Email"),name:"email"})]}),(0,i.jsx)(gD,{heading:g(e.form.informationTitle)?e.form.informationTitle:n("informations_pe_37892"),children:e.disabled?(0,i.jsx)(zE,{form:e.form,userInfo:e.userInfo}):(0,i.jsx)(TR,{asoBannersColors:e.asoBannersColors,change:e.change,elements:e.form.elements,organizationId:t,prefix:"formRegister.userInfo.fields.",values:e.values.formRegister.userInfo.fields})}),r&&e.event&&(0,i.jsxs)(gD,{heading:g(e.form.slotTitle)?e.form.slotTitle:n("disponibilit_s_49923"),children:[g(e.form.slotSubtitle)&&(0,i.jsx)(Rf,{text:e.form.slotSubtitle}),e.areSectionsDisabled?.isWishedAssignmentsDisabled?(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("no_longer_modif_99663")}),(0,i.jsx)(uc,{children:n("you_are_already_assigned_to_missions")})]}):(0,i.jsx)(mD,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.values.formRegister.slots,customSlotsPeriods:e.form.customSlotsPeriods,daysDisplay:e.form.daysDisplay,elements:e.form.elements,event:e.event,prefix:"formRegister.",slotDisplay:e.form.slotDisplay,userInfoFields:u})]}),d&&e.event&&(0,i.jsxs)(gD,{heading:g(e.form.positionTitle)?e.form.positionTitle:n("missions_souhai_23225"),children:[g(e.form.positionSubtitle)&&(0,i.jsx)(Rf,{text:e.form.positionSubtitle}),e.areSectionsDisabled?.isWishedAssignmentsDisabled?(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("no_longer_modif_99663")}),(0,i.jsx)(uc,{children:n("you_are_already_assigned_to_missions")})]}):(0,i.jsx)(nD,{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:u})]}),l&&e.event&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(gD,{heading:g(e.form.accreditationTitle)?e.form.accreditationTitle:n("accr_ditations_74375"),children:[g(e.form.accreditationSubtitle)&&(0,i.jsx)(Rf,{text:e.form.accreditationSubtitle}),e.areSectionsDisabled?.isWishedAccreditationsDisabled?(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("no_longer_modif_99663")}),(0,i.jsx)(uc,{children:n("you_are_already_assigned_to_accreditations")})]}):(0,i.jsx)(LR,{accreditationProfileId:e.values.formRegister.accreditationProfileId,accreditationsSlotsIds:e.values.formRegister.accreditationsSlotsIds,alreadyAssignedProfileId:e.alreadyAssignedProfileId,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles??qo,delegationAccreditationsSlots:e.delegationAccreditationsSlots??qo,displayFormCustomFields:!0,event:e.event,options:e.form,prefix:"formRegister.",scannedSlotsIds:c,showAutoAccredit:e.showAutoAccredit,slots:e.values.formRegister.slots,userInfosFields:u})]})})]})},pD=e=>{const n=ki($R),t=(0,V.useMemo)(()=>(e.organization.form.elements??[]).flatMap(e=>e.elementType===tn.Field?[e.customField]:[]),[e.organization]);return(0,V.useEffect)(()=>{const i=n.formRegisterInputDefault(on.Admin,null,t,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditationsSlots:e.organization.delegation?.accreditationsSlots??[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:e.organization.form.slotDisplay,team:null});e.setInitialValues({email:e.values.email||"",formRegister:{...i,userInfo:{...i.userInfo,...e.values.formRegister.userInfo,fields:{...i.userInfo.fields,...e.values.formRegister.userInfo.fields}}}})},[e.organization]),(0,i.jsx)(Yx,{children:(0,i.jsx)(hD,{alreadyAssignedProfileId:null,alreadyAssignedSlotsIds:qo,change:e.change,delegationAccreditationsProfiles:e.organization.delegation?.accreditationsProfiles??qo,delegationAccreditationsSlots:e.organization.delegation?.accreditationsSlots??qo,event:e.organization.event,form:e.organization.form,organization:e.organization,showAutoAccredit:!0,showEmail:!1,values:e.values})})},ID=e=>{const{translate:n,params:{delegationId:t}}=Kl();return(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)($c,{isEmail:!0,label:n("Email"),name:"email"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:n("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:n("last_name")}),name:"formRegister.userInfo.fields.lastName"})]})]}),!t&&(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("param_tres_du_m_69378")}),(0,i.jsx)(Mr,{color:"gray500",children:n("s_lectionnez_le_16209")})]}),(0,i.jsx)(of,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:n("population_38615")}),multiple:e.population.canSelectMultiple,name:"formRegister.userInfo.fields.population",children:e.population.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(_m,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:n("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)(_m,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:n("Form")}),state:Yo(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))})]})]})},xD=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,delegationId:a}}=Kl(),r=ki($R),d=ki(Ol),l=(0,V.useRef)(null),{mutate:c,isLoading:u}=ll(),{mutate:m}=function(e={}){return Ui("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)}(),[g,h]=(0,V.useState)(null),p=(0,V.useMemo)(()=>g?.form.elements.filter(e=>e.elementType===tn.Field)??[],[g]),[I,x]=(0,V.useState)({email:"",formRegister:r.formRegisterInputDefault(on.Admin,null,qo,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditationsSlots:qo,eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:Ln.Hide,team:null})}),f=(0,V.useMemo)(()=>r.formRegisterSchema(p,{slotDisplay:g?.form.slotDisplay??Ln.Hide,minNumberOfSlots:g?.form.minNumberOfSlots??1,eventStartDate:g?.event?.startAt??Oo.c9.now(),eventEndDate:g?.event?.endAt??Oo.c9.now(),positionRanking:g?.form.positionRanking??sn.Unranked,positionDisplay:g?.form.positionDisplay??Fn.None,accreditationDisplay:g?.form.accreditationDisplay??Pn.None,delegationId:g?.delegation?.id,delegationAccreditationsProfiles:g?.delegation?.accreditationsProfiles??[]}),[p,r,g]),_=(0,V.useCallback)(e=>d.validateForForm(f)(e),[f]),j=(0,V.useCallback)(async t=>{g?await m({organizationId:s,eventId:o,delegationId:g.delegation?.id,formId:g.form.id,email:t.email,formRegister:t.formRegister}):await c({organizationId:s,eventId:o,email:t.email,userInfo:t.formRegister.userInfo,sendNotificationEmail:t.formRegister.sendNotificationEmail}),n.push(e.closePath)},[e.closePath,g]),v=e.organization.delegations.nodes,S=e.organization.forms.nodes,[y,C]=(0,V.useState)(!1),[b,A]=(0,V.useState)([]),[E,w]=(0,V.useState)([]),$=(0,V.useCallback)(async e=>{if(w(e),Yo(e)){C(!0);const{organization:n}=await dl({organizationId:s,eventId:o,formId:e[0]},await X());h(n),C(!1)}else h(null)},[o,s]),T=(0,V.useCallback)(async e=>{if(A(e),Yo(e)){const n=v.find(n=>n.id===e[0]);w([n.formId]),C(!0);const{organization:t}=await dl({organizationId:s,delegationId:e[0],eventId:o,formId:n.formId},await X());h(t),C(!1)}else h(null)},[v,s,o]);return Au(t("cr_ation_d_un_m_98624")),(0,V.useEffect)(()=>{a&&T([a])},[a,T]),(0,i.jsx)(xc,{customErrorRef:l,height:1,hideDefaultErrors:!0,initialValues:I,render:({form:n,handleSubmit:s,values:a})=>(0,i.jsx)(Hx,{category:t("cr_ation_d_un_m_98624"),color:"dark",fallbackClosePath:e.closePath,heading:t("nouveau_membre_94535"),children:(0,i.jsx)(Gx,{ref:l,children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(hc,{hideSpacer:!0}),(0,i.jsx)(sf,{heading:t("informations_su_05921"),children:(0,i.jsx)(ID,{delegations:v,delegationsIds:b,forms:S,formsIds:E,population:e.organization.population,setDelegationsIds:T,setFormsIds:$})}),y&&(0,i.jsx)(Yx,{css:{minHeight:"200px"},children:(0,i.jsx)(Ql,{})}),!y&&g&&(0,i.jsx)(pD,{change:n.change,organization:g,setInitialValues:x,values:a}),(0,i.jsx)(Yx,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[o&&(0,i.jsx)(Xx,{name:"formRegister.sendNotificationEmail",children:t("envoyer_l_email_75574")}),(0,i.jsx)(tc,{isLoading:u,textAlign:"center",onClick:s,children:t("ajouter_le_memb_57505")})]})})]})})}),validate:_,width:1,onSubmit:j})},fD=()=>{const{params:{organizationId:e,eventId:n,delegationId:t}}=Kl(),{data:s,loader:o}=Li('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 canSelectMultiple\n\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:n,level:n?xn.Event:xn.Organization},[]);return o||(0,i.jsx)(xD,{closePath:t?Js.DELEGATION_MEMBERS({organizationId:e,eventId:n,delegationId:t}):n?yo.VOLUNTEERS(e,n):hs.COMMUNITY_USERS({organizationId:e}),organization:s.organization})};let _D=class extends Rc{constructor(e){super(e)}commentInputDefault(){return{content:""}}commentInputSchema(){return zc.Ik().shape({content:zc.Yj().required(this.t("le_commentaire_33393"))})}createCommentSchema(){return zc.Ik().shape({comment:this.commentInputSchema()})}};function jD(e){return e.replace(/\*\*(.+?)\*\*/g,"$1").replace(/\+\+(.+?)\+\+/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1")}_D=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],_D);const vD=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("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)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_55928"),text:n("suppression_d_u_90124"),onClose:e.onClose,onDelete:async()=>{await t({organizationId:e.organizationId,eventId:e.eventId,commentId:e.commentId}),e.onSuccess()}})},SD=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{mutate:o}=function(e={}){return Ui("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)}(),[a,r]=(0,V.useState)(e.comment.content),[d,l]=(0,V.useState)(!1),c=g(a);return(0,i.jsxs)(xx,{children:[(0,i.jsx)(fx,{children:(0,i.jsx)(Mr,{color:"gray500",css:{cursor:"pointer"},children:(0,i.jsx)(Yl,{icon:"pen"})})}),(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"message",children:n("mise_jour_du_59845")}),(0,i.jsx)(hx,{children:(0,i.jsx)(af,{label:n("commentaire_08754"),value:a,onChange:r})}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:!c,isLoading:d,onClick:async()=>{l(!0),await o({organizationId:t,eventId:s,commentId:e.comment.id,comment:{content:a}}),e.reload()},children:n("mettre_jour_85141")})})]})]})},yD=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Jm),{user:a}=Yi(),[r,d]=(0,V.useState)(!1),l=e.comment.event,c=e.comment.writtenBy;return(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(t_,{email:c.email,image:c.userInfo.picture?.url,name:c.userInfo.name,size:40}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"2",children:[(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:c.userInfo.nameOrEmail}),(0,i.jsx)(Mr,{color:"gray500",children:o.toLocaleString(e.comment.insertedAt.toLocal(),Uo.DateTime)}),e.showEvent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray500",children:"‱"}),(0,i.jsx)(Mr,{color:"gray500",children:l?.name??n("communaut_20896")})]}),c.id===a?.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray500",children:"‱"}),(0,i.jsx)(SD,{comment:e.comment,reload:e.reload})]}),(0,i.jsxs)(ly,{permissions:sy.COMMENT_ADD,children:[(0,i.jsx)(Mr,{color:"gray500",children:"‱"}),(0,i.jsx)(Mr,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{d(!0)},children:(0,i.jsx)(Yl,{icon:"trash-can"})})]})]}),(0,i.jsx)(Mr,{color:"gray800",css:{background:"$gray100",borderRadius:"0 $2 $2 $2",boxShadow:"$sm",padding:"$3",whiteSpace:"pre-line"},dangerouslySetInnerHTML:{__html:jD(e.comment.content)}})]}),r&&(0,i.jsx)(vD,{commentId:e.comment.id,eventId:s,organizationId:t,onClose:()=>{d(!1)},onSuccess:e.reload})]})},CD=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=Kl(),a=ki(_D),r=ki(Ol),{data:d,loader:l,reload:c}=ml({organizationId:n,userInfoId:s}),{mutate:u,isLoading:m}=ul(),[g,h]=(0,V.useState)(1),p=(0,V.useCallback)(()=>{h(g+1),c()},[g,h,c]);return(0,i.jsx)(xc,{direction:"column",hideDefaultErrors:!0,initialValues:{comment:a.commentInputDefault()},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[l||(d.organization?.userInfo.comments??[]).map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(yD,{comment:n,reload:p,showEvent:e.showEvent})]},t)),(0,i.jsxs)(ly,{permissions:sy.COMMENT_ADD,children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(hc,{}),(0,i.jsx)(rf,{label:o("commentaire_08754"),name:"comment.content"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(tc,{isLoading:m,onClick:n,children:(0,i.jsx)(Mr,{textAlign:"center",width:1,children:o("ajouter_un_nouv_86295")})})]}),(0,i.jsx)(Pl,{height:"8"})]}),validate:r.validateForForm(a.createCommentSchema()),width:1,onSubmit:async e=>{await u({organizationId:n,eventId:t,userInfoId:s,comment:e.comment}),p()}},g)},bD=({canEdit:e,editPath:n,formsUsersInfos:t,isEditDisabled:s=!1})=>{const{params:{organizationId:o,eventId:a},translate:r}=Kl(),d=ki(Jm),l=(0,V.useMemo)(()=>(0,Lm.A)(t.filter(e=>Yo(e.accreditationsSlots)).map(e=>({...e,accreditationsSlots:(0,Lm.A)(e.accreditationsSlots,e=>[e.accreditationCategory.name.toLowerCase(),ch(e.accreditation.index),e.accreditation.name.toLowerCase(),e.date?.toMillis()??1,e.name.toLowerCase()])})),e=>e.form.name.toLowerCase()),[t]),c=Dm();return(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[s&&(0,i.jsx)(VE,{message:r("you_are_already_assigned_to_accreditations"),title:r("wished_accreds_can_no_longer_be_changed")}),(0,i.jsx)(Nm,{filters:e&&(0,i.jsx)(tc,{color:"white",disabled:s,size:"sm",to:n,children:r("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:r("AccreditationName")}),!c&&(0,i.jsx)(Gm,{children:r("cr_neau_11117")}),!c&&(0,i.jsx)(Gm,{children:r("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:Yo(l)?l.flatMap((e,n)=>e.accreditationsSlots.map((t,r)=>(0,i.jsxs)(km,{children:[(0,i.jsxs)($m,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Mr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:t.accreditationCategory.name}),(0,i.jsx)(Xm,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:Ws.ACCREDITATION({organizationId:o,eventId:a,accreditationId:t.accreditation.id}),children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:t.accreditation.name,width:1,children:t.accreditation.name})})]}),!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($m,{children:Uh(d,t,"")}),(0,i.jsx)($m,{children:(0,i.jsx)(WE,{editDisabled:s,eventId:a,form:e.form,organizationId:o})})]})]},`${n}-${r}`))):(0,i.jsx)(km,{css:{height:"200px"},children:(0,i.jsx)($m,{children:(0,i.jsx)(UE,{title:r("aucune_accr_dit_56501")})})})}),setOffset:Bc.A,title:r("accr_ditations_74375"),totalCount:0})]})},AD=e=>{const n=ki(Jm),t=V.useMemo(()=>{const n=Gu(e.aui.accreditation.color);return{background:n[50],color:n[700]}},[e.aui]);return(0,i.jsx)(i.Fragment,{children:e.renderAccreditation((0,i.jsxs)(Tl,{css:{...t,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsx)(Mr,{children:Uh(n,e.aui.accreditationSlot,"")}),e.aui.isAutoAccredit&&(0,i.jsx)(Mr,{fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:"bolt-auto"})})]}),(0,i.jsx)(Mr,{fontSize:"textXs",fontWeight:"medium",children:e.aui.accreditation.name})]}),e.aui.accreditation.id)})},ED=e=>{const n=fI(),t=V.useMemo(()=>(0,Lm.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),ch(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]),s=V.useMemo(()=>(0,Lm.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),ch(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]);return(0,i.jsxs)(D$,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:n?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[t.map(n=>(0,i.jsx)(R$,{children:(0,i.jsx)(AD,{aui:n,renderAccreditation:e.renderAccreditation})},n.id)),s.map(n=>(0,i.jsx)(R$,{endAt:n.accreditationSlot.date,startAt:n.accreditationSlot.date,children:(0,i.jsx)(AD,{aui:n,renderAccreditation:e.renderAccreditation})},n.id))]})},wD=e=>{const{translate:n,params:{organizationId:t,eventId:s,userInfoId:o}}=Kl(),a=ki(Jm),{mutate:r}=ja(),{mutate:d}=function(e={}){return Ui("mutation AccreditationsSlotsUsersInfosCheckIn(\n $eventId: EventId!\n $checkIn: AccreditationSlotCheckInInput!\n) {\n accreditationsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}(),l=(0,V.useMemo)(()=>Uh(a,e.aui.accreditationSlot,e.aui.accreditation.name),[e.aui]);return(0,i.jsxs)(km,{children:[(0,i.jsxs)($m,{align:"center",gap:"3",children:[(0,i.jsx)(xI,{color:e.aui.accreditation.color,icon:e.aui.accreditation.icon}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.aui.accreditationCategory.name}),(0,i.jsx)(Xm,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:Ws.ACCREDITATION({organizationId:t,eventId:s,accreditationId:e.aui.accreditation.id}),children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.aui.accreditation.name,width:1,children:e.aui.accreditation.name})}),l!==e.aui.accreditation.name&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},title:l,width:1,children:l})]})]}),(0,i.jsxs)($m,{align:"start",direction:"column",justify:"center",children:[e.aui.state===ye.Waiting&&(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[(0,i.jsx)(Mr,{color:"warning500",children:(0,i.jsx)(Yl,{icon:"hourglass-empty",iconStyle:"solid"})}),(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:n("pas_encore_scan_88057")})]}),e.aui.state===ye.CheckedIn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"1",children:[(0,i.jsx)(Mr,{color:"success500",children:(0,i.jsx)(Yl,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:n("scann_e_01567")})]}),(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:e.aui.checkInAt?.isValid?a.toLocaleString(e.aui.checkInAt.toLocal(),Uo.DateTime):""})]})]}),(0,i.jsx)($m,{children:e.aui.isAutoAccredit&&(0,i.jsx)(Mr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"check"})})}),(0,i.jsx)($m,{children:e.aui.isWorkflow&&(0,i.jsx)(Mr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"check"})})}),(0,i.jsx)($m,{children:e.aui.accreditationProfile?e.aui.accreditationProfile.name:"-"}),(0,i.jsxs)($m,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Mr,{children:e.aui.createdBy?.name||e.aui.createdBy?.email||"-"}),(0,i.jsx)(Mr,{color:"gray500",children:a.toLocaleString(e.aui.insertedAt.toLocal(),Uo.DateTime)})]}),e.canMemberAccredit&&(0,i.jsxs)(Qm,{justify:"end",width:200,children:[e.aui.state===ye.Waiting&&(0,i.jsx)(tc,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.aui.eventId,checkIn:{strategy:Ce.CheckIn,accreditationsSlotsUsersInfosIds:[e.aui.id]}}),e.reload()},children:"Scanner"}),(0,i.jsx)(Km,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:async()=>{await r({eventId:s,massAccredit:{accreditationsSlotsIds:[e.aui.accreditationSlot.id],selecteds:{ids:[o]},strategy:hn.Delete}}),e.reload()},children:n("d_saffecter_du_47122")})})]})]})},$D=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>(0,Lm.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(n=>!e.selectedDay?.isValid||!!n.accreditationSlot.date?.isValid&&n.accreditationSlot.date.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),e=>[e.accreditationCategory.name.toLowerCase(),ch(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.date?.toMillis()??1,e.accreditationSlot.name.toLowerCase()]),[e.event,e.selectedDay]);return(0,i.jsxs)(ym,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:n("Accreditation")}),(0,i.jsx)(Gm,{children:n("scann_e_le_27812")}),(0,i.jsx)(Gm,{children:n("affect_e_automa_74071")}),(0,i.jsx)(Gm,{children:n("ajout_via_une_69544")}),(0,i.jsx)(Gm,{children:n("ajout_via_un_p_85925")}),(0,i.jsx)(Gm,{children:n("ajout_e_par_71330")}),e.canMemberAccredit&&(0,i.jsx)(Gm,{width:200})]}),t.map(n=>(0,i.jsx)(wD,{aui:n,canMemberAccredit:e.canMemberAccredit,reload:e.reload},n.id))]})},TD=e=>{const{translate:n}=Kl(),[t,s]=V.useState(N_(e.event.startAt,e.event.endAt)),[o,a]=V.useState(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Tl,{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)(Tl,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Mr,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(dc,{children:e.title}),e.subtitle&&(0,i.jsx)(rc,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Tl,{as:"nav",gap:"3",children:["calendar"===e.accreditationsDisplay&&(0,i.jsx)(z$,{max:e.event.endAt,min:e.event.startAt,value:t,onChange:s}),"list"===e.accreditationsDisplay&&!e.hideListView&&(0,i.jsx)(Mr,{width:160,children:(0,i.jsx)(Wp,{rightIcon:"xmark",value:o,onChange:a,onRightIconClick:()=>a(null)})}),!e.hideListView&&e.setAccreditationsDisplay&&(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{value:e.accreditationsDisplay,onChange:e.setAccreditationsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:n("Calendar")}),(0,i.jsx)("option",{value:"list",children:n("List")})]})}),e.actions]})]}),"calendar"===e.accreditationsDisplay?(0,i.jsx)(ED,{event:e.event,featureFlags:e.featureFlags,renderAccreditation:e.renderAccreditation,selectedDay:t}):(0,i.jsx)($D,{canMemberAccredit:e.canMemberAccredit,event:e.event,reload:e.reload,selectedDay:o})]})})};function zD(e,n,t={}){const{localEvent:i,updateLocalEvent:s}=BS(),[o,a]=V.useState("function"==typeof t.deserialize?t.deserialize(i?.[e])||n:i?.[e]??n);return[o,V.useCallback(async n=>{a(n),await s({[e]:"function"==typeof t.serialize?t.serialize(n):n})},[e,a,s])]}const OD=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=Kl(),[a,r]=zD("user.accreditations.display","calendar");return(0,i.jsx)(TD,{...e,accreditationsDisplay:a,actions:(0,i.jsx)(ly,{permissions:sy.MEMBER_ACCREDIT,children:(0,i.jsx)(tc,{to:yo.EDIT_ACCREDIT(n,t,s),children:o("_diter_les_accr_86042")})}),canMemberAccredit:e.canMemberAccredit,setAccreditationsDisplay:r})},RD=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=Kl(),{canMemberAccredit:a}=oy(),r=(0,V.useMemo)(()=>Yo(e.organization.userInfo.formsUsersInfos.filter(e=>Yo(e.accreditationsSlots)))||(e.event?.hasFormWithAccreditationDisplay??!1),[e.organization,e.event]);return(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:1,children:[Yo(e.event.volunteerRegistration.accreditationsUsersInfos)&&(0,i.jsx)(OD,{canMemberAccredit:a,event:e.event,reload:e.reload,renderAccreditation:(e,s)=>(0,i.jsx)(ql,{style:{width:"100%"},to:Ws.ACCREDITATION({organizationId:n,eventId:t,accreditationId:s}),children:e}),subtitle:o("visualisez_tout_53227"),title:o("accr_ditations_33155")}),r&&(0,i.jsx)(bD,{canEdit:a,editPath:yo.EDIT_USER_ACCREDITATIONS(n,t,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(Pl,{height:"8"})]})},DD=()=>{const{organizationId:e,eventId:n,userInfoId:t}=Vi(),{data:s,loader:o,reload:a}=Li("query UserProfileAccreditations(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $excludeAccreditations: [AccreditationId!]\n) {\n organization(id: $organizationId) {\n hideAccreditationsUntilConfirmationEmailSent\n\n userInfo(id: $userInfoId) {\n formsUsersInfos(eventId: $eventId, level: Event) {\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n index\n }\n\n accreditationCategory {\n name\n }\n }\n\n form {\n id\n name\n }\n }\n }\n }\n\n event(id: $eventId) {\n name\n dayStartTime\n startAt\n endAt\n hasFormWithAccreditationDisplay\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n isAccreditationsEmailSent\n\n accreditationsUsersInfos(excludeAccreditations: $excludeAccreditations) {\n ...UserPanelAccreditationSlotUserInfo\n }\n }\n }\n}\n",{organizationId:e,eventId:n,userInfoId:t},[$o.UserPanelAccreditationSlotUserInfoFragment]);return o||(0,i.jsx)(RD,{event:s.event,organization:s.organization,reload:a})},MD=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),{organization:a,hasFeature:r}=XS(),{event:d,hasEventRole:l}=BS(),{canDocumentRead:c,canMemberAccredit:u,canMemberAssignmentStateEdit:m,canMemberEdit:g,canMemberDelete:h}=oy(),{mutate:p,isLoading:I}=ir(),{mutate:x,isLoading:f}=lr(),{mutate:_,isLoading:j}=lr(),{mutate:v,isLoading:S}=lr(),{mutate:y}=Na(),{mutate:C}=Ga(),{mutate:b,isLoading:A}=ar(),{mutate:E,isLoading:w}=ar(),[$,T]=(0,V.useState)(!1),[z,O]=(0,V.useState)(!1),R=(0,V.useMemo)(()=>(0,Lm.A)(e.customDocuments.filter(n=>wh(n.populationsIds,e.userInfo.fields.population)),e=>e.name),[e.customDocuments,e.userInfo]),{permissions:[D]}=iE(((...e)=>({name:"canUserInfoAssignFn",args:e}))(e.userInfo.id)),M=c&&(e.links&&(e.state===it.Assigned||Yo(a.customBadges))||Yo(R)),P=M&&e.state===it.Assigned&&d.usePositions,k=l&&g&&d.useDelegations&&r(Ze.Delegation)&&e.delegation,F={lang:e.userInfo.language};return(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(D||m)&&(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("affectation")}),m&&(e.state===it.Assigned||e.state===it.Refused||e.state===it.NotApplicable||e.state===it.PreAssigned)&&(0,i.jsx)(tc,{color:"white",isLoading:f,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await x({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:it.WaitingAssignment}}),e.reload()},children:o("changer_le_stat_90266")}),m&&(e.state===it.Assigned||e.state===it.WaitingAssignment||e.state===it.NotApplicable||e.state===it.PreAssigned)&&(0,i.jsx)(tc,{color:"white",isLoading:j,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await _({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:it.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),m&&(e.state===it.WaitingAssignment||e.state===it.Assigned)&&(0,i.jsx)(tc,{color:"white",isLoading:S,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await v({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:it.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),D&&e.state===it.Assigned&&(0,i.jsx)(tc,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:yo.EDIT_ASSIGNMENT(t,s,e.userInfo.id),children:o("_diter_les_affe_42283")}),D&&(e.state===it.WaitingAssignment||e.state===it.PreAssigned)&&(0,i.jsx)(tc,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:yo.ASSIGNMENT(t,s,e.userInfo.id),children:o("affecter_94255")}),D&&e.teams.map(e=>e.state===it.WaitingAssignment?(0,i.jsx)(tc,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:yo.TEAM_ASSIGNMENT(t,s,e.teamCode),children:o("affecter_l_qui_12468",e.teamCode)},e.teamCode):null),D&&e.state===it.Assigned&&(0,i.jsx)(tc,{color:"white",isLoading:I,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:t,eventId:s,userInfoId:e.userInfo.id,emailType:Ve.Assignments})},children:o("r_envoyer_l_e_65315")}),D&&e.state===it.Refused&&(0,i.jsx)(tc,{color:"white",isLoading:I,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:t,eventId:s,userInfoId:e.userInfo.id,emailType:Ve.Refused})},children:o("r_envoyer_l_e_06733")})]}),u&&(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Accreditation")}),(e.accreditationState===ge.NotApplicable||e.accreditationState===ge.Refused||e.accreditationState===ge.Accredited||e.accreditationState===ge.AutoAccredited)&&(0,i.jsx)(tc,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await E({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ge.WaitingAccreditation}}),e.reload()},children:o("changer_le_stat_20528")}),(e.accreditationState===ge.Accredited||e.accreditationState===ge.AutoAccredited||e.accreditationState===ge.WaitingAccreditation||e.accreditationState===ge.NotApplicable)&&(0,i.jsx)(tc,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await E({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ge.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),(e.accreditationState===ge.WaitingAccreditation||e.accreditationState===ge.Accredited||e.accreditationState===ge.AutoAccredited)&&(0,i.jsx)(tc,{color:"white",isLoading:A,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await b({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:ge.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),e.accreditationState===ge.Accredited&&(0,i.jsx)(tc,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:yo.EDIT_ACCREDIT(t,s,e.userInfo.id),children:o("_diter_les_accr_86042")}),(e.accreditationState===ge.AutoAccredited||e.accreditationState===ge.WaitingAccreditation)&&(0,i.jsx)(tc,{color:"white",leftIcon:"badge-check",rightIcon:"arrow-right",to:yo.ACCREDIT(t,s,e.userInfo.id),children:o("accr_diter_70543")}),(e.accreditationState===ge.Accredited||e.accreditationState===ge.AutoAccredited)&&(0,i.jsx)(tc,{color:"white",isLoading:I,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:t,eventId:s,userInfoId:e.userInfo.id,emailType:Ve.Accreditations})},children:o("r_envoyer_l_e_24677")})]}),M&&(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Documents")}),P&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.nameOrEmail}-assignments`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userAssignmentsLink,"pdf",F),children:o("t_l_charger_la_82882")}),(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.nameOrEmail}-planning`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userPlanningLink,"pdf",F),children:o("t_l_charger_le_74660")}),(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-days`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userPlanningDaysLink,"pdf",F),children:o("t_l_charger_le_43587")}),(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-list`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userPlanningListLink,"pdf",F),children:o("t_l_charger_le_58518")}),(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.nameOrEmail}-user-hours`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userHoursLink,"pdf",F),children:o("t_l_charger_les_98537")}),(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.nameOrEmail}-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userBadgeLink,"pdf",F),children:o("t_l_charger_le_53240")}),(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.nameOrEmail}-certificate`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userCertificateLink,"pdf",F),children:o("t_l_charger_l_a_02386")})]}),a.customBadges.map(n=>(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.nameOrEmail}-custom-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userCustomBadgeLinks[n],"pdf",F),children:o("t_l_charger_1_80752",M_(n))},n)),R.map((n,t)=>(0,i.jsx)(tc,{color:"white",download:`${e.userInfo.name}-custom-document`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ef(e.links.userCustomDocumentLinks[n.slug],"pdf",F),children:o("t_l_charger_1_80752",n.name)},t))]}),h&&(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("g_n_ral_64953")}),k&&(0,i.jsx)(tc,{color:"white",leftIcon:"minus",rightIcon:"arrow-right",onClick:()=>T(!0),children:o("retirer_de_la_d_64963")}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>O(!0),children:o("d_sinscrire_de_06416")})]}),k&&$&&(0,i.jsx)(ow,{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:()=>T(!1),onDelete:async()=>{await y({organizationId:a.id,eventId:s,delegationId:e.delegation.id,selecteds:{ids:[e.userInfo.id]}}),n.push(yo.VOLUNTEERS(t,s))}}),z&&(0,i.jsx)(ow,{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:()=>O(!1),onDelete:async()=>{await C({eventId:s,selecteds:{ids:[e.userInfo.id]}}),n.push(yo.VOLUNTEERS(t,s))}}),(0,i.jsx)(Pl,{height:"8"})]})},PD=()=>{const{params:{eventId:e,userInfoId:n}}=Kl(),{data:t,loader:s,reload:o}=Li("query UserOverlayActionsEvent($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n customDocuments {\n ...CustomDocumentPopulation\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n accreditationState\n state\n\n delegation {\n id\n name\n }\n\n teams {\n teamCode\n state\n }\n\n userInfo {\n ...UserInfoOverlay\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n }\n }\n }\n}\n",{eventId:e,userInfoId:n},[$o.CustomDocumentPopulationFragment,$o.UserInfoOverlayFragment,$o.UserInfoLinksFragment]);if(s)return s;{const e=t.event.volunteerRegistration;return(0,i.jsx)(MD,{accreditationState:e.accreditationState,customDocuments:t.event.customDocuments,delegation:e.delegation,links:e.userInfo.links,reload:o,state:e.state,teams:e.teams,userInfo:e.userInfo})}},kD=e=>{const{history:n,params:{organizationId:t},translate:s}=Kl(),{mutate:o}=function(e={}){return Ui("mutation UserInfoAdminDelete($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n userInfoAdminDelete(organizationId: $organizationId, userInfoId: $userInfoId) {\n id\n }\n}\n",e)}(),[a,r]=(0,V.useState)(!1);return(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("g_n_ral_64953")}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>r(!0),children:s("supprimer_43083")}),a&&(0,i.jsx)(ow,{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:()=>r(!1),onDelete:async()=>{await o({organizationId:t,userInfoId:e.userInfo.id}),n.push(hs.COMMUNITY_USERS({organizationId:t}))}})]})},FD=()=>{const{params:{organizationId:e,userInfoId:n}}=Kl(),{data:t,loader:s}=Li("query UserOverlayActionsOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n }\n }\n}\n",{organizationId:e,userInfoId:n},[$o.UserInfoOverlayFragment]);return s||(0,i.jsx)(kD,{userInfo:t.organization.userInfo})},ND=e=>{const{translate:n,params:{organizationId:t,eventId:s,userInfoId:o}}=Kl(),a=ki(TS),r=ki(Jm),{mutate:d}=va(),{data:l}=ya({organizationId:t,eventId:s,userInfoId:o}),c=(0,V.useMemo)(()=>{const t=a.createUpdateCampaignValuesDefault(!1,l.organization?.event?.emailSender?.id??l.organization?.emailSenderId,null,null),i=l.organization?.userInfo?.name||"",s=r.toLocaleString(Oo.c9.now(),Uo.FullDateTime);return{...t,campaign:{...t.campaign,name:e.campaignType===ve.Sms?n("sms_1_le_2_25252",i,s):n("e_mail_1_le_21805",i,s),campaignType:e.campaignType,state:je.InProgress,sendToEveryone:!1,usersInfosIds:[o]}}},[e.campaignType,l.organization]);return(0,i.jsx)(xc,{initialValues:c,render:t=>(0,i.jsxs)(gp,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Yy,{children:e.campaignType===ve.Sms?n("envoi_d_un_sms_22148"):n("envoi_d_un_emai_99336")}),(0,i.jsx)(hp,{css:{padding:"$6"},children:e.campaignType===ve.Email?(0,i.jsx)(mS,{canCustomDocuments:e.canCustomDocuments,customDocuments:l.organization?.event?.customDocuments??[],customFields:qo,emailSenderId:l.organization?.event?.emailSender?.id??l.organization?.emailSenderId,emailsSenders:l.organization?.emailsSenders??[],form:t.form,hasDuplicatedMembers:!1,values:t.values}):(0,i.jsx)(fS,{formRenderProps:t})}),(0,i.jsx)(pp,{children:(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")}),(0,i.jsx)(tc,{isLoading:t.submitting,onClick:t.handleSubmit,children:n("envoyer_26609")})]})})]}),onSubmit:async n=>{await d({organizationId:t,eventId:s,campaign:n.campaign}),e.onClose()}})},LD=e=>{const n=Fi(),t=ki(Fc),{mutate:s}=Xa();return(0,i.jsx)(tb,{buttonText:n("modifier_l_adre_94026"),icon:"pen",initialValues:{email:e.email},schema:t.emailSchema(),title:n("modification_de_69462"),onClose:e.onClose,onSubmit:async n=>{await s({email:n.email,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.userInfoId}),e.onClose(),e.onSuccess()},children:(0,i.jsx)($c,{label:n("adresse_e_mail_60930"),name:"email"})})},UD=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{hasFeature:o}=XS(),{event:a}=BS(),[r,d]=(0,V.useState)(!1),[l,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1),h=Ho(e.userInfo.population).join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"4",width:1,children:[(0,i.jsx)(t_,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:88}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{font:"gray800 textXl medium",children:e.userInfo.name}),(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("Email")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Ku,{color:"white",cursor:"pointer",leftIcon:"at",rightIcon:"chevron-down",size:"md",children:e.userInfo.email})}),(0,i.jsxs)(Fu,{placement:"bottom-start",children:[(0,i.jsx)(Pu,{icon:"copy",onClick:()=>{lS(e.userInfo.email)},children:n("copier_1_59210",e.userInfo.email)}),e.canEmailEdit&&(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{d(!0)},children:n("modifier_1_38587",e.userInfo.email)}),(0,i.jsx)(Pu,{icon:"at",onClick:()=>c(!0),children:n("_crire_1_90053",e.userInfo.email)})]})]})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("t_l_phone_31755")}),g(e.userInfo.phone?.internationalFormat)?(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Ku,{color:"white",cursor:"pointer",leftIcon:"phone",rightIcon:"chevron-down",size:"md",children:e.userInfo.phone?.internationalFormat??"-"})}),(0,i.jsxs)(Fu,{placement:"bottom-start",children:[(0,i.jsx)(Pu,{color:"default",icon:"copy",onClick:()=>lS(e.userInfo.phone.internationalFormat),children:n("copier_1_59210",e.userInfo.phone?.internationalFormat??"-")}),(0,i.jsx)(ql,{to:{pathname:`tel:${e.userInfo.phone.internationalFormat.replaceAll(" ","")}`},children:(0,i.jsx)(Pu,{color:"default",icon:"phone",children:n("appeler_1_57163",e.userInfo.phone?.internationalFormat??"-")})}),o(Ze.Sms)&&(0,i.jsx)(Pu,{icon:"phone",onClick:()=>m(!0),children:n("_crire_1_90053",e.userInfo.phone?.internationalFormat??"-")})]})]}):(0,i.jsx)(Mr,{color:"gray500",children:"-"})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:e.populationFieldName}),(0,i.jsx)(Mr,{color:"gray500",children:g(h)?h:"-"})]}),e.showPositions&&e.assignmentState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("status_d_affect_75769")}),(0,i.jsx)(Tl,{children:(0,i.jsx)(Ku,{...Ly(e.assignmentState),children:n(e.assignmentState)})})]})}),e.showAccreditations&&e.accreditationState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("statut_d_accr_d_75527")}),(0,i.jsx)(Tl,{children:(0,i.jsx)(Ku,{...Uy(e.accreditationState),children:n(e.accreditationState)})})]})})]})]})]}),r&&(0,i.jsx)(LD,{email:e.userInfo.email,eventId:s,organizationId:t,userInfoId:e.userInfo.id,onClose:()=>{d(!1)},onSuccess:e.reload}),l&&(0,i.jsx)(ND,{campaignType:ve.Email,canCustomDocuments:!!s&&a?.useDocuments,onClose:()=>c(!1)}),u&&(0,i.jsx)(ND,{campaignType:ve.Sms,canCustomDocuments:!1,onClose:()=>m(!1)})]})},VD=()=>(0,i.jsxs)(Tl,{gap:"4",width:1,children:[(0,i.jsx)(Qu,{size:88,variant:"circular"}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:28,width:200}),(0,i.jsx)(Qu,{borderRadius:"$1",height:48,width:1})]})]}),BD=e=>{const{translate:n,params:{organizationId:t,eventId:s,userInfoId:o}}=Kl(),{canCampaignSend:a}=oy(),r=ki(Jm),{mutate:d}=pr(),l=e.campaign.sentAt?.setZone(Oo.c9.local().zone),c=(0,V.useMemo)(()=>e.campaign.campaignType===ve.Email&&e.campaign.email?e.campaign.email.state:null,[e.campaign]),u=(0,V.useMemo)(()=>e.campaign.campaignType===ve.Sms&&e.campaign.textMessage?e.campaign.textMessage.state:null,[e.campaign]);return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(Xm,{to:Gj.CAMPAIGN({organizationId:e.campaign.organizationId,eventId:e.campaign.eventId||void 0,campaignId:e.campaign.id}),children:e.campaign.name}),l&&(0,i.jsx)(Mr,{color:"gray500",children:n("envoy_e_le_1_31494",r.toLocaleString(l,Uo.DateOnly.MonthLong),r.toLocaleString(l,Uo.TimeOnly))})]})}),(0,i.jsxs)($m,{width:150,children:[(0,i.jsx)(Mr,{width:22,children:e.campaign.campaignType===ve.Email?(0,i.jsx)(Yl,{icon:"at"}):(0,i.jsx)(Yl,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsxs)($m,{width:200,children:[c&&(0,i.jsx)(Ku,{...Py(c),children:n(c)}),u&&(0,i.jsx)(Ku,{...Hy(u),children:n(u)})]}),(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{css:{ellipsis:!0},children:e.campaign.event?.name??n("communaut_20896")})}),a&&(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsx)(Km,{children:(0,i.jsx)(Pu,{icon:"paper-plane",onClick:async()=>{await d({organizationId:t,eventId:s,campaignId:e.campaign.id,selecteds:{ids:[o]}})},children:n("r_envoyer_90741")})})})]})},WD=()=>{const{translate:e,params:{organizationId:n,userInfoId:t}}=Kl(),{canCampaignSend:s}=oy(),{data:o,isLoading:a,reload:r}=Li("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:n,userInfoId:t},[]);return(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:e("nom_de_la_campa_45063")}),(0,i.jsx)(Gm,{width:150,children:e("type_35427")}),(0,i.jsx)(Gm,{width:200,children:e("State")}),(0,i.jsx)(Gm,{children:e("_v_nement_22345")}),s&&(0,i.jsx)(Gm,{width:100})]}),a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{})]}):o.organization.userInfo.campaigns.nodes.map(e=>(0,i.jsx)(BD,{campaign:e,reload:r},e.id))]})},GD=e=>{const n=ki(Jm);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"clock",subtitle:n.toLocaleString(e.history.insertedAt.toLocal(),Uo.DateTime),children:e.actionLabel}),(0,i.jsx)(hx,{css:{overflowY:"auto"},children:(0,i.jsx)(Tl,{direction:"column",gap:"2",children:e.history.details.map((e,n)=>(0,i.jsx)(Mr,{css:{wordBreak:"break-word"},children:e},n))})})]})})},qD=e=>{const{translate:n}=Kl(),t=ki(Jm),s=e.history.data?.email??null,[o,a]=(0,V.useState)(!1);return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{width:320,children:"workflow"===e.history.executedBy?(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(Tl,{align:"center",css:{background:"$primary100",borderRadius:"32px",color:"$primary600",flexShrink:0,height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Yl,{icon:"bolt"})}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("automatisation_94272")})]}):e.history.user?(0,i.jsx)(My,{isClickDisabled:!0,size:32,userInfo:e.history.user}):g(s)?(0,i.jsxs)(Tl,{align:"center",css:{overflow:"hidden"},gap:"3",children:[(0,i.jsx)(t_,{email:s,size:32}),(0,i.jsx)(Mr,{css:{ellipsis:""},font:"gray800 textSm medium",title:s,children:s})]}):"-"}),(0,i.jsx)($m,{width:200,children:e.getActionLabel(e.history.action)}),(0,i.jsxs)($m,{children:[Yo(e.history.details)?(0,i.jsx)(Mr,{css:{clamp:2,cursor:"pointer",whiteSpace:"pre-line",wordBreak:"break-word","&:hover":{color:"$primary700"}},role:"button",tabIndex:0,onClick:()=>a(!0),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a(!0))},children:e.history.details.join("\n")}):"-",o&&(0,i.jsx)(GD,{actionLabel:e.getActionLabel(e.history.action),history:e.history,onClose:()=>a(!1)})]}),(0,i.jsx)($m,{width:200,children:t.toLocaleString(e.history.insertedAt.toLocal(),Uo.DateTime)})]})},HD=e=>{const{translate:n}=Kl();return e.isLoading||0!==e.totalCount?(0,i.jsx)(Nm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{width:320,children:n("utilisateur_41699")}),(0,i.jsx)(Gm,{width:200,children:n("action_44224")}),(0,i.jsx)(Gm,{children:n("d_tails_96248")}),(0,i.jsx)(Gm,{width:200,children:n("Date")})]}),numberOfPages:e.numberOfPages,offset:e.offset,rows:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):e.histories.map(n=>(0,i.jsx)(qD,{getActionLabel:e.getActionLabel,history:n},n.id)),setOffset:e.setOffset,totalCount:e.totalCount}):(0,i.jsx)(UE,{title:n("aucun_historiqu_42893")})},YD=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),[o,a]=(0,V.useState)(0),{data:r,isLoading:d}=Li("query UserHistoryChanges(\n $organizationId: OrganizationId!\n $userInfoId: UsersInfoId!\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n histories(eventId: $eventId, offset: $offset, limit: 25) {\n nodes {\n ...HistoryRow\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{organizationId:n,userInfoId:s,eventId:t,offset:o},[$o.HistoryRowFragment]),{numberOfPages:l,totalCount:c}=Sx(r.organization?.userInfo.histories);return(0,i.jsx)(HD,{getActionLabel:n=>e(`history_users_infos_${n}`),histories:r.organization?.userInfo.histories.nodes??[],isLoading:d,numberOfPages:l,offset:o,setOffset:a,totalCount:c})},ZD=e=>{const{translate:n,params:{organizationId:t}}=Kl(),s=ki(Jm),o=(0,V.useMemo)(()=>Object.values((0,fm.A)(e.vr.positionsSlotsUsersInfos,e=>e.position.id)).map(e=>{const n=e[0].position;return{id:n.id,text:g(n.acronym)?n.acronym:n.name,color:n.color,count:e.length,icon:n.icon}}),[e.vr]),a=(0,V.useMemo)(()=>Object.values((0,fm.A)(e.vr.accreditationsUsersInfos,e=>e.accreditation.id)).map(e=>{const n=e[0].accreditation;return{id:n.id,text:g(n.acronym)?n.acronym:n.name,color:n.color,count:e.length,icon:n.icon}}),[e.vr]);return(0,i.jsxs)(km,{children:[(0,i.jsxs)($m,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Xm,{to:Rs.EVENT({organizationId:t,eventId:e.vr.event.id}),children:e.vr.event.name}),(0,i.jsx)(Mr,{color:"gray500",children:n("inscrit_le_1_12018",s.toLocaleString(e.vr.insertedAt.toLocal(),Uo.DateTime))})]}),(0,i.jsx)($m,{children:(0,i.jsx)(pA,{badges:o})}),(0,i.jsx)($m,{children:(0,i.jsx)(pA,{badges:a})}),(0,i.jsx)($m,{children:e.vr.delegation&&(0,i.jsx)(Ku,{ellipsis:!0,children:e.vr.delegation.name})})]})},KD=()=>{const{translate:e,params:{organizationId:n,userInfoId:t}}=Kl(),{data:s,isLoading:o}=Li("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:n,userInfoId:t},[]);return(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Gm,{children:e("missions_63972")}),(0,i.jsx)(Gm,{children:e("accr_ditations_39450")}),(0,i.jsx)(Gm,{children:e("Delegation")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{})]}):s.organization.userInfo.volunteersRegistrations.map(e=>(0,i.jsx)(ZD,{vr:e},e.id))]})},XD=e=>{const{translate:n,params:{organizationId:t}}=Kl(),s=ki(Jm);return(0,i.jsxs)(km,{children:[(0,i.jsxs)($m,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Xm,{to:$s.FORM_PARAMETERS_GENERAL({organizationId:t,eventId:e.fui.event?.id,formId:e.fui.form.id}),children:e.fui.form.name}),(0,i.jsx)(Mr,{color:"gray500",children:n("rempli_le_1_29292",s.toLocaleString(e.fui.insertedAt.toLocal(),Uo.DateTime))})]}),(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{css:{ellipsis:!0},children:e.fui.event?.name??n("communaut_20896")})})]})},QD=()=>{const{translate:e,params:{organizationId:n,userInfoId:t}}=Kl(),{data:s,isLoading:o}=Li("query UserHistoryForms($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n formsUsersInfos {\n id\n insertedAt\n\n form {\n id\n name\n }\n\n event {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:n,userInfoId:t},[]);return(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:e("nom_du_formulai_14952")}),(0,i.jsx)(Gm,{children:e("_v_nement_22345")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{})]}):s.organization.userInfo.formsUsersInfos.map(e=>(0,i.jsx)(XD,{fui:e},e.id))]})},JD=e=>{const n=ki(Jm),{organization:t}=XS(),s=(0,V.useMemo)(()=>Oo.c9.fromISO(e.weezeventWebhook.data?.values?.validated)?.isValid?Oo.c9.fromISO(e.weezeventWebhook.data?.values?.validated):e.weezeventWebhook.insertedAt,[e.weezeventWebhook]),o=e.weezeventWebhook.checklist?$f(t.weezeventOrganizationId,e.weezeventWebhook.checklist.id):"";return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xm,{to:o,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.weezeventWebhook.checklist?.name??"-",width:1,children:e.weezeventWebhook.checklist?.name??"-"})})}),(0,i.jsx)($m,{children:n.toLocaleString(s,{...Uo.DateTime,weekday:"long"})}),(0,i.jsx)($m,{children:e.weezeventWebhook.data?.values?.partner_name??"-"})]})},eM=()=>{const{translate:e,params:{eventId:n,userInfoId:t}}=Kl(),{data:s,isLoading:o}=Li('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:n,userInfoId:t},[]);return(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:e("liste_de_contr_79815")}),(0,i.jsx)(Gm,{children:e("Date")}),(0,i.jsx)(Gm,{children:e("op_rateur_30804")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{})]}):s.event.volunteerRegistration.weezeventWebhooks.nodes.map(e=>(0,i.jsx)(JD,{weezeventWebhook:e},e.id))]})},nM=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{data:o,isLoading:a}=Li("query UserHistorySegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n segmentsFolders(segmentType: Volunteers, eventId: $eventId, level: $level) {\n id\n name\n\n segments {\n id\n name\n isIn(userInfoId: $userInfoId)\n }\n }\n }\n}\n",{organizationId:n,level:t?xn.Event:xn.Organization,eventId:t,userInfoId:s},[]);return(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:e("dossier_00726")}),(0,i.jsx)(Gm,{children:e("vue_97139")}),(0,i.jsx)(Gm,{width:100,children:e("fait_parti_67171")})]}),a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{})]}):o.organization.segmentsFolders.flatMap(e=>e.segments.map(s=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:e.name}),(0,i.jsx)($m,{children:(0,i.jsx)(Xm,{to:t?yo.VOLUNTEERS_SEGMENT(n,t,s.id):yo.COMMUNITY_USERS_SEGMENT(n,s.id),children:s.name})}),(0,i.jsx)($m,{width:100,children:s.isIn&&(0,i.jsx)(Yl,{icon:"check"})})]},s.id)))]})},tM=e=>{const{translate:n,params:t}=Kl(),{hasOrganizationRole:s}=XS(),{hasEventRole:o}=BS(),{canAccreditationRead:a,canCampaignRead:r,canDelegationRead:d,canFormRead:l}=oy(),c={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"},u=e.isEvent&&e.isWeezeventConnected&&(a||d);return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,overflow:"hidden",paddingTop:"$5"},direction:"column",gap:"5",children:[(0,i.jsx)(Mr,{css:{px:"$6"},font:"gray900 textMd semiBold",children:n("historique_06296")}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$6"},children:[(s||o)&&(0,i.jsx)(Ey,{path:Rj.MEMBER_HISTORY_CHANGES(t),children:n("historique_06296")}),(s||o)&&(0,i.jsx)(Ey,{path:Rj.MEMBER_HISTORY_EVENTS(t),children:n("Event")}),r&&(0,i.jsx)(Ey,{path:Rj.MEMBER_HISTORY_CAMPAIGNS(t),children:n("Campaigns")}),l&&(0,i.jsx)(Ey,{path:Rj.MEMBER_HISTORY_FORMS(t),children:n("Form_plural")}),u&&(0,i.jsx)(Ey,{path:Rj.MEMBER_HISTORY_SCANS(t),children:"Scans"}),(s||o)&&(0,i.jsx)(Ey,{path:Rj.MEMBER_HISTORY_SEGMENTS(t),children:n("vues_50543")})]}),(s||o)&&(0,i.jsx)($y,{path:Rj.MEMBER_HISTORY_CHANGES(c),children:(0,i.jsx)(YD,{})}),(s||o)&&(0,i.jsx)($y,{path:Rj.MEMBER_HISTORY_EVENTS(c),children:(0,i.jsx)(KD,{})}),r&&(0,i.jsx)($y,{path:Rj.MEMBER_HISTORY_CAMPAIGNS(c),children:(0,i.jsx)(WD,{})}),l&&(0,i.jsx)($y,{path:Rj.MEMBER_HISTORY_FORMS(c),children:(0,i.jsx)(QD,{})}),u&&(0,i.jsx)($y,{path:Rj.MEMBER_HISTORY_SCANS(c),children:(0,i.jsx)(eM,{})}),(s||o)&&(0,i.jsx)($y,{path:Rj.MEMBER_HISTORY_SEGMENTS(c),children:(0,i.jsx)(nM,{})})]})]})},iM=e=>{const{translate:n}=Kl(),t=ki(Jm),[s,o]=(0,V.useState)(!0),a=(0,V.useCallback)(async()=>{const n=!s;o(n),await NS.forms.put({id:e.form.id,isOpenInUserOverlay:n})},[s,o]),r=e.canEdit&&!1!==e.form.isEditableInMemberSpace;return(0,V.useEffect)(()=>{(async()=>{o((await NS.forms.get(e.form.id))?.isOpenInUserOverlay??!0)})()},[]),(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",padding:"$5 $6",userSelect:"none"},gap:"4",onClick:a,children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:s?"chevron-up":"chevron-down"})}),(0,i.jsxs)(Tl,{align:"start",css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{children:e.form.name}),e.showIsFilled?e.filledAt?(0,i.jsx)(Ku,{color:"success",size:"sm",children:n("rempli_le_1_29292",t.toLocaleString(e.filledAt.toLocal(),Uo.DateTime))}):(0,i.jsx)(Ku,{color:"error",size:"sm",children:n("non_rempli_80877")}):null]}),r&&(0,i.jsx)(tc,{color:"white",size:"sm",to:e.getEditUserFormPath(e.form.id),children:n("_diter_62574")})]}),s&&(0,i.jsx)(zE,{css:{borderTop:"1px solid $gray200",padding:"$6"},form:e.form,userInfo:e.userInfo})]})},sM=e=>(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Yl,{icon:e.icon}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:e.title})]}),e.children]}),oM=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl();return(0,i.jsx)(sM,{icon:"people-group",title:t("d_l_gations_78318"),children:(0,i.jsx)(Tl,{gap:"2",wrap:"wrap",children:e.delegations.map(e=>{const t=o?e.name:e.event?`${e.event.name} : ${e.name}`:e.name;return(0,i.jsx)(Ku,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{n.push(e.event?Js.DELEGATION({organizationId:s,eventId:e.event.id,delegationId:e.id}):yo.COMMUNITY_DELEGATION(s,e.id))},children:t},e.id)})})})},aM=e=>{const{history:n,translate:t}=Kl(),s=ki(Jm),[o,a]=(0,V.useState)(!1),r=(0,V.useMemo)(()=>e.customFields.filter(e=>e.isPrivate),[e.customFields]),d=(0,V.useMemo)(()=>Yo(e.profilePrivateFields)?e.profilePrivateFields:r.map(e=>e.slug),[r,e.profilePrivateFields]),l=(0,V.useMemo)(()=>(0,Lm.A)(r.filter(n=>d.includes(n.slug)&&AC(n,e.userInfo.fields,e.customFields)),({slug:e})=>d.indexOf(e)),[e.customFields,r,d]),c=(0,V.useCallback)(async n=>{await e.profilePrivateFieldsUpdate(n),e.reload()},[e.profilePrivateFieldsUpdate,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(sM,{icon:"lock-keyhole",title:t("informations_pr_15873"),children:[l.map(n=>(0,i.jsx)(TE,{field:n,fields:e.userInfo.fields},n.slug)),(0,i.jsx)(Mr,{css:{textTransform:"uppercase"},font:"gray500 textXs regular",children:t("inscrit_le_1_12018",s.toLocaleString(e.insertedAt.toLocal(),Uo.DateTime))}),(0,i.jsx)(ly,{permissions:sy.MEMBER_EDIT,children:(0,i.jsx)(Fz,{color:"white",menu:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Pu,{icon:"gear",onClick:()=>{a(!0)},children:t("g_rer_les_champ_00431")})}),onClick:()=>n.push(e.getEditUserFormPath("private")),children:t("_diter_62574")})})]}),o&&(0,i.jsx)(jp,{columns:r,css:{zIndex:"210"},initialSelectedColumns:d,saveButtonText:t("mettre_jour_85141"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_69296"),title:t("gestion_des_cha_66775"),onClose:()=>{a(!1)},onSave:c})]})},rM=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Yl,{icon:"users-viewfinder"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("profils_li_s_03417")})]}),e.usersInfos.map(e=>(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(My,{size:32,userInfo:e}),Yo(e.delegations)&&(0,i.jsx)(Tl,{css:{paddingLeft:"44px"},gap:"2",wrap:"wrap",children:e.delegations.map(e=>(0,i.jsx)(Ku,{color:"white",size:"md",children:e.name},e.id))})]},e.id))]})},dM=({team:{organizationId:e,eventId:n,formId:t,teamCode:s,teamMembers:o}})=>{const{history:a,translate:r}=Kl(),d=yf({organizationId:e,eventId:n,formId:t,teamCode:s}),{isLoading:l,copy:c}=cS(),u=(0,V.useCallback)(()=>{c(yf({organizationId:e,eventId:n,formId:t,teamCode:s}))},[e,n,t,s]);return(0,i.jsxs)(sM,{icon:"user-group",title:r("_quipe_76857"),children:[g(s)&&(0,i.jsx)(Tl,{gap:"2",children:(0,i.jsx)(Ku,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{a.push(yo.TEAM_ASSIGNMENT(e,n,s))},children:s})}),o.map(e=>(0,i.jsx)(My,{size:32,userInfo:e},e.id)),(0,i.jsxs)(Tl,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(ql,{to:d,children:r("lien_d_invitati_45319")}),(0,i.jsx)(tc,{color:"white",isLoading:l,rightIcon:"copy",size:"sm",onClick:u})]})]})};function lM(e,{locale:n}={}){const t=e.amount/100;return new Intl.NumberFormat(n,{style:"currency",currency:"USD",minimumFractionDigits:e.currencyDecimalPlaces,maximumFractionDigits:e.currencyDecimalPlaces}).formatToParts(t).map(n=>"currency"===n.type?e.currencySymbol:n.value).join("")}const cM=e=>{const{translate:n,params:{eventId:t,userInfoId:s}}=Kl(),{canTicketIdRegenerate:o}=oy(),a=ki(Jm),{mutate:r}=cl(),[d,l]=(0,V.useState)(!1),c=(0,V.useMemo)(()=>g(e.volunteerRegistration.weezevent.lastSynchronizedAt)&&Oo.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt)?.isValid?a.toLocaleString(Oo.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt).toLocal(),Uo.DateTime):"-",[e.volunteerRegistration]),u=(0,V.useMemo)(()=>e.volunteerRegistration.pairedAt?.isValid?a.toLocaleString(e.volunteerRegistration.pairedAt.toLocal(),Uo.DateTime):"-",[e.volunteerRegistration]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{css:{padding:"$5 $6"},direction:"column",gap:"4",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Yl,{icon:"memo-circle-info"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("informations_22954")})]}),(0,i.jsxs)(Tl,{align:e.isWeezeventConnected?"center":"start",direction:e.isWeezeventConnected?"row":"column",gap:"5",children:[(0,i.jsx)(RA,{name:e.nameOrEmail,size:64,value:e.volunteerRegistration.ticketId}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("TicketId")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Ku,{color:"white",cursor:"pointer",leftIcon:"ticket",rightIcon:"chevron-down",size:"md",children:e.volunteerRegistration.ticketId})}),(0,i.jsxs)(Fu,{placement:"bottom-start",children:[(0,i.jsx)(Pu,{icon:"copy",onClick:()=>{lS(e.volunteerRegistration.ticketId)},children:n("copier_75889")}),e.isWeezeventConnected&&g(e.volunteerRegistration.weezeventTicketUrl)&&(0,i.jsx)(ql,{to:e.volunteerRegistration.weezeventTicketUrl,children:(0,i.jsx)(Pu,{icon:"arrow-up-right-from-square",children:n("ouvrir_dans_wee_97529")})}),e.isWeezeventConnected&&g(e.volunteerRegistration.weezeventAccessUrl)&&(0,i.jsx)(ql,{to:e.volunteerRegistration.weezeventAccessUrl,children:(0,i.jsx)(Pu,{icon:"arrow-up-right-from-square",children:n("ouvrir_dans_wee_22181")})}),e.isWeezeventConnected&&g(e.volunteerRegistration.weezeventPayUrl)&&(0,i.jsx)(ql,{to:e.volunteerRegistration.weezeventPayUrl,children:(0,i.jsx)(Pu,{icon:"arrow-up-right-from-square",children:n("ouvrir_dans_wee_14636")})}),o&&(0,i.jsx)(Pu,{icon:"repeat",onClick:()=>l(!0),children:n("r_g_n_rer_le_co_81294")})]})]})]}),e.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("num_ro_de_puce_50039")}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:g(e.volunteerRegistration.shortTag)?e.volunteerRegistration.shortTag:"-"})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("derni_re_synchr_59823")}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:c})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("appair_le_70213")}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:u})]})]})]})]}),e.isWeezeventConnected&&Yo(e.volunteerRegistration.weezeventPayBalances)&&(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",padding:"$5 $6"},direction:"column",gap:"4",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Yl,{icon:"money-bill"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("solde_cashless_67316")})]}),(0,i.jsx)(Tl,{gap:"9",children:e.volunteerRegistration.weezeventPayBalances.map((e,n)=>(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:e.currencyName}),(0,i.jsx)(Mr,{color:"gray800",children:lM(e)})]},n))})]})]}),d&&(0,i.jsx)(ow,{buttonText:n("r_g_n_rer_37440"),subtext:[n("_tes_vous_s_r_d_57752"),n("cela_rendra_l_a_42228")],text:n("r_g_n_rer_le_co_81294"),onClose:()=>l(!1),onDelete:async()=>{await r({eventId:t,selecteds:{ids:[s]}}),e.reload()}})]})},uM=e=>{const{translate:n,params:{eventId:t,userInfoId:s}}=Kl(),{organization:o}=XS(),{event:a}=BS(),{canMemberEdit:r}=oy(),[d,l]=(0,V.useState)(""),[c,u]=(0,V.useState)(e.initialShowNotFilled),m=(0,V.useCallback)(n=>{u(n),e.setShowNotFilled(n)},[e.setShowNotFilled,u]),h=(0,V.useMemo)(()=>Object.fromEntries(e.formsUsersInfos.map(e=>[e.formId,e.insertedAt])),[e.formsUsersInfos]),p=(0,V.useMemo)(()=>(0,Lm.A)(e.forms.filter(e=>!(!c&&void 0===h[e.id])&&(!g(d)||e.name.toLowerCase().includes(d.toLowerCase().trim()))),[e=>void 0!==h[e.id]?1:2,e=>e.name]),[e.forms,h,d,c]),I=(0,V.useMemo)(()=>Yo(e.delegations)&&(!t||a?.useDelegations),[a,t,e.delegations]),x=(0,V.useMemo)(()=>e.formsUsersInfos.filter(e=>g(e.teamCode)),[e.formsUsersInfos]),f=(0,V.useMemo)(()=>!Yo(x)||!t||a?.useForms,[x,t,a]),_=(0,V.useMemo)(()=>e.usersInfos.filter(e=>e.id!==s),[e.usersInfos,s]),j=(0,V.useMemo)(()=>yA(e.userPermissions,n),[e.userPermissions,o]);return(0,i.jsxs)(Tl,{gap:"6",width:1,children:[(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"4",children:[e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(cM,{isWeezeventConnected:e.isWeezeventConnected,nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$4"},gap:"2",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_f_28561"),value:d,onChange:l})}),(0,i.jsx)(om,{state:c?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:n("afficher_les_fo_84832")})]}),(0,i.jsx)(Tl,{direction:"column",gap:"3",children:0===p.length?(0,i.jsx)(Tl,{css:{background:"white",bd:!0},height:400,children:(0,i.jsx)(UE,{button:(0,i.jsx)(ly,{permissions:sy.MEMBER_EDIT,children:(0,i.jsx)(tc,{to:e.getEditUserFormPath("all"),children:n("_diter_les_cham_66020")})}),title:n("aucun_formulair_41857")})}):p.map(n=>(0,i.jsx)(iM,{canEdit:r,filledAt:h[n.id],form:n,getEditUserFormPath:e.getEditUserFormPath,showIsFilled:"all"!==n.id,userInfo:e.userInfo},n.id))})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:348,children:[!e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(cM,{isWeezeventConnected:e.isWeezeventConnected,nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),Yo(j)&&(0,i.jsx)(sM,{icon:"shield",title:n("r_les_61679"),children:(0,i.jsx)(Tl,{gap:"2",wrap:"wrap",children:j.map(e=>(0,i.jsx)(gA,{badge:e},e.id))})}),Yo(_)&&(0,i.jsx)(rM,{usersInfos:_}),I&&(0,i.jsx)(oM,{delegations:e.delegations}),f&&x.map((e,n)=>(0,i.jsx)(dM,{team:e},n)),(0,i.jsx)(aM,{customFields:e.customFields,getEditUserFormPath:e.getEditUserFormPath,insertedAt:e.insertedAt,profilePrivateFields:e.profilePrivateFields,profilePrivateFieldsUpdate:e.profilePrivateFieldsUpdate,reload:e.reload,userInfo:e.userInfo})]})]})},mM=()=>{const{organizationId:e,eventId:n,userInfoId:t}=Vi(),{localEvent:s,updateLocalEvent:o}=BS(),{mutate:a}=function(e={}){return Ui("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:r,loader:d,reload:l}=Li("query UserInformationsEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n ...UserAllPermissions\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n ...FormUserInfoUserProfile\n }\n\n user {\n usersInfos(organizationId: $organizationId, eventId: $eventId) {\n id\n name\n email\n\n picture {\n url\n }\n\n delegations(level: Event) {\n id\n name\n }\n }\n }\n }\n }\n\n event(id: $eventId) {\n isWeezeventConnected\n profilePrivateFields\n\n forms {\n nodes {\n ...FormUserOverlay\n }\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n insertedAt\n shortTag\n ticketId\n weezevent\n pairedAt\n weezeventAccessUrl\n weezeventPayUrl\n weezeventTicketUrl\n\n delegation {\n ...DelegationUserProfile\n }\n\n weezeventPayBalances {\n amount\n currencyDecimalPlaces\n currencyName\n currencySymbol\n }\n }\n }\n}\n",{organizationId:e,eventId:n,userInfoId:t},[$o.CustomFieldWithConditionFragment,$o.UserInfoOverlayFragment,$o.UserAllPermissionsFragment,$o.FormUserInfoUserProfileFragment,$o.FormUserOverlayFragment,$o.DelegationUserProfileFragment]),c=(0,V.useMemo)(()=>(0,Lm.A)(r.event?.forms.nodes??[],e=>e.name),[r.event]),u=(0,V.useMemo)(()=>(0,kl.A)([r.event?.volunteerRegistration.delegation]),[r.event]);return d||(0,i.jsx)(uM,{customFields:r.organization.customFields.nodes,delegations:u,forms:c,formsUsersInfos:r.organization?.userInfo.formsUsersInfos??qo,getEditUserFormPath:i=>yo.EDIT_USER_FORM(e,n,t,i),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:r.event.volunteerRegistration.insertedAt,isWeezeventConnected:r.event.isWeezeventConnected,profilePrivateFields:r.event.profilePrivateFields,profilePrivateFieldsUpdate:e=>a({eventId:n,profilePrivateFields:e}),reload:l,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:r.organization.userInfo,userPermissions:r.organization.userInfo,usersInfos:r.organization.userInfo.user.usersInfos,volunteerRegistration:r.event?.volunteerRegistration})},gM=()=>{const{params:{organizationId:e,userInfoId:n},translate:t}=Kl(),{localOrganization:s,updateLocalOrganization:o}=XS(),{mutate:a}=function(e={}){return Ui("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:r,loader:d,reload:l}=Li("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:n},[$o.CustomFieldWithConditionFragment,$o.FormUserOverlayFragment,$o.UserInfoOverlayFragment,$o.UserAllPermissionsFragment,$o.DelegationUserProfileFragment,$o.FormUserInfoUserProfileFragment]),c=(0,V.useMemo)(()=>{if(r.organization){const e=KC(r.organization.customFields.nodes),n={id:"all",name:t("tous_les_champs_57939"),elements:e};return(0,Lm.A)(r.organization.forms.nodes,e=>e.name).concat([n])}return[]},[r.organization,t]);return d||(0,i.jsx)(uM,{customFields:r.organization.customFields.nodes,delegations:r.organization.userInfo.delegations,forms:c,formsUsersInfos:r.organization?.userInfo.formsUsersInfos??qo,getEditUserFormPath:t=>yo.COMMUNITY_EDIT_USER_FORM(e,n,t),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:r.organization.userInfo.insertedAt,isWeezeventConnected:!1,profilePrivateFields:r.organization.profilePrivateFields,profilePrivateFieldsUpdate:n=>a({organizationId:e,profilePrivateFields:n}),reload:l,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:r.organization.userInfo,userPermissions:r.organization.userInfo,usersInfos:r.organization.userInfo.user.usersInfos,volunteerRegistration:null})},hM=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Bg),{mutate:o}=Ua(),a=(0,V.useMemo)(()=>Bo(),[]),[r,d]=(0,V.useState)(e.assignments.map(e=>({...e,checkInAt:e.checkInAt?.toLocal(),checkOutAt:e.checkOutAt?.toLocal()}))),l=(0,V.useMemo)(()=>r.every(e=>e.checkInAt?.isValid&&e.checkOutAt?.isValid&&e.checkOutAt>e.checkInAt||e.checkInAt?.isValid&&!e.checkOutAt?.isValid||!e.checkInAt?.isValid&&!e.checkOutAt?.isValid),[r]),c=(0,V.useCallback)((e,n,t)=>{d((0,dp.jM)(i=>{i.forEach(i=>{i.id===e&&(i[n]=t||void 0)})}))},[r,d]);return(0,i.jsx)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"sliders",children:n("mettre_jour_d_54198")}),(0,i.jsx)(hx,{gap:"4",children:r.map(e=>(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Mr,{font:"gray800 textSm medium",children:[e.position.name," -"," ",(0,i.jsx)(mf,{fontWeight:"regular",children:Zg(s,e.positionSlot,"",{slot:{includeRange:!0}})})]}),(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsx)(Kp,{rightIcon:"xmark",value:e.checkInAt,zone:a,onChange:n=>{c(e.id,"checkInAt",n)},onRightIconClick:()=>{c(e.id,"checkInAt",null)}}),(0,i.jsx)(Kp,{rightIcon:"xmark",value:e.checkOutAt,zone:a,onChange:n=>{c(e.id,"checkOutAt",n)},onRightIconClick:()=>{c(e.id,"checkOutAt",null)}}),(0,i.jsx)(wc,{shouldParseAsInt:!0,value:e.breakTime,onChange:n=>{c(e.id,"breakTime",n)}})]})]},e.id))}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:!l,onClick:async()=>{await Promise.all(r.map(e=>o({eventId:t,checkIn:{strategy:Ce.CheckInOut,breakTime:e.breakTime,checkInAt:e.checkInAt,checkOutAt:e.checkOutAt,positionsSlotsUsersInfosIds:[e.id]}}))),e.onClose(),e.onSuccess()},children:n("mettre_jour_85141")})})]})})},pM=e=>{const{translate:n}=Kl(),t=ki(Bg),s=(0,V.useMemo)(()=>{const n=Gu(e.psui.position.color);return{background:n[50],color:n[700]}},[e.psui]);return(0,i.jsx)(i.Fragment,{children:e.renderPosition((0,i.jsxs)(Tl,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[e.psui.positionSlot.name&&(0,i.jsx)(Mr,{children:e.psui.positionSlot.name}),(0,i.jsx)(Mr,{children:t.toDisplayString(e.psui.positionSlot.range,{hideDate:!0})})]}),e.psui.state===ye.CheckedOut&&(0,i.jsx)(Yl,{icon:"stopwatch",title:n("d_pointer_25328")}),e.psui.state===ye.CheckedIn&&(0,i.jsx)(Yl,{icon:"timer",title:n("pointer_80927")})]}),(0,i.jsx)(Mr,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]}),e.psui.position.id)})},IM=e=>{const n=fI(),[t]=Yg(e.dayStartTime),s=(0,V.useMemo)(()=>Lg(e.assignments.map(e=>({...e,range:e.positionSlot.range})),e.startAt,e.endAt,t),[e.assignments,e.startAt,e.endAt,t]);return(0,i.jsx)(D$,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:n?"week":"day",maxDate:e.endAt,minDate:e.startAt,children:s.map((n,s)=>(0,i.jsx)(R$,{endAt:n.range.start,startAt:n.range.start,startHour:t,children:(0,i.jsx)(pM,{psui:n,renderPosition:e.renderPosition,startHour:t})},s))})},xM=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{hasPermission:o}=PS(),a=ki(Jm),r=ki(Xb),d=ki(Bg),{mutate:l}=Ua(),c=(0,V.useMemo)(()=>Zg(d,e.psui.positionSlot,"",{slot:{includeRange:!0}}),[e.psui]),u=o(sy.MEMBER_ASSIGN),m=o(sy.POSITION_READ,{positionCategoryId:e.psui.positionCategoryId,positionId:e.psui.position.id});return(0,i.jsxs)(km,{children:[(0,i.jsxs)($m,{align:"center",gap:"3",children:[(0,i.jsx)(xI,{color:e.psui.position.color,icon:e.psui.position.icon}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.psui.positionCategory.name}),(0,i.jsx)(Xm,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:oo.POSITION({organizationId:t,eventId:s,positionId:e.psui.position.id}),children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.psui.position.name,width:1,children:e.psui.position.name})}),(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),(0,i.jsx)($m,{children:e.psui.state===ye.CheckedOut?(0,i.jsx)(Ku,{leftIcon:"clock",children:n("temps_total_79448",r.minutesToHoursMinutesString(e.psui.timeDifferenceMinutes))}):e.psui.state===ye.CheckedIn?(0,i.jsx)(Ku,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:n("point_le_1_63576",a.toLocaleString(e.psui.checkInAt.toLocal(),Uo.DateTime))}):(0,i.jsx)(Ku,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:n("non_point_42145")})}),(0,i.jsx)($m,{children:e.psui.isAutoAssign&&(0,i.jsx)(Mr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"check"})})}),(0,i.jsx)($m,{children:e.psui.isWorkflow&&(0,i.jsx)(Mr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"check"})})}),(0,i.jsxs)($m,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Mr,{children:e.psui.createdBy?.name||e.psui.createdBy?.email||"-"}),(0,i.jsx)(Mr,{color:"gray500",children:a.toLocaleString(e.psui.insertedAt.toLocal(),Uo.DateTime)})]}),(0,i.jsxs)(Qm,{justify:"end",width:200,children:[m&&(e.psui.state===ye.Waiting?(0,i.jsx)(tc,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.psui.eventId,checkIn:{strategy:Ce.CheckIn,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:n("pointer_80927")}):e.psui.state===ye.CheckedIn?(0,i.jsx)(tc,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.psui.eventId,checkIn:{strategy:Ce.CheckOut,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:n("d_pointer_25328")}):null),(0,i.jsx)(ME,{canCheckIn:m,canDelete:u,psui:e.psui,reloadCheckIn:e.reload,onDelete:e.reload})]})]})},fM=e=>{const{translate:n}=Kl(),{hasPermission:t}=PS(),s=t(sy.POSITION_READ),o=(0,V.useMemo)(()=>e.assignments.filter(n=>!e.selectedDay?.isValid||n.positionSlot.range.contains(e.selectedDay)||n.positionSlot.range.start.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()||n.positionSlot.range.end.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),[e.assignments,e.selectedDay]);return(0,i.jsxs)(ym,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:n("Position")}),(0,i.jsx)(Gm,{children:n("statut_du_point_52451")}),(0,i.jsx)(Gm,{children:n("affect_e_automa_74071")}),(0,i.jsx)(Gm,{children:n("ajout_via_une_69544")}),(0,i.jsx)(Gm,{children:n("ajout_e_par_71330")}),s&&(0,i.jsx)(Gm,{width:200})]}),o.map(n=>(0,i.jsx)(xM,{psui:n,reload:e.reload},n.id))]})},_M=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=Kl(),[a,r]=(0,V.useState)(N_(e.event.startAt,e.event.endAt)),[d,l]=(0,V.useState)(null),[c,u]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{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)(Tl,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Mr,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(dc,{children:e.title}),e.subtitle&&(0,i.jsx)(rc,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Tl,{as:"nav",gap:"3",children:["calendar"===e.positionsDisplay&&(0,i.jsx)(z$,{max:e.event.endAt,min:e.event.startAt,value:a,onChange:r}),"list"===e.positionsDisplay&&!e.hideListView&&(0,i.jsx)(Mr,{width:160,children:(0,i.jsx)(Wp,{rightIcon:"xmark",value:d,onChange:l,onRightIconClick:()=>l(null)})}),!e.hideListView&&e.setPositionsDisplay&&(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{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")})]})}),e.canMemberAssign&&(0,i.jsx)(tc,{to:yo.EDIT_ASSIGNMENT(n,t,s),children:o("_diter_les_affe_42283")}),e.canMemberAssign&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Fu,{placement:"bottom-end",children:(0,i.jsx)(Pu,{icon:"circle-check",onClick:()=>u(!0),children:o("mettre_jour_d_54198")})})]})]})]}),"calendar"===e.positionsDisplay?(0,i.jsx)(IM,{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)(fM,{assignments:e.assignments,reload:e.reload,selectedDay:d})]}),hM&&(0,i.jsx)(hM,{assignments:e.assignments,isOpen:c,onClose:()=>u(!1),onSuccess:()=>e.reload()})]})},jM=e=>{const[n,t]=zD("user.positions.display","calendar");return(0,i.jsx)(_M,{...e,positionsDisplay:n,setPositionsDisplay:t})},vM=e=>{const n=Fi(),t=ki(Bg),{mutate:s,isLoading:o}=rr(),a=g(e.slot.name)?`${e.slot.name} - ${t.toDisplayString(e.slot.range)}`:t.toDisplayString(e.slot.range);return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:e.slot.position.name}),(0,i.jsx)($m,{children:a}),(0,i.jsx)($m,{justify:"end",width:200,children:(0,i.jsx)(tc,{color:"white",isLoading:o,size:"sm",onClick:async()=>{await s({eventId:e.eventId,massAssign:{strategy:hn.Add,selecteds:{ids:[e.userInfoId]},positionsSlotsIds:[e.slot.id]}}),e.reload()},children:n("affecter_94255")})})]})},SM=e=>{const{params:{eventId:n,userInfoId:t},translate:s}=Kl(),[o,a,r]=Wm(""),[d,l]=(0,V.useState)(0),[c,u]=(0,V.useState)(null),m=(0,V.useCallback)(e=>{u(e),l(0)},[u,l]),{data:h,isLoading:p}=Li("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:n,userInfoId:t,name:g(a)?a:void 0,offset:d,sort:c},[]);const{numberOfPages:I,totalCount:x}=Sx(h.event?.volunteerRegistration.availablePositionsSlots),f=h.event?.volunteerRegistration.availablePositionsSlots.nodes??[];return(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:s("rechercher_une_69998"),value:o,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($x,{attribute:An.Position,setSort:m,sort:c,children:s("nom_de_la_missi_64605")}),(0,i.jsx)($x,{attribute:An.Range,setSort:m,sort:c,children:s("cr_neau_11117")}),(0,i.jsx)(Gm,{width:200})]}),numberOfPages:I,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):Yo(f)?f.map(t=>(0,i.jsx)(vM,{eventId:n,reload:e.reload,slot:t,userInfoId:e.userInfoId},t.id)):(0,i.jsx)(km,{css:{height:"200px"},children:(0,i.jsx)(UE,{title:s("aucune_mission_03533")})}),setOffset:l,title:s("missions_dispon_68881"),totalCount:x})},yM=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),a=ki(Bg),r=(0,V.useMemo)(()=>{const n=e.volunteerRegistration.preassignPositions.map(e=>({name:e.name,range:e.range?a.toDisplayString(e.range):"-",path:oo.POSITION({organizationId:t,eventId:s,positionId:e.id})})),i=e.volunteerRegistration.preassignPositionsCategories.map(e=>({name:e.name,range:e.range?a.toDisplayString(e.range):"-",path:oo.POSITION_CATEGORY({organizationId:t,eventId:s,positionCategoryId:e.id})}));return n.concat(i)},[e.volunteerRegistration]);return Yo(r)?(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:o("nom_de_la_missi_64605")}),(0,i.jsx)(Gm,{children:o("Date")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:r.map((e,t)=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{n.push(e.path)},children:e.name})}),(0,i.jsx)($m,{children:e.range})]},t))}),setOffset:Bc.A,title:o("pr_affectation_68999"),totalCount:0}):null},CM=e=>{const{translate:n}=Kl(),t=ki(Xb);return(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:n("nombre_d_heures_46954")}),(0,i.jsx)(Mr,{font:"gray900 displaySm semiBold",children:t.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes)})]}),(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:n("nombre_de_missi_80367")}),(0,i.jsx)(Mr,{font:"gray900 displaySm semiBold",children:e.numberOfAssignments})]})]})},bM=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=Kl(),{canMemberAssign:a}=oy(),r=(0,V.useMemo)(()=>(0,Lm.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event]);return(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:1,children:[Yo(r)&&(0,i.jsx)(jM,{assignments:r,canMemberAssign:a,event:e.event,reload:()=>{e.reload(),r.length<=1&&e.reloadHeader()},renderPosition:(e,s)=>(0,i.jsx)(ql,{style:{width:"100%"},to:oo.POSITION({organizationId:n,eventId:t,positionId:s}),children:e}),subtitle:o("visualisez_tout_59046"),title:o("missions_affect_97811")}),(0,i.jsx)(yM,{volunteerRegistration:e.event.volunteerRegistration}),e.event.hasFormWithPositionDisplay&&(0,i.jsx)(GE,{canMemberAssign:a,editPath:yo.EDIT_USER_MISSIONS(n,t,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(ly,{permissions:sy.MEMBER_ASSIGN,children:(0,i.jsx)(SM,{reload:e.reload,userInfoId:s})}),Yo(r)&&(0,i.jsx)(CM,{numberOfAssignments:r.length,volunteerRegistration:e.event.volunteerRegistration})]})},AM=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{data:o,loader:a,reload:r}=Va({organizationId:n,eventId:t,userInfoId:s});return a||(0,i.jsx)(bM,{event:o.event,organization:o.organization,reload:r,reloadHeader:e.reload})},EM=()=>{const{params:{organizationId:e,eventId:n,userInfoId:t}}=Kl(),{data:s,loader:o}=sr({organizationId:e,eventId:n,userInfoId:t}),{permissions:[a],isLoading:r}=iE(QA({eventId:n,userInfoId:t}));return o||r?o:(0,i.jsx)(i.Fragment,{children:s.event.hasFormWithSlotDisplay&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(tw,{editPath:yo.EDIT_USER_SLOTS(e,n,t),eventId:n,formsUsersInfos:s.organization.userInfo.formsUsersInfos,organizationId:e,showEditButton:a})})})},wM=e=>{const{params:n,translate:t}=Kl(),{data:s,isLoading:o,reload:a}=Li('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',n,[$o.UserInfoOverlayFragment]),r=(0,V.useMemo)(()=>s.organization?.userInfo.numberOfComments??0,[s.organization]),d={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"};Au(s.organization?.userInfo?.nameOrEmail||"");const{params:{eventId:l,delegationId:c,organizationId:u,userInfoId:m}}=Kl(),{permissions:[g,h],isLoading:p}=iE(KA({eventId:l,organizationId:u,userInfoId:m}),((...e)=>({name:"canEmailUpdateFn",args:e}))({delegationId:c,eventId:l,organizationId:u,userInfoId:m})),I=o||p;return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(by,{hideBorder:!0,children:I?(0,i.jsx)(VD,{}):(0,i.jsx)(UD,{accreditationState:s.organization?.userInfo.volunteerRegistration?.accreditationState,assignmentState:s.organization?.userInfo.volunteerRegistration?.state,canEmailEdit:h,populationFieldName:s.organization?.populationField.name||"",reload:a,showAccreditations:e.showAccreditations,showPositions:e.showPositions,userInfo:s.organization.userInfo})}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:Rj.MEMBER_INFORMATION(n),children:t("informations_22954")}),e.showAvailabilities&&(0,i.jsx)(Ey,{path:Rj.MEMBER_AVAILABILITIES(n),children:t("disponibilit_s_49923")}),e.showPositions&&(0,i.jsx)(Ey,{path:Rj.MEMBER_POSITIONS(n),children:t("missions_63972")}),e.showAccreditations&&(0,i.jsx)(Ey,{path:Rj.MEMBER_ACCREDITATIONS(n),children:t("accr_ditations_39450")}),e.showActions&&(0,i.jsx)(Ey,{path:Rj.MEMBER_ACTIONS(n),children:t("actions_21689")}),g&&(0,i.jsx)(Ey,{path:Rj.MEMBER_COMMENTS(n),children:t("commentaires_97857",r)}),(0,i.jsx)(Ey,{basePath:Rj.MEMBER_HISTORY(n),path:Rj.MEMBER_HISTORY_CHANGES(n),children:t("historique_06296")})]}),(0,i.jsx)($y,{path:Rj.MEMBER_INFORMATION(d),children:e.isEvent?(0,i.jsx)(yy,{children:(0,i.jsx)(mM,{})}):(0,i.jsx)(yy,{children:(0,i.jsx)(gM,{})})}),e.showAvailabilities&&(0,i.jsx)($y,{path:Rj.MEMBER_AVAILABILITIES(d),children:(0,i.jsx)(yy,{children:(0,i.jsx)(EM,{})})}),e.showPositions&&(0,i.jsx)($y,{path:Rj.MEMBER_POSITIONS(d),children:(0,i.jsx)(yy,{children:(0,i.jsx)(AM,{reload:a})})}),e.showAccreditations&&(0,i.jsx)($y,{path:Rj.MEMBER_ACCREDITATIONS(d),children:(0,i.jsx)(yy,{children:(0,i.jsx)(DD,{})})}),e.showActions&&(0,i.jsx)($y,{path:Rj.MEMBER_ACTIONS(d),children:e.isEvent?(0,i.jsx)(yy,{children:(0,i.jsx)(PD,{})}):(0,i.jsx)(yy,{children:(0,i.jsx)(FD,{})})}),g&&(0,i.jsx)($y,{path:Rj.MEMBER_COMMENTS(d),children:(0,i.jsx)(yy,{children:(0,i.jsx)(CD,{showEvent:!0})})}),(0,i.jsx)($y,{path:Rj.MEMBER_HISTORY(d),children:(0,i.jsx)(yy,{children:(0,i.jsx)(tM,{isEvent:e.isEvent,isWeezeventConnected:s.organization?.event?.isWeezeventConnected??!1})})})]})]})},$M=()=>{const{canAccreditationRead:e,canDocumentRead:n,canMemberAccredit:t,canMemberAssign:s,canMemberAssignmentStateEdit:o,canMemberAvailabilitiesEdit:a,canMemberDelete:r,canPositionRead:d}=oy(),l=n||t||s||o||r,c=e||d||a;return(0,i.jsx)(wM,{isEvent:!0,showAccreditations:e,showActions:l,showAvailabilities:c,showPositions:d})},TM=()=>(0,i.jsx)(wM,{isEvent:!1,showAccreditations:!1,showActions:!0,showAvailabilities:!1,showPositions:!1});var zM=t(6301);function OM(e=[]){const n=String.fromCharCode(65+(0,zM.A)(25));return!1===e.includes(n)?n:OM(e)}function RM(e=[]){const n=(0,zM.A)(9);return!1===e.includes(n)?n:RM(e)}const DM=["Q","O","I","L"],MM=[0,1];function PM(e=10){const n=(0,Om.A)(0,e-1).map(()=>{return e=DM,n=MM,0===(0,zM.A)(1)?OM(e):RM(n).toString();var e,n}).join("");return`${OM(DM)}${n}`}const kM=e=>{const n=Fi(),t=`formKeyToTeamCode.f${e.form.id}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:"Équipe"}),(0,i.jsx)(oI,{height:"4"}),(0,i.jsx)($c,{hint:n("d_finissez_votr_19710"),label:n("code_quipe_14296"),name:t,rightIcon:"arrows-rotate",onRightIconClick:()=>{e.change(t,PM())}}),(0,i.jsx)(Pl,{height:"9"})]})},FM=e=>{const{history:n,params:{eventId:t},translate:s}=Kl(),o=V.useMemo(()=>(0,Lm.A)(e.forms,e=>e.name.toLowerCase()),[e.forms]);return(0,i.jsxs)(Tl,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsxs)(Tl,{align:"center",css:{margin:"auto",overflowY:"auto"},direction:"column",height:1,width:1,children:[e.banner,(0,i.jsxs)(Tl,{css:{padding:"$6 $4",width:"100%","@tablet":{padding:"$6 $8"},"@desktop":{padding:"$7",width:t?"100%":"$container"}},direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 displayXs semiBold",children:e.title}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Ty,{children:[(0,i.jsxs)(wy,{children:[o.map(n=>(0,i.jsx)(Ey,{path:e.getTabPath(n.id),children:n.name},n.id)),e.extraTabs]}),e.children]})]})]})}),(0,i.jsx)(Tl,{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)(Tl,{align:"center",css:{width:"100%","@desktop":{width:t?"100%":"$container"}},gap:"4",children:[(0,i.jsx)(tc,{isLoading:e.isLoading,onClick:e.handleSubmit,children:s("mettre_jour_85141")}),(0,i.jsx)(Mr,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>n.goBack(e.returnPathFallback),children:s("annuler_48254")})]})})]})},NM=({banner:e,change:n,customFields:t,formIdToInsertedAt:s,forms:o,getEditUserFormPath:a,handleSubmit:r,isLoading:d,returnPathFallback:l,showAllAndPrivate:c,showIsFilled:u,userInfo:m,values:g})=>{const{translate:h,params:{organizationId:p}}=Kl(),I=ki(Jm),x=V.useMemo(()=>t.filter(e=>e.isPrivate).map(e=>({id:W(),elementType:tn.Field,customField:e,hasCondition:!1,conditionValue:!1})),[t]),f=V.useMemo(()=>KC(t),[t]),_=V.useCallback((e,n)=>(0,i.jsxs)(i.Fragment,{children:[0!==n&&(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:e}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(sI,{direction:"horizontal"})]}),[]);return(0,i.jsxs)(FM,{banner:e,extraTabs:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ey,{path:a("all"),children:h("tous_les_champs_57939")}),(0,i.jsx)(Ey,{path:a("private"),children:h("champs_priv_s_84670")})]}):void 0,forms:o,getTabPath:a,handleSubmit:r,isLoading:d,returnPathFallback:l,title:h("mise_jour_de_17055",m.nameOrEmail),children:[o.map(e=>{const t=s[e.id];return(0,i.jsxs)($y,{path:a(e.id),children:[(0,i.jsx)(Pl,{height:"7"}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textMd semiBold",children:h("statut_du_formu_08195")}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsxs)(Up,{shouldParseAsBoolean:!0,state:t?"disabled":"active",value:g.filledFormsIds.includes(e.id),onChange:t=>{n("filledFormsIds",Ko(g.filledFormsIds,e.id,t))},children:[(0,i.jsx)("option",{value:"true",children:t?h("rempli_le_1_29292",I.toLocaleString(t,Uo.DateTime)):h("rempli_78674")}),(0,i.jsx)("option",{value:"false",children:h("non_rempli_80877")})]})})]}),(0,i.jsx)(Pl,{height:"6"}),e.areTeamsAllowed&&(0,i.jsx)(kM,{change:n,form:e})]}),(0,i.jsx)(TR,{change:n,elements:e.elements,organizationId:p,prefix:"userInfo.fields.",renderSection:_,values:g.userInfo.fields})]},e.id)}),c&&(0,i.jsxs)($y,{path:a("all"),children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(TR,{change:n,elements:f,organizationId:p,prefix:"userInfo.fields.",renderSection:_,values:g.userInfo.fields})]}),c&&(0,i.jsxs)($y,{path:a("private"),children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(TR,{change:n,elements:x,organizationId:p,prefix:"userInfo.fields.",renderSection:_,values:g.userInfo.fields})]})]})},LM=[Qe.Address,Qe.Text,Qe.Textarea,Qe.Time],UM=({banner:e,customFields:n,country:t,formIdToInsertedAt:s,formIdToTeamCode:o,forms:a,from:r,getEditUserFormPath:d,showAllAndPrivate:l,showIsFilled:c,userInfo:u})=>{const{organizationId:m,eventId:g,delegationId:h}=Vi(),p=Bi(),I=ki(AR),x=ki(Ol),{mutate:f,isLoading:_}=function(e={}){return Ui("mutation UserInfoUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userId: UserId!\n $userInfo: UsersInfoInput!\n $filledFormsIds: [FormId!]\n $memberSpaceFormId: FormId\n $formKeyToTeamCode: JSON\n) {\n userInfoUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n userId: $userId\n userInfo: $userInfo\n filledFormsIds: $filledFormsIds\n formKeyToTeamCode: $formKeyToTeamCode\n memberSpaceFormId: $memberSpaceFormId\n ) {\n id\n }\n}\n",e)}(),j=(0,V.useMemo)(()=>Object.keys(s).map(e=>parseInt(e,10)),[s]),v=(0,V.useMemo)(()=>Object.fromEntries(Object.entries(o).map(([e,n])=>[`f${e}`,n])),[o]),S=(0,V.useMemo)(()=>({filledFormsIds:j,formKeyToTeamCode:v,userInfo:I.userInfoUpdateInputDefault(u,n,{checkboxDefaultEmpty:!0,countryCode:t})}),[j,v,u,n,t]),y=(0,V.useCallback)(e=>x.validateForForm(I.updateUserInfoChangedFieldsSchema(n,S.userInfo.fields,e.userInfo.fields))(e),[n,S]);return(0,i.jsx)(xc,{direction:"column",height:1,hideDefaultErrors:!0,initialValues:S,render:({form:t,handleSubmit:o,values:p})=>(0,i.jsx)(NM,{banner:e,change:t.change,customFields:n,formIdToInsertedAt:s,forms:a,getEditUserFormPath:d,handleSubmit:o,isLoading:_,returnPathFallback:"app"===r?g?yo.VOLUNTEERS(m,g):hs.COMMUNITY_USERS({organizationId:m}):h?Js.DELEGATION_MEMBERS({organizationId:m,eventId:g,delegationId:h}):Rj.MEMBER({organizationId:m,eventId:g,userInfoId:u.id}),showAllAndPrivate:l,showIsFilled:c,userInfo:u,values:p}),validate:y,width:1,onSubmit:async e=>{const t=e.userInfo.fields;n.forEach(e=>{LM.includes(e.fieldType)&&!t[e.slug]?t[e.slug]="":e.fieldType!==Qe.File||t[e.slug]||(t[e.slug]=null)}),await f({organizationId:m,eventId:g,userId:u.userId,userInfo:{id:u.id,fields:e.userInfo.fields},filledFormsIds:c?e.filledFormsIds:void 0,formKeyToTeamCode:e.formKeyToTeamCode}),p.goBack("app"===r?yo.VOLUNTEERS(m,g):Rj.MEMBER({organizationId:m,eventId:g,userInfoId:u.id}))}})},VM=({country:e,data:n,forms:t,getEditFormPath:s})=>{const{params:{organizationId:o,eventId:a,userInfoId:r}}=Kl(),d=(0,V.useMemo)(()=>n.organization?.userInfo.formsUsersInfos??[],[n.organization]),l=(0,V.useMemo)(()=>d.map(e=>e.formId),[d]),c=(0,V.useMemo)(()=>Object.fromEntries(d.map(e=>[e.formId,e.insertedAt])),[d]),u=(0,V.useMemo)(()=>a?Object.fromEntries(d.map(e=>[e.formId,e.teamCode])):{},[a,d]);return(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:[yo.EDIT_USER_FORM(":organizationId",":eventId",":userInfoId",":formId"),yo.COMMUNITY_EDIT_USER_FORM(":organizationId",":userInfoId",":formId")],children:(0,i.jsx)(UM,{country:e,customFields:n.organization.customFields.nodes,formIdToInsertedAt:c,formIdToTeamCode:u,forms:t,from:"app",getEditUserFormPath:s,showAllAndPrivate:!0,showIsFilled:!0,userInfo:n.organization.userInfo})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:a?yo.EDIT_USER_FORM(o,a,r,l?.[0]??"all"):yo.COMMUNITY_EDIT_USER_FORM(o,r,l?.[0]??"all"),replace:!0})})]})},BM=()=>{const{params:{organizationId:e,eventId:n,delegationId:t,userInfoId:s}}=Kl(),o=Bi(),{data:a,loader:r}=Li("query UpdateUserInfosEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n\n category {\n name\n }\n }\n }\n\n userInfo(id: $userInfoId) {\n id\n isEditable\n userId\n email\n nameOrEmail\n fields\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n formId\n insertedAt\n teamCode\n }\n }\n }\n\n event(id: $eventId) {\n country\n\n forms {\n nodes {\n ...UpdateUserForm\n }\n }\n }\n}\n",{organizationId:e,eventId:n,userInfoId:s},[$o.CustomFieldWithConditionFragment,$o.UpdateUserFormFragment]);return r||(a.organization.userInfo.isEditable??1)||o.push(yo.DASHBOARD(e,n)),r||(0,i.jsx)(VM,{country:a.event.country,data:a,forms:t?a.event.forms.nodes.filter(e=>Yo(e.delegationsIds)&&e.delegationsIds.includes(t)):a.event.forms.nodes,getEditFormPath:t=>yo.EDIT_USER_FORM(e,n,s,t)})},WM=()=>{const{organizationId:e,delegationId:n,userInfoId:t}=Vi(),{data:s,loader:o}=Li("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:t},[$o.CustomFieldWithConditionFragment,$o.UpdateUserFormFragment]);return o||(0,i.jsx)(VM,{country:s.organization.country,data:s,forms:n?s.organization.forms.nodes.filter(e=>Yo(e.delegationsIds)&&e.delegationsIds.includes(n)):s.organization.forms.nodes,getEditFormPath:n=>yo.COMMUNITY_EDIT_USER_FORM(e,t,n)})},GM=(0,V.createContext)({}),qM=({children:e,...n})=>(0,i.jsx)(GM.Provider,{value:{shouldShowModeSelection:Boolean(n.createCard||n.upsertCard||n.updateCard),...n},children:e});function HM(){return(0,V.useContext)(GM)}var YM=t(4809);let ZM=class extends Rc{constructor(e){super(e)}csvDocumentInputDefault(e){return{key:"",name:"",acl:"",formats:{timeFormat:"HH:mm",dateFormat:Ro,datetimeFormat:"yyyy-MM-dd HH:mm",...e}}}schema(){const e=this.t("le_document_est_86403");return zc.Ik().shape({acl:zc.Yj().required(e),delimiter:zc.Yj().optional().test("is-valid-value",this.t("delimiter_value_52108"),e=>!e||!YM.BAD_DELIMITERS.includes(e)),key:zc.Yj().required(e).test("is-a-csv",this.t("le_fichier_n_es_33134"),e=>fv(uv(e).extension)===hv.Csv),name:zc.Yj().required(e),newline:zc.Yj().optional().test("is-valid-value",this.t("newline_charact_88066"),e=>!e||["\r","\n","\r\n"].includes(e)),quoteChar:zc.Yj().optional(),formats:zc.Ik().shape({timeFormat:zc.Yj().optional(),dateFormat:zc.Yj().optional(),datetimeFormat:zc.Yj().optional()}),file:zc.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;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],ZM);var KM;let XM=class extends Rc{static{KM=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={Id:"id"};static IMPORT_COLUMNS_REQUIRED=e=>e===dn.Update?[KM.IMPORT_COLUMNS_DEFAULT.Id]:[];constructor(e,n){super(n),this.csvInputService=e}default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mode:dn.Upsert}}}schema(){return zc.Ik().shape({input:zc.Ik().shape({csv:this.csvInputService.schema(),mode:zc.Yj().oneOf(Kt,this.t("le_mode_d_impor_75706"))})})}};XM=KM=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[ZM,Di])],XM);let QM=class extends XM{csvInputService;default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mappings:[],presets:[],mode:dn.Upsert,tag:""}}}schema(){return zc.Ik().shape({input:zc.Ik().shape({csv:this.csvInputService.schema(),mappings:zc.YO().of(zc.Yj().nullable()),presets:zc.YO().of(zc.Ik().shape({customFieldId:zc.ai().positive(this.t("le_choix_du_typ_07079")),value:zc.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:zc.Yj().oneOf(Kt,this.t("le_mode_d_impor_75706")),tag:zc.Yj().required("a_tag_must_be_s_23274")})})}settingsStepSchema(){return zc.Ik().shape({input:zc.Ik().shape({csv:this.csvInputService.schema()})})}mappingStepSchema(){return zc.Ik().shape({input:zc.Ik().shape({mappings:zc.YO().of(zc.Yj().nullable()),presets:zc.YO().of(zc.Ik().shape({customFieldId:zc.ai().positive(this.t("le_choix_du_typ_07079")),value:zc.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:zc.Yj().oneOf(Kt,this.t("le_mode_d_impor_75706")),tag:zc.Yj().required("a_tag_must_be_s_23274")})})}constructor(e,n){super(e,n),this.csvInputService=e}};QM=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[ZM,Di])],QM);var JM;let eP=class extends QM{static{JM=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...QM.IMPORT_COLUMNS_DEFAULT,Email:"email",TicketId:"ticketId"};static IMPORT_COLUMNS_REQUIRED=e=>e===dn.Update?[JM.IMPORT_COLUMNS_DEFAULT.Id]:[JM.IMPORT_COLUMNS_DEFAULT.Email];constructor(e,n){super(e,n),this.csvInputService=e}};eP=JM=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[ZM,Di])],eP);const nP=e=>{const{params:{organizationId:n},translate:t}=Kl(),{data:s,loader:o}=La({organizationId:n}),a=Sc(),r=(0,V.useMemo)(()=>e.formRenderProps.values.input.csv.file,[e.formRenderProps.values.input.csv]),d=(0,V.useMemo)(()=>{const n=localStorage.getItem(Tc[`${e.localStorageKeyPrefix}_FORMATS`]);return n?JSON.parse(n):n},[e.localStorageKeyPrefix]),l=(0,V.useMemo)(()=>{const n=n=>e.formRenderProps.values.input.csv.formats?.[n]===s.organization?.[n]?(0,i.jsx)(Ku,{css:{textTransform:"uppercase"},children:t("from_organisati_25675")}):d?.[n]===e.formRenderProps.values.input.csv.formats?.[n]&&(0,i.jsx)(Ku,{css:{textTransform:"uppercase"},children:t("from_saved_22150")});return{datetime:n("datetimeFormat"),date:n("dateFormat"),timeBadge:n("timeFormat")}},[s.organization,d,e.formRenderProps.values.input.csv.formats]),c=Ni(),u=[e.ImportInputService.IMPORT_COLUMNS_DEFAULT.Id];window.location.origin===F.HEAVENT_PUBLIC_URL.origin&&u.push(eP.IMPORT_COLUMNS_DEFAULT.TicketId);const m=Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT).filter(e=>!u.includes(e));let g=[...m,...e.customFields.map(e=>e.slug.startsWith("cf")?`${e.name} [${e.slug}]`:e.name)],h=0;if(Yo(e.additionalCategories))for(const n of e.additionalCategories){if(n.fields.some(e=>!e.slug.startsWith("accreditation_slot_")&&!e.slug.startsWith("accreditation_profile_")))throw new Error("Unhandled category type");g=[...g,...n.fields.map(e=>`${e.name} [${e.slug}]`)],h+=n.fields.length}const p=[g,new Array(m.length+e.customFields.length+h)].map(e=>e.map(e=>{return`${n=e,n.includes(",")||n.includes('"')||n.includes("\n")||n.includes(" ")?'"'+n.replace(/"/g,'""')+'"':n}`;var n}).join(",")).join("\n"),I=`data:text/csv;charset=utf-8,${encodeURIComponent(p)}`;return o||(0,i.jsxs)(Tl,{direction:"column",gap:"8",children:[(0,i.jsx)(Kj,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},heading:t("choix_du_fichie_30517"),subtitle:[...c(t("s_lectionnez_vo_53506","{1}"),(0,i.jsx)(Xm,{css:{color:"$primary600"},download:`export-${e.sampleFilename?Gl(e.sampleFilename):"sample-file"}.csv`,to:I,children:t("t_l_charger_un_46976")}))],children:(0,i.jsx)(PC,{...a,accept:gv.Csv,acl:"private",organizationId:n,prefix:"input.csv.",withFileField:!0,onChange:n=>e.onChange(n,e.formRenderProps)})}),(0,i.jsxs)(Kj,{heading:t("param_tres_du_f_01675"),isOpenToggleLabel:t("afficher_les_pa_96893"),subtitle:t("personnaliser_s_29361"),children:[(0,i.jsxs)(wb,{heading:t("type_de_carat_r_62356"),children:[(0,i.jsx)($c,{hint:t("laissez_ce_cham_07837"),label:t("d_limitateur_77701"),name:"input.csv.delimiter",state:r?"disabled":void 0}),(0,i.jsx)($c,{hint:t("leave_blank_if_02058"),label:t("caract_re_d_ch_56847"),name:"input.csv.quoteChar",state:r?"disabled":void 0}),(0,i.jsxs)(ny,{hint:t("leave_blank_if_02058"),label:t("caract_re_de_re_71491"),name:"input.csv.newline",state:r?"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)(wb,{heading:t("type_de_format_68432"),children:[(0,i.jsx)($c,{label:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[t("format_d_heure_46798"),l.timeBadge]}),name:"input.csv.formats.timeFormat",state:r?"disabled":void 0}),(0,i.jsx)($c,{label:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[t("format_de_date_82059"),l.date]}),name:"input.csv.formats.dateFormat",state:r?"disabled":void 0}),(0,i.jsx)($c,{label:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[t("format_de_date_24474"),l.datetime]}),name:"input.csv.formats.datetimeFormat",state:r?"disabled":void 0})]})]})]})},tP=br("input",{blockSize:"fit-content",inlineSize:"fit-content"}),iP=(0,V.forwardRef)((e,n)=>(0,i.jsx)(tP,{ref:n,type:"radio",...e}));iP.displayName="Radio";const sP=({children:e,css:n,icon:t,subtext:s,...o})=>{const{inputId:a,descId:r,labelId:d}=Sc(),l=(0,V.useRef)(null);return(0,i.jsx)(Tl,{css:{bd:!0,flexGrow:"1",margin:"-1px",cursor:"pointer",'&:has( input[type="radio"]:checked)':{border:"2px solid $primary500"},...n},onClick:()=>l.current?.click(),children:(0,i.jsx)(Tl,{css:{border:"1px solid transparent",padding:"$4",'&:has( input[type="radio"]:checked)':{border:"none"}},children:(0,i.jsxs)(Tl,{gap:"1",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Tl,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(xI,{css:{color:"$gray800",background:"unset"},icon:t})}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(bc,{htmlFor:a,id:d,children:(0,i.jsx)(rc,{css:{fontSize:"$textSm",fontWeight:"$medium"},children:e})}),s&&(0,i.jsx)(rc,{id:r,children:s})]}),(0,i.jsx)(Tl,{css:{flex:"1"}})]}),(0,i.jsx)(iP,{ref:l,"aria-describedby":r,"aria-labelledby":d,id:a,...o})]})})})},oP=({name:e,value:n,...t})=>(0,i.jsx)(Dl.D0,{name:e,render:({input:e})=>(0,i.jsx)(sP,{checked:e.checked,name:e.name,value:n,onChange:e.onChange,...t,children:t.children}),type:"radio",value:n}),aP=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>[{id:-1,name:n("default_fields_04920"),fields:Object.entries(e.defaultFields).map(([e,t])=>({name:g(n(e))?n(e):e,slug:t,id:parseInt((0,vc.A)())}))},...e.categories].map(n=>({...n,fields:(0,Lm.A)(n.fields,n=>{const t=n.name.toLowerCase(),i=n.slug.toLowerCase(),s=e.column.name.toLowerCase(),o=Math.min(j(t,s),j(i,s));return o{const s=Object.values(e.defaultFields).find(e=>e===n);return s&&e.requiredFieldSlugs.includes(s)?(0,i.jsx)("strong",{children:t}):t},[e.defaultFields,e.requiredFieldSlugs]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wc,{state:"disabled",value:e.column.name,onChange:()=>{}}),(0,i.jsx)(Yl,{icon:"arrow-right"}),(0,i.jsx)(of,{isSearchVisible:!0,multiple:!1,name:`input.mappings.${e.column.index}`,placeholder:n("s_lectionnez_un_12007"),renderValue:s,children:t.map(n=>(0,i.jsx)("optgroup",{label:n.name,children:n.fields.map(n=>(0,i.jsx)("option",{style:{fontWeight:e.requiredFieldSlugs.includes(n.slug)?"bold":"inherit",opacity:e.values.includes(n.slug)?.5:1},value:n.slug,children:n.name},n.id))},n.id))})]})},rP=br("div",{display:"grid",gridTemplateColumns:"[column] 1fr auto [field] 1fr",gap:"$4 $5",alignItems:"center"}),dP=br("div",{color:"$gray800",gridColumn:"column",fontWeight:"$medium"}),lP=br("div",{color:"$gray800",gridColumn:"field",fontWeight:"$medium"}),cP=e=>{const{translate:n}=Kl();return(0,i.jsxs)(rP,{children:[(0,i.jsx)(dP,{children:n("titres_de_vos_c_31388")}),(0,i.jsx)(lP,{children:n("champs_de_formu_64126")}),e.columns.map((n,t)=>(0,i.jsx)(aP,{categories:e.categories,column:{name:n,index:t},defaultFields:e.defaultFields,requiredFieldSlugs:e.requiredFieldSlugs,values:e.values},t))]})},uP=e=>{const{translate:n}=Kl(),{alertDescriptionKey:t}=HM(),{formRenderProps:{values:{input:{mappings:s}}}}=(0,V.useContext)(Ml),o=(0,V.useMemo)(()=>Object.entries(e.defaultFields).filter(([n,t])=>e.requiredFieldSlugs.includes(t)&&!s.includes(t)).map(([e,t])=>g(n(e))?n(e):e),[e.defaultFields,e.requiredFieldSlugs,s]),a=Ni();return(0,i.jsxs)(Kj,{css:{"& > header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},gap:"5",heading:n("donn_es_de_mapp_98874"),subtitle:n("s_lectionnez_le_13978"),children:[Yo(o)&&(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("required_field_46113",o.length)}),(0,i.jsx)(uc,{children:[...a(n(t,"{1}"),(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:o.map(e=>(0,i.jsx)("li",{children:e},e))}))]})]}),(0,i.jsx)(cP,{...e})]})},mP=({file:e,onToggle:n,...t})=>{const s=Fi();return(0,i.jsx)(Kj,{heading:s("attribution_d_u_50979"),isOpen:Yo(t.values)??!1,isOpenToggleLabel:s("attribuer_autom_74319"),subtitle:s("d_finissez_dire_31742"),onToggle:n,children:(0,i.jsx)(wb,{heading:s("liste_des_champ_94862"),children:(0,i.jsx)(eb,{name:"input.presets",...t})})})},gP=(e,n)=>{switch(n.type){case"LOADING":return{isLoading:!0,columns:void 0,errors:void 0};case"SUCCESS":return{isLoading:!1,columns:n.columns,errors:void 0};case"ERROR":return{isLoading:!1,columns:void 0,errors:n.errors}}};function hP(e){const{translate:n}=Kl(),{isLoading:t,columns:s,errors:o}=((e,n)=>{const[t,i]=(0,V.useReducer)(gP,{isLoading:!0,columns:void 0,errors:void 0});return(0,V.useEffect)(()=>{i({type:"LOADING"}),(0,YM.parse)(e,{preview:1,...n,complete:({data:e,errors:n})=>{n.filter(e=>"UndetectableDelimiter"!==e.code).length?i({type:"ERROR",errors:n}):i({type:"SUCCESS",columns:e[0]})}})},[e]),t})(e.file,{delimiter:e.values.input.csv.delimiter??void 0,quoteChar:e.values.input.csv.quoteChar??void 0,newline:e.values.input.csv.newline??void 0}),a=(0,V.useMemo)(()=>{const n=YC(e.customFields).map(({category:e,items:n})=>({id:e.id,name:e.name,fields:n.map(e=>e.fieldType===Qe.File?{...e,name:`${e.name} (URL)`}:e)}));return e.additionalCategories?n.concat(e.additionalCategories):n},[e.additionalCategories,e.customFields]);return t||o?null:(0,i.jsxs)(i.Fragment,{children:[e.additionalOptions&&(0,i.jsx)(Kj,{heading:n("param_tres_d_im_18876"),children:e.additionalOptions}),(0,i.jsx)(uP,{categories:a,columns:s,defaultFields:e.defaultFields,modeSelection:e.modeSelection,requiredFieldSlugs:e.requiredFieldSlugs,values:e.values.input.mappings}),Yo(e.customFields)&&(0,i.jsx)(mP,{change:e.form.change,customFields:e.customFields,file:e.file,values:e.values.input.presets,onToggle:e.onToggle})]})}const pP=e=>{const{params:{organizationId:n},translate:t}=Kl(),{createCard:s,upsertCard:o,updateCard:a,shouldShowModeSelection:r}=HM();return(0,i.jsxs)(Tl,{direction:"column",gap:"8",children:[r&&(0,i.jsx)(Kj,{heading:t("type_d_action_d_35533"),name:"input.mode",role:"radiogroup",subtitle:t("s_lectionnez_la_32551"),children:(0,i.jsxs)(Tl,{gap:"4",justify:"evenly",children:[s&&(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(oP,{icon:"user-plus",name:"input.mode",subtext:s.description,value:dn.Create,children:s.heading})}),o&&(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(oP,{icon:"user-pen",name:"input.mode",subtext:o.description,value:dn.Upsert,children:o.heading})}),a&&(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(oP,{icon:"arrows-rotate",name:"input.mode",subtext:a.description,value:dn.Update,children:a.heading})})]})}),e.formRenderProps.values.input.csv?.file&&xP(e.formRenderProps.form)&&(0,i.jsx)(hP,{additionalCategories:e.additionalCategories,additionalOptions:e.additionalOptions,customFields:e.customFields,defaultFields:e.ImportInputService.IMPORT_COLUMNS_DEFAULT,file:e.formRenderProps.values.input.csv.file,form:e.formRenderProps.form,requiredFieldSlugs:e.ImportInputService.IMPORT_COLUMNS_REQUIRED(e.formRenderProps.values.input.mode),values:e.formRenderProps.values,onToggle:t=>{if(!e.formRenderProps.values.input.csv.file)throw new Error("No file in input!");try{t?e.formRenderProps.form.change("input.presets",JSON.parse(localStorage.getItem(Tc[`${e.localStorageKeyPrefix}_PRESETS`](n))??"[]")):e.formRenderProps.form.change("input.presets",[])}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}}),(0,i.jsxs)(Kj,{heading:t("identify_your_i_87636"),subtitle:t("by_default_you_75833"),children:[(0,i.jsx)($c,{label:t("your_import_tag_41852"),name:"input.tag",state:"disabled"}),!e.isTagInputDisabled&&(0,i.jsx)(wc,{label:t("specify_an_impo_41868"),onChange:n=>{g(n)?e.formRenderProps.form.change("input.tag",`${e.importTagPrefix}-csv-${n}`):e.formRenderProps.form.change("input.tag",`${e.importTagPrefix}-csv-${Oo.c9.now().toFormat(Mo)}`)}})]})]})},IP=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Tl,{align:"center",css:{alignSelf:"center",maxInlineSize:"640px"},direction:"column",gap:"8",children:[(0,i.jsxs)(Tl,{align:"center",direction:"column",gap:"4",children:[(0,i.jsx)(Tl,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(xI,{css:{color:"$gray800",background:"unset"},icon:"party-horn"})}),(0,i.jsxs)(Tl,{css:{textAlign:"center"},direction:"column",gap:"1",children:[(0,i.jsx)(dc,{children:n("l_importation_e_12369")}),(0,i.jsx)(rc,{textStyle:"subtitle",children:n("_la_fin_du_pro_00757")})]})]}),(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(tc,{onClick:()=>window.location.reload(),children:n("nouvel_import_48306")}),e.returnLink]})]})},xP=e=>!!e.getFieldState("input.csv.key")?.valid&&!!e.getFieldState("input.csv.file")?.valid,fP=/\[(cf[0-9]+|accreditation_slot_[0-9]+)\]$/,_P=/\[accreditation_slot_([0-9]+)\]$/,jP=(e,n)=>Math.abs(e.length-n.length)<=1&&(0===e.length||0===n.length||e.charCodeAt(0)===n.charCodeAt(0)||e.charCodeAt(e.length-1)===n.charCodeAt(n.length-1)),vP=(e,n)=>e.IMPORT_COLUMNS_REQUIRED(n.mode).every(e=>n.mappings.includes(e)),SP=(e,n,t)=>n.formatListValues(e.IMPORT_COLUMNS_REQUIRED(t.mode).filter(e=>!t.mappings.includes(e)),"conjunction"),yP=e=>{const{params:{organizationId:n,eventId:t,delegationId:s},translate:o}=Kl(),{shouldShowModeSelection:a}=HM();Au(e.heading);const r=ki(Di),{data:d}=La({organizationId:n}),l=Gi(),c=ki(e.ImportInputService),u=(0,V.useRef)(null),m=(0,V.useMemo)(()=>((e,n,t)=>{let i;const s=()=>i??=((e,n,t)=>{const i=e.IMPORT_COLUMNS_DEFAULT,s=new Map,o=new Map;for(const[e,n]of Object.entries(i)){const t=e.toLowerCase(),a=String(n).toLowerCase();o.has(t)||o.set(t,i[e]),s.has(a)||s.set(a,i[n])}const a=new Map,r=new Map;for(const e of n){const n=e.slug.toLowerCase(),t=e.name.toLowerCase();a.has(n)||a.set(n,e.slug),r.has(t)||r.set(t,e.slug)}const d=new Map,l=new Map,c=[];let u=0;for(let e=0;e<(t?.length??0);e++){const n=[];c.push(n);for(const i of t[e].fields){const t={slug:i.slug,name:i.name,categoryIndex:e,order:u++};n.push(t);const s=String(i.id);d.has(s)||d.set(s,t);const o=l.get(i.name.length);o?o.push(t):l.set(i.name.length,[t])}}return{defaultBySlug:s,defaultByName:o,customFieldBySlug:a,customFieldByName:r,accreditationsById:d,accreditationsByLength:l,accreditationsByCategory:c,hasAccreditations:c.length>0}})(e,n,t),o=e=>{const n=s(),t=(e=>fP.exec(e)?.[1])(e);if(t){const i=t.toLowerCase();return n.defaultBySlug.has(i)?n.defaultBySlug.get(i)??null:t.startsWith("accreditation_slot_")&&n.hasAccreditations?(e=>{const n=s(),t=_P.exec(e)?.[1];if(void 0===t)return null;const i=n.accreditationsById.get(t);if(i)return i.slug;const o=e.split(" [accreditation_slot_").at(0)??e,a=n.accreditationsByLength.get(o.length)?.find(e=>e.name===o);if(a)return a.slug;let r;for(let e=o.length-1;e<=o.length+1;e++){const t=n.accreditationsByLength.get(e);if(t)for(const e of t)r&&e.order>r.order||jP(e.name,o)&&j(e.name,o)<2&&(r=e)}return r?.slug??null})(e):n.customFieldBySlug.has(i)?n.customFieldBySlug.get(i)??null:n.customFieldByName.get(e.toLowerCase())??null}const i=e.toLowerCase();return n.defaultByName.has(i)?n.defaultByName.get(i)??null:n.customFieldByName.get(i)??null};let a=null,r=[];return{matchColumn:o,getAutomaticMappings(e){const n=e.join("\0");return n===a||(a=n,r=e.map(o)),r}}})(e.ImportInputService,e.customFields,e.additionalCategories),[e.ImportInputService,e.customFields,e.additionalCategories]),[h,p]=(0,V.useState)(!1),I=(0,V.useMemo)(()=>{try{const n={dateFormat:d.organization.dateFormat,datetimeFormat:d.organization.datetimeFormat,timeFormat:d.organization.timeFormat},t=JSON.parse(l.getItem(Tc[`${e.localStorageKeyPrefix}_FORMATS`])??"{}");return{...n,...t}}catch{return null}},[d.organization]),x=(0,V.useMemo)(()=>{const n=l.getItem(Tc[`${e.localStorageKeyPrefix}_FORMATS`]);return n?JSON.parse(n):n},[e.localStorageKeyPrefix]),f=(0,V.useMemo)(()=>{const n=c.default(I).input;let t=n.mode;if(a)try{t=l.getItem(Tc[`${e.localStorageKeyPrefix}_MODE`])??dn.Upsert}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}return{input:{...n,mode:t,tag:`${e.importTagPrefix}-csv-${Oo.c9.now().toFormat(Mo)}`}}},[c,I,a,e.localStorageKeyPrefix,e.importTagPrefix]),_=ki(QM),v=(0,V.useCallback)((t,i)=>{(0,YM.parse)(t,{delimiter:i.values.input.csv.delimiter,preview:1,newline:i.values.input.csv.newline,quoteChar:i.values.input.csv.quoteChar,complete:({data:n,errors:t})=>{if(!t.length||1===t.length&&"UndetectableDelimiter"===t[0].code){const t=n[0],s=m.getAutomaticMappings(t);let o={};try{o=JSON.parse(l.getItem(Tc[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}")}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}const a=t.map((e,n)=>void 0!==o[e]?o[e]:s[n]??null);if(i.form.change("input.mappings",a),e.skipMappingIfAllColumnsMatch){const n=new Set([...Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT),...e.customFields.map(e=>e.slug),...(e.additionalCategories??[]).flatMap(e=>e.fields.map(e=>e.slug))]);p(a.every(e=>g(e)&&n.has(e))&&vP(e.ImportInputService,{mode:i.values.input.mode,mappings:a.filter(g)}))}}}});try{i.form.change("input.presets",JSON.parse(l.getItem(Tc[`${e.localStorageKeyPrefix}_PRESETS`](n))??"[]"))}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}},[m,l,n,a,e.ImportInputService,e.importTagPrefix,e.localStorageKeyPrefix,e.skipMappingIfAllColumnsMatch]);return(0,i.jsx)(Am.Provider,{value:{designSystem:bm},children:(0,i.jsx)(Hx,{category:o("nouvel_import_48306"),color:"dark",fallbackClosePath:e.closePath,heading:e.heading,children:(0,i.jsx)(Gx,{ref:u,children:(0,i.jsxs)(vS,{containerRef:u,initialValues:f,isEdit:!1,summaryStep:(0,i.jsx)(IP,{returnLink:e.returnLink}),onSubmit:async({input:i})=>{if(!vP(e.ImportInputService,i))return{[zl.Ym]:o("you_have_not_ma_46806",SP(e.ImportInputService,r,i))};(t=>{const i=t.csv.file;if(!i)throw new Error("No file in input!");(0,YM.parse)(i,{delimiter:t.csv.delimiter,preview:1,newline:t.csv.newline,quoteChar:t.csv.quoteChar,complete:({data:n,errors:i})=>{if(!i.length)try{const i=n[0],s=m.getAutomaticMappings(i),o=JSON.parse(l.getItem(Tc[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}"),a={};for(const[e,n]of t.mappings.entries()){const t=i[e];n?a[t]=n:delete o[t],g(s[e])&&!a[t]&&(a[t]=null)}l.setItem(Tc[`${e.localStorageKeyPrefix}_MAPPINGS`],JSON.stringify({...o,...a}))}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}});try{const i=JSON.parse(l.getItem(Tc[`${e.localStorageKeyPrefix}_PRESETS`](n))??"[]");l.setItem(Tc[`${e.localStorageKeyPrefix}_PRESETS`](n),JSON.stringify([...new Map([...i,...t.presets].map(e=>[e.customFieldId,e])).values()])),l.setItem(Tc[`${e.localStorageKeyPrefix}_FORMATS`],JSON.stringify(t.csv.formats?Object.fromEntries(Object.entries(t.csv.formats).filter(([e,n])=>g(n))):{})),a&&l.setItem(Tc[`${e.localStorageKeyPrefix}_MODE`],t.mode)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}})(i);const d=(e=>{const n={...e.csv};return delete n.file,{...e,csv:n}})(i);try{const{jobId:i}=await e.mutate({organizationId:n,eventId:t,delegationId:s,input:d});e.checkImport(i,n,t)}catch{}},children:[(0,i.jsx)(jS,{actions:n=>(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(tc,{disabled:!xP(n.form),onClick:n.handleSubmit,children:o("suivant_donn_08625")}),x&&(0,i.jsx)(tc,{color:"invisible-gray",onClick:()=>{l.removeItem(Tc[`${e.localStorageKeyPrefix}_FORMATS`]),window.location.reload()},children:o("clear_saved_set_61259")})]}),heading:o("choix_du_fichie_30517"),render:n=>(0,i.jsx)(nP,{ImportInputService:e.ImportInputService,additionalCategories:e.additionalCategories,customFields:e.customFields,formRenderProps:n,localStorageKeyPrefix:e.localStorageKeyPrefix,sampleFilename:e.sampleFilename,onChange:v}),schema:_.settingsStepSchema()}),!h&&(0,i.jsx)(jS,{actions:e=>(0,i.jsx)(tc,{type:"submit",onClick:e.handleSubmit,children:o("importer_90688")}),heading:o("donn_es_impor_12371"),render:n=>(0,i.jsx)(pP,{ImportInputService:e.ImportInputService,additionalCategories:e.additionalCategories,additionalOptions:e.additionalOptions,customFields:e.customFields,formRenderProps:n,importTagPrefix:e.importTagPrefix,isTagInputDisabled:e.isTagInputDisabled,localStorageKeyPrefix:e.localStorageKeyPrefix}),schema:c.mappingStepSchema()})]})})})})},CP=({accreditations:e,accreditationsProfiles:n,closePath:t,customFields:s})=>{const{params:{organizationId:o,eventId:a},translate:r}=Kl(),d=ki(Jm),{mutate:l}=function(e={}){return Ui("mutation VolunteersImport(\n $eventId: EventId\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $input: MappableImportInput!\n) {\n jobId: volunteersImport(\n eventId: $eventId\n organizationId: $organizationId\n delegationId: $delegationId\n input: $input\n )\n}\n",e)}(),{checkVolunteersImport:c}=AS(),u=(0,V.useMemo)(()=>((e,n)=>n.map(n=>({id:n.id,name:n.name,fields:n.slots.map(t=>({id:t.id,slug:`accreditation_slot_${t.id}`,name:Uh(e,t,n.name,{accreditation:{includeNameAtEnd:!0}})}))})))(d,e).concat((e=>Object.values((0,fm.A)(e,e=>e.accreditationProfileCategory.id)).map(e=>({id:e[0].accreditationProfileCategory.id,name:e[0].accreditationProfileCategory.name,fields:e.map(e=>({id:e.id,slug:`accreditation_profile_${e.id}`,name:e.name}))})))(n)),[e,n,d]);return(0,i.jsx)(qM,{alertDescriptionKey:"to_add_a_member_56912",createCard:{heading:r("ajouter_un_memb_78965"),description:r("cr_e_un_nouveau_57873")},updateCard:{heading:r("mettre_jour_d_10088"),description:r("aucun_membre_se_13414")},upsertCard:{heading:r("ajouter_et_mett_05009"),description:r("si_plusieurs_me_88818")},children:(0,i.jsx)(yP,{ImportInputService:eP,additionalCategories:u,checkImport:c,closePath:t,customFields:s,heading:r("import_de_membr_48618"),importTagPrefix:"volunteers",localStorageKeyPrefix:"VOLUNTEERS_IMPORT",mutate:l,returnLink:(0,i.jsx)(Xm,{to:a?yo.VOLUNTEERS(o,a):hs.COMMUNITY_USERS({organizationId:o}),children:r("revenir_aux_mem_33379")})})})},bP=()=>{const{params:{organizationId:e}}=Kl(),{data:n,loader:t}=jd({organizationId:e,variety:Te.UserInfo});return t||(0,i.jsx)(CP,{accreditations:qo,accreditationsProfiles:qo,closePath:hs.COMMUNITY_USERS({organizationId:e}),customFields:n.organization.customFields.nodes})},AP=()=>{const{params:{organizationId:e,eventId:n}}=Kl(),{data:t,loader:s}=jd({organizationId:e,variety:Te.UserInfo,eventId:n});return s||(0,i.jsx)(CP,{accreditations:t.organization.event?.accreditations.nodes??qo,accreditationsProfiles:t.organization.event?.accreditationsProfiles.nodes??qo,closePath:yo.VOLUNTEERS(e,n),customFields:t.organization.customFields.nodes})};function EP(e){switch(e){case gt.Active:return{color:"success",leftIcon:"play"};case gt.Error:return{color:"error",leftIcon:"triangle-exclamation"};case gt.Paused:return{color:"warning",leftIcon:"pause"};default:return Zl()}}const wP=[ze.CanLeadersAddMembers,ze.CanLeadersDeleteMembers,ze.CanLeadersDuplicateMembers,ze.CanLeadersEditColumns,ze.CanLeadersEditCustomFields,ze.CanLeadersEditMembers,ze.CanLeadersImportMembers,ze.CanLeadersSeeHiddenAccreditationsSlots];function $P(e,n){switch(e){case ht.VolunteersSegment:return n===rt.SetCustomField||n===rt.AddAccreditations||n===rt.DeleteAccreditations;case ht.DelegationsSegment:return n===rt.SetCustomField||n===rt.LockDelegation||n===rt.UnlockDelegation||n===rt.AddDelegationPermissions||n===rt.DeleteDelegationPermissions;case ht.Assigned:case ht.FormSubmit:return!1;default:return Zl()}}function TP(e){switch(e){case dt.EveryMinute:return 1;case dt.Every2Minutes:return 2;case dt.Every5Minutes:return 5;case dt.Every10Minutes:return 10;default:return Zl()}}let zP=class extends Rc{constructor(e){super(e)}workflowInputDefault(e){return{name:e?.name??"",state:e?.state??gt.Active,frequency:e?.frequency??dt.Every10Minutes,trigger:e?.trigger??ht.VolunteersSegment,action:e?.action??rt.SetCustomField,data:(0,LS.A)({recipients:ut.View},e?.data??{}),onExit:e?.onExit??lt.Revert}}workflowInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_est_requ_61536")),state:zc.Yj().required(this.t("le_statut_est_r_13164")).oneOf(wi,this.t("le_statut_est_r_13164")),action:zc.Yj().required(this.t("l_action_est_re_08934")).oneOf(yi,this.t("l_action_est_re_08934")),trigger:zc.Yj().required(this.t("le_d_clencheur_32555")).oneOf($i,this.t("le_d_clencheur_32555")),data:zc.gl().required().test("positions-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==ht.Assigned||Yo(this.parent.data.positionsCategoriesIds)||Yo(this.parent.data.positionsIds)||Yo(this.parent.data.positionsSlotsIds)||Yo(this.parent.data.positionsSegmentsIds)}).test("volunteers-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==ht.VolunteersSegment||Number.isInteger(this.parent.data.volunteersSegmentId)}).test("delegations-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==ht.DelegationsSegment||Number.isInteger(this.parent.data.delegationsSegmentId)}).test("form-id-valid",this.t("le_formulaire_e_77404"),function(){return this.parent.trigger!==ht.FormSubmit||Number.isInteger(this.parent.data.formId)}).test("campaign-id-valid",this.t("la_campagne_est_06708"),function(){return this.parent.trigger!==ht.VolunteersSegment||this.parent.action!==rt.SendCampaign||Number.isInteger(this.parent.data.campaignId)}).test("campaign-recipients-valid",this.t(this.t("les_destinatair_82420")),function(){return this.parent.trigger!==ht.VolunteersSegment||this.parent.action!==rt.SendCampaign||Ei.includes(this.parent.data.recipients)}).test("campaign-recipients-users-infos",this.t("la_liste_des_me_55886"),function(){return this.parent.trigger!==ht.VolunteersSegment||this.parent.action!==rt.SendCampaign||this.parent.data.recipients!==ut.UsersInfosIds||Yo(this.parent.data.usersInfosIds)}).test("custom-field-id-valid",this.t("le_champ_person_80074"),function(){return(this.parent.trigger!==ht.VolunteersSegment&&this.parent.trigger!==ht.DelegationsSegment||this.parent.action!==rt.SetCustomField)&&(this.parent.trigger!==ht.FormSubmit||this.parent.action!==rt.CreateDelegation)||Number.isInteger(this.parent.data.customFieldId)}).test("duplicate-member-custom-fields-valid",this.t("le_champ_lier_69891"),function(){return this.parent.action!==rt.DuplicateMember||(this.parent.data.customFields||[]).every(e=>!0!==e.fromField||g(e.value))}).test("accreditations-valid",this.t("les_accr_ditati_27943"),function(){return this.parent.trigger===ht.Assigned?Yo(this.parent.data.accreditationsSlotsIds):this.parent.trigger!==ht.VolunteersSegment||this.parent.action!==rt.AddAccreditations&&this.parent.action!==rt.DeleteAccreditations||Yo(this.parent.data.accreditationsSlotsIds)||"number"==typeof this.parent.data.accreditationProfileId}).test("positions-slots-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==ht.VolunteersSegment||this.parent.action!==rt.AddPositions&&this.parent.action!==rt.DeletePositions||Yo(this.parent.data.positionsSlotsIds)}).test("delegation-id-valid",this.t("la_d_l_gation_c_71684"),function(){return this.parent.trigger!==ht.FormSubmit||this.parent.action!==rt.CreateDelegation||Number.isInteger(this.parent.data.delegationId)}).test("event-id-valid",this.t("l_v_nement_est_88155"),function(){return this.parent.trigger!==ht.VolunteersSegment||this.parent.action!==rt.AddEvent||Number.isInteger(this.parent.data.eventId)}).test("permissions-valid",this.t("les_permissions_82998"),function(){return this.parent.trigger!==ht.DelegationsSegment||this.parent.action!==rt.AddDelegationPermissions&&this.parent.action!==rt.DeleteDelegationPermissions||Yo(this.parent.data.permissions)&&this.parent.data.permissions.every(e=>wP.includes(e))}),onExit:zc.Yj().required(this.t("l_action_de_fin_64764")).oneOf(bi,this.t("l_action_de_fin_64764"))})}};zP=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],zP);const OP=e=>(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$4",width:"min($container, 100%)"},direction:"column",gap:"5",children:[(0,i.jsxs)(Tl,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$3"},gap:"3",width:1,children:[(0,i.jsx)(xI,{color:"gray",icon:e.icon}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:e.category}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:e.title})]})]}),(0,i.jsx)(Tl,{direction:"column",gap:"4",width:1,children:e.children})]}),RP=e=>{const{translate:n,params:{eventId:t}}=Kl(),{hasFeature:s}=XS(),{event:o}=BS(),a=(!o||o.useCampaigns)&&e.workflow.trigger===ht.VolunteersSegment,r=e.workflow.trigger===ht.VolunteersSegment||e.workflow.trigger===ht.DelegationsSegment,d=e.workflow.trigger===ht.DelegationsSegment,l=!!t&&s(Ze.Accreditation)&&(o?.useAccreditations??!1)&&(e.workflow.trigger===ht.Assigned||e.workflow.trigger===ht.VolunteersSegment),c=!!t&&s(Ze.Accreditation)&&(o?.useAccreditations??!1)&&e.workflow.trigger===ht.VolunteersSegment,u=!!t&&(o?.usePositions??!1)&&e.workflow.trigger===ht.VolunteersSegment,m=s(Ze.Delegation)&&e.workflow.trigger===ht.FormSubmit,g=!t&&e.workflow.trigger===ht.VolunteersSegment,h=!!t&&e.workflow.trigger===ht.VolunteersSegment;return(0,i.jsx)(OP,{category:n("action_s_lectio_18617"),icon:"lasso-sparkles",title:n("alors_automatiq_16268"),children:(0,i.jsxs)(of,{isSearchVisible:!0,name:"workflow.action",placeholder:n("choisir_une_act_51814"),state:e.isEdit?"disabled":"active",children:[a&&(0,i.jsx)("option",{value:rt.SendCampaign,children:n("SendCampaign")}),r&&(0,i.jsx)("option",{value:rt.SetCustomField,children:n("SetCustomField")}),l&&(0,i.jsx)("option",{value:rt.AddAccreditations,children:n("AddAccreditations")}),c&&(0,i.jsx)("option",{value:rt.DeleteAccreditations,children:n("DeleteAccreditations")}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("option",{value:rt.AddPositions,children:n("AddPositions")}),(0,i.jsx)("option",{value:rt.DeletePositions,children:n("DeletePositions")})]}),m&&(0,i.jsx)("option",{value:rt.CreateDelegation,children:n("cr_er_une_d_l_g_23035")}),g&&(0,i.jsx)("option",{value:rt.AddEvent,children:n("AddEvent")}),h&&(0,i.jsx)("option",{value:rt.DuplicateMember,children:n("DuplicateMember")}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("option",{value:rt.LockDelegation,children:n("LockDelegation")}),(0,i.jsx)("option",{value:rt.UnlockDelegation,children:n("UnlockDelegation")}),(0,i.jsx)("option",{value:rt.AddDelegationPermissions,children:n("AddDelegationPermissions")}),(0,i.jsx)("option",{value:rt.DeleteDelegationPermissions,children:n("DeleteDelegationPermissions")})]})]})})},DP=()=>{const{translate:e,params:{eventId:n}}=Kl(),{data:t}=Li("query WorkflowAccreditationsProfiles($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n }\n }\n }\n}\n",{eventId:n},[]),s=(0,V.useMemo)(()=>gb(t.event?.accreditationsProfilesCategories??[]),[t.event]);return(0,i.jsx)(of,{isSearchVisible:!0,label:e("profil_d_accr_d_02274"),multiple:!1,name:"workflow.data.accreditationProfileId",placeholder:e("s_lectionner_un_45763"),children:s})},MP=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Jm),{data:o}=Ja({eventId:t,loadIsBlocked:!1}),a=(0,V.useMemo)(()=>Bh(s,o.event?.accreditationsCategories??[]),[o.event,s]);return(0,i.jsxs)(OP,{category:n("liste_des_accr_02647"),icon:"badge-check",title:n("les_accr_ditati_19289"),children:[(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.isProfileVisible?n("accr_ditations_39450"):void 0,multiple:!0,name:"workflow.data.accreditationsSlotsIds",placeholder:"SĂ©lectionner des accrĂ©ditations",children:a}),e.isProfileVisible&&(0,i.jsx)(DP,{})]})},PP=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{data:t}=Li("query WorkflowEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:n},[]);return(0,i.jsx)(OP,{category:e("liste_des_v_ne_29929"),icon:"plus",title:e("l_v_nement_sui_45117"),children:(0,i.jsx)(of,{isSearchVisible:!0,name:"workflow.data.eventId",placeholder:e("choisir_un_v_n_58535"),children:(t.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},kP=()=>{const{translate:e,params:{eventId:n}}=Kl(),t=ki(Bg),{data:s}=Li(ha,{eventId:n},[]),o=(0,V.useMemo)(()=>Wh(t,s.event?.positionsCategories??[]),[s.event,t]);return(0,i.jsx)(OP,{category:e("liste_des_missi_82050"),icon:"sitemap",title:e("les_cr_neaux_su_85944"),children:(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.positionsSlotsIds",placeholder:e("choisir_un_cr_n_50945"),children:o})})},FP=e=>{const{translate:n,params:{organizationId:t}}=Kl(),[s,o,a]=Wm(""),{usersInfosOptions:r,isLoading:d}=my({organizationId:t,eventId:null,hasSelected:Yo(e.workflow.data.usersInfosIds),nameDebounced:o,userInfoIds:e.workflow.data.usersInfosIds||[]});return(0,i.jsxs)(OP,{category:n("destinataires_19592"),icon:"users",title:n("aux_membres_sui_99877"),children:[(0,i.jsxs)(of,{name:"workflow.data.recipients",children:[(0,i.jsx)("option",{value:ut.View,children:n("aux_membres_de_71046")}),(0,i.jsx)("option",{value:ut.DelegationsLeaders,children:n("aux_responsable_38147")}),(0,i.jsx)("option",{value:ut.PositionsLeaders,children:n("aux_responsable_85620")}),(0,i.jsx)("option",{value:ut.UsersInfosIds,children:n("_certains_memb_91094")})]}),e.workflow.data.recipients===ut.UsersInfosIds&&(0,i.jsx)(of,{isSearchLoading:d,isSearchVisible:!0,label:n("liste_des_membr_89037"),multiple:!0,name:"workflow.data.usersInfosIds",searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",name:s,placeholder:n("rechercher_un_m_05904"),state:"search",onChange:a}),children:r})]})},NP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{data:o}=Li("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:t,eventId:s,level:s?xn.Event:xn.Organization,formId:e.workflow.data.formId},[]);const a=(0,V.useMemo)(()=>o.organization?.delegations.nodes??[],[o.organization]),r=(0,V.useMemo)(()=>(o.organization?.form.elements??[]).flatMap(e=>e.customField?.fieldType===Qe.Text?[e.customField]:[]),[o.organization]);return(0,i.jsxs)(OP,{category:n("liste_des_d_l_g_86270"),icon:"users",title:n("la_d_l_gation_s_46776"),children:[(0,i.jsx)(of,{isSearchVisible:!0,label:n("d_l_gation_ut_74409"),name:"workflow.data.delegationId",placeholder:n("choisir_une_d_l_57897"),children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(of,{isSearchVisible:!0,label:n("champ_utilise_04526"),name:"workflow.data.customFieldId",placeholder:n("choisir_un_cham_05690"),children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},LP=e=>{const{translate:n}=Kl();return(0,i.jsx)(OP,{category:n("liste_des_droit_83212"),icon:"user-shield",title:(e.workflow.action,rt.AddDelegationPermissions,n("les_droits_suiv_96404")),children:(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.permissions",placeholder:n("choisir_des_dro_64167"),children:wP.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))})})},UP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{data:o}=Li("query WorkflowDelegationsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, segmentType: Delegations, eventId: $eventId) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:s,level:s?xn.Event:xn.Organization},[]);return(0,i.jsx)(OP,{category:n("liste_des_d_l_g_86270"),icon:"people-group",title:n("une_vue_parmi_l_98342"),children:(0,i.jsx)(of,{isSearchVisible:!0,name:"workflow.data.delegationsSegmentId",placeholder:n("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))})})},VP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{data:o}=jl({organizationId:t,eventId:s,variety:Te.UserInfo}),a=(0,V.useMemo)(()=>o.organization?.customFields.nodes??[],[o.organization]),r=(0,V.useMemo)(()=>XC(a.filter(e=>e.fieldType===Qe.Text)),[a]);return(0,i.jsx)(OP,{category:n("param_tres_du_n_85818"),icon:"user",title:n("on_duplique_le_59761"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsxs)(of,{hint:n("si_le_champ_ne_73587"),isSearchVisible:!0,label:n("e_mail_du_nouve_23523"),name:"workflow.data.emailSourceCustomFieldId",children:[(0,i.jsx)("option",{value:"-1",children:n("garder_l_e_mail_42832")}),r]}),(0,i.jsx)(eb,{canLinkToField:!0,change:e.change,customFields:a,name:"workflow.data.customFields",values:e.workflow.data.customFields||[]})]})})},BP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{data:o}=Li("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:t,eventId:s,level:s?xn.Event:xn.Organization},[]);return(0,i.jsx)(OP,{category:n("liste_des_formu_69259"),icon:"file-lines",title:n("un_formulaire_p_61128"),children:(0,i.jsx)(of,{isSearchVisible:!0,name:"workflow.data.formId",placeholder:n("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))})})};function WP(e,n){switch(n){case rt.SetCustomField:return e("remettre_l_anci_37071");case rt.AddAccreditations:return e("supprimer_les_a_39948");case rt.DeleteAccreditations:return e("ajouter_les_acc_34000");case rt.AddPositions:return e("d_saffecter_des_98543");case rt.DeletePositions:return e("r_affecter_aux_53313");case rt.LockDelegation:return e("UnlockDelegation");case rt.UnlockDelegation:return e("LockDelegation");case rt.AddDelegationPermissions:return e("retirer_les_dro_34459");case rt.DeleteDelegationPermissions:return e("remettre_les_dr_74368");default:return""}}function GP(e,n){return n===ht.DelegationsSegment?e("quand_la_d_l_ga_62267"):e("quand_le_membre_90818")}const qP=e=>{const{translate:n}=Kl();return(0,i.jsx)(OP,{category:n("finalisation_94065"),icon:"hand-sparkles",title:GP(n,e.workflow.trigger),children:(0,i.jsxs)(of,{name:"workflow.onExit",placeholder:n("choisir_une_act_51814"),children:[(0,i.jsx)("option",{value:lt.Revert,children:WP(n,e.workflow.action)}),(0,i.jsx)("option",{value:lt.Keep,children:n("ne_rien_faire_76456")})]})})},HP=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Bg),{data:o}=Li("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:t},[]),a=(0,V.useMemo)(()=>(0,Lm.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o.event]),r=(0,V.useMemo)(()=>(0,Lm.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Lm.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]),d=(0,V.useMemo)(()=>(o.event?.positionsCategories??[]).flatMap(e=>(0,Lm.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Lm.A)(e.slots,e=>e.range.start.toMillis()).map(n=>{const t=Zg(s,n,e.name,{position:{includeNameAtEnd:!0},slot:{includeRange:!0}});return(0,i.jsx)("option",{value:n.id,children:t},n.id)})},e.id))),[o.event]),l=(0,V.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)(OP,{category:n("liste_des_missi_82050"),icon:"sitemap",title:n("une_mission_par_94044"),children:[(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("est_affect_u_18005"),multiple:!0,name:"workflow.data.positionsCategoriesIds",placeholder:n("choisir_une_cat_82874"),state:e.isEdit?"disabled":"active",children:a}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("est_affect_u_40348"),multiple:!0,name:"workflow.data.positionsIds",placeholder:n("choisir_une_mis_90627"),state:e.isEdit?"disabled":"active",children:r}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("est_affect_u_82271"),multiple:!0,name:"workflow.data.positionsSlotsIds",placeholder:n("choisir_un_cr_n_50945"),state:e.isEdit?"disabled":"active",children:d}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("est_affect_u_31860"),multiple:!0,name:"workflow.data.positionsSegmentsIds",placeholder:n("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:l})]})},YP=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl(),{data:s}=Li("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:n,eventId:t,level:t?xn.Event:xn.Organization},[]);return(0,i.jsx)(OP,{category:e("liste_des_campa_60034"),icon:"paper-plane",title:e("la_campagne_sui_83193"),children:(0,i.jsx)(of,{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))})})},ZP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{data:o}=jl({organizationId:t,eventId:s,variety:e.workflow.trigger===ht.DelegationsSegment?Te.Delegation:Te.UserInfo}),a=(0,V.useMemo)(()=>o.organization?.customFields.nodes??[],[o.organization]),r=(0,V.useMemo)(()=>XC(a),[a]),d=a.find(n=>n.id===e.workflow.data.customFieldId);return(0,i.jsxs)(OP,{category:n("liste_des_champ_94862"),icon:"text",title:n("le_champ_suivan_27303"),children:[(0,i.jsx)(of,{isSearchVisible:!0,label:n("CustomField"),name:"workflow.data.customFieldId",placeholder:n("choisir_un_cham_67587"),children:r}),d&&(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("nouvelle_valeur_39039",d.name)}),(0,i.jsx)(GC,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:d,delegationsSpaceLayouts:[],forms:[],name:"workflow.data.customFieldValue",slug:d.slug,tags:[],traces:[],value:e.workflow.data?.customFieldValue}),pC(d)&&(0,i.jsx)(Xx,{name:"workflow.data.addValues",children:n("ajouter_les_val_22996")})]})]})},KP=e=>{const{translate:n,params:{eventId:t}}=Kl(),{hasFeature:s}=XS(),{event:o}=BS(),a=!!t&&(o?.usePositions??!1)&&(o?.useAccreditations??!1)&&s(Ze.Accreditation),r=(o?.useForms??!0)&&(o?.useDelegations??!0)&&s(Ze.Delegation),d=(o?.useDelegations??!0)&&s(Ze.Delegation);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"workflow.trigger",children:n=>{n===ht.Assigned?e.change("workflow.action",rt.AddAccreditations):n===ht.FormSubmit?e.change("workflow.action",rt.CreateDelegation):e.change("workflow.action",rt.SetCustomField),e.change("workflow.data.customFieldId",void 0),e.change("workflow.data.customFieldValue",void 0)}}),(0,i.jsx)(OP,{category:n("initialisation_38640"),icon:"hand-sparkles",title:n("quand_18117"),children:(0,i.jsxs)(of,{isSearchVisible:!0,name:"workflow.trigger",placeholder:n("choisir_un_d_cl_85012"),state:e.isEdit?"disabled":"active",children:[a&&(0,i.jsx)("option",{value:ht.Assigned,children:n("un_membre_est_a_48435")}),r&&(0,i.jsx)("option",{value:ht.FormSubmit,children:n("FormSubmit")}),(0,i.jsx)("option",{value:ht.VolunteersSegment,children:n("VolunteersSegment")}),d&&(0,i.jsx)("option",{value:ht.DelegationsSegment,children:n("DelegationsSegment")})]})})]})},XP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{data:o}=Li("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:t,eventId:s,level:s?xn.Event:xn.Organization},[]);return(0,i.jsx)(OP,{category:n("liste_des_membr_89037"),icon:"user-group",title:n("une_vue_parmi_l_98342"),children:(0,i.jsx)(of,{isSearchVisible:!0,name:"workflow.data.volunteersSegmentId",placeholder:n("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))})})},QP=()=>(0,i.jsx)(Tl,{height:32,justify:"center",width:1,children:(0,i.jsx)(Mr,{css:{borderRight:"1px solid $gray200"},height:1})}),JP=e=>{const{translate:n}=Kl(),t=e.workflow.data,s=e.workflow.trigger===ht.VolunteersSegment,o=e.workflow.trigger===ht.DelegationsSegment,a=e.workflow.trigger===ht.Assigned,r=e.workflow.trigger===ht.FormSubmit,d=e.workflow.trigger===ht.VolunteersSegment&&"number"==typeof t.volunteersSegmentId||e.workflow.trigger===ht.Assigned&&(Yo(t.positionsCategoriesIds)||Yo(t.positionsIds)||Yo(t.positionsSlotsIds)||Yo(t.positionsSegmentsIds))||e.workflow.trigger===ht.FormSubmit&&"number"==typeof t.formId||e.workflow.trigger===ht.DelegationsSegment&&"number"==typeof t.delegationsSegmentId,l=d&&e.workflow.trigger===ht.VolunteersSegment&&e.workflow.action===rt.SendCampaign,c=l&&"number"==typeof e.workflow.data.campaignId,u=d&&(e.workflow.trigger===ht.VolunteersSegment||e.workflow.trigger===ht.DelegationsSegment)&&e.workflow.action===rt.SetCustomField,m=d&&e.workflow.action===rt.AddAccreditations,g=d&&e.workflow.action===rt.DeleteAccreditations,h=d&&e.workflow.action===rt.AddPositions,p=d&&e.workflow.action===rt.DeletePositions,I=d&&e.workflow.action===rt.CreateDelegation,x=d&&e.workflow.action===rt.AddEvent,f=d&&e.workflow.action===rt.DuplicateMember,_=d&&(e.workflow.action===rt.LockDelegation||e.workflow.action===rt.UnlockDelegation),j=d&&(e.workflow.action===rt.AddDelegationPermissions||e.workflow.action===rt.DeleteDelegationPermissions),v=e.workflow.trigger===ht.VolunteersSegment&&(u||m||g||h||p)||e.workflow.trigger===ht.DelegationsSegment&&(u||_||j),S=_||j||l||u||m||h||p||I||x;return(0,i.jsxs)(Tl,{align:"center",direction:"column",children:[(0,i.jsx)(hc,{}),e.workflow.state===gt.Error&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lc,{alertStyle:"warning",width:"min($container, 100%)",children:[(0,i.jsx)(cc,{children:n("une_erreur_est_38715")}),(0,i.jsx)(uc,{children:e.workflow.data.errorMessage})]}),(0,i.jsx)(Pl,{height:"6"})]}),(0,i.jsx)(Tl,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("d_but_41840")})}),(0,i.jsx)(QP,{}),(0,i.jsx)(KP,{change:e.change,isEdit:e.isEdit,workflow:e.workflow}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(XP,{hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(UP,{isEdit:e.isEdit})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(HP,{isEdit:e.isEdit})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(BP,{isEdit:e.isEdit})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(RP,{isEdit:e.isEdit,workflow:e.workflow})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(YP,{})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(FP,{workflow:e.workflow})]}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(ZP,{change:e.change,workflow:e.workflow})]}),(m||g)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(MP,{isProfileVisible:e.workflow.trigger===ht.VolunteersSegment})]}),(h||p)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(kP,{})]}),I&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(NP,{workflow:e.workflow})]}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(PP,{})]}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(VP,{change:e.change,workflow:e.workflow})]}),j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(LP,{workflow:e.workflow})]}),v&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(qP,{workflow:e.workflow})]}),S&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QP,{}),(0,i.jsx)(Tl,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("fin_60104")})})]})]})},ek=V.forwardRef((e,n)=>{const{history:t,translate:s,params:{organizationId:o,eventId:a}}=Kl(),{user:r}=Yi(),d=Um(),[l,c]=V.useState(!1),u=V.useCallback(()=>{JSON.stringify(e.workflow)===e.initialValuesString?t.goBack(Yj.WORKFLOWS({organizationId:o,eventId:a})):c(!0)},[e.workflow,e.initialValuesString,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hx,{button:(0,i.jsx)(ly,{permissions:sy.WORKFLOW_EDIT,children:(0,i.jsx)(tc,{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",heading:e.isEdit?e.name:s("nouvelle_automa_77863"),onClose:u,children:(0,i.jsxs)(Tl,{height:1,children:[(0,i.jsxs)(Tl,{css:{background:"white",padding:"$6"},direction:"column",gap:"7",width:420,children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:s("param_tres_de_l_25166")}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)($c,{label:s("nom_de_l_automa_04883"),name:"workflow.name"}),(0,i.jsx)(ny,{label:s("State"),name:"workflow.state",children:d(wi.filter(e=>e!==gt.Error))}),(0,i.jsxs)(ny,{label:s("Frequency"),name:"workflow.frequency",state:Ym(r.email)?void 0:"disabled",children:[(0,i.jsx)("option",{value:dt.Every10Minutes,children:s(dt.Every10Minutes)}),(0,i.jsx)("option",{value:dt.Every5Minutes,children:s(dt.Every5Minutes)}),(0,i.jsx)("option",{value:dt.Every2Minutes,children:s(dt.Every2Minutes)}),(0,i.jsx)("option",{value:dt.EveryMinute,children:s(dt.EveryMinute)})]})]})]}),(0,i.jsx)(Tl,{ref:n,css:{background:"$gray50",flex:"1",overflowY:"auto",padding:"$8"},direction:"column",height:1,children:(0,i.jsx)(JP,{change:e.change,hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit,workflow:e.workflow})})]})}),(0,i.jsx)(Mz,{fallbackPath:Yj.WORKFLOWS({organizationId:o,eventId:a}),isOpen:l,onClose:()=>c(!1)})]})});ek.displayName="UpdateWorkflowForm";const nk=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{showNotification:a}=AS(),r=(0,V.useRef)(null),d=ki(Ol),l=ki(zP),[c,u]=(0,V.useState)(""),m=(0,V.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.name??""):t("cr_ation_d_une_01202"),[e.initialValues]);return Au(m),(0,V.useEffect)(()=>{u(JSON.stringify(e.initialValues))},[e.initialValues]),(0,i.jsx)(xc,{customErrorRef:r,height:1,initialValues:{workflow:e.initialValues},render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(ek,{ref:r,category:m,change:n.change,handleSubmit:t,hasBeenExecuted:e.hasBeenExecuted,initialValuesString:c,isEdit:e.isEdit,name:e.initialValues.name,submitting:s,workflow:o.workflow}),validate:e=>d.validateForForm(l.workflowInputSchema())(e.workflow),width:1,onSubmit:async i=>{await e.mutate(i.workflow),a(e.isEdit?t("l_automatisatio_62036"):t("l_automatisatio_19124")),n.push(Yj.WORKFLOWS({organizationId:s,eventId:o}))}})},tk=()=>{const{params:{organizationId:e,eventId:n}}=Kl(),t=ki(zP),{mutate:s}=function(e={}){return Ui("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,V.useMemo)(()=>t.workflowInputDefault(),[]);return(0,i.jsx)(nk,{hasBeenExecuted:!1,initialValues:o,isEdit:!1,mutate:t=>s({organizationId:e,eventId:n,workflow:t})})},ik=()=>{const{params:{organizationId:e,eventId:n,workflowId:t}}=Kl(),s=ki(zP),{mutate:o}=function(e={}){return Ui("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:a,loader:r}=Li("query WorkflowToEdit($organizationId: OrganizationId!, $workflowId: WorkflowId!) {\n organization(id: $organizationId) {\n workflow(id: $workflowId) {\n id\n name\n frequency\n state\n action\n trigger\n hasBeenExecuted\n onExit\n\n data {\n accreditationProfileId\n accreditationsSlotsIds\n addValues\n campaignId\n customFieldId\n customFieldValue\n customFields\n delegationId\n delegationsSegmentId\n emailSourceCustomFieldId\n errorMessage\n eventId\n formId\n permissions\n positionsCategoriesIds\n positionsIds\n positionsSegmentsIds\n positionsSlotsIds\n recipients\n usersInfosIds\n volunteersSegmentId\n }\n }\n }\n}\n",{organizationId:e,workflowId:t},[]),d=(0,V.useMemo)(()=>s.workflowInputDefault(a.organization?.workflow),[a.organization]);return r||(0,i.jsx)(nk,{hasBeenExecuted:a.organization?.workflow.hasBeenExecuted,initialValues:d,isEdit:!0,mutate:i=>o({organizationId:e,eventId:n,workflowId:t,workflow:i})})},sk=(0,V.createContext)({});function ok(){return(0,V.useContext)(sk)}let ak=class extends Rc{translationService;constructor(e){super(e),this.translationService=e}segmentFolderInputDefault(e,n){return{name:n?.name??"",segmentType:e}}};ak=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],ak);const rk=e=>{const n=Fi(),{eventId:t,organizationId:s,segmentType:o,reloadSegments:a}=ok(),{mutate:r}=function(e={}){return Ui("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:d}=function(e={}){return Ui("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)}(),l=ki(ak);return(0,i.jsx)(tb,{buttonText:e.isEdit?n("mettre_jour_l_05529"):n("cr_er_le_dossie_71150"),icon:"text",initialValues:{segmentFolder:l.segmentFolderInputDefault(o,e.segmentFolder)},size:"md",subtitle:n("classez_vos_vue_39895"),title:n("nom_du_dossier_95781"),onClose:e.onClose,onSubmit:async n=>{e.isEdit&&e.segmentFolder?await d({organizationId:s,eventId:t,segmentFolderId:e.segmentFolder.id,name:n.segmentFolder.name}):await r({organizationId:s,eventId:t,segmentFolder:n.segmentFolder}),a(),e.onClose()},children:(0,i.jsx)($c,{label:n("nom_du_dossier_95781"),name:"segmentFolder.name"})})},dk=e=>{const n={type:"segment",segmentId:e.segment.id},{setNodeRef:t,style:s,handleProps:o}=up(`s-${e.segment.id}`,n),[a,r]=V.useState(!1),d=V.useCallback(n=>{e.setSegmentsFolders((0,dp.jM)(t=>{t[e.segmentFolderIndex].segments[e.index].name=n}))},[e.segmentFolderIndex,e.index,e.setSegmentsFolders]),l=V.useCallback(()=>e.setSegmentsFolders(n=>n.map(n=>({...n,segments:n.segments.filter(n=>n.id!==e.segment.id)}))),[e.segment,e.setSegmentsFolders]);return(0,i.jsxs)(Tl,{ref:t,css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",align:"center",style:s,children:[(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"pointer"},...o,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})}),a?(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(wc,{value:e.segment.name,onChange:d})}):(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 textSm medium",children:e.segment.name}),(0,i.jsx)(tc,{color:"white",leftIcon:a?"check":"pen",size:"sm",onClick:()=>r(!a)}),(0,i.jsx)(tc,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:l})]})},lk=e=>{const[n,t]=V.useState(!1),s={type:"segmentFolder",segmentFolderId:e.segmentFolder.id},{setNodeRef:o,style:a,handleProps:r}=up(`sf-${e.segmentFolder.id}`,s),d={type:"segmentFolderSegments",segmentFolderId:e.segmentFolder.id},{setNodeRef:l}=(0,Ip.zM)({id:`drop-sf-${e.segmentFolder.id}`,data:d}),c=V.useCallback(n=>{e.setSegmentsFolders((0,dp.jM)(t=>{t[e.index].name=n}))},[e.index,e.setSegmentsFolders]);return(0,i.jsxs)(Tl,{ref:o,css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm"},direction:"column",style:a,children:[(0,i.jsxs)(Tl,{align:"center",css:{padding:"$4"},gap:"3",children:[(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"pointer"},fontSize:"textMd",...r,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})}),n?(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(wc,{value:e.segmentFolder.name,onChange:c})}):(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textMd medium",children:e.segmentFolder.name}),(0,i.jsx)(tc,{color:"white",leftIcon:n?"check":"pen",size:"sm",onClick:()=>t(!n)}),(0,i.jsx)(tc,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:()=>{e.setSegmentsFolders(n=>n.filter(n=>n!==e.segmentFolder))}})]}),(0,i.jsx)(lp.gB,{items:e.segmentFolder.segments.map(e=>`s-${e.id}`),strategy:lp._G,children:(0,i.jsx)(Tl,{ref:l,css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$4"},direction:"column",gap:"2",children:e.segmentFolder.segments.map((n,t)=>(0,i.jsx)(dk,{canDelete:e.segmentFolder.segments.length>1,index:t,segment:n,segmentFolderIndex:e.index,setSegmentsFolders:e.setSegmentsFolders},n.id))})})]})},ck=[xp.FN,xp.Mk];function uk(e){return e?.data.current}function mk(e,n){return"segment"===n.type?e.findIndex(e=>e.segments.some(e=>e.id===n.segmentId)):e.findIndex(e=>e.id===n.segmentFolderId)}const gk=e=>{const n=Fi(),{segmentsFolders:t}=ok(),{mutate:s,isLoading:o}=function(e={}){return Ui("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)}(),[a,r]=(0,V.useState)(t.map(e=>({id:e.id,name:e.name,segments:e.segments.map(e=>({id:e.id,name:e.name}))}))),d=(0,V.useCallback)(async()=>{await s({organizationId:e.organizationId,eventId:e.eventId,segmentType:e.segmentType,segmentsFolders:a.map(e=>({...e,id:!e.id||e.id<0?void 0:e.id}))}),e.onClose(),e.onSuccess()},[e.organizationId,e.eventId,e.segmentType,a]),l=function(e,n){const t=(0,Ip.FR)((0,Ip.MS)(Ip.AN,{activationConstraint:{distance:4}}),(0,Ip.MS)(Ip.uN,{coordinateGetter:lp.JR})),i=(0,V.useRef)(null),s=(0,V.useCallback)(n=>{const t=uk(n.active);if("segmentFolder"===t?.type)return(0,Ip.fp)({...n,droppableContainers:n.droppableContainers.filter(e=>"segmentFolder"===uk(e)?.type)});const i=n.droppableContainers.filter(e=>"segment"===uk(e)?.type),[s]=(0,Ip.TT)({...n,droppableContainers:n.droppableContainers.filter(e=>"segmentFolderSegments"===uk(e)?.type)});if(s){const t=mk(e,uk(n.droppableContainers.find(e=>e.id===s.id))),o=i.filter(n=>e[t].segments.some(e=>e.id===uk(n).segmentId));return o.length>0?(0,Ip.fp)({...n,droppableContainers:o}):[s]}return(0,Ip.fp)({...n,droppableContainers:i})},[e]),o=(0,V.useCallback)(()=>{i.current=e},[e]),a=(0,V.useCallback)(({active:e,over:t})=>{const i=uk(e),s=uk(t);"segment"===i?.type&&s&&"segmentFolder"!==s.type&&n((0,dp.jM)(e=>{const n=mk(e,i),t=mk(e,s);if(-1!==n&&-1!==t&&n!==t){const o=e[n],a=e[t],[r]=o.segments.splice(o.segments.findIndex(e=>e.id===i.segmentId),1),d="segment"===s.type?a.segments.findIndex(e=>e.id===s.segmentId):-1;a.segments.splice(-1===d?a.segments.length:d,0,r)}}))},[n]),r=(0,V.useCallback)(({active:e,over:t})=>{i.current=null;const s=uk(e),o=uk(t);s&&o&&e.id!==t.id&&("segmentFolder"===s.type&&"segmentFolder"===o.type?n(e=>Qo(e,mk(e,s),mk(e,o))):"segment"===s.type&&"segment"===o.type&&n((0,dp.jM)(e=>{const n=e[mk(e,s)],t=n.segments.findIndex(e=>e.id===s.segmentId),i=n.segments.findIndex(e=>e.id===o.segmentId);-1!==i&&(n.segments=Qo(n.segments,t,i))})))},[n]),d=(0,V.useCallback)(()=>{i.current&&(n(i.current),i.current=null)},[n]);return{collisionDetection:s,modifiers:ck,sensors:t,onDragCancel:d,onDragEnd:r,onDragOver:a,onDragStart:o}}(a,r);return(0,i.jsx)(Hx,{button:(0,i.jsx)(tc,{isLoading:o,onClick:d,children:n("enregistrer_06519")}),category:n("vues_personnali_80652"),heading:n("param_tres_de_v_66378"),onClose:e.onClose,children:(0,i.jsxs)(Gx,{css:{background:"white"},children:[(0,i.jsxs)(Tl,{align:"center",gap:"6",justify:"between",children:[(0,i.jsx)(Mr,{font:"gray900 textLg semiBold",children:n("organisation_de_95776")}),(0,i.jsx)(tc,{color:"white",leftIcon:"folder-plus",onClick:()=>{const e=Math.min((0,Dg.A)(a,e=>e.id)?.id??0,0);r([...a,{id:e-1,name:n("nouveau_dossier_94479"),segments:[]}])},children:n("nouveau_dossier_94479")})]}),(0,i.jsx)(oI,{height:"5"}),(0,i.jsx)(Ip.Mp,{...l,children:(0,i.jsx)(lp.gB,{items:a.map(e=>`sf-${e.id}`),strategy:lp._G,children:(0,i.jsx)(Tl,{direction:"column",gap:"6",width:1,children:a.map((e,n)=>(0,i.jsx)(lk,{canDelete:a.length>1,index:n,segmentFolder:e,setSegmentsFolders:r},e.id))})})})]})})},hk=e=>{const n=Fi(),{eventId:t,organizationId:s,segmentsFolders:o,reloadSegments:a}=ok(),{mutate:r}=function(e={}){return Ui("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)(tb,{buttonText:n("d_placer_la_vue_27440"),icon:"sliders",initialValues:{segmentFolderId:e.segment.segmentFolderId},size:"md",title:n("d_placer_la_vue_55115",e.segment.name),onClose:e.onClose,onSubmit:async n=>{await r({organizationId:s,eventId:t,segmentId:e.segment.id,segmentFolderId:n.segmentFolderId}),a(),e.onClose()},children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",children:n("vers_quel_dossi_86452")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Tl,{css:{overflowY:"auto"},direction:"column",gap:"3",children:o.map(e=>(0,i.jsx)(qz,{label:e.name,name:"segmentFolderId",value:e.id},e.id))})]})},pk=e=>{const{translate:n}=Kl(),{eventId:t,organizationId:s,segmentsFolders:o,reloadSegments:a}=ok(),{mutate:r,isLoading:d}=function(e={}){return Ui("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)}(),[l,c]=(0,V.useState)(e.segment.name),[u,m]=(0,V.useState)(e.segment.segmentFolderId),[h,p]=(0,V.useState)(e.segment.description||void 0),I=g(l);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"gear",subtitle:n("mettez_jour_l_55467"),children:n("mise_jour_de_80873")}),(0,i.jsxs)(hx,{gap:"4",children:[(0,i.jsx)(wc,{label:n("nom_de_la_vue_66415"),value:l,onChange:c}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("dossier_00726"),shouldParseAsInt:!0,values:[u],onChange:e=>{Yo(e)&&m(e[0])},children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(af,{label:n("Description"),value:h,onChange:p})]}),(0,i.jsx)(gx,{children:()=>(0,i.jsx)(tc,{disabled:!I,isLoading:d,onClick:async()=>{await r({organizationId:s,eventId:t,description:h,name:l,segmentFolderId:u,segmentId:e.segment.id}),a()},children:n("mettre_jour_85141")})})]})})},Ik=br("div",{alignItems:"center",color:"$gray700",cursor:"pointer",display:"flex",height:"32px",gap:"$space$2",px:"$3",width:"100%","&:hover":{"& .count":{background:"$primary500",color:"white"}},"& .name":{flex:"1",ellipsis:""},"& .count, & .count-admin":{borderRadius:"16px",fontSize:"$textXs",px:"8px",py:"2px"},"& .ellipsis":{display:"none"},"&:hover .count-admin":{display:"none"},"&:hover .ellipsis":{color:"$gray700",display:"block","& .trigger":{alignItems:"center",display:"flex",height:"32px",justifyContent:"end",px:"8px",width:"32px"}},variants:{selected:{true:{background:"$primary50",borderRadius:"$1",color:"$primary500","& .count":{background:"$primary500",color:"white"},"& .count, & .count-admin":{background:"$primary500",color:"white"}},false:{"&:hover":{background:"$gray100",borderRadius:"$1",color:"$gray800"},"& .count, & .count-admin":{background:"$primary50",color:"$primary500"}}}}}),xk=(0,V.memo)(function(e){const{history:n,translate:t}=Kl(),{canSegmentEdit:s,eventId:o,organizationId:a,segmentId:r,getSegmentPath:d,onSegmentClick:l,reloadSegments:c}=ok(),{mutate:u}=function(e={}){return Ui("mutation SegmentDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentDelete(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:m}=function(e={}){return Ui("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:g}=function(e={}){return Ui("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:h}=function(e={}){return Ui("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,I]=(0,V.useState)(!1),[x,f]=(0,V.useState)(!1),[_,j]=(0,V.useState)(!1);return(0,i.jsxs)(Ik,{selected:e.segment.id===r,onClick:()=>{l(e.segment.id),n.push(d(e.segment.id))},onMouseLeave:e=>{Tu(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:jc,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)("div",{className:"trigger",children:(0,i.jsx)("i",{className:"fa-regular fa-ellipsis-vertical"})})}),(0,i.jsxs)(Fu,{offset:0,placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>I(!0),children:t("mettre_jour_85141")}),e.canMoveUpDown&&(0,i.jsx)(Pu,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await h({organizationId:a,eventId:o,segmentId:e.segment.id}),c()},children:t("d_placer_vers_l_49863")}),e.canMoveUpDown&&(0,i.jsx)(Pu,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await g({organizationId:a,eventId:o,segmentId:e.segment.id}),c()},children:t("d_placer_vers_l_52432")}),e.canMoveFolder&&(0,i.jsx)(Pu,{icon:"folder",onClick:()=>f(!0),children:t("d_placer_de_dos_65513")}),e.canDelete&&(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{await m({organizationId:a,eventId:o,segmentId:e.segment.id}),c()},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:e.canDelete&&(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>j(!0),children:t("supprimer_43083")})})]})]})}),p&&(0,i.jsx)(pk,{segment:e.segment,onClose:()=>{I(!1)}}),x&&(0,i.jsx)(hk,{segment:e.segment,onClose:()=>{f(!1)}}),_&&(0,i.jsx)(ow,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_38950"),text:t("suppression_de_73669",e.segment.name),onClose:()=>{j(!1)},onDelete:async()=>{await u({organizationId:a,eventId:o,segmentId:e.segment.id}),c(),await e.onDelete()},children:e.segment.isUsedInWorkflow&&(0,i.jsx)(lc,{alertStyle:"warning",children:(0,i.jsx)(uc,{children:t("cette_vue_est_u_58409")})})})]})}),fk=e=>{const n=Fi(),{canSegmentEdit:t,eventId:s,organizationId:o,reloadSegments:a,segmentType:r}=ok(),{mutate:d}=function(e={}){return Ui("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:l}=function(e={}){return Ui("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 Ui("mutation SegmentFolderMoveUp(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentFolderMoveUp(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}(),{mutate:u}=function(e={}){return Ui("mutation SegmentFolderDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentFolderId: SegmentsFolderId!\n $newEventId: EventId!\n) {\n segmentFolderDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n newEventId: $newEventId\n )\n}\n",e)}(),[m,h]=(0,V.useState)(!1),[p,I]=(0,V.useState)(!1),[x,f]=(0,V.useState)(!1),[_,j]=(0,V.useState)(!1),[v,S]=(0,V.useState)(!1),y=(0,V.useCallback)(async()=>{const n=!x;f(n),await NS.segmentsFolders.put({id:e.segmentFolder.id,isOpen:n})},[x,e.segmentFolder.id]),C=(0,V.useCallback)(n=>u({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id,newEventId:n}),[o,s,e.segmentFolder,u]),b=(0,V.useMemo)(()=>g(e.search)?e.segmentFolder.segments.filter(n=>zg(n,e.search)):e.segmentFolder.segments,[e.segmentFolder.segments,e.search]);return(0,V.useEffect)(()=>{(async()=>{f((await NS.segmentsFolders.get(e.segmentFolder.id))?.isOpen??!0)})()},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",userSelect:"none","& .ellipsis":{display:"none"},"&:hover .ellipsis":{display:"block"}},gap:"2",onClick:y,children:[(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:x?"chevron-down":"chevron-right"})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 textXs semiBold",children:e.segmentFolder.name}),t&&(0,i.jsx)(Mr,{className:"ellipsis",onClick:jc,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Tl,{align:"center",css:{color:"$gray500",px:"$2"},justify:"end",width:24,children:(0,i.jsx)(Yl,{icon:"ellipsis-vertical"})})}),(0,i.jsxs)(Fu,{offset:0,placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>h(!0),children:n("renommer_42135")}),(0,i.jsx)(Pu,{icon:"gear",onClick:()=>j(!0),children:n("r_ordonner_41823")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Pu,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await l({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),a()},children:n("d_placer_vers_l_52432")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Pu,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await c({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),a()},children:n("d_placer_vers_l_49863")}),!!s&&e.canDeleteSegmentFolder&&(0,i.jsx)(Pu,{icon:"clone",onClick:()=>S(!0),children:"Dupliquer sur un autre Ă©vĂ©nement"})]}),(0,i.jsx)(lw,{children:e.canDeleteSegmentFolder&&(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>I(!0),children:n("supprimer_43083")})})]})]})})]}),b.length>0&&x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Tl,{direction:"column",gap:"1",children:b.map((n,t)=>(0,i.jsx)(xk,{canDelete:e.canDeleteSegment,canMoveFolder:e.canDeleteSegmentFolder,canMoveUpDown:e.segmentFolder.segments.length>1,isFirst:0===t,isLast:t===e.segmentFolder.segments.length-1,segment:n,onDelete:e.onSegmentDelete},n.id))})]}),(0,i.jsx)(Pl,{height:"5"})]}),m&&(0,i.jsx)(rk,{isEdit:!0,segmentFolder:e.segmentFolder,onClose:()=>{h(!1)}}),p&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_13885"),text:n("suppression_de_73669",e.segmentFolder.name),onClose:()=>{I(!1)},onDelete:async()=>{await d({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),a()}}),_&&(0,St.createPortal)((0,i.jsx)(Mr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(gk,{eventId:s,organizationId:o,segmentType:r,onClose:()=>{j(!1)},onSuccess:()=>(a(),e.onSegmentDelete())})}),document.body),v&&(0,i.jsx)(xz,{eventId:s,organizationId:o,onClose:()=>S(!1),onSuccess:C})]})},_k=e=>{const n=Fi(),{canSegmentEdit:t,segmentsFolders:s}=ok(),[o,a]=(0,V.useState)(!1),r=(0,V.useMemo)(()=>s.flatMap(e=>e.segments).length>1,[s]),[d,l]=(0,V.useState)(""),c=(0,V.useMemo)(()=>g(d)?s.filter(e=>e.segments.some(e=>zg(e,d))):s,[s,d]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eu,{css:{background:"white",borderRight:"1px solid $gray200",overflow:"hidden"},gridtemplaterows:"1fr 48px",height:1,width:1,children:[(0,i.jsxs)(Tl,{css:{overflowY:"auto",padding:"$7 $4"},direction:"column",width:1,children:[(0,i.jsx)(Tl,{align:"center",children:(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1"},fontSize:"textMd",fontWeight:"semiBold",children:n("vues_personnali_80652")})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_50038"),state:"search",value:d,onChange:l})}),(0,i.jsx)(Pl,{height:"4"}),c.map((n,t)=>(0,i.jsx)(fk,{canDeleteSegment:r,canDeleteSegmentFolder:s.length>1,isFirst:0===t,isLast:t===s.length-1,search:d,segmentFolder:n,onSegmentDelete:e.onSegmentDelete},n.id))]}),t&&(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",cursor:"pointer",padding:"$3 $6"},gap:"4",width:1,onClick:()=>{a(!0)},children:[(0,i.jsx)(Yl,{icon:"plus"}),(0,i.jsx)(Mr,{color:"gray700",fontWeight:"medium",children:n("nouveau_dossier_94479")})]})]}),o&&(0,i.jsx)(rk,{isEdit:!1,onClose:()=>{a(!1)}})]})},jk=()=>{const{history:e,translate:n}=Kl(),{columns:t,columnsSearch:s,predicates:o,rendering:a,sort:r}=pg(),{columnsExport:d,eventId:l,getSegmentPath:c,infos:u,organizationId:m,reloadSegments:h,segment:p,segmentId:I,segmentType:x,segmentsFolders:f,setIsSaveSegmentVisible:_}=ok(),j=(0,V.useCallback)(()=>{_(!1)},[_]),{mutate:v,isLoading:S}=function(e={}){return Ui("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:y,isLoading:C}=function(e={}){return Ui("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)}(),[b,A]=(0,V.useState)(!1),[E,w]=(0,V.useState)(""),[$,T]=(0,V.useState)(f.find(e=>e.segments.find(e=>e.id===I))?.id??f[0].id),[z,O]=(0,V.useState)(p.description||void 0),R=!b||g(E);return(0,i.jsx)(xx,{isOpen:!0,onClose:j,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"floppy-disk",subtitle:n("sauvegarder_vos_15289"),children:n("enregistrer_une_52986")}),(0,i.jsxs)(hx,{children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("que_souhaitez_v_33936")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(cm,{css:{"& label > div > div":{fontWeight:"$regular"}},state:b?"unchecked":"checked",onClick:()=>{A(!1)},children:n("enregistrer_les_31603").split("{1}").map((e,n)=>1===n?(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(mf,{fontWeight:"medium",children:p.name}),e]},n):(0,i.jsx)(V.Fragment,{children:e},n))}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(cm,{css:{"& label > div > div":{fontWeight:"$regular"}},state:b?"checked":"unchecked",onClick:()=>{A(!0)},children:n("cr_er_une_nouve_37002")}),b&&(0,i.jsx)(Mr,{css:{marginLeft:"$6"},children:(0,i.jsx)(wc,{hint:n("cette_vue_sera_83858"),placeholder:n("nom_de_votre_no_21748"),value:E,onChange:w})})]})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("dans_quel_dossi_07643"),renderOnPortal:!0,shouldParseAsInt:!0,values:[$],onChange:e=>{Yo(e)&&T(e[0])},children:f.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(af,{label:n("Description"),placeholder:n("entrer_une_desc_74340"),value:z,onChange:O})]}),(0,i.jsx)(gx,{children:()=>(0,i.jsx)(tc,{disabled:!R,isLoading:C||S,onClick:async()=>{const n={segmentType:x,name:E,description:z,predicatesGroups:o,columns:t,columnsExport:d,columnsSearch:s,sort:r,rendering:a,infos:u};if(b){const{segmentCreate:{id:t}}=await y({organizationId:m,eventId:l,segmentFolderId:$,segment:n});h(),e.push(c(t))}else await v({organizationId:m,eventId:l,segmentFolderId:$,segmentId:I,segment:n}),h()},children:n("enregistrer_06519")})})]})})},vk=e=>{const{segment:n}=e,{massActions:t,reload:s}=pg(),[o,a]=V.useState(n.columnsExport),[r,d]=V.useState(n.infos),l=V.useMemo(()=>JSON.stringify(n.columnsExport),[n]),c=V.useMemo(()=>JSON.stringify(n.infos),[n]),u=V.useMemo(()=>JSON.stringify(o)!==l||JSON.stringify(r)!==c,[o,l,r,c]),[m,g]=V.useState(!1),h=V.useCallback(()=>{t.toggleSelectAll("unchecked"),s()},[t,s]);return(0,i.jsx)(sk.Provider,{value:{areSegmentsOpen:e.areSegmentsOpen,canSegmentEdit:e.canSegmentEdit,columnsExport:o,eventId:e.eventId,filters:e.filters,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,infos:r,isSaveSegmentVisible:m,isSegmentDirty:u,onMassEditSuccess:h,onSegmentClick:e.onSegmentClick,organizationId:e.organizationId,reloadSegments:e.reloadSegments,segment:n,segmentId:e.segmentId,segmentType:e.segmentType,segmentsFolders:e.segmentsFolders,setAreSegmentsOpen:e.setAreSegmentsOpen,setColumnsExport:a,setInfos:d,setIsSaveSegmentVisible:g,setSegmentCount:e.setSegmentCount},children:e.children})},Sk=e=>{const{areSegmentsOpen:n,hideSegments:t,isSaveSegmentVisible:s}=ok();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{height:1,width:1,children:[!0!==t&&n&&(0,i.jsx)(Mr,{css:{overflow:"hidden"},height:1,width:260,children:(0,i.jsx)(_k,{onSegmentDelete:e.onSegmentDelete})}),(0,i.jsx)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",height:1,children:e.children})]}),s&&(0,i.jsx)(jk,{})]})},yk=e=>{const[n,t]=V.useState(e.segmentsFolders),s=V.useMemo(()=>n.flatMap(e=>e.segments),[n]),o=V.useMemo(()=>s.find(n=>n.id===e.segmentId),[e.segmentId,s]),[a,r]=V.useState(e.initialSegmentsOpen??!0),d=V.useCallback(n=>{e.onSegmentsToggle?.(n),r(n)},[r]),l=V.useCallback((e,i)=>{t((0,dp.jM)(n,n=>{n.forEach(n=>{n.segments.forEach(n=>{n.id===e&&(n.count=i)})})}))},[n,t]);return V.useEffect(()=>{t(e.segmentsFolders)},[e.segmentsFolders]),(0,i.jsx)(Cx,{columns:o.columns,columnsSearch:o.columnsSearch,columnsToIncludes:e.columnsToIncludes,eventId:e.eventId??null,filters:e.filters,filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle,getMassActionId:e.getMassActionId,limit:e.initialLimit,loadDataList:e.loadDataList,loadDataListParams:e.loadDataListParams,loadRow:e.loadRow,loadRowParams:e.loadRowParams,organizationId:e.organizationId,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:o.predicatesGroups,rendering:o.rendering,renderingLoaders:e.renderingLoaders,renderingParams:e.renderingParams,setLimit:e.setLimit,showHeader:!1,showMassActions:e.showMassActions,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,sort:o.sort,children:(0,i.jsx)(vk,{areSegmentsOpen:a,canSegmentEdit:e.canSegmentEdit,eventId:e.eventId,filters:e.filters,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,organizationId:e.organizationId,reloadSegments:e.reload,segment:o,segmentId:e.segmentId,segmentType:e.segmentType,segmentsFolders:n,setAreSegmentsOpen:d,setSegmentCount:l,onSegmentClick:e.onSegmentClick,children:(0,i.jsx)(Sk,{onSegmentDelete:e.onSegmentDelete,children:e.children})})},o.id)},Ck=e=>{const n=Fi(),{isSaveVisible:t}=pg(),{canSegmentEdit:s,isSegmentDirty:o,setIsSaveSegmentVisible:a}=ok();return(0,i.jsx)(op,{actions:e.actions,controls:(0,i.jsxs)(i.Fragment,{children:[s&&(t||o)&&(0,i.jsx)(tc,{color:"invisible",onClick:()=>{a(!0)},children:n("enregistrer_la_22884")}),e.controls]}),searchPlaceholder:e.searchPlaceholder,showActions:e.showActions,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:s,showSearchColumns:e.showSearchColumns})},bk=e=>{const{limit:n,massActions:t}=pg(),{canSegmentEdit:s,segment:o}=ok(),a=s&&t.numberOfSelected===n&&o.count>n;return(0,i.jsxs)(Tl,{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)(Qh,{isReadOnly:!s}),a&&e.selectSegment]})},Ak=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{showNotification:o}=AS(),{mutate:a}=vl();return(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:(0,kl.A)([n("_tes_vous_s_r_d_94890"),e.workflow.trigger===ht.Assigned?n("cela_supprimera_60220"):null]),text:n("suppression_de_73669",e.workflow.name),onClose:e.onClose,onDelete:async()=>{await a({organizationId:t,eventId:s,selecteds:{ids:[e.workflow.id]}}),o(n("l_automatisatio_64405",e.workflow.name)),e.onSuccess()}})},Ek=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{mutate:a}=Sl(),{mutate:r}=Cl(),[d,l]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"play",isDisabled:e.workflow.state===gt.Paused,onClick:async()=>{await r({organizationId:s,eventId:o,selecteds:{ids:[e.workflow.id]}}),e.reload()},children:t("ex_cuter_54158")}),(0,i.jsx)(Pu,{icon:"pen",to:Yj.UPDATE({organizationId:s,eventId:o,workflowId:e.workflow.id}),children:t("_diter_62574")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:t}}=await a({organizationId:s,eventId:o,workflowId:e.workflow.id});n.push(Yj.UPDATE({organizationId:s,eventId:o,workflowId:t}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{l(!0),Tu(e.target)},children:t("supprimer_43083")})})]}),d&&(0,i.jsx)(Ak,{workflow:e.workflow,onClose:()=>l(!1),onSuccess:e.reload})]})},wk=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl(),{massActions:s,predicates:o}=pg(),{onMassEditSuccess:a,segment:r}=ok(),{showNotification:d}=AS(),{user:l}=Yi(),{mutate:c}=vl(),{mutate:u}=Da(),{mutate:m}=Cl(),[g,h]=(0,V.useState)(!1),[p,I]=(0,V.useState)(!1),x=s.getSelectedsInput(o,null),f=s.isAllSelected?r.count:s.numberOfSelected;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{onClick:()=>h(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"play",onClick:async()=>{const{numberOfExecuted:i}=await m({organizationId:n,eventId:t,selecteds:x});d(e("_1_automatisat_96943",i)),a()},children:e("ex_cuter_54158")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>I(!0),children:e("supprimer_43083")})})]})]}),g&&(0,i.jsx)(vw,{canAccessBackoffice:Ym(l.email),mutate:e=>u({organizationId:n,eventId:t,massEdit:e}),selecteds:x,onClose:()=>h(!1),onSuccess:n=>{d(e("_1_automatisat_35589",n)),a()}}),p&&(0,i.jsx)(ow,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_04998")],text:e("suppression_de_41301",f),onClose:()=>I(!1),onDelete:async()=>{await c({organizationId:n,eventId:t,selecteds:x}),d(e("_1_automatisat_45105",f)),a()}})]})},$k=e=>{const n=ki(Jm);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.insertedAt.toLocal(),Uo.DateTime)})},Tk=e=>{const n=g(e.createdBy?.name),t=(n?e.createdBy?.name:e.createdBy?.email)||"";return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray900 textSm medium",title:t,width:1,children:t}),n&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},title:e.createdBy?.email||"",width:1,children:e.createdBy?.email||""})]})})},zk=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),{mutate:s}=Da(),o=V.useCallback(async i=>(await s({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.workflowId]},slug:e.property,strategy:hn.Replace,value:i}}),!0),[n,t,e.workflowId,e.property,s]);return(0,i.jsx)(sA,{column:e.column,initialValue:e.initialValue,mutate:o,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable??!0})},Ok=e=>{const{translate:n}=Kl(),{user:t}=Yi();return(0,i.jsx)(zk,{column:e.column,initialValue:e.workflow.frequency,property:ct.Frequency,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Up,{label:n("Frequency"),value:e,onChange:t,children:Ci.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),renderValue:n(e.workflow.frequency),updatable:Ym(t.email),workflowId:e.workflow.id})},Rk=({children:e,isEditMode:n,title:t,updatable:s})=>n&&s?(0,i.jsx)(Mr,{css:{clamp:2},font:"gray900 textSm medium",title:t,width:1,children:t}):(0,i.jsx)(i.Fragment,{children:e}),Dk=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{isEditMode:o}=pg(),a=e.workflow.name;return(0,i.jsx)(zk,{column:e.column,initialValue:a,property:ct.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("nom_de_l_automa_04883"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(Xm,{to:Yj.WORKFLOW({organizationId:t,eventId:s,workflowId:e.workflow.id}),children:(0,i.jsx)(Mr,{css:{clamp:2},title:a,children:a})})}),workflowId:e.workflow.id})},Mk=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>wi.filter(e=>e!==gt.Error),[]),s=e.workflow.data.errorMessage||"";return(0,i.jsx)(zk,{column:e.column,initialValue:e.workflow.state,property:ct.State,reload:e.reload,renderInput:(e,s)=>(0,i.jsx)(Up,{label:n("State"),value:e,onChange:s,children:t.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),renderValue:()=>(0,i.jsxs)(Tl,{align:"start",direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(Ku,{...EP(e.workflow.state),children:n(e.workflow.state)}),e.workflow.state===gt.Error&&(0,i.jsx)(Mr,{css:{ellipsis:!0},title:s,width:1,children:s})]}),workflowId:e.workflow.id})},Pk=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Jm),a=ki(Bg),r=(0,V.useMemo)(()=>Yo(e.row.accreditationsSlots)?lh(e.row.accreditationsSlots):[],[e.column]),d=(0,V.useMemo)(()=>Yo(e.row.positionsSlots)?ah(a,[],[],e.row.positionsSlots):[],[e.column]);return e.column.slug===Rh.Id?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===Rh.Name?(0,i.jsx)(Dk,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Rh.State?(0,i.jsx)(Mk,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Rh.Trigger?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:n(e.row.trigger)}):e.column.slug===Rh.Action?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:n(e.row.action)}):e.column.slug===Rh.CreatedBy?(0,i.jsx)(Tk,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===Rh.CreatedAt?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===Rh.VolunteersSegment?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.segment?(0,i.jsx)(Xm,{to:e.row.segment.segmentType===Bn.Delegations?yo.DELEGATIONS_SEGMENT(t,s,e.row.segment.id):yo.VOLUNTEERS_SEGMENT(t,s,e.row.segment.id),children:e.row.segment.name}):"-"}):e.column.slug===Rh.ExecutedAt?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.executedAt?.isValid?o.toLocaleString(e.row.executedAt.toLocal(),Uo.DateTime):"-"}):e.column.slug===Rh.Accreditations?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:r,doNotSort:!0})}):e.column.slug===Rh.Positions?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:d,doNotSort:!0})}):e.column.slug===Rh.Campaign?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.campaign?(0,i.jsx)(Xm,{to:Gj.CAMPAIGN({organizationId:t,eventId:s,campaignId:e.row.campaign.id}),children:e.row.campaign.name}):"-"}):e.column.slug===Rh.Frequency?(0,i.jsx)(Ok,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Rh.CustomField?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.customField?e.row.customField.name:"-"}):null},kk=e=>{const{translate:n,params:{organizationId:t,segmentId:s}}=Kl(),{areSegmentsOpen:o,hideSegments:a,segment:r,setAreSegmentsOpen:d,setSegmentCount:l}=ok(),{data:c}=Li("query SegmentHeader($organizationId: OrganizationId!, $segmentId: SegmentId!) {\n organization(id: $organizationId) {\n segment(id: $segmentId) {\n count(shouldCompute: true)\n }\n }\n}\n",{organizationId:t,segmentId:r.id},[]);return V.useEffect(()=>{r.id===s&&l(r.id,c.organization?.segment.count??r.count)},[s,r,c.organization,l]),(0,i.jsx)(by,{children:(0,i.jsxs)(Tl,{align:"center",gap:"4",width:1,children:[!a&&(0,i.jsx)(Tl,{css:{cursor:"pointer",padding:"$2"},onClick:()=>d(!o),children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"sidebar"})})}),(0,i.jsx)(Dx,{placement:"top",children:n(o?"masquer_la_list_94215":"afficher_la_lis_48771")})]})}),e.name||(0,i.jsxs)(Mr,{css:{flex:"1"},font:"gray900 displayXs medium",children:[(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsx)(Mr,{children:r.name}),r.isUsedInWorkflow&&(0,i.jsx)(Ku,{color:"white",leftIcon:"bolt-auto",children:n("utilis_e_dans_u_46582")})]}),r.description&&(0,i.jsx)(Mr,{css:{whiteSpace:"pre-wrap"},font:"gray500 textXs medium",children:r.description})]}),e.children]})})},Fk=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=Kl();return(0,i.jsx)(kk,{children:(0,i.jsx)(ly,{permissions:sy.WORKFLOW_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{e.push(Yj.CREATE({organizationId:t,eventId:s}))},children:n("cr_er_une_autom_91246")})})})},Nk=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{limit:o,reload:a}=pg(),{segment:r}=ok();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fk,{}),(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:(0,i.jsx)(wk,{}),searchPlaceholder:n("rechercher_une_30575"),showActions:e.canWorkflowEdit,showEditColumns:e.canSegmentEdit,showEditMode:e.canWorkflowEdit,showSearchColumns:!1}),selectSegment:(0,i.jsx)(ap,{allSelectedText:n("les_1_automat_58612",r.count,r.name),pageSelectedText:n("les_1_automat_30472",o),selectAllText:n("s_lectionner_le_71777",r.count,r.name)})}),(0,i.jsx)(kx,{getEditPath:e=>Yj.UPDATE({organizationId:t,eventId:s,workflowId:e.id}),renderCell:(e,n)=>(0,i.jsx)(Pk,{column:e,reload:a,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)(Ek,{reload:n,workflow:e})})]})]})},Lk=e=>{const{translate:n,params:{organizationId:t,eventId:s,segmentId:o}}=Kl(),a=ki(Mh),r=(0,V.useMemo)(()=>a.getWorkflowsFilters(t,s),[a,t,s]),d=(0,V.useMemo)(()=>a.getWorkflowsPossibleColumns(),[a]),l=(0,V.useMemo)(()=>({level:s?xn.Event:xn.Organization}),[s]);return(0,i.jsx)(yk,{canSegmentEdit:e.canSegmentEdit,columnsToIncludes:Dh,eventId:s,filters:r,filtersButtonText:n("filtrer_les_aut_25902"),filtersSubtitle:n("appliquer_des_f_55705"),getSegmentPath:e=>Yj.WORKFLOWS_SEGMENT({organizationId:t,eventId:s,segmentId:e}),initialLimit:e.initialLimit??Tm,initialSegmentsOpen:e.initialSegmentsOpen??!0,loadDataList:yl,loadDataListParams:l,organizationId:t,possibleColumns:d,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:Bn.Workflows,segmentsFolders:e.segmentsFolders,setLimit:e.setLimit,showMassActions:e.canWorkflowEdit,showRowDropdown:e.canWorkflowEdit,showRowEdit:e.canWorkflowEdit,onSegmentClick:e.onSegmentClick,onSegmentDelete:e.onSegmentDelete,onSegmentsToggle:e.onSegmentsToggle,children:(0,i.jsx)(Nk,{canSegmentEdit:e.canSegmentEdit,canWorkflowEdit:e.canWorkflowEdit})})};function Uk(e){return(0,V.useMemo)(()=>e.flatMap(e=>e.segments).map(e=>e.id),[e])}const Vk=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=Kl(),{event:{name:o},localEvent:a,updateLocalEvent:r}=BS(),{canSegmentEdit:d,canWorkflowEdit:l}=oy();Au(`${o} ${s("automatisations_60045")}`);const{data:c,loader:u,reload:m}=bl({organizationId:n,eventId:t,level:xn.Event}),g=(0,V.useMemo)(()=>c.organization?.segmentsFolders??[],[c.organization]),h=Uk(g);return u||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:Yj.WORKFLOWS_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(Lk,{canSegmentEdit:d,canWorkflowEdit:l,initialLimit:a?.workflowsLimit,initialSegmentsOpen:a?.areWorkflowsSegmentsOpen,reload:m,segmentsFolders:g,setLimit:e=>{r({workflowsLimit:e})},onSegmentClick:e=>{r({workflowsSegmentId:e})},onSegmentDelete:async()=>{await r({workflowsSegmentId:null}),e.replace(Yj.WORKFLOWS({organizationId:n,eventId:t}))},onSegmentsToggle:async e=>{await r({areWorkflowsSegmentsOpen:e})}})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:Yj.WORKFLOWS_SEGMENT({organizationId:n,eventId:t,segmentId:a?.workflowsSegmentId&&h.includes(a.workflowsSegmentId)?a.workflowsSegmentId:h[0]}),replace:!0})})]})},Bk=()=>{const{history:e,params:{organizationId:n},translate:t}=Kl(),{organization:s,localOrganization:o,updateLocalOrganization:a}=XS(),{canSegmentEdit:r,canWorkflowEdit:d}=ay();Au(`${s.name} ${t("automatisations_60045")}`);const{data:l,loader:c,reload:u}=bl({organizationId:n,level:xn.Organization}),m=(0,V.useMemo)(()=>l.organization?.segmentsFolders??[],[l.organization]),g=Uk(m);return c||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:Yj.WORKFLOWS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(Lk,{canSegmentEdit:r,canWorkflowEdit:d,initialLimit:o?.workflowsLimit,initialSegmentsOpen:o?.areWorkflowsSegmentsOpen,reload:u,segmentsFolders:m,setLimit:e=>{a({workflowsLimit:e})},onSegmentClick:e=>{a({workflowsSegmentId:e})},onSegmentDelete:async()=>{await a({workflowsSegmentId:null}),e.replace(Yj.WORKFLOWS({organizationId:n}))},onSegmentsToggle:async e=>{await a({areWorkflowsSegmentsOpen:e})}})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:Yj.WORKFLOWS_SEGMENT({organizationId:n,segmentId:o?.workflowsSegmentId&&g.includes(o.workflowsSegmentId)?o.workflowsSegmentId:g[0]}),replace:!0})})]})},Wk=e=>(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,flex:"1",...e.css},direction:"column",children:[(0,i.jsx)(Tl,{css:{flex:"1",padding:"$6"},direction:"column",gap:"2",children:e.children}),e.button&&(0,i.jsx)(Tl,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},justify:"end",children:e.button})]}),Gk=e=>(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray500 textSm regular",children:e.label}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:e.children})]}),qk=({workflow:e})=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Jm),a=ki(Bg),r=e=>o.toLocaleString(e.toLocal(),Uo.DateTime),d=g(e.createdBy.name)?e.createdBy.name:e.createdBy.email,l=(0,V.useMemo)(()=>Yo(e.accreditationsSlots)?lh(e.accreditationsSlots):[],[e.accreditationsSlots]),c=(0,V.useMemo)(()=>Yo(e.positionsSlots)?ah(a,[],[],e.positionsSlots):[],[e.positionsSlots]),u=(0,V.useMemo)(()=>e.segment?e.segment.segmentType===Bn.Delegations?s?yo.DELEGATIONS_SEGMENT(t,s,e.segment.id):yo.COMMUNITY_DELEGATIONS_SEGMENT(t,e.segment.id):s?yo.VOLUNTEERS_SEGMENT(t,s,e.segment.id):yo.COMMUNITY_USERS_SEGMENT(t,e.segment.id):null,[e.segment,t,s]),m=(0,V.useMemo)(()=>(e.data.customFields||[]).flatMap(n=>{const t=e.customFields?.find(({id:e})=>e===n.customFieldId);return t?[{name:t.name,value:n.value}]:[]}),[e.data.customFields,e.customFields]);return(0,i.jsx)(yy,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[e.state===gt.Error&&(0,i.jsxs)(lc,{alertStyle:"error",children:[(0,i.jsx)(cc,{children:n("une_erreur_est_38715")}),(0,i.jsx)(uc,{children:e.data.errorMessage})]}),(0,i.jsxs)(Tl,{gap:"4",width:1,children:[(e.trigger===ht.VolunteersSegment||e.trigger===ht.DelegationsSegment)&&e.segment&&(0,i.jsxs)(Wk,{children:[(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:e.trigger===ht.DelegationsSegment?n("nombre_de_d_l_g_65603"):n("nombre_de_membr_42906")}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayMd",fontWeight:"medium",children:e.segment.count})]}),(0,i.jsxs)(Wk,{children:[(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:n("Frequency")}),(0,i.jsxs)(Mr,{color:"gray900",fontWeight:"medium",children:[(0,i.jsx)(Mr,{as:"span",fontSize:"displayMd",children:TP(e.frequency)}),(0,i.jsx)(Mr,{as:"span",fontSize:"textXl",children:n("min_74949")})]})]})]}),(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(oT,{css:{borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},hideTitleBorder:!0,title:n("informations_g_79325"),children:(0,i.jsxs)(Tl,{gap:"7",wrap:"wrap",children:[(0,i.jsx)(Gk,{label:n("cr_e_par_30622"),children:(0,i.jsxs)(Tl,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$1",padding:"$1 $2 $1 6px"},gap:"2",children:[(0,i.jsx)(t_,{email:e.createdBy.email,image:e.createdBy.picture?.url,name:e.createdBy.name,size:16}),(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:d})]})}),(0,i.jsx)(Gk,{label:n("date_de_cr_atio_00749"),children:r(e.insertedAt)}),(0,i.jsx)(Gk,{label:n("derni_re_ex_cut_36102"),children:e.executedAt?.isValid?r(e.executedAt):"-"}),(0,i.jsx)(Gk,{label:n("State"),children:(0,i.jsx)(Ku,{...EP(e.state),children:n(e.state)})})]})}),(0,i.jsx)(oT,{css:{borderTop:"none",borderTopLeftRadius:"0",borderTopRightRadius:"0"},hideTitleBorder:!0,title:n("d_tails_de_l_au_28745"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(Gk,{label:n("initialisation_38640"),children:n(e.trigger)}),(e.trigger===ht.VolunteersSegment||e.trigger===ht.DelegationsSegment)&&(0,i.jsx)(Gk,{label:n("vue_s_lectionn_21556"),children:e.segment&&u?(0,i.jsx)(Xm,{to:u,children:e.segment.name}):"-"}),e.trigger===ht.FormSubmit&&(0,i.jsx)(Gk,{label:n("Form"),children:e.form?(0,i.jsx)(Xm,{to:$s.FORM({organizationId:t,eventId:s,formId:e.form.id}),children:e.form.name}):"-"}),Yo(e.positionsCategories)&&(0,i.jsx)(Gk,{label:n("cat_gories_24533"),children:(0,i.jsx)(Tl,{direction:"column",gap:"1",children:e.positionsCategories.map(e=>(0,i.jsx)(Xm,{to:oo.POSITION_CATEGORY({organizationId:t,eventId:s,positionCategoryId:e.id}),children:e.name},e.id))})}),Yo(e.positions)&&(0,i.jsx)(Gk,{label:n("missions_63972"),children:(0,i.jsx)(Tl,{direction:"column",gap:"1",children:e.positions.map(e=>(0,i.jsx)(Xm,{to:oo.POSITION({organizationId:t,eventId:s,positionId:e.id}),children:e.name},e.id))})}),Yo(e.triggerPositionsSlots)&&(0,i.jsx)(Gk,{label:n("cr_neaux_33401"),children:(0,i.jsx)(Tl,{direction:"column",gap:"1",children:e.triggerPositionsSlots.map(e=>(0,i.jsx)(Mr,{children:Zg(a,e,e.position.name,{position:{includeName:!0}})},e.id))})}),Yo(e.positionsSegments)&&(0,i.jsx)(Gk,{label:n("vues_50543"),children:(0,i.jsx)(Tl,{direction:"column",gap:"1",children:e.positionsSegments.map(e=>(0,i.jsx)(Mr,{children:e.name},e.id))})}),(0,i.jsx)(Gk,{label:n("action_44224"),children:n(e.action)}),e.action===rt.SendCampaign&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gk,{label:n("campagne_97871"),children:e.campaign?(0,i.jsx)(Xm,{to:Gj.CAMPAIGN({organizationId:t,eventId:s,campaignId:e.campaign.id}),children:e.campaign.name}):"-"}),(0,i.jsx)(Gk,{label:n("destinataires_19592"),children:e.data.recipients===ut.DelegationsLeaders?n("aux_responsable_38147"):e.data.recipients===ut.PositionsLeaders?n("aux_responsable_85620"):e.data.recipients===ut.UsersInfosIds?n("_certains_memb_91094"):n("aux_membres_de_71046")}),Yo(e.usersInfos)&&(0,i.jsx)(Gk,{label:n("liste_des_membr_89037"),children:(0,i.jsx)(Tl,{direction:"column",gap:"1",children:e.usersInfos.map(e=>(0,i.jsx)(Mr,{children:g(e.name)?e.name:e.email},e.id))})})]}),e.action===rt.SetCustomField&&(0,i.jsx)(Gk,{label:e.customField?n("nouvelle_valeur_39039",e.customField.name):n("CustomField"),children:e.customField?(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(wE,{field:e.customField,fields:{[e.customField.slug]:e.data.customFieldValue}}),e.data.addValues&&(0,i.jsx)(Mr,{font:"gray500 textSm regular",children:n("ajouter_les_val_22996")})]}):"-"}),(e.action===rt.AddAccreditations||e.action===rt.DeleteAccreditations)&&(0,i.jsx)(Gk,{label:n("accr_ditations_39450"),children:Yo(l)?(0,i.jsx)(Tl,{gap:"2",wrap:"wrap",children:l.map(e=>(0,i.jsx)(gA,{badge:e},e.id))}):"-"}),e.accreditationProfile&&(0,i.jsx)(Gk,{label:n("profil_d_accr_d_63000"),children:e.accreditationProfile.name}),(e.action===rt.AddPositions||e.action===rt.DeletePositions)&&(0,i.jsx)(Gk,{label:n("cr_neaux_33401"),children:Yo(c)?(0,i.jsx)(Tl,{gap:"2",wrap:"wrap",children:c.map(e=>(0,i.jsx)(gA,{badge:e},e.id))}):"-"}),e.action===rt.CreateDelegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gk,{label:n("d_l_gation_ut_74409"),children:e.delegation?(0,i.jsx)(Xm,{to:Js.DELEGATION({organizationId:t,eventId:s,delegationId:e.delegation.id}),children:e.delegation.name}):"-"}),(0,i.jsx)(Gk,{label:n("champ_utilise_04526"),children:e.customField?.name??"-"})]}),e.action===rt.AddEvent&&(0,i.jsx)(Gk,{label:n("_v_nement_22345"),children:e.addedEvent?(0,i.jsx)(Xm,{to:Rs.EVENT({organizationId:t,eventId:e.addedEvent.id}),children:e.addedEvent.name}):"-"}),e.action===rt.DuplicateMember&&(0,i.jsx)(Gk,{label:n("champs_91671"),children:Yo(m)?(0,i.jsx)(Tl,{direction:"column",gap:"1",children:m.map(({name:e,value:n})=>(0,i.jsxs)(Mr,{children:[e," : ",n]},e))}):"-"}),e.action===rt.DuplicateMember&&(0,i.jsx)(Gk,{label:n("e_mail_du_nouve_23523"),children:e.emailSourceCustomField?.name??n("e_mail_du_membr_16089")}),(e.action===rt.AddDelegationPermissions||e.action===rt.DeleteDelegationPermissions)&&(0,i.jsx)(Gk,{label:n("droits_73696"),children:Yo(e.data.permissions)?(0,i.jsx)(Tl,{gap:"2",wrap:"wrap",children:e.data.permissions.map(e=>(0,i.jsx)(Ku,{children:n(e)},e))}):"-"}),$P(e.trigger,e.action)&&(0,i.jsx)(Gk,{label:GP(n,e.trigger),children:e.onExit===lt.Revert?WP(n,e.action):n("ne_rien_faire_76456")})]})})]})]})})},Hk=()=>{const{translate:e,params:{organizationId:n,workflowId:t}}=Kl(),[s,o]=(0,V.useState)(0),{data:a,isLoading:r}=Li("query WorkflowHistories($organizationId: OrganizationId!, $workflowId: WorkflowId!, $offset: Int) {\n organization(id: $organizationId) {\n workflow(id: $workflowId) {\n histories(offset: $offset, limit: 25) {\n nodes {\n ...HistoryRow\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{organizationId:n,workflowId:t,offset:s},[$o.HistoryRowFragment]),{numberOfPages:d,totalCount:l}=Sx(a.organization?.workflow.histories);return(0,i.jsx)(yy,{children:(0,i.jsx)(HD,{getActionLabel:n=>e(`history_workflows_${n}`),histories:a.organization?.workflow.histories.nodes??[],isLoading:r,numberOfPages:d,offset:s,setOffset:o,totalCount:l})})},Yk=({reload:e,workflow:n})=>{const{history:t,params:{organizationId:s,eventId:o,workflowId:a},translate:r}=Kl(),{mutate:d}=Sl(),{mutate:l}=Cl(),[c,u]=(0,V.useState)(!1);return(0,i.jsx)(Cy,{breadcrumbs:(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:Yj.WORKFLOWS({organizationId:s,eventId:o}),children:r("automatisations_60045")}),(0,i.jsx)(AT,{isCurrent:!0,to:Yj.WORKFLOW({organizationId:s,eventId:o,workflowId:a}),children:n.name})]}),buttons:(0,i.jsxs)(ly,{permissions:sy.WORKFLOW_EDIT,children:[(0,i.jsx)(tc,{to:Yj.UPDATE({organizationId:s,eventId:o,workflowId:a}),children:r("_diter_62574")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"play",isDisabled:n.state===gt.Paused,onClick:async()=>{await l({organizationId:s,eventId:o,selecteds:{ids:[a]}}),e()},children:r("ex_cuter_54158")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:e}}=await d({organizationId:s,eventId:o,workflowId:a});t.push(Yj.UPDATE({organizationId:s,eventId:o,workflowId:e}))},children:r("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),u(!0)},children:r("supprimer_43083")})})]})]}),c&&(0,i.jsx)(Ak,{workflow:n,onClose:()=>u(!1),onSuccess:()=>t.replace(Yj.WORKFLOWS({organizationId:s,eventId:o}))})]}),name:n.name})},Zk=e=>{const{params:{organizationId:n,eventId:t,workflowId:s},translate:o}=Kl();Au(e.workflow.name);const a=e=>({organizationId:e?":organizationId":n,eventId:t?e?":eventId":t:void 0,workflowId:e?":workflowId":s});return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(Yk,{reload:e.reload,workflow:e.workflow}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:Yj.WORKFLOW_DASHBOARD(a(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:Yj.WORKFLOW_HISTORY(a(!1)),children:o("historique_06296")})]}),(0,i.jsx)($y,{path:Yj.WORKFLOW_DASHBOARD(a(!0)),children:(0,i.jsx)(qk,{workflow:e.workflow})}),(0,i.jsx)($y,{path:Yj.WORKFLOW_HISTORY(a(!0)),children:(0,i.jsx)(Hk,{})})]})]})},Kk=()=>{const{params:{organizationId:e,eventId:n,workflowId:t}}=Kl(),{data:s,loader:o,reload:a}=Li("query Workflow($organizationId: OrganizationId!, $workflowId: WorkflowId!) {\n organization(id: $organizationId) {\n workflow(id: $workflowId) {\n id\n name\n state\n trigger\n action\n frequency\n onExit\n executedAt\n insertedAt\n\n createdBy {\n email\n name\n picture {\n url\n }\n }\n\n data {\n addValues\n customFields\n customFieldValue\n errorMessage\n permissions\n recipients\n }\n\n accreditationProfile {\n id\n name\n }\n\n accreditationsSlots {\n ...AccreditationSlotVolunteerRegistration\n }\n\n addedEvent {\n id\n name\n }\n\n campaign {\n id\n name\n }\n\n customField {\n id\n name\n slug\n fieldType\n listType\n\n values {\n id\n value\n color\n }\n }\n\n customFields {\n id\n name\n }\n\n emailSourceCustomField {\n id\n name\n }\n\n delegation {\n id\n name\n }\n\n form {\n id\n name\n }\n\n positions {\n id\n name\n }\n\n positionsCategories {\n id\n name\n }\n\n positionsSegments {\n id\n name\n }\n\n positionsSlots {\n id\n name\n range\n\n position {\n id\n acronym\n color\n icon\n name\n }\n }\n\n segment {\n id\n name\n segmentType\n count(shouldCompute: true)\n }\n\n triggerPositionsSlots {\n id\n name\n range\n\n position {\n id\n name\n }\n }\n\n usersInfos {\n id\n name\n email\n }\n }\n }\n}\n",{organizationId:e,workflowId:t},[$o.AccreditationSlotVolunteerRegistrationFragment]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:Yj.WORKFLOW({organizationId:":organizationId",eventId:n?":eventId":void 0,workflowId:":workflowId"}),children:(0,i.jsx)(qi,{path:Yj.WORKFLOW_DASHBOARD({organizationId:e,eventId:n,workflowId:t}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(Zk,{reload:a,workflow:s.organization.workflow})})]})};let Xk=class extends Og{constructor(e,n,t){super(e,n,t)}getCampaignsFilters(e){return[{slug:"state",name:this.t("State"),category:this.t("Campaigns"),fieldType:nn.Select,values:zt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"campaign_type",name:this.t("type_35427"),category:this.t("Campaigns"),fieldType:nn.Select,values:Ot.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"created_by",name:this.t("cr_e_par_30622"),category:this.t("Campaigns"),fieldType:nn.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:nn.Date,hideEmpty:!0}]}};Xk=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],Xk);const Qk=()=>{const{translate:e,history:n,params:{organizationId:t}}=Kl();return(0,i.jsx)(kk,{children:(0,i.jsx)(ly,{permissions:sy.CAMPAIGN_SEND,children:(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"paper-plane",onClick:()=>{n.push(Gj.CREATE_TEMPLATE({organizationId:t}))},children:e("cr_er_un_mod_le_20298")}),onClick:()=>{n.push(Gj.CREATE({organizationId:t}))},children:e("cr_er_une_campa_96023")})})})};function Jk(e){switch(e){case je.Draft:return{color:"gray",leftIcon:"pen-ruler"};case je.Done:return{color:"success",leftIcon:"check"};case je.InProgress:return{color:"warning",leftIcon:"hourglass-empty"};case je.Scheduled:return{color:"primary",leftIcon:"calendar"};case je.Template:return{color:"purple",leftIcon:"paper-plane"};default:return Zl()}}const eF=e=>{const{history:n,translate:t}=Kl(),{showNotification:s}=AS(),{mutate:o}=function(e={}){return Ui("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:a}=function(e={}){return Ui("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:r}=function(e={}){return Ui("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)}(),[d,l]=(0,V.useState)(!1),c=e.campaign.state===je.Draft||e.campaign.state===je.Scheduled;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{n.push(Gj.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}))},children:t("_diter_62574")}),c&&(0,i.jsx)(Pu,{icon:"paper-plane",onClick:async()=>{await a({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),e.reload()},children:t("envoyer_26609")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{const{campaignDuplicate:{id:t}}=await o({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id});n.push(Gj.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:t}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),l(!0)},children:t("supprimer_43083")})})]}),d&&(0,i.jsx)(ow,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_58075"),text:t("suppression_de_73669",e.campaign.name),onClose:()=>{l(!1)},onDelete:async()=>{await r({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),s(t("la_campagne_1_92813",e.campaign.name)),e.reload()}})]})},nF=e=>{const{translate:n}=Kl(),t=ki(Jm),s=e.campaign.sentAt?.setZone(Oo.c9.local().zone);return(0,i.jsxs)(km,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{Tu(e.target)},children:[(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(Xm,{to:Gj.CAMPAIGN_DASHBOARD({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}),children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.campaign.name,children:e.campaign.name})}),e.campaign.state===je.Done&&s&&(0,i.jsx)(Mr,{color:"gray500",children:n("envoy_e_le_1_90336",t.toLocaleString(s,Uo.DateTime),e.campaign.createdBy?.nameOrEmail??"")}),e.campaign.state===je.Scheduled&&e.campaign.scheduledAt?.isValid&&(0,i.jsx)(Mr,{color:"gray500",children:n("programm_e_le_58279",t.toLocaleString(e.campaign.scheduledAt,Uo.DateOnly.MonthLong),t.toLocaleString(e.campaign.scheduledAt,Uo.TimeOnly))})]})}),(0,i.jsxs)($m,{css:{flex:"0 150px"},children:[(0,i.jsx)(Mr,{width:22,children:e.campaign.campaignType===ve.Email?(0,i.jsx)(Yl,{icon:"at"}):(0,i.jsx)(Yl,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsx)($m,{css:{flex:"0 200px",justifyContent:"flex-end"},children:e.campaign.numberOfRecipients}),(0,i.jsx)($m,{css:{flex:"0 150px",justifyContent:"flex-end"},children:e.campaign.campaignType===ve.Email?n("gratuit_13712"):`${e.campaign.cost} €`}),(0,i.jsx)($m,{css:{flex:"0 150px"},children:(0,i.jsx)(Ku,{...Jk(e.campaign.state),children:n(e.campaign.state)})}),(0,i.jsx)(Qm,{justify:"end",children:e.canCampaignSend&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",to:Gj.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id})})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(eF,{campaign:e.campaign,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})})]})};function tF(e,n){(0,V.useEffect)(()=>{let t=null;return e.some(e=>e.state===je.InProgress)&&(t=window.setInterval(n,3e4)),()=>{t&&clearInterval(t)}},[e])}const iF=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canCampaignSend:t}=ay(),{data:s,isLoading:o,limit:a,numberOfPages:r,offset:d,reload:l,setLimit:c,setOffset:u,setSort:m,sort:g,totalCount:h}=pg();return tF(s,l),(0,i.jsx)(Tl,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Tx,{"aria-busy":o,headerRow:(0,i.jsxs)(jm,{children:[(0,i.jsx)($x,{attribute:_e.Name,setSort:m,sort:g,children:e("nom_de_la_campa_45063")}),(0,i.jsx)($x,{attribute:_e.Type,setSort:m,sort:g,width:150,children:e("type_35427")}),(0,i.jsx)(Gm,{width:200,children:e("nombre_de_desti_21374")}),(0,i.jsx)(Gm,{width:150,children:e("co_t_68998")}),(0,i.jsx)($x,{attribute:_e.State,css:{flex:"0 150px"},setSort:m,sort:g,children:e("State")}),(0,i.jsx)(Gm,{width:100})]}),paginationRow:(0,i.jsx)(Fm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Pm,{limit:a,numberOfPages:r,offset:d,setLimit:c,setOffset:u,showLimits:!0,totalCount:h})}),children:o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{}),(0,i.jsx)(qm,{})]}):s.map(e=>(0,i.jsx)(nF,{campaign:e,canCampaignSend:t,eventId:null,organizationId:n,reload:l},e.id))})})},sF=()=>{const e=Fi();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qk,{}),(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{searchPlaceholder:e("rechercher_une_69554"),showActions:!1,showEditColumns:!1,showEditMode:!1,showSearchColumns:!1})}),(0,i.jsx)(iF,{})]})]})},oF=e=>{const{history:n,translate:t,params:{organizationId:s,segmentId:o}}=Kl(),{localOrganization:a,updateLocalOrganization:r}=XS(),{canSegmentEdit:d}=ay(),l=ki(Xk);return(0,i.jsx)(yk,{canSegmentEdit:d,filters:l.getCampaignsFilters(e.organization.admins.nodes),filtersButtonText:t("filtrer_les_cam_97457"),filtersSubtitle:t("appliquer_des_f_57442"),getSegmentPath:e=>Gj.CAMPAIGNS_SEGMENT({organizationId:s,segmentId:e}),initialLimit:a?.campaignsLimit??Tm,initialSegmentsOpen:a?.areCampaignsSegmentsOpen??!0,loadDataList:Sd,organizationId:s,possibleColumns:[],possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:Bn.Campaigns,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{r({campaignsLimit:e})},onSegmentClick:e=>{r({campaignsSegmentId:e})},onSegmentDelete:async()=>{await r({campaignsSegmentId:null}),n.replace(Gj.CAMPAIGNS({organizationId:s}))},onSegmentsToggle:async e=>{await r({areCampaignsSegmentsOpen:e})},children:(0,i.jsx)(sF,{})})},aF=()=>{const{params:{organizationId:e},translate:n}=Kl();Au(`${n("communaut_20896")} ${n("Campaigns")}`);const{localOrganization:t}=XS(),{data:s,loader:o,reload:a}=Li("query CampaignsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n admins: usersInfos(isResourceCreator: true) {\n nodes {\n userId\n nameOrEmail\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Campaigns) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e},[$o.SegmentsFoldersSegmentsFragment]),r=(0,V.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:Gj.CAMPAIGNS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(oF,{organization:s.organization,reload:a})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:Gj.CAMPAIGNS_SEGMENT({organizationId:e,segmentId:t?.campaignsSegmentId&&r.includes(t.campaignsSegmentId)?t?.campaignsSegmentId:r[0]}),replace:!0})})]})},rF=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{updateLocalOrganization:t}=XS(),{canCampaignRead:s,canFormRead:o,canDelegationRead:a,canWorkflowRead:r}=ay();return(0,i.jsxs)(Tz,{"aria-label":e("menu_communauta_47274"),children:[(0,i.jsx)($z,{replace:!1,to:hs.COMMUNITY_DASHBOARD({organizationId:n}),children:e("tableau_de_bord_24627")}),(0,i.jsx)($z,{isActive:e=>e.endsWith("/users")||null!==e.match(/\/users\/\d+/)||null!==e.match(/\/member\/\d+/),replace:!1,to:hs.COMMUNITY_USERS({organizationId:n}),onClick:()=>t({usersSegmentId:null}),children:e("vos_membres_38104")}),s&&(0,i.jsx)($z,{isActive:e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/community\/campaigns\/\d+/)||null!==e.match(/\/community\/campaign\/\d+/),replace:!1,to:Gj.CAMPAIGNS({organizationId:n}),onClick:()=>t({campaignsSegmentId:null}),children:e("Campaigns")}),o&&(0,i.jsx)($z,{isActive:e=>e.endsWith("/forms")||e.endsWith("/forms/create"),replace:!1,to:$s.FORMS({organizationId:n}),children:e("Form_plural")}),a&&(0,i.jsx)($z,{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:yo.COMMUNITY_DELEGATIONS(n),children:e("d_l_gations_78318")}),r&&(0,i.jsx)($z,{isActive:e=>e.endsWith("/workflows")||null!==e.match(/\/community\/workflows\/\d+/)||null!==e.match(/\/community\/workflow\/\d+/),replace:!1,to:Yj.WORKFLOWS({organizationId:n}),children:e("automatisations_60045")})]})},dF=e=>(0,i.jsx)(bR,{children:(0,i.jsxs)(eu,{gridtemplatecolumns:"auto",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(rF,{}),(0,i.jsx)(Mr,{css:{overflowY:"auto"},children:e.children})]})}),lF=({percent:e,prospectivePercent:n})=>(0,i.jsxs)(Mr,{css:{background:"$gray100",borderRadius:"$1",position:"relative"},height:8,width:1,children:[(0,i.jsx)(Mr,{css:{background:Yu(e),borderRadius:"$1",left:0,maxWidth:"100%",position:"absolute",top:0,width:100*e+"%"},height:1}),void 0!==n&&(0,i.jsx)(Mr,{css:{background:Yu(n),borderRadius:"$1",left:0,opacity:.4,maxWidth:"100%",position:"absolute",top:0,width:100*n+"%"},height:1})]}),cF=()=>{const e=Fi(),{organizationId:n}=Vi(),t=Bi(),{data:s,loader:o}=Li("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:n},[]),a=ki(Bg);return o||(0,i.jsxs)(Tl,{css:{margin:"auto"},direction:"column",height:1,width:"$container",children:[(0,i.jsx)(Pl,{height:"9"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("tableau_de_bord_24627")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:e("en_un_coup_d_oe_57288")}),(0,i.jsx)(Pl,{height:"9"}),(0,i.jsxs)(Tl,{gap:"6",width:1,children:[(0,i.jsx)(YT,{icon:"megaphone",iconColor:"primary",text:e("nombre_d_v_nem_14214"),value:s.organization.events.nodes.length}),(0,i.jsx)(YT,{icon:"user-group",iconColor:"purple",text:e("nombre_de_membr_08851"),value:s.organization.numberOfUsersInfos})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Gm,{children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(Gm,{width:200,children:e("nombre_de_missi_67304_plural")}),(0,i.jsx)(Gm,{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,QS.A)(e.assignedResources/e.resources*100);return(0,i.jsxs)(km,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{t.push(Rs.EVENT({organizationId:n,eventId:e.id}))},children:[(0,i.jsx)($m,{children:e.name}),(0,i.jsx)($m,{children:e.range?a.toDisplayString(e.range):"-"}),(0,i.jsx)($m,{width:200,children:e.numberOfPositions}),(0,i.jsx)($m,{children:e.resources>0?(0,i.jsxs)(Tl,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(lF,{percent:e.assignedResources/e.resources})}),(0,i.jsxs)(Mr,{color:"gray700",width:40,children:[s," %"]})]}):"-"})]},e.id)})}),setOffset:Bc.A,title:e("liste_des_v_ne_29929"),totalCount:0}),(0,i.jsx)(Pl,{height:"9"})]})};function uF(e,n,t){const[i,s]=(0,V.useState)(null);return(0,V.useCallback)(async()=>{if(i)return i;{const i=await e(n,await X()),o=t(i);return s(o),o}},[i,e,n])}const mF=V.createContext({}),gF=e=>{const n=uF(Ta,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?xn.Event:xn.Organization},e=>e.organization.campaigns.nodes),t=uF(Ta,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?xn.Event:xn.Organization},e=>e.organization.event?.customDocuments??[]),s=uF(Ta,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?xn.Event:xn.Organization},e=>e.organization.delegationsCategories.nodes),o=uF(Ta,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?xn.Event:xn.Organization},e=>e.organization.event?.delegationsSpaceLayouts??[]),a=uF(Ta,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?xn.Event:xn.Organization},e=>e.organization.forms.nodes),r=uF(Md,{organizationId:e.organizationId},e=>e.organization.delegations.nodes),d=uF(Ta,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?xn.Event:xn.Organization},e=>e.organization.tags.nodes);return(0,i.jsx)(mF.Provider,{value:{getCampaigns:n,getCustomDocuments:t,getDelegationsCategories:s,getEditPath:e.getEditPath,getShowPath:e.getShowPath,getDelegationsSpaceLayouts:o,getForms:a,getParentDelegations:r,getTags:d},children:e.children})};function hF(){return V.useContext(mF)}const pF=e=>{const{translate:n,params:{organizationId:t}}=Kl(),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(hn.Add),[d,l]=(0,V.useState)([]),[c,u]=(0,V.useState)(e.roles[0]?.id??null),[m,g,h]=Wm(""),{usersInfosOptions:p,isLoading:I}=my({organizationId:t,eventId:null,hasSelected:Yo(d),nameDebounced:g,userInfoIds:d}),x=Yo(d);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"user-gear",children:n("_diter_les_resp_29588")}),(0,i.jsxs)(hx,{gap:"6",children:[(0,i.jsxs)(Up,{label:n("que_souhaitez_v_87607"),value:a,onChange:r,children:[(0,i.jsx)("option",{value:hn.Add,children:n("ajouter_des_res_84773")}),(0,i.jsx)("option",{value:hn.Replace,children:n("remplacer_les_r_60774")}),(0,i.jsx)("option",{value:hn.Delete,children:n("supprimer_des_r_69379")})]}),(0,i.jsx)(_m,{isSearchLoading:I,isSearchVisible:!0,label:n("reponsable_82458_plural"),multiple:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_05904"),state:"search",value:m,onChange:h}),values:d,onChange:l,children:p}),e.showRoleSelect&&a!==hn.Delete&&(0,i.jsx)(Up,{label:n("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)(gx,{children:(0,i.jsx)(tc,{disabled:!x,isLoading:s,onClick:async()=>{o(!0),await e.onSuccess(a,d.map(e=>({userInfoId:e,roleId:c}))),e.onClose(),o(!1)},children:n("_diter_62574")})})]})})};let IF=class extends Sw{translationService;inputName="massAccreditationsProfiles";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsProfiles:zc.YO().of(zc.Ik().shape({accreditationProfileId:zc.ai().required(),maxResources:zc.gl().nullable(),willAutoAccredit:zc.zM().required()})).required(this.t("vous_devez_s_le_98277")).min(1,this.t("vous_devez_s_le_98277"))}}};IF=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],IF);const xF=e=>{const n=Fi();return(0,i.jsx)(bw,{handleSubmit:e.handleSubmit,nextText:n("suivant_accr_25709"),prefix:"massAccreditationsProfiles.",strategies:[{label:n("ajouter_des_pro_03108"),value:hn.Add},{label:n("remplacer_les_p_03034"),value:hn.Replace},{label:n("supprimer_des_p_90440"),value:hn.Delete}]})},fF=e=>{const n=Fi(),{data:t,loader:s}=Qa({eventId:e.eventId}),{accreditationsProfiles:o,strategy:a}=e.values.massAccreditationsProfiles,r=(0,V.useMemo)(()=>t.event?.accreditationsProfilesCategories??[],[t.event]),d=(0,V.useMemo)(()=>gb(r),[r]),l=(0,V.useMemo)(()=>o.map(e=>e.accreditationProfileId),[o]),c=(0,V.useCallback)(n=>{const t=n.filter(e=>!o.some(n=>n.accreditationProfileId===e)),i=o.filter(e=>n.includes(e.accreditationProfileId)).concat(t.map(e=>({accreditationProfileId:e,willAutoAccredit:!0})));e.change("massAccreditationsProfiles.accreditationsProfiles",i)},[o,e.change]);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ab,{accreditationsProfiles:o,accreditationsProfilesCategories:r,change:e.change,hideActions:a===hn.Delete,prefix:"massAccreditationsProfiles."}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:n("ajouter_des_pro_61834")}),values:l,onChange:c,children:d}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n(a===hn.Add?"ajouter_les_pro_81094":a===hn.Replace?"remplacer_les_p_72074":"supprimer_les_p_65703",e.numberOfSelected)})})]})},_F=e=>{const n=Fi(),t=ki(IF),{mutate:s}=function(e={}){return Ui("mutation DelegationsMassAccreditationsProfilesEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $massAccreditationsProfiles: MassDelegationsAccreditationsProfilesInput!\n) {\n numberOfDelegations: delegationsMassAccreditationsProfilesEdit(\n organizationId: $organizationId\n eventId: $eventId\n massAccreditationsProfiles: $massAccreditationsProfiles\n )\n}\n",e)}();return(0,i.jsx)(Cw,{children:(0,i.jsx)(Hx,{category:n("d_l_gations_78318"),heading:n("_diter_les_prof_19479"),onClose:e.onClose,children:(0,i.jsx)(Gx,{children:(0,i.jsxs)(vS,{initialValues:{massAccreditationsProfiles:{accreditationsProfiles:[],selecteds:e.selecteds,strategy:hn.Add}},isEdit:!1,onSubmit:async t=>{const i=(await s({organizationId:e.organizationId,eventId:e.eventId,massAccreditationsProfiles:t.massAccreditationsProfiles})).numberOfDelegations;e.onSuccess(n("les_profils_d_a_85146",i)),e.onClose()},children:[(0,i.jsx)(jS,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(xF,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(jS,{heading:n("profils_d_accr_27825"),render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(fF,{change:n.change,eventId:e.eventId,handleSubmit:t,numberOfSelected:e.numberOfSelected,submitting:s,values:o}),schema:t.step2Schema()})]})})})})};let jF=class extends Sw{translationService;inputName="massAccreditationsSlots";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsSlots:zc.YO().of(zc.Ik().shape({accreditationCategoryId:zc.ai().required(),accreditationId:zc.ai().required(),accreditationSlotId:zc.ai().required(),isDefault:zc.zM().required(),isVisible:zc.zM().required(),maxResources:zc.gl().nullable()})).required(this.t("vous_devez_s_le_72138")).min(1,this.t("vous_devez_s_le_72138"))}}};jF=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],jF);const vF=e=>{const n=Fi();return(0,i.jsx)(bw,{handleSubmit:e.handleSubmit,nextText:n("suivant_accr_25709"),prefix:"massAccreditationsSlots.",strategies:[{label:n("ajouter_des_acc_17744"),value:hn.Add},{label:n("remplacer_les_a_92733"),value:hn.Replace},{label:n("supprimer_des_a_04246"),value:hn.Delete}]})},SF="massAccreditationsSlots.",yF=e=>{const n=Fi(),t=ki(Jm),{data:s,loader:o}=Li("query DelegationsMassAccreditationsSlotsEvent($eventId: EventId!) {\n event(id: $eventId) {\n ...EventAccreditations\n }\n}\n",{eventId:e.eventId},[$o.EventAccreditationsFragment]);const{massAccreditationsSlots:a}=e.values,{strategy:r}=a,d=(0,V.useMemo)(()=>s.event?.accreditationsCategories??[],[s.event]),l=(0,V.useMemo)(()=>Bh(t,d),[t,d]),c=(0,V.useMemo)(()=>new Map(d.flatMap(e=>e.accreditations.flatMap(n=>n.slots.map(t=>[t.id,{accreditationCategoryId:e.id,accreditationId:n.id}])))),[d]),u=(0,V.useMemo)(()=>a.accreditationsSlots.map(e=>e.accreditationSlotId),[a.accreditationsSlots]),m=(0,V.useCallback)(n=>{const{accreditationsSlots:t}=a,i=n.filter(e=>!t.some(n=>n.accreditationSlotId===e)),s=t.filter(e=>n.includes(e.accreditationSlotId)).concat(i.flatMap(e=>{const n=c.get(e);return n?[{...n,accreditationSlotId:e,isDefault:!1,isVisible:!0}]:[]}));fb(a,s,SF,e.change)},[a,e.change,c]);return o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yb,{accreditationCategories:d,change:e.change,delegationAccreditations:a,prefix:SF,selectedAccreditationsSlotsIds:e.values.selectedAccreditationsSlotsIds}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:n("AddAccreditations")}),values:u,onChange:m,children:l}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n(r===hn.Add?"ajouter_les_acc_92457":r===hn.Replace?"remplacer_les_a_11676":"supprimer_les_a_19773",e.numberOfSelected)})})]})},CF=e=>{const n=Fi(),t=ki(jF),{mutate:s}=function(e={}){return Ui("mutation DelegationsMassAccreditationsSlotsEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $massAccreditationsSlots: MassDelegationsAccreditationsSlotsInput!\n) {\n numberOfDelegations: delegationsMassAccreditationsSlotsEdit(\n organizationId: $organizationId\n eventId: $eventId\n massAccreditationsSlots: $massAccreditationsSlots\n )\n}\n",e)}();return(0,i.jsx)(Cw,{children:(0,i.jsx)(Hx,{category:n("d_l_gations_78318"),heading:n("_diter_les_accr_86042"),onClose:e.onClose,children:(0,i.jsx)(Gx,{children:(0,i.jsxs)(vS,{initialValues:{massAccreditationsSlots:{accreditationsCategories:[],accreditations:[],accreditationsSlots:[],selecteds:e.selecteds,strategy:hn.Add},selectedAccreditationsSlotsIds:[]},isEdit:!1,onSubmit:async t=>{const i=(await s({organizationId:e.organizationId,eventId:e.eventId,massAccreditationsSlots:t.massAccreditationsSlots})).numberOfDelegations;e.onSuccess(n("les_accr_ditati_58186",i)),e.onClose()},children:[(0,i.jsx)(jS,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(vF,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(jS,{heading:n("accr_ditations_39450"),render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(yF,{change:n.change,eventId:e.eventId,handleSubmit:t,numberOfSelected:e.numberOfSelected,submitting:s,values:o}),schema:t.step2Schema()})]})})})})},bF=e=>{const{setNodeRef:n,style:t,handleProps:s}=up(e.column.slug);return(0,i.jsxs)(Tl,{ref:n,align:"center",css:{background:"white",border:"1px solid $gray200",borderTop:"none",px:"$4","&:first-child":{borderTop:"1px solid $gray200",borderTopLeftRadius:"$1",borderTopRightRadius:"$1"},"&:last-child":{borderBottomLeftRadius:"$1",borderBottomRightRadius:"$1"}},gap:"3",height:40,style:t,children:[(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"grab"},...s,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(Mr,{color:"gray800",children:e.column.name})]})},AF=e=>(0,i.jsx)(_p,{ids:e.selectedColumns.map(e=>e.slug),onReorder:(n,t)=>{e.setSelectedColumns(Qo(e.selectedColumns,n,t))},children:(0,i.jsx)(Tl,{css:{background:"$gray50",bd:"gray200 1",padding:"$4"},direction:"column",children:e.selectedColumns.map(e=>(0,i.jsx)(bF,{column:e},e.slug))})}),EF=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Oh),{data:a}=Li("query MassColumnsCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:t,eventId:s},[$o.OrganizationCustomFieldsFragment]),{mutate:r,isLoading:d}=$a(),l=(0,V.useMemo)(()=>o.getDelegationMembersPossibleColumns(t,a.organization?.customFields.nodes??[],{forDelegationsSpace:!1,isWeezeventConnected:!0,positionDisplay:Fn.Position,slotDisplay:Ln.Custom}),[t,o,a.organization]),[c,u]=(0,V.useState)(""),m=(0,V.useMemo)(()=>l.filter(e=>!g(c)||e.name.trim().toLowerCase().includes(c.trim().toLowerCase())),[l,c]),[h,p]=(0,V.useState)([]);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"line-columns",children:n("_diter_les_colo_38837")}),(0,i.jsxs)(hx,{gap:"2",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("quelles_colonne_05047")}),Yo(h)&&(0,i.jsx)(AF,{selectedColumns:h,setSelectedColumns:p}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:n("ajouter_des_col_04043")})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:400,children:(0,i.jsxs)(Tl,{css:{py:"$3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Mr,{css:{px:"$3"},children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_c_86475"),state:"search",value:c,onChange:u})}),(0,i.jsx)(Mr,{css:{maxHeight:"300px",overflowY:"auto",px:"$3"},children:m.map(e=>(0,i.jsx)(um,{isCheckbox:!0,isRadio:!1,isSelected:h.includes(e),value:e.slug,onClick:()=>{p(n=>Ko(n,e,!n.includes(e)))},children:e.name},e.slug))})]})})]})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{isLoading:d,onClick:async()=>{const i=(await r({organizationId:t,eventId:s,massEdit:{reset:!1,selecteds:e.selecteds,slug:ze.Columns,strategy:hn.Replace,value:h.map(e=>e.slug)}})).numberOfEdited;e.onSuccess(n("les_colonnes_de_83023",i)),e.onClose()},children:n("mettre_jour_85141")})})]})})},wF=e=>{const{translate:n}=Kl(),{mutate:t,isLoading:s}=function(e={}){return Ui("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,a]=(0,V.useState)([]),[r,d]=(0,V.useState)([]),{data:l}=Li("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?xn.Organization:xn.Event,eventId:o[0]},[]);const c=(!!e.eventId||Yo(o))&&Yo(r);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"clone"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("copier_les_d_l_43406")}),e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("cela_liera_vos_60643")})]}),(0,i.jsx)(Pl,{height:"7"}),!e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:n("_v_nement_22345"),values:o,onChange:a,children:(l.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pl,{height:"4"})]}),(e.eventId||Yo(o))&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(_m,{isSearchVisible:!0,label:n("formulaire_ut_59771"),values:r,onChange:d,children:(l.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:!c,isLoading:s,onClick:async()=>{const i=(await t({organizationId:e.organizationId,eventId:e.eventId,massMove:{eventId:e.eventId?null:o[0],formId:r[0],selecteds:e.selecteds}})).numberOfDelegations;e.onSuccess(n("_1_d_l_gations_15078",i)),e.onClose()},children:n("copier_75889")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},$F=()=>{const e=Fi(),{canDelegationEdit:n}=oy(),{massActions:t,predicates:s}=pg(),{eventId:o,onMassEditSuccess:a,organizationId:r,segment:d}=ok(),{showNotification:l}=AS(),{mutate:c}=$a(),{mutate:u}=function(e={}){return Ui("mutation DelegationsMassLeadersEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massLeaders: MassLeadersInput!\n) {\n numberOfDelegations: delegationsMassLeadersEdit(\n organizationId: $organizationId\n eventId: $eventId\n massLeaders: $massLeaders\n )\n}\n",e)}(),{mutate:m}=Dd(),{mutate:h}=Rd(),[p,I]=(0,V.useState)(!1),[x,f]=(0,V.useState)(!1),[_,j]=(0,V.useState)(!1),[v,S]=(0,V.useState)(!1),[y,C]=(0,V.useState)(!1),[b,A]=(0,V.useState)(!1),[E,w]=(0,V.useState)(!1),$=t.getSelectedsInput(s,null),T=t.isAllSelected?d.count:t.numberOfSelected,z=(0,V.useCallback)(e=>{g(e)&&l(e),a()},[a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{onClick:()=>{I(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[n&&(0,i.jsx)(Pu,{icon:"clone",onClick:()=>f(!0),children:e(o?"copier_dans_la_91936":"copier_dans_un_20230")}),n&&(0,i.jsx)(Pu,{icon:"user-gear",onClick:()=>j(!0),children:e("_diter_les_resp_29588")}),n&&(0,i.jsx)(Pu,{icon:"paper-plane",onClick:()=>(async()=>{const n=(await m({organizationId:r,eventId:o,selecteds:$})).numberOfDelegations;z(e("l_e_mail_d_invi_63545",n))})(),children:e("envoyer_l_e_mai_17491")}),n&&(0,i.jsx)(Pu,{icon:"line-columns",onClick:()=>S(!0),children:e("_diter_les_colo_38837")}),n&&o&&(0,i.jsx)(Pu,{icon:"badge-check",onClick:()=>A(!0),children:e("_diter_les_accr_86042")}),n&&o&&(0,i.jsx)(Pu,{icon:"badge-check",onClick:()=>C(!0),children:e("_diter_les_prof_19479")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>w(!0),children:e("supprimer_43083")})})]})]}),p&&(0,i.jsx)(fw,{eventId:o,mutate:e=>c({organizationId:r,eventId:o,massEdit:e}),organizationId:r,selecteds:$,onClose:()=>{I(!1)},onSuccess:n=>{z(e("_1_d_l_gations_08105",n))}}),x&&(0,i.jsx)(wF,{eventId:o,organizationId:r,selecteds:$,onClose:()=>{f(!1)},onSuccess:a}),_&&(0,i.jsx)(pF,{roles:[],showRoleSelect:!1,onClose:()=>j(!1),onSuccess:async(n,t)=>{const i=(await u({organizationId:r,eventId:o,massLeaders:{leaders:t,strategy:n,selecteds:$}})).numberOfDelegations;z(e("les_responsable_32087",i))}}),b&&o&&(0,i.jsx)(CF,{eventId:o,numberOfSelected:T,organizationId:r,selecteds:$,onClose:()=>A(!1),onSuccess:z}),y&&o&&(0,i.jsx)(_F,{eventId:o,numberOfSelected:T,organizationId:r,selecteds:$,onClose:()=>C(!1),onSuccess:z}),v&&(0,i.jsx)(EF,{selecteds:$,onClose:()=>S(!1),onSuccess:z}),E&&(0,i.jsx)(ow,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_34990")],text:e("suppression_de_99024",T),onClose:()=>{w(!1)},onDelete:async()=>{const n=(await h({organizationId:r,eventId:o,selecteds:$})).numberOfDelegations;z(e("_1_d_l_gations_40887",n))}})]})},TF=e=>{const n=Fi(),t=ki(Rv);return(0,i.jsxs)(Tl,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(Mr,{children:n("_1_2_membres_04485",e.assignedResources,t.toNumberOrInfinity(e.resources))}),(0,i.jsx)(lF,{percent:e.assignedResources/(e.resources||e.assignedResources)})]})},zF=e=>{const n=(0,V.useMemo)(()=>(e.delegation.children||[]).flatMap(e=>e.event?[{id:e.event.id,color:"gray",icon:null,text:e.event.name}]:[]),[e.delegation]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},OF=(0,i.jsx)(Ql,{});function RF(e){const[n,t]=(0,V.useState)(!0),[i,s]=(0,V.useState)(null);return(0,V.useEffect)(()=>{e().then(e=>{s(e),t(!1)},()=>{t(!1)})},[]),{isLoading:n,loader:n?OF:null,result:i}}const DF=e=>{const n=Fi(),{getDelegationsSpaceLayouts:t}=hF(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("DelegationsSpaceLayout")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(_m,{label:n("DelegationsSpaceLayout"),renderOnPortal:!0,shouldParseAsInt:!0,values:"number"==typeof e.value?[e.value]:[],onChange:n=>{Yo(n)?e.setValue(n[0]):e.setValue(null)},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},MF=e=>{const{eventId:n,organizationId:t}=ok(),{mutate:s}=$a();return(0,i.jsx)(sA,{column:e.column,initialValue:e.initialValue,mutate:async i=>s({organizationId:t,eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:e.property,strategy:hn.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},PF=e=>(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationsSpaceLayout?.id,property:ze.DelegationsSpaceLayout,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(DF,{setValue:n,value:e}),renderValue:e.delegation.delegationsSpaceLayout?e.delegation.delegationsSpaceLayout.name:"-"}),kF=e=>{const n=Fi(),{getParentDelegations:t}=hF(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("d_l_gation_de_l_86100")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("d_l_gation_de_l_86100"),renderOnPortal:!0,shouldParseAsInt:!0,values:"number"==typeof e.value?[e.value]:[],onChange:n=>{Yo(n)?e.setValue(n[0]):e.setValue(null)},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},FF=e=>{const{params:{organizationId:n}}=Kl(),{isEditMode:t}=pg();return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.delegation.parent?.id,property:ze.Parent,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(kF,{setValue:n,value:e}),renderValue:()=>e.delegation.parent?(0,i.jsx)(Rk,{isEditMode:t,title:e.delegation.parent.name,updatable:!0,children:(0,i.jsx)(Xm,{to:Js.DELEGATION({organizationId:n,delegationId:e.delegation.parent.id}),children:e.delegation.parent.name})}):""})},NF=e=>{const n=(0,V.useMemo)(()=>(e.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlot),[e.delegation]),t=(0,V.useMemo)(()=>lh(n),[n]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:t,doNotSort:!0})})},LF=e=>{const n=(0,V.useMemo)(()=>bA((e.delegation.accreditationsProfiles||[]).map(e=>e.accreditationProfile)),[e.delegation]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n,doNotSort:!0})})},UF=e=>{const{translate:n}=Kl(),{getCampaigns:t}=hF(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("tags_79499")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("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))})},VF=e=>{const n=(0,V.useMemo)(()=>e.delegation.campaigns||[],[e.delegation]),t=(0,V.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:n.map(e=>e.id),property:ze.Campaigns,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(UF,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(pA,{badges:t})})},BF=e=>{const{translate:n}=Kl(),{getDelegationsCategories:t}=hF(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("Category")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Up,{label:n("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))})},WF=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),{isEditMode:s}=pg();return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationCategory.id,property:ze.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(BF,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:s,title:e.delegation.delegationCategory.name,updatable:!0,children:(0,i.jsx)(Xm,{to:Js.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})})},GF=e=>{const n=(0,V.useMemo)(()=>(0,Lm.A)(e.delegation.delegationCategory.leaders,e=>u(e.userInfo.nameOrEmail)).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.delegation]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},qF=e=>{const n=Fi(),t=ki(Jm);return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.delegation.deadlineDate,property:ze.DeadlineDate,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Wp,{label:n("date_limite_d_i_79779"),value:e,onChange:t}),renderValue:e.delegation.deadlineDate?t.toLocaleString(e.delegation.deadlineDate,Uo.DateOnly.MonthLong):"-"})},HF=e=>{const n=Fi();return(0,i.jsx)(dg,{buttons:(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("fermer_62479")}),size:"md",onClose:e.onClose,children:(0,i.jsx)(Tl,{css:{overflowY:"auto"},direction:"column",gap:"2",children:(0,i.jsx)(Rf,{text:e.text})})})},YF={clamp:"2",wordBreak:"break-word"},ZF=e=>{const{isEditMode:n}=pg(),[t,s]=(0,V.useState)(!1),o=(0,V.useMemo)(()=>(e.text||"").replace(/<\/(p|div|li|ul|ol|h[1-6]|blockquote|tr)\s*>/gi," ").replace(/<(br|hr)\s*\/?>/gi," ").replace(/<[^>]*>/g,"").replace(/&(#\d+|#x[0-9a-f]+|[a-z]+);/gi,(e,n)=>n.startsWith("#x")||n.startsWith("#X")?String.fromCodePoint(parseInt(n.slice(2),16)):n.startsWith("#")?String.fromCodePoint(parseInt(n.slice(1),10)):p[n.toLowerCase()]??e).replace(/\s+/g," ").trim(),[e.text]),a=!g(o),r=(0,V.useCallback)(async n=>{await e.mutate(n),e.reload()},[e.mutate,e.reload]),d=(0,V.useCallback)(()=>a?"-":(0,i.jsx)(Mr,{css:YF,children:o}),[a,o]);return n&&e.updatable?(0,i.jsx)(iA,{column:e.column,initialValue:e.text||"",renderInput:(n,t)=>(0,i.jsx)(Mr,{css:{overflow:"hidden auto"},width:1,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:(0,i.jsx)(tS,{initialValue:n,label:e.column.name,onChange:t})}),renderValue:d,onSave:r}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($m,{css:{border:"2px solid transparent",cursor:a?"default":"pointer"},minWidth:e.column.minWidth,width:e.column.width,onClick:e=>{a||(jc(e),s(!0))},children:d()}),t&&(0,i.jsx)(HF,{text:e.text,onClose:()=>{s(!1)}})]})},KF=e=>{const{eventId:n,organizationId:t}=ok(),{mutate:s}=$a(),o=(0,V.useCallback)(i=>s({organizationId:t,eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:ze.Description,strategy:hn.Replace,value:i}}),[t,n,e.delegation.id,s]);return(0,i.jsx)(ZF,{column:e.column,mutate:o,reload:e.reload,text:e.delegation.description,updatable:!0})},XF=e=>{const{translate:n}=Kl(),{getCustomDocuments:t}=hF(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("tags_79499")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("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))})},QF=e=>{const n=(0,V.useMemo)(()=>e.delegation.customDocuments||[],[e.delegation]),t=(0,V.useMemo)(()=>n.map(e=>({id:e.slug,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:n.map(e=>e.slug),property:ze.Documents,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(XF,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(pA,{badges:t})})},JF=e=>{const n=Fi(),{getForms:t}=hF(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("Form")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Up,{label:n("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))})},eN=e=>(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.delegation.form.id,property:ze.Form,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(JF,{setValue:n,value:e}),renderValue:e.delegation.form.name}),nN=e=>{const n=Fi();return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.delegation.lockedAt?.isValid??!1,property:ze.IsLocked,reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Up,{label:n("IsLocked"),shouldParseAsBoolean:!0,value:e,onChange:t,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]}),renderValue:e.delegation.lockedAt?.isValid?n("oui_54361"):n("non_33516")})},tN=e=>{const n=(0,V.useMemo)(()=>(0,Lm.A)(e.delegation.leaders,e=>u(e.nameOrEmail)).map(e=>({id:e.id,color:"gray",icon:null,text:e.nameOrEmail})),[e.delegation]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},iN=e=>{const n=Fi(),t=ki(Rv);return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.delegation.maxResources||"",property:ze.MaxResources,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("MaxResources"),shouldParseAsInt:!0,value:e,onChange:t}),renderValue:t.toNumberOrInfinity(e.delegation.maxResources)})},sN=e=>{const{translate:n}=Kl(),{isEditMode:t}=pg(),{getShowPath:s}=hF();return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.delegation.name,property:ze.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("nom_de_la_d_l_g_28087"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:t,title:e.delegation.name,updatable:!0,children:(0,i.jsx)(Xm,{to:s(e.delegation.id),children:(0,i.jsx)(Mr,{css:{clamp:2},title:e.delegation.name,children:e.delegation.name})})})})},oN=e=>{const n=Fi();return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:e.value,property:e.property,reload:e.reload,renderInput:(t,s)=>(0,i.jsxs)(Up,{label:e.label,shouldParseAsBoolean:!0,value:t,onChange:s,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]}),renderValue:e.value?n("oui_54361"):n("non_33516")})},aN=e=>{const{translate:n}=Kl(),{getTags:t}=hF(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("tags_79499")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("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))})},rN=e=>{const n=(0,V.useMemo)(()=>e.delegation.tags||[],[e.delegation]),t=(0,V.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(MF,{column:e.column,delegation:e.delegation,initialValue:n.map(e=>e.id),property:ze.Tag,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(aN,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(pA,{badges:t})})},dN=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{mutate:o}=$a(),a=(0,V.useCallback)((n,t)=>o({organizationId:e.organizationId,eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:t,strategy:hn.Replace,value:n}}),[e.row,o]),r=(0,V.useMemo)(()=>yf({organizationId:t,eventId:s,delegationId:e.row.id,formId:e.row.form.id}),[e.row]),d=(0,V.useMemo)(()=>Sf(t,Js.DELEGATION({organizationId:t,eventId:s,delegationId:e.row.id})),[e.row]);return e.column.slug===jh.Id?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===jh.Name?(0,i.jsx)(sN,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.Description?(0,i.jsx)(KF,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.DelegationCategory?(0,i.jsx)(WF,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.State?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ku,{...sC(e.row.state),children:n(e.row.state)})}):e.column.slug===jh.Leaders?(0,i.jsx)(tN,{column:e.column,delegation:e.row}):e.column.slug===jh.CategoryLeaders?(0,i.jsx)(GF,{column:e.column,delegation:e.row}):e.column.slug===jh.Form?(0,i.jsx)(eN,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.FormLink?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Xm,{to:r,children:r})}):e.column.slug===jh.DelegationSpaceLink?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Xm,{to:d,children:d})}):e.column.slug===jh.DeadlineDate?(0,i.jsx)(qF,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.MaxResources?(0,i.jsx)(iN,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.AssignedResources?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(TF,{assignedResources:e.row.numberOfResources,resources:e.row.maxResources})}):e.column.slug===jh.Tags?(0,i.jsx)(rN,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.FillingRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===jh.CreatedBy?(0,i.jsx)(Tk,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===jh.ShowInDelegation?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("ShowInDelegationSpace"),property:ze.ShowInDelegationSpace,reload:e.reloadRow,value:e.row.showInDelegationSpace}):e.column.slug===jh.CanLeadersAddMembers?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("CanLeadersAddMembers"),property:ze.CanLeadersAddMembers,reload:e.reloadRow,value:e.row.canLeadersAddMembers}):e.column.slug===jh.CanLeadersDeleteMembers?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("CanLeadersDeleteMembers"),property:ze.CanLeadersDeleteMembers,reload:e.reloadRow,value:e.row.canLeadersDeleteMembers}):e.column.slug===jh.CanLeadersDuplicateMembers?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("CanLeadersDuplicateMembers"),property:ze.CanLeadersDuplicateMembers,reload:e.reloadRow,value:e.row.canLeadersDuplicateMembers}):e.column.slug===jh.CanLeadersEditColumns?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("CanLeadersEditColumns"),property:ze.CanLeadersEditColumns,reload:e.reloadRow,value:e.row.canLeadersEditColumns}):e.column.slug===jh.CanLeadersEditMembers?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("CanLeadersEditMembers"),property:ze.CanLeadersEditMembers,reload:e.reloadRow,value:e.row.canLeadersEditMembers}):e.column.slug===jh.CanLeadersEditCustomFields?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("CanLeadersEditCustomFields"),property:ze.CanLeadersEditCustomFields,reload:e.reloadRow,value:e.row.canLeadersEditCustomFields}):e.column.slug===jh.CanLeadersImportMembers?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("CanLeadersImportMembers"),property:ze.CanLeadersImportMembers,reload:e.reloadRow,value:e.row.canLeadersImportMembers}):e.column.slug===jh.CanLeadersSeeHiddenAccreditationsSlots?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("CanLeadersSeeHiddenAccreditationsSlots"),property:ze.CanLeadersSeeHiddenAccreditationsSlots,reload:e.reloadRow,value:e.row.canLeadersSeeHiddenAccreditationsSlots}):e.column.slug===jh.ShowFormLinkInDelegationSpace?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("afficher_le_lie_05841"),property:ze.ShowFormLinkInDelegationSpace,reload:e.reloadRow,value:e.row.showFormLinkInDelegationSpace}):e.column.slug===jh.DelegationsSpaceLayout?(0,i.jsx)(PF,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.ShowAllAccreditations?(0,i.jsx)(oN,{column:e.column,delegation:e.row,label:n("ShowAllAccreditations"),property:ze.ShowAllAccreditations,reload:e.reloadRow,value:e.row.showAllAccreditations}):e.column.slug===jh.IsLocked?(0,i.jsx)(nN,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.CreatedAt?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===jh.Accreditations?(0,i.jsx)(NF,{column:e.column,delegation:e.row}):e.column.slug===jh.AccreditationsProfiles?(0,i.jsx)(LF,{column:e.column,delegation:e.row}):e.column.slug===jh.Campaigns?(0,i.jsx)(VF,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.Documents?(0,i.jsx)(QF,{column:e.column,delegation:e.row,reload:e.reloadRow}):"events"===e.column.slug?(0,i.jsx)(zF,{column:e.column,delegation:e.row}):e.column.slug===jh.Parent?(0,i.jsx)(FF,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===jh.UsedCustomFieldsFilled?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:n(e.row.usedCustomFieldsFilled?.toString()||"-")}):(0,i.jsx)(jA,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:a,reload:e.reloadRow,updatable:!0})},lN=e=>{const{history:n,translate:t}=Kl(),{getEditPath:s}=hF(),{mutate:o}=Td(),[a,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",to:s(e.delegation.id),children:t("_diter_62574")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{const{delegationDuplicate:t}=await o({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegation.id});n.push(s(t.id))},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:async()=>{r(!0)},children:t("supprimer_43083")})})]}),a&&(0,i.jsx)(MT,{delegation:e.delegation,onClose:()=>{r(!1)},onSuccess:e.reload})]})},cN=e=>{const{getEditPath:n}=hF(),t=Kb(e.customFields);return(0,i.jsx)(kx,{getEditPath:e=>n(e.id),renderCell:(n,s,o)=>(0,i.jsx)(dN,{column:n,customField:t.get(n.slug),eventId:e.eventId,organizationId:e.organizationId,reloadRow:o,row:s}),renderRowDropdown:(n,t)=>(0,i.jsx)(lN,{delegation:n,eventId:e.eventId,organizationId:e.organizationId,reload:t})})},uN=()=>{const{history:e,translate:n,params:{organizationId:t}}=Kl();return(0,i.jsx)(kk,{children:(0,i.jsx)(ly,{permissions:sy.DELEGATION_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{e.push(yo.COMMUNITY_CREATE_DELEGATION(t))},children:n("cr_er_une_d_l_g_23035")})})})},mN=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{canDelegationEdit:s,canSegmentEdit:o}=ay(),{limit:a}=pg(),{segment:r}=ok();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(uN,{}),0===e.numberOfDelegations?(0,i.jsx)(yy,{css:{overflow:"hidden"},children:(0,i.jsx)(Tl,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(UE,{title:n("vous_n_avez_pas_32103")})})}):(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:(0,i.jsx)($F,{}),searchPlaceholder:n("rechercher_une_31213"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:o}),selectSegment:(0,i.jsx)(ap,{allSelectedText:n("les_1_d_l_gat_04594",r.count,r.name),pageSelectedText:n("les_1_d_l_gat_27248",a),selectAllText:n("s_lectionner_le_71777",r.count,r.name)})}),(0,i.jsx)(cN,{customFields:e.customFields,eventId:null,organizationId:t})]})]})},gN={level:xn.Organization},hN=e=>{const{history:n,params:{organizationId:t,segmentId:s},translate:o}=Kl();Au(`${o("communaut_20896")} ${o("d_l_gations_78318")}`);const{localOrganization:a,updateLocalOrganization:r}=XS(),{canDelegationEdit:d,canSegmentEdit:l}=ay(),c=ki(Sh),u=(0,V.useMemo)(()=>c.getDelegationsFilters(t,null,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.organization,t]),m=(0,V.useMemo)(()=>c.getDelegationsPossibleColumns(null,e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(gF,{eventId:null,getEditPath:e=>ss(Js.DELEGATION({organizationId:t,delegationId:e})),getShowPath:e=>Js.DELEGATION({organizationId:t,delegationId:e}),organizationId:t,children:(0,i.jsx)(yk,{canSegmentEdit:l,columnsToIncludes:vh,filters:u,filtersButtonText:o("filtrer_les_d_l_04628"),filtersSubtitle:o("appliquer_des_f_65318"),getSegmentPath:e=>yo.COMMUNITY_DELEGATIONS_SEGMENT(t,e),hideSegments:0===e.organization.numberOfDelegations,initialLimit:a?.delegationsLimit??Tm,initialSegmentsOpen:a?.areDelegationsSegmentsOpen??!0,loadDataList:zd,loadDataListParams:gN,loadRow:Od,organizationId:t,possibleColumns:m,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:Bn.Delegations,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{r({delegationsLimit:e})},showMassActions:d,showRowDropdown:d,showRowEdit:d,onSegmentClick:e=>{r({delegationsSegmentId:e})},onSegmentDelete:async()=>{await r({delegationsSegmentId:null}),n.replace(yo.COMMUNITY_DELEGATIONS(t))},onSegmentsToggle:async e=>{await r({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(mN,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.organization.numberOfDelegations})})})},pN=()=>{const{history:e,params:{organizationId:n}}=Kl(),{localOrganization:t}=XS(),{data:s,loader:o,reload:a}=Li("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:n},[$o.SegmentCustomFieldFragment,$o.SegmentsFoldersSegmentsFragment]),r=(0,V.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_DELEGATIONS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(hN,{organization:s.organization,reload:a})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{onLoad:()=>{const i=t?.delegationsSegmentId&&r.includes(t.delegationsSegmentId)?t?.delegationsSegmentId:r[0];e.replace(yo.COMMUNITY_DELEGATIONS_SEGMENT(n,i))}})})]})},IN=()=>{const{hasFeature:e}=XS();return e(Ze.Delegation)?(0,i.jsx)(pN,{}):(0,i.jsx)(Tl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Vj,{icon:"people-group"})})},xN=e=>{const n=Fi(),{isLoading:t,copy:s}=cS();return(0,i.jsxs)(Mr,{children:[(0,i.jsx)(Mr,{color:"gray700",css:e.css,children:e.title}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsx)(wc,{css:{"& .h-styled-input-container":{background:"white"}},hint:e.hint,state:"disabled",value:e.link,onChange:Bc.A}),(0,i.jsx)(tc,{color:e.buttonColor,isLoading:t,leftIcon:"copy",onClick:()=>s(e.link),children:n("copier_75889")})]})]})},fN=br("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"}}),_N=({isOpen:e,onClose:n,link:t})=>{const s=Fi(),o=Ni();return(0,i.jsx)(xx,{isOpen:e,onClose:n,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"plug-circle-bolt",subtitle:s("exporter_votre_81734"),onClose:n,children:s("export_de_votre_02014")}),(0,i.jsx)(hx,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{css:{marginBottom:"$5"},children:(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:s("limites_des_exp_03687")}),(0,i.jsx)(uc,{children:(0,i.jsxs)(fN,{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)(xN,{buttonColor:"primary",css:{fontWeight:500},link:t,title:s("lien_d_api_pour_98778")}),(0,i.jsx)(xN,{buttonColor:"primary",css:{fontWeight:500},link:`=IMPORTDATA("${t}")`,title:s("import_de_la_vu_17175")})]})})]})})},jN=e=>{const n=Fi(),[t,s]=(0,V.useState)(He.Excel),[o,a]=(0,V.useState)("unchecked");return(0,i.jsx)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"file-xls",subtitle:n("exporter_votre_28801"),children:n("exporter_vos_me_10045")}),(0,i.jsxs)(hx,{gap:"3",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("parameters_de_votre_export")}),(0,i.jsxs)(Tl,{direction:"column",gap:"5",children:[(0,i.jsxs)(Up,{label:n("format_de_lexport"),value:t,onChange:s,children:[(0,i.jsx)("option",{value:He.Excel,children:"Excel (.xslx)"}),(0,i.jsx)("option",{value:He.Csv,children:"CSV (.csv)"})]}),e.showIncludeFiles&&(0,i.jsx)(om,{state:o,onClick:a,children:n("inclure_dans_l_65554")})]})]}),(0,i.jsx)(gx,{children:()=>(0,i.jsx)(tc,{onClick:()=>{e.requestExport(t,"checked"===o),e.onClose()},children:n("recevoir_l_expo_53392")})})]})})},vN=({organizationKey:e})=>{const{history:n,translate:t,params:{organizationId:s,segmentId:o}}=Kl(),{user:a}=Yi(),{columns:r}=pg(),{segment:d}=ok(),{mutate:l}=function(e={}){return Ui("mutation UsersInfosExport(\n $organizationId: OrganizationId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $includeFiles: Boolean!\n $columns: [String!]!\n) {\n jobId: usersInfosExport(\n organizationId: $organizationId\n segmentId: $segmentId\n format: $format\n includeFiles: $includeFiles\n columns: $columns\n )\n}\n",e)}(),[c,u]=(0,V.useState)(!1),[m,g]=(0,V.useState)(!1),{checkExport:h}=AS();return(0,i.jsxs)(kk,{children:[(0,i.jsx)(ly,{permissions:sy.MEMBER_CREATE,children:(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"file-import",onClick:()=>{n.push(yo.COMMUNITY_VOLUNTEERS_IMPORT(s))},children:t("importer_via_un_61623")}),path:Rj.CREATE({organizationId:s}),children:t("ajouter_un_memb_33261")})}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(ly,{permissions:sy.MEMBER_CREATE,children:(0,i.jsx)(Pu,{icon:"merge",onClick:()=>{n.push(yo.COMMUNITY_USERS_DUPLICATES(s))},children:t("g_rer_les_doubl_39469")})}),(0,i.jsx)(Pu,{icon:"plug-circle-bolt",onClick:e=>{Tu(e.target),u(!0)},children:t("exporter_via_l_09843")}),(0,i.jsx)(Pu,{icon:"file-xls",onClick:e=>{Tu(e.target),g(!0)},children:t("exporter_en_exc_51862")}),(0,i.jsx)(ly,{permissions:sy.MEMBER_CREATE,children:(0,i.jsx)(Pu,{icon:"file-import",onClick:()=>{n.push(yo.COMMUNITY_FILES_IMPORT(s))},children:t("importer_des_do_55420")})})]})]}),(0,i.jsx)(_N,{isOpen:c,link:Af({organizationId:s,eventId:void 0,lang:a?.language,pathComponent:`members/${o}`,key:e}),onClose:()=>{u(!1)}}),(0,i.jsx)(jN,{isOpen:m,requestExport:async(e,n)=>{const{jobId:t}=await l({organizationId:s,segmentId:d.id,format:e,includeFiles:n,columns:r});h(t,s)},showIncludeFiles:!0,onClose:()=>{g(!1)}})]})},SN=e=>{const{params:{organizationId:n}}=Kl(),t=Kb(e.customFields);return(0,i.jsx)(kx,{getEditPath:e=>yo.COMMUNITY_EDIT_USER(n,e.id),renderCell:(e,n,s)=>(0,i.jsx)(f$,{column:e,customField:t.get(e.slug),reloadRow:s,row:n,updatable:!0})})};var yN;!function(e){e[e.Delegations=0]="Delegations",e[e.DelegationsCategories=1]="DelegationsCategories",e[e.Positions=2]="Positions",e[e.PositionsCategories=3]="PositionsCategories"}(yN||(yN={}));const CN=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.level??(e.eventId?xn.Event:xn.Both),[e.eventId,e.level]),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(null),[d,l,c]=Wm("");(0,V.useEffect)(()=>{(async()=>{if(o(!0),e.resource===yN.Delegations){const{organization:s}=await(n={organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:t,name:g(l)?l:void 0,ids:e.ids},i=await X(),oa(la,{variables:n,token:i||void 0,fragments:[]}));r(s)}else if(e.resource===yN.DelegationsCategories){const{organization:n}=await function(e,n){return oa('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:n||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:t,name:g(l)?l:void 0,ids:e.ids},await X());r(n)}else if(e.resource===yN.Positions){const{organization:n}=await function(e,n){return oa(ca,{variables:e,token:n||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:g(l)?l:void 0,ids:e.ids},await X());r(n)}else if(e.resource===yN.PositionsCategories){const{organization:n}=await function(e,n){return oa('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:n||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:g(l)?l:void 0,ids:e.ids},await X());r(n)}var n,i;o(!1)})()},[t,l,e.eventId,e.hasSelected,e.organizationId,e.resource]);const u=(0,V.useMemo)(()=>{if(a){const n=(0,Lm.A)((0,Rg.A)(a.list.nodes.concat(a.selected.nodes),e=>e.id),e=>e.name.toLowerCase());return t!==xn.Both&&e.eventId?n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)):Object.values((0,fm.A)(n,e=>e.event?.id??-1)).map(e=>{const n=e[0];return(0,i.jsx)("optgroup",{label:n.event?.name??a.name,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n.event?.id??-1)})}return(0,i.jsx)(i.Fragment,{})},[e.eventId,t,a]);return(0,i.jsx)(_m,{isSearchLoading:s,isSearchVisible:!0,menuWidth:e.menuWidth,renderOnPortal:!0,searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_50038"),state:"search",value:d,onChange:c}),values:e.ids,onChange:e.onChange,children:u})},bN=e=>{const{translate:n,params:{organizationId:t}}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:e.accessScope===se.DelegationCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(se.DelegationCategory),children:n("r_le_sur_une_ca_31475")}),e.accessScope===se.DelegationCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(CN,{hasSelected:!0,ids:[e.resourceId],level:xn.Event,menuWidth:600,organizationId:t,resource:yN.DelegationsCategories,onChange:n=>{Yo(n)&&e.setResourceId(n[0])}})}),(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Up,{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))})})]})]})]})},AN=e=>{const{translate:n,params:{organizationId:t}}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:e.accessScope===se.Delegation?"checked":"unchecked",onClick:()=>e.setAccessScope(se.Delegation),children:n("r_le_sur_une_d_10967")}),e.accessScope===se.Delegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},gap:"4",children:(0,i.jsx)(CN,{hasSelected:!0,ids:[e.resourceId],level:xn.Both,organizationId:t,resource:yN.Delegations,onChange:n=>{Yo(n)&&e.setResourceId(n[0])}})})]})]})},EN=e=>{const{translate:n}=Kl(),{organization:t}=XS(),s=(0,V.useMemo)(()=>(0,Lm.A)(t.events.nodes,e=>u(e.name)).map(e=>{const n=3444===t.id?`${e.name} (${e.fields.cf61867})`:e.name;return(0,i.jsx)("option",{value:e.id,children:n},e.id)}),[t.events]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:e.accessScope===se.Event?"checked":"unchecked",onClick:()=>e.setAccessScope(se.Event),children:n("r_le_sur_un_v_89523")}),e.accessScope===se.Event&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(_m,{isSearchVisible:!0,menuWidth:600,renderOnPortal:!0,shouldParseAsInt:!0,values:[e.resourceId],onChange:n=>{Yo(n)&&e.setResourceId(n[0])},children:s})}),(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Up,{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))})})]})]})]})},wN=e=>{const{translate:n,params:{organizationId:t}}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:e.accessScope===se.PositionCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(se.PositionCategory),children:n("r_le_sur_une_ca_13181")}),e.accessScope===se.PositionCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(CN,{hasSelected:!0,ids:[e.resourceId],menuWidth:600,organizationId:t,resource:yN.PositionsCategories,onChange:n=>{Yo(n)&&e.setResourceId(n[0])}})}),(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Up,{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))})})]})]})]})},$N=e=>{const{translate:n,params:{organizationId:t}}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:e.accessScope===se.Position?"checked":"unchecked",onClick:()=>e.setAccessScope(se.Position),children:n("r_le_sur_une_mi_92313")}),e.accessScope===se.Position&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(CN,{hasSelected:!0,ids:[e.resourceId],menuWidth:600,organizationId:t,resource:yN.Positions,onChange:n=>{Yo(n)&&e.setResourceId(n[0])}})}),(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Up,{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))})})]})]})]})},TN=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1})]}),zN=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{organization:s,roles:o}=XS(),{mutate:a,isLoading:r}=function(e={}){return Ui("mutation UserAccessMassCreate(\n $organizationId: OrganizationId!\n $massAccessCreate: MassAccessCreateInput!\n) {\n numberOfEdited: userAccessMassCreate(\n organizationId: $organizationId\n massAccessCreate: $massAccessCreate\n )\n}\n",e)}(),{data:d,isLoading:l}=Li('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:t},[]),[c,u]=(0,V.useState)(se.Organization),[m,g]=(0,V.useState)(o.organizationRoles[0].id),[h,p]=(0,V.useState)(-1),I=e=>{e===se.Organization?g(o.organizationRoles[0].id):e===se.Event?(g(o.eventRoles[0].id),p(s.events.nodes[0].id)):e===se.Delegation?(g(-1),p(d.organization.delegations.nodes[0].id)):e===se.DelegationCategory?(g(o.delegationCategoryRoles[0].id),p(d.organization.delegationsCategories.nodes[0].id)):e===se.Position?(g(o.positionRoles[0].id),p(d.organization.positions.nodes[0].id)):e===se.PositionCategory&&(g(o.positionRoles[0].id),p(d.organization.positionsCategories.nodes[0].id)),u(e)};return(0,i.jsxs)(xx,{isOpen:e.isOpen,onClose:e.onClose,children:[!e.hideTrigger&&(0,i.jsx)(fx,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:n("ajouter_un_r_le_19073")})}),(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"user-lock",children:n("ajouter_un_r_le_19073")}),(0,i.jsx)(hx,{children:l?(0,i.jsx)(TN,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cm,{state:c===se.Organization?"checked":"unchecked",onClick:()=>I(se.Organization),children:n("r_le_sur_l_orga_15663")}),c===se.Organization&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Up,{shouldParseAsInt:!0,value:m,onChange:g,children:o.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),Yo(s.events.nodes)&&(0,i.jsx)(EN,{accessScope:c,eventRoles:o.eventRoles,resourceId:h,roleId:m,setAccessScope:I,setResourceId:p,setRoleId:g}),Yo(d.organization?.delegations.nodes)&&(0,i.jsx)(AN,{accessScope:c,resourceId:h,setAccessScope:I,setResourceId:p}),Yo(d.organization?.delegationsCategories.nodes)&&(0,i.jsx)(bN,{accessScope:c,delegationCategoryRoles:o.delegationCategoryRoles,resourceId:h,roleId:m,setAccessScope:I,setResourceId:p,setRoleId:g}),Yo(d.organization?.positions.nodes)&&(0,i.jsx)($N,{accessScope:c,positionRoles:o.positionRoles,resourceId:h,roleId:m,setAccessScope:I,setResourceId:p,setRoleId:g}),Yo(d.organization?.positionsCategories.nodes)&&(0,i.jsx)(wN,{accessScope:c,positionCategoryRoles:o.positionRoles,resourceId:h,roleId:m,setAccessScope:I,setResourceId:p,setRoleId:g})]})}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{isLoading:r,onClick:async()=>{const n=(await a({organizationId:t,massAccessCreate:{resourceId:c===se.Organization?t:h,roleId:c===se.Delegation?void 0:m,scope:c,selecteds:{ids:e.usersInfosIds}}})).numberOfEdited;e.onSuccess?.(n),e.onClose()},children:n("ajouter_97327")})})]})]})},ON=e=>{const n=Fi(),{mutate:t,isLoading:s}=dr(),{mutate:o,isLoading:a}=fl(),[r,d]=(0,V.useState)([]),[l,c]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{if(e.eventId){const n=await ur({eventId:e.eventId},await X());d(n.event.delegations.nodes)}else{const i=await(n={organizationId:e.organizationId},t=await X(),oa("query MassDelegationAddOrganizationDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:n,token:t||void 0,fragments:[]}));d(i.organization.delegations.nodes)}var n,t})()},[e.organizationId,e.eventId]),(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("ajouter_des_mem_60880")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("Delegation"),values:l,onChange:c,children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{isLoading:s||a,onClick:async()=>{if(Yo(l)){let i=0;const s=r.find(e=>e.id===l[0]);i=e.eventId?(await t({eventId:e.eventId,selecteds:e.selecteds,delegationId:l[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,delegationId:l[0]})).numberOfMembers,e.onSuccess(n("_1_membres_ont_51715",i,s.name)),e.onClose()}},children:n("ajouter_97327")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},RN=e=>{const{translate:n}=Kl(),{mutate:t,isLoading:s}=function(e={}){return Ui("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:a}=function(e={}){return Ui("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:r}=Nd({organizationId:e.organizationId,level:e.eventId?xn.Event:xn.Organization,eventId:e.eventId}),d=(0,V.useMemo)(()=>r.organization?.forms.nodes??[],[r.organization]),[l,c]=(0,V.useState)([]),u=Yo(l);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("ajouter_des_mem_81812")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("Form"),values:l,onChange:c,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:!u,isLoading:s||a,onClick:async()=>{if(Yo(l)){let i=0;const s=d.find(e=>e.id===l[0]);i=e.eventId?(await t({eventId:e.eventId,selecteds:e.selecteds,formId:l[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:l[0]})).numberOfMembers,e.onSuccess(n("le_formulaire_11679",s.name,i)),e.onClose()}},children:n("ajouter_97327")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},DN=e=>{const n=Fi(),{mutate:t,isLoading:s}=function(e={}){return Ui("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:a}=function(e={}){return Ui("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:r}=Nd({organizationId:e.organizationId,level:e.eventId?xn.Event:xn.Organization,eventId:e.eventId}),d=(0,V.useMemo)(()=>r.organization?.forms.nodes??[],[r.organization]),[l,c]=(0,V.useState)([]),u=Yo(l);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"file-lines"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("marquer_un_form_10633")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("Form"),values:l,onChange:c,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(lc,{alertStyle:"error",children:(0,i.jsx)(uc,{children:e.eventId?n("cette_action_su_82938"):n("cette_action_su_88097")})}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{color:"error",disabled:!u,isLoading:s||a,onClick:async()=>{if(Yo(l)){let i=0;const s=d.find(e=>e.id===l[0]);i=e.eventId?(await t({eventId:e.eventId,selecteds:e.selecteds,formId:l[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:l[0]})).numberOfMembers,e.onSuccess(n("le_formulaire_87510",s.name,i)),e.onClose()}},children:n("marquer_comme_n_20227")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})};let MN=class extends Rc{constructor(e){super(e)}massAddEventInputSchema(){return zc.Ik().shape({massAddEvent:zc.Ik().shape({eventId:zc.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})})}massAddEventSchema(){return zc.Ik().shape({eventId:zc.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})}};MN=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],MN);const PN=e=>{const n=Fi(),t=ki(MN),{mutate:s}=function(e={}){return Ui("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:a}=ka({organizationId:e.organizationId}),[r,d]=(0,V.useState)(""),l=(0,V.useMemo)(()=>g(r)?(o.organization?.events.nodes??[]).filter(e=>e.name.trim().toLowerCase().includes(r.trim().toLowerCase())):o.organization?.events.nodes??[],[o.organization,r]);return(0,i.jsxs)(tb,{buttonText:n("ajouter_le_memb_03343",e.numberOfSelected),icon:"sliders",initialValues:{massAddEvent:{eventId:null,selecteds:e.selecteds}},schema:t.massAddEventInputSchema(),size:"md",title:n("ajouter_les_mem_13940"),onClose:e.onClose,onSubmit:async t=>{const i=l.find(e=>e.id===t.massAddEvent.eventId),o=(await s({organizationId:e.organizationId,massAddEvent:t.massAddEvent})).numberOfMembers;e.onSuccess(n("_1_membres_ont_83814",o,i.name)),e.onClose()},children:[(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_40024"),value:r,onChange:d}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",children:n("sur_quel_v_nem_31606")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Tl,{css:{overflowY:"auto"},direction:"column",gap:"3",children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$2",height:54}),(0,i.jsx)(Qu,{borderRadius:"$2",height:54})]}):l.map(e=>(0,i.jsx)(qz,{label:e.name,name:"massAddEvent.eventId",value:e.id},e.id))})]})},kN=e=>{const n=Fi(),{data:t,loader:s}=Li("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}=yd(),[a,r]=(0,V.useState)(null);return(0,i.jsxs)(tb,{buttonText:n("fusionner_les_92573",e.numbersOfSelected),icon:"sliders",initialValues:{},size:"md",title:n("fusion_de_membr_34256"),onClose:e.onClose,onSubmit:async()=>{null!==a&&(await o({organizationId:e.organizationId,eventId:e.eventId,mainUserInfoId:a,toMergeUsersInfosIds:e.usersInfosIds.filter(e=>e!==a)}),e.onSuccess(n("_1_membres_ont_74574",e.usersInfosIds.length)),e.onClose())},children:[(0,i.jsx)(lc,{alertStyle:"gray",children:(0,i.jsx)(uc,{children:n("toutes_les_info_39932",e.numbersOfSelected)})}),"number"==typeof t.organization?.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(lc,{alertStyle:"warning",children:(0,i.jsx)(uc,{children:n("if_you_merge_me_62641")})})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("quel_membre_sou_80665")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",gap:"4",children:s||t.organization.usersInfos.nodes.map((e,t)=>{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)(V.Fragment,{children:[0!==t&&(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{r(e.id)},children:[(0,i.jsx)(lm,{shouldPreventDefault:!1,state:a===e.id?"checked":"unchecked",onClick:Bc.A}),(0,i.jsx)(t_,{email:e.email,image:e.picture?.url,name:e.name,size:48}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:g(e.name)?e.name:"-"}),(0,i.jsx)(Mr,{color:"gray500",children:e.email}),(0,i.jsx)(Tl,{gap:"2",wrap:"wrap",children:s.map(e=>(0,i.jsxs)(V.Fragment,{children:[e.numberOfAccreditations>0&&(0,i.jsx)(Ku,{css:{height:"fit-content"},leftIcon:"badge-check",children:n("_1_2_accred_26410",e.eventName,e.numberOfAccreditations)}),e.numberOfAssignments>0&&(0,i.jsx)(Ku,{css:{height:"fit-content"},leftIcon:"location-dot",children:n("_1_2_assign_03225",e.eventName,e.numberOfAssignments)})]},e.eventId))})]})]})]},e.id)})})]})},FN=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{showNotification:s}=AS(),{canOrganizationUserEdit:o}=ay(),{mutate:a}=Ra(),{mutate:r}=function(e={}){return Ui("mutation UsersInfosMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassDelete(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{hasFeature:d}=XS(),{data:l}=Li("query UsersActions($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hasDelegations\n hasEvents\n hasForms\n }\n}\n",{organizationId:t},[]),[c,u]=(0,V.useState)(!1),[m,h]=(0,V.useState)(!1),[p,I]=(0,V.useState)(!1),[x,f]=(0,V.useState)(!1),[_,j]=(0,V.useState)(!1),[v,S]=(0,V.useState)(!1),[y,C]=(0,V.useState)(!1),[b,A]=(0,V.useState)(!1),[E,w]=(0,V.useState)(!1),$=e.massActions.getSelectedsInput(e.predicates,null),T=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,z=(0,V.useCallback)(n=>{g(n)&&s(n),e.onMassEditSuccess()},[e.onMassEditSuccess]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{onClick:()=>{u(!0)},children:n("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsxs)(lw,{title:n("gestion_des_mem_51660"),children:[(0,i.jsx)(Pu,{icon:"plus",isDisabled:!l.organization?.hasEvents,onClick:()=>h(!0),children:n("ajouter_1_membr_25541",T)}),(0,i.jsx)(Pu,{icon:"merge",onClick:()=>I(!0),children:n("fusionner_les_m_37150")}),o&&(0,i.jsx)(Pu,{icon:"shield",onClick:()=>f(!0),children:n("ajouter_un_r_le_82872",T)})]}),(0,i.jsx)(lw,{title:n("accr_ditations_39450"),children:d(Ze.Delegation)&&(0,i.jsx)(Pu,{icon:"people-group",isDisabled:!l.organization?.hasDelegations,onClick:()=>S(!0),children:l.organization?.hasDelegations?n("ajouter_1_mem_86218",T):n("cette_organisat_48937")})}),(0,i.jsxs)(lw,{title:n("communication_05277"),children:[(0,i.jsx)(Pu,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>C(!0),children:n("ajouter_1_mem_52947",T)}),(0,i.jsx)(Pu,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>A(!0),children:n("marquer_un_form_10633")}),(0,i.jsx)(Pu,{icon:"paper-plane",onClick:()=>w(!0),children:n("SendCampaign")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>j(!0),children:n("supprimer_43083")})})]})]}),c&&(0,i.jsx)(_w,{mutate:e=>a({organizationId:t,massEdit:e}),organizationId:t,selecteds:$,onClose:()=>{u(!1)},onSuccess:e=>{z(n("_1_membres_ont_07596",e))}}),m&&(0,i.jsx)(PN,{numberOfSelected:T,organizationId:t,selecteds:$,onClose:()=>{h(!1)},onSuccess:z}),p&&(0,i.jsx)(kN,{eventId:null,numbersOfSelected:T,organizationId:t,usersInfosIds:e.massActions.selectedsIds,onClose:()=>I(!1),onSuccess:z}),x&&(0,i.jsx)(zN,{isOpen:!0,usersInfosIds:e.massActions.selectedsIds,onClose:()=>f(!1),onSuccess:e=>{z(n("le_r_le_a_t_a_95295",e))}}),_&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_65177"),n("cette_action_es_45424")],text:n("suppression_de_57689",T),onClose:()=>j(!1),onDelete:async()=>{const e=(await r({organizationId:t,selecteds:$})).numberOfMembers;z(n("_1_membres_ont_13170",e))}}),y&&(0,i.jsx)(RN,{eventId:null,organizationId:t,selecteds:$,onClose:()=>C(!1),onSuccess:z}),b&&(0,i.jsx)(DN,{eventId:null,organizationId:t,selecteds:$,onClose:()=>A(!1),onSuccess:z}),v&&(0,i.jsx)(ON,{eventId:null,organizationId:t,selecteds:$,onClose:()=>S(!1),onSuccess:z}),E&&(0,i.jsx)(Ww,{eventId:null,organizationId:t,selecteds:$,onClose:()=>w(!1),onSuccess:z})]})},NN=({customFields:e,organizationKey:n})=>{const t=Fi(),{canMemberEdit:s,canSegmentEdit:o}=ay(),{limit:a,massActions:r,predicates:d,reload:l}=pg(),{onMassEditSuccess:c,segment:u}=ok();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vN,{organizationKey:n,reload:l}),(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:(0,i.jsx)(FN,{massActions:r,predicates:d,showOnlyMassEdit:!1,totalNumberOfMembers:u.count,onMassEditSuccess:c}),searchPlaceholder:t("rechercher_un_m_05904"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:o}),selectSegment:(0,i.jsx)(ap,{allSelectedText:t("les_1_membres_56748",u.count,u.name),pageSelectedText:t("les_1_membres_00895",a),selectAllText:t("s_lectionner_le_71777",u.count,u.name)})}),(0,i.jsx)(SN,{customFields:e})]})]})},LN=e=>{const{history:n,translate:t,params:{organizationId:s,segmentId:o}}=Kl(),{localOrganization:a,updateLocalOrganization:r}=XS(),{canMemberEdit:d,canSegmentEdit:l}=ay(),c=ki(I$),u=(0,V.useMemo)(()=>c.getOrganizationUsersFilters(s,o,e.organization),[e.organization]),m=(0,V.useMemo)(()=>c.getOrganizationUsersPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(yk,{canSegmentEdit:l,columnsToIncludes:p$,filters:u,filtersButtonText:t("filtrer_les_mem_49255"),filtersSubtitle:t("appliquer_des_f_48814"),getSegmentPath:e=>yo.COMMUNITY_USERS_SEGMENT(s,e),initialLimit:a?.usersLimit??Tm,initialSegmentsOpen:a?.areUsersSegmentsOpen??!0,loadDataList:Ya,loadRow:qa,organizationId:s,possibleColumns:m,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:Bn.Volunteers,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{r({usersLimit:e})},showMassActions:d,showRowEdit:d,onSegmentClick:e=>{r({usersSegmentId:e})},onSegmentDelete:async()=>{await r({usersSegmentId:null}),n.replace(hs.COMMUNITY_USERS({organizationId:s}))},onSegmentsToggle:async e=>{await r({areUsersSegmentsOpen:e})},children:(0,i.jsx)(NN,{customFields:e.organization.customFields.nodes,organizationKey:e.organization.key})})},UN=()=>{const{params:{organizationId:e},translate:n}=Kl();Au(`${n("communaut_20896")} ${n("membres_11310")}`);const{localOrganization:t}=XS(),{data:s,loader:o,reload:a}=Li("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:Ee.All},[$o.SegmentCustomFieldFragment,$o.SegmentsFoldersSegmentsFragment]);const r=(0,V.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_USERS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(LN,{organization:s.organization,reload:a})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.COMMUNITY_USERS_SEGMENT(e,t?.usersSegmentId&&r.includes(t.usersSegmentId)?t?.usersSegmentId:r[0]),replace:!0})})]})},VN=e=>{const{translate:n,params:{organizationId:t}}=Kl(),s=ki(CC),{mutate:o,isLoading:a}=yd(),r=(0,V.useMemo)(()=>Object.fromEntries(e.displayColumns.flatMap(n=>{const t=e.customFields.find(e=>e.slug===n);return t?[[n,t]]:[]})),[e.customFields,e.displayColumns]);return(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(tc,{color:"primary",isLoading:a,size:"sm",onClick:async()=>{await o({organizationId:t,mainUserInfoId:e.selectedId,toMergeUsersInfosIds:e.usersInfos.map(({id:e})=>e).filter(n=>n!==e.selectedId)}),e.onSuccess()},children:n("fusionner_04498")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("nom_du_membre_69353")}),e.displayColumns.map(e=>{const t=r[e];return"delegations"===e?(0,i.jsx)(Gm,{children:n("d_l_gations_78318")},e):t?(0,i.jsx)(Gm,{children:t.name},e):null}),(0,i.jsx)(Gm,{children:n("membre_principa_09597")})]}),numberOfPages:0,offset:0,rows:e.usersInfos.map(n=>(0,i.jsxs)(km,{css:{cursor:"pointer"},onClick:()=>{e.onSelect(n.id)},children:[(0,i.jsx)($m,{children:(0,i.jsx)(My,{userInfo:n})}),e.displayColumns.map(e=>{const t=r[e];return"delegations"===e?(0,i.jsx)($m,{gap:"2",wrap:"wrap",children:n.delegations.map(e=>{const n=e.event?`${e.event.name}`:e.name;return(0,i.jsx)(Ku,{children:n},e.id)})},e):t?(0,i.jsx)($m,{children:s.getValueString(t,n.fields,{fileReturnValue:"name"})},e):null}),(0,i.jsx)($m,{children:(0,i.jsx)(lm,{shouldPreventDefault:!1,state:e.selectedId===n.id?"checked":"unchecked",onClick:Bc.A})})]},n.id)),setOffset:Bc.A,title:e.usersInfos[0].name,totalCount:0})},BN=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{localOrganization:s,updateLocalOrganization:o}=XS(),a=e.organization.customFields.nodes,[r,d]=(0,V.useState)(e.organization.possibleDuplicates),[l,c]=(0,V.useState)(Object.fromEntries(r.map(({id:e,usersInfos:n})=>[e,n[0].id]))),[u,m]=(0,V.useState)(!1),h=r.length??0,[p,I]=(0,V.useState)(s?.duplicatesColumns||[]),x=(0,V.useMemo)(()=>(0,Lm.A)([...a.map(e=>({name:e.name,slug:e.slug})),{name:n("d_l_gations_78318"),slug:"delegations"}],e=>e.name),[a]),f=(0,V.useCallback)(async e=>{I(e),await o({duplicatesColumns:e})},[I]),[_,j]=(0,V.useState)(""),v=(0,V.useMemo)(()=>g(_)?r.filter(e=>e.usersInfos.some(e=>e.name.toLowerCase().includes(_.toLowerCase()))):r,[r,_]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hx,{fallbackClosePath:hs.COMMUNITY_USERS({organizationId:t}),heading:n("gestion_des_mem_14016"),children:(0,i.jsxs)(Gx,{children:[(0,i.jsx)(Tl,{align:"center",justify:"between",children:(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("liste_des_membr_20115")}),h>0&&(0,i.jsx)(Ku,{color:"warning",size:"sm",children:n("_1_doublon_pot_74382",h)})]}),(0,i.jsx)(Mr,{color:"gray500",children:n("s_lectionner_le_91896")})]})}),(0,i.jsx)(Pl,{height:"6"}),0===h?(0,i.jsxs)(ym,{children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:n("nom_du_membre_69353")}),(0,i.jsx)(Gm,{children:n("membre_principa_09597")})]}),(0,i.jsx)(km,{css:{height:"400px"},children:(0,i.jsx)($m,{css:{height:"100%"},children:(0,i.jsx)(UE,{subtitle:"",title:n("il_n_y_a_pas_de_78722")})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",justify:"between",children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{placeholder:n("rechercher_un_m_05904"),value:_,onChange:j})}),(0,i.jsx)(tc,{color:"white",leftIcon:"gear",onClick:()=>{m(!0)},children:n("_diter_les_colo_39630")})]}),(0,i.jsx)(Pl,{height:"6"}),v.map(({id:e,usersInfos:n})=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(VN,{customFields:a,displayColumns:p,selectedId:l[e],usersInfos:n,onSelect:n=>{c(t=>({...t,[e]:n}))},onSuccess:()=>{d(n=>n.filter(n=>n.id!==e))}}),(0,i.jsx)(Pl,{height:"4"})]},e))]})]})}),u&&(0,i.jsx)(jp,{columns:x,initialSelectedColumns:p,saveButtonText:n("_diter_62574"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_96096"),title:n("_dition_des_col_70300"),onClose:()=>{m(!1)},onSave:f})]})},WN=()=>{const{params:{organizationId:e}}=Kl(),{data:n,loader:t}=Li("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},[$o.CustomFieldWithConditionFragment]);return t||(0,i.jsx)(BN,{organization:n.organization})},GN=()=>{const{translate:e,params:{organizationId:n}}=Kl();Au(e("communaut_20896"));const{hasFeature:t}=XS(),{canDelegationEdit:s,canDelegationRead:o,canFormRead:a,canWorkflowEdit:r,canWorkflowRead:d}=ay();return t(Ze.Community)?(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:hs.COMMUNITY_DASHBOARD({organizationId:":organizationId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(cF,{})})}),(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_USERS_DUPLICATES(":organizationId"),children:(0,i.jsx)(WN,{})}),(0,i.jsx)(kr.qh,{path:[Rj.CREATE({organizationId:":organizationId",delegationId:":delegationId"}),Rj.CREATE({organizationId:":organizationId"})],children:(0,i.jsx)(fD,{})}),(0,i.jsx)(kr.qh,{path:hs.COMMUNITY_USERS({organizationId:":organizationId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(UN,{})})}),(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_EDIT_USER(":organizationId",":userInfoId"),children:(0,i.jsx)(bR,{children:(0,i.jsx)(WM,{})})}),(0,i.jsx)(kr.qh,{exact:!0,path:Gj.CREATE_TEMPLATE({organizationId:":organizationId"}),children:(0,i.jsx)(fy,{isTemplate:!0})}),(0,i.jsx)(kr.qh,{exact:!0,path:Gj.CREATE({organizationId:":organizationId",options:":options?"}),children:(0,i.jsx)(fy,{isTemplate:!1})}),(0,i.jsx)(kr.qh,{path:Gj.UPDATE({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(jy,{})}),(0,i.jsx)(kr.qh,{path:Gj.CAMPAIGNS({organizationId:":organizationId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(aF,{})})}),(0,i.jsx)(kr.qh,{path:Gj.CAMPAIGN({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(iC,{})})}),a&&(0,i.jsx)(kr.qh,{path:$s.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(bz,{isCreateOpen:!0})})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORMS({organizationId:":organizationId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(bz,{isCreateOpen:!1})})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORM_ELEMENTS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(uO,{})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(kO,{})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(RO,{})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(yO,{})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_STATE({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(LO,{})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORM_INTEGRATION({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(Rz,{})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORM_EMAILS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(pO,{})}),a&&(0,i.jsx)(kr.qh,{path:$s.FORM_PREVIEW({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(Dz,{})}),(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_VOLUNTEERS_IMPORT(":organizationId"),children:(0,i.jsx)(bP,{})}),(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_FILES_IMPORT(":organizationId"),children:(0,i.jsx)(Iz,{})}),(0,i.jsx)(kr.qh,{path:Rj.MEMBER({organizationId:":organizationId",userInfoId:":userInfoId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(TM,{})})}),s&&(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_CREATE_DELEGATION(":organizationId",":options?"),children:(0,i.jsx)(Gb,{})}),s&&(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_EDIT_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(Hb,{})}),o&&(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_DELEGATIONS(":organizationId"),children:(0,i.jsx)(dF,{children:(0,i.jsx)(IN,{})})}),o&&(0,i.jsx)(kr.qh,{path:Js.DELEGATION_CATEGORY({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(dz,{isEvent:!1})})}),o&&(0,i.jsx)(kr.qh,{path:yo.COMMUNITY_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(dF,{children:(0,i.jsx)(HT,{})})}),r&&(0,i.jsx)(kr.qh,{path:Yj.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(tk,{})}),r&&(0,i.jsx)(kr.qh,{path:Yj.UPDATE({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(ik,{})}),d&&(0,i.jsx)(kr.qh,{path:Yj.WORKFLOW({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(Kk,{})})}),d&&(0,i.jsx)(kr.qh,{path:Yj.WORKFLOWS({organizationId:":organizationId"}),children:(0,i.jsx)(dF,{children:(0,i.jsx)(Bk,{})})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:hs.COMMUNITY_USERS({organizationId:n}),replace:!0})})]}):(0,i.jsx)(dF,{children:(0,i.jsx)(Tl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Vj,{icon:"crown",subtitle:e("contactez_nous_69860"),title:e("pour_en_profite_62789")})})})};let qN=class extends Og{constructor(e,n,t){super(e,n,t)}getCustomFieldsFilters(e,n,t){return[{slug:"name",name:this.t("nom_du_champ_48329"),category:this.t("champs_de_formu_64126"),fieldType:nn.Text,hideEmpty:!0},{slug:"label",name:this.t("label_08243"),category:this.t("champs_de_formu_64126"),fieldType:nn.Text},{slug:"customFieldCategory",name:this.t("cat_gorie_00291"),category:this.t("champs_de_formu_64126"),fieldType:nn.Select,values:(0,Lm.A)(t.customFieldsCategories.nodes,e=>u(e.name)),hideEmpty:!0},{slug:"fieldType",name:this.t("type_35427"),category:this.t("champs_de_formu_64126"),fieldType:nn.Select,values:Gt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"variety",name:this.t("typologie_34041"),category:this.t("champs_de_formu_64126"),fieldType:nn.Select,values:(0,Lm.A)(Pt.filter(e=>!n||e!==Te.Event).map(e=>({id:e,name:gC(this.t.bind(this),e)})),({name:e})=>e),hideEmpty:!0},{slug:"privacy",name:this.t("Privacy"),category:this.t("champs_de_formu_64126"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"condition",name:this.t("condition_61066"),category:this.t("champs_de_formu_64126"),fieldType:nn.Select,values:t.customFields.nodes},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),category:this.t("champs_de_formu_64126"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"hasValidationRules",name:this.t("r_gles_de_valid_33082"),category:this.t("champs_de_formu_64126"),fieldType:nn.Checkbox,hideEmpty:!0},{slug:"createdBy",name:this.t("cr_e_par_30622"),category:this.t("champs_de_formu_64126"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"createdAt",name:this.t("cr_e_le_02658"),category:this.t("champs_de_formu_64126"),fieldType:nn.Datetime,hideEmpty:!0}]}getCustomFieldsPossibleColumns(){return[{slug:"id",name:this.t("id_51738"),isSortable:!0,sortAttribute:$e.Id,width:100},{slug:"name",name:this.t("nom_du_champ_48329"),isSortable:!0,sortAttribute:$e.Name,minWidth:240},{slug:"label",name:this.t("label_08243"),isSortable:!0,sortAttribute:$e.Label,minWidth:180},{slug:"category",name:this.t("Category"),isSortable:!0,sortAttribute:$e.Category,minWidth:240},{slug:"variety",name:this.t("typologie_34041"),minWidth:180},{slug:"fieldType",name:this.t("type_35427"),isSortable:!0,sortAttribute:$e.Type,width:250},{slug:"numberOfTimesUsed",name:this.t("nombre_d_utilis_58389"),width:200},{slug:"state",name:this.t("Privacy"),isSortable:!0,sortAttribute:$e.Status,width:200},{slug:"values",name:this.t("valeurs_34314"),minWidth:240},{slug:"variable",name:this.t("variable_pour_l_45711"),minWidth:180},{slug:"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:$e.CreatedAt,minWidth:180}]}};qN=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],qN);const HN=V.createContext({}),YN=e=>{const n=uF(wa,{organizationId:e.organizationId},e=>e.organization.customFieldsCategories.nodes);return(0,i.jsx)(HN.Provider,{value:{getCustomFieldsCategories:n},children:e.children})},ZN=e=>{const{translate:n}=Kl(),{getCustomFieldsCategories:t}=V.useContext(HN),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("Category")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Up,{label:n("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))})},KN=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),{mutate:s}=Ea();return(0,i.jsx)(sA,{column:e.column,initialValue:e.initialValue,mutate:async i=>s({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.customFieldId]},slug:e.property,strategy:hn.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},XN=e=>(0,i.jsx)(KN,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.category.id,property:we.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(ZN,{setValue:n,value:e}),renderValue:e.customField.category.name}),QN=e=>{const{translate:n}=Kl();return(0,i.jsx)(KN,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.label||"",property:we.Label,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{name:n("label_08243"),value:e,onChange:t}),renderValue:e.customField.label||""})},JN=e=>{const{translate:n}=Kl();return(0,i.jsx)(KN,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.name,property:we.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("nom_du_champ_48329"),value:e,onChange:t}),renderValue:()=>(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(Mr,{color:"gray800",css:{clamp:2,width:"100%"},title:e.customField.name,children:e.customField.name}),e.customField.conditionCustomField&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0,width:"100%"},title:e.customField.conditionCustomField.name,children:n("d_pend_de_1_52961",e.customField.conditionCustomField.name)})]})})},eL=e=>{const{history:n,params:{eventId:t}}=Kl(),s=e.customField.variety===Te.UserInfo&&e.customField.numberOfTimesUsed>0;return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:s?(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{n.push(mj.CUSTOM_FIELD_USAGE({organizationId:e.organizationId,eventId:t,segmentId:e.segmentId,customFieldId:e.customField.id}))},children:e.customField.numberOfTimesUsed}):e.customField.numberOfTimesUsed})},nL=e=>{const{translate:n}=Kl();return(0,i.jsx)(KN,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.isPrivate,property:we.Privacy,reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Up,{label:n("Privacy"),shouldParseAsBoolean:!0,value:e,onChange:t,children:[(0,i.jsx)("option",{value:"true",children:n("Private")}),(0,i.jsx)("option",{value:"false",children:n("Public")})]}),renderValue:()=>e.customField.isPrivate?(0,i.jsx)(Ku,{color:"gray",leftIcon:"lock",children:n("Private")}):(0,i.jsx)(Ku,{color:"primary",leftIcon:"globe",children:n("Public")})})},tL=e=>{const{translate:n}=Kl();return"id"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"name"===e.column.slug?(0,i.jsx)(JN,{column:e.column,customField:e.row,reload:e.reloadRow}):"label"===e.column.slug?(0,i.jsx)(QN,{column:e.column,customField:e.row,reload:e.reloadRow}):"category"===e.column.slug?(0,i.jsx)(XN,{column:e.column,customField:e.row,reload:e.reloadRow}):"fieldType"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Mr,{color:"gray800",css:{width:"18px"},children:(0,i.jsx)(Yl,{icon:ZC(e.row.fieldType,e.row.fieldProperty)})}),(0,i.jsx)(Pl,{width:"2"}),(0,i.jsx)(Mr,{color:"gray800",children:n(e.row.fieldType)})]})}):"numberOfTimesUsed"===e.column.slug?(0,i.jsx)(eL,{column:e.column,customField:e.row,organizationId:e.organizationId,segmentId:e.segmentId}):"state"===e.column.slug?(0,i.jsx)(nL,{column:e.column,customField:e.row,reload:e.reloadRow}):"values"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.values.map(({value:e})=>e).join(", ")}):"variable"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.variety===Te.UserInfo?`{user.${e.row.slug}}`:e.row.variety===Te.Event?`{event.${e.row.slug}}`:e.row.variety===Te.Delegation?`{delegation.${e.row.slug}}`:""}):"variety"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:gC(n,e.row.variety)}):"isEncrypted"===e.column.slug?(0,i.jsx)($m,{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)(Tk,{column:e.column,createdBy:e.row.createdBy}):"createdAt"===e.column.slug?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)($m,{})},iL=e=>{const{history:n,translate:t,params:{eventId:s}}=Kl(),{showNotification:o}=AS(),[a,r]=(0,V.useState)(!1),{mutate:d}=Ad(),{mutate:l}=bd(),[c,u]=(0,V.useState)(!1),m=e.customField.fieldType!==Qe.Select||e.customField.isSelectV2;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{isOpen:a,onStateChange:r,children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Mu,{onClick:t=>{Tu(t.target),n.push(mj.UPDATE({organizationId:e.organizationId,eventId:s,customFieldId:e.customField.id}))},children:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(Yl,{icon:"pen"}),t("_diter_62574")]})}),m&&(0,i.jsx)(Mu,{onClick:async t=>{Tu(t.target);const{customFieldsMassDuplicate:i}=await d({organizationId:e.organizationId,eventId:s,selecteds:{ids:[e.customField.id]}});e.reload(),n.push(mj.UPDATE({organizationId:e.organizationId,eventId:s,customFieldId:i[0].id}))},children:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(Yl,{icon:"clone"}),t("dupliquer_28256")]})})]}),(0,i.jsx)(lw,{children:e.customField.canDelete&&(0,i.jsx)(Mu,{color:"red",onClick:()=>{r(!1),u(!0)},children:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(Yl,{icon:"trash-can"}),t("supprimer_43083")]})})})]}),c&&(0,i.jsx)(ow,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_96670"),text:t("suppression_de_73669",e.customField.name),onClose:()=>{u(!1)},onDelete:async()=>{await l({organizationId:e.organizationId,eventId:s,selecteds:{ids:[e.customField.id]}}),o(t("le_champ_1_43589",e.customField.name)),e.reload()}})]})},sL=()=>{const{translate:e,params:{eventId:n}}=Kl(),{massActions:t,predicates:s}=pg(),{onMassEditSuccess:o,organizationId:a,segment:r}=ok(),{showNotification:d}=AS(),{mutate:l}=Ea(),{mutate:c}=Ad(),{mutate:u}=bd(),[m,h]=(0,V.useState)(!1),[p,I]=(0,V.useState)(!1),x=t.getSelectedsInput(s,null),f=t.isAllSelected?r.count:t.numberOfSelected,_=(0,V.useCallback)(e=>{g(e)&&d(e),o()},[o]),j=(0,V.useCallback)(async()=>{const t=(await c({organizationId:a,eventId:n,selecteds:x})).customFieldsMassDuplicate.length;_(e("_1_champs_ont_57847",t))},[c,_,a,n,x,e]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{onClick:()=>h(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"clone",onClick:j,children:e("dupliquer_28256")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>I(!0),children:e("supprimer_43083")})})]})]}),m&&(0,i.jsx)(xw,{mutate:e=>l({organizationId:a,eventId:n,massEdit:e}),organizationId:a,selecteds:x,onClose:()=>h(!1),onSuccess:n=>_(e("_1_champs_pers_55120",n))}),p&&(0,i.jsx)(ow,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_63402")],text:e("suppression_de_98457",f),onClose:()=>I(!1),onDelete:async()=>{const t=(await u({organizationId:a,eventId:n,selecteds:x})).numberOfCustomFields;_(e("_1_champs_pers_68086",t))}})]})},oL=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=Kl();return(0,i.jsx)(kk,{children:(0,i.jsx)(ly,{permissions:sy.CUSTOM_FIELD_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{e.push(mj.CREATE({organizationId:t,eventId:s}))},children:n("cr_er_un_champ_31226")})})})},aL=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,customFieldId:o}}=Kl(),{data:a,loader:r}=Li("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:t,customFieldId:o},[]),d=a.organization?.customField;return(0,i.jsx)(gp,{returnToFallback:mj.CUSTOM_FIELDS({organizationId:t,eventId:s}),size:"sm",children:r?(0,i.jsx)(hp,{children:r}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yy,{children:n("nombre_d_utilis_58389")}),(0,i.jsxs)(hp,{children:[(0,i.jsx)(Pl,{height:"9"}),(0,i.jsxs)(Tl,{align:"center",direction:"column",children:[(0,i.jsx)(Tl,{align:"center",css:{background:"$purple100",borderRadius:"24px",color:"$purple700",fontSize:"$textXl"},height:64,justify:"center",width:64,children:(0,i.jsx)(Yl,{icon:ZC(d.fieldType,d.fieldProperty)})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:d.name})]}),(0,i.jsx)(Pl,{height:"9"}),d.positions.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("liste_de_missio_27210",d.positions.length)}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Tl,{direction:"column",gap:"6",children:d.positions.map(n=>(0,i.jsxs)(Mr,{css:{cursor:"pointer"},onClick:()=>{e.push(oo.POSITION({organizationId:t,eventId:n.event.id,positionId:n.id}))},children:[(0,i.jsx)(Mr,{color:"gray800",children:n.event.name}),(0,i.jsx)(Mr,{color:"gray500",children:n.name})]},n.id))}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",height:"1px",marginBottom:"$6",marginTop:"$6",width:"100%"}})]}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("liste_des_formu_84836",d.forms.length)}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Tl,{direction:"column",gap:"6",children:d.forms.map(t=>{const s=t.event?t.event.name:n("communaut_20896");return(0,i.jsxs)(Mr,{css:{cursor:"pointer"},onClick:()=>{e.push($s.FORM({organizationId:t.organization.id,eventId:t.event?.id,formId:t.id}))},children:[(0,i.jsx)(Mr,{color:"gray800",children:s}),(0,i.jsx)(Mr,{color:"gray500",children:t.name})]},t.id)})}),(0,i.jsx)(Pl,{height:"9"})]})]})})},rL=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=Kl(),{canCustomFieldEdit:o,canSegmentEdit:a}=oy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oL,{}),(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:(0,i.jsx)(sL,{}),searchPlaceholder:e("rechercher_un_c_49598"),showActions:o,showEditColumns:a,showEditMode:o,showSearchColumns:!1})}),(0,i.jsx)(kx,{getEditPath:e=>mj.UPDATE({organizationId:n,eventId:t,customFieldId:e.id}),renderCell:(e,t,o)=>(0,i.jsx)(tL,{column:e,organizationId:n,reloadRow:o,row:t,segmentId:s}),renderRowDropdown:(e,t)=>(0,i.jsx)(iL,{customField:e,organizationId:n,reload:t})}),(0,i.jsx)(kr.dO,{children:(0,i.jsx)(kr.qh,{path:mj.CUSTOM_FIELD_USAGE({organizationId:":organizationId",eventId:t?":eventId":void 0,segmentId:":segmentId",customFieldId:":customFieldId"}),children:(0,i.jsx)(aL,{})})})]})]})},dL=e=>{const{translate:n,params:{organizationId:t,eventId:s,segmentId:o}}=Kl(),{canCustomFieldEdit:a,canSegmentEdit:r}=oy(),d=ki(qN),l=(0,V.useMemo)(()=>d.getCustomFieldsFilters(t,s,e.organization),[e.organization,t,s]),c=(0,V.useMemo)(()=>d.getCustomFieldsPossibleColumns(),[]),u=(0,V.useMemo)(()=>({level:s?xn.Event:xn.Organization}),[s]);return(0,i.jsx)(YN,{organizationId:t,children:(0,i.jsx)(yk,{canSegmentEdit:r,eventId:s,filters:l,filtersButtonText:n("filtrer_les_cha_91574"),filtersSubtitle:n("appliquer_des_f_27562"),getSegmentPath:e=>mj.CUSTOM_FIELDS_SEGMENT({organizationId:t,eventId:s,segmentId:e}),initialLimit:e.initialLimit??Tm,initialSegmentsOpen:e.initialSegmentsOpen??!0,loadDataList:Ma,loadDataListParams:u,loadRow:Cd,organizationId:t,possibleColumns:c,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:Bn.CustomFields,segmentsFolders:e.organization.segmentsFolders,setLimit:e.setLimit,showMassActions:a,showRowDropdown:a,showRowEdit:a,onSegmentClick:e.onSegmentClick,onSegmentDelete:e.onSegmentDelete,onSegmentsToggle:e.onSegmentsToggle,children:(0,i.jsx)(rL,{})})})},lL=xg([{operator:$n.Is,slug:"condition",value:[]}]);function cL(e){return(0,V.useMemo)(()=>e.flatMap(e=>e.segments).map(e=>e.id),[e])}const uL=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=Kl(),{event:{name:o},localEvent:a,updateLocalEvent:r}=BS();Au(`${o} ${s("champs_de_formu_64126")}`);const{data:d,loader:l,reload:c}=Ed({organizationId:n,eventId:t,level:xn.Event,predicatesGroups:lL}),u=cL(d.organization?.segmentsFolders??[]);return l||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:mj.CUSTOM_FIELDS_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(dL,{initialLimit:a?.customFieldsLimit,initialSegmentsOpen:a?.areCustomFieldsSegmentsOpen,organization:d.organization,reload:c,setLimit:e=>{r({customFieldsLimit:e})},onSegmentClick:e=>{r({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await r({customFieldsSegmentId:null}),e.replace(mj.CUSTOM_FIELDS({organizationId:n,eventId:t}))},onSegmentsToggle:async e=>{await r({areCustomFieldsSegmentsOpen:e})}})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:mj.CUSTOM_FIELDS_SEGMENT({organizationId:n,eventId:t,segmentId:a?.customFieldsSegmentId&&u.includes(a.customFieldsSegmentId)?a.customFieldsSegmentId:u[0]}),replace:!0})})]})},mL=()=>{const{history:e,params:{organizationId:n},translate:t}=Kl(),{localOrganization:s,updateLocalOrganization:o}=XS();Au(t("champs_de_formu_64126"));const{data:a,loader:r,reload:d}=Ed({organizationId:n,level:xn.Organization,predicatesGroups:lL}),l=cL(a.organization?.segmentsFolders??[]);return r||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:mj.CUSTOM_FIELDS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(dL,{initialLimit:s?.customFieldsLimit,initialSegmentsOpen:s?.areCustomFieldsSegmentsOpen,organization:a.organization,reload:d,setLimit:e=>{o({customFieldsLimit:e})},onSegmentClick:e=>{o({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await o({customFieldsSegmentId:null}),e.replace(mj.CUSTOM_FIELDS({organizationId:n}))},onSegmentsToggle:async e=>{await o({areCustomFieldsSegmentsOpen:e})}})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:mj.CUSTOM_FIELDS_SEGMENT({organizationId:n,segmentId:s?.customFieldsSegmentId&&l.includes(s.customFieldsSegmentId)?s.customFieldsSegmentId:l[0]}),replace:!0})})]})};let gL=class extends Rc{constructor(e){super(e)}delegationCategoryInputDefault(e){return{name:e.name,banners:e.banners}}};gL=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],gL);let hL=class extends Rc{constructor(e){super(e)}delegationCategoryBannerInputDefault(){return{bannerType:-1,bannerVehicleType:he.Car,min:1,max:10}}};hL=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],hL);const pL=e=>{const{translate:n}=Kl(),t=ki(hL),s=Um(),o=(0,V.useMemo)(()=>(e.bannersCustomFields?.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e.toString(10),children:n},e))},e.id)),[e.bannersCustomFields]);return(0,i.jsxs)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.values.map((t,a)=>{const r=`${e.prefix}[${a}].`;return(0,i.jsxs)(Tl,{align:"start",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"4",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(of,{isSearchVisible:!0,label:n("type_de_bandeau_34965"),name:`${r}bannerType`,children:o}),(0,i.jsx)(ny,{label:n("type_de_v_hicul_88166"),name:`${r}bannerVehicleType`,children:s(wt)})]}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)($c,{label:n("commence_par_la_30514"),min:0,name:`${r}min`,shouldParseAsInt:!0}),(0,i.jsx)($c,{label:n("jusqu_la_vale_40572"),min:0,name:`${r}max`,shouldParseAsInt:!0})]})]}),(0,i.jsx)(Tl,{align:"end",css:{paddingTop:"$6"},children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",onClick:()=>{e.change(e.prefix,e.values.filter((e,n)=>n!==a))}})})]},a)}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.prefix,[...e.values,t.delegationCategoryBannerInputDefault()])},children:n("ajouter_un_band_94873")})})]})},IL=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,delegationCategoryId:o}}=Kl(),{showNotification:a}=AS(),r=ki(gL),{data:d,loader:l}=Li("query DelegationCategoryToEdit(\n $organizationId: OrganizationId!\n $delegationCategoryId: DelegationsCategoryId!\n $loadBannersCustomFields: Boolean!\n $bannersCustomFieldsIds: [CustomFieldId!]!\n) {\n organization(id: $organizationId) {\n customFields(ids: $bannersCustomFieldsIds) @include(if: $loadBannersCustomFields) {\n nodes {\n id\n name\n\n values {\n id\n value\n }\n }\n }\n\n delegationCategory(id: $delegationCategoryId) {\n id\n name\n\n banners {\n bannerType\n bannerVehicleType\n min\n max\n }\n }\n }\n}\n",{organizationId:t,delegationCategoryId:o,loadBannersCustomFields:yh(t),bannersCustomFieldsIds:yh(t)?Ch():[]},[]);const{mutate:c}=function(e={}){return Ui("mutation DelegationCategoryUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n $delegationCategory: DelegationsCategoryUpdateInput!\n) {\n delegationCategoryUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}(),u=(0,V.useMemo)(()=>Yo(d.organization?.delegationCategory.banners),[d.organization]);return Au(n("mise_jour_de_17055",d.organization?.delegationCategory.name)),l||(0,i.jsx)(xc,{height:1,initialValues:{delegationCategory:r.delegationCategoryInputDefault(d.organization.delegationCategory)},render:({form:e,handleSubmit:a,submitting:r,values:l})=>(0,i.jsx)(Hx,{button:(0,i.jsx)(tc,{isLoading:r,onClick:a,children:n("mettre_jour_l_94846")}),category:n("mise_jour_de_17055",d.organization.delegationCategory.name),color:"dark",fallbackClosePath:Js.DELEGATION_CATEGORY({organizationId:t,eventId:s,delegationCategoryId:o}),heading:d.organization.delegationCategory.name,children:(0,i.jsxs)(Gx,{children:[(0,i.jsx)(sf,{heading:n("informations_su_03761"),children:(0,i.jsx)($c,{label:n("nom_de_la_cat_g_03860"),name:"delegationCategory.name"})}),yh(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("bandeaux_v_hicu_49859"),initialIsOpen:u,isToggleable:!0,onToggle:n=>{n||e.change("delegationCategory.banners",[])},children:(0,i.jsx)(pL,{bannersCustomFields:d.organization.customFields,change:e.change,prefix:"delegationCategory.banners",values:l.delegationCategory.banners})})]}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:r,textAlign:"center",onClick:a,children:n("mettre_jour_l_94846")})})]})}),width:1,onSubmit:async i=>{await c({organizationId:t,eventId:s,delegationCategoryId:o,delegationCategory:i.delegationCategory}),a(n("la_cat_gorie_a_28053")),e.goBack(Js.DELEGATION_CATEGORY({organizationId:t,eventId:s,delegationCategoryId:o}))}})},xL=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:n("lier_un_champ_p_01331")})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(lb,{customFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})})]})},fL=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("aucun_champ_per_72101")}),(0,i.jsx)(xL,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})]})},_L=e=>{const n=(0,V.useMemo)(()=>Object.fromEntries(e.formCustomFields.map(e=>[e.id,e])),[e.formCustomFields]);return(0,i.jsx)(_p,{ids:e.formCustomFieldsValues.map(e=>e.id),onReorder:e.onReorder,children:(0,i.jsx)(Tl,{css:{bd:!0},direction:"column",width:1,children:e.formCustomFieldsValues.map((t,s)=>(0,i.jsx)(iO,{css:{border:"none",borderBottom:"1px solid $gray200",borderRadius:"0",boxShadow:"none","&:last-child":{borderBottom:"none"}},elementId:t.id,field:n[t.customFieldId],index:s,isMandatory:t.isMandatory,showEdit:!1,toggleIsMandatory:e.toggleMandatory,updateCustomField:Bc.A,onDelete:e.onDelete},t.id))})})},jL=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>new Set(e.formCustomFieldsValues.map(({customFieldId:e})=>e)),[e.formCustomFieldsValues]),s=(0,V.useCallback)(n=>{e.change(`${e.prefix}formCustomFields`,n)},[e.prefix,e.change]),o=(0,V.useCallback)(n=>{t.has(n.id)?s(e.formCustomFieldsValues.filter(({customFieldId:e})=>e!==n.id)):s([...e.formCustomFieldsValues,{id:W(),customFieldId:n.id,isMandatory:!0}])},[e.formCustomFieldsValues,t,s]),a=(0,V.useCallback)((n,t)=>{s(Qo(e.formCustomFieldsValues,n,t))},[e.formCustomFieldsValues,s]),r=(0,V.useCallback)((n,t)=>{s((0,dp.jM)(e.formCustomFieldsValues,e=>{e[n].isMandatory=t}))},[e.formCustomFieldsValues,s]),d=(0,V.useCallback)(n=>{s((0,dp.jM)(e.formCustomFieldsValues,e=>{e.splice(n,1)}))},[e.formCustomFieldsValues,s]);return(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsx)(Tl,{width:280,children:(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("champs_personna_17489")})}),(0,i.jsx)(Tl,{css:{flex:"1"},children:Yo(e.formCustomFieldsValues)?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(_L,{formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,toggleMandatory:r,onDelete:d,onReorder:a}),(0,i.jsx)(xL,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:t,toggle:o})]}):(0,i.jsx)(fL,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:t,toggle:o})})]})},vL=e=>{const{params:{organizationId:n}}=Kl(),t=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(e.customFields.map(e=>e.category),e=>e.id),e=>e.name.toLowerCase()),[e.customFields]),s=(0,V.useMemo)(()=>(0,fm.A)(e.customFields,e=>e.category.id),[e.customFields]);return(0,i.jsxs)(Tl,{direction:"column",children:[t.map((t,o)=>{const a=s[t.id];return(0,i.jsxs)(V.Fragment,{children:[0!==o&&(0,i.jsx)(oI,{height:"5"}),(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsx)(Tl,{width:280,children:(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:t.name})}),(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",gap:"4",children:a.map(t=>(0,i.jsx)(db,{change:e.change,display:!0,field:t,fileAcl:"public-read",isMandatory:!1,organizationId:n,prefix:`${e.prefix}fields.`},t.id))})]})]},t.id)}),Yo(e.customFields)&&e.showFormCustomFields&&(0,i.jsx)(oI,{height:"5"}),e.showFormCustomFields&&(0,i.jsx)(jL,{change:e.change,formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,prefix:e.prefix})]})},SL=e=>{const{history:n,translate:t,params:{organizationId:s}}=Kl(),o=ki(J_),{organization:a}=XS(),r=(0,V.useMemo)(()=>(0,Lm.A)(e.groups,e=>u(e.name)),[e.groups]),d=(0,V.useCallback)(n=>{const t=e.groupsAccesses.filter((e,t)=>t!==n&&e.groupId).map(({groupId:e})=>e);return r.filter(e=>!t.includes(e.id)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},[r,e.groupsAccesses]),l=(0,V.useMemo)(()=>(0,Lm.A)(a.roles.filter(e=>e.accessLevel===Un.Event),e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[a.roles]);return Zo(r)?(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:t("vous_n_avez_pas_50446")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:t("un_groupe_donne_90412")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(tc,{color:"white",onClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_GROUPS(s))},children:t("cr_er_un_groupe_03956")})]}):(0,i.jsxs)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.groupsAccesses.map((n,s)=>(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("acc_s_n_1_17158",s+1)}),(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(of,{isSearchVisible:!0,label:t("groupe_74342"),name:`event.groupsAccesses[${s}].groupId`,renderOnPortal:!0,shouldParseAsInt:!0,children:d(s)})}),(0,i.jsx)(Mr,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"arrow-right"})}),(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(of,{label:t("r_le_59302"),name:`event.groupsAccesses[${s}].roleId`,renderOnPortal:!0,shouldParseAsInt:!0,children:l})}),(0,i.jsx)(Mr,{css:{paddingTop:"$6"},children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("event.groupsAccesses",Jo(e.groupsAccesses,s))}})})]})]},s)),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change("event.groupsAccesses",e.groupsAccesses.concat([o.eventGroupAccessDefault()]))},children:t("ajouter_un_grou_74184")})})]})},yL=e=>{const{history:n,translate:t,params:{organizationId:s}}=Kl(),o=ki(Ig),a=(0,V.useMemo)(()=>Y_.map((e,n)=>(0,i.jsx)("option",{value:e,children:e},n)),[]);return(0,i.jsxs)(i.Fragment,{children:[e.showEmailSender&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(of,{isCreateVisible:!0,isSearchVisible:!0,label:t("_metteur_des_e_27849"),name:"event.emailSenderId",onCreateClick:()=>{n.push(yo.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)(Pl,{height:"4"})]}),(0,i.jsx)(Zr.Yr,{name:"event.languages",children:n=>{!e.hasLanguagesFeature&&n.length>1&&e.change("event.languages",[(0,lg.A)(n)])}}),(0,i.jsx)(of,{label:t("langues_de_l_v_94191"),multiple:!0,name:"event.languages",children:ru.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(of,{isSearchVisible:!0,label:t("fuseau_horaire_14654"),name:"event.timeZone",children:a}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(rS,{label:t("heure_laquell_13491"),name:"event.dayStartTime"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(of,{isSearchVisible:!0,label:t("Country"),name:"event.country",children:o.getCountriesIdName().map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(ny,{label:t("Layer"),name:"event.layer",children:[(0,i.jsx)("option",{value:gn.Google,children:t("plan_24242")}),(0,i.jsx)("option",{value:gn.GoogleSatellite,children:t("satellite_64364")}),(0,i.jsx)("option",{value:gn.IgnPlan,children:t("plan_ign_03240")})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsx)(ef,{label:(0,i.jsx)(Uv,{children:t("latitude_par_d_01620")}),name:"event.latitude"}),(0,i.jsx)(ef,{label:(0,i.jsx)(Uv,{children:t("longitude_par_d_28326")}),name:"event.longitude"})]}),e.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(df,{name:"event.isWeezeventSynchronized",children:t("synchroniser_av_82451")})]}),Yo(e.delegationsSpaceLayouts)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(of,{label:(0,i.jsx)(Uv,{children:t("layout_de_l_esp_40392")}),name:"event.delegationsSpaceLayoutId",children:e.delegationsSpaceLayouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:t("modules_activ_s_07626")}),(0,i.jsx)(df,{name:"event.usePositions",children:t("missions_63972")}),(0,i.jsx)(df,{name:"event.useAccreditations",children:t("accr_ditations_39450")}),(0,i.jsx)(df,{name:"event.useDelegations",children:t("d_l_gations_78318")}),(0,i.jsx)(df,{name:"event.useForms",children:t("Form_plural")}),(0,i.jsx)(df,{name:"event.useCampaigns",children:t("Campaigns")}),(0,i.jsx)(df,{name:"event.useDocuments",children:t("Documents")}),(0,i.jsx)(df,{name:"event.useWorkflows",children:t("automatisations_60045")})]})]})},CL=e=>{const{history:n,translate:t,params:{organizationId:s}}=Kl(),o=ki(J_),a=ki(Ol),r=ki(zC),{hasFeature:d,reload:l}=XS(),{canOrganizationUserEdit:c}=ay(),u=(0,V.useRef)(null),m=(0,V.useMemo)(()=>({event:e.initialValues}),[e.initialValues]),h=(0,V.useMemo)(()=>!(!(e.initialValues.languages.length>1||"number"==typeof e.initialValues.emailSenderId)&&e.initialValues.dayStartTime.startsWith("00:00")&&e.initialValues.usePositions&&e.initialValues.useAccreditations&&e.initialValues.useDelegations&&e.initialValues.useForms&&e.initialValues.useCampaigns&&e.initialValues.useDocuments&&e.initialValues.useWorkflows&&"number"!=typeof e.initialValues.delegationsSpaceLayoutId),[e.initialValues]),p=(0,V.useMemo)(()=>Yo(e.initialValues.groupsAccesses),[e.initialValues]),I=(0,V.useMemo)(()=>e.isEdit&&Yo(Object.keys(e.initialValues.fields)),[e.isEdit,e.initialValues]),x=(0,V.useMemo)(()=>g(e.initialValues.description),[e.initialValues]),f=(0,V.useMemo)(()=>!!e.isEdit&&Yo(e.initialValues.tagsIds),[e.isEdit,e.initialValues]),_=(0,V.useCallback)(n=>a.validateForForm(o.createUpdateEventSchema(r.changedFieldsSchema(e.eventCustomFields,m.event.fields,n.event.fields)))(n),[e.eventCustomFields,m]);return(0,i.jsx)(xc,{customErrorRef:u,height:1,initialValues:m,initialValuesEqual:()=>!0,render:({form:n,handleSubmit:o,values:a})=>(0,i.jsx)(Hx,{button:e.isEdit&&(0,i.jsx)(tc,{isLoading:e.isMutateLoading,onClick:o,children:t("mettre_jour_l_28846")}),category:e.organization.name,color:"dark",fallbackClosePath:Rs.EVENTS({organizationId:s}),heading:e.isEdit?t("mise_jour_de_17055",e.initialValues.name):t("cr_ation_d_un_94106"),children:(0,i.jsxs)(Gx,{ref:u,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{heading:t("dites_en_nous_u_13238"),subtitle:t("param_trer_votr_94121"),children:(0,i.jsx)(oj,{form:n,values:a})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(sf,{heading:t("options_avanc_e_12396"),initialIsOpen:h,isToggleable:!0,subtitle:t("param_trer_l_m_66748"),children:(0,i.jsx)(yL,{change:n.change,delegationsSpaceLayouts:e.delegationsSpaceLayouts,emailsSenders:e.organization.emailsSenders,hasLanguagesFeature:d(Ze.Languages),showEmailSender:!0,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(sf,{heading:t("groupes_34813"),initialIsOpen:p,isToggleable:!0,subtitle:t("donner_acc_s_41454"),onToggle:e=>{e||n.change("event.groupsAccesses",[])},children:(0,i.jsx)(SL,{change:n.change,groups:e.organization.groups.nodes,groupsAccesses:a.event.groupsAccesses||qo})})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(sf,{heading:t("champs_de_formu_64126"),initialIsOpen:I,isToggleable:!0,subtitle:t("ajouter_des_inf_87361"),onToggle:e=>{e||n.change("event.fields",{})},children:(0,i.jsx)(vL,{change:n.change,customFields:e.eventCustomFields,formCustomFields:qo,formCustomFieldsValues:qo,prefix:"event.",showFormCustomFields:!1})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(sf,{heading:t("Description"),initialIsOpen:x,isToggleable:!0,subtitle:t("ajouter_une_des_44242"),onToggle:e=>{e||n.change("event.description","")},children:(0,i.jsx)(iS,{label:(0,i.jsx)(Uv,{children:t("description_58935")}),name:"event.description"})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(sf,{heading:t("tags_79499"),initialIsOpen:f,isToggleable:!0,subtitle:t("ajouter_des_tag_23887"),onToggle:e=>{e||n.change("event.tagsIds",[])},children:(0,i.jsx)(sb,{change:n.change,name:"event.",organizationId:s,tags:e.organization.tags.nodes,tagsIds:a.event.tagsIds})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:e.isMutateLoading,textAlign:"center",onClick:o,children:e.isEdit?t("mettre_jour_l_28846"):t("cr_er_l_v_neme_16731")})})]})}),validate:_,width:1,onSubmit:async t=>{const i=await e.mutate({organizationId:s,event:c?t.event:{...t.event,groupsAccesses:null}});l(),e.isEdit?n.goBack(Rs.EVENT({organizationId:s,eventId:i})):n.replace(Rs.EVENT({organizationId:s,eventId:i}))}})},bL=()=>{const e=ki(J_),{params:{organizationId:n},translate:t}=Kl();Au(t("cr_er_l_v_neme_16731"));const{data:s,loader:o}=Li("query EventCreateInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n}\n",{organizationId:n},[$o.CreateUpdateEventInfosFragment]),{mutate:a,isLoading:r}=function(e={}){return Ui("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)(CL,{delegationsSpaceLayouts:qo,eventCustomFields:s.organization?.eventCustomFields.nodes??qo,initialValues:e.eventInputDefault(),isEdit:!1,isMutateLoading:r,mutate:async e=>{const{eventCreate:{id:n}}=await a(e);return n},organization:s.organization})},AL=()=>{const e=ki(J_),{params:{organizationId:n,eventId:t},translate:s}=Kl(),{data:o,loader:a}=Li("query EventUpdateInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n\n event(id: $eventId) {\n name\n description\n languages\n startAt\n endAt\n timeZone\n country\n layer\n latitude\n longitude\n emailSenderId\n dayStartTime\n tagsIds\n fields\n isWeezeventSynchronized\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n delegationsSpaceLayoutId\n\n groupsAccesses {\n groupId\n roleId\n }\n\n delegationsSpaceLayouts {\n id\n name\n }\n }\n}\n",{organizationId:n,eventId:t},[$o.CreateUpdateEventInfosFragment]);Au(`${s("mettre_jour_l_28846")}: ${o.event?.name}`);const{mutate:r,isLoading:d}=function(e={}){return Ui("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 a||(0,i.jsx)(CL,{delegationsSpaceLayouts:o.event?.delegationsSpaceLayouts??qo,eventCustomFields:o.organization?.eventCustomFields.nodes??qo,initialValues:e.eventInputDefault(o.event),isEdit:!0,isMutateLoading:d,mutate:async e=>{const{eventUpdate:{id:n}}=await r({...e,eventId:t});return n},organization:o.organization})};var EL;let wL=class extends QM{static{EL=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...QM.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===dn.Update?[EL.IMPORT_COLUMNS_DEFAULT.Id]:[],EL.IMPORT_COLUMNS_DEFAULT.Name,EL.IMPORT_COLUMNS_DEFAULT.StartAt,EL.IMPORT_COLUMNS_DEFAULT.EndAt];constructor(e,n){super(e,n),this.csvInputService=e}};wL=EL=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[ZM,Di])],wL);const $L=()=>{const{params:{organizationId:e},translate:n}=Kl(),{mutate:t}=function(e={}){return Ui("mutation EventsImport($organizationId: OrganizationId!, $input: MappableImportInput!) {\n jobId: eventsImport(organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkEventsImport:s}=AS(),o=(0,V.useCallback)((e,n)=>s(e,n),[s]),{data:a,loader:r}=jd({organizationId:e,variety:Te.Event});return r||(0,i.jsx)(qM,{alertDescriptionKey:"to_add_an_event_37885",children:(0,i.jsx)(yP,{ImportInputService:wL,checkImport:o,closePath:Rs.EVENTS({organizationId:e}),customFields:a.organization.customFields.nodes,heading:n("import_events_60816"),importTagPrefix:"events",localStorageKeyPrefix:"EVENTS_IMPORT",mutate:t,returnLink:(0,i.jsx)(Xm,{to:Rs.EVENTS({organizationId:e}),children:n("revenir_aux_v_65215")})})})};var TL;function zL(e){return{includeCreatedBy:e.includes(TL.CreatedBy),includeDescription:e.includes(TL.Description),includeNumberOfMembers:e.includes(TL.NumberOfMembers)||e.includes(TL.NumberOfMembersAccredited)||e.includes(TL.NumberOfMembersAssigned)}}!function(e){e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.EndAt="endAt",e.Id="id",e.Name="name",e.NumberOfMembers="numberOfMembers",e.NumberOfMembersAccredited="numberOfMembersAccredited",e.NumberOfMembersAssigned="numberOfMembersAssigned",e.StartAt="startAt",e.State="state",e.Tags="tags"}(TL||(TL={}));let OL=class extends Og{constructor(e,n,t){super(e,n,t)}getEventsFilters(e,n){return[{slug:"name",name:this.t("nom_de_l_v_nem_08711"),category:this.t("Event"),fieldType:nn.Text,hideEmpty:!0},{slug:TL.Description,name:this.t("Description"),category:this.t("Event"),fieldType:nn.Text},{slug:"startAt",name:this.t("date_de_d_but_43380"),category:this.t("Event"),fieldType:nn.Date,hideEmpty:!0},{slug:"endAt",name:this.t("date_de_fin_86920"),category:this.t("Event"),fieldType:nn.Date,hideEmpty:!0},{slug:"state",name:this.t("State"),category:this.t("Event"),fieldType:nn.Select,values:[{id:qe.Ongoing,name:this.t(qe.Ongoing)},{id:qe.Upcoming,name:this.t(qe.Upcoming)},{id:qe.Done,name:this.t(qe.Done)}],hideEmpty:!0},{slug:"tag",name:this.t("Tag"),category:this.t("Event"),fieldType:nn.Select,needLoading:!0,organizationId:e,tagContext:Yn.Events},{slug:TL.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("Event"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:TL.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("Event"),fieldType:nn.Datetime,hideEmpty:!0},...this.customFieldsToFilters(n)]}getEventPossibleColumns(e){return[{slug:TL.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Ge.Id,width:100},{slug:TL.Name,name:this.t("nom_de_l_v_nem_08711"),isSearchable:!0,isSortable:!0,sortAttribute:Ge.Name,minWidth:240},{slug:TL.Description,name:this.t("Description"),minWidth:320},{slug:TL.StartAt,name:this.t("date_de_d_but_43380"),isSortable:!0,sortAttribute:Ge.StartAt,minWidth:180},{slug:TL.EndAt,name:this.t("date_de_fin_86920"),isSortable:!0,sortAttribute:Ge.EndAt,minWidth:180},{slug:TL.State,name:this.t("State"),minWidth:180},{slug:TL.Tags,name:this.t("tags_79499"),minWidth:320},{slug:TL.NumberOfMembers,name:this.t("nombre_de_membr_08851"),minWidth:180},{slug:TL.NumberOfMembersAssigned,name:this.t("nombre_de_membr_87779_plural"),minWidth:180},{slug:TL.NumberOfMembersAccredited,name:this.t("nombre_de_membr_25913"),minWidth:180},{slug:TL.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:TL.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Ge.CreatedAt,minWidth:180}].concat(this.customFieldsToPossibleColumns(e))}};OL=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],OL);const RL=e=>{const n=Fi(),t=ki(Jm);return(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:n("date_de_l_v_ne_69973")}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:k_(t,e.event.startAt,e.event.endAt)})]})},DL=e=>{const n=Fi();return(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:n("State")}),(0,i.jsx)(Tl,{children:(0,i.jsx)(Ku,{color:F_(e.event.state),children:n(e.event.state)})})]})},ML=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("mutation EventsMassArchive(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n eventsMassArchive(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{reload:s}=XS();return(0,i.jsx)(ow,{buttonText:n("archiver_26131"),subtext:n("_tes_vous_s_r_d_76724"),text:n("archivage_de_31255",e.event.name),onClose:e.onClose,onDelete:async()=>{await t({organizationId:e.organizationId,selecteds:{ids:[e.event.id]}}),s(),e.onSuccess()}})};let PL=class extends Rc{constructor(e){super(e)}eventDuplicateInputDefault(e){return{name:this.t("copie_de_1_62900",e.name),startAt:e.startAt,endAt:e.endAt,eventId:null,includeAccreditations:!0,includeCustomDocuments:!0,includeCustomFields:!0,includeDelegations:!0,includeEmailsTemplates:!0,includeForms:!0,includePositions:!0,includeSegments:!0,includeTemplates:!0,includeWorkflows:!0}}eventDuplicateSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_est_requ_61536")),startAt:lf.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:lf.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 Oo.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Oo.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),includeAccreditations:zc.zM(),includeCustomDocuments:zc.zM(),includeCustomFields:zc.zM(),includeDelegations:zc.zM(),includeEmailsTemplates:zc.zM(),includeForms:zc.zM(),includePositions:zc.zM(),includeSegments:zc.zM(),includeTemplates:zc.zM(),includeWorkflows:zc.zM()})}};PL=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],PL);const kL=e=>{const n=Fi(),t=ki(PL),s=ki(Ol),{mutate:o,isLoading:a}=function(e={}){return Ui("mutation EventDuplicate($eventId: EventId!, $options: EventDuplicateInput!) {\n eventDuplicate(eventId: $eventId, options: $options) {\n id\n }\n}\n",e)}(),{organization:r,reload:d}=XS(),[l,c]=(0,V.useState)(!1),u=(0,V.useMemo)(()=>r.events.nodes.filter(n=>n.id!==e.event.id),[r.events.nodes]),m=e.event.endAt.diff(e.event.startAt,"days").days;return(0,i.jsx)(Dl.lV,{initialValues:{options:t.eventDuplicateInputDefault(e.event)},initialValuesEqual:Yr.A,render:({form:t,handleSubmit:s,invalid:o,values:r})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"options.startAt",children:e=>{const n=e.plus({days:m});n.equals(r.options.endAt)||t.change("options.endAt",n)}}),(0,i.jsx)(Zr.Yr,{name:"options.endAt",children:e=>{const n=e.minus({days:m});n.equals(r.options.startAt)||t.change("options.startAt",n)}}),(0,i.jsx)(px,{icon:"clone",children:n("dupliquer_l_v_72541",e.event.name)}),(0,i.jsxs)(hx,{css:{overflowY:"auto"},gap:"5",children:[(0,i.jsx)(np,{value:l,onChange:e=>{c(e),e||t.change("options.eventId",null)},children:n("dupliquer_les_d_77458")}),l?(0,i.jsx)(of,{isSearchVisible:!0,label:n("_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)($c,{label:n("nom_du_nouvel_66511"),name:"options.name"}),(0,i.jsxs)(Tl,{gap:"5",children:[(0,i.jsx)(Qx,{label:n("nouvelle_date_d_75723"),min:Oo.c9.utc(),name:"options.startAt"}),(0,i.jsx)(Qx,{label:n("nouvelle_date_d_93958"),min:Oo.c9.utc(),name:"options.endAt"})]})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("que_souhaitez_v_40297")}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsxs)(Tl,{gap:"5",children:[(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includePositions",children:n("missions_63972")})}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeAccreditations",children:n("accr_ditations_39450")})})]}),(0,i.jsxs)(Tl,{gap:"5",children:[(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeForms",children:n("Form_plural")})}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeDelegations",children:n("d_l_gations_78318")})})]}),(0,i.jsxs)(Tl,{gap:"5",children:[(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeSegments",children:n("vues_personnali_80652")})}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeCustomDocuments",children:n("documents_perso_87374")})})]}),(0,i.jsxs)(Tl,{gap:"5",children:[(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeTemplates",children:n("mod_les_de_camp_58182")})}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeWorkflows",children:n("automatisations_60045")})})]}),(0,i.jsxs)(Tl,{gap:"5",children:[(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeEmailsTemplates",children:n("mod_les_d_e_mai_23121")})}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(Xx,{name:"options.includeCustomFields",children:n("champs_de_formu_64126")})})]})]})]})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:o,isLoading:a,onClick:s,children:n("dupliquer_28256")})})]}),validate:e=>s.validateForForm(t.eventDuplicateSchema())(e.options),onSubmit:async n=>{await o({eventId:e.event.id,options:n.options}),d(),e.reload(),e.onClose()}})},FL=e=>{const{params:{organizationId:n},translate:t}=Kl(),{canEventEdit:s}=ay(),[o,a]=(0,V.useState)(!1),[r,d]=(0,V.useState)(!1),l=(0,V.useMemo)(()=>e.event.tags.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.event.tags]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Tl,{css:{flex:"1"},children:(0,i.jsx)(Xm,{to:yo.VOLUNTEERS(n,e.event.id),children:e.event.name})}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},gap:"8",children:[(0,i.jsx)(RL,{event:e.event}),(0,i.jsx)(DL,{event:e.event}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:t("tags_79499")}),(0,i.jsx)(pA,{badges:l})]})]}),(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(tc,{to:yo.VOLUNTEERS(n,e.event.id),children:t("voir_l_v_nemen_72358")}),s&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",to:yo.EDIT_EVENT(n,e.event.id),children:t("_diter_62574")}),(0,i.jsx)(Pu,{icon:"clone",onClick:e=>{Tu(e.target),a(!0)},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),d(!0)},children:t("archiver_26131")})})]})]})]})]}),(0,i.jsx)(xx,{isOpen:o,onClose:()=>{a(!1)},children:(0,i.jsx)(Ix,{children:(0,i.jsx)(kL,{event:e.event,reload:e.reload,onClose:()=>{a(!1)}})})}),r&&(0,i.jsx)(ML,{event:e.event,organizationId:n,onClose:()=>d(!1),onSuccess:e.reload})]})},NL=()=>{const{translate:e}=Kl();return(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,minHeight:"75px",padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Tl,{css:{flex:"1"},children:(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1})}),(0,i.jsxs)(Tl,{css:{flex:"1"},gap:"8",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:70,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:e("State")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:e("tags_79499")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1})]})]}),(0,i.jsx)(Tl,{width:200})]})},LL=()=>{const{data:e,isLoading:n,limit:t,numberOfPages:s,offset:o,reload:a,setLimit:r,setOffset:d,totalCount:l}=pg();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tl,{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:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(NL,{}),(0,i.jsx)(NL,{}),(0,i.jsx)(NL,{})]}):e.map(e=>(0,i.jsx)(FL,{event:e,reload:a},e.id))}),(0,i.jsx)(Fm,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Pm,{limit:t,numberOfPages:s,offset:o,setLimit:r,setOffset:d,showLimits:!0,totalCount:l})})]})},UL=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canEventEdit:t}=ay();return(0,i.jsx)(kk,{children:t&&(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"file-import",to:Rs.EVENTS_IMPORT({organizationId:n}),onClick:e=>Tu(e.target),children:e("importer_via_un_61623")}),path:yo.CREATE_EVENT(n),children:e("cr_er_un_v_nem_28126")})})},VL=e=>{const{params:{organizationId:n}}=Kl(),{mutate:t}=za(),s=(0,V.useCallback)(i=>t({organizationId:n,massEdit:{reset:!1,selecteds:{ids:[e.event.id]},slug:Be.Description,strategy:hn.Replace,value:i}}),[n,e.event.id,t]);return(0,i.jsx)(ZF,{column:e.column,mutate:s,reload:e.reload,text:e.event.description,updatable:!0})},BL=e=>{const{params:{organizationId:n}}=Kl(),{mutate:t}=za();return(0,i.jsx)(sA,{column:e.column,initialValue:e.initialValue,mutate:i=>t({organizationId:n,massEdit:{reset:!1,selecteds:{ids:[e.eventId]},slug:e.property,strategy:hn.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},WL=e=>{const{translate:n}=Kl(),t=ki(Jm);return(0,i.jsx)(BL,{column:e.column,eventId:e.event.id,initialValue:e.event.endAt,property:Be.EndAt,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Wp,{label:n("date_de_fin_86920"),value:e,onChange:t}),renderValue:t.toLocaleString(e.event.endAt,Uo.DateOnly.WeekdayLongMonthLong),updatable:!0})},GL=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{isEditMode:s}=pg();return(0,i.jsx)(BL,{column:e.column,eventId:e.event.id,initialValue:e.event.name,property:Be.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("nom_de_l_v_nem_08711"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:s,title:e.event.name,updatable:!0,children:(0,i.jsx)(Xm,{to:Rs.EVENT({organizationId:t,eventId:e.event.id}),children:(0,i.jsx)(Mr,{css:{clamp:2},title:e.event.name,children:e.event.name})})}),updatable:!0})},qL=e=>{const{translate:n}=Kl(),t=ki(Jm);return(0,i.jsx)(BL,{column:e.column,eventId:e.event.id,initialValue:e.event.startAt,property:Be.StartAt,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Wp,{label:n("date_de_d_but_43380"),value:e,onChange:t}),renderValue:t.toLocaleString(e.event.startAt,Uo.DateOnly.WeekdayLongMonthLong),updatable:!0})},HL=V.createContext({}),YL=e=>{const n=uF(Wa,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(HL.Provider,{value:{getTags:n},children:e.children})},ZL=e=>{const{translate:n}=Kl(),{getTags:t}=V.useContext(HL),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("tags_79499")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("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))})},KL=e=>{const n=(0,V.useMemo)(()=>e.event.tags||[],[e.event]),t=(0,V.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(BL,{column:e.column,eventId:e.event.id,initialValue:n.map(e=>e.id),property:Be.Tag,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(ZL,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(pA,{badges:t}),updatable:!0})},XL=e=>{const{translate:n}=Kl(),{mutate:t}=za(),s=(0,V.useCallback)((n,i)=>t({organizationId:e.organizationId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:hn.Replace,value:n}}),[e.row,t]);return e.column.slug===TL.Id?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===TL.Name?(0,i.jsx)(GL,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===TL.Description?(0,i.jsx)(VL,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===TL.StartAt?(0,i.jsx)(qL,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===TL.EndAt?(0,i.jsx)(WL,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===TL.Tags?(0,i.jsx)(KL,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===TL.State?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ku,{color:F_(e.row.state),children:n(e.row.state)})}):e.column.slug===TL.NumberOfMembers?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembers}):e.column.slug===TL.NumberOfMembersAccredited?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAccredited}):e.column.slug===TL.NumberOfMembersAssigned?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAssigned}):e.column.slug===TL.CreatedBy?(0,i.jsx)(Tk,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===TL.CreatedAt?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(jA,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:s,reload:e.reloadRow,updatable:!0})},QL=e=>{const{translate:n,params:{organizationId:t}}=Kl(),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(Pu,{icon:"clone",onClick:e=>{Tu(e.target),o(!0)},children:n("dupliquer_28256")}),(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),r(!0)},children:n("archiver_26131")})]}),(0,i.jsx)(xx,{isOpen:s,onClose:()=>{o(!1)},children:(0,i.jsx)(Ix,{children:(0,i.jsx)(kL,{event:e.event,reload:e.reload,onClose:()=>{o(!1)}})})}),a&&(0,i.jsx)(ML,{event:e.event,organizationId:t,onClose:()=>r(!1),onSuccess:e.reload})]})},JL=e=>{const{params:{organizationId:n}}=Kl(),t=Kb(e.customFields);return(0,i.jsx)(kx,{getEditPath:e=>yo.EDIT_EVENT(n,e.id),renderCell:(e,s,o)=>(0,i.jsx)(XL,{column:e,customField:t.get(e.slug),organizationId:n,reloadRow:o,row:s}),renderRowDropdown:(e,n)=>(0,i.jsx)(QL,{event:e,reload:n})})},eU=e=>{const{translate:n}=Kl(),{canEventEdit:t}=ay(),{rendering:s}=pg(),o=t&&s===ph.List,a=t&&s===ph.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UL,{}),(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{searchPlaceholder:n("rechercher_un_40024"),showActions:t,showEditColumns:o,showEditMode:a,showSearchColumns:!1})}),s===ph.List?(0,i.jsx)(JL,{customFields:e.customFields}):(0,i.jsx)(LL,{})]})]})},nU=e=>e===ph.Card?{includeCreatedBy:!1,includeDescription:!1,includeNumberOfMembers:!1,sort:{attribute:Ge.StartAt,direction:Gn.Desc}}:{},tU=e=>{const{history:n,translate:t,params:{organizationId:s,segmentId:o}}=Kl(),{localOrganization:a,updateLocalOrganization:r}=XS(),{canEventEdit:d,canSegmentEdit:l}=ay(),c=ki(OL),u=(0,V.useMemo)(()=>e.organization.customFields.nodes,[e.organization]),m=(0,V.useMemo)(()=>c.getEventsFilters(s,u),[s,u]),g=(0,V.useMemo)(()=>c.getEventPossibleColumns(u),[u]);return(0,i.jsx)(YL,{organizationId:s,children:(0,i.jsx)(yk,{canSegmentEdit:l,columnsToIncludes:zL,filters:m,filtersButtonText:t("filtrer_les_v_48869"),filtersSubtitle:t("appliquer_des_f_84816"),getSegmentPath:e=>yo.EVENTS_SEGMENT(s,e),initialLimit:a?.eventsLimit??Tm,initialSegmentsOpen:a?.areEventsSegmentsOpen??!0,loadDataList:kd,loadRow:Fd,organizationId:s,possibleColumns:g,possibleRenderings:[ph.Card,ph.List],reload:e.reload,renderingParams:nU,segmentId:o,segmentType:Bn.Events,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{r({eventsLimit:e})},showRowDropdown:d,showRowEdit:d,onSegmentClick:e=>{r({eventsSegmentId:e})},onSegmentDelete:async()=>{await r({eventsSegmentId:null}),n.replace(Rs.EVENTS({organizationId:s}))},onSegmentsToggle:async e=>{await r({areEventsSegmentsOpen:e})},children:(0,i.jsx)(eU,{customFields:u})})})},iU=()=>{const{params:{organizationId:e},translate:n}=Kl();Au(n("events_23531"));const{localOrganization:t}=XS(),{data:s,loader:o,reload:a}=Li("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},[$o.SegmentCustomFieldFragment,$o.SegmentsFoldersSegmentsFragment]),r=(0,V.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.EVENTS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(tU,{organization:s.organization,reload:a})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.EVENTS_SEGMENT(e,t?.eventsSegmentId&&r.includes(t.eventsSegmentId)?t.eventsSegmentId:r[0]),replace:!0})})]})},sU=()=>{const{params:{organizationId:e},translate:n}=Kl(),{loader:t,data:s}=Li("query EventsMobile($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n }\n }\n }\n}\n",{organizationId:e},[]);return t||(Yo(s.organization.events.nodes)?(0,i.jsx)(qi,{path:yo.DASHBOARD_EVENT_SWITCH(e,s.organization.events.nodes[0].id)}):(0,i.jsx)(Mr,{children:n("no_events_found_69870")}))},oU={PLURAL:"print-triggers",SINGLE:"print-trigger"},aU=e=>Xi([oU.SINGLE,e]),rU={PRINT_TRIGGERS:e=>Xi([Rs.EVENT(e),oU.PLURAL]),PRINT_TRIGGER:({printTriggerId:e,...n})=>Xi([Rs.EVENT({...n}),aU(e)]),CREATE:e=>is(rU.PRINT_TRIGGERS(e)),UPDATE:e=>ss(rU.PRINT_TRIGGER(e))};let dU=class extends Rc{constructor(e){super(e)}accreditationsCustomFieldInputSchema(){return zc.Ik().shape({customFieldId:zc.ai().required(this.t("le_champ_person_80074")),conditionValue:zc.gl().required(this.t("la_condition_es_66568"))})}};dU=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],dU);let lU=class extends Rc{constructor(e){super(e)}accreditationsSlotInputDefault(){return{name:""}}createAccreditationSlotSchema(){return zc.Ik().shape({slot:this.accreditationsSlotInputSchema()})}accreditationsSlotInputSchema(){return zc.Ik().shape({name:zc.Yj(),maxResources:zc.ai().nullable(),date:lf.typeError(this.t("la_date_est_inv_22002")).nullable()})}};lU=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],lU);let cU=class extends Rc{accreditationsCustomFieldInput;accreditationsSlotInput;constructor(e,n,t){super(e),this.accreditationsCustomFieldInput=n,this.accreditationsSlotInput=t}createUpdateAccreditationValuesDefault(e,n,t){const i=this.accreditationInputDefault(e,n,t);return{accreditation:i,hasNumberOfDaysLimit:"number"==typeof i.numberOfDaysLimit}}accreditationInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_de_l_acc_82676")),accreditationCategoryId:zc.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:zc.Yj(),privateNote:zc.Yj(),acronym:zc.Yj(),color:zc.Yj().required(this.t("la_couleur_est_95740")),icon:zc.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(Zt,this.t("l_ic_ne_est_req_15843")),weezeventIsSynchronized:zc.zM().required(),address:zc.Yj().nullable(),latitude:zc.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:zc.ai().nullable().typeError(this.t("la_longitude_do_35170")),zoom:zc.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:zc.Yj().required(this.t("le_fond_de_cart_48524")).oneOf(ei,this.t("le_fond_de_cart_48524")),slots:zc.YO().of(this.accreditationsSlotInput.accreditationsSlotInputSchema()),accreditationDisplay:zc.Yj().required(this.t("le_type_d_affic_60154")).oneOf(Ct,this.t("le_type_d_affic_60154")).test("calendar-slots",this.t("tous_les_cr_nea_42033"),(e,n)=>e!==oe.Calendar||Yo(n.parent.slots)&&n.parent.slots.every(e=>e.date?.isValid)),numberOfDaysLimit:zc.ai().notRequired(),accreditationsCustomFields:zc.YO().of(this.accreditationsCustomFieldInput.accreditationsCustomFieldInputSchema()),formCustomFields:zc.YO(),tagsIds:zc.YO().of(zc.ai())})}createUpdateAccreditationSchema(e){const n=this.accreditationInputSchema();return zc.Ik().shape({accreditation:e?n.shape({fields:e}):n})}accreditationInputDefault(e,n,t){let i=n?.accreditationCategoryId??t;return Number.isInteger(i)||(i=null),{accreditationCategoryId:i,name:n?.name??"",description:n?.description??"",privateNote:n?.privateNote??"",acronym:n?.acronym??"",color:n?.color??Ar.colors.primary500.value,icon:n?.icon??rn.BadgeCheck,weezeventIsSynchronized:n?.weezeventIsSynchronized??!0,willAutoAccredit:n?.willAutoAccredit??!1,address:n?.address??null,latitude:n?.latitude??null,longitude:n?.longitude??null,zoom:n?.zoom??Wr,layer:n?.layer??e,accreditationDisplay:n?.accreditationDisplay??oe.List,numberOfDaysLimit:n?.numberOfDaysLimit??null,slots:(0,Lm.A)(n?.slots??[],e=>(0,kl.A)([e.date?.toMillis(),e.name])),conditionsOperator:n?.conditionsOperator??be.And,accreditationsCustomFields:n?.accreditationsCustomFields??[],tagsIds:n?.tagsIds??[],fields:n?.fields??{},formCustomFields:n?.formCustomFields??[]}}};cU=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di,dU,lU])],cU);const uU=e=>{const n=Fi(),t=e.customFields.find(n=>n.id===e.customFieldValue.customFieldId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:`${e.field}customFieldId`,children:n=>{const t=e.customFields.find(e=>e.id===n);e.change(`${e.field}conditionValue`,t?.fieldType===Qe.Select?[]:"")}}),(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:n("condition_n_1_11603",e.index+1)}),(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsxs)(of,{isSearchVisible:!0,label:n("CustomField"),name:`${e.field}customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:n("s_lectionnez_un_62064")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Mr,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"arrow-right"})}),(0,i.jsxs)(Mr,{css:{flex:"1"},children:[t?.fieldType===Qe.Checkbox&&(0,i.jsxs)(ny,{label:n("accessible_seul_31434"),name:`${e.field}conditionValue`,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"",children:n("s_lectionnez_un_44130")}),(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]}),t?.fieldType===Qe.Select&&(0,i.jsx)(of,{isSearchVisible:!0,label:n("accessible_seul_31434"),multiple:!0,name:`${e.field}conditionValue`,children:t.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]}),(0,i.jsx)(Mr,{css:{paddingTop:"$6"},children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onRemove})})]})]})]})},mU=e=>{const{history:n,translate:t,params:{organizationId:s}}=Kl();return 0===e.customFields.length?(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:t("vous_n_avez_pas_62142")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:t("pour_ajouter_de_74432")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(tc,{color:"white",onClick:()=>{n.push(mj.CUSTOM_FIELDS({organizationId:s}))},children:t("cr_eer_un_champ_08883")})]}):(0,i.jsxs)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.customFieldsValues.map((n,s)=>{const o=s===e.customFieldsValues.length-1,a=`${e.name}[${s}].`;return(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(uU,{change:e.change,customFieldValue:n,customFields:e.customFields,field:a,index:s,onRemove:()=>{e.change(e.name,e.customFieldsValues.filter((e,n)=>n!==s))}}),e.customFieldsValues.length>1&&!o?0===s?(0,i.jsx)(Mr,{css:{width:"fit-content"},children:(0,i.jsxs)(ny,{name:`${e.prefix}conditionsOperator`,children:[(0,i.jsx)("option",{value:be.And,children:t(be.And)}),(0,i.jsx)("option",{value:be.Or,children:t(be.Or)})]})}):(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:t(e.conditionsOperator)}):null]},s)}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.name,[...e.customFieldsValues,{customFieldId:-1,conditionValue:""}])},children:t("ajouter_une_con_66324")})})]})},gU=()=>{const{translate:e}=Kl();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(df,{name:"accreditation.willAutoAccredit",subtext:e("si_la_case_est_44018"),children:e("autoriser_l_acc_50624")})})},hU=e=>{const{mutate:n}=function(e={}){return Ui("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)(zb,{initialName:"",isEdit:!1,mutate:async t=>(await n({eventId:e.eventId,accreditationCategory:{name:t}})).accreditationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},pU=e=>{const{mutate:n}=function(e={}){return Ui("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)(zb,{initialName:e.accreditationCategory.name,isEdit:!0,mutate:async t=>(await n({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id,accreditationCategory:{name:t}})).accreditationCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},IU=e=>{const{translate:n,params:{eventId:t}}=Kl(),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(HC(e.event.accreditationsCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($c,{label:n("nom_de_votre_ac_85997"),name:"accreditation.name"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(of,{isCreateVisible:!0,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"accreditation.accreditationCategoryId",onCreateClick:()=>{o(!0)},children:a.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:n("Acronym")}),name:"accreditation.acronym"})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(DC,{label:n("Color"),name:"accreditation.color"}),(0,i.jsx)(NC,{label:n("ic_ne_55554"),name:"accreditation.icon"})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(iS,{label:(0,i.jsx)(Uv,{children:n("description_58935")}),name:"accreditation.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(df,{name:"accreditation.weezeventIsSynchronized",children:n("WeezeventIsSynchronized")})]}),s&&(0,i.jsx)(hU,{eventId:t,onClose:()=>{o(!1)},onSuccess:n=>{r(HC([...a,n])),e.change("accreditation.accreditationCategoryId",n.id)}})]})},xU=e=>{const n=Fi(),[t,s]=V.useState(Oo.c9.invalid("Invalid")),[o,a]=V.useState(0),r=V.useMemo(()=>e.slots.map((e,n)=>({...e,index:n})),[e.slots]),d=V.useMemo(()=>{const n=Oo.IX.fromDateTimes(t.startOf("day"),t.endOf("day"));return t.isValid?r.filter(i=>e.matchDateFilter(i,t,n)):r},[t,r,e.matchDateFilter]),l=V.useMemo(()=>d.slice(o,10+o),[o,d]),c=V.useMemo(()=>Math.ceil(d.length/10),[d]),u=V.useMemo(()=>d.length,[d]);return(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textMd medium",children:n("liste_de_vos_cr_37612")}),(0,i.jsx)(Mr,{width:200,children:(0,i.jsx)(Wp,{max:e.event.endAt,min:e.event.startAt,value:t,onChange:e=>{s(e),a(0)}})})]}),(0,i.jsxs)(Tl,{css:{background:"$gray100",bd:!0,padding:"$6"},direction:"column",gap:"3",children:[l.map(n=>e.renderSlot(n)),(0,i.jsx)(Pm,{limit:10,numberOfPages:c,offset:o,setOffset:a,totalCount:u})]}),(0,i.jsxs)(Mr,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:e.onNewSlot,children:["+ ",n("ajouter_un_cr_n_63607")]})]})},fU=e=>{const n=Fi(),{user:t}=Yi();return(0,i.jsx)(tb,{buttonText:n("r_p_ter_28960"),icon:"sliders",initialValues:{value:1,unit:e.showHours?"hour":"day"},size:"md",title:n("r_p_ter_le_cr_n_68038"),onClose:e.onClose,onSubmit:async n=>{e.onSubmit(n.value,n.unit),e.onClose()},children:(0,i.jsxs)(Tl,{align:"center",gap:"3",wrap:"wrap",children:[(0,i.jsxs)(Mr,{children:[n("r_p_ter_pour_le_06048"),Hn.Fr!==t?.language&&" "+n("prochain_e_s_04262")]}),(0,i.jsx)(Mr,{width:100,children:(0,i.jsx)(ny,{name:"value",shouldParseAsInt:!0,children:(0,Om.A)(1,31).map(e=>(0,i.jsx)("option",{value:e,children:e},e))})}),Hn.Fr===t?.language&&(0,i.jsx)(Mr,{children:n("prochain_e_s_04262")}),(0,i.jsx)(Mr,{width:120,children:(0,i.jsxs)(ny,{name:"unit",children:[e.showHours&&(0,i.jsx)("option",{value:"hour",children:n("heures_17899")}),(0,i.jsx)("option",{value:"day",children:n("jours_43822")}),(0,i.jsx)("option",{value:"week",children:n("semaines_53228")})]})})]})})},_U=e=>{const n=Fi(),t=ki(lU);return(0,i.jsx)(tb,{buttonText:n("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:t.createAccreditationSlotSchema(),size:"md",subtitle:n(""),title:n("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async n=>{await e.onSuccess((0,Fr.A)(n.slot,["id","name","date","maxResources"])),e.onClose()},children:({form:t})=>(0,i.jsxs)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)($c,{label:n("nom_du_cr_neau_54351"),name:"slot.name"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("MaxResources"),name:"slot.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Qx,{label:n("Date"),max:e.event.endAt,min:e.event.startAt,name:"slot.date",rightIcon:"xmark",onRightIconClick:()=>{t.change("slot.date",null)}})]})})},jU=e=>{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>g(e.slot.name)?e.slot.name:n("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,V.useMemo)(()=>{const i=e.slot.date?.isValid?t.toLocaleString(e.slot.date,Uo.DateOnly.WeekdayLongMonthLong):"",s=e.slot.maxResources?n("_1_membre_maxi_51489",e.slot.maxResources):"";return(0,kl.A)([s,i]).join(" - ")||"-"},[e.slot.maxResources,e.slot.date]),[a,r]=(0,V.useState)(e.initialIsEditOpen),[d,l]=(0,V.useState)(!1),c=!e.slot.date?.isValid,u=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Mr,{color:"gray500",children:o})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{r(!0)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"clone",size:"sm",onClick:()=>{e.onDuplicate(e.slot)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("dupliquer_28256")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",disabled:c,leftIcon:"arrows-repeat",size:"sm",onClick:()=>{l(!0)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",disabled:u,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n(u?"des_membres_son_92320":"supprimer_43083")})]})]}),a&&(0,i.jsx)(_U,{event:e.event,slot:e.slot,onClose:()=>{r(!1)},onSuccess:async n=>{e.updateSlots(n,e.index)}}),d&&(0,i.jsx)(fU,{showHours:!1,onClose:()=>{l(!1)},onSubmit:(n,t)=>{e.onRepeat(e.slot,n,t)}})]})},vU=e=>{const n=Fi(),t=ki(lU),[s,o]=(0,V.useState)(-1),a=(0,V.useMemo)(()=>e.values.accreditation.slots.some(e=>e.date?.isValid),[e.values.accreditation]),r=(0,V.useCallback)((n,t)=>{const i=[...e.values.accreditation.slots];i[t]=n,e.change("accreditation.slots",i)},[e.values.accreditation.slots,e.change]),d=(0,V.useCallback)((e,n)=>!!e.date?.isValid&&e.date.startOf("day")===n.startOf("day"),[]),l=(0,V.useCallback)(()=>{e.change("accreditation.slots",e.values.accreditation.slots.concat([t.accreditationsSlotInputDefault()])),o(e.values.accreditation.slots.length)},[e.values.accreditation.slots,e.change]),c=(0,V.useCallback)(n=>{e.change("accreditation.slots",[...e.values.accreditation.slots,{name:n.name,date:n.date,maxResources:n.maxResources}])},[e.values.accreditation.slots,e.change]),u=(0,V.useCallback)((n,t,i)=>{const s=function(e,n,t){if(e.date?.isValid)return(0,Om.A)(1,n+1).map(n=>{if("day"===t){const t=e.date.plus({day:n});return{name:e.name,date:t,maxResources:e.maxResources}}if("week"===t){const t=e.date.plus({week:n});return{name:e.name,date:t,maxResources:e.maxResources}}throw new Error("Wrong unit")});throw new Error("Can not repeat slot with wrong date")}(n,t,i);e.change("accreditation.slots",e.values.accreditation.slots.concat(s))},[e.values.accreditation.slots,e.change]),m=(0,V.useCallback)(n=>{e.change("accreditation.slots",Jo(e.values.accreditation.slots,n))},[e.values.accreditation.slots,e.change]);return(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(xU,{event:e.event,matchDateFilter:d,renderSlot:n=>(0,i.jsx)(jU,{event:e.event,index:n.index,initialIsEditOpen:n.index===s,remove:m,slot:n,updateSlots:r,onDuplicate:c,onRepeat:u},n.index),slots:e.values.accreditation.slots,onNewSlot:l}),(0,i.jsx)(oI,{height:"5"}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("type_d_affichag_09962")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("comment_souhait_62602")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(xS,{name:"accreditation.accreditationDisplay",value:oe.List,children:n("afficher_sous_f_71276")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(xS,{name:"accreditation.accreditationDisplay",value:oe.Radio,children:n("afficher_sous_f_61997")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(xS,{name:"accreditation.accreditationDisplay",value:oe.Calendar,children:n("afficher_sous_f_15380")})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"5"}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("blocage_de_l_ac_17590")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("est_ce_qu_il_y_67585")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(cm,{state:e.values.hasNumberOfDaysLimit?"unchecked":"checked",onClick:n=>{e.change("hasNumberOfDaysLimit","checked"!==n),e.change("accreditation.numberOfDaysLimit",null)},children:n("non_33516")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(cm,{state:e.values.hasNumberOfDaysLimit?"checked":"unchecked",onClick:n=>{e.change("hasNumberOfDaysLimit","checked"===n)},children:n("oui_54361")}),e.values.hasNumberOfDaysLimit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(Tl,{align:"center",css:{paddingLeft:"$6"},gap:"2",children:[(0,i.jsx)(Mr,{width:80,children:(0,i.jsx)($c,{min:0,name:"accreditation.numberOfDaysLimit",shouldParseAsInt:!0})}),(0,i.jsx)(Mr,{children:n("jours_avant_la_74918")})]})]})]})]})]})},SU=e=>(0,i.jsx)(ej,{names:[`${e.prefix}latitude`,`${e.prefix}longitude`,`${e.prefix}zoom`],render:n=>(0,i.jsx)(Xr,{center:e.center,coordinatesFieldsProps:{latitudeProps:n[`${e.prefix}latitude`],longitudeProps:n[`${e.prefix}longitude`],zoomProps:n[`${e.prefix}zoom`]},layer:e.layer,point:e.point,traces:e.traces})}),yU=111320,CU=e=>e*Math.PI/180;function bU([e,n],[t,i]){const s=CU(t-e),o=CU(i-n),a=Math.sin(s/2)**2+Math.cos(CU(e))*Math.cos(CU(t))*Math.sin(o/2)**2;return 12742e3*Math.asin(Math.sqrt(a))}const AU=e=>`${(e/1e3).toFixed(2)} km`,EU=e=>(0,i.jsxs)(Tl,{gap:"2",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:e.label}),(0,i.jsx)(Mr,{color:"gray800",children:e.value})]}),wU=e=>{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>e.traces.flatMap(n=>{const t=function(e,n,t){if(e.length<2)return null;const i=n===Xn.Backward?e.slice().reverse():e,s=function(e){let n,t=0;return e.map(([,,e])=>("number"==typeof e&&(void 0===n||n-e>=5?n=e:e-n>=5&&(t+=e-n,n=e)),t))}(i),o=Math.cos(CU(t.latitude)),a=([e,n])=>[(n-t.longitude)*yU*o,(e-t.latitude)*yU];let r=0,d=1/0,l=0,c=0;for(let e=0;ee.startAt&&n?t.toLocaleString(function(e,n,t){const i=t.distanceFromStart+t.distanceFromFinish,s=t.totalEffort>0?t.effortFromStart/t.totalEffort:0;return e.plus({seconds:Math.round(i/1e3*n*s)})}(e.startAt,n,i),Uo.ShortDateTime):null,[t]);return(0,i.jsx)(Tl,{direction:"column",gap:"4",children:s.map(({trace:e,projection:t})=>{const s=o(e,e.firstRunnerPace,t),a=o(e,e.lastRunnerPace,t);return(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$3 $4"},direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{css:{color:e.color},children:(0,i.jsx)(Yl,{icon:"route"})}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:e.name})]}),t.distanceToTrace>50&&(0,i.jsx)(Mr,{color:"warning700",children:n("le_point_est_78274",Math.round(t.distanceToTrace))}),(0,i.jsx)(EU,{label:n("distance_depuis_55700"),value:AU(t.distanceFromStart)}),(0,i.jsx)(EU,{label:n("distance_jusqu_19272"),value:AU(t.distanceFromFinish)}),t.totalClimb>0&&(0,i.jsx)(EU,{label:n("d_nivel_positi_53034"),value:`${Math.round(t.climbFromStart)} m / ${Math.round(t.totalClimb)} m`}),s&&(0,i.jsx)(EU,{label:n("passage_estim_18732"),value:s}),a&&(0,i.jsx)(EU,{label:n("passage_estim_81350"),value:a})]},e.id)})})},$U=e=>{const n=Fi(),t=e.traces.filter(n=>e.tracesIds.includes(n.id)),s=qr(e.point);return(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:n("apparence_75510")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsxs)(ny,{label:n("Layer"),name:`${e.name}layer`,children:[(0,i.jsx)("option",{value:gn.Google,children:"Plan"}),(0,i.jsx)("option",{value:gn.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:gn.IgnPlan,children:"IGN Plan"})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(ny,{label:(0,i.jsx)(Uv,{children:n("Zoom")}),name:`${e.name}zoom`,shouldParseAsInt:!0,children:(0,Om.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)(Pl,{height:"6"}),(0,i.jsx)(of,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:n("Traces")}),multiple:!0,name:`${e.name}tracesIds`,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:n("localisation_38416")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(ab,{addressName:`${e.name}address`,label:(0,i.jsx)(Uv,{children:n("Address")}),latitudeName:`${e.name}latitude`,longitudeName:`${e.name}longitude`}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(ef,{label:(0,i.jsx)(Uv,{children:n("latitude_46176")}),name:`${e.name}latitude`}),(0,i.jsx)(ef,{label:(0,i.jsx)(Uv,{children:n("longitude_01695")}),name:`${e.name}longitude`})]}),s&&t.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(wU,{point:s,traces:t})]})]}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(SU,{center:(o=e.center,"number"==typeof o?.latitude&&"number"==typeof o?.longitude?{latitude:o.latitude,longitude:o.longitude}:void 0),layer:e.layer,point:s,prefix:e.name,traces:t})})]});var o},TU=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),{showNotification:a}=AS(),r=ki(cU),d=ki(Ol),l=ki(zC),c=(0,V.useRef)(null),u=(0,V.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.accreditation.name):o("cr_ation_d_une_01473"),[e.isEdit,e.initialValues]);Au(u);const{areSlotsOpen:m,isLocalisationOpen:h,areConditionsOpen:p,areCustomFieldsOpen:I,isPrivateNoteOpen:x,areTagsOpen:f}=(0,V.useMemo)(()=>{const n=e.initialValues.accreditation;return{areSlotsOpen:e.isEdit&&Yo(n.slots),isLocalisationOpen:e.isEdit&&(g(n.address)||"number"==typeof n.latitude||"number"==typeof n.longitude),areConditionsOpen:e.isEdit&&Yo(n.accreditationsCustomFields),areCustomFieldsOpen:e.isEdit&&(Yo(Object.keys(n.fields))||Yo(n.formCustomFields)),isPrivateNoteOpen:e.isEdit&&g(n.privateNote),areTagsOpen:e.isEdit&&Yo(n.tagsIds)}},[e.initialValues,e.isEdit]),_=(0,V.useCallback)(n=>d.validateForForm(r.createUpdateAccreditationSchema(l.changedFieldsSchema(e.accreditationCustomFields,e.initialValues.accreditation.fields,n.accreditation.fields)))(n),[e.accreditationCustomFields,e.initialValues]);return(0,i.jsx)(xc,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:a,submitting:r,values:d})=>(0,i.jsx)(Hx,{button:e.isEdit?(0,i.jsx)(tc,{isLoading:r,onClick:a,children:o("mettre_jour_l_92576")}):null,category:u,color:"dark",fallbackClosePath:Ws.ACCREDITATIONS({organizationId:t,eventId:s}),heading:e.isEdit?e.initialValues.accreditation.name:o("nouvelle_accr_d_32707"),children:(0,i.jsxs)(Gx,{ref:c,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{heading:o("informations_su_35382"),children:(0,i.jsx)(IU,{change:n.change,event:e.event})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:o("automatisation_47772"),subtitle:o("attribuer_autom_55909"),children:(0,i.jsx)(gU,{})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:o("cr_neaux_33401"),initialIsOpen:m,isToggleable:!0,subtitle:o("ajouter_les_dif_76832"),onToggle:e=>{e||n.change("accreditation.slots",[])},children:(0,i.jsx)(vU,{change:n.change,event:e.event,values:d})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:o("localisation_38416"),initialIsOpen:h,isToggleable:!0,subtitle:o("indiquez_la_loc_61935"),onToggle:t=>{t||(n.change("accreditation.layer",e.event.layer),n.change("accreditation.zoom",Wr),n.change("accreditation.address",null),n.change("accreditation.latitude",null),n.change("accreditation.longitude",null))},children:(0,i.jsx)($U,{center:null,layer:d.accreditation.layer,name:"accreditation.",point:d.accreditation,traces:[],tracesIds:[]})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:o("conditions_77756"),initialIsOpen:p,isToggleable:!0,subtitle:o("ajoutez_des_con_94296"),onToggle:e=>{e||n.change("accreditation.accreditationsCustomFields",[])},children:(0,i.jsx)(mU,{change:n.change,conditionsOperator:d.accreditation.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:d.accreditation.accreditationsCustomFields,name:"accreditation.accreditationsCustomFields",prefix:"accreditation."})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:o("champs_de_formu_64126"),initialIsOpen:I,isToggleable:!0,subtitle:o("ajouter_des_inf_14221"),onToggle:e=>{e||(n.change("accreditation.formCustomFields",[]),n.change("accreditation.fields",{}))},children:(0,i.jsx)(vL,{change:n.change,customFields:e.accreditationCustomFields,formCustomFields:e.formCustomFields,formCustomFieldsValues:d.accreditation.formCustomFields,prefix:"accreditation.",showFormCustomFields:!0})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:o("note_priv_e_06303"),initialIsOpen:x,isToggleable:!0,subtitle:o("ajoutez_une_not_89122"),onToggle:e=>{e||n.change("accreditation.privateNote","")},children:(0,i.jsx)(iS,{label:(0,i.jsx)(Uv,{children:o("note_priv_e_06303")}),name:"accreditation.privateNote"})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:o("tags_79499"),initialIsOpen:f,isToggleable:!0,subtitle:o("ajouter_des_tag_77298"),onToggle:e=>{e||n.change("accreditation.tagsIds",[])},children:(0,i.jsx)(sb,{change:n.change,name:"accreditation.",organizationId:t,tags:e.tags,tagsIds:d.accreditation.tagsIds})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:r,onClick:a,children:(0,i.jsx)(Mr,{textAlign:"center",children:e.isEdit?o("mettre_jour_l_92576"):o("cr_er_l_accr_di_16123")})})})]})}),validate:_,width:1,onSubmit:async i=>{const r=await e.mutate({eventId:s,accreditation:{...i.accreditation,slots:i.accreditation.slots.map(e=>(0,_r.A)(e,["index"]))}});a(e.isEdit?o("l_accr_ditation_24401"):o("l_accr_ditation_25694")),e.isEdit?n.goBack(Ws.ACCREDITATION({organizationId:t,eventId:s,accreditationId:r})):n.replace(Ws.ACCREDITATION({organizationId:t,eventId:s,accreditationId:r}))}})},zU=()=>{const{organizationId:e,eventId:n,options:t}=Vi(),s=ki(cU),{data:o,loader:a}=Li("query AccreditationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(\n eventId: $eventId\n variety: Accreditation\n privacy: All\n ) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n }\n}\n",{organizationId:e,eventId:n},[$o.ConditionsCustomFieldsFragment,$o.FormCustomFieldsFragment,$o.CreatePositionTagsFragment,$o.AttachCustomFieldFragment,$o.CreateAccreditationEventFragment]),{mutate:r}=function(e={}){return Ui("mutation AccreditationCreate($eventId: EventId!, $accreditation: AccreditationInput!) {\n accreditationCreate(eventId: $eventId, accreditation: $accreditation) {\n id\n }\n}\n",e)}(),d=g(t)?parseInt(t,10):null;return a||(0,i.jsx)(TU,{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,d),isEdit:!1,mutate:async e=>(await r(e)).accreditationCreate.id,tags:o.organization.tags.nodes})},OU=()=>{const{organizationId:e,eventId:n,accreditationId:t}=Vi(),s=ki(cU),{data:o,loader:a}=Li("query AccreditationToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(\n eventId: $eventId\n variety: Accreditation\n privacy: All\n ) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n\n accreditation(id: $accreditationId) {\n name\n accreditationCategoryId\n description\n privateNote\n acronym\n color\n icon\n weezeventIsSynchronized\n willAutoAccredit\n address\n latitude\n longitude\n zoom\n layer\n tagsIds\n accreditationDisplay\n numberOfDaysLimit\n conditionsOperator\n fields\n\n accreditationsCustomFields {\n customFieldId\n conditionValue\n }\n\n formCustomFields {\n id\n customFieldId\n isMandatory\n }\n\n slots {\n id\n name\n date\n maxResources\n assignedResources\n }\n }\n }\n}\n",{organizationId:e,eventId:n,accreditationId:t},[$o.ConditionsCustomFieldsFragment,$o.FormCustomFieldsFragment,$o.CreatePositionTagsFragment,$o.AttachCustomFieldFragment,$o.CreateAccreditationEventFragment]),{mutate:r}=function(e={}){return Ui("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 a||(0,i.jsx)(TU,{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 r({...e,accreditationId:t})).accreditationUpdate.id,tags:o.organization.tags.nodes})};var RU;let DU=class extends QM{static{RU=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...QM.IMPORT_COLUMNS_DEFAULT,AccreditationName:"accreditationName",AccreditationCategoryName:"accreditationCategoryName",SlotName:"slotName",SlotDate:"slotDate",MaxResources:"slotMaxResources",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",ConditionsOperator:"conditionsOperator",Address:"address",Latitude:"latitude",Longitude:"longitude",MapLayer:"mapLayer",MapZoom:"mapZoom",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===dn.Update?[RU.IMPORT_COLUMNS_DEFAULT.Id]:[],RU.IMPORT_COLUMNS_DEFAULT.AccreditationName,RU.IMPORT_COLUMNS_DEFAULT.AccreditationCategoryName];constructor(e,n){super(e,n),this.csvInputService=e}};DU=RU=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[ZM,Di])],DU);const MU=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{mutate:s}=function(e={}){return Ui("mutation AccreditationsImport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $input: MappableImportInput!\n) {\n jobId: accreditationsImport(organizationId: $organizationId, eventId: $eventId, input: $input)\n}\n",e)}(),{checkAccreditationsImport:o}=AS(),a=(0,V.useCallback)((e,n,t)=>o(e,n,t),[o]),{data:r,loader:d}=jd({organizationId:e,variety:Te.Accreditation});return d||(0,i.jsx)(qM,{alertDescriptionKey:"pour_ajouter_un_26814",children:(0,i.jsx)(yP,{ImportInputService:DU,checkImport:a,closePath:Ws.ACCREDITATIONS({organizationId:e,eventId:n}),customFields:r.organization.customFields.nodes,heading:t("accreditations_66464"),importTagPrefix:"accreditations",localStorageKeyPrefix:"ACCREDITATIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(Xm,{to:Ws.ACCREDITATIONS({organizationId:e,eventId:n}),children:t("back_to_accredi_24412")})})})};var PU;function kU(e,n){return n===gh.Table||n===gh.WeeklyCalendar?{includeConditions:!1,includeCustomFields:n===gh.Table,includeCreatedBy:!1,includeDescription:!1,includeResources:!0,includeTags:!1}:{includeConditions:e.includes(PU.Conditions),includeCustomFields:!1,includeCreatedBy:e.includes(PU.CreatedBy),includeDescription:e.includes(PU.Description),includeResources:!1,includeTags:e.includes(PU.Tags)}}!function(e){e.Acronym="acronym",e.Address="address",e.AutoAccredit="autoAccredit",e.Category="category",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Index="index",e.Latitude="latitude",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.MaxResources="maxResources",e.AssignedResources="resources",e.Slot="slot",e.SlotDate="slotDate",e.SlotName="slotName",e.ScannedResources="scannedResources",e.WishedResources="wishedResources",e.Tags="tags",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized"}(PU||(PU={}));let FU=class extends Og{constructor(e,n,t){super(e,n,t)}getAccreditationsFilters(e,n){return(0,kl.A)([{slug:"name",name:this.t("AccreditationName"),category:this.t("accr_ditations_39450"),fieldType:nn.Text,hideEmpty:!0},{slug:"accreditation",name:this.t("Accreditation"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:PU.Description,name:this.t("Description"),category:this.t("accr_ditations_39450"),fieldType:nn.Text},{slug:PU.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("accr_ditations_39450"),fieldType:nn.Text},Yo(e.accreditationsCategories)?{slug:"accreditationCategory",name:this.t("cat_gorie_00291"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,values:(0,Lm.A)(e.accreditationsCategories,e=>u(e.name)),hideEmpty:!0}:null,{slug:"slotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("accr_ditations_39450"),fieldType:nn.Text},{slug:"slotDate",name:this.t("Date"),category:this.t("accr_ditations_39450"),fieldType:nn.Date},{slug:"tag",name:"Tag",category:this.t("accr_ditations_39450"),fieldType:nn.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:Yn.Accreditations},{slug:"accreditationCustomField",name:this.t("condition_61066"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("accr_ditations_39450"),fieldType:nn.Text},{slug:"color",name:this.t("Color"),category:this.t("accr_ditations_39450"),fieldType:nn.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,values:Zt.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("accr_ditations_39450"),fieldType:nn.Text},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("accr_ditations_39450"),fieldType:nn.Number,hideEmpty:!0},{slug:PU.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("accr_ditations_39450"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:PU.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("accr_ditations_39450"),fieldType:nn.Datetime,hideEmpty:!0},e.isWeezeventConnected?{slug:PU.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),category:this.t("accr_ditations_39450"),fieldType:nn.Number}:null,...this.customFieldsToFilters(n)])}getAccreditationsPossibleColumns(e,{isWeezeventConnected:n}){const t=[{slug:PU.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:me.Id,width:100},{slug:PU.Name,name:this.t("AccreditationName"),isSearchable:!0,isSortable:!0,sortAttribute:me.Name,minWidth:240},{slug:PU.Description,name:this.t("Description"),minWidth:320},{slug:PU.Category,name:this.t("nom_de_la_cat_g_03860"),isSearchable:!0,isSortable:!0,sortAttribute:me.Category,minWidth:240},{slug:PU.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:240},{slug:PU.SlotDate,name:this.t("Date"),minWidth:180,isSortable:!0,sortAttribute:ue.Date},{slug:PU.AssignedResources,name:this.t("membres_11310"),minWidth:320},{slug:PU.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:PU.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:PU.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:PU.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:PU.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:PU.Acronym,name:this.t("Acronym"),isSearchable:!0,isSortable:!0,sortAttribute:me.Acronym,minWidth:180},{slug:PU.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:PU.Icon,name:this.t("ic_ne_55554"),width:80},{slug:PU.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:PU.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:PU.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:PU.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:me.CreatedAt,minWidth:180},{slug:PU.AutoAccredit,name:this.t("AutoAccredit"),minWidth:180},{slug:PU.Index,name:this.t("Index"),isSortable:!0,sortAttribute:me.Index,width:200}];return n&&t.push({slug:PU.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:PU.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),t.concat(this.customFieldsToPossibleColumns(e))}};FU=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],FU);const NU=e=>{const{params:{eventId:n}}=Kl(),{mutate:t}=ba(),s=V.useCallback(async i=>{const s=Ho(e.property);for(const o of s){const a=1===s.length?i:i[o];await t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.accreditationId]},slug:o,strategy:hn.Replace,value:a}})}return!0},[e.accreditationId,e.property,t]);return(0,i.jsx)(sA,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},LU=e=>{const{translate:n}=Kl();return(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.acronym||"",property:ae.Acronym,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("Acronym"),value:e,onChange:t}),renderValue:e.accreditation.acronym||""})},UU=V.createContext({}),VU=e=>{const n=uF(rd,{eventId:e.eventId},e=>e.event.accreditationsCategories),t=uF(Wa,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(UU.Provider,{value:{getAccreditationsCategories:n,getTags:t},children:e.children})};function BU(){return V.useContext(UU)}const WU=e=>{const n=Fi(),{getAccreditationsCategories:t}=BU(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("Category")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Up,{label:n("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))})},GU=e=>{const{organizationId:n,eventId:t}=Vi(),{isEditMode:s}=pg(),o=e.accreditationCategory.name;return(0,i.jsx)(NU,{accreditationId:e.accreditationId,column:e.column,initialValue:e.accreditationCategory.id,property:ae.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(WU,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:s,title:o,updatable:!0,children:(0,i.jsx)(Xm,{to:Ws.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.accreditationCategory.id}),children:o})})})},qU=e=>{const{translate:n}=Kl();return(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.color,property:ae.Color,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(RC,{label:n("Color"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Tl,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{css:{background:e.accreditation.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{lS(e.accreditation.color)}})}),(0,i.jsx)(Dx,{placement:"top",children:e.accreditation.color})]})})})};function HU(e,n,t){return n.fieldType===Qe.Select?Yo(t)?(0,kl.A)(t.map(e=>n.values.find(n=>n.id===e)?.value)).join(", "):"":e(!0===t?"true":"false")}const YU=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.accreditation.accreditationsCustomFields||[],[e.accreditation]),s=(0,V.useMemo)(()=>t.map((e,t)=>({id:t,color:"gray",icon:null,text:`${e.customField.name} : ${HU(n,e.customField,e.conditionValue)}`})),[t]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:s})})},ZU=e=>{const{params:{eventId:n}}=Kl(),{mutate:t}=ba(),s=(0,V.useCallback)(i=>t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.accreditation.id]},slug:ae.Description,strategy:hn.Replace,value:i}}),[n,e.accreditation.id,t]);return(0,i.jsx)(ZF,{column:e.column,mutate:s,reload:e.reload,text:e.accreditation.description,updatable:!0})},KU=e=>{const{translate:n}=Kl();return(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.icon,property:ae.Icon,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(FC,{label:n("Icon"),renderOnPortal:!0,value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Yl,{icon:Hl(e.accreditation.icon)})})},XU=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>({[ae.Color]:e.accreditation.color,[ae.Icon]:e.accreditation.icon}),[e.accreditation]);return(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:t,property:[ae.Color,ae.Icon],reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(RC,{label:n("Color"),value:e[ae.Color],onChange:n=>{t({...e,[ae.Color]:n})}}),(0,i.jsx)(FC,{label:n("Icon"),renderOnPortal:!0,value:e[ae.Icon],onChange:n=>{t({...e,[ae.Icon]:n})}})]}),renderValue:()=>(0,i.jsx)(xI,{color:e.accreditation.color,icon:e.accreditation.icon})})},QU=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{isEditMode:o}=pg(),a=e.accreditation.name;return(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.name,property:ae.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("AccreditationName"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(Xm,{to:Ws.ACCREDITATION({organizationId:t,eventId:s,accreditationId:e.accreditation.id}),children:(0,i.jsx)(Mr,{css:{clamp:2},title:a,children:a})})})})},JU=e=>{const{translate:n}=Kl(),{getTags:t}=BU(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("tags_79499")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("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))})},eV=e=>{const n=(0,V.useMemo)(()=>e.accreditation.tags||[],[e.accreditation]),t=(0,V.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:n.map(e=>e.id),property:ae.Tag,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(JU,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(pA,{badges:t})})},nV=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Jm),{mutate:o}=hd(),a=(0,V.useMemo)(()=>e.accreditationSlot.date?s.toLocaleString(e.accreditationSlot.date,Uo.DateOnly.WeekdayLongMonthLong):"-",[e.accreditationSlot]),r=(0,V.useMemo)(()=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date:Oo.c9.invalid("Invalid"),[e.accreditationSlot]);return(0,i.jsx)(sA,{column:e.column,initialValue:r,mutate:async n=>o({eventId:t,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Fr.A)(e.accreditationSlot,["id","name","maxResources"]),date:n}}),reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Wp,{label:n("Date"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Mr,{color:"gray900",css:{ellipsis:!0,textTransform:"capitalize"},title:a,width:1,children:a}),updatable:!0})},tV=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{isEditMode:o}=pg(),{mutate:a}=hd(),r=(0,V.useMemo)(()=>g(e.accreditationSlot.name)?e.accreditationSlot.name:"-",[e.accreditationSlot]);return(0,i.jsx)(sA,{column:e.column,initialValue:e.accreditationSlot.name,mutate:async n=>a({eventId:s,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Fr.A)(e.accreditationSlot,["id","date","maxResources"]),name:n}}),reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("nom_du_cr_neau_54351"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:o,title:r,updatable:!0,children:(0,i.jsx)(Xm,{to:Ws.ACCREDITATION_SLOT({organizationId:t,eventId:s,accreditationId:e.accreditationSlot.accreditation.id,accreditationSlotId:e.accreditationSlot.id}),children:(0,i.jsx)(Mr,{css:{clamp:2},title:r,children:r})})}),updatable:!0})},iV=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.accreditationSlot.weezeventChecklistId){const n=$f(e.weezeventOrganizationId,e.accreditationSlot.weezeventChecklistId);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Xm,{to:n,children:e.accreditationSlot.weezeventChecklistId})})}return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},sV=e=>{const n=Fi(),t=ki(CC);return e.column.slug===PU.Id?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===PU.Category?(0,i.jsx)(GU,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.accreditation.id,column:e.column,reload:e.reload}):e.column.slug===PU.Name?(0,i.jsx)(QU,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===PU.Description?(0,i.jsx)(ZU,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===PU.SlotName?e.row.isHidden?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):(0,i.jsx)(tV,{accreditationSlot:e.row,column:e.column,reload:e.reload}):e.column.slug===PU.SlotDate?e.row.isHidden?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):(0,i.jsx)(nV,{accreditationSlot:e.row,column:e.column,reload:e.reload}):e.column.slug===PU.MaxResources||e.column.slug===PU.AssignedResources?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(TF,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===PU.Tags?(0,i.jsx)(eV,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===PU.Conditions?(0,i.jsx)(YU,{accreditation:e.row.accreditation,column:e.column}):e.column.slug===PU.Address?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.accreditation.address}):e.column.slug===PU.Latitude?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.accreditation.latitude}):e.column.slug===PU.Longitude?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.accreditation.longitude}):e.column.slug===PU.Acronym?(0,i.jsx)(LU,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===PU.Color?(0,i.jsx)(qU,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===PU.Icon?(0,i.jsx)(KU,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===PU.IconColor?(0,i.jsx)(XU,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===PU.FillingRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===PU.CreatedBy?(0,i.jsx)(Tk,{column:e.column,createdBy:e.row.accreditation.createdBy}):e.column.slug===PU.CreatedAt?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===PU.WeezeventIsSynchronized?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.accreditation.weezeventIsSynchronized?n("oui_54361"):n("non_33516")}):e.column.slug===PU.WeezeventChecklistId?(0,i.jsx)(iV,{accreditationSlot:e.row,column:e.column,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.customField?t.getValueString(e.customField,e.row.accreditation.fields,{fileReturnValue:"name"}):""})},oV=e=>{const{translate:n,params:{eventId:t}}=Kl(),{reloadRow:s}=pg(),{mutate:o}=hd(),[a,r]=(0,V.useState)(!1);return e.accreditationSlot.isHidden?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",onClick:()=>r(!0)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),a&&(0,i.jsx)(_U,{event:e.event,slot:{...e.accreditationSlot,maxResources:e.accreditationSlot.maxResources,assignedResources:e.accreditationSlot.assignedResources},onClose:()=>{r(!1)},onSuccess:async n=>{await o({eventId:t,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:n}),s(e.accreditationSlot.id)}})]})},aV=e=>{const{canAccreditationEdit:n}=oy(),t=Kb(e.customFields);return(0,i.jsx)(kx,{renderCell:(n,s,o)=>(0,i.jsx)(sV,{column:n,customField:t.get(n.slug),reload:o,row:s,weezeventOrganizationId:e.weezeventOrganizationId}),renderRowDropdown:n=>(0,i.jsx)(oV,{accreditationSlot:n,event:e.event}),showMassActions:!1,showRowDropdown:n,showRowEdit:!1})},rV=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl(),{columns:o}=pg(),{user:a}=Yi(),{data:r,isLoading:d}=Li("query AccreditationsHeader($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:t},[]),{mutate:l}=function(e={}){return Ui("mutation AccreditationsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: accreditationsExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}(),[c,u]=(0,V.useState)(!1),[m,g]=(0,V.useState)(!1),[h,p]=(0,V.useState)(!1),{checkExport:I}=AS(),[x,f]=(0,V.useState)(!1);return(0,i.jsxs)(kk,{children:[(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"file-import",to:Ws.ACCREDITATIONS_IMPORT({organizationId:n,eventId:t}),onClick:e=>Tu(e.target),children:s("importer_via_un_61623")}),path:yo.CREATE_ACCREDITATION(n,t),children:s("cr_er_une_accr_33475")})}),(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsxs)(Ou,{isOpen:c,onStateChange:u,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"plus",onClick:()=>{u(!1),f(!0)},children:s("cr_er_une_cat_g_20051")})}),(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"plug-circle-bolt",onClick:e=>{Tu(e.target),g(!0)},children:s("exporter_via_l_09843")}),(0,i.jsx)(Pu,{icon:"file-xls",onClick:e=>{Tu(e.target),p(!0)},children:s("exporter_en_exc_51862")})]})]})]})}),x&&(0,i.jsx)(hU,{eventId:t,onClose:()=>{f(!1)},onSuccess:e.reload}),!d&&(0,i.jsx)(_N,{isOpen:m,link:Af({organizationId:n,eventId:t,lang:a?.language,pathComponent:"accreditations",key:r.event.key}),onClose:()=>{g(!1)}}),!d&&(0,i.jsx)(jN,{isOpen:h,requestExport:async i=>{const{jobId:s}=await l({organizationId:n,eventId:t,segmentId:e.segment.id,format:i,columns:o});I(s,n,t)},showIncludeFiles:!1,onClose:()=>{p(!1)}})]})},dV=e=>{const{translate:n}=Kl();return(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.willAutoAccredit,property:ae.AutoAccredit,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(om,{state:e?"checked":"unchecked",onClick:e=>{t("checked"===e)},children:n("AutoAccredit")}),renderValue:e.accreditation.willAutoAccredit?n("oui_54361"):n("non_33516")})},lV=e=>(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.index??0,property:ae.Index,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(wc,{min:1,shouldParseAsInt:!0,value:e,onChange:n}),renderValue:e.accreditation.index?.toString(10)??"-"}),cV=e=>{const{translate:n}=Kl();return(0,i.jsx)(NU,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.weezeventIsSynchronized,property:ae.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Up,{label:n("WeezeventIsSynchronized"),shouldParseAsBoolean:!0,value:e,onChange:t,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]}),renderValue:e.accreditation.weezeventIsSynchronized?n("oui_54361"):n("non_33516")})},uV=e=>{const{mutate:n}=ba(),t=(0,V.useCallback)((t,i)=>n({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:hn.Replace,value:t}}),[e.row,n]);return e.column.slug===PU.Id?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===PU.Category?(0,i.jsx)(GU,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.id,column:e.column,reload:e.reloadRow}):e.column.slug===PU.Name?(0,i.jsx)(QU,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.Description?(0,i.jsx)(ZU,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.SlotName||e.column.slug===PU.SlotDate?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===PU.MaxResources||e.column.slug===PU.AssignedResources?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(TF,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===PU.Tags?(0,i.jsx)(eV,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.Conditions?(0,i.jsx)(YU,{accreditation:e.row,column:e.column}):e.column.slug===PU.Address?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===PU.Latitude?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===PU.Longitude?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):e.column.slug===PU.Acronym?(0,i.jsx)(LU,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.Color?(0,i.jsx)(qU,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.Icon?(0,i.jsx)(KU,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.IconColor?(0,i.jsx)(XU,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.FillingRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===PU.CreatedBy?(0,i.jsx)(Tk,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===PU.AutoAccredit?(0,i.jsx)(dV,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.WeezeventIsSynchronized?(0,i.jsx)(cV,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===PU.WeezeventChecklistId?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===PU.CreatedAt?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===PU.Index?(0,i.jsx)(lV,{accreditation:e.row,column:e.column,reload:e.reloadRow}):(0,i.jsx)(jA,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:t,reload:e.reloadRow,updatable:!0})};function mV(){const{history:e,params:{organizationId:n,eventId:t}}=Kl(),{mutate:i}=function(e={}){return Ui("mutation AccreditationDuplicate($eventId: EventId!, $accreditationId: AccreditationId!) {\n accreditationDuplicate(eventId: $eventId, accreditationId: $accreditationId) {\n id\n }\n}\n",e)}();return(0,V.useCallback)(async s=>{const{accreditationDuplicate:o}=await i({eventId:t,accreditationId:s});e.push(yo.EDIT_ACCREDITATION(n,t,o.id))},[n,t,i])}const gV=e=>{const{translate:n,params:{eventId:t}}=Kl(),{showNotification:s}=AS(),{mutate:o}=dd();return(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:(0,kl.A)([n("_tes_vous_s_r_d_79068"),e.accreditation.assignedResources>0?n("_1_membre_est_95699",e.accreditation.assignedResources):null]),text:n("suppression_de_73669",e.accreditation.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:t,selecteds:{ids:[e.accreditation.id]}}),s(n("l_accr_ditation_25253",e.accreditation.name)),e.onSuccess()}})},hV=e=>{const n=Fi(),t=mV(),[s,o]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",to:yo.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id),children:n("_diter_62574")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{await t(e.accreditation.id)},children:n("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{o(!0),Tu(e.target)},children:n("supprimer_43083")})})]}),s&&(0,i.jsx)(gV,{accreditation:e.accreditation,onClose:()=>{o(!1)},onSuccess:e.reload})]})},pV=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),s=Kb(e.customFields);return(0,i.jsx)(kx,{getEditPath:e=>yo.EDIT_ACCREDITATION(n,t,e.id),renderCell:(e,n,o)=>(0,i.jsx)(uV,{column:e,customField:s.get(e.slug),eventId:t,reloadRow:o,row:n}),renderRowDropdown:(e,s)=>(0,i.jsx)(hV,{accreditation:e,eventId:t,organizationId:n,reload:s})})},IV=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),{canMemberAccredit:s}=oy(),{columns:o,predicates:a,rendering:r}=pg(),d=(0,V.useMemo)(()=>kU(o,r),[o,r]),{data:l}=pd({...d,organizationId:n,eventId:t,predicatesGroups:a,onlyWithDate:!0});return(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",width:1,children:(0,i.jsx)(D$,{css:{border:"1px solid $gray200"},date:e.selectedDay,display:"week",maxDate:e.endAt,minDate:e.startAt,children:(l.event?.accreditationsSlots.nodes??[]).map(e=>(0,i.jsx)(R$,{endAt:e.date,startAt:e.date,children:(0,i.jsx)(H$,{accreditation:e.accreditation,accreditationSlot:e,canMemberAccredit:s,showWished:!0,stats:e})},e.id))})})},xV=()=>{const e=Fi(),{massActions:n,predicates:t}=pg(),{eventId:s,onMassEditSuccess:o,organizationId:a,segment:r}=ok(),{showNotification:d}=AS(),{mutate:l}=ba(),{mutate:c}=dd(),[u,m]=(0,V.useState)(!1),[h,p]=(0,V.useState)(!1),I=n.getSelectedsInput(t,null),x=n.isAllSelected?r.count:n.numberOfSelected,f=(0,V.useCallback)(e=>{g(e)&&d(e),o()},[o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{onClick:()=>{m(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Fu,{placement:"bottom-end",children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:e("supprimer_43083")})})]}),u&&(0,i.jsx)(pw,{eventId:s,mutate:e=>l({eventId:s,massEdit:e}),organizationId:a,selecteds:I,onClose:()=>{m(!1)},onSuccess:n=>{f(e("_1_accr_ditati_22872",n))}}),h&&(0,i.jsx)(ow,{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:s,selecteds:I})).numberOfAccreditations;f(e("_1_accr_ditati_88237",n))}})]})},fV=()=>{const{params:{organizationId:e,eventId:n}}=Kl(),{columns:t,predicates:s,rendering:o}=pg(),{infos:a,setInfos:r}=ok(),d=(0,V.useMemo)(()=>kU(t,o),[t,o]),{data:l}=pd({...d,organizationId:e,eventId:n,predicatesGroups:s,customFieldsSlugs:(a.accreditationsTableLinks||[]).map(e=>e.customFieldSlug)}),c=(0,V.useMemo)(()=>(0,Rg.A)(l.event?.accreditationsSlots.nodes??[],e=>e.accreditationCategory.id).map(e=>e.accreditationCategory),[l.event]),u=(0,V.useMemo)(()=>(0,Rg.A)(l.event?.accreditationsSlots.nodes??[],e=>e.accreditation.id).map(e=>e.accreditation),[l.event]),m=(0,V.useMemo)(()=>a.accreditationsTableLinks||[],[a]),g=(0,V.useCallback)(e=>{r({...a,accreditationsTableLinks:e})},[a,r]);return(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",width:1,children:(0,i.jsx)(T$,{accreditations:u,categories:c,customFields:l.organization?.customFields?.nodes??qo,links:m,setLinks:g,showTotal:!1,slots:l.event?.accreditationsSlots.nodes??qo})})},_V=e=>{const n=Fi(),{canAccreditationEdit:t,canSegmentEdit:s}=oy(),{limit:o,reload:a,rendering:r}=pg(),{infos:d,segment:l,setInfos:c}=ok(),u=(0,V.useMemo)(()=>Oo.c9.isDateTime(d?.accreditationsCalendarSelectedDay)&&d?.accreditationsCalendarSelectedDay?.isValid?d.accreditationsCalendarSelectedDay:Oo.c9.fromISO(d?.accreditationsCalendarSelectedDay)?.isValid?Oo.c9.fromISO(d.accreditationsCalendarSelectedDay,{zone:"utc"}):e.event.startAt,[d]),m=(0,V.useCallback)(e=>{c({...d,accreditationsCalendarSelectedDay:e})},[d,c]),g=r!==gh.Table&&r!==gh.WeeklyCalendar&&s,h=r!==gh.Table&&r!==gh.WeeklyCalendar&&t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rV,{reload:a,segment:l}),0===e.event.numberOfAccreditations?(0,i.jsx)(yy,{css:{overflow:"hidden"},children:(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(UE,{subtitle:"",title:n("vous_n_avez_pas_53408")})})}):(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:(0,i.jsx)(xV,{}),controls:r===gh.WeeklyCalendar&&(0,i.jsx)(z$,{max:e.event.endAt,min:e.event.startAt,value:u,onChange:m}),searchPlaceholder:n("rechercher_une_65646"),showActions:t,showEditColumns:g,showEditMode:h,showSearchColumns:s}),selectSegment:(0,i.jsx)(ap,{allSelectedText:n("les_1_accr_di_20650",l.count,l.name),pageSelectedText:n("les_1_accr_di_60244",o),selectAllText:n("s_lectionner_le_71777",l.count,l.name)})}),r===gh.SlotsList?(0,i.jsx)(aV,{customFields:e.customFields,event:e.event,weezeventOrganizationId:e.weezeventOrganizationId}):r===gh.List?(0,i.jsx)(pV,{customFields:e.customFields}):r===gh.Table?(0,i.jsx)(fV,{}):(0,i.jsx)(IV,{endAt:e.event.endAt,selectedDay:u,startAt:e.event.startAt})]})]})},jV={async loadDataList(e,n){const{event:t}=await function(e,n){return oa(Jr,{variables:e,token:n||void 0,fragments:[$o.ConditionCustomFieldFragment,$o.AccreditationsAccreditationSlotFragment]})}(e,n);return{data:{rows:t.accreditationsSlots}}},async loadRow(e,n){const{event:t}=await function(e,n){return oa("query AccreditationsAccreditationSlot(\n $eventId: EventId!\n $id: AccreditationsSlotId!\n $customFieldsSlugs: [CustomFieldSlug!]\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $id) {\n ...AccreditationsAccreditationSlot\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.AccreditationsAccreditationSlotFragment]})}(e,n);return{data:{row:t.accreditationSlot}}}},vV=e=>e===gh.SlotsList?jV:e===gh.List?{}:null,SV=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=Kl(),{hasPermission:r,localEvent:d,updateLocalEvent:l}=BS(),{canAccreditationEdit:c}=oy(),u=ki(FU),m=(0,V.useMemo)(()=>e.organization?.customFields.nodes??[],[e.organization]),g=(0,V.useMemo)(()=>u.getAccreditationsFilters(e.event,m),[m,e.event]),h=(0,V.useMemo)(()=>u.getAccreditationsPossibleColumns(m,{isWeezeventConnected:e.event.isWeezeventConnected}),[m,e.event]);return(0,i.jsx)(VU,{eventId:o,organizationId:s,children:(0,i.jsx)(yk,{canSegmentEdit:r(sy.SEGMENT_EDIT),columnsToIncludes:kU,eventId:o,filters:g,filtersButtonText:t("filtrer_les_acc_57840"),filtersSubtitle:t("appliquer_des_f_18351"),getSegmentPath:e=>yo.ACCREDITATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfAccreditations,initialLimit:d?.accreditationsLimit??Tm,initialSegmentsOpen:d?.areAccreditationsSegmentsOpen??!0,loadDataList:od,loadRow:ad,organizationId:s,possibleColumns:h,possibleRenderings:[gh.List,gh.SlotsList,gh.Table,gh.WeeklyCalendar],reload:e.reload,renderingLoaders:vV,segmentId:a,segmentType:Bn.Accreditations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{l({accreditationsLimit:e})},showMassActions:c,showRowDropdown:c,showRowEdit:c,onSegmentClick:e=>{l({accreditationsSegmentId:e})},onSegmentDelete:async()=>{await l({accreditationsSegmentId:null}),n.replace(Ws.ACCREDITATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await l({areAccreditationsSegmentsOpen:e})},children:(0,i.jsx)(_V,{customFields:m,event:e.event,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},yV=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{event:{name:s},localEvent:o}=BS();Au(`${s} ${t("accr_ditations_39450")}`);const{data:a,loader:r,reload:d}=Li("query AccreditationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, variety: Accreditation) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n startAt\n endAt\n numberOfAccreditations\n isWeezeventConnected\n\n accreditationsCategories {\n id\n name\n }\n\n segmentsFolders(segmentType: Accreditations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:n},[$o.SegmentCustomFieldFragment,$o.SegmentsFoldersSegmentsFragment]),l=(0,V.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.ACCREDITATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(SV,{event:a.event,organization:a.organization,reload:d})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.ACCREDITATIONS_SEGMENT(e,n,o?.accreditationsSegmentId&&l.includes(o.accreditationsSegmentId)?o?.accreditationsSegmentId:l[0]),replace:!0})})]})},CV=()=>{const{hasFeature:e}=XS();return e(Ze.Accreditation)?(0,i.jsx)(yV,{}):(0,i.jsx)(Tl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Vj,{icon:"badge-check"})})},bV=[{name:"accreditationsCategoriesIds",type:"ids",resource:"accreditationsCategories",multiple:!0},{name:"accreditationsIds",type:"ids",resource:"accreditations",multiple:!0}],AV=[{name:"date",type:"date"},{name:"endDate",type:"date",requires:"date"}],EV=[{name:"sortAttribute",type:"enum",values:Si,multiple:!1,allowOtherValues:!0},{name:"sortDirection",type:"enum",values:Ii,multiple:!1,defaultValue:Gn.Asc,requires:"sortAttribute"}],wV={name:"delimiter",type:"delimiter"},$V={path:"assignments",params:[wV,{name:"state",type:"enum",values:vi,multiple:!1},{name:"date",type:"date"},{name:"includeLeaders",type:"boolean"},{name:"slugs",type:"slugs",variety:Te.UserInfo,emptyMeans:"all"},{name:"positionCategoryId",type:"ids",resource:"positionsCategories",multiple:!1},{name:"positionId",type:"ids",resource:"positions",multiple:!1},...EV]},TV={path:"accreditations",feature:Ze.Accreditation,params:[wV,{name:"date",type:"date"},{name:"states",type:"enum",values:Et,multiple:!0},{name:"slugs",type:"slugs",variety:Te.UserInfo,emptyMeans:"all"},...bV,{name:"accreditationsSlotsIds",type:"ids",resource:"accreditationsSlots",multiple:!0},...EV]},zV={path:"accreditations-matrix",feature:Ze.Accreditation,params:[wV,...AV,{name:"slugs",type:"slugs",variety:Te.UserInfo,emptyMeans:"none"},...bV]},OV={path:"accreditations-slots",feature:Ze.Accreditation,params:[wV,{name:"includeMembers",type:"boolean"},...bV]},RV={path:"positions",params:[wV,{name:"includeMembers",type:"boolean"},{name:"slugs",type:"slugs",variety:Te.Position,emptyMeans:"all",extraSlugs:["description"]}]},DV={path:"delegations-matrix",feature:Ze.Delegation,params:[wV,...AV,{name:"columns",type:"enum",values:["wished","assigned","quota","scanned"],multiple:!0},...bV]},MV=[$V,TV,zV,OV,RV,DV];function PV(e){return Object.fromEntries(e.params.map(e=>[e.name,"enum"===e.type&&void 0!==e.defaultValue?e.defaultValue:void 0]))}function kV(e,n){const t=Object.fromEntries(e.params.map(e=>{return[e.name,(t=n[e.name],Array.isArray(t)?t.length>0?t.join(","):null:"boolean"==typeof t?t?"true":null:"number"==typeof t?Number.isFinite(t)?t.toString():null:g(t)?t:null)];var t}));return Object.fromEntries(e.params.flatMap(e=>{const n=t[e.name],i=void 0===e.requires||null!==t[e.requires];return null!==n&&i?[[e.name,n]]:[]}))}function FV(){const{params:{organizationId:e,eventId:n}}=Kl(),{user:t}=Yi();return async(i,s)=>{const o=Af({organizationId:e,eventId:n,lang:t?.language,pathComponent:i.path,searchParams:kV(i,s)}),a=await fetch(o,{method:"POST",headers:{[U]:await X()??""}});if(a.ok){const{url:e}=await a.json();location.href=e}}}const NV=e=>{const{params:{organizationId:n,eventId:t,accreditationId:s},translate:o}=Kl();return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:Ws.ACCREDITATIONS({organizationId:n,eventId:t}),children:o("accr_ditations_39450")}),(0,i.jsx)(AT,{to:Ws.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.accreditation.accreditationCategoryId}),children:e.accreditation.accreditationCategoryName}),(0,i.jsx)(AT,{isCurrent:!0,to:Ws.ACCREDITATION({organizationId:n,eventId:t,accreditationId:s}),children:e.accreditation.name})]})},LV=({accreditation:e})=>{const{history:n,params:{organizationId:t,eventId:s,accreditationId:o},translate:a}=Kl(),r=mV(),d=FV(),[l,c]=(0,V.useState)(!1);return(0,i.jsx)(Cy,{acronym:e.acronym,breadcrumbs:(0,i.jsx)(NV,{accreditation:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsx)(tc,{to:yo.EDIT_ACCREDITATION(t,s,o),children:a("_diter_l_accr_d_26424")})}),(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"arrow-down-to-bracket",onClick:()=>d(TV,{accreditationsIds:[o]}),children:a("exporter_les_me_63676")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>await r(e.id),children:a("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),c(!0)},children:a("supprimer_43083")})})]})]})}),l&&(0,i.jsx)(gV,{accreditation:e,onClose:()=>c(!1),onSuccess:()=>n.replace(Ws.ACCREDITATIONS({organizationId:t,eventId:s}))})]}),color:e.color,icon:e.icon,name:e.name,subtext:e.hasSlots?a("creneau",e.numberOfSlots):void 0})},UV=e=>(0,i.jsx)(sI,{color:e.color,css:{display:"none","@tablet":{display:"block"},...e.css},direction:e.direction}),VV=br("dt",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular",gridColumn:1}}),BV=({children:e,...n})=>(0,i.jsx)(VV,{...n,children:e}),WV=br("dd",{color:"$gray500",marginInline:0,"@tablet":{color:"$gray800",gridColumn:2}}),GV=({children:e,...n})=>(0,i.jsx)(WV,{...n,children:e}),qV=br("div",{display:"grid",gridTemplateColumns:"auto",rowGap:"$1","@tablet":{columnGap:"$3",gridTemplateColumns:"auto auto",justifyContent:"space-between"}}),HV=({children:e,...n})=>(0,i.jsx)(qV,{...n,children:e}),YV=br("dl",{display:"flex",flexDirection:"column",gap:"$4",marginBlock:0,marginInline:0}),ZV=({children:e,...n})=>(0,i.jsx)(YV,{...n,children:e}),KV=({accreditationCategoryId:e,accreditationCategoryName:n,accreditationName:t,color:s,customFields:o,fields:a,icon:r,numberOfDaysLimit:d,weezeventChecklistId:l,weezeventOrganizationId:c})=>{const{params:{organizationId:u,eventId:m,accreditationId:g},translate:h}=Kl(),p="number"==typeof c&&"number"==typeof l;return(0,i.jsx)(oT,{css:{flex:"2 1"},title:h("param_tres_78420"),children:(0,i.jsx)(Tl,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(ZV,{children:[(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:h("cat_gorie_00291")}),(0,i.jsx)(GV,{children:(0,i.jsx)(Xm,{to:Ws.ACCREDITATION_CATEGORY({organizationId:u,eventId:m,accreditationCategoryId:e}),children:n})})]}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UV,{direction:"horizontal"}),(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:h("Accreditation")}),(0,i.jsx)(GV,{children:(0,i.jsx)(Xm,{to:Ws.ACCREDITATION({organizationId:u,eventId:m,accreditationId:g}),children:t})})]})]}),(0,i.jsx)(UV,{direction:"horizontal"}),(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:h("Color")}),(0,i.jsx)(GV,{children:(0,i.jsx)(Mr,{css:{background:s,borderRadius:"20px",height:"20px",width:"20px"}})})]}),(0,i.jsx)(UV,{direction:"horizontal"}),(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:h("ic_ne_55554")}),(0,i.jsx)(GV,{children:(0,i.jsx)(Yl,{icon:Hl(r)})})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UV,{direction:"horizontal"}),(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:h("Deadline")}),(0,i.jsx)(GV,{children:h("_1_jours_avant_40282",d)})]})]}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UV,{direction:"horizontal"}),(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:h("WeezeventChecklistId")}),(0,i.jsx)(GV,{children:(0,i.jsx)(Xm,{to:$f(c,l),children:l})})]})]}),o.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(Tl,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Tl,{justify:"end",width:300,children:(0,i.jsx)(wE,{field:e,fields:a})})]})]},e.slug))]})})})},XV=br("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),QV=br("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),JV=({customFields:e})=>{const n=Dm(),t=Fi();return(0,i.jsx)(oT,{title:t("conditions_77756"),children:Yo(e)?e.map(({customField:e,conditionValue:s},o)=>(0,i.jsxs)(V.Fragment,{children:[0!==o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),!n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Pl,{height:"4"})]})]}),(0,i.jsx)(XV,{children:e.name}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(QV,{children:HU(t,e,s)})]},o)):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:t("aucune_conditio_36491")})})},eB=({assignedResources:e,maxResources:n})=>{const t=Fi();return(0,i.jsx)(oT,{css:{flex:"1 1"},title:t("limite_de_membr_42978"),children:(0,i.jsx)(Tl,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:(0,i.jsx)(Mr,{css:{margin:"auto"},children:(0,i.jsx)(tT,{count:e,total:n??1/0})})})})},nB=({location:e,location:{zoom:n,layer:t,traces:s,address:o}})=>{const a=Fi(),r=sh(e);return(0,i.jsx)(oT,{css:{border:r&&!th?"none":"1px solid $gray200",overflow:"hidden",padding:r?0:"$4","@tablet":{border:"1px solid $gray200",padding:0,"& .h-detail-box-content":{padding:r?"0":"$6"}}},title:a("localisation_38416"),children:r?(0,i.jsxs)(i.Fragment,{children:[ih(e)&&(0,i.jsx)(Mr,{height:380,width:1,children:(0,i.jsx)(Xr,{initialZoom:n,layer:t,point:qr(e),traces:s})}),th(e)&&(0,i.jsx)(Mr,{color:"gray800",css:{padding:"$4","@tablet":{padding:"$7"}},children:o})]}):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:a("aucune_localisa_78216")})})},tB=()=>{const{params:{eventId:e,accreditationId:n}}=Kl(),{data:t,loader:s}=Li("query AccreditationChart($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n ...AccreditationChart\n }\n }\n}\n",{eventId:e,accreditationId:n},[$o.AccreditationChartFragment]);return s||(0,i.jsx)(oT,{title:"Reporting",children:(0,i.jsx)(Mr,{height:380,width:1,children:(0,i.jsx)(VT,{accreditation:t.event.accreditation,slots:t.event.accreditation.slots})})})},iB="both",sB="delegationAccreditation",oB="slot",aB=({limitSource:e})=>{const n=Fi();return e===sB?(0,i.jsx)(Yl,{icon:"people-group",title:n("limite_fix_e_po_87265")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yl,{icon:"badge-check",title:n("limite_fix_e_po_40573")}),e===iB&&(0,i.jsxs)(i.Fragment,{children:[" + ",(0,i.jsx)(aB,{limitSource:sB})]})]})},rB=({event:e,slot:n,reload:t})=>{const{history:s,params:{organizationId:o,eventId:a,accreditationId:r},translate:d}=Kl(),l=ki(Jm),c=ki(Rv),{assignedResources:u,maxResources:m,percent:h}=((e,n)=>{const t=n?.assignedResources??0,s=n?.wishedResources??0,o=n?.maxResources??1/0,a=1/0,r=t>=o,d=o-t,l=o-s,c=1/0,u=1/0,m=d===c?iB:ds.push(Ws.ACCREDITATION_SLOT({organizationId:o,eventId:a,accreditationId:r,accreditationSlotId:n.id})),children:[(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:g(n.name)?n.name:"-"})}),(0,i.jsx)($m,{children:n.date?l.toLocaleString(n.date,Uo.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(Mr,{children:d("_1_2_membres_04485",u,c.toNumberOrInfinity(m))}),m&&(0,i.jsx)(lF,{percent:h})]})}),(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsxs)(Km,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{f(!0)},children:d("_diter_62574")}),(0,i.jsx)(Pu,{color:n.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{j(!0)},children:d("supprimer_43083")})]})})]}),x&&(0,i.jsx)(_U,{event:e,slot:n,onClose:()=>{f(!1)},onSuccess:async e=>{await p({eventId:a,accreditationSlotId:n.id,accreditationSlot:e}),t()}}),_&&(0,i.jsx)(ow,{buttonText:d("supprimer_43083"),subtext:[d("_tes_vous_s_r_d_48876")],text:d("suppression_de_73669",Uh(l,n,"")),onClose:()=>{j(!1)},onDelete:async()=>{await I({eventId:a,accreditationSlotId:n.id}),t()}})]})},dB=()=>{const{translate:e,params:{eventId:n,accreditationId:t}}=Kl(),[s,o,a]=Wm(""),[r,d]=zD("accreditation.slots.date",Oo.c9.invalid("Invalid"),Ex),[l,c]=(0,V.useState)(0),[u,m]=zD("accreditation.slots.sort",null),{data:h,isLoading:p,reload:I}=Li("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:n,accreditationId:t,name:g(o)?o:void 0,date:r?.isValid?r:void 0,offset:l,sort:u},[]);const{numberOfPages:x,totalCount:f}=Sx(h.event?.accreditationsSlots),_=(0,V.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:a})}),(0,i.jsx)(Mr,{width:200,children:(0,i.jsx)(Wp,{max:h.event?.endAt,min:h.event?.startAt,value:r,onChange:d})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($x,{attribute:ue.Name,setSort:_,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)($x,{attribute:ue.Date,setSort:_,sort:u,children:e("Date")}),(0,i.jsx)(Gm,{children:e("remplissage_75916")}),(0,i.jsx)(Gm,{width:100})]}),numberOfPages:x,offset:l,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):h.event.accreditationsSlots.nodes.map(e=>(0,i.jsx)(rB,{event:h.event,reload:I,slot:e},e.id)),setOffset:c,title:e("liste_des_cr_ne_66393"),totalCount:f})},lB=()=>{const{organizationId:e,eventId:n,accreditationId:t}=Vi(),{canAccreditationEdit:s}=oy(),{data:o,loader:a,reload:r}=Li("query AccreditationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: Accreditation) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n description\n privateNote\n acronym\n icon\n color\n address\n latitude\n longitude\n layer\n zoom\n assignedResources\n maxResources\n hasSlots\n hiddenSlotId\n fields\n numberOfDaysLimit\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n tags {\n id\n name\n }\n }\n }\n}\n",{organizationId:e,eventId:n,accreditationId:t},[$o.CustomFieldWithConditionFragment]),{mutate:d}=ba();return a||(0,i.jsx)(yy,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)(tB,{}),o.event.accreditation.hasSlots&&(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(dB,{})}),(0,i.jsxs)(Tl,{gap:"6",width:1,children:[!o.event.accreditation.hasSlots&&(0,i.jsx)(eB,{assignedResources:o.event.accreditation.assignedResources,maxResources:o.event.accreditation.maxResources}),(0,i.jsx)(KV,{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,numberOfDaysLimit:o.event.accreditation.numberOfDaysLimit})]}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(JV,{customFields:o.event.accreditation.accreditationsCustomFields}),(0,i.jsx)(yT,{...s?{associateTags:e=>d({eventId:n,massEdit:{reset:!1,selecteds:{ids:[t]},slug:ae.Tag,strategy:hn.Replace,value:e}}),reload:r}:{},tags:o.event.accreditation.tags}),(0,i.jsx)(_T,{privateNote:o.event.accreditation.privateNote})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(fT,{description:o.event.accreditation.description}),(0,i.jsx)(nB,{location:o.event.accreditation})]})]})]})})},cB=e=>{const{translate:n}=Kl(),t=ki(Bg),{data:s}=Li("query MassCheckInPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const o=(0,V.useMemo)(()=>(s.event?.positions.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(n=>(0,i.jsx)("option",{value:n.id,children:Zg(t,n,e.name,{position:{includeNameAtEnd:!0}})},n.id))},e.id)),[s.event]),{mutate:a}=Ua(),[r,d]=(0,V.useState)([]),[l,c]=(0,V.useState)(Ce.CheckInOut),[u,m]=(0,V.useState)(null),[g,h]=(0,V.useState)(null),[p,I]=(0,V.useState)(0),[x,f]=(0,V.useState)(!1),_=(0,V.useMemo)(()=>Bo(),[]),j=Yo(r)&&(l===Ce.Reset||l===Ce.BreakTime||l===Ce.CheckIn&&u?.isValid||l===Ce.CheckOut&&g?.isValid||u?.isValid&&g?.isValid&&g>u||u?.isValid&&!g?.isValid);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"sliders",children:n("mise_jour_du_76261")}),(0,i.jsxs)(hx,{gap:"5",children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:n("pour_quel_cr_ne_94965"),multiple:!0,values:r,onChange:d,children:o}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("que_souhaitez_v_87607")}),(0,i.jsxs)(RE,{isChecked:l===Ce.CheckInOut,text:n("mettre_jour_l_00128"),onClick:()=>c(Ce.CheckInOut),children:[(0,i.jsx)(Kp,{hint:n("date_et_heure_d_93417"),rightIcon:"xmark",value:u,zone:_,onChange:m,onRightIconClick:()=>m(null)}),(0,i.jsx)(Kp,{hint:n("date_et_heure_d_65738"),rightIcon:"xmark",value:g,zone:_,onChange:h,onRightIconClick:()=>h(null)}),(0,i.jsx)(wc,{hint:n("temps_de_pause_00051"),shouldParseAsInt:!0,value:p,onChange:I})]}),(0,i.jsx)(RE,{isChecked:l===Ce.CheckIn,text:n("mettre_jour_l_12738"),onClick:()=>c(Ce.CheckIn),children:(0,i.jsx)(Kp,{hint:n("date_et_heure_d_93417"),rightIcon:"xmark",value:u,zone:_,onChange:m,onRightIconClick:()=>m(null)})}),(0,i.jsx)(RE,{isChecked:l===Ce.CheckOut,text:n("mettre_jour_l_31683"),onClick:()=>c(Ce.CheckOut),children:(0,i.jsx)(Kp,{hint:n("date_et_heure_d_65738"),rightIcon:"xmark",value:g,zone:_,onChange:h,onRightIconClick:()=>h(null)})}),(0,i.jsx)(RE,{isChecked:l===Ce.BreakTime,text:n("mettre_jour_l_68723"),onClick:()=>c(Ce.BreakTime),children:(0,i.jsx)(wc,{css:{maxWidth:"110px"},hint:n("temps_de_pause_00051"),shouldParseAsInt:!0,value:p,onChange:I})}),(0,i.jsx)(RE,{isChecked:l===Ce.Reset,text:n("remettre_z_ro_11572"),onClick:()=>c(Ce.Reset)})]})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:!j,isLoading:x,onClick:async()=>{f(!0);try{const t=(await a({eventId:e.eventId,checkIn:{breakTime:p,checkInAt:u?.toUTC(),checkOutAt:g?.toUTC(),strategy:l,positionsSlotsIds:r,selecteds:e.selecteds}})).numberOfMembers;e.onSuccess(n("le_pointage_de_04632",t)),e.onClose()}catch{f(!1)}},children:n("mettre_jour_85141")})})]})})},uB=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl(),{user:o}=Yi(),{checkDocumentsExport:a}=AS(),{data:r}=Li("query MassDocumentExportCustomDocuments($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n name\n slug\n }\n }\n}\n",{eventId:t},[]),{mutate:d}=Fa(),[l,c]=(0,V.useState)(Ne.Assignments),[u,m]=(0,V.useState)(Oo.c9.invalid("Invalid")),[g,h]=(0,V.useState)(!1),[p,I]=(0,V.useState)(!1),x=(0,V.useMemo)(()=>(0,Rg.A)(r.event?.customDocuments??[],e=>e.slug),[r.event]),f=l===Ne.Assignments||l===Ne.UserHours||l===Ne.UserPlanning||l===Ne.UserPlanningList;return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"file",children:s("exporter_un_doc_23130")}),(0,i.jsxs)(hx,{gap:"5",children:[(0,i.jsx)(lc,{alertStyle:"gray",children:(0,i.jsx)(uc,{children:s("l_e_mail_peut_m_13253")})}),(0,i.jsxs)(_m,{isSearchVisible:!0,label:s("quel_document_v_81798"),renderOnPortal:!0,values:[l],onChange:e=>{Yo(e)&&c(e[0])},children:[x.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),(0,i.jsx)("option",{value:Ne.Assignments,children:s("fiche_d_affecta_91461")}),(0,i.jsx)("option",{value:Ne.UserPlanning,children:s("UserPlanning")}),(0,i.jsx)("option",{value:Ne.UserPlanningList,children:s("UserPlanningList")}),(0,i.jsx)("option",{value:Ne.UserPlanningDays,children:s("UserPlanningDays")}),(0,i.jsx)("option",{value:Ne.Certificate,children:s("Certificate")}),(0,i.jsx)("option",{value:Ne.UserHours,children:s("UserHours")})]}),f&&(0,i.jsx)(Wp,{label:s("exportez_vos_do_87332"),value:u,onChange:m}),(0,i.jsx)(om,{state:g?"checked":"unchecked",onClick:e=>{h("checked"===e)},children:s("fusionner_les_d_64130")})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{isLoading:p,onClick:async()=>{I(!0);const i=x.map(e=>e.slug),s=i.includes(l)?Ne.UserCustomDocument:l,r=i.includes(l)?l:void 0,{jobId:c}=await d({organizationId:n,eventId:t,documentsExport:{documentType:s,customDocumentSlug:r,segmentsIds:[],selecteds:e.selecteds,language:o.language,oneFile:g,date:u}});a(c,n,t),e.onSuccess(),e.onClose()},children:s("exporter_59120")})})]})})},mB=e=>{const{translate:n}=Kl(),{mutate:t,isLoading:s}=fa(),{data:o}=Qa({eventId:e.eventId}),a=(0,V.useMemo)(()=>o.event?.accreditationsProfilesCategories??[],[o.event]),r=(0,V.useMemo)(()=>a.flatMap(e=>e.accreditationsProfiles),[a]),d=(0,V.useMemo)(()=>gb(a),[a]),[l,c]=(0,V.useState)([]),u=Yo(l);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"badge-check"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("ajouter_un_prof_36857")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("profil_d_accr_d_02274"),multiple:!1,values:l,onChange:c,children:d}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:!u,isLoading:s,onClick:async()=>{if(Yo(l)){const i=r.find(e=>e.id===l[0]),s=(await t({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:l[0],selecteds:e.selecteds,strategy:hn.Replace}})).numberOfMembers;e.onSuccess(n("le_profil_d_acc_64681",i.name,s)),e.onClose()}},children:n("ajouter_97327")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},gB=e=>{const n=Fi(),{mutate:t,isLoading:s}=ar(),[o,a]=(0,V.useState)(ge.WaitingAccreditation);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("mettre_jour_l_44471")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Up,{label:n("nouveau_statut_57871"),value:o,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{value:ge.NotApplicable,children:n(ge.NotApplicable)}),(0,i.jsx)("option",{value:ge.Refused,children:n(ge.Refused)}),(0,i.jsx)("option",{value:ge.WaitingAccreditation,children:n(ge.WaitingAccreditation)})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{isLoading:s,onClick:async()=>{const i=(await t({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(n("le_statut_d_acc_85658",i,n(o))),e.onClose()},children:n("modifier_le_sta_94473")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})};let hB=class extends Sw{translationService;inputName="massAssign";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{positionsSlotsIds:zc.YO().of(zc.ai()).required(this.t("vous_devez_s_le_28976")).min(1,this.t("vous_devez_s_le_28976"))}}};hB=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],hB);const pB=e=>{const n=Fi();return(0,i.jsx)(bw,{handleSubmit:e.handleSubmit,nextText:n("suivant_affec_68075"),prefix:"massAssign.",strategies:[{label:n("ajouter_des_aff_57793"),value:hn.Add},{label:n("remplacer_les_a_43030"),value:hn.Replace},{label:n("supprimer_des_a_59880"),value:hn.Delete}]})},IB=e=>{const n=Fi(),t=ki(Bg),s=e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(km,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===s)},children:[(0,i.jsx)($m,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(sm,{shouldPreventDefault:!1,state:s,onClick:Bc.A}):(0,i.jsx)(lm,{shouldPreventDefault:!1,state:s,onClick:Bc.A})}),(0,i.jsx)($m,{css:{textTransform:"capitalize"},children:t.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})}),(0,i.jsx)($m,{children:g(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)($m,{children:(0,i.jsx)(Ku,{color:e.slot.assignedResources>=e.slot.resources?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",e.slot.assignedResources,e.slot.resources)})})]})},xB=e=>{const n=Fi(),t=(0,V.useMemo)(()=>(0,Lm.A)(e.slots.filter(n=>n.position.id===e.position.id),e=>e.range.start.toMillis()),[e.slots,e.position]),s=(0,V.useMemo)(()=>t.map(e=>e.id),[t]),o=(0,V.useMemo)(()=>{const n=(0,mm.A)(e.positionsSlotsIds,s);return n.length===s.length?"checked":0===n.length?"unchecked":"indeterminate"},[s,e.positionsSlotsIds]),a=e.position.positionDisplay===jn.List||e.strategy===hn.Delete,r=(0,V.useCallback)((n,t)=>{if(a)e.change("massAssign.positionsSlotsIds",Ko(e.positionsSlotsIds,n,t));else{const i=(0,em.A)(e.positionsSlotsIds,s).concat(t?[n]:[]);e.change("massAssign.positionsSlotsIds",i)}},[a,e.positionsSlotsIds,e.change,s]);return(0,i.jsx)(Ib,{accreditation:e.position,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:t.length,children:(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{justify:"center",width:48,children:a&&(0,i.jsx)(sm,{state:o,onClick:n=>{"checked"===n?e.change("massAssign.positionsSlotsIds",(0,wo.A)(e.positionsSlotsIds.concat(s))):e.change("massAssign.positionsSlotsIds",(0,em.A)(e.positionsSlotsIds,s))}})}),(0,i.jsx)(Gm,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Gm,{children:n("nom_du_cr_neau_54351")}),(0,i.jsx)(Gm,{})]}),t.map(n=>(0,i.jsx)(IB,{positionsSlotsIds:e.positionsSlotsIds,shouldDisplayList:a,slot:n,onClick:r},n.id))]})})},fB=e=>{const n=(0,V.useMemo)(()=>(0,Lm.A)(e.positions.filter(n=>n.positionCategoryId===e.category.id),e=>e.name.toLowerCase()),[e.category,e.positions]);return(0,i.jsx)(pb,{category:e.category.name,children:n.map(n=>(0,i.jsx)(xB,{change:e.change,position:n,positionsSlotsIds:e.positionsSlotsIds,slots:e.slots,strategy:e.strategy},n.id))})},_B=e=>{const n=Fi(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(e.segmentId),[r,d]=(0,V.useState)(e.excludeFull?"checked":"unchecked"),[l,c]=(0,V.useState)(e.excludePast?"checked":"unchecked"),[u,m]=(0,V.useState)(e.filterAvailabilities?"checked":"unchecked"),[g,h]=(0,V.useState)(e.filterWished?"checked":"unchecked"),p=(e.excludeFull?1:0)+(e.excludePast?1:0)+(e.filterAvailabilities?1:0)+(e.filterWished?1:0)+(-1===e.segmentId?0:1);return(0,i.jsxs)(Tl,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),value:e.name,onChange:n=>{e.setName(n)}})}),(0,i.jsxs)(Nw,{apply:()=>{e.setExcludeFull("checked"===r),e.setExcludePast("checked"===l),e.setFilterAvailabilities("checked"===u),e.setFilterWished("checked"===g),e.setSegmentId(o),s(!1)},color:"white",isOpen:t,numberOfAppliedFilters:p,reinit:()=>{e.setExcludeFull(!1),d("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setFilterAvailabilities(!1),m("unchecked"),e.setFilterWished(!1),h("unchecked"),e.setSegmentId(-1),a(-1),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsxs)(Up,{label:n("vues_personnali_80652"),shouldParseAsInt:!0,value:o,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{value:-1,children:n("vue_personnalis_97654")}),e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,i.jsx)(om,{state:r,onClick:d,children:n("masquer_les_cr_14425")}),(0,i.jsx)(om,{state:l,onClick:c,children:n("masquer_les_cr_05336")}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:n("filtres_sur_les_73833")}),(0,i.jsx)(om,{state:u,onClick:m,children:n("filtrer_selon_l_74774")}),(0,i.jsx)(om,{state:g,onClick:h,children:n("filtrer_selon_l_76350")})]})]})},jB=e=>{const n=Fi(),[t,s,o]=Wm(""),[a,r]=zD("massAssign.filters.segmentId",-1),[d,l]=zD("massAssign.filters.excludeFull",!1),[c,u]=zD("massAssign.filters.excludePast",!1),[m,h]=zD("massAssign.filters.filterAvailabilities",!1),[p,I]=zD("massAssign.filters.filterWished",!1),{data:x,loader:f}=Li("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 positionDisplay\n }\n\n positionCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,positionName:g(s)?s:void 0,segmentId:-1===a?void 0:a,excludeFull:d,excludePast:c,selecteds:e.selecteds,filterAvailabilities:m,filterWished:p},[]);const _=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)((x.event?.positionsSlots.nodes??[]).map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[x.event]),j=(0,V.useMemo)(()=>(0,Rg.A)((x.event?.positionsSlots.nodes??[]).map(e=>e.position),e=>e.id),[x.event]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_B,{excludeFull:d,excludePast:c,filterAvailabilities:m,filterWished:p,name:t,segmentId:a,segments:x.event?.segments??[],setExcludeFull:e=>{l(e)},setExcludePast:u,setFilterAvailabilities:h,setFilterWished:I,setName:o,setSegmentId:e=>{r(e)}}),(0,i.jsx)(Pl,{height:"6"}),f||(0,i.jsx)(hb,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:_.map(n=>(0,i.jsx)(fB,{category:n,change:e.change,positions:j,positionsSlotsIds:e.values.massAssign.positionsSlotsIds,slots:x.event?.positionsSlots.nodes??qo,strategy:e.values.massAssign.strategy},n.id))}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n(e.values.massAssign.strategy===hn.Add?"affecter_les_1_56142":e.values.massAssign.strategy===hn.Replace?"r_affecter_les_73080":"d_saffecter_les_98962",e.numberOfSelected)})})]})},vB=e=>{const n=Fi(),t=ki(hB),{mutate:s}=rr();return(0,i.jsx)(Cw,{children:(0,i.jsx)(Hx,{category:n("affectation"),heading:n("affecter_les_me_77160"),onClose:e.onClose,children:(0,i.jsx)(Gx,{children:(0,i.jsxs)(vS,{initialValues:{massAssign:{selecteds:e.selecteds,strategy:hn.Add,positionsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{const i=(await s({eventId:e.eventId,massAssign:t.massAssign})).numberOfMembers;e.onSuccess(n("_1_membres_ont_14333",i)),e.onClose()},children:[(0,i.jsx)(jS,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(pB,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(jS,{heading:n("affectation_plural"),render:n=>(0,i.jsx)(jB,{change:n.form.change,eventId:e.eventId,handleSubmit:n.handleSubmit,numberOfSelected:e.numberOfSelected,selecteds:e.selecteds,submitting:n.submitting,values:n.values}),schema:t.step2Schema()})]})})})})};let SB=class extends Sw{translationService;inputName="massAvailabilitiesUpdate";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(),formId:zc.ai().required(this.t("le_formulaire_e_77404"))}}step2Fields(){return{slots:zc.YO().of(zc.Ik()).required(this.t("vous_devez_ajou_68961")).min(1,this.t("vous_devez_ajou_68961"))}}};SB=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],SB);const yB=e=>{const{translate:n}=Kl(),{data:t}=Li("query MassAvailabilitiesUpdateForms($eventId: EventId!) {\n event(id: $eventId) {\n forms(hasSlotDisplay: true) {\n nodes {\n id\n name\n slotDisplay\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const s=(0,V.useMemo)(()=>(t.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==Ln.Hide),[t.event]);return(0,i.jsx)(bw,{handleSubmit:e.handleSubmit,nextText:n("suivant_dispo_94398"),prefix:"massAvailabilitiesUpdate.",strategies:[{label:n("ajouter_des_dis_72846"),value:hn.Add},{label:n("remplacer_les_d_31752"),value:hn.Replace},{label:n("supprimer_des_d_60814"),value:hn.Delete}],children:(0,i.jsx)(of,{isSearchVisible:!0,label:n("Form"),name:"massAvailabilitiesUpdate.formId",children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},CB=e=>{const{translate:n}=Kl(),{data:t,loader:s}=Li("query MassAvailabilitiesUpdateSlots(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n form(id: $formId) {\n id\n name\n\n elements {\n id\n ...FormElementDisplay\n }\n\n ...FormSlotsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId)\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.values.massAvailabilitiesUpdate.formId},[$o.FormElementDisplayFragment,$o.FormSlotsOptionsFragment,$o.FormRegisterCustomSlotPeriodFragment]);return(0,i.jsxs)(i.Fragment,{children:[s||(0,i.jsx)(mD,{change:e.change,currentSlots:e.values.massAvailabilitiesUpdate.slots,customSlotsPeriods:t.organization.form.customSlotsPeriods,daysDisplay:t.organization.form.daysDisplay,elements:t.organization.form.elements,event:t.event,prefix:"massAvailabilitiesUpdate.",slotDisplay:t.organization.form.slotDisplay,userInfoFields:{}}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n("mettre_jour_85141")})})]})},bB=e=>{const{translate:n}=Kl(),t=ki(SB),{mutate:s}=function(e={}){return Ui("mutation VolunteersRegistrationsMassAvailabilitiesUpdate(\n $eventId: EventId!\n $massAvailabilitiesUpdate: MassAvailabilitiesUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAvailabilitiesUpdate(\n eventId: $eventId\n massAvailabilitiesUpdate: $massAvailabilitiesUpdate\n )\n}\n",e)}();return(0,i.jsx)(Cw,{children:(0,i.jsx)(Hx,{category:n("disponibilit_s_49923"),heading:n("mettre_jour_l_84190"),onClose:e.onClose,children:(0,i.jsx)(Gx,{children:(0,i.jsxs)(vS,{initialValues:{massAvailabilitiesUpdate:{selecteds:e.selecteds,strategy:hn.Add,formId:null,slots:[]}},isEdit:!1,onSubmit:async t=>{const i=(await s({eventId:e.eventId,massAvailabilitiesUpdate:t.massAvailabilitiesUpdate})).numberOfMembers;e.onSuccess(n("_1_membres_ont_07596",i)),e.onClose()},children:[(0,i.jsx)(jS,{heading:n("initialisation_38640"),render:({handleSubmit:n})=>(0,i.jsx)(yB,{eventId:e.eventId,handleSubmit:n}),schema:t.step1Schema()}),(0,i.jsx)(jS,{heading:n("disponibilit_s_49923"),render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(CB,{change:n.change,eventId:e.eventId,handleSubmit:t,organizationId:e.organizationId,submitting:s,values:o}),schema:t.step2Schema()})]})})})})},AB=e=>{const n=Fi(),{mutate:t,isLoading:s}=Na(),[o,a]=(0,V.useState)([]),[r,d]=(0,V.useState)([]);return(0,V.useEffect)(()=>{(async()=>{const n=await ur({eventId:e.eventId},await X());a(n.event.delegations.nodes)})()},[e.eventId]),(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"error",icon:"people-group"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("retirer_des_mem_97655")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("Delegation"),values:r,onChange:d,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{color:"error",isLoading:s,onClick:async()=>{if(Yo(r)){const i=o.find(e=>e.id===r[0]);await t({organizationId:e.organizationId,eventId:e.eventId,delegationId:r[0],selecteds:e.selecteds}),e.onSuccess(n("les_membres_ont_44616",i.name)),e.onClose()}},children:n("retirer_de_la_d_64963")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})};let EB=class extends Sw{translationService;inputName="massPreAssign";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(),level:zc.Yj().required(this.t("le_niveau_est_r_81100")).oneOf(ii,this.t("le_niveau_est_r_81100"))}}step2Fields(){return{positionsCategoriesIds:zc.YO().of(zc.ai()).test("non-empty-categories",this.t("vous_devez_s_le_32044"),function(){return this.parent.level!==In.Categories||this.parent.positionsCategoriesIds.length>0}),positionsIds:zc.YO().of(zc.ai()).test("non-empty-positions",this.t("vous_devez_s_le_89603"),function(){return this.parent.level!==In.Positions||this.parent.positionsIds.length>0})}}};EB=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],EB);const wB=e=>{const n=Fi();return(0,i.jsxs)(bw,{handleSubmit:e.handleSubmit,nextText:n("suivant_pr_a_99182"),prefix:"massPreAssign.",strategies:[{label:n("ajouter_des_pr_46968"),value:hn.Add},{label:n("remplacer_les_p_59777"),value:hn.Replace}],children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:n("_quel_niveau_s_87878")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"massPreAssign.level",value:In.Categories,children:n("pr_affecter_su_68204")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"massPreAssign.level",value:In.Positions,children:n("pr_affecter_su_38603")})]})},$B=e=>{const n=Fi();return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{css:{paddingRight:0},width:48,children:(0,i.jsx)(sm,{state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:n=>{e.change("massPreAssign.positionsCategoriesIds",Ko(e.positionsCategoriesIds,e.category.id,"checked"===n))}})}),(0,i.jsx)($m,{children:e.category.name}),(0,i.jsx)($m,{children:(0,i.jsx)(Ku,{color:e.category.assignedResources>=e.category.resources?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",e.category.assignedResources,e.category.resources)})})]})},TB=e=>{const n=Fi(),[t,s,o]=Wm(""),{data:a,isLoading:r}=Li("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 d=(0,V.useMemo)(()=>g(s)?(a.event?.positionsCategories??[]).filter(e=>e.name.trim().toLowerCase().includes(s.trim().toLowerCase())):a.event?.positionsCategories??[],[a.event?.positionsCategories,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_une_66722"),value:t,onChange:o})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{css:{paddingRight:0},width:48}),(0,i.jsx)(Gm,{children:n("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gm,{})]}),numberOfPages:1,offset:0,rows:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):d.map(n=>(0,i.jsx)($B,{category:n,change:e.change,positionsCategoriesIds:e.values.massPreAssign.positionsCategoriesIds},n.id)),setOffset:Bc.A,title:(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{children:n("s_lectionner_le_58635")}),(0,i.jsx)(Mr,{font:"gray500 textSm regular",children:n("les_membres_s_l_66443")})]}),totalCount:d.length??0}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:e.handleSubmit,children:n("pr_affecter_le_81533",e.numberOfSelected)})})]})},zB=e=>{const n=Fi();return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{css:{paddingRight:0},width:48,children:(0,i.jsx)(sm,{state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:n=>{e.change("massPreAssign.positionsIds",Ko(e.positionsIds,e.position.id,"checked"===n))}})}),(0,i.jsxs)($m,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:e.position.name}),(0,i.jsx)(Mr,{color:"gray500",children:e.position.positionCategoryName})]}),(0,i.jsx)($m,{children:(0,i.jsx)(Ku,{color:e.position.assignedResources>=e.position.resources?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",e.position.assignedResources,e.position.resources)})})]})},OB=e=>{const n=Fi(),[t,s,o]=Wm(""),[a,r]=(0,V.useState)(0),[d,l]=(0,V.useState)(null),{data:c,isLoading:u}=Li("query MassPreAssignPositions(\n $eventId: EventId!\n $name: String\n $offset: Int\n $sort: PositionsSort\n) {\n event(id: $eventId) {\n positions(name: $name, limit: 25, offset: $offset, sort: $sort) {\n nodes {\n id\n name\n positionCategoryName\n assignedResources\n resources\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:e.eventId,name:g(s)?s:void 0,offset:a,sort:d},[]);const{numberOfPages:m,totalCount:h}=Sx(c.event?.positions);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),value:t,onChange:e=>{r(0),o(e)}})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{css:{paddingRight:0},width:48}),(0,i.jsx)($x,{attribute:En.Name,setSort:e=>{l(e),r(0)},sort:d,children:n("nom_de_la_missi_64605")}),(0,i.jsx)(Gm,{})]}),numberOfPages:m,offset:a,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):c.event.positions.nodes.map(n=>(0,i.jsx)(zB,{change:e.change,position:n,positionsIds:e.values.massPreAssign.positionsIds},n.id)),setOffset:r,title:(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{children:n("s_lectionner_le_26300")}),(0,i.jsx)(Mr,{font:"gray500 textSm regular",children:n("les_membres_s_l_63510")})]}),totalCount:h}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{onClick:e.handleSubmit,children:n("pr_affecter_le_81533",e.numberOfSelected)})})]})},RB=e=>{const n=Fi(),t=ki(EB),{mutate:s}=xl();return(0,i.jsx)(Cw,{children:(0,i.jsx)(Hx,{category:n("pr_affectation_12256"),heading:n("pr_affecter_le_71377"),onClose:e.onClose,children:(0,i.jsx)(Gx,{children:(0,i.jsxs)(vS,{initialValues:{massPreAssign:{level:In.Categories,selecteds:e.selecteds,strategy:hn.Add,positionsIds:[],positionsCategoriesIds:[]}},isEdit:!1,onSubmit:async t=>{const i=(await s({eventId:e.eventId,massPreAssign:t.massPreAssign})).numberOfMembers;e.onSuccess(n("_1_membres_ont_49355",i)),e.onClose()},children:[(0,i.jsx)(jS,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(wB,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(jS,{heading:n("pr_affectation_68999"),render:n=>n.values.massPreAssign.level===In.Categories?(0,i.jsx)(TB,{change:n.form.change,eventId:e.eventId,handleSubmit:n.handleSubmit,numberOfSelected:e.numberOfSelected,values:n.values}):(0,i.jsx)(OB,{change:n.form.change,eventId:e.eventId,handleSubmit:n.handleSubmit,numberOfSelected:e.numberOfSelected,values:n.values}),schema:t.step2Schema()})]})})})})},DB=e=>{const n=Fi(),{mutate:t,isLoading:s}=lr(),[o,a]=(0,V.useState)(it.WaitingAssignment);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("mettre_jour_l_82143")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Up,{label:n("nouveau_statut_57871"),value:o,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{value:it.NotApplicable,children:n(it.NotApplicable)}),(0,i.jsx)("option",{value:it.Refused,children:n(it.Refused)}),(0,i.jsx)("option",{value:it.WaitingAssignment,children:n(it.WaitingAssignment)})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{isLoading:s,onClick:async()=>{const i=(await t({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(n("le_statut_d_aff_39000",i,n(o))),e.onClose()},children:n("modifier_le_sta_94473")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},MB=e=>{const{translate:n,params:{eventId:t}}=Kl(),{organization:s}=XS(),{canAccreditationRead:o,canCampaignSend:a,canDelegationRead:r,canDocumentRead:d,canMemberAccredit:l,canMemberAssign:c,canMemberAvailabilitiesEdit:u,canMemberCreate:m,canMemberDelete:h,canMemberEdit:p,canPositionRead:I,canPrint:x,canTicketIdRegenerate:f}=oy(),{showNotification:_}=AS(),{mutate:j}=Ra(),{mutate:v}=tr(),{mutate:S}=Ga(),{mutate:y}=or(),{mutate:C}=cl(),{data:b,isLoading:A}=Li("query VolunteerActions($eventId: EventId!) {\n event(id: $eventId) {\n hasDelegations\n hasForms\n numberOfZplDocuments\n weezeventEventId\n }\n}\n",{eventId:t},[]),[E,w]=(0,V.useState)(!1),[$,T]=(0,V.useState)(!1),[z,O]=(0,V.useState)(!1),[R,D]=(0,V.useState)(!1),[M,P]=(0,V.useState)(!1),[k,F]=(0,V.useState)(!1),[N,L]=(0,V.useState)(!1),[U,B]=(0,V.useState)(!1),[W,G]=(0,V.useState)(!1),[q,H]=(0,V.useState)(!1),[Y,Z]=(0,V.useState)(!1),[K,X]=(0,V.useState)(!1),[Q,J]=(0,V.useState)(!1),[ee,ne]=(0,V.useState)(!1),[te,ie]=(0,V.useState)(!1),[se,oe]=(0,V.useState)(!1),[ae,re]=(0,V.useState)(!1),[de,le]=(0,V.useState)(!1),[ce,ue]=(0,V.useState)(!1),me=e.massActions.getSelectedsInput(e.predicates,e.scope),ge=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,he=(0,V.useCallback)(n=>{g(n)&&_(n),e.onMassEditSuccess()},[e.onMassEditSuccess]),pe=(0,V.useCallback)(async()=>{const e=(await v({eventId:t,selecteds:me,numberOfCopies:1})).numberOfCreatedMembers;he(n("_1_membres_ont_35202",e))},[t,v,he,me]),Ie=(0,V.useCallback)(async()=>{const e=(await y({eventId:t,selecteds:me})).numberOfMembers;he(n("les_accr_ditati_80622",e))},[t,me,he]),xe=p||u||I||o||r||f||h,fe=(0,V.useMemo)(()=>x&&!A&&!!b.event.weezeventEventId&&!!b.event.numberOfZplDocuments,[x,A,b]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{flex:"1"}}),p&&(0,i.jsx)(tc,{onClick:()=>{w(!0)},children:n("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&I&&c&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"wand-magic-sparkles",onClick:()=>D(!0)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("affecter_1_me_24704",ge)})]}),!e.showOnlyMassEdit&&o&&l&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"badge-check",onClick:()=>P(!0)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("accr_diter_1_13773",ge)})]}),!e.showOnlyMassEdit&&xe&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsxs)(lw,{title:n("gestion_des_mem_51660"),children:[p&&(0,i.jsx)(Pu,{icon:"merge",onClick:()=>T(!0),children:n("fusionner_les_m_37150")}),m&&(0,i.jsx)(Pu,{icon:"clone",onClick:pe,children:n("CanLeadersDuplicateMembers")}),u&&(0,i.jsx)(Pu,{icon:"calendar",isDisabled:!b.event?.hasForms,onClick:()=>F(!0),children:n("mettre_jour_l_84190")})]}),(0,i.jsx)(lw,{title:n("affectation_plural"),children:I&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pu,{icon:"wand-magic-sparkles",onClick:()=>O(!0),children:n("changer_le_stat_39694")}),(0,i.jsx)(Pu,{icon:"wand-magic-sparkles",onClick:()=>B(!0),children:n("pr_affecter_1_62649",ge)}),(0,i.jsx)(Pu,{icon:"circle-check",onClick:()=>G(!0),children:n("mettre_jour_l_00128")})]})}),(0,i.jsxs)(lw,{title:n("accr_ditations_39450"),children:[o&&(0,i.jsx)(Pu,{icon:"badge-check",onClick:()=>H(!0),children:n("changer_le_stat_27596")}),o&&l&&(0,i.jsx)(Pu,{icon:"check",onClick:Ie,children:n("valider_les_acc_80801")}),o&&l&&(0,i.jsx)(Pu,{icon:"badge-check",onClick:()=>Z(!0),children:n("ajouter_un_prof_96916",ge)}),o&&fe&&(0,i.jsx)(Pu,{icon:"hand-back-fist",onClick:()=>le(!0),children:n("imprimer_un_bra_94539")}),r&&(0,i.jsx)(Pu,{icon:"people-group",isDisabled:!b.event?.hasDelegations,onClick:()=>X(!0),children:n("ajouter_1_mem_86218",ge)}),r&&p&&(0,i.jsx)(Pu,{icon:"minus",isDisabled:!b.event?.hasDelegations,onClick:()=>J(!0),children:n("retirer_1_mem_57996",ge)})]}),(0,i.jsxs)(lw,{title:n("communication_05277"),children:[p&&(0,i.jsx)(Pu,{icon:"file-lines",isDisabled:!b.event?.hasForms,onClick:()=>ne(!0),children:n("ajouter_1_mem_52947",ge)}),p&&(0,i.jsx)(Pu,{icon:"file-lines",isDisabled:!b.event?.hasForms,onClick:()=>ie(!0),children:n("marquer_un_form_10633")}),a&&(0,i.jsx)(Pu,{icon:"paper-plane",onClick:()=>oe(!0),children:n("SendCampaign")}),d&&(0,i.jsx)(Pu,{icon:"file",onClick:()=>re(!0),children:n("exporter_un_doc_23130")})]}),(0,i.jsxs)(lw,{children:[f&&(0,i.jsx)(Pu,{color:"red",icon:"repeat",onClick:()=>ue(!0),children:n("r_g_n_rer_les_c_44410")}),h&&(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>L(!0),children:n("d_sinscrire_de_06416")})]})]})]}),E&&(0,i.jsx)(_w,{eventId:t,mutate:e=>j({organizationId:s.id,eventId:t,massEdit:e}),organizationId:s.id,selecteds:me,onClose:()=>w(!1),onSuccess:e=>{he(n("_1_membres_ont_07596",e))}}),$&&(0,i.jsx)(kN,{eventId:t,numbersOfSelected:ge,organizationId:s.id,usersInfosIds:me.ids||[],onClose:()=>T(!1),onSuccess:he}),z&&(0,i.jsx)(DB,{eventId:t,selecteds:me,onClose:()=>O(!1),onSuccess:he}),R&&(0,i.jsx)(vB,{eventId:t,numberOfSelected:ge,selecteds:me,onClose:()=>D(!1),onSuccess:he}),M&&(0,i.jsx)(Vw,{eventId:t,numberOfSelected:ge,selecteds:me,onClose:()=>P(!1),onSuccess:he}),k&&(0,i.jsx)(bB,{eventId:t,numberOfSelected:ge,organizationId:s.id,selecteds:me,onClose:()=>F(!1),onSuccess:he}),U&&(0,i.jsx)(RB,{eventId:t,numberOfSelected:ge,selecteds:me,onClose:()=>B(!1),onSuccess:he}),W&&(0,i.jsx)(cB,{eventId:t,organizationId:s.id,selecteds:me,onClose:()=>G(!1),onSuccess:he}),N&&(0,i.jsx)(ow,{buttonText:n("d_sinscrire_27046"),subtext:[n("_tes_vous_s_r_d_46029")],text:n("d_sinscription_66971",ge),onClose:()=>L(!1),onDelete:async()=>{const e=(await S({eventId:t,selecteds:me})).numberOfMembers;he(n("_1_membres_ont_85190",e))}}),q&&(0,i.jsx)(gB,{eventId:t,selecteds:me,onClose:()=>H(!1),onSuccess:he}),ee&&(0,i.jsx)(RN,{eventId:t,organizationId:s.id,selecteds:me,onClose:()=>ne(!1),onSuccess:he}),te&&(0,i.jsx)(DN,{eventId:t,organizationId:s.id,selecteds:me,onClose:()=>ie(!1),onSuccess:he}),Y&&(0,i.jsx)(mB,{eventId:t,selecteds:me,onClose:()=>Z(!1),onSuccess:he}),K&&(0,i.jsx)(ON,{eventId:t,organizationId:s.id,selecteds:me,onClose:()=>X(!1),onSuccess:he}),Q&&(0,i.jsx)(AB,{eventId:t,organizationId:s.id,selecteds:me,onClose:()=>J(!1),onSuccess:he}),se&&(0,i.jsx)(Ww,{eventId:t,organizationId:s.id,selecteds:me,onClose:()=>oe(!1),onSuccess:he}),ae&&(0,i.jsx)(uB,{selecteds:me,onClose:()=>re(!1),onSuccess:e.onMassEditSuccess}),de&&(0,i.jsx)(Kw,{eventId:t,isOpen:de,selecteds:me,setIsOpen:le,sort:e.sort}),ce&&(0,i.jsx)(ow,{buttonText:n("r_g_n_rer_37440"),subtext:[n("_tes_vous_s_r_d_60491"),n("cela_rendra_les_60931")],text:n("r_g_n_rer_les_c_44410"),onClose:()=>ue(!1),onDelete:async()=>{const{numberOfEdited:e}=await C({eventId:t,selecteds:me});he(n("les_codes_barre_03402",e))}})]})},PB=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{hasFeature:o}=XS(),a=ki(Oh),{canMemberEdit:r}=oy(),[d,l]=zD("accreditationMembers.columns",[Th.Name,Th.Accreditations]),[c,u]=zD("accreditationMembers.limit",Tm),[m,g]=zD("accreditationMembers.predicates",[]),h=(0,V.useMemo)(()=>xg(m),[m]),[p,I]=zD("accreditationMembers.sort",null),{data:x}=cr({organizationId:t,eventId:s,privacy:Ee.All,loadCustomDocuments:!1,loadForms:!1,loadSegments:!1}),f=(0,V.useMemo)(()=>x.organization?.customFields.nodes??[],[x.organization]),_=Kb(f),j=(0,V.useMemo)(()=>x.event?a.getAccreditationMembersFilters(t,s,f,x.event,{hasDelegations:o(Ze.Delegation)}):[],[s,f,x.event]),v=(0,V.useMemo)(()=>a.getAccreditationMembersPossibleColumns(t,f),[t,f]),S=(0,V.useMemo)(()=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,accreditationProfileCategoryId:e.accreditationProfileCategoryId,accreditationProfileId:e.accreditationProfileId,accreditationSlotId:e.accreditationSlotId}),[e.accreditationCategoryId,e.accreditationId,e.accreditationProfileCategoryId,e.accreditationProfileId,e.accreditationSlotId]);return(0,i.jsx)(yy,{children:(0,i.jsx)(Cx,{columns:d,columnsSearch:[],columnsToIncludes:zh,eventId:s,filters:j,getMassActionId:e=>e.userInfo.id,limit:c,loadDataList:hr,loadDataListParams:{accreditationsCategoriesIds:"number"==typeof e.accreditationCategoryId?[e.accreditationCategoryId]:void 0,accreditationsIds:"number"==typeof e.accreditationId?[e.accreditationId]:void 0,accreditationsProfilesCategoriesIds:"number"==typeof e.accreditationProfileCategoryId?[e.accreditationProfileCategoryId]:void 0,accreditationsProfilesIds:"number"==typeof e.accreditationProfileId?[e.accreditationProfileId]:void 0,accreditationsSlotsIds:"number"==typeof e.accreditationSlotId?[e.accreditationSlotId]:void 0,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:gr,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:v,predicates:h,renderActions:(e,n,t)=>(0,i.jsx)(MB,{massActions:e,predicates:h,scope:S,showOnlyMassEdit:!0,sort:p,totalNumberOfMembers:n,onMassEditSuccess:t}),renderAllSelectedText:e=>n("les_1_membres_31409",e),renderPageSelectedText:e=>n("les_1_membres_00895",e),renderSelectAllText:e=>n("s_lectionner_le_34300",e),rendering:xh.List,setColumns:l,setLimit:u,setPredicates:g,setSort:I,showEditColumns:!0,showEditMode:r,showFilters:!0,showMassActions:r,showPredicatesBadges:!0,showRowDropdown:r,showRowEdit:r,showSearchColumns:!1,showSelectAll:!0,sort:p,children:(0,i.jsx)(kx,{renderCell:(e,n,t)=>(0,i.jsx)(pE,{canChangeDelegation:!0,canMemberAccredit:!0,canMemberAssign:!0,column:e,customField:_.get(e.slug),eventId:s,reloadRow:t,row:n})})})})},kB=e=>{const{params:{organizationId:n,eventId:t,accreditationId:s},translate:o}=Kl();Au(e.event.accreditation.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":t,accreditationId:e?":accreditationId":s});return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(LV,{accreditation:e.event.accreditation}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:Ws.ACCREDITATION_DASHBOARD(a(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:Ws.ACCREDITATION_MEMBERS(a(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($y,{path:Ws.ACCREDITATION_DASHBOARD(a(!0)),children:(0,i.jsx)(lB,{})}),(0,i.jsx)($y,{path:Ws.ACCREDITATION_MEMBERS(a(!0)),children:(0,i.jsx)(PB,{accreditationId:s})})]})]})},FB=()=>{const{params:{organizationId:e,eventId:n,accreditationId:t}}=Kl(),{data:s,loader:o}=Li("query Accreditation($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n accreditationCategoryId\n accreditationCategoryName\n assignedResources\n hasSlots\n acronym\n color\n icon\n numberOfSlots\n }\n\n volunteersRegistrations(accreditationsIds: [$accreditationId]) {\n totalCount\n }\n }\n}\n",{eventId:n,accreditationId:t},[]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:Ws.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(qi,{path:Ws.ACCREDITATION_DASHBOARD({organizationId:e,eventId:n,accreditationId:t}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(kB,{event:s.event})})]})},NB=e=>{const n=Fi(),t=e.isEdit?"0px":e.isLeftPanelOpen?"280px":"68px",s=e.isRightPanelOpen?"360px":"68px";return(0,i.jsxs)(eu,{css:{overflow:"hidden"},gridtemplatecolumns:`${t} 1fr ${s}`,gridtemplaterows:"88px 1fr 72px",height:1,width:1,children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{borderRight:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"1 / 3"},children:e.isLeftPanelOpen&&e.leftPanel}),(0,i.jsx)(Tl,{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)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"sidebar",onClick:()=>{e.setIsLeftPanelOpen(!e.isLeftPanelOpen)}})})}),(0,i.jsx)(Dx,{placement:"top",children:e.isLeftPanelOpen?n("cacher_la_liste_66205"):n("afficher_la_lis_14277")})]})})]}),(0,i.jsx)(Mr,{css:{gridColumn:"2 / 4",gridRow:"1 / 2"},children:e.header}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid $gray200",gridColumn:"2 / 3",gridRow:"2 / 3",overflowY:"auto"},children:e.children}),(0,i.jsx)(Mr,{css:{gridColumn:"2 / 3",gridRow:"3 / 4"},children:e.buttons}),(0,i.jsx)(Mr,{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)(Tl,{css:{paddingTop:"$6"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:()=>{e.setIsRightPanelOpen(!0)},children:(0,i.jsx)(Yl,{icon:"sidebar"})})}),(0,i.jsx)(Dx,{placement:"top",children:n("afficher_les_in_82197")})]})})})]})},LB=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,userInfoId:a}}=Kl(),r=ki(Jm),d=(0,V.useMemo)(()=>e.teams.find(n=>n.leaderUserInfoId===e.userInfo.id),[e.teams,e.userInfo]),l=(0,V.useMemo)(()=>e.teams.flatMap(e=>e.members.flatMap(e=>e.userInfo.id===a?[]:[e.userInfo])),[e.teams]);return(0,i.jsxs)(Tl,{align:"center",css:{padding:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Mr,{css:{position:"relative"},children:[(0,i.jsx)(t_,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:32}),(0,i.jsx)(Tl,{align:"center",css:{background:Ar.colors[`${e.badgeColorIcon.color}100`].value,border:"2px solid white",borderRadius:"16px",bottom:"-6px",color:Ar.colors[`${e.badgeColorIcon.color}700`].value,fontSize:"8px",position:"absolute",right:"-6px"},height:16,justify:"center",width:16,children:(0,i.jsx)(Yl,{icon:e.badgeColorIcon.leftIcon})})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(ql,{to:Rj.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:a}),children:(0,i.jsx)(Mr,{css:{cursor:"pointer","&:hover":{textDecoration:"underline"}},font:"gray900 textXl medium",children:e.userInfo.name})}),(0,i.jsxs)(Mr,{color:"gray500",children:["(",e.userInfo.email,")"]}),e.showTeam&&d&&(0,i.jsx)(Ku,{leftIcon:"shield",children:t("chef_d_quipe_20641")}),e.delegation&&(0,i.jsx)(Ku,{cursor:"pointer",leftIcon:"building",onClick:()=>n.push(Js.DELEGATION({organizationId:s,eventId:o,delegationId:e.delegation.id})),children:e.delegation.name})]}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray500",children:r.toLocaleString(e.insertedAt,Uo.DateOnly.MonthLong)}),e.showTeam&&Yo(e.teams)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray500",children:"‱"}),(0,i.jsx)(Mr,{color:"gray500",children:t("_quipe_1_07445",e.teams[0].teamCode)}),(0,i.jsx)(Mr,{color:"gray500",children:"‱"}),(0,i.jsx)(lE,{teamMembers:l})]})]})]}),e.showTabs&&(0,i.jsx)(Mr,{width:320,children:(0,i.jsxs)(Gv,{selectedItem:e.isPreAssign?"preassign":"affect",onChange:t=>{"preassign"!==t||e.isPreAssign?"affect"===t&&e.isPreAssign&&n.replace(yo.ASSIGNMENT(s,o,a)):n.replace(yo.PRE_ASSIGNMENT(s,o,a))},children:[(0,i.jsx)(qv,{item:"affect",children:t("affecter_94255")}),(0,i.jsx)(qv,{item:"preassign",children:t("pr_affecter_17434")})]})})]})},UB=e=>{const n=Fi(),t=ki(Jm);return(0,i.jsxs)(Tl,{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)(t_,{email:e.vr.userInfo.email,image:e.vr.userInfo.picture?.url,name:e.vr.userInfo.name,size:40}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:e.vr.userInfo.name}),(0,i.jsx)(Mr,{children:n("inscrit_le_1_12018",t.toLocaleString(e.vr.insertedAt,Uo.DateOnly.MonthLong))})]})]})},VB=()=>(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"3",children:[(0,i.jsx)(Qu,{size:40,variant:"circular"}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1})]})]}),BB=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),a=e.event?.delegations?.nodes??[],r=e.event?.segmentsFolders??[],d=e.event?.volunteersRegistrations.totalCount??0,l=e.event?.volunteersRegistrations.nodes??[];return(0,i.jsxs)(Tl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Tl,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Gy,{color:"primary",returnPathFallback:Ws.ACCREDITATIONS({organizationId:t,eventId:s}),children:o("retour_92202")}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(Ku,{color:"error",size:"sm",children:o("profil_restant",d)})]})]}),(0,i.jsxs)(Tl,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:o("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(Ou,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"bottom",children:(0,i.jsxs)(Tl,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsxs)(Up,{label:o("date_d_inscript_31369"),value:e.direction,onChange:e.setDirection,children:[(0,i.jsx)("option",{value:Gn.Desc,children:o("du_plus_r_cent_76468")}),(0,i.jsx)("option",{value:Gn.Asc,children:o("du_plus_ancien_08999")})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:o("vue_personnalis_97654")}),e.isLoading?(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:[e.segmentId],onChange:n=>{Yo(n)?e.setSegmentId((0,lg.A)(n)):e.setSegmentId(-1)},children:r.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)(_m,{isSelectAllVisible:!0,label:o("status_d_affect_75769"),multiple:!0,values:e.states,onChange:e.setStates,children:[(0,i.jsx)("option",{value:it.WaitingAssignment,children:o(it.WaitingAssignment)}),(0,i.jsx)("option",{value:it.PreAssigned,children:o(it.PreAssigned)}),(0,i.jsx)("option",{value:it.Assigned,children:o(it.Assigned)})]}),e.showAccreditationStates&&(0,i.jsxs)(_m,{isSelectAllVisible:!0,label:o("statut_d_accr_d_75527"),multiple:!0,values:e.accreditationStates,onChange:e.setAccreditationStates,children:[(0,i.jsx)("option",{value:ge.WaitingAccreditation,children:o(ge.WaitingAccreditation)}),(0,i.jsx)("option",{value:ge.AutoAccredited,children:o(ge.AutoAccredited)}),(0,i.jsx)("option",{value:ge.Accredited,children:o(ge.Accredited)})]}),e.loadDelegations&&(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:o("Delegation")}),e.isLoading?(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:e.delegationId?[e.delegationId]:[],onChange:n=>{Yo(n)?e.setDelegationId((0,lg.A)(n)):e.setDelegationId(null)},children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})})]})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(VB,{}),(0,i.jsx)(VB,{}),(0,i.jsx)(VB,{})]}):l.map(t=>(0,i.jsx)(UB,{displayBorder:!0,isSelected:t.userInfo.id===e.userInfoId,vr:t,onClick:()=>{n.push(e.getPath(t.userInfo.id))}},t.userInfo.id))})]})},WB=e=>{const[n,t]=V.useState(e.isOpen??!0),s=V.useCallback(n=>{e.setIsOpen?.(n),t(n)},[e.setIsOpen,t]);return V.useEffect(()=>{"boolean"==typeof e.isOpen&&t(e.isOpen)},[e.isOpen]),(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",padding:"$6",...e.css},direction:"column",gap:"4",children:[(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",userSelect:"none",...e.titleCss},gap:"4",onClick:()=>{s(!n)},children:[(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:n?"chevron-down":"chevron-right"})}),(0,i.jsx)(Tl,{css:{color:"$gray800",flex:"1",fontWeight:"$semiBold"},children:e.title})]}),n&&e.children]})},GB=e=>{const n=Fi(),t=ki(Jm),[s,o]=zD("assignment.rightPanel.areAccreditationsOpen",!0),a=(0,V.useMemo)(()=>function(e,n,t,i){return e.flatMap(e=>e.accreditationsSlots.map(e=>{const s=Uh(n,e,e.accreditation.name,{defaultName:"-"});return{name:e.accreditation.name,subtitle:s,path:Ws.ACCREDITATION({organizationId:t,eventId:i,accreditationId:e.accreditation.id})}}))}(e.formsUsersInfos,t,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(WB,{isOpen:s,setIsOpen:o,title:n("accr_ditations_74375"),children:(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{children:(0,i.jsx)(Gm,{children:n("accr_ditation_s_00595")})}),a.map((e,n)=>(0,i.jsx)(km,{children:(0,i.jsxs)($m,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",children:e.name}),(0,i.jsx)(Mr,{color:"gray500",children:e.subtitle})]})},n))]})})},qB=e=>{const n=ki(Jm);return(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{justify:"between",children:[(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:e.comment.writtenBy.userInfo.name}),(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:n.toLocaleString(e.comment.insertedAt,{...Uo.DateTime,month:"numeric"})})]}),(0,i.jsx)(Tl,{css:{background:"$gray100",bd:!0,borderTopLeftRadius:"0",padding:"$2 $3",whiteSpace:"pre-wrap"},children:e.comment.content})]})},HB=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{data:o,isLoading:a,reload:r}=ml({organizationId:n,userInfoId:s}),{mutate:d,isLoading:l}=ul(),[c,u]=(0,V.useState)(""),{permissions:[m]}=iE(KA({organizationId:n,eventId:t,userInfoId:s}));return(0,i.jsxs)(Tl,{css:{padding:"0 $6 $4 $6"},direction:"column",gap:"3",children:[a?(0,i.jsx)(Qu,{borderRadius:"$1",height:40,variant:"rectangular",width:1}):o.organization.userInfo.comments.map(e=>(0,i.jsx)(qB,{comment:e},e.id)),m&&(0,i.jsxs)(xx,{children:[(0,i.jsx)(fx,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:e("ajouter_un_comm_27671")})}),(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"message",children:e("ajouter_un_comm_27671")}),(0,i.jsx)(hx,{children:(0,i.jsx)(af,{label:e("commentaire_08754"),value:c,onChange:u})}),(0,i.jsx)(gx,{children:o=>(0,i.jsx)(tc,{disabled:h(c),isLoading:l,onClick:async()=>{await d({organizationId:n,eventId:t,userInfoId:s,comment:{content:c}}),r(),o()},children:e("ajouter_97327")})})]})]})]})},YB=e=>{const n=Fi(),[t,s]=zD("assignment.rightPanel.areInformationsOpen",!0);return(0,i.jsxs)(WB,{isOpen:t,setIsOpen:s,title:e.title,children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)($E,{children:n("Email")}),(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0,fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.userInfo.email})]}),e.customFields.map(n=>(0,i.jsx)(TE,{field:n,fields:e.userInfo.fields},n.id)),e.formsIds.map(t=>{const s=AE(t,n);return g(e.userInfo.fields[s.slug])?(0,i.jsx)(TE,{field:s,fields:e.userInfo.fields},s.slug):null})]})},ZB=e=>{const n=Fi(),t=ki(Bg),[s,o]=zD("assignment.rightPanel.arePositionsOpen",!0),a=(0,V.useMemo)(()=>BE(e.formsUsersInfos,t,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(WB,{isOpen:s,setIsOpen:o,title:n("missions_souhai_23225"),children:(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{children:(0,i.jsx)(Gm,{children:n("mission_souhait_49168")})}),a.map((e,t)=>(0,i.jsx)(km,{children:(0,i.jsxs)($m,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",children:e.name}),e.form.positionRanking===sn.Ranked&&(0,i.jsx)(Ku,{children:n("choix_n_1_00613",e.rank)})]}),(0,i.jsx)(Mr,{color:"gray500",children:e.range})]})},t))]})})},KB=e=>{const n=Fi(),t=ki(Jm),s=ki(Bg),[o,a]=zD("assignment.rightPanel.areAvailabilitiesOpen",!0),r=(0,V.useMemo)(()=>(0,Lm.A)(e.formsUsersInfos.flatMap(e=>e.slots.map(n=>({display:e.form.slotDisplay,slot:n}))),({slot:e})=>e.range.start.toMillis()).map(({display:e,slot:n})=>e===Ln.Calendar||e===Ln.DisplayDays?t.toLocaleString(n.range.start,Uo.DateOnly.MonthLong):s.toDisplayString(n.range)),[t,s,e.formsUsersInfos]);return(0,i.jsx)(WB,{isOpen:o,setIsOpen:a,title:n("disponibilit_s_49923"),children:(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{children:(0,i.jsx)(Gm,{children:n("disponibilit_92461")})}),r.map((e,n)=>(0,i.jsx)(km,{children:(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",children:e})})},n))]})})},XB=e=>{const n=Fi(),t=(0,V.useMemo)(()=>e.formsUsersInfos.map(e=>e.form.id),[e.formsUsersInfos]);return(0,i.jsxs)(Tl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(Yl,{icon:"sidebar"})})}),(0,i.jsx)(Dx,{placement:"top",children:n("cacher_les_info_51832")})]}),(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:n("_propos_de_1_50761",e.userInfo.name)})]}),(0,i.jsx)(HB,{}),(0,i.jsx)(YB,{customFields:e.customFields,formsIds:t,title:n("informations_22954"),userInfo:e.userInfo}),(0,i.jsx)(KB,{formsUsersInfos:e.formsUsersInfos}),e.showWishedPositions&&(0,i.jsx)(ZB,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId}),e.showWishedAccreditations&&(0,i.jsx)(GB,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId})]})},QB=(0,V.createContext)({}),JB=e=>{const[n,t]=(0,V.useState)(e.accreditationProfileId),[s,o]=(0,V.useState)(e.accreditationsSlotsIds);return(0,i.jsx)(QB.Provider,{value:{accreditationProfileId:n,accreditationsSlotsIds:s,alreadyAssignedProfileId:e.alreadyAssignedProfileId,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,isEdit:e.isEdit,showNextMember:e.showNextMember,setAccreditationProfileId:t,setAccreditationsSlotsIds:o},children:e.children})};function eW(){return(0,V.useContext)(QB)}const nW=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),{accreditationProfileId:a,accreditationsSlotsIds:r,showNextMember:d}=eW(),{mutate:l,isLoading:c}=ar(),{mutate:u,isLoading:m}=ja(),g=(0,V.useCallback)(()=>{e.isEdit?n.goBack(yo.VOLUNTEERS(t,s)):d()},[e.isEdit,d]);return(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,justify:"end",width:1,children:[(0,i.jsx)(Mr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{m||c||(await l({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:ge.Refused}}),g())},children:o("refuser_92819")}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(tc,{color:"primary",isLoading:m,onClick:async()=>{m||c||(await u({eventId:s,massAccredit:{accreditationsSlotsIds:r,accreditationProfile:{accreditationProfileId:a},selecteds:{ids:[e.userInfoId]},strategy:hn.Replace}}),g())},children:e.isEdit?o("mettre_jour_l_11622"):o("accr_diter_70543")}),(0,i.jsx)(tc,{color:"white",onClick:g,children:e.isEdit?o("annuler_48254"):o("accr_diter_plus_19053")})]})},tW=e=>{const{accreditationsSlotsIds:n,alreadyAssignedSlotsIds:t,setAccreditationsSlotsIds:s}=eW(),o=(0,V.useMemo)(()=>Vh(e.accreditationsSlots.filter(n=>n.accreditationId===e.accreditation.id)),[e.accreditationsSlots,e.accreditation]),a=(0,V.useMemo)(()=>Object.fromEntries(o.map(e=>[e.id,e])),[o]),r=(0,V.useMemo)(()=>Object.fromEntries((e.delegationAccreditationsSlots||[]).map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),d=(0,V.useCallback)(e=>{const n=r[e],t=a[e];return(0,Dg.A)((0,kl.A)(["number"==typeof t?.maxResources?{assignedResources:t.assignedResources,maxResources:t.maxResources,remaining:t.maxResources-t.assignedResources}:null,"number"==typeof n?.maxResources?{assignedResources:n.assignedResources,maxResources:n.maxResources,remaining:n.maxResources-n.assignedResources}:null]),e=>e.remaining)??null},[r,a]),l=(0,V.useCallback)(e=>{const n=r[e],i=a[e],s=!!n&&n.isFull&&!t.includes(e),o=!!i&&(i.isBlocked||i.isFull&&!t.includes(e));return s||o},[t,r,a]),c=(0,V.useMemo)(()=>e.accreditation.hasSlots?null:(0,i.jsx)(Ow,{getAssignedMaxRemaining:d,slotId:e.accreditation.hiddenSlotId}),[d,e.accreditation]),u=n.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsx)(Ib,{accreditation:e.accreditation,badge:c,displayNumberOfSlots:e.accreditation.hasSlots,displaySlots:e.accreditation.hasSlots,numberOfSlots:o.length,renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(sm,{disabled:l(e.accreditation.hiddenSlotId),shouldPreventDefault:!1,state:u,onClick:Bc.A}),onClick:()=>{e.accreditation.hasSlots||l(e.accreditation.hiddenSlotId)||s(Ko(n,e.accreditation.hiddenSlotId,"unchecked"===u))},children:(0,i.jsx)(Tl,{css:{background:"white",padding:"$4"},children:e.accreditation.hasSlots?e.accreditation.accreditationDisplay===oe.Calendar?(0,i.jsx)(Dw,{accreditationsSlotsIds:n,slotIdToDas:r,slots:o,onChange:s}):(0,i.jsxs)(Tl,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsx)(Tl,{css:{padding:"$4"},direction:"column",gap:"3",children:e.accreditation.accreditationDisplay===oe.Radio?(0,i.jsx)(MR,{accreditation:e.accreditation,accreditationsSlotsIds:n,getAssignedMaxRemaining:d,getDisabled:l,slots:o,onChange:s}):(0,i.jsx)(DR,{accreditation:e.accreditation,accreditationsSlotsIds:n,getAssignedMaxRemaining:d,getDisabled:l,slots:o,onChange:s})}),(0,i.jsx)(PR,{accreditation:e.accreditation,accreditationsSlotsIds:n,slots:o,onChange:s})]}):null})})},iW=e=>{const n=(0,V.useMemo)(()=>uh((0,Rg.A)(e.accreditationsSlots.flatMap(n=>n.accreditationCategoryId===e.category.id?[n.accreditation]:[]),e=>e.id)),[e.accreditationsSlots,e.category]);return(0,i.jsx)(pb,{category:e.category.name,children:n.map(n=>(0,i.jsx)(tW,{accreditation:n,accreditationsSlots:e.accreditationsSlots,delegationAccreditationsSlots:e.delegation?.accreditationsSlots},n.id))})},sW=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(e.accreditationsSlots.map(e=>e.accreditationCategory),e=>e.id),e=>u(e.name)),[e.accreditationsSlots]);return(0,i.jsxs)(Tl,{css:{background:"white",bd:"gray200 2",padding:"$4 $5"},direction:"column",gap:"6",children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("accr_ditations_39450")}),(0,i.jsx)(hb,{css:{bd:"gray200 2"},children:t.map(n=>(0,i.jsx)(iW,{accreditationsSlots:e.accreditationsSlots,category:n,delegation:e.delegation},n.id))})]})},oW=e=>{const{accreditationProfileId:n,alreadyAssignedProfileId:t,setAccreditationProfileId:s}=eW(),o=(0,V.useMemo)(()=>(0,Lm.A)(e.accreditationsProfiles.filter(n=>n.accreditationProfileCategoryId===e.category.id),e=>u(e.name)),[e.accreditationsProfiles,e.category]);return(0,i.jsx)(pb,{category:e.category.name,children:o.map(o=>(0,i.jsx)(OR,{accreditationProfileId:n,alreadyAssignedProfileId:t,delegationAccreditationsProfiles:e.delegation?.accreditationsProfiles,profile:o,setAccreditationProfileId:s,showDescription:!1},o.id))})},aW=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(e.accreditationsProfiles.map(e=>e.accreditationProfileCategory),e=>e.id),e=>u(e.name)),[e.accreditationsProfiles]);return(0,i.jsxs)(Tl,{css:{background:"white",bd:"gray200 2",padding:"$4 $5"},direction:"column",gap:"6",children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("profils_d_accr_27825")}),(0,i.jsx)(hb,{css:{bd:"gray200 2"},children:t.map(n=>(0,i.jsx)(oW,{accreditationsProfiles:e.accreditationsProfiles,category:n,delegation:e.delegation},n.id))})]})},rW=e=>{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>e.event.accreditationsCategories.flatMap(e=>e.accreditations),[e.event.accreditationsCategories]),o=(0,V.useMemo)(()=>e.event.accreditationsProfilesCategories.flatMap(e=>e.accreditationsProfiles),[e.event.accreditationsProfilesCategories]),a=(0,V.useMemo)(()=>(e.accreditationsCategoriesIds||[]).map(n=>e.event.accreditationsCategories.find(e=>e.id===n).name).join(", "),[e.accreditationsCategoriesIds,e.event]),r=(0,V.useMemo)(()=>(e.accreditationsIds||[]).map(e=>s.find(n=>n.id===e).name).join(", "),[s,e.accreditationsIds]),d=(0,V.useMemo)(()=>(e.accreditationsProfilesIds||[]).map(e=>o.find(n=>n.id===e).name).join(", "),[o,e.accreditationsProfilesIds]),l=(0,V.useMemo)(()=>e.date?t.toLocaleString(e.date,Uo.DateOnly.MonthLong):"",[e.date]),c=(0,V.useMemo)(()=>e.segmentId?e.event.segments.find(n=>n.id===e.segmentId).name:"",[e.segmentId,e.event]),u=(0,V.useMemo)(()=>(e.tagsIds||[]).map(n=>e.organization.tags.nodes.find(e=>e.id===n).name).join(", "),[e.tagsIds,e.organization]);return g(a)||g(r)||g(d)||g(l)||g(c)||g(u)||e.excludeFull||e.excludePast||e.onlyDelegation?(0,i.jsxs)(Tl,{align:"center",gap:"3",wrap:"wrap",children:[g(a)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsCategoriesIds([]),children:n("cat_gories_1_42029",a)}),g(r)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsIds([]),children:n("accr_ditations_30765",r)}),g(d)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsProfilesIds([]),children:n("profils_d_accr_16603",d)}),g(l)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setDate(null),children:n("date_1_17337",l)}),g(c)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setSegmentId(null),children:n("vue_1_29260",c)}),g(u)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setTagsIds([]),children:n("tags_1_43158",u)}),e.excludeFull&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setExcludeFull(!1),children:n("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setExcludePast(!1),children:n("cr_neaux_dans_l_92999")}),e.onlyDelegation&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setOnlyDelegation(!1),children:n("accr_ditations_07661")}),(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:n("r_initialiser_l_66835")})]}):null},dW=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.accreditationsCategoriesIds),[o,a]=(0,V.useState)(e.accreditationsIds),[r,d]=(0,V.useState)(e.accreditationsProfilesIds),[l,c]=(0,V.useState)(e.date),[m,g]=(0,V.useState)(e.tagsIds),[h,p]=(0,V.useState)(e.segmentId?[e.segmentId]:[]),[I,x]=(0,V.useState)(e.onlyDelegation?"checked":"unchecked"),[f,_]=(0,V.useState)(e.excludeFull?"checked":"unchecked"),[j,v]=(0,V.useState)(e.excludePast?"checked":"unchecked"),S=(0,V.useMemo)(()=>(0,Lm.A)(e.event.accreditationsCategories,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.event.accreditationsCategories]),y=(0,V.useMemo)(()=>{return n=e.event.accreditationsCategories,(0,Lm.A)(n,e=>u(e.name)).map(e=>{const n=uh(e.accreditations);return(0,i.jsx)("optgroup",{label:e.name,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)});var n},[e.event.accreditationsCategories]),C=(0,V.useMemo)(()=>gb(e.event.accreditationsProfilesCategories),[e.event.accreditationsProfilesCategories]);return(0,i.jsxs)(Tl,{direction:"column",onChange:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,i.jsxs)(Tl,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("liste_des_filtr_75605")}),(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_97056"),renderOnPortal:!0,values:t||qo,onChange:s,children:S}),(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_92029"),renderOnPortal:!0,values:o||qo,onChange:a,children:y}),(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_72321"),renderOnPortal:!0,values:r||qo,onChange:d,children:C}),(0,i.jsx)(Wp,{max:e.event.endAt,min:e.event.startAt,placeholder:n("date_du_cr_neau_82295"),value:l,onChange:c}),(0,i.jsx)(_m,{isSearchVisible:!0,placeholder:n("s_lectionnez_un_19794"),renderOnPortal:!0,values:h,onChange:e=>{Yo(e)?p([(0,lg.A)(e)]):p([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_73255"),renderOnPortal:!0,values:m||qo,onChange:g,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(om,{state:I,onClick:x,children:n("seulement_les_a_45276")}),(0,i.jsx)(om,{state:f,onClick:_,children:n("masquer_les_cr_14425")}),(0,i.jsx)(om,{state:j,onClick:v,children:n("masquer_les_cr_05336")})]}),(0,i.jsxs)(Tl,{align:"center",css:{brderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:n("r_initialiser_77538")}),(0,i.jsx)(tc,{size:"sm",onClick:()=>{e.setAccreditationsCategoriesIds(t),e.setAccreditationsIds(o),e.setAccreditationsProfilesIds(r),e.setDate(l),e.setExcludeFull("checked"===f),e.setExcludePast("checked"===j),e.setOnlyDelegation("checked"===I),e.setSegmentId(Yo(h)?h[0]:null),e.setTagsIds(m),e.close()},children:n("appliquer_05753")})]})]})},lW=e=>{const n=Fi(),[t,s]=(0,V.useState)(!1),o=(0,V.useCallback)(()=>{e.setAccreditationsCategoriesIds([]),e.setAccreditationsIds([]),e.setAccreditationsProfilesIds([]),e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setOnlyDelegation(!1),e.setSegmentId(null),e.setTagsIds([])},[e.setAccreditationsCategoriesIds,e.setAccreditationsIds,e.setAccreditationsProfilesIds,e.setDate,e.setExcludeFull,e.setExcludePast,e.setOnlyDelegation,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Tl,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_une_65646"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Ou,{doNotCloseOnOtherOpen:!0,isOpen:t,onStateChange:s,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"bars-filter",children:n("filtres_64574")})})}),(0,i.jsx)(Fu,{placement:"bottom-end",width:385,children:(0,i.jsx)(dW,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(rW,{...e,reset:o})]})},cW=({event:e,organization:n})=>{const{eventId:t}=Vi(),[s,o,a]=Wm(""),[r,d]=zD("accredit.filters.accreditationsCategoriesIds",null),[l,c]=zD("accredit.filters.accreditationsIds",null),[u,m]=zD("accredit.filters.accreditationsProfilesIds",null),[h,p]=zD("accredit.filters.date",null),[I,x]=zD("accredit.filters.tagsIds",null),[f,_]=zD("accredit.filters.segmentId",null),[j,v]=zD("accredit.filters.excludeFull",!1),[S,y]=zD("accredit.filters.excludePast",!1),[C,b]=zD("accredit.filters.onlyDelegation",!0),{data:A,loader:E}=Li("query AccreditSlots(\n $eventId: EventId!\n $name: String\n $accreditationCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $accreditationsProfilesIds: [AccreditationsProfileId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n $delegationId: DelegationId\n) {\n event(id: $eventId) {\n accreditationsProfiles(\n name: $name\n ids: $accreditationsProfilesIds\n delegationId: $delegationId\n ) {\n nodes {\n ...AccreditationProfile\n }\n }\n\n accreditationsSlots(\n includeHidden: true\n name: $name\n accreditationsCategoriesIds: $accreditationCategoriesIds\n accreditationsIds: $accreditationsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n delegationId: $delegationId\n ) {\n nodes {\n ...AccreditationsSlot\n }\n }\n }\n}\n",{eventId:t,name:g(o)?o:void 0,accreditationCategoriesIds:Yo(r)?r:void 0,accreditationsIds:Yo(l)?l:void 0,accreditationsProfilesIds:Yo(u)?u:void 0,date:h,tagsIds:Yo(I)?I:void 0,segmentId:f,excludeFull:j,excludePast:S,delegationId:C?e.volunteerRegistration.delegation?.id:void 0},[$o.AccreditationProfileFragment,$o.AccreditationsSlotFragment]);return(0,i.jsxs)(Tl,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",gap:"7",width:1,children:[(0,i.jsx)(lW,{accreditationsCategoriesIds:r,accreditationsIds:l,accreditationsProfilesIds:u,date:h,event:e,excludeFull:j,excludePast:S,name:s,onlyDelegation:C,organization:n,segmentId:f,setAccreditationsCategoriesIds:d,setAccreditationsIds:c,setAccreditationsProfilesIds:m,setDate:p,setExcludeFull:v,setExcludePast:y,setName:a,setOnlyDelegation:b,setSegmentId:_,setTagsIds:x,tagsIds:I}),E||(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[Yo(A.event.accreditationsProfiles.nodes)&&(0,i.jsx)(aW,{accreditationsProfiles:A.event.accreditationsProfiles.nodes,delegation:e.volunteerRegistration.delegation}),Yo(A.event.accreditationsSlots.nodes)&&(0,i.jsx)(sW,{accreditationsSlots:A.event.accreditationsSlots.nodes,delegation:e.volunteerRegistration.delegation})]})]})},uW=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,userInfoId:a}}=Kl();Au(t("accr_ditations_79986",e.event.volunteerRegistration.userInfo.name));const[r,d]=zD("accredit.isLeftPanelOpen",!0),[l,c]=zD("accredit.isRightPanelOpen",!0),[u,m,h]=Wm(""),[p,I]=zD("accredit.leftPanelDirection",Gn.Desc),[x,f]=zD("accredit.leftPanelSegmentId",-1),[_,j]=zD("accredit.leftPanelDelegationId",null),[v,S]=zD("accredit.leftPanelStates",[ge.AutoAccredited,ge.WaitingAccreditation]),{data:y,isLoading:C}=xa({eventId:o,accreditationStates:v,name:g(m)?m:void 0,segmentId:-1===x?void 0:x,delegationId:_||void 0,direction:p,loadDelegations:!0}),b=(0,V.useCallback)(()=>{const e=y.event?.volunteersRegistrations.nodes??[],t=e.findIndex(e=>e.userInfo.id===a),i=e[t+1]?.userInfo.id??e[0].userInfo.id;i===a?n.goBack(yo.ACCREDIT(s,o,a)):n.replace(yo.ACCREDIT(s,o,i))},[s,o,a,y.event]),A=e.event.volunteerRegistration,E=(0,V.useMemo)(()=>e.isEdit?A.accreditationProfileId:null,[e.isEdit,A]),w=(0,V.useMemo)(()=>{if(e.isEdit)return A.accreditationProfileId;{const e=(0,kl.A)(A.userInfo.formsUsersInfos.flatMap(e=>{const n=A.delegation?.accreditationsProfiles.find(n=>n.accreditationProfileId===e.accreditationProfileId);return"number"==typeof n?.maxResources&&n.assignedResources>=n.maxResources?[]:[e.accreditationProfileId]}));return Yo(e)?e[0]:null}},[e.isEdit,A]),$=(0,V.useMemo)(()=>A.accreditationsUsersInfos.map(({accreditationSlotId:e})=>e),[A]),T=(0,V.useMemo)(()=>[...$,...e.isEdit?[]:A.userInfo.formsUsersInfos.flatMap(e=>e.accreditationsSlots.flatMap(e=>{const n=A.delegation?.accreditationsSlots.find(n=>n.accreditationSlotId===e.id),t=n?.maxResources&&n?.assignedResources>=n?.maxResources;return e?.maxResources&&e?.assignedResources>=e?.maxResources||t?[]:[e.id]}))],[$,A,e.isEdit]);return(0,i.jsx)(JB,{accreditationProfileId:w,accreditationsSlotsIds:T,alreadyAssignedProfileId:E,alreadyAssignedSlotsIds:$,isEdit:e.isEdit,showNextMember:b,children:(0,i.jsx)(NB,{buttons:(0,i.jsx)(nW,{isEdit:e.isEdit,userInfoId:A.userInfo.id}),header:(0,i.jsx)(LB,{badgeColorIcon:Uy(A.accreditationState),delegation:A.delegation,insertedAt:A.insertedAt,isPreAssign:!1,showTabs:!1,showTeam:!1,teams:qo,userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:r,isRightPanelOpen:l,leftPanel:(0,i.jsx)(BB,{accreditationStates:v,delegationId:_,direction:p,event:y.event,getPath:e=>yo.ACCREDIT(s,o,e),isLoading:C,loadDelegations:!0,name:u,segmentId:x,setAccreditationStates:S,setDelegationId:j,setDirection:I,setName:h,setSegmentId:f,setStates:Bc.A,showAccreditationStates:!0,showStates:!1,states:qo,userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(XB,{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:d,setIsRightPanelOpen:c,children:(0,i.jsx)(cW,{event:e.event,organization:e.organization})})})},mW=e=>{const{organizationId:n,eventId:t,userInfoId:s}=Vi(),{data:o,loader:a}=Li("query AccreditInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n index\n }\n }\n\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n }\n }\n\n segments(segmentType: Accreditations) {\n id\n name\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n userInfoId\n accreditationState\n accreditationProfileId\n insertedAt\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n delegation {\n id\n name\n\n ...DelegationAccreditationsSlots\n }\n\n userInfo {\n id\n name\n email\n fields\n\n picture {\n url\n }\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n accreditationProfileId\n\n accreditationsSlots {\n id\n maxResources\n assignedResources\n }\n }\n }\n }\n }\n}\n",{organizationId:n,eventId:t,userInfoId:s},[$o.FormsUsersInfosWishedFragment,$o.CustomFieldWithConditionFragment,$o.DelegationAccreditationsSlotsFragment]);return a||(0,i.jsx)(uW,{event:o.event,isEdit:e.isEdit,organization:o.organization})},gW=()=>{const{translate:e,params:{eventId:n}}=Kl(),[t,s,o]=Wm(""),[a,r]=(0,V.useState)(""),[d,l]=(0,V.useState)(0),{data:c,isLoading:u,reload:m}=Li("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:n,name:g(s)?s:void 0,state:""!==a?a:void 0,offset:d},[$o.EmailRecipientFragment]);const h=Um(),{numberOfPages:p,totalCount:I}=Sx(c.event?.emails);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{value:a,onChange:e=>{r(e),l(0)},children:[(0,i.jsx)("option",{value:"",children:e("tous_les_status_67644")}),h(Lt.filter(e=>e!==Le.Queued))]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_un_d_02329"),value:t,onChange:e=>{o(e),l(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_du_membre_69353")}),(0,i.jsx)(Gm,{children:e("date_d_envoi_74668")}),(0,i.jsx)(Gm,{children:e("State")}),(0,i.jsx)(Gm,{width:100})]}),numberOfPages:p,offset:d,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):c.event.emails.nodes.map(e=>(0,i.jsx)(ky,{email:e,emailType:Ve.Accreditations,reload:m},e.id)),setOffset:l,title:e("liste_des_envoi_14764"),totalCount:I})},hW=e=>{const n=Fi(),{mutate:t,isLoading:s}=function(e={}){return Ui("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)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nb,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("les_membres_pr_09143")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{isLoading:s,onClick:async()=>{await t({eventId:e.eventId,sendAccreditationsEmails:e.sendAccreditationsEmails}),e.reload(),e.onClose()},children:n("confirmer_l_env_08749")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},pW=e=>{const n=Fi(),[t,s,o]=Wm(""),[a,r]=(0,V.useState)([]),{data:d}=Id({eventId:e.eventId,usersInfosIds:a,name:g(s)?s:void 0}),l=(0,V.useMemo)(()=>(0,Rg.A)((d.event?.volunteersRegistrations.nodes??[]).concat(d.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[d.event]),{mutate:c,isLoading:u}=function(e={}){return Ui("mutation AccreditationsEmailsEstimate(\n $eventId: EventId!\n $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n eventAccreditationsEmailsEstimate(\n eventId: $eventId\n sendAccreditationsEmails: $sendAccreditationsEmails\n )\n}\n",e)}(),[m,h]=(0,V.useState)(re.Everyone),[p,I]=(0,V.useState)([]),x=m===re.Everyone||m===re.Accredited||m===re.Refused||m===re.Members&&Yo(a)||m===re.Segments&&Yo(p),f=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nb,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("envoi_des_e_mai_83224")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("personnaliser_v_78340")}),(0,i.jsx)(Pl,{height:"7"}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{alertStyle:"error",children:(0,i.jsx)(uc,{children:n("vous_ne_pouvez_69435")})}),(0,i.jsx)(Pl,{height:"4"})]}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("que_souhaitez_v_01732")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(cm,{state:m===re.Everyone?"checked":"unchecked",onClick:()=>{h(re.Everyone)},children:n("tous_les_e_mail_50843")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:m===re.Accredited?"checked":"unchecked",onClick:()=>{h(re.Accredited)},children:n("tous_les_e_mail_02185")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:m===re.Refused?"checked":"unchecked",onClick:()=>{h(re.Refused)},children:n("tous_les_e_mail_41162")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:m===re.Members?"checked":"unchecked",onClick:()=>{h(re.Members)},children:n("_certains_memb_91094")}),m===re.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_50038"),state:"search",value:t,onChange:o}),values:a,onChange:r,children:l.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:m===re.Segments?"checked":"unchecked",onClick:()=>{h(re.Segments)},children:n("uniquement_ce_54026")}),m===re.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,values:p,onChange:I,children:(d.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:f,isLoading:u,onClick:async()=>{if(x){const n={recipients:m,segmentsIds:p,usersInfosIds:a},{eventAccreditationsEmailsEstimate:t}=await c({eventId:e.eventId,sendAccreditationsEmails:n});e.onSuccess(t,n),e.onClose()}},children:n("envoyer_les_e_m_37846")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},IW=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),{setNumberOfWaitingAccreditations:a}=BS(),[r,d]=(0,V.useState)(!1),[l,c]=(0,V.useState)(null),[u,m]=(0,V.useState)(0),[g,h]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{a(e.event.waitingAccreditation.totalCount)},[e.event]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(yy,{children:[(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsxs)(Wk,{button:(0,i.jsx)(tc,{disabled:0===e.event.waitingAccreditation.totalCount,onClick:()=>{e.event.waitingAccreditation.totalCount>0&&n.push(yo.ACCREDIT(t,s,e.event.waitingAccreditation.nodes[0].userInfoId))},children:o("accr_diter_les_48281")}),children:[(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:o("membres_en_atte_52995")}),(0,i.jsx)(Mr,{font:"gray900 displayMd medium",children:e.event.waitingAccreditation.totalCount})]}),(0,i.jsxs)(Wk,{button:(0,i.jsx)(tc,{onClick:()=>{d(!0)},children:o("param_trer_et_e_31095")}),children:[(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:o("e_mail_de_confi_84099_plural")}),(0,i.jsx)(Mr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfWaiting})]})]}),(0,i.jsx)(Pl,{height:"9"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:o("historique_des_71419")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsxs)(Wk,{children:[(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:o("nombre_d_envois_95106")}),(0,i.jsx)(Mr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfSent})]}),(0,i.jsxs)(Wk,{children:[(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:o("nombre_d_ouvert_84187")}),(0,i.jsx)(Mr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfOpen})]}),(0,i.jsxs)(Wk,{children:[(0,i.jsx)(Mr,{color:"gray500",fontWeight:"medium",children:o("nombre_de_clics_64232")}),(0,i.jsx)(Mr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfClick})]})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(gW,{})]}),r&&(0,i.jsx)(pW,{emailSender:e.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{d(!1)},onSuccess:(e,n)=>{m(e),c(n),h(!0)}}),g&&(0,i.jsx)(hW,{eventId:s,numberOfEmails:u,reload:e.reload,sendAccreditationsEmails:l,onClose:()=>{h(!1)}})]})},xW=()=>{const e=Fi();return(0,i.jsxs)(by,{direction:"column",children:[(0,i.jsx)(Mr,{font:"blueGray900 textXl medium",children:e("accr_ditations_39450")}),(0,i.jsx)(Mr,{color:"gray500",children:e("accr_diter_vos_35773")})]})},fW=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{event:{name:s},localEvent:o,updateLocalEvent:a}=BS();Au(`${s} ${t("accr_ditations_39450")}`);const{data:r,loader:d,reload:l}=Li('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:n,direction:o?.["accredit.leftPanelDirection"]??Gn.Desc},[]);return(0,V.useEffect)(()=>{(async()=>{await Promise.all([a({"accredit.filters.accreditationsCategoriesIds":null}),a({"accredit.filters.accreditationsIds":null}),a({"accredit.filters.accreditationsProfilesIds":null}),a({"accredit.filters.date":null}),a({"accredit.filters.tagsIds":null}),a({"accredit.filters.segmentId":null}),a({"accredit.filters.excludeFull":!1})])})()},[]),d||(0,i.jsxs)(Ay,{children:[(0,i.jsx)(xW,{}),(0,i.jsx)(IW,{event:r.event,organization:r.organization,reload:l})]})},_W=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("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)(ow,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954"),n("cela_supprimera_56396")],text:n("suppression_de_73669",e.accreditationCategory.name),onClose:e.onClose,onDelete:async()=>{await t({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id}),e.onSuccess()}})},jW=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl();return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:Ws.ACCREDITATIONS({organizationId:n,eventId:t}),children:s("accr_ditations_39450")}),(0,i.jsx)(AT,{isCurrent:!0,to:Ws.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.category.id}),children:e.category.name})]})},vW=({category:e,reload:n})=>{const{history:t,params:{organizationId:s,eventId:o},translate:a}=Kl(),r=FV(),{mutate:d}=function(e={}){return Ui("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,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1);return(0,i.jsx)(Cy,{breadcrumbs:(0,i.jsx)(jW,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsx)(tc,{color:"white",onClick:()=>m(!0),children:a("_diter_62574")})}),(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{t.push(yo.CREATE_ACCREDITATION(s,o,e.id))},children:a("add_accreditation")})}),(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"arrow-down-to-bracket",onClick:()=>r(TV,{accreditationsCategoriesIds:[e.id]}),children:a("exporter_les_me_63676")}),(0,i.jsx)(Pu,{icon:"copy",onClick:async()=>{const{accreditationCategoryDuplicate:{id:n}}=await d({eventId:o,accreditationCategoryId:e.id});t.push(Ws.ACCREDITATION_CATEGORY({organizationId:s,eventId:o,accreditationCategoryId:n}))},children:a("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:a("supprimer_43083")})})]})]})}),u&&(0,i.jsx)(pU,{accreditationCategory:e,eventId:o,onClose:()=>{m(!1)},onSuccess:n}),l&&(0,i.jsx)(_W,{accreditationCategory:e,eventId:o,onClose:()=>{c(!1)},onSuccess:()=>{t.replace(Ws.ACCREDITATIONS({organizationId:s,eventId:o}))}})]}),name:e.name,subtext:a("accreditation",e.numberOfAccreditations)})},SW=e=>{const{setNodeRef:n,style:t,handleProps:s}=up(e.accreditation.id);return(0,i.jsxs)(Tl,{ref:n,align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",style:t,children:[(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"pointer"},...s,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 textSm medium",children:e.accreditation.name})]})},yW=e=>{const{translate:n,params:{eventId:t,accreditationCategoryId:s}}=Kl(),{data:o,loader:a}=Li("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:t,accreditationCategoryId:s},[]),{mutate:r}=ba(),[d,l]=(0,V.useState)([]),[c,u]=(0,V.useState)(!1),m=(0,V.useCallback)(async()=>{u(!0),await Promise.all(d.map((e,n)=>r({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:ae.Index,strategy:hn.Replace,value:n}}))),e.onClose(),e.onSuccess(),u(!1)},[t,d,u,r,e.onClose,e.onSuccess]),g=(0,V.useCallback)((e,n)=>{l(Qo(d,e,n))},[d,l]);return(0,V.useEffect)(()=>{l(uh(o.event?.accreditationCategory.accreditations??[]))},[o.event,l]),(0,i.jsx)(Hx,{button:(0,i.jsx)(tc,{isLoading:c,onClick:m,children:n("enregistrer_06519")}),category:n("liste_des_accr_02647"),heading:n("changer_l_ordre_11550"),onClose:e.onClose,children:a||(0,i.jsxs)(Gx,{css:{background:"white "},children:[(0,i.jsx)(Mr,{font:"gray900 textLg semiBold",children:n("organisation_de_45058")}),(0,i.jsx)(oI,{height:"5"}),(0,i.jsx)(_p,{ids:d.map(e=>e.id),onReorder:g,children:(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Tl,{align:"center",css:{padding:"$4"},gap:"3",children:(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textMd medium",children:o.event.accreditationCategory.name})}),(0,i.jsx)(Tl,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",children:d.map(e=>(0,i.jsx)(SW,{accreditation:e},e.id))})]})})]})})},CW=()=>{const{params:{organizationId:e,eventId:n,accreditationCategoryId:t},translate:s}=Kl(),[o,a,r]=Wm(""),[d,l]=(0,V.useState)(0),[c,u]=(0,V.useState)({direction:Gn.Asc,attribute:me.Index}),{data:m,isLoading:h,reload:p}=Li("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:n,accreditationCategoryId:t,name:g(a)?a:void 0,offset:d,sort:c},[]);const{numberOfPages:I,totalCount:x}=Sx(m.event?.accreditations),[f,_]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nm,{filters:(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:s("rechercher_une_65646"),value:o,onChange:r})}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"gear",onClick:()=>_(!0)})}),(0,i.jsx)(Dx,{placement:"top",children:s("changer_l_ordre_11550")})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($x,{attribute:me.Name,setSort:u,sort:c,children:s("AccreditationName")}),(0,i.jsx)($x,{attribute:me.Index,setSort:u,sort:c,children:s("Index")}),(0,i.jsx)(Gm,{children:s("number_of_slots_92461")}),(0,i.jsx)(Gm,{children:s("type_d_affichag_55093")})]}),numberOfPages:I,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):0===m.event.accreditations.totalCount?(0,i.jsxs)(Tl,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(nb,{color:"primary",icon:"user-group"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:s("no_accreditations")})]}):m.event.accreditations.nodes.map(t=>(0,i.jsxs)(km,{css:{userSelect:"none"},children:[(0,i.jsx)($m,{css:{fontWeight:"$medium"},children:(0,i.jsx)(Xm,{to:Ws.ACCREDITATION({organizationId:e,eventId:n,accreditationId:t.id}),children:rh(t)})}),(0,i.jsx)($m,{children:t.index??"-"}),(0,i.jsx)($m,{children:t.numberOfSlots}),(0,i.jsx)($m,{children:s(t.accreditationDisplay)})]},t.id)),setOffset:l,title:s("liste_des_accr_02647"),totalCount:x}),f&&(0,St.createPortal)((0,i.jsx)(Mr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(yW,{onClose:()=>_(!1),onSuccess:p})}),document.body)]})},bW=()=>{const{translate:e,params:{eventId:n,accreditationCategoryId:t}}=Kl(),{data:s,loader:o}=Li("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:n,accreditationCategoryId:t},[$o.AccreditationChartFragment]),[a,r]=(0,V.useState)(),d=(0,V.useMemo)(()=>s.event?.accreditations?.nodes.find(e=>e.id==a),[a]);return o||(0,i.jsx)(oT,{select:(0,i.jsx)(Tl,{width:.5,children:(0,i.jsxs)(Up,{value:a??-1,onChange:e=>{r(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:rh(e)},e.id))]})}),title:e("r_partition_du_55091"),children:(0,i.jsx)(Tl,{gap:"4",width:1,children:(0,i.jsx)(Mr,{height:380,width:1,children:a&&d?(0,i.jsx)(VT,{accreditation:d,slots:d.slots}):(0,i.jsx)(UE,{title:e("vous_allez_retr_26787")})})})})},AW=()=>(0,i.jsx)(yy,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)(Tl,{width:1,children:(0,i.jsx)(bW,{})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(CW,{})})]})}),EW=({event:e,reload:n})=>{const{params:{organizationId:t,eventId:s,accreditationCategoryId:o},translate:a}=Kl();Au(e.accreditationCategory.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":s,accreditationCategoryId:e?":accreditationCategoryId":o});return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(vW,{category:e.accreditationCategory,reload:n}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:Ws.ACCREDITATION_CATEGORY_DASHBOARD(r(!1)),children:a("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:Ws.ACCREDITATION_CATEGORY_MEMBERS(r(!1)),children:a("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($y,{path:Ws.ACCREDITATION_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(AW,{})}),(0,i.jsx)($y,{path:Ws.ACCREDITATION_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(PB,{accreditationCategoryId:o})})]})]})},wW=()=>{const{params:{organizationId:e,eventId:n,accreditationCategoryId:t}}=Kl(),{data:s,loader:o,reload:a}=Li("query AccreditationsCategory(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditationCategory(id: $accreditationCategoryId) {\n id\n name\n assignedResources\n numberOfAccreditations\n }\n\n volunteersRegistrations(accreditationsCategoriesIds: [$accreditationCategoryId]) {\n totalCount\n }\n }\n}\n",{eventId:n,accreditationCategoryId:t},[]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:Ws.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(qi,{path:Ws.ACCREDITATION_CATEGORY_DASHBOARD({organizationId:e,eventId:n,accreditationCategoryId:t}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(EW,{event:s.event,reload:a})})]})};let $W=class extends Rc{constructor(e){super(e)}createUpdateAccreditationProfileValuesDefault(e,n){return{accreditationProfile:this.accreditationProfileInputDefault(e,n)}}accreditationProfileInputSchema(){return zc.Ik().shape({accreditationProfileCategoryId:zc.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),name:zc.Yj().required(this.t("le_nom_de_l_acc_82676")),description:zc.Yj(),acronym:zc.Yj().nullable(),color:zc.Yj().required(this.t("la_couleur_est_95740")),icon:zc.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(Zt,this.t("l_ic_ne_est_req_15843")),accreditationsSlotsIds:zc.YO().of(zc.ai()).min(1,this.t("vous_devez_s_le_34381"))})}createUpdateAccreditationProfileSchema(){return zc.Ik().shape({accreditationProfile:this.accreditationProfileInputSchema()})}accreditationProfileInputDefault(e,n){let t=e?.accreditationProfileCategoryId??n;return Number.isInteger(t)||(t=null),{accreditationProfileCategoryId:t,name:e?.name??"",description:e?.description??"",acronym:e?.acronym??"",color:e?.color??Ar.colors.primary500.value,icon:e?.icon??rn.BadgeCheck,accreditationsSlotsIds:e?.accreditationsSlotsIds??[]}}};$W=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],$W);const TW=e=>{const{translate:n}=Kl(),t=ki(Jm),s=(0,V.useMemo)(()=>Vh(e.accreditation.slots.filter(n=>e.accreditationsSlotsIds.includes(n.id))),[e.accreditation.slots,e.accreditationsSlotsIds]);return(0,i.jsx)(Ib,{accreditation:e.accreditation,displayNumberOfSlots:e.accreditation.hasSlots,displaySlots:e.accreditation.hasSlots,numberOfSlots:s.length,children:(0,i.jsxs)(ym,{hideBorder:!0,children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Gm,{children:n("nom_du_cr_neau_54351")})]}),s.map(e=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:e.date?t.toLocaleString(e.date,Uo.DateOnly.WeekdayShortMonthLong):"-"}),(0,i.jsx)($m,{children:g(e.name)?e.name:"-"})]},e.id))]})})},zW=e=>{const n=(0,V.useMemo)(()=>uh(e.category.accreditations.filter(n=>n.slots.some(n=>e.accreditationsSlotsIds.includes(n.id)))),[e.accreditationsSlotsIds,e.category.accreditations]);return(0,i.jsx)(pb,{category:e.category.name,children:n.map(n=>(0,i.jsx)(TW,{accreditation:n,accreditationsSlotsIds:e.accreditationsSlotsIds},n.id))})},OW=e=>(0,i.jsx)(hb,{css:{padding:"0"},children:e.categories.map(n=>(0,i.jsx)(zW,{accreditationsSlotsIds:e.accreditationsSlotsIds,category:n},n.id))}),RW=e=>{const{translate:n}=Kl(),t=ki(Jm),s=(0,V.useMemo)(()=>Bh(t,e.accreditationsCategories),[e.accreditationsCategories]),o=(0,V.useMemo)(()=>HC(e.accreditationsCategories.filter(n=>n.accreditations.some(n=>n.slots.some(n=>e.accreditationsSlotsIds.includes(n.id))))),[e.accreditationsCategories,e.accreditationsSlotsIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$6"},width:1,children:Yo(e.accreditationsSlotsIds)?(0,i.jsx)(OW,{accreditationsSlotsIds:e.accreditationsSlotsIds,categories:o}):(0,i.jsxs)(Tl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$9 $7"},direction:"column",width:1,children:[(0,i.jsx)(xI,{color:"white",css:{background:"white",border:"1px solid $gray200",color:"$gray800"},icon:"badge-check",size:"md"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("aucune_accr_dit_40299")})]})}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"accreditationProfile.accreditationsSlotsIds",triggerElem:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",children:n("AddAccreditations")}),children:s})]})},DW=e=>{const{mutate:n}=function(e={}){return Ui("mutation AccreditationProfileCategoryCreate(\n $eventId: EventId!\n $accreditationProfileCategory: AccreditationsProfilesCategoryInput!\n) {\n accreditationProfileCategoryCreate(\n eventId: $eventId\n accreditationProfileCategory: $accreditationProfileCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(zb,{initialName:"",isEdit:!1,mutate:async t=>(await n({eventId:e.eventId,accreditationProfileCategory:{name:t}})).accreditationProfileCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},MW=e=>{const{mutate:n}=function(e={}){return Ui("mutation AccreditationProfileCategoryUpdate(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n $accreditationProfileCategory: AccreditationsProfilesCategoryInput!\n) {\n accreditationProfileCategoryUpdate(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n accreditationProfileCategory: $accreditationProfileCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(zb,{initialName:e.accreditationProfileCategory.name,isEdit:!0,mutate:async t=>(await n({eventId:e.eventId,accreditationProfileCategoryId:e.accreditationProfileCategory.id,accreditationProfileCategory:{name:t}})).accreditationProfileCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},PW=e=>{const{translate:n,params:{eventId:t}}=Kl(),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(HC(e.event.accreditationsProfilesCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($c,{label:n("nom_de_votre_pr_36577"),name:"accreditationProfile.name"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(of,{isCreateVisible:!0,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"accreditationProfile.accreditationProfileCategoryId",onCreateClick:()=>o(!0),children:a.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:n("Acronym")}),name:"accreditationProfile.acronym"})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(DC,{label:n("Color"),name:"accreditationProfile.color"}),(0,i.jsx)(NC,{label:n("ic_ne_55554"),name:"accreditationProfile.icon"})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(iS,{label:(0,i.jsx)(Uv,{children:n("description_58935")}),name:"accreditationProfile.description"}),s&&(0,i.jsx)(DW,{eventId:t,onClose:()=>o(!1),onSuccess:n=>{r(HC([...a,n])),e.change("accreditationProfile.accreditationProfileCategoryId",n.id)}})]})},kW=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),{showNotification:a}=AS(),r=ki($W),d=ki(Ol),l=(0,V.useRef)(null),c=(0,V.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.accreditationProfile.name):o("cr_ation_d_un_p_06796"),[e.isEdit,e.initialValues,o]);return Au(c),(0,i.jsx)(xc,{customErrorRef:l,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:a,submitting:r,values:d})=>(0,i.jsx)(Hx,{button:e.isEdit?(0,i.jsx)(tc,{isLoading:r,onClick:a,children:o("mettre_jour_l_81963")}):null,category:c,color:"dark",fallbackClosePath:JO.ACCREDITATIONS_PROFILES({organizationId:t,eventId:s}),heading:e.isEdit?e.initialValues.accreditationProfile.name:o("nouveau_profil_88612"),children:(0,i.jsxs)(Gx,{ref:l,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{heading:o("informations_su_10044"),children:(0,i.jsx)(PW,{change:n.change,event:e.event})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:o("accr_ditations_39450"),subtitle:o("s_lectionnez_le_99366"),children:(0,i.jsx)(RW,{accreditationsCategories:e.event.accreditationsCategories,accreditationsSlotsIds:d.accreditationProfile.accreditationsSlotsIds})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:r,onClick:a,children:(0,i.jsx)(Mr,{textAlign:"center",children:e.isEdit?o("mettre_jour_l_26779"):o("cr_er_le_profil_04447")})})})]})}),validate:d.validateForForm(r.createUpdateAccreditationProfileSchema()),width:1,onSubmit:async i=>{await e.mutate({eventId:s,accreditationProfile:i.accreditationProfile}),a(e.isEdit?o("le_profil_d_acc_43644"):o("le_profil_d_acc_31514")),n.push(JO.ACCREDITATIONS_PROFILES({organizationId:t,eventId:s}))}})},FW=()=>{const{eventId:e,accreditationProfileCategoryId:n}=Vi(),t=ki($W),{data:s,loader:o}=Li("query AccreditationProfileEventInfos($eventId: EventId!) {\n event(id: $eventId) {\n ...CreateAccreditationProfileEvent\n }\n}\n",{eventId:e},[$o.CreateAccreditationProfileEventFragment]),{mutate:a}=function(e={}){return Ui("mutation AccreditationProfileCreate(\n $eventId: EventId!\n $accreditationProfile: AccreditationsProfileInput!\n) {\n accreditationProfileCreate(eventId: $eventId, accreditationProfile: $accreditationProfile) {\n id\n }\n}\n",e)}();return o||(0,i.jsx)(kW,{event:s.event,initialValues:t.createUpdateAccreditationProfileValuesDefault(null,n),isEdit:!1,mutate:async e=>(await a(e)).accreditationProfileCreate.id})},NW=()=>{const{eventId:e,accreditationProfileId:n}=Vi(),t=ki($W),{data:s,loader:o}=Li("query AccreditationProfileToEdit(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n ...CreateAccreditationProfileEvent\n\n accreditationProfile(id: $accreditationProfileId) {\n name\n description\n acronym\n color\n icon\n accreditationProfileCategoryId\n accreditationsSlotsIds\n }\n }\n}\n",{eventId:e,accreditationProfileId:n},[$o.CreateAccreditationProfileEventFragment]),{mutate:a}=function(e={}){return Ui("mutation AccreditationProfileUpdate(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n $accreditationProfile: AccreditationsProfileInput!\n) {\n accreditationProfileUpdate(\n eventId: $eventId\n accreditationProfileId: $accreditationProfileId\n accreditationProfile: $accreditationProfile\n ) {\n id\n }\n}\n",e)}();return o||(0,i.jsx)(kW,{event:s.event,initialValues:t.createUpdateAccreditationProfileValuesDefault(s.event.accreditationProfile,null),isEdit:!0,mutate:async e=>(await a({...e,accreditationProfileId:n})).accreditationProfileUpdate.id})};var LW;let UW=class extends QM{static{LW=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...QM.IMPORT_COLUMNS_DEFAULT,AccreditationProfileCategoryName:"accreditationProfileCategoryName",AccreditationProfileName:"accreditationProfileName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===dn.Update?[LW.IMPORT_COLUMNS_DEFAULT.Id]:[],LW.IMPORT_COLUMNS_DEFAULT.AccreditationProfileCategoryName,LW.IMPORT_COLUMNS_DEFAULT.AccreditationProfileName];constructor(e,n){super(e,n),this.csvInputService=e}};UW=LW=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[ZM,Di])],UW);const VW=({accreditations:e})=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl(),o=ki(Jm),{mutate:a}=function(e={}){return Ui("mutation AccreditationsProfilesImport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $input: MappableImportInput!\n) {\n jobId: accreditationsProfilesImport(\n organizationId: $organizationId\n eventId: $eventId\n input: $input\n )\n}\n",e)}(),{checkAccreditationsProfilesImport:r}=AS(),d=(0,V.useCallback)((e,n,t)=>r(e,n,t),[r]),l=(0,V.useMemo)(()=>e.map(e=>({...e,fields:e.slots.map(n=>({id:n.id,slug:`accreditation_slot_${n.id}`,name:Uh(o,n,e.name,{accreditation:{includeNameAtEnd:!0}})}))})),[e]);return(0,i.jsx)(qM,{alertDescriptionKey:"pour_ajouter_un_18028",children:(0,i.jsx)(yP,{ImportInputService:UW,additionalCategories:l,checkImport:d,closePath:JO.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t}),customFields:qo,heading:s("profils_d_accr_27825"),importTagPrefix:"accreditations-profiles",localStorageKeyPrefix:"ACCREDITATIONS_PROFILES_IMPORT",mutate:a,returnLink:(0,i.jsx)(Xm,{to:JO.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t}),children:s("retour_aux_prof_38933")})})})},BW=()=>{const{params:{eventId:e}}=Kl(),{data:n,loader:t}=Li("query AccreditationsProfilesImportInfos($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n }\n}\n",{eventId:e},[$o.AccreditationImportFragment]);return t||(0,i.jsx)(VW,{accreditations:n.event.accreditations.nodes})};var WW;function GW(e){return{includeAccreditations:e.includes(WW.Accreditations),includeCreatedBy:e.includes(WW.CreatedBy),includeDescription:e.includes(WW.Description)}}!function(e){e.Accreditation="accreditation",e.Accreditations="accreditations",e.AccreditationProfile="accreditation_profile",e.AccreditationSlot="accreditationSlotId",e.Acronym="acronym",e.Category="category",e.Color="color",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Name="name"}(WW||(WW={}));let qW=class extends Og{constructor(e,n,t){super(e,n,t)}getAccreditationsProfilesFilters(e){const n=this.t("profils_d_accr_27825");return[{slug:WW.Name,name:this.t("nom_08311"),category:n,fieldType:nn.Text,hideEmpty:!0},{slug:WW.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:n,fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},...Yo(e.accreditationsProfilesCategories)?[{slug:WW.Category,name:this.t("cat_gorie_00291"),category:n,fieldType:nn.Select,values:(0,Lm.A)(e.accreditationsProfilesCategories,e=>u(e.name)),hideEmpty:!0}]:[],{slug:WW.Description,name:this.t("Description"),category:n,fieldType:nn.Text},{slug:WW.Accreditation,name:this.t("Accreditation"),category:n,fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:WW.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:n,fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:WW.Acronym,name:this.t("Acronym"),category:n,fieldType:nn.Text},{slug:WW.Color,name:this.t("Color"),category:n,fieldType:nn.Text,hideEmpty:!0},{slug:WW.Icon,name:this.t("ic_ne_55554"),category:n,fieldType:nn.Select,values:Zt.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:WW.CreatedBy,name:this.t("cr_e_par_30622"),category:n,fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:WW.CreatedAt,name:this.t("cr_e_le_02658"),category:n,fieldType:nn.Datetime,hideEmpty:!0}]}getAccreditationsProfilesPossibleColumns(){return[{slug:WW.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:ce.Id},{slug:WW.Name,name:this.t("nom_08311"),isSearchable:!0,isSortable:!0,sortAttribute:ce.Name,minWidth:240},{slug:WW.Description,name:this.t("Description"),minWidth:320},{slug:WW.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:ce.Category,minWidth:200},{slug:WW.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:WW.Acronym,name:this.t("Acronym"),isSearchable:!0,minWidth:160},{slug:PU.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:PU.Icon,name:this.t("ic_ne_55554"),width:80},{slug:PU.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:WW.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:WW.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:ce.CreatedAt,minWidth:180}]}};qW=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],qW);const HW=e=>{const{translate:n,params:{eventId:t}}=Kl(),{showNotification:s}=AS(),{mutate:o}=cd();return(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_04327"),text:n("suppression_de_73669",e.accreditationProfile.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:t,selecteds:{ids:[e.accreditationProfile.id]}}),s(n("le_profil_d_acc_21890",e.accreditationProfile.name)),e.onSuccess()}})},YW=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{mutate:a}=ud(),[r,d]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",to:JO.ACCREDITATIONS_PROFILE_EDIT({organizationId:s,eventId:o,accreditationProfileId:e.accreditationProfile.id}),children:t("_diter_62574")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{const{accreditationProfileDuplicate:{id:t}}=await a({eventId:o,accreditationProfileId:e.accreditationProfile.id});n.push(JO.ACCREDITATIONS_PROFILE_EDIT({organizationId:s,eventId:o,accreditationProfileId:t}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{d(!0),Tu(e.target)},children:t("supprimer_43083")})})]}),r&&(0,i.jsx)(HW,{accreditationProfile:e.accreditationProfile,onClose:()=>d(!1),onSuccess:e.reload})]})},ZW=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Jm),{data:o,loader:a}=Ja({eventId:t,loadIsBlocked:!1}),[r,d]=(0,V.useState)(!1),[l,c]=(0,V.useState)(hn.Add),[u,m]=(0,V.useState)([]),g=(0,V.useMemo)(()=>o.event?Bh(s,o.event.accreditationsCategories):null,[s,o.event]),h=Yo(u);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"badge-check",children:n("accr_ditations_39450")}),(0,i.jsxs)(hx,{gap:"6",children:[(0,i.jsxs)(Up,{label:n("que_souhaitez_v_87607"),value:l,onChange:c,children:[(0,i.jsx)("option",{value:hn.Add,children:n("ajouter_des_acc_17744")}),(0,i.jsx)("option",{value:hn.Replace,children:n("remplacer_les_a_92733")}),(0,i.jsx)("option",{value:hn.Delete,children:n("supprimer_des_a_04246")})]}),a||(0,i.jsx)(_m,{isSearchVisible:!0,label:n("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:u,onChange:m,children:g})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:!h,isLoading:r,onClick:async()=>{d(!0),await e.onSuccess(l,u),e.onClose(),d(!1)},children:n("_diter_62574")})})]})})},KW=()=>{const{translate:e,params:{eventId:n}}=Kl(),{massActions:t,predicates:s}=pg(),{onMassEditSuccess:o,segment:a}=ok(),{showNotification:r}=AS(),{mutate:d}=Aa(),{mutate:l}=_a(),{mutate:c}=cd(),[u,m]=(0,V.useState)(!1),[h,p]=(0,V.useState)(!1),[I,x]=(0,V.useState)(!1),f=t.getSelectedsInput(s,null),_=t.isAllSelected?a.count:t.numberOfSelected,j=(0,V.useCallback)(e=>{g(e)&&r(e),o()},[r,o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{onClick:()=>m(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"badge-check",onClick:()=>p(!0),children:e("_diter_les_accr_86042")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>x(!0),children:e("supprimer_43083")})})]})]}),u&&(0,i.jsx)(Iw,{eventId:n,mutate:e=>d({eventId:n,massEdit:e}),selecteds:f,onClose:()=>m(!1),onSuccess:n=>j(e("_1_profils_d_a_11729",n))}),h&&(0,i.jsx)(ZW,{onClose:()=>p(!1),onSuccess:async(t,i)=>{const{numberOfAccreditationsProfiles:s}=await l({eventId:n,massAccreditations:{accreditationsSlotsIds:i,strategy:t,selecteds:f}});j(e("_1_profils_d_a_11729",s))}}),I&&(0,i.jsx)(ow,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_06203")],text:e("suppression_de_76750",_),onClose:()=>x(!1),onDelete:async()=>{const t=(await c({eventId:n,selecteds:f})).numberOfAccreditationsProfiles;j(e("_1_profils_d_a_94525",t))}})]})},XW=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Jm),{mutate:o}=_a(),{isEditMode:a}=pg(),[r,d]=(0,V.useState)(!0),[l,c]=(0,V.useState)(null),u=(0,V.useMemo)(()=>e.accreditationProfile.accreditationsSlots??[],[e.accreditationProfile]),m=(0,V.useMemo)(()=>lh(u),[u]),g=(0,V.useMemo)(()=>u.map(e=>e.id),[u]),h=(0,V.useCallback)(async e=>{if(e&&r){const{event:e}=await er({eventId:t,loadIsBlocked:!1},await X());c(Bh(s,e.accreditationsCategories)),d(!1)}},[s,t,r]),p=(0,V.useCallback)(async n=>{await o({eventId:t,massAccreditations:{accreditationsSlotsIds:n,selecteds:{ids:[e.accreditationProfile.id]},strategy:hn.Replace}}),e.reload()},[t,e.accreditationProfile.id,e.reload,o]);return a&&e.updatable?(0,i.jsx)(iA,{column:e.column,css:{gap:"$2"},initialValue:g,renderInput:(e,t)=>r?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:l}),renderValue:()=>(0,i.jsx)(pA,{badges:m,doNotSort:!0}),onSave:p,onStateChange:h}):(0,i.jsx)($m,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:m,doNotSort:!0})})},QW=e=>{const{params:{eventId:n}}=Kl(),{mutate:t}=Aa(),s=V.useCallback(async i=>{const s=Ho(e.property);for(const o of s){const a=1===s.length?i:i[o];await t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.accreditationProfileId]},slug:o,strategy:hn.Replace,value:a}})}return!0},[e.accreditationProfileId,e.property,t]);return(0,i.jsx)(sA,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},JW=e=>{const{translate:n}=Kl();return(0,i.jsx)(QW,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.acronym||"",property:le.Acronym,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("Acronym"),value:e,onChange:t}),renderValue:e.accreditationProfile.acronym||""})},eG=e=>{const{translate:n,params:{eventId:t}}=Kl(),{data:s,loader:o}=Li("query AccreditationsProfilesCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n }\n }\n}\n",{eventId:t},[]);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("Category")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Up,{label:n("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:(s.event.accreditationsProfilesCategories??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},nG=e=>{const{organizationId:n,eventId:t}=Vi(),{isEditMode:s}=pg(),o=e.accreditationProfileCategory.name;return(0,i.jsx)(QW,{accreditationProfileId:e.accreditationProfileId,column:e.column,initialValue:e.accreditationProfileCategory.id,property:le.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(eG,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:s,title:o,updatable:!0,children:(0,i.jsx)(Xm,{to:JO.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:n,eventId:t,accreditationProfileCategoryId:e.accreditationProfileCategory.id}),children:o})})})},tG=e=>{const{translate:n}=Kl();return(0,i.jsx)(QW,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.color,property:le.Color,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(RC,{label:n("Color"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Tl,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{css:{background:e.accreditationProfile.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{lS(e.accreditationProfile.color)}})}),(0,i.jsx)(Dx,{placement:"top",children:e.accreditationProfile.color})]})})})},iG=e=>{const{params:{eventId:n}}=Kl(),{mutate:t}=Aa(),s=(0,V.useCallback)(i=>t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.accreditationProfile.id]},slug:le.Description,strategy:hn.Replace,value:i}}),[n,e.accreditationProfile.id,t]);return(0,i.jsx)(ZF,{column:e.column,mutate:s,reload:e.reload,text:e.accreditationProfile.description,updatable:e.updatable})},sG=e=>{const{translate:n}=Kl();return(0,i.jsx)(QW,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.icon,property:le.Icon,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(FC,{label:n("Icon"),renderOnPortal:!0,value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Yl,{icon:Hl(e.accreditationProfile.icon)})})},oG=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>({[le.Color]:e.accreditationProfile.color,[le.Icon]:e.accreditationProfile.icon}),[e.accreditationProfile]);return(0,i.jsx)(QW,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:t,property:[le.Color,le.Icon],reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(RC,{label:n("Color"),value:e[le.Color],onChange:n=>{t({...e,[le.Color]:n})}}),(0,i.jsx)(FC,{label:n("Icon"),renderOnPortal:!0,value:e[le.Icon],onChange:n=>{t({...e,[le.Icon]:n})}})]}),renderValue:()=>(0,i.jsx)(xI,{color:e.accreditationProfile.color,icon:e.accreditationProfile.icon})})},aG=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{isEditMode:o}=pg(),a=e.accreditationProfile.name;return(0,i.jsx)(QW,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.name,property:le.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("nom_08311"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(Xm,{to:JO.ACCREDITATIONS_PROFILE({organizationId:t,eventId:s,accreditationProfileId:e.accreditationProfile.id}),children:(0,i.jsx)(Mr,{css:{clamp:2},title:a,children:a})})})})},rG=e=>e.column.slug===WW.Id?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===WW.Name?(0,i.jsx)(aG,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WW.Description?(0,i.jsx)(iG,{accreditationProfile:e.row,column:e.column,reload:e.reload,updatable:e.canAccreditationEdit}):e.column.slug===WW.Category?(0,i.jsx)(nG,{accreditationProfileCategory:e.row.accreditationProfileCategory,accreditationProfileId:e.row.id,column:e.column,reload:e.reload}):e.column.slug===WW.Accreditations?(0,i.jsx)(XW,{accreditationProfile:e.row,column:e.column,reload:e.reload,updatable:e.canAccreditationEdit}):e.column.slug===WW.Acronym?(0,i.jsx)(JW,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WW.Color?(0,i.jsx)(tG,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WW.Icon?(0,i.jsx)(sG,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WW.IconColor?(0,i.jsx)(oG,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===WW.CreatedBy?(0,i.jsx)(Tk,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===WW.CreatedAt?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):null,dG=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl();return(0,i.jsx)(kk,{children:(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"file-import",to:JO.ACCREDITATIONS_PROFILES_IMPORT({organizationId:n,eventId:t}),onClick:e=>Tu(e.target),children:e("importer_via_un_61623")}),path:JO.ACCREDITATIONS_PROFILE_CREATE({organizationId:n,eventId:t}),children:e("cr_er_un_profil_01464")})})})},lG=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{canAccreditationEdit:o,canSegmentEdit:a}=oy(),{limit:r}=pg(),{segment:d}=ok();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dG,{}),0===e.numberOfAccreditationsProfiles?(0,i.jsx)(yy,{css:{overflow:"hidden"},children:(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(UE,{subtitle:"",title:n("vous_n_avez_pas_24880")})})}):(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:(0,i.jsx)(KW,{}),searchPlaceholder:n("rechercher_un_p_31010"),showActions:o,showEditColumns:a,showEditMode:o,showSearchColumns:a}),selectSegment:(0,i.jsx)(ap,{allSelectedText:n("les_1_profils_67546",d.count,d.name),pageSelectedText:n("les_1_profils_27968",r),selectAllText:n("s_lectionner_le_71777",d.count,d.name)})}),(0,i.jsx)(kx,{getEditPath:e=>JO.ACCREDITATIONS_PROFILE_EDIT({organizationId:t,eventId:s,accreditationProfileId:e.id}),renderCell:(e,n,t)=>(0,i.jsx)(rG,{canAccreditationEdit:o,column:e,reload:t,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)(YW,{accreditationProfile:e,reload:n})})]})]})},cG=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=Kl(),{hasPermission:r,localEvent:d,updateLocalEvent:l}=BS(),{canAccreditationEdit:c}=oy(),u=ki(qW),m=(0,V.useMemo)(()=>u.getAccreditationsProfilesFilters(e.event),[u,e.event]),g=(0,V.useMemo)(()=>u.getAccreditationsProfilesPossibleColumns(),[u]);return(0,i.jsx)(yk,{canSegmentEdit:r(sy.SEGMENT_EDIT),columnsToIncludes:GW,eventId:o,filters:m,filtersButtonText:t("filtrer_les_pro_86372"),filtersSubtitle:t("appliquer_des_f_18351"),getSegmentPath:e=>JO.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:s,eventId:o,segmentId:e}),hideSegments:0===e.event.numberOfAccreditationsProfiles,initialLimit:d?.accreditationsProfilesLimit??Tm,initialSegmentsOpen:d?.areAccreditationsProfilesSegmentsOpen??!0,loadDataList:md,loadRow:gd,organizationId:s,possibleColumns:g,possibleRenderings:[],reload:e.reload,segmentId:a,segmentType:Bn.AccreditationsProfiles,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{l({accreditationsProfilesLimit:e})},showMassActions:c,showRowDropdown:c,showRowEdit:c,onSegmentClick:e=>{l({accreditationsProfilesSegmentId:e})},onSegmentDelete:async()=>{await l({accreditationsProfilesSegmentId:null}),n.replace(JO.ACCREDITATIONS_PROFILES({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await l({areAccreditationsProfilesSegmentsOpen:e})},children:(0,i.jsx)(lG,{numberOfAccreditationsProfiles:e.event.numberOfAccreditationsProfiles})})},uG=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{event:{name:s},localEvent:o}=BS();Au(`${s} ${t("profils_d_accr_27825")}`);const{data:a,loader:r,reload:d}=Li("query AccreditationsProfilesSegments($eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n numberOfAccreditationsProfiles\n\n accreditationsProfilesCategories {\n id\n name\n }\n\n segmentsFolders(segmentType: AccreditationsProfiles) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:n},[$o.SegmentsFoldersSegmentsFragment]),l=(0,V.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:JO.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(cG,{event:a.event,reload:d})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:JO.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:e,eventId:n,segmentId:o?.accreditationsProfilesSegmentId&&l.includes(o.accreditationsProfilesSegmentId)?o.accreditationsProfilesSegmentId:l[0]}),replace:!0})})]})},mG=()=>{const{hasFeature:e}=XS();return e(Ze.Accreditation)?(0,i.jsx)(uG,{}):(0,i.jsx)(Tl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Vj,{icon:"badge-check"})})},gG=e=>{const{params:{organizationId:n,eventId:t,accreditationProfileId:s},translate:o}=Kl();return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:JO.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t}),children:o("profils_d_accr_27825")}),(0,i.jsx)(AT,{to:JO.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:n,eventId:t,accreditationProfileCategoryId:e.accreditationProfile.accreditationProfileCategory.id}),children:e.accreditationProfile.accreditationProfileCategory.name}),(0,i.jsx)(AT,{isCurrent:!0,to:JO.ACCREDITATIONS_PROFILE({organizationId:n,eventId:t,accreditationProfileId:s}),children:e.accreditationProfile.name})]})},hG=({accreditationProfile:e})=>{const{history:n,params:{organizationId:t,eventId:s,accreditationProfileId:o},translate:a}=Kl(),{mutate:r}=ud(),[d,l]=(0,V.useState)(!1);return(0,i.jsx)(Cy,{acronym:e.acronym,breadcrumbs:(0,i.jsx)(gG,{accreditationProfile:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsx)(tc,{to:JO.ACCREDITATIONS_PROFILE_EDIT({organizationId:t,eventId:s,accreditationProfileId:o}),children:a("_diter_62574")})}),(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{const{accreditationProfileDuplicate:{id:e}}=await r({eventId:s,accreditationProfileId:o});n.push(JO.ACCREDITATIONS_PROFILE_EDIT({organizationId:t,eventId:s,accreditationProfileId:e}))},children:a("dupliquer_28256")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),l(!0)},children:a("supprimer_43083")})})]})]})}),d&&(0,i.jsx)(HW,{accreditationProfile:e,onClose:()=>l(!1),onSuccess:()=>n.replace(JO.ACCREDITATIONS_PROFILES({organizationId:t,eventId:s}))})]}),color:e.color,icon:e.icon,name:e.name,subtext:a("accreditation",e.accreditationsSlots.length)})},pG=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl(),o=ki(Jm),a=(0,V.useMemo)(()=>(0,Lm.A)(e.accreditationsSlots,[e=>e.accreditation.name,e=>e.date?.toMillis()??0]),[e.accreditationsSlots]);return(0,i.jsx)(Nm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:s("AccreditationName")}),(0,i.jsx)(Gm,{children:s("nom_du_cr_neau_54351")}),(0,i.jsx)(Gm,{children:s("cat_gorie_00291")})]}),rows:0===a.length?(0,i.jsxs)(Tl,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(nb,{color:"primary",icon:"badge-check"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:s("no_accreditations")})]}):a.map(e=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{css:{fontWeight:"$medium"},children:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(xI,{color:e.accreditation.color,icon:e.accreditation.icon,size:"sm"}),(0,i.jsx)(Xm,{to:Ws.ACCREDITATION({organizationId:n,eventId:t,accreditationId:e.accreditation.id}),children:e.accreditation.name})]})}),(0,i.jsx)($m,{children:g(e.name)||e.date?Uh(o,e,e.accreditation.name,{date:{localeFormat:Uo.DateOnly.WeekdayLongMonthLong}}):"-"}),(0,i.jsx)($m,{children:(0,i.jsx)(Xm,{to:Ws.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.accreditation.accreditationCategoryId}),children:e.accreditation.accreditationCategoryName})})]},e.id)),title:s("accr_ditations_39450"),totalCount:a.length})},IG=e=>{const{params:{organizationId:n,eventId:t,accreditationProfileId:s},translate:o}=Kl();Au(e.event.accreditationProfile.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":t,accreditationProfileId:e?":accreditationProfileId":s});return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(hG,{accreditationProfile:e.event.accreditationProfile}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:JO.ACCREDITATIONS_PROFILE_DASHBOARD(a(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:JO.ACCREDITATIONS_PROFILE_MEMBERS(a(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($y,{path:JO.ACCREDITATIONS_PROFILE_DASHBOARD(a(!0)),children:(0,i.jsx)(yy,{children:(0,i.jsx)(pG,{accreditationsSlots:e.event.accreditationProfile.accreditationsSlots})})}),(0,i.jsx)($y,{path:JO.ACCREDITATIONS_PROFILE_MEMBERS(a(!0)),children:(0,i.jsx)(PB,{accreditationProfileId:s})})]})]})},xG=()=>{const{params:{organizationId:e,eventId:n,accreditationProfileId:t}}=Kl(),{data:s,loader:o}=Li("query AccreditationsProfile(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n accreditationProfile(id: $accreditationProfileId) {\n id\n name\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n\n accreditationsSlots {\n id\n name\n date\n\n accreditation {\n id\n name\n acronym\n color\n icon\n accreditationCategoryId\n accreditationCategoryName\n }\n }\n }\n\n volunteersRegistrations(accreditationsProfilesIds: [$accreditationProfileId]) {\n totalCount\n }\n }\n}\n",{eventId:n,accreditationProfileId:t},[]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:JO.ACCREDITATIONS_PROFILE({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(qi,{path:JO.ACCREDITATIONS_PROFILE_DASHBOARD({organizationId:e,eventId:n,accreditationProfileId:t}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(IG,{event:s.event})})]})},fG=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("mutation AccreditationProfileCategoryDelete(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n accreditationProfileCategoryDelete(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954"),n("cela_supprimera_01527")],text:n("suppression_de_73669",e.accreditationProfileCategory.name),onClose:e.onClose,onDelete:async()=>{await t({eventId:e.eventId,accreditationProfileCategoryId:e.accreditationProfileCategory.id}),e.onSuccess()}})},_G=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl();return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:JO.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t}),children:s("profils_d_accr_27825")}),(0,i.jsx)(AT,{isCurrent:!0,to:JO.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:n,eventId:t,accreditationProfileCategoryId:e.category.id}),children:e.category.name})]})},jG=({category:e,reload:n})=>{const{history:t,params:{organizationId:s,eventId:o},translate:a}=Kl(),{mutate:r}=function(e={}){return Ui("mutation AccreditationProfileCategoryDuplicate(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n accreditationProfileCategoryDuplicate(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n ) {\n id\n }\n}\n",e)}(),[d,l]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1);return(0,i.jsx)(Cy,{breadcrumbs:(0,i.jsx)(_G,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsx)(tc,{color:"white",onClick:()=>u(!0),children:a("_diter_62574")})}),(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{t.push(JO.ACCREDITATIONS_PROFILE_CREATE({organizationId:s,eventId:o,accreditationProfileCategoryId:e.id}))},children:a("cr_er_un_profil_01464")})}),(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"copy",onClick:async()=>{const{accreditationProfileCategoryDuplicate:{id:n}}=await r({eventId:o,accreditationProfileCategoryId:e.id});t.push(JO.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:s,eventId:o,accreditationProfileCategoryId:n}))},children:a("dupliquer_28256")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:a("supprimer_43083")})})]})]})}),c&&(0,i.jsx)(MW,{accreditationProfileCategory:e,eventId:o,onClose:()=>{u(!1)},onSuccess:n}),d&&(0,i.jsx)(fG,{accreditationProfileCategory:e,eventId:o,onClose:()=>{l(!1)},onSuccess:()=>{t.replace(JO.ACCREDITATIONS_PROFILES({organizationId:s,eventId:o}))}})]}),name:e.name,subtext:a("_1_profil_d_ac_37871",e.numberOfAccreditationsProfiles)})},vG=()=>{const{params:{organizationId:e,eventId:n,accreditationProfileCategoryId:t},translate:s}=Kl(),[o,a,r]=Wm(""),[d,l]=(0,V.useState)(0),[c,u]=(0,V.useState)({direction:Gn.Asc,attribute:ce.Name}),{data:m,isLoading:h}=Li("query AccreditationsProfilesCategoryProfiles(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId\n $name: String\n $offset: Int\n $sort: AccreditationsProfilesSort\n) {\n event(id: $eventId) {\n accreditationsProfiles(\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n name: $name\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n name\n acronym\n color\n icon\n\n accreditationsSlots {\n id\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,accreditationProfileCategoryId:t,name:g(a)?a:void 0,offset:d,sort:c},[]);const{numberOfPages:p,totalCount:I}=Sx(m.event?.accreditationsProfiles);return(0,i.jsx)(Nm,{filters:(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:s("rechercher_un_p_37681"),value:o,onChange:r})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($x,{attribute:ce.Name,setSort:u,sort:c,children:s("nom_08311")}),(0,i.jsx)(Gm,{children:s("Acronym")}),(0,i.jsx)(Gm,{children:s("number_of_slots_92461")})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):0===m.event.accreditationsProfiles.totalCount?(0,i.jsxs)(Tl,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(nb,{color:"primary",icon:"badge-check"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:s("aucun_profil_d_17112")})]}):m.event.accreditationsProfiles.nodes.map(t=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{css:{fontWeight:"$medium"},children:(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(xI,{color:t.color,icon:t.icon,size:"sm"}),(0,i.jsx)(Xm,{to:JO.ACCREDITATIONS_PROFILE({organizationId:e,eventId:n,accreditationProfileId:t.id}),children:t.name})]})}),(0,i.jsx)($m,{children:t.acronym||"-"}),(0,i.jsx)($m,{children:t.accreditationsSlots.length})]},t.id)),setOffset:l,title:s("liste_des_profi_29615"),totalCount:I})},SG=({event:e,reload:n})=>{const{params:{organizationId:t,eventId:s,accreditationProfileCategoryId:o},translate:a}=Kl();Au(e.accreditationProfileCategory.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":s,accreditationProfileCategoryId:e?":accreditationProfileCategoryId":o});return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(jG,{category:e.accreditationProfileCategory,reload:n}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:JO.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD(r(!1)),children:a("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:JO.ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS(r(!1)),children:a("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($y,{path:JO.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(yy,{children:(0,i.jsx)(vG,{})})}),(0,i.jsx)($y,{path:JO.ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(PB,{accreditationProfileCategoryId:o})})]})]})},yG=()=>{const{params:{organizationId:e,eventId:n,accreditationProfileCategoryId:t}}=Kl(),{data:s,loader:o,reload:a}=Li("query AccreditationsProfilesCategory(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n event(id: $eventId) {\n accreditationProfileCategory(id: $accreditationProfileCategoryId) {\n id\n name\n numberOfAccreditationsProfiles\n }\n\n volunteersRegistrations(\n accreditationsProfilesCategoriesIds: [$accreditationProfileCategoryId]\n ) {\n totalCount\n }\n }\n}\n",{eventId:n,accreditationProfileCategoryId:t},[]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:JO.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),children:(0,i.jsx)(qi,{path:JO.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD({organizationId:e,eventId:n,accreditationProfileCategoryId:t}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(SG,{event:s.event,reload:a})})]})},CG=e=>(0,i.jsx)(yy,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{gap:"6",width:1,children:[(0,i.jsx)(eB,{assignedResources:e.accreditationSlot.assignedResources,maxResources:e.accreditationSlot.maxResources}),(0,i.jsx)(KV,{accreditationCategoryId:e.accreditationSlot.accreditation.accreditationCategoryId,accreditationCategoryName:e.accreditationSlot.accreditation.accreditationCategoryName,accreditationName:e.accreditationSlot.accreditation.name,color:e.accreditationSlot.accreditation.color,customFields:e.customFields,fields:e.accreditationSlot.accreditation.fields,icon:e.accreditationSlot.accreditation.icon,numberOfDaysLimit:e.accreditationSlot.accreditation.numberOfDaysLimit,weezeventChecklistId:e.accreditationSlot.weezeventChecklistId,weezeventOrganizationId:e.weezeventOrganizationId})]}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(JV,{customFields:e.accreditationSlot.accreditation.accreditationsCustomFields}),(0,i.jsx)(yT,{tags:e.accreditationSlot.accreditation.tags}),(0,i.jsx)(_T,{privateNote:e.accreditationSlot.accreditation.privateNote})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(fT,{description:e.accreditationSlot.accreditation.description}),(0,i.jsx)(nB,{location:e.accreditationSlot.accreditation})]})]})]})}),bG=e=>{const{params:{organizationId:n,eventId:t,accreditationId:s,accreditationSlotId:o},translate:a}=Kl(),r=ki(Jm),d=(0,V.useMemo)(()=>Uh(r,e.slot,e.slot.accreditation.name,{date:{localeFormat:Uo.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:Ws.ACCREDITATIONS({organizationId:n,eventId:t}),children:a("accr_ditations_39450")}),(0,i.jsx)(AT,{to:Ws.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.slot.accreditation.accreditationCategoryId}),children:e.slot.accreditation.accreditationCategoryName}),(0,i.jsx)(AT,{to:Ws.ACCREDITATION({organizationId:n,eventId:t,accreditationId:s}),children:e.slot.accreditation.name}),(0,i.jsx)(AT,{isCurrent:!0,to:Ws.ACCREDITATION_SLOT({organizationId:n,eventId:t,accreditationId:s,accreditationSlotId:o}),children:d})]})},AG=e=>{const{history:n,params:{organizationId:t,eventId:s,accreditationId:o},translate:a}=Kl(),{user:r}=Yi(),d=FV(),{mutate:l}=ld(),[c,u]=(0,V.useState)(!1),m=ki(Jm),g=(0,V.useMemo)(()=>Uh(m,e.slot,e.slot.accreditation.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:Uo.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsx)(Cy,{acronym:e.slot.accreditation.acronym,breadcrumbs:(0,i.jsx)(bG,{slot:e.slot}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{to:yo.EDIT_ACCREDITATION(t,s,o),children:a("_diter_62574")}),(0,i.jsx)(ly,{permissions:sy.ACCREDITATION_EDIT,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"arrow-down-to-bracket",onClick:()=>d(TV,{accreditationsSlotsIds:[e.slot.id]}),children:a("exporter_les_me_63676")}),yh(t)&&(0,i.jsx)(Pu,{icon:"arrow-down-to-bracket",target:"_blank",to:Ef(e.slot.links.asoPaxManifestLink,"pdf",{lang:r?.language}),children:"PAX Manifest"})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:e=>{Tu(e.target),u(!0)},children:a("supprimer_43083")})})]})]})}),c&&(0,i.jsx)(ow,{buttonText:a("supprimer_43083"),subtext:[a("_tes_vous_s_r_d_48876")],text:a("suppression_de_73669",g),onClose:()=>u(!1),onDelete:async()=>{await l({eventId:s,accreditationSlotId:e.slot.id}),n.replace(Ws.ACCREDITATION({organizationId:t,eventId:s,accreditationId:o}))}})]}),color:e.slot.accreditation.color,icon:e.slot.accreditation.icon,name:g})},EG=e=>{const{params:{organizationId:n,eventId:t,accreditationId:s,accreditationSlotId:o},translate:a}=Kl();Au(Uh(ki(Jm),e.event.accreditationSlot,e.event.accreditationSlot.name));const r=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":t,accreditationId:e?":accreditationId":s,accreditationSlotId:e?":accreditationSlotId":o});return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(AG,{slot:e.event.accreditationSlot}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:Ws.ACCREDITATION_SLOT_DASHBOARD(r(!1)),children:a("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:Ws.ACCREDITATION_SLOT_MEMBERS(r(!1)),children:a("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($y,{path:Ws.ACCREDITATION_SLOT_DASHBOARD(r(!0)),children:(0,i.jsx)(CG,{accreditationSlot:e.event.accreditationSlot,customFields:e.organization.customFields.nodes,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),(0,i.jsx)($y,{path:Ws.ACCREDITATION_SLOT_MEMBERS(r(!0)),children:(0,i.jsx)(PB,{accreditationSlotId:o})})]})]})},wG=()=>{const{params:{organizationId:e,eventId:n,accreditationId:t,accreditationSlotId:s}}=Kl(),{data:o,loader:a}=Li("query AccreditationsSlot(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, variety: Accreditation) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n id\n name\n date\n assignedResources\n maxResources\n weezeventChecklistId\n\n accreditation {\n name\n description\n privateNote\n acronym\n icon\n color\n address\n latitude\n longitude\n layer\n zoom\n accreditationCategoryId\n accreditationCategoryName\n fields\n numberOfDaysLimit\n\n accreditationsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n tags {\n id\n name\n }\n }\n\n links {\n asoPaxManifestLink\n }\n }\n\n volunteersRegistrations(accreditationsSlotsIds: [$accreditationSlotId]) {\n totalCount\n }\n }\n}\n",{organizationId:e,eventId:n,accreditationSlotId:s},[$o.CustomFieldWithConditionFragment]);return a||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:Ws.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(qi,{path:Ws.ACCREDITATION_SLOT_DASHBOARD({organizationId:e,eventId:n,accreditationId:t,accreditationSlotId:s}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(EG,{event:o.event,organization:o.organization})})]})},$G=V.createContext({}),TG=e=>{const n=Wi(),[t,s]=V.useState(e.positionsIds),[o,a]=V.useState(e.positionsCategoriesIds),[r,d]=V.useState(e.positionsSlotsIds);return(0,i.jsx)($G.Provider,{value:{isEdit:e.isEdit,isPreAssign:n.pathname.includes("pre-assignment"),positionsIds:t,positionsCategoriesIds:o,positionsSlotsIds:r,showNextVolunteer:e.showNextVolunteer,setPositionsIds:s,setPositionsCategoriesIds:a,setPositionsSlotsIds:d,teams:e.teams},children:e.children})};function zG(){return V.useContext($G)}const OG=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl(),{isPreAssign:a,positionsIds:r,positionsCategoriesIds:d,positionsSlotsIds:l,showNextVolunteer:c}=zG(),{mutate:u,isLoading:m}=rr(),{mutate:g,isLoading:h}=xl(),{mutate:p,isLoading:I}=function(e={}){return Ui("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:f}=lr(),_=(0,V.useCallback)(()=>{e.isEdit?n.goBack(yo.ASSIGNMENTS(t,s)):c()},[e.isEdit,c]);return(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(Mr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{m||h||I||f||(await p({eventId:s,volunteerRegistrationId:e.volunteerRegistrationId}),_())},children:o("refuser_92819")}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(tc,{color:"primary",isLoading:m||h,onClick:async()=>{a?(!Yo(r)||m||h||I||f||(await g({eventId:s,massPreAssign:{level:In.Positions,positionsIds:r,positionsCategoriesIds:[],selecteds:{ids:[e.userInfoId]},strategy:hn.Replace}}),_()),!Yo(d)||m||h||I||f||(await g({eventId:s,massPreAssign:{level:In.Categories,positionsIds:[],positionsCategoriesIds:d,selecteds:{ids:[e.userInfoId]},strategy:hn.Replace}}),_())):m||h||I||f||(Yo(l)?await u({eventId:s,massAssign:{positionsSlotsIds:l,selecteds:{ids:[e.userInfoId]},strategy:hn.Replace}}):await x({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:it.WaitingAssignment}}),_())},children:e.isEdit?o("mettre_jour_l_30423"):o(a?"pr_affecter_17434":"affecter_94255")}),(0,i.jsx)(tc,{color:"white",onClick:_,children:e.isEdit?o("annuler_48254"):o("affecter_plus_t_97778")})]})},RG=e=>{const[n,t]=V.useState(e.initialIsOpen);return(0,i.jsxs)(Tl,{css:{bd:!0,userSelect:"none",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:e.header}),(0,i.jsx)(tc,{color:"white",leftIcon:n?"chevron-up":"chevron-down",size:"sm",onClick:()=>{t(!n)}})]}),n&&(0,i.jsx)(Tl,{css:{background:"$gray100",padding:"$6"},direction:"column",children:e.children})]})},DG=e=>{const n=Fi(),t=e.assignedResources/e.neededResources;return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,cursor:"pointer",userSelect:"none"},direction:"column",width:1,onClick:e.onClick,children:[(0,i.jsxs)(Tl,{align:"center",css:{padding:"$3 $5"},width:1,children:[e.isRadio?(0,i.jsx)(lm,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:Bc.A}):(0,i.jsx)(sm,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:Bc.A}),(0,i.jsx)(Pl,{width:"4"}),(0,i.jsx)(xI,{color:e.color,icon:e.icon}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[g(e.category)&&(0,i.jsx)(Mr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(Mr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Pl,{width:"2"}),(0,i.jsx)(Mr,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:"user-group"})}),(0,i.jsx)(Pl,{width:"2"}),(0,i.jsxs)(Mr,{color:"gray700",children:[e.assignedResources,"/",e.neededResources]}),(0,i.jsx)(Pl,{width:"6"}),(0,i.jsx)(Mr,{width:120,children:(0,i.jsx)(lF,{percent:t})}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsxs)(Mr,{color:"gray700",textAlign:"end",width:36,children:[Math.min(100,Math.round(100*t)),"%"]})]}),(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",padding:"$3 $6","&:empty":{display:"none"}},children:[e.overlaps&&(0,i.jsx)(Ku,{color:"warning",leftIcon:"triangle-exclamation",children:n("ce_cr_neau_en_c_55775")}),e.teamMembers]})]})},MG=e=>{const n=Fi(),t=ki(Bg),{positionsIds:s,positionsCategoriesIds:o,setPositionsIds:a,setPositionsCategoriesIds:r}=zG(),d=()=>{r(Xo(o,e.category.id))};return(0,i.jsx)(RG,{css:{background:"white"},header:(0,i.jsxs)(Tl,{align:"center",children:[(0,i.jsx)(sm,{state:o.includes(e.category.id)?"checked":"unchecked",onClick:d}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(Mr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"medium",onClick:d,children:e.category.name}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(Ku,{color:"warning",size:"md",children:n("_1_membre_manq_31014",e.category.resources)}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(Mr,{css:{flex:"1"}})]}),initialIsOpen:!0,children:(0,i.jsx)(Tl,{css:{background:"$gray100"},direction:"column",gap:"2",children:e.category.positions.map(e=>(0,i.jsx)(DG,{assignedResources:e.assignedResources,color:e.color,icon:e.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:!1,subtitle:e.range?t.toDisplayString(e.range):"-",title:e.name,onClick:()=>{a(Xo(s,e.id))}},e.id))})})},PG=e=>{const n=Fi(),t=(0,V.useMemo)(()=>function(e,n,t,i,s,o){const{wishedPositionsSlots:a,possiblePositionsSlots:r,otherPositionsSlots:d}=Qg(e,n,t,i,s,o),l=new Set,c=e=>Object.values((0,fm.A)(e,e=>e.positionCategory.id)).flatMap(e=>{const n=Object.values((0,fm.A)(e,e=>e.position.id)).flatMap(e=>{const n=e[0].position;return l.has(n.id)?[]:(l.add(n.id),n)});return 0===n.length?[]:[{...e[0].positionCategory,positions:n}]});return{wishedPositionsCategories:c(a),possiblePositionsCategories:c(r),otherPositionsCategories:c(d)}}(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)(Mr,{font:"gray900 textMd medium",children:n("cat_gorie_mis_36044",t.wishedPositionsCategories.length)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("cat_gories_ou_m_71206")}),(0,i.jsx)(Pl,{height:"3"}),t.wishedPositionsCategories.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(MG,{category:e}),(0,i.jsx)(Pl,{height:"3"})]},e.id)),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("autre_cat_gorie_21569",t.possiblePositionsCategories.length)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("cat_gories_ou_m_50063")}),(0,i.jsx)(Pl,{height:"3"}),t.possiblePositionsCategories.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(MG,{category:e}),(0,i.jsx)(Pl,{height:"3"})]},e.id)),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("autre_cat_gorie_64824",t.otherPositionsCategories.length)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("cat_gories_ou_m_74482")}),(0,i.jsx)(Pl,{height:"3"}),t.otherPositionsCategories.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(MG,{category:e}),(0,i.jsx)(Pl,{height:"3"})]},e.id))]})},kG=e=>{const{translate:n}=Kl(),{isPreAssign:t,teams:s}=zG(),o=(0,V.useMemo)(()=>!t&&Yo(s)?s.flatMap(n=>n.members.flatMap(n=>n.positionsSlotsUsersInfos.map(e=>e.positionSlotId).includes(e.positionSlotId)?[n.userInfo]:[])):[],[t,s,e.positionSlotId]);return Yo(o)?(0,i.jsxs)(Tl,{align:"center",css:{marginLeft:"auto"},gap:"1",children:[(0,i.jsx)(lE,{teamMembers:o}),(0,i.jsx)(Mr,{font:"gray800 textXs regular",children:n("_1_quipier_es_00024",o.length)})]}):null},FG=(e,n)=>{const t={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return g(n.name)?`${n.name} - ${e.toLocaleString(n.range,void 0,t)}`:e.toLocaleString(n.range,void 0,t)},NG=e=>e.position.positionDisplay===jn.Radio,LG=e=>{const n=Fi(),t=ki(Bg),{positionsSlotsIds:s,setPositionsSlotsIds:o}=zG(),a=(0,V.useMemo)(()=>e.positionsSlots.filter(n=>e.state===it.Assigned&&s.includes(n.id)),[e.state]),{wishedPositionsSlots:r,possiblePositionsSlots:d,otherPositionsSlots:l}=(0,V.useMemo)(()=>{const n=Qg(e.positionsSlots,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges,e.userInfo.fields),t=a.map(e=>e.id);return{wishedPositionsSlots:n.wishedPositionsSlots.filter(e=>!t.includes(e.id)),possiblePositionsSlots:n.possiblePositionsSlots.filter(e=>!t.includes(e.id)),otherPositionsSlots:n.otherPositionsSlots.filter(e=>!t.includes(e.id))}},[e.positionsSlots,e.userInfo,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges]),c=(0,V.useMemo)(()=>{const e=r.concat(d).concat(l);return s.flatMap(n=>{const t=e.find(e=>e.id===n);return t?[t]:[]})},[r,d,l,s]),u=e=>NG(e)?c.filter(n=>n.position.id!==e.position.id):c,m=n=>{if(NG(n)){const t=e.positionsSlots.filter(e=>e.position.id===n.position.id).map(e=>e.id);o([...s.filter(e=>!t.includes(e)),...s.includes(n.id)?[]:[n.id]])}else o(Xo(s,n.id))};return(0,i.jsxs)(i.Fragment,{children:[e.state===it.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("cr_neau_affect_50400",a.length)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("cr_neaux_sur_le_05515",e.userInfo.name)}),(0,i.jsx)(Pl,{height:"3"}),a.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(DG,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isRadio:NG(e),isSelected:s.includes(e.id),neededResources:e.resources,overlaps:Kg(e,u(e)),subtitle:FG(t,e),teamMembers:(0,i.jsx)(kG,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{m(e)}}),(0,i.jsx)(Pl,{height:"3"})]},e.id)),(0,i.jsx)(Pl,{height:"6"})]}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("creneau_souhaite",r.length)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("cr_neaux_dont_l_10130")}),(0,i.jsx)(Pl,{height:"3"}),r.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(DG,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isRadio:NG(e),isSelected:s.includes(e.id),neededResources:e.resources,overlaps:Kg(e,u(e)),subtitle:FG(t,e),teamMembers:(0,i.jsx)(kG,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{m(e)}}),(0,i.jsx)(Pl,{height:"3"})]},e.id)),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("autre_creneau_possible",d.length)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("cr_neaux_dont_l_99850")}),(0,i.jsx)(Pl,{height:"3"}),d.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(DG,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isRadio:NG(e),isSelected:s.includes(e.id),neededResources:e.resources,overlaps:Kg(e,u(e)),subtitle:FG(t,e),teamMembers:(0,i.jsx)(kG,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{m(e)}}),(0,i.jsx)(Pl,{height:"3"})]},e.id)),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("autre_creneau",l.length)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("cr_neaux_dont_l_25685")}),(0,i.jsx)(Pl,{height:"3"}),l.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(DG,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isRadio:NG(e),isSelected:s.includes(e.id),neededResources:e.resources,overlaps:Kg(e,u(e)),subtitle:FG(t,e),teamMembers:(0,i.jsx)(kG,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{m(e)}}),(0,i.jsx)(Pl,{height:"3"})]},e.id))]})},UG=e=>{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>(e.positionsCategoriesIds||[]).map(n=>e.event.positionsCategories.find(e=>e.id===n).name).join(", "),[e.positionsCategoriesIds,e.event]),o=(0,V.useMemo)(()=>(e.positionsIds||[]).map(n=>e.event.positions.nodes.find(e=>e.id===n).name).join(", "),[e.positionsIds,e.event]),a=(0,V.useMemo)(()=>e.date?t.toLocaleString(e.date,Uo.DateOnly.MonthLong):"",[e.date]),r=(0,V.useMemo)(()=>e.segmentId?e.event.segments.find(n=>n.id===e.segmentId).name:"",[e.segmentId,e.event]),d=(0,V.useMemo)(()=>(e.tagsIds||[]).map(n=>e.organization.tags.nodes.find(e=>e.id===n).name).join(", "),[e.tagsIds,e.organization]);return g(s)||g(o)||g(a)||g(r)||g(d)||e.excludeFull||e.excludePast?(0,i.jsxs)(Tl,{align:"center",gap:"3",wrap:"wrap",children:[g(s)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsCategoriesIds(null)},children:n("cat_gories_1_42029",s)}),g(o)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsIds(null)},children:n("missions_1_62834",o)}),g(a)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:n("date_1_17337",a)}),g(r)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:n("vue_1_29260",r)}),g(d)&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds(null)},children:n("tags_1_43158",d)}),e.excludeFull&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:n("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(Ku,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:n("cr_neaux_dans_l_92999")}),(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:n("r_initialiser_l_66835")})]}):null},VG=e=>{const n=Fi(),[t,s]=(0,V.useState)(e.positionsCategoriesIds),[o,a]=(0,V.useState)(e.positionsIds),[r,d]=(0,V.useState)(e.date),[l,c]=(0,V.useState)(e.segmentId?[e.segmentId]:[]),[u,m]=(0,V.useState)(e.tagsIds),[g,h]=(0,V.useState)(e.excludeFull?"checked":"unchecked"),[p,I]=(0,V.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Tl,{direction:"column",onChange:jc,children:[(0,i.jsxs)(Tl,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("liste_des_filtr_75605")}),(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_97056"),renderOnPortal:!0,values:t||qo,onChange:s,children:e.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_71859"),renderOnPortal:!0,values:o||qo,onChange:a,children:e.event.positions.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Wp,{max:e.event.endAt,min:e.event.startAt,placeholder:n("date_du_cr_neau_82295"),value:r,onChange:d}),(0,i.jsx)(_m,{isSearchVisible:!0,placeholder:n("s_lectionnez_un_19794"),renderOnPortal:!0,values:l,onChange:e=>{Yo(e)?c([(0,lg.A)(e)]):c([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_73255"),renderOnPortal:!0,values:u||qo,onChange:m,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(om,{state:g,onClick:h,children:n("masquer_les_cr_14425")}),(0,i.jsx)(om,{state:p,onClick:I,children:n("masquer_les_cr_05336")})]}),(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:n("r_initialiser_77538")}),(0,i.jsx)(tc,{size:"sm",onClick:()=>{e.setDate(r),e.setExcludeFull("checked"===g),e.setExcludePast("checked"===p),e.setPositionsCategoriesIds(t),e.setPositionsIds(o),e.setSegmentId(Yo(l)?l[0]:null),e.setTagsIds(u),e.close()},children:n("appliquer_05753")})]})]})},BG=e=>{const n=Fi(),[t,s]=(0,V.useState)(!1),o=(0,V.useCallback)(()=>{e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setPositionsCategoriesIds(null),e.setPositionsIds(null),e.setSegmentId(null),e.setTagsIds(null)},[e.setDate,e.setExcludeFull,e.setExcludePast,e.setPositionsCategoriesIds,e.setPositionsIds,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Tl,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Ou,{doNotCloseOnOtherOpen:!0,isOpen:t,onStateChange:s,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"bars-filter",children:n("filtres_64574")})})}),(0,i.jsx)(Fu,{placement:"bottom-end",width:385,children:(0,i.jsx)(VG,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(UG,{...e,reset:o})]})},WG=e=>{const{eventId:n}=Vi(),{isPreAssign:t}=zG(),[s,o,a]=Wm(""),[r,d]=zD("assignment.filters.positionsCategoriesIds",null),[l,c]=zD("assignment.filters.positionsIds",null),[u,m]=zD("assignment.filters.date",null),[h,p]=zD("assignment.filters.tagsIds",null),[I,x]=zD("assignment.filters.segmentId",null),[f,_]=zD("assignment.filters.excludeFull",!1),[j,v]=zD("assignment.filters.excludePast",!1),{data:S,loader:y}=Li("query AssignmentSlots(\n $eventId: EventId!\n $name: String\n $positionsCategoriesIds: [PositionsCategoryId!]\n $positionsIds: [PositionId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n positionsSlots(\n name: $name\n positionsCategoriesIds: $positionsCategoriesIds\n positionsIds: $positionsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n ) {\n nodes {\n id\n name\n range\n assignedResources\n resources\n\n positionCategory {\n id\n name\n resources\n }\n\n position {\n id\n name\n color\n icon\n positionDisplay\n assignedResources\n resources\n range\n\n ...PositionPositionsCustomFields\n }\n }\n }\n }\n}\n",{eventId:n,name:g(o)?o:void 0,positionsCategoriesIds:Yo(r)?r:void 0,positionsIds:Yo(l)?l:void 0,date:u,tagsIds:Yo(h)?h:void 0,segmentId:I,excludeFull:f,excludePast:j},[$o.PositionPositionsCustomFieldsFragment]);return(0,i.jsxs)(Tl,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(BG,{date:u,event:e.event,excludeFull:f,excludePast:j,name:s,organization:e.organization,positionsCategoriesIds:r,positionsIds:l,segmentId:I,setDate:m,setExcludeFull:_,setExcludePast:v,setName:a,setPositionsCategoriesIds:d,setPositionsIds:c,setSegmentId:x,setTagsIds:p,tagsIds:h}),(0,i.jsx)(Pl,{height:"7"}),y||(t?(0,i.jsx)(PG,{positionsSlots:S.event?.positionsSlots.nodes??[],userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}):(0,i.jsx)(LG,{positionsSlots:S.event?.positionsSlots.nodes??[],state:e.state,userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}))]})},GG=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,userInfoId:a}}=Kl(),r=Wi().pathname.includes("pre-assignment"),{canMemberAssign:d}=oy();Au(t("affectations_1_71402",e.event.volunteerRegistration.userInfo.name));const[l,c]=zD("assignment.isLeftPanelOpen",!0),[u,m]=zD("assignment.isRightPanelOpen",!0),[h,p,I]=Wm(""),[x,f]=zD("assignment.leftPanelDirection",Gn.Desc),[_,j]=zD("assignment.leftPanelSegmentId",-1),[v,S]=zD("assignment.leftPanelStates",[it.WaitingAssignment,it.PreAssigned]),{data:y,isLoading:C}=xa({eventId:o,states:v,name:g(p)?p:void 0,segmentId:-1===_?void 0:_,direction:x,loadDelegations:!1}),b=(0,V.useCallback)(()=>{const e=y.event?.volunteersRegistrations.nodes??[],t=e.findIndex(e=>e.userInfo.id===a),i=e[t+1]?.userInfo.id??e[0].userInfo.id;i===a?n.goBack(yo.ASSIGNMENTS(s,o)):r?n.replace(yo.PRE_ASSIGNMENT(s,o,i)):n.replace(yo.ASSIGNMENT(s,o,i))},[r,s,o,a,y.event]),A=e.event.volunteerRegistration,E=(0,V.useMemo)(()=>A.positionsSlotsUsersInfos.map(({positionSlotId:e})=>e),[A]),w=(0,V.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)(TG,{isEdit:e.isEdit,positionsCategoriesIds:A.preassignPositionsCategoriesIds,positionsIds:A.preassignPositionsIds,positionsSlotsIds:E,showNextVolunteer:b,teams:A.teams,children:(0,i.jsx)(NB,{buttons:(0,i.jsx)(OG,{isEdit:e.isEdit,userInfoId:A.userInfo.id,volunteerRegistrationId:A.id}),header:(0,i.jsx)(LB,{badgeColorIcon:Ly(A.state),delegation:A.delegation,insertedAt:A.insertedAt,isPreAssign:r,showTabs:d,showTeam:!0,teams:A.teams,userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:l,isRightPanelOpen:u,leftPanel:(0,i.jsx)(BB,{accreditationStates:qo,delegationId:null,direction:x,event:y.event,getPath:e=>r?yo.PRE_ASSIGNMENT(s,o,e):yo.ASSIGNMENT(s,o,e),isLoading:C,loadDelegations:!1,name:h,segmentId:_,setAccreditationStates:Bc.A,setDelegationId:Bc.A,setDirection:f,setName:I,setSegmentId:j,setStates:S,showAccreditationStates:!1,showStates:!0,states:v,userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(XB,{customFields:e.event.formsCustomsFields,eventId:o,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:s,showWishedAccreditations:!1,showWishedPositions:!0,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{m(!1)}}),setIsLeftPanelOpen:c,setIsRightPanelOpen:m,children:(0,i.jsx)(WG,{event:e.event,organization:e.organization,state:A.state,userInfo:A.userInfo,...w})})})},qG=e=>{const{organizationId:n,eventId:t,userInfoId:s}=Vi(),{data:o,loader:a}=Li("query AssignmentInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n positionsCategories {\n id\n name\n }\n\n positions {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Positions) {\n id\n name\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n userInfoId\n state\n preassignPositionsIds\n preassignPositionsCategoriesIds\n isTeamMember\n insertedAt\n\n delegation {\n id\n name\n }\n\n teams {\n leaderUserInfoId\n teamCode\n\n members {\n positionsSlotsUsersInfos {\n positionSlotId\n }\n\n userInfo {\n ...UserInfoTeamMember\n }\n }\n }\n\n userInfo {\n id\n name\n email\n fields\n picture {\n url\n }\n }\n\n positionsCategories {\n id\n }\n\n positions {\n id\n }\n\n positionsSlots {\n id\n }\n\n slots: slotsMerged {\n range\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n",{organizationId:n,eventId:t,userInfoId:s},[$o.FormsUsersInfosWishedFragment,$o.CustomFieldWithConditionFragment,$o.UserInfoTeamMemberFragment]);return a||(0,i.jsx)(GG,{event:o.event,isEdit:e.isEdit,organization:o.organization})},HG=e=>{const n=Fi(),{mutate:t,isLoading:s}=function(e={}){return Ui("mutation SendAssignmentsEmails(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsSend(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}();return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nb,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray900 textLg medium",textAlign:"center",children:n("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("les_membres_pr_53976")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{isLoading:s,onClick:async()=>{await t({eventId:e.eventId,sendAssignmentsEmails:e.sendAssignmentsEmails}),e.reload(),e.onClose()},children:n("confirmer_l_env_08749")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},YG=e=>{const n=Fi(),[t,s,o]=Wm(""),[a,r]=(0,V.useState)([]),{data:d}=Id({eventId:e.eventId,usersInfosIds:a,name:g(s)?s:void 0}),{mutate:l,isLoading:c}=function(e={}){return Ui("mutation AssignmentsEmailsEstimate(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsEstimate(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}(),[u,m]=(0,V.useState)(pe.Everyone),h=(0,V.useMemo)(()=>(0,Rg.A)((d.event?.volunteersRegistrations.nodes??[]).concat(d.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[d.event]),[p,I]=(0,V.useState)([]),x=u===pe.Everyone||u===pe.Assigned||u===pe.Refused||u===pe.Members&&Yo(a)||u===pe.Segments&&Yo(p),f=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(nb,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("envoi_des_e_mai_81363")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("personnaliser_v_78340")}),(0,i.jsx)(Pl,{height:"7"}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{alertStyle:"error",children:(0,i.jsx)(uc,{children:n("vous_ne_pouvez_69435")})}),(0,i.jsx)(Pl,{height:"4"})]}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("que_souhaitez_v_01732")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(cm,{state:u===pe.Everyone?"checked":"unchecked",onClick:()=>{m(pe.Everyone)},children:n("tous_les_e_mail_39319")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:u===pe.Assigned?"checked":"unchecked",onClick:()=>{m(pe.Assigned)},children:n("tous_les_e_mail_42685")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:u===pe.Refused?"checked":"unchecked",onClick:()=>{m(pe.Refused)},children:n("tous_les_e_mail_41162")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:u===pe.Members?"checked":"unchecked",onClick:()=>{m(pe.Members)},children:n("_certains_memb_91094")}),u===pe.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_50038"),state:"search",value:t,onChange:o}),values:a,onChange:r,children:h.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:u===pe.Segments?"checked":"unchecked",onClick:()=>{m(pe.Segments)},children:n("uniquement_ce_54026")}),u===pe.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Mr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,values:p,onChange:I,children:(d.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:f,isLoading:c,onClick:async()=>{if(x){const n={recipients:u,segmentsIds:p,usersInfosIds:a},{eventAssignmentsEmailsEstimate:t}=await l({eventId:e.eventId,sendAssignmentsEmails:n});e.onSuccess(t,n),e.onClose()}},children:n("envoyer_les_e_m_37846")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},ZG=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=Kl(),{localEvent:o,setNumberOfWaitingAssigments:a}=BS(),{data:r,loader:d,reload:l}=Li('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:t,eventId:s,direction:o?.["assignment.leftPanelDirection"]??Gn.Desc},[]);const c=Um(),[u,m,h]=Wm(""),[p,I]=(0,V.useState)(""),[x,f]=(0,V.useState)(0),{data:_,isLoading:j,reload:v}=function(e){return Li("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,[$o.EmailRecipientFragment])}({eventId:s,name:g(m)?m:void 0,state:""!==p?p:void 0,offset:x}),[S,y]=(0,V.useState)(!1),[C,b]=(0,V.useState)(null),[A,E]=(0,V.useState)(0),[w,$]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{r.event?.waitingAssignment&&a(r.event.waitingAssignment.totalCount)},[r]),d||(0,i.jsxs)(Tl,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:n("mes_affectation_73224")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsx)(YT,{button:(0,i.jsxs)(i.Fragment,{children:[r.event.hasFormWithTeamsAllowed&&(0,i.jsx)(tc,{color:"invisible",disabled:0===r.event.waitingTeams.totalCount,onClick:()=>{e.push(yo.TEAM_ASSIGNMENT(t,s,r.event.waitingTeams.nodes[0].teamCode))},children:n("affecter_les_q_17322")}),(0,i.jsx)(tc,{disabled:0===r.event.waitingAssignment.totalCount,onClick:()=>{e.push(yo.ASSIGNMENT(t,s,r.event.waitingAssignment.nodes[0].userInfoId))},children:n("affecter_les_me_77160")})]}),icon:"arrow-trend-up",iconColor:"success",text:n("membre_en_atten_84228",r.event.waitingAssignment.totalCount),value:r.event.waitingAssignment.totalCount}),(0,i.jsx)(YT,{button:(0,i.jsx)(tc,{onClick:()=>{y(!0)},children:n("param_trer_et_e_31095")}),icon:"at",iconColor:"success",text:n("e_mail_de_confi_84099",r.event.emailsStats.numberOfWaiting),value:r.event.emailsStats.numberOfWaiting}),(0,i.jsx)(YT,{button:(0,i.jsx)(tc,{onClick:()=>{e.push(yo.VOLUNTEERS(t,s))},children:n("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:n("membre_affect_05484",r.event.assigned.totalCount),value:r.event.assigned.totalCount})]}),(0,i.jsx)(Pl,{height:"9"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("historique_des_68195")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{gap:"6",children:[(0,i.jsx)(YT,{icon:"paper-plane",iconColor:"purple",text:n("nombre_d_envois_95106"),value:r.event.emailsStats.numberOfSent??0}),(0,i.jsx)(YT,{icon:"eye",iconColor:"success",text:n("nombre_d_ouvert_84187"),value:r.event.emailsStats.numberOfOpen??0}),(0,i.jsx)(YT,{icon:"hand-pointer",iconColor:"primary",text:n("nombre_de_clics_64232"),value:r.event.emailsStats.numberOfClick??0})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{value:p,onChange:e=>{I(e),f(0)},children:[(0,i.jsx)("option",{value:"",children:n("tous_les_status_67644")}),c(Lt.filter(e=>e!==Le.Queued))]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_d_02329"),value:u,onChange:e=>{h(e),f(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("nom_du_membre_69353")}),(0,i.jsx)(Gm,{children:n("date_d_envoi_74668")}),(0,i.jsx)(Gm,{children:n("State")}),(0,i.jsx)(Gm,{width:100})]}),numberOfPages:_.event?.emails.numberOfPages??0,offset:x,rows:j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):Yo(_.event.emails.nodes)?(0,i.jsx)(i.Fragment,{children:_.event.emails.nodes.map(e=>(0,i.jsx)(ky,{email:e,emailType:Ve.Assignments,reload:v},e.id))}):(0,i.jsx)(IE,{subtitle:n("vous_n_avez_pas_92612"),title:n("aucun_courriel_12121")}),setOffset:f,title:n("liste_des_envoi_52697"),totalCount:_.event?.emails.totalCount??0}),S&&(0,i.jsx)(YG,{emailSender:r.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{y(!1)},onSuccess:(e,n)=>{E(e),b(n),$(!0)}}),w&&(0,i.jsx)(HG,{eventId:s,numberOfEmails:A,reload:l,sendAssignmentsEmails:C,onClose:()=>{$(!1)}})]})},KG=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=Kl(),{localEvent:o}=BS(),{data:a,loader:r}=Li('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"]??Gn.Desc},[]);return r||(0,i.jsxs)(Tl,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:n("mes_affectation_73224")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{gap:"6",children:(0,i.jsx)(YT,{button:(0,i.jsx)(tc,{disabled:0===a.event.preAssigneds.totalCount,onClick:()=>{e.push(yo.ASSIGNMENT(t,s,a.event.preAssigneds.nodes[0].userInfoId))},children:n("affecter_les_me_77160")}),icon:"arrow-trend-up",iconColor:"success",text:n("membre_en_atten_84228",a.event.preAssigneds.totalCount),value:a.event.preAssigneds.totalCount})})]})},XG=()=>{const{translate:e,params:{eventId:n}}=Kl(),{event:{name:t},hasPermission:s,updateLocalEvent:o}=BS(),a=s(sy.MEMBER_ASSIGN,{eventId:n});return Au(`${t} ${e("mes_affectation_73224")}`),(0,V.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})])})()},[]),a?(0,i.jsx)(ZG,{}):(0,i.jsx)(KG,{})},QG=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,teamCode:a}}=Kl(),r=a===e.team.teamCode,[d,l]=(0,V.useState)(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{background:r?"$primary100":"white",borderBottom:d?"none":"1px solid $gray200",cursor:"pointer",padding:"$4","&:hover":{background:"$primary100"}},gap:"4",onClick:()=>{n.push(yo.TEAM_ASSIGNMENT(s,o,e.team.teamCode))},children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:e.team.teamCode}),(0,i.jsx)(Mr,{color:"gray500",children:t("_1_membre_49737",e.team.members.length)})]}),(0,i.jsx)(Mr,{color:"gray900",css:{cursor:"pointer",padding:"$2"},fontSize:"textMd",onClick:e=>{jc(e),l(!d)},children:(0,i.jsx)(Yl,{icon:d?"chevron-down":"chevron-right"})})]}),d&&e.team.members.map((t,a)=>(0,i.jsx)(UB,{displayBorder:a===e.team.members.length-1,isSelected:r,vr:t,onClick:()=>{n.push(yo.TEAM_ASSIGNMENT(s,o,e.team.teamCode))}},t.userInfo.id))]})},JG=e=>{const{params:{organizationId:n,eventId:t,teamCode:s},translate:o}=Kl(),a=e.event?.teams.totalCount??0,r=e.event?.teams.nodes??[];return(0,i.jsxs)(Tl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Tl,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Gy,{color:"primary",returnPathFallback:yo.TEAM_ASSIGNMENT(n,t,s),children:o("retour_92202")}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(Ku,{color:"error",size:"sm",children:o("_1_quipe_rest_49090",a)})]})]}),(0,i.jsxs)(Tl,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:o("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(Ou,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(Fu,{css:{paddingTop:"0"},placement:"bottom",children:(0,i.jsxs)(Tl,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsx)(wc,{label:o("nombre_de_membr_84892"),shouldParseAsInt:!0,value:e.numberOfMembers||"",onChange:e.setNumberOfMembers})]})})]})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(VB,{}),(0,i.jsx)(VB,{}),(0,i.jsx)(VB,{})]}):r.map(e=>(0,i.jsx)(QG,{team:e},e.teamCode))})]})},eq=()=>{const{translate:e,params:{eventId:n,teamCode:t}}=Kl(),{positionsSlotsIds:s,showNextVolunteer:o}=zG(),{mutate:a,isLoading:r}=function(e={}){return Ui("mutation TeamAssignmentRefuse($eventId: EventId!, $teamCode: TeamCode!) {\n teamAssignmentRefuse(eventId: $eventId, teamCode: $teamCode)\n}\n",e)}(),{mutate:d,isLoading:l}=function(e={}){return Ui("mutation TeamAssign($eventId: EventId!, $teamCode: TeamCode!, $assignment: AssignmentInput!) {\n teamAssign(eventId: $eventId, teamCode: $teamCode, assignment: $assignment)\n}\n",e)}();return(0,i.jsxs)(Tl,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(Mr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{l||r||(await a({eventId:n,teamCode:t}),o())},children:e("refuser_l_quip_29246")}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(tc,{color:"primary",isLoading:l,onClick:async()=>{l||r||(await d({eventId:n,teamCode:t,assignment:{positionsSlotsIds:s}}),o())},children:e("affecter_l_qui_23291")}),(0,i.jsx)(tc,{color:"white",onClick:o,children:e("affecter_l_qui_37763")})]})},nq=e=>{const n=Fi();return(0,i.jsx)(Tl,{align:"center",css:{padding:"$5 $6"},gap:"4",children:(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textXl medium",children:e.team.teamCode}),(0,i.jsx)(Mr,{color:"gray500",children:n("_1_membre_49737",e.team.members.length)})]})})},tq=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=(0,V.useMemo)(()=>e.team.leaderUserInfo.formsUsersInfos.filter(n=>n.form.id===e.team.formId),[e.team]);return(0,i.jsxs)(Tl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(Yl,{icon:"sidebar"})})}),(0,i.jsx)(Dx,{placement:"top",children:n("cacher_les_info_67266")})]}),(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:n("_propos_de_l_47506")})]}),e.team.members.map(t=>(0,i.jsx)(YB,{customFields:e.customFields,formsIds:[e.team.formId],title:n("informations_de_63884",t.userInfo.nameOrEmail),userInfo:t.userInfo},t.id)),(0,i.jsx)(ZB,{eventId:s,formsUsersInfos:o,organizationId:t}),(0,i.jsx)(KB,{formsUsersInfos:o})]})},iq=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,teamCode:a}}=Kl(),[r,d]=zD("assignment.isLeftPanelOpen",!0),[l,c]=zD("assignment.isRightPanelOpen",!0),[u,m,h]=Wm(""),[p,I]=zD("teamAssignment.numberOfMembers",null),{data:x,isLoading:f}=Li("query TeamAssignmentWaitingTeams($eventId: EventId!, $name: String, $numberOfMembers: Int) {\n event(id: $eventId) {\n teams(name: $name, numberOfMembers: $numberOfMembers, state: WaitingAssignment) {\n nodes {\n teamCode\n\n members {\n ...VolunteerRegistrationWaitingAssignment\n }\n }\n\n totalCount\n }\n }\n}\n",{eventId:o,name:g(m)?m:void 0,numberOfMembers:"number"==typeof p&&p>0?p:void 0},[$o.VolunteerRegistrationWaitingAssignmentFragment]);const _=(0,V.useCallback)(()=>{const e=x.event?.teams.nodes??[],t=e.findIndex(e=>e.teamCode===a),i=e[t+1]?.teamCode??e[0].teamCode;i===a?n.goBack(yo.ASSIGNMENTS(s,o)):n.replace(yo.TEAM_ASSIGNMENT(s,o,i))},[s,o,a,x.event]),j=e.event.team,v=(0,V.useMemo)(()=>({wishedPositionsCategoriesIds:j.positionsCategoriesIds,wishedPositionsIds:j.positionsIds,wishedPositionsSlotsIds:j.positionsSlotsIds,wishedRanges:j.slots.map(({range:e})=>e)}),[j]);return Au(t("affectation_de_62702",j.teamCode)),(0,i.jsx)(TG,{isEdit:!1,positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[],showNextVolunteer:_,teams:[],children:(0,i.jsx)(NB,{buttons:(0,i.jsx)(eq,{}),header:(0,i.jsx)(nq,{team:j}),isEdit:!1,isLeftPanelOpen:r,isRightPanelOpen:l,leftPanel:(0,i.jsx)(JG,{event:x.event,isLoading:f,name:u,numberOfMembers:p,setName:h,setNumberOfMembers:I}),rightPanel:(0,i.jsx)(tq,{customFields:e.event.formsCustomsFields,team:j,onCollapse:()=>{c(!1)}}),setIsLeftPanelOpen:d,setIsRightPanelOpen:c,children:(0,i.jsx)(WG,{event:e.event,organization:e.organization,state:it.NotApplicable,userInfo:j.leaderUserInfo,...v})})})},sq=()=>{const{params:{organizationId:e,eventId:n,teamCode:t}}=Kl(),{data:s,loader:o}=Li("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:n,teamCode:t},[$o.CustomFieldWithConditionFragment,$o.FormsUsersInfosWishedFragment]);return o||(0,i.jsx)(iq,{event:s.event,organization:s.organization})},oq=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=Kl(),{event:{name:o},hasPermission:a}=BS(),{canCampaignSend:r}=oy(),d=a(sy.CAMPAIGN_SEND,{eventId:t});Au(`${o} ${s("Campaigns")}`);const l=Um(),[c,u]=(0,V.useState)(""),[m,h]=(0,V.useState)(""),p=Bm(e=>{h(e),S()}),[I,x]=(0,V.useState)(""),[f,_]=(0,V.useState)(""),[j,v]=(0,V.useState)(0),S=()=>{v(0)},[y,C]=(0,V.useState)(null),{data:b,isLoading:A,reload:E}=Li("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:t,name:g(m)?m:void 0,states:""!==I?[I]:void 0,campaignType:""!==f?f:void 0,offset:j,sort:y},[$o.CampaignListFragment]);return tF(b.event?.campaigns.nodes??[],E),(0,i.jsxs)(Ay,{children:[(0,i.jsxs)(by,{children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:s("Campaigns")}),d?(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"paper-plane",onClick:()=>{e.push(Gj.CREATE_TEMPLATE({organizationId:n,eventId:t}))},children:s("cr_er_un_mod_le_20298")}),onClick:()=>{e.push(Gj.CREATE({organizationId:n,eventId:t}))},children:s("cr_er_une_campa_96023")}):r?(0,i.jsx)(tc,{to:Gj.CREATE({organizationId:n,eventId:t}),children:s("cr_er_une_campa_96023")}):null]}),(0,i.jsxs)(yy,{children:[(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Ry,{content:b.event?.doneCampaigns.totalCount??"-",title:s("nombre_de_campa_52133")}),(0,i.jsx)(Ry,{content:b.event?.campaignsCost??"-",title:s("co_t_des_campag_08459")})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Tl,{css:{boxShadow:"$xs"},direction:"column",children:(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{value:I,onChange:e=>{x(e),S()},children:[(0,i.jsx)("option",{value:"",children:s("toutes_les_camp_81617")}),l(zt)]})}),(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(Up,{value:f,onChange:e=>{_(e),S()},children:[(0,i.jsx)("option",{value:"",children:s("sms_et_e_mail_94587")}),l(Ot)]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:s("rechercher_une_69554"),value:c,onChange:e=>{u(e),p(e)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($x,{attribute:_e.Name,setSort:C,sort:y,children:s("nom_de_la_campa_45063")}),(0,i.jsx)($x,{attribute:_e.Type,css:{flex:"0 150px"},setSort:C,sort:y,children:s("type_35427")}),(0,i.jsx)(Gm,{css:{flex:"0 200px"},children:s("nombre_de_desti_21374")}),(0,i.jsx)(Gm,{css:{flex:"0 150px"},children:s("co_t_68998")}),(0,i.jsx)($x,{attribute:_e.State,css:{flex:"0 150px"},setSort:C,sort:y,children:s("State")}),(0,i.jsx)(Gm,{css:{flex:"0 100px"}})]}),numberOfPages:b.event?.campaigns.numberOfPages??0,offset:j,rows:A?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:Yo(b.event.campaigns.nodes)?(0,i.jsx)(i.Fragment,{children:b.event.campaigns.nodes.map(e=>(0,i.jsx)(nF,{campaign:e,canCampaignSend:r,eventId:t,organizationId:n,reload:E},e.id))}):(0,i.jsx)(IE,{title:s("no_campaigns")})}),setOffset:v,title:s("liste_des_campa_60034"),totalCount:b.event?.campaigns.totalCount??0})})]})]})},aq=({organizationId:e,eventId:n,category:t,clickable:s})=>{const o=Fi();return(0,i.jsx)(km,{children:(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Tl,{gap:"3",justify:"between",children:[s?(0,i.jsx)(Xm,{to:oo.POSITION_CATEGORY({organizationId:e,eventId:n,positionCategoryId:t.id}),children:t.name}):(0,i.jsx)(Mr,{color:"gray700",children:t.name}),(0,i.jsx)(Mr,{color:"gray700",children:o("_1_2_membres_04485",t.assignedResources,t.resources)})]}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(lF,{percent:t.assignedResources/t.resources})})]})})},t.id)},rq=e=>(0,i.jsx)(Tl,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",padding:"$3 $4"},gap:"3",width:1,children:(0,i.jsxs)(ql,{to:e.path,width:1,children:[(0,i.jsx)(Tl,{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)(Yl,{icon:"check"})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",css:{textDecoration:e.isDone?"line-through":""},fontWeight:"medium",children:e.title}),(0,i.jsx)(Mr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Mr,{color:"gray900",css:{cursor:"pointer"},children:(0,i.jsx)(Yl,{icon:"arrow-right"})})]})}),dq=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Xb),{hasEventRole:a}=BS(),{canCampaignSend:r,canFormEdit:d,canPositionEdit:l}=oy(),{data:c,loader:u}=Li("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},[]),m=(0,V.useMemo)(()=>c.event?(0,Lm.A)(c.event.positionsCategories,e=>e.name.toLowerCase()):[],[c.event]),g=!(!(a&&r&&d&&l&&c.event)||c.event.onboarding.isFirstCampaignCreated&&c.event.onboarding.isFirstFormCreated&&c.event.onboarding.isFirstPositionCreated);return u||(0,i.jsxs)(Tl,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:n("tableau_de_bord_24627")}),(0,i.jsx)(Pl,{height:"7"}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(RG,{header:(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:n("vos_premiers_pa_81169")}),(0,i.jsx)(Mr,{color:"gray500",children:n("pour_bien_d_mar_03933")})]}),initialIsOpen:!0,children:(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(rq,{isDone:c.event.onboarding.isFirstPositionCreated,path:yo.CREATE_POSITION(t,s),subtitle:n("cr_er_une_nouve_43436"),title:n("cr_er_votre_pre_70209")}),(0,i.jsx)(rq,{isDone:c.event.onboarding.isFirstFormCreated,path:$s.FORMS({organizationId:t,eventId:s}),subtitle:n("cr_er_un_formul_31199"),title:n("cr_er_votre_pre_76199")}),(0,i.jsx)(rq,{isDone:c.event.onboarding.isFirstCampaignCreated,path:Gj.CREATE({organizationId:t,eventId:s}),subtitle:n("communiquer_fac_26569"),title:n("envoyer_votre_p_47899")})]})}),(0,i.jsx)(Pl,{height:"8"})]}),(0,i.jsxs)(eu,{gap:"6",gridtemplatecolumns:"1fr 1fr 350px",gridtemplaterows:"1fr 1fr",children:[(0,i.jsx)(Mr,{css:{gridColumn:"1 / 2",gridRow:"1 / 2"},children:(0,i.jsx)(YT,{button:(0,i.jsx)(tc,{to:oo.POSITIONS({organizationId:t,eventId:s}),children:n("voir_les_missio_71964")}),icon:"user-group",iconColor:"primary",text:n("nombre_de_membr_60320",c.event.resources),value:c.event.resources})}),(0,i.jsx)(Mr,{css:{gridColumn:"2 / 3",gridRow:"1 / 2"},children:(0,i.jsx)(YT,{button:(0,i.jsx)(tc,{to:oo.POSITIONS({organizationId:t,eventId:s}),children:n("voir_les_missio_71964")}),icon:"sitemap",iconColor:"purple",text:n("nombre_de_missi_67304",c.event.numberOfPositions),value:c.event.numberOfPositions})}),(0,i.jsx)(Mr,{css:{gridColumn:"1 / 2",gridRow:"2 / 3"},children:(0,i.jsx)(YT,{button:(0,i.jsx)(tc,{onClick:()=>{e.push(yo.VOLUNTEERS(t,s))},children:n("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:n("nombre_de_membr_87779",c.event.assignmentsStats.numberOfAssigned),value:c.event.assignmentsStats.numberOfAssigned})}),(0,i.jsx)(Mr,{css:{gridColumn:"2 / 3",gridRow:"2 / 3"},children:(0,i.jsx)(YT,{button:(0,i.jsx)(tc,{onClick:()=>{e.push(yo.ASSIGNMENTS(t,s))},children:n("voir_mes_affect_10965")}),icon:"wand-magic-sparkles",iconColor:"warning",text:n("nombre_de_membr_63555",c.event.assignmentsStats.numberOfWaitingAssignment),value:c.event.assignmentsStats.numberOfWaitingAssignment})}),(0,i.jsxs)(Tl,{css:{bd:!0,gridColumn:"3 / 4",gridRow:"1 / 3",padding:"$6"},direction:"column",justify:"between",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("taux_de_remplis_11913")}),(0,i.jsxs)(Mr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:[0===c.event.resources?"0":Math.round(c.event.assignedResources/c.event.resources*100),"%"]})]}),(0,i.jsx)(Mr,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("temps_de_b_n_vo_87924")}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(c.event.volunteerMinutesNeeded)})]}),(0,i.jsx)(Mr,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray500",children:n("temps_de_b_n_vo_60725")}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(c.event.volunteerMinutesAssigned)})]})]})]}),(0,i.jsx)(Pl,{height:"8"}),a&&(0,i.jsx)(Mr,{css:{boxShadow:"$xs"},children:(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Gm,{children:n("cat_gories_24533")})}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:m.length>0?m.map(e=>(0,i.jsx)(aq,{category:e,clickable:!0,eventId:s,organizationId:t},e.id)):(0,i.jsx)(IE,{subtitle:n("vous_n_avez_pas_59681"),title:n("aucune_cat_gori_21347")})}),setOffset:Bc.A,title:n("liste_des_membr_59735"),totalCount:0})})]})};var lq;let cq=class extends QM{static{lq=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...QM.IMPORT_COLUMNS_DEFAULT,Name:"name",CategoryName:"categoryName",FormId:"formId",Deadline:"deadline",MaxResources:"maxResources",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===dn.Update?[lq.IMPORT_COLUMNS_DEFAULT.Id]:[],lq.IMPORT_COLUMNS_DEFAULT.Name,lq.IMPORT_COLUMNS_DEFAULT.CategoryName,lq.IMPORT_COLUMNS_DEFAULT.FormId];default(e){const n=super.default(e);return n.input={...n.input},n}constructor(e,n){super(e,n),this.csvInputService=e}};cq=lq=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[ZM,Di])],cq);const uq=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{mutate:s}=function(e={}){return Ui("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}=AS(),a=(0,V.useCallback)((e,n,t)=>o(e,n,t),[o,n]),{data:r,loader:d}=jd({organizationId:e,variety:Te.Delegation});return d||(0,i.jsx)(qM,{alertDescriptionKey:"to_add_a_team_51299",children:(0,i.jsx)(yP,{ImportInputService:cq,checkImport:a,closePath:Js.DELEGATIONS({organizationId:e,eventId:n}),customFields:r.organization.customFields.nodes,heading:t("import_de_d_l_g_69356"),importTagPrefix:"delegations",localStorageKeyPrefix:"DELEGATIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(Xm,{to:Js.DELEGATIONS({organizationId:e,eventId:n}),children:t("revenir_aux_d_l_15915")})})})},mq=e=>{const{translate:n,params:{eventId:t}}=Kl(),{canDelegationEdit:s,canMemberAccredit:o}=oy(),[a,r]=(0,V.useState)(e.delegationAccreditationSlot),d=(0,V.useMemo)(()=>Gu(e.accreditationSlot.accreditation.color),[e.accreditationSlot]),l=(0,V.useMemo)(()=>({background:d[50],border:`1px solid ${d[500]}`,color:d[700]}),[d]),c=(0,V.useCallback)(async()=>{const{event:{delegation:n}}=await Pa({eventId:t,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlot.id},await X());r(n.accreditationSlot)},[e.accreditationSlot,e.delegationId,r]),u=s&&o,[m,g]=(0,V.useState)(!1),h=a.maxResources?`/${a.maxResources}`:"",p=`${a.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{...l,borderRadius:"$1",cursor:u?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,width:1,onClick:()=>{u&&g(!0)},children:[(0,i.jsx)(M$,{background:d[100],count:p,icon:"badge-check",text:n("attribu_es_48167")}),(0,i.jsx)(M$,{background:d[100],count:a.wishedResources,icon:"hand-holding-heart",text:n("souhait_es_78101")}),(0,i.jsx)(M$,{background:d[100],count:a.scannedResources,icon:"scanner-gun",text:n("scann_es_13169")})]}),u&&m&&(0,i.jsx)(q$,{accreditationSlotId:e.accreditationSlot.id,delegationId:e.delegationId,eventId:t,onClose:()=>(g(!1),c())})]})},gq=e=>{const n=(0,V.useMemo)(()=>(e.delegation.allAccreditationsSlots||[]).find(n=>n.accreditationSlotId===e.accreditationSlot.id),[e.delegation,e.accreditationSlot]);return n?(0,i.jsx)(mq,{accreditationSlot:e.accreditationSlot,delegationAccreditationSlot:n,delegationId:e.delegation.id}):null},hq=e=>{const{translate:n}=Kl(),{mutate:t}=fa(),s=(0,V.useCallback)(n=>n.accreditationProfileId===e.accreditationProfileId,[e.accreditationProfileId]),o=(0,V.useCallback)(async n=>{const{event:t}=await(i={eventId:e.eventId,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfileId,userInfoId:n},o=await X(),oa("query DelegationAccreditationProfileMember(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n }\n }\n\n member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...VolunteerRegistrationDelegationAccreditationProfile\n }\n }\n}\n",{variables:i,token:o||void 0,fragments:[$o.DelegationAccreditationProfileStatsFragment,$o.VolunteerRegistrationDelegationAccreditationProfileFragment]}));var i,o;const a=t.member.wishedAccreditationProfileId===e.accreditationProfileId;return{member:s(t.member)||a?t.member:null,stats:t.delegation.accreditationProfile}},[e.accreditationProfileId,e.delegationId,e.eventId,s]),a=(0,V.useCallback)((n,i)=>t({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:e.accreditationProfileId,selecteds:{ids:[n]},strategy:i}}),[t,e.accreditationProfileId,e.eventId]),r=(0,V.useCallback)(e=>a(e,hn.Add),[a]),d=(0,V.useCallback)(e=>a(e,hn.Delete),[a]);return(0,i.jsx)(B$,{add:r,assignedText:n("d_j_attribu_33932"),delete:d,deleteText:n("retirer_le_prof_47260"),isAssigned:s,members:e.volunteersRegistrations,name:e.name,reloadMember:o,stats:e.stats})},pq=e=>{const{data:n,loader:t}=Li("query DelegationAccreditationProfileMembers(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n\n accreditationProfile {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationProfile\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfileId},[$o.DelegationAccreditationProfileStatsFragment,$o.VolunteerRegistrationDelegationAccreditationProfileFragment]);return(0,i.jsx)(gp,{size:"md",onClose:e.onClose,children:t||(0,i.jsx)(hq,{accreditationProfileId:e.accreditationProfileId,delegationId:e.delegationId,eventId:e.eventId,name:n.event.delegation.accreditationProfile.accreditationProfile.name,stats:n.event.delegation.accreditationProfile,volunteersRegistrations:n.event.delegation.accreditationProfile.volunteersRegistrations})})},Iq=e=>{const{translate:n,params:{eventId:t}}=Kl(),{canDelegationEdit:s,canMemberAccredit:o}=oy(),[a,r]=(0,V.useState)(e.delegationAccreditationProfile),d=(0,V.useMemo)(()=>Gu(e.accreditationProfile.color),[e.accreditationProfile]),l=(0,V.useMemo)(()=>({background:d[50],border:`1px solid ${d[500]}`,color:d[700]}),[d]),c=(0,V.useCallback)(async()=>{const{event:{delegation:n}}=await(i={eventId:t,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfile.id},s=await X(),oa("query DelegationAccreditationProfileStats(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n }\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[$o.DelegationAccreditationProfileStatsFragment]}));var i,s;r(n.accreditationProfile)},[e.accreditationProfile,e.delegationId,r]),u=s&&o,[m,g]=(0,V.useState)(!1),h=a.maxResources?`/${a.maxResources}`:"",p=`${a.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{...l,borderRadius:"$1",cursor:u?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,justify:"center",width:1,onClick:()=>{u&&g(!0)},children:[(0,i.jsx)(M$,{background:d[100],count:p,icon:"badge-check",text:n("attribu_es_48167")}),(0,i.jsx)(M$,{background:d[100],count:a.wishedResources,icon:"hand-holding-heart",text:n("souhait_es_78101")})]}),u&&m&&(0,i.jsx)(pq,{accreditationProfileId:e.accreditationProfile.id,delegationId:e.delegationId,eventId:t,onClose:()=>(g(!1),c())})]})},xq=e=>{const n=(0,V.useMemo)(()=>(e.delegation.accreditationsProfiles||[]).find(n=>n.accreditationProfileId===e.accreditationProfile.id),[e.delegation,e.accreditationProfile]);return n?(0,i.jsx)(Iq,{accreditationProfile:e.accreditationProfile,delegationAccreditationProfile:n,delegationId:e.delegation.id}):null},fq=e=>(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightXl"},children:[e.accreditationsProfiles.map(n=>(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(xq,{accreditationProfile:n,delegation:e.delegation})},n.id)),e.accreditationsSlots.map(n=>(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(gq,{accreditationSlot:n,delegation:e.delegation})},n.id))]}),_q=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),s=(0,V.useMemo)(()=>o$(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,V.useMemo)(()=>a$(e.allAccreditationsSlots),[e.allAccreditationsSlots]),a=(0,V.useMemo)(()=>e.showAccreditations?d$(o,e.selectedSlotsIds):[],[o,e.selectedSlotsIds,e.showAccreditations]),r=(0,V.useMemo)(()=>l$(a,e.selectedSlotsIds,e.matrixRendering),[a,e.matrixRendering,e.selectedSlotsIds]),d=(0,V.useMemo)(()=>(0,Lm.A)(e.allAccreditationsProfiles.filter(n=>e.showProfiles&&(Zo(e.selectedProfilesIds)||e.selectedProfilesIds.includes(n.id))),e=>[u(e.accreditationProfileCategory.name),u(e.name)]),[e.allAccreditationsProfiles,e.selectedProfilesIds,e.showProfiles]),l=(0,V.useMemo)(()=>r.map(e=>e.id),[r]),c=(0,V.useCallback)(e=>(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightXl",px:"$4"},width:1,children:(0,i.jsx)(Xm,{to:Js.DELEGATION({organizationId:n,eventId:t,delegationId:e.id}),children:e.name})},e.id),[n,t]),m=(0,V.useCallback)(e=>(0,i.jsx)(fq,{accreditationsProfiles:d,accreditationsSlots:r,delegation:e},e.id),[r,l]);return(0,i.jsx)(Tl,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(Ql,{}):(0,i.jsx)(c$,{accreditationsProfiles:d,allAccreditations:o,allAccreditationsProfiles:e.allAccreditationsProfiles,allCategories:s,cellWidth:200,data:e.delegations,filteredAccreditations:a,hideQuotaOption:!0,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:c,renderRow:m,rendering:e.matrixRendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setRendering:e.setMatrixRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:Bc.A,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:!1,slots:r,totalCount:e.totalCount})})},jq=()=>{const{params:{eventId:e}}=Kl(),{infos:n,setInfos:t}=ok(),{data:s,isLoading:o,limit:a,numberOfPages:r,offset:d,setLimit:l,setOffset:c,totalCount:u}=pg(),{data:m,isLoading:g}=Li("query DelegationsAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfiles(usedInDelegations: true) {\n nodes {\n ...AccreditationProfileMatrix\n }\n }\n\n accreditationsSlots(includeHidden: true, usedInDelegations: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:e},[$o.AccreditationProfileMatrixFragment,$o.AccreditationSlotMatrixFragment]),h=(0,V.useMemo)(()=>n.delegationsMatrixSelectedSlotsIds||[],[n]),p=(0,V.useCallback)(e=>t(n=>({...n,delegationsMatrixSelectedSlotsIds:e})),[n,t]),I=(0,V.useMemo)(()=>n.delegationsMatrixSelectedProfilesIds||[],[n]),x=(0,V.useCallback)(e=>t(n=>({...n,delegationsMatrixSelectedProfilesIds:e})),[n,t]),f=(0,V.useMemo)(()=>n.delegationsMatrixShowAccreditations??!0,[n]),_=(0,V.useCallback)(e=>t(n=>({...n,delegationsMatrixShowAccreditations:e})),[t]),j=(0,V.useMemo)(()=>n.delegationsMatrixShowProfiles??!0,[n]),v=(0,V.useCallback)(e=>t(n=>({...n,delegationsMatrixShowProfiles:e})),[t]),S=(0,V.useMemo)(()=>n.volunteersMatrixRendering||mh.Category,[n]),y=(0,V.useCallback)(e=>t(n=>({...n,volunteersMatrixRendering:e})),[n,t]);return(0,i.jsx)(_q,{allAccreditationsProfiles:m.event?.accreditationsProfiles.nodes??qo,allAccreditationsSlots:m.event?.accreditationsSlots.nodes??qo,delegations:s,isLoading:o||g,limit:a,matrixRendering:S,numberOfPages:r,offset:d,selectedProfilesIds:I,selectedSlotsIds:h,setLimit:l,setMatrixRendering:y,setOffset:c,setSelectedProfilesIds:x,setSelectedSlotsIds:p,setShowAccreditations:_,setShowProfiles:v,showAccreditations:f,showProfiles:j,totalCount:u})},vq=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:a}=Kl(),{mutate:r,isLoading:d}=hl(),[l,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)([]),[g,h]=(0,V.useState)(!0),p=!l||Yo(u);return(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"user-group",subtitle:a("ajoutez_une_d_l_54234"),children:a("cr_ation_d_une_07120")}),(0,i.jsxs)(hx,{children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:a("que_souhaitez_v_87607")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Gz,{state:l?"unchecked":"checked",onClick:()=>c(!1),children:a("cr_er_une_nouve_45377")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Gz,{state:l?"checked":"unchecked",onClick:()=>c(!0),children:a("cr_er_une_d_l_g_37657")}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:a("_quelle_d_l_ga_55758"),multiple:!1,renderOnPortal:!0,values:u,onChange:m,children:e.parentDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(np,{value:g,onChange:h,children:a("je_souhaite_app_69393")})]})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:!p,isLoading:d,onClick:async()=>{let i;if(l&&Yo(u)){const n=u[0],t=e.parentDelegations.find(e=>e.id===n);Yo(t.leadersIds)&&await r({eventId:s,usersInfosIds:t.leadersIds,sendVolunteerRegistrationEmail:!1}),i=o(JSON.stringify({parentId:n,applyParentSettings:g}))}n.push(yo.CREATE_DELEGATION(t,s,i))},children:a("suivant_62774")})})]})},Sq=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=Kl(),{columns:o}=pg(),{segment:a}=ok(),{data:r}=Li(nd,{organizationId:n},[]),{mutate:d}=function(e={}){return Ui("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)}(),[l,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1),g=Yo(r.organization?.delegations.nodes),{checkExport:h}=AS();return(0,i.jsxs)(kk,{children:[(0,i.jsx)(ly,{permissions:sy.DELEGATION_EDIT,children:g?(0,i.jsxs)(xx,{children:[(0,i.jsx)(fx,{children:(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"file-import",to:yo.EVENT_DELEGATIONS_IMPORT(n,t),onClick:e=>Tu(e.target),children:s("importer_des_d_05454")}),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsx)(vq,{parentDelegations:r.organization.delegations.nodes})]}):(0,i.jsx)(Fz,{menu:(0,i.jsx)(Pu,{icon:"file-import",to:yo.EVENT_DELEGATIONS_IMPORT(n,t),onClick:e=>Tu(e.target),children:s("importer_des_d_05454")}),path:yo.CREATE_DELEGATION(n,t),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(ly,{permissions:sy.DELEGATION_EDIT,children:(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"plus",onClick:()=>{c(!0)},children:s("cr_er_une_cat_g_20051")})})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"file-xls",onClick:e=>{Tu(e.target),m(!0)},children:s("exporter_en_exc_51862")})})]})]}),(0,i.jsx)(jN,{isOpen:u,requestExport:async e=>{const{jobId:i}=await d({organizationId:n,eventId:t,segmentId:a.id,format:e,columns:o});h(i,n,t)},showIncludeFiles:!1,onClose:()=>{m(!1)}}),l&&(0,i.jsx)(Ob,{eventId:t,organizationId:n,onClose:()=>c(!1),onSuccess:i=>{e.push(Js.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:i.id}))}})]})},yq=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{canDelegationEdit:o,canSegmentEdit:a}=oy(),{limit:r,rendering:d}=pg(),{segment:l}=ok(),c=a&&d===hh.List,u=o&&d===hh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sq,{}),0===e.numberOfDelegations?(0,i.jsx)(yy,{css:{overflow:"hidden"},children:(0,i.jsx)(Mr,{css:{overflow:"hidden"},width:1,children:(0,i.jsx)(UE,{title:n("vous_n_avez_pas_58215")})})}):(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:(0,i.jsx)($F,{}),searchPlaceholder:n("rechercher_une_31213"),showActions:o,showEditColumns:c,showEditMode:u,showSearchColumns:a}),selectSegment:(0,i.jsx)(ap,{allSelectedText:n("les_1_d_l_gat_04594",l.count,l.name),pageSelectedText:n("les_1_d_l_gat_27248",r),selectAllText:n("s_lectionner_le_71777",l.count,l.name)})}),d===hh.AccreditationsMatrix?(0,i.jsx)(jq,{}):(0,i.jsx)(cN,{customFields:e.customFields,eventId:s,organizationId:t})]})]})},Cq={level:xn.Event},bq=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=Kl(),{hasPermission:r,localEvent:d,updateLocalEvent:l}=BS(),{canDelegationEdit:c}=oy(),u=ki(Sh),m=(0,V.useMemo)(()=>u.getDelegationsFilters(e.event.organizationId,o,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.event,e.organization,o]),g=(0,V.useMemo)(()=>u.getDelegationsPossibleColumns(o,e.organization.customFields.nodes),[o,e.organization]);return(0,i.jsx)(gF,{eventId:o,getEditPath:e=>ss(Js.DELEGATION({organizationId:s,eventId:o,delegationId:e})),getShowPath:e=>Js.DELEGATION({organizationId:s,eventId:o,delegationId:e}),organizationId:s,children:(0,i.jsx)(yk,{canSegmentEdit:r(sy.SEGMENT_EDIT),columnsToIncludes:vh,eventId:o,filters:m,filtersButtonText:t("filtrer_les_d_l_04628"),filtersSubtitle:t("appliquer_des_f_65318"),getSegmentPath:e=>yo.DELEGATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfDelegations,initialLimit:d?.delegationsLimit??Tm,initialSegmentsOpen:d?.areDelegationsSegmentsOpen??!0,loadDataList:zd,loadDataListParams:Cq,loadRow:Od,organizationId:s,possibleColumns:g,possibleRenderings:[hh.List,hh.AccreditationsMatrix],reload:e.reload,segmentId:a,segmentType:Bn.Delegations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{l({delegationsLimit:e})},showMassActions:c,showRowDropdown:c,showRowEdit:c,onSegmentClick:e=>{l({delegationsSegmentId:e})},onSegmentDelete:async()=>{await l({delegationsSegmentId:null}),n.replace(Js.DELEGATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await l({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(yq,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.event.numberOfDelegations})})})},Aq=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{event:{name:s},localEvent:o}=BS();Au(`${s} ${t("d_l_gations_78318")}`);const{data:a,loader:r,reload:d}=Li("query DelegationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: Delegation) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n organizationId\n numberOfDelegations\n\n segmentsFolders(segmentType: Delegations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:n},[$o.SegmentCustomFieldFragment,$o.SegmentsFoldersSegmentsFragment]),l=(0,V.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.DELEGATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(bq,{event:a.event,organization:a.organization,reload:d})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.DELEGATIONS_SEGMENT(e,n,o?.delegationsSegmentId&&l.includes(o.delegationsSegmentId)?o.delegationsSegmentId:l[0]),replace:!0})})]})},Eq=()=>{const{hasFeature:e}=XS();return e(Ze.Delegation)?(0,i.jsx)(Aq,{}):(0,i.jsx)(Tl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Vj,{icon:"people-group"})})};let wq=class extends Rc{constructor(e){super(e)}delegationsSpaceLayoutTabInputDefault(){return{name:this.t("tab_sans_nom_50048"),description:"",slug:"",canDelete:!0,isVisible:!0,isPinned:!1,segmentType:Bn.Volunteers,rendering:xh.List,infos:{matrixShowAccreditations:!0,matrixShowProfiles:!0}}}defaultDashboardTab(){return{name:this.t("tableau_de_bord_24627"),description:"",slug:ns.DASHBOARD,canDelete:!1,isVisible:!0,isPinned:!0,segmentType:Bn.Volunteers,rendering:xh.List,infos:{}}}defaultDocumentsTab(){return{name:this.t("Documents"),description:"",slug:ns.DOCUMENTS,canDelete:!1,isVisible:!0,isPinned:!1,segmentType:Bn.Volunteers,rendering:xh.List,infos:{}}}tabInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_est_requ_61536")),description:zc.Yj(),slug:zc.Yj().required(this.t("l_url_est_requi_99475")).test("is-valid-slug",this.t("le_slug_ne_doit_10047"),e=>m(e)===e),canDelete:zc.zM().required(),isVisible:zc.zM().required(),isPinned:zc.zM().required(),segmentType:zc.Yj().oneOf([Bn.Accreditations,Bn.Volunteers],this.t("le_type_de_vue_62720")).required(this.t("le_type_de_vue_62720")),rendering:zc.Yj().required(this.t("le_type_de_visu_51393"))})}};wq=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],wq);let $q=class extends Rc{tabInput;constructor(e,n){super(e),this.tabInput=n}delegationSpaceLayoutInputDefault(e){return{name:e?.name??"",tabs:e?.tabs??[this.tabInput.defaultDashboardTab(),this.tabInput.defaultDocumentsTab()]}}delegationSpaceLayoutInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_du_layou_34851")),tabs:zc.YO().of(this.tabInput.tabInputSchema())})}createUpdateDelegationSpaceLayout(){return zc.Ik().shape({delegationsSpaceLayout:this.delegationSpaceLayoutInputSchema()})}};$q=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di,wq])],$q);const Tq=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!0),{slug:o,canDelete:a,isVisible:r,isPinned:d,segmentType:l,rendering:c}=e.delegationsSpaceLayoutTab,u=(0,V.useMemo)(()=>l===Bn.Volunteers?[xh.AccreditationsMatrix,xh.List]:[gh.Table,gh.WeeklyCalendar],[l]),g=(0,V.useMemo)(()=>e.customFields.filter(e=>e.fieldType===Qe.Select&&!e.canSelectMultiple).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id)),[e.customFields]),h=(0,V.useCallback)(n=>{jc(n),e.form.change(`${e.prefix}isVisible`,!r)},[r,e.form,e.prefix]),p=(0,V.useMemo)(()=>t&&r,[t,r]),I=a,x=a,f=a&&l===Bn.Volunteers&&c===xh.List,_=a&&l===Bn.Volunteers&&c===xh.AccreditationsMatrix,j=_,v=_,S=v&&Yo(e.accreditationsProfilesOptions),y=a&&(!v||!1!==e.delegationsSpaceLayoutTab.infos?.matrixShowAccreditations),C=S&&!1!==e.delegationsSpaceLayoutTab.infos?.matrixShowProfiles,b=a&&l===Bn.Accreditations&&c===gh.Table&&Yo(e.delegationsSpaceLayoutTab.infos?.accreditationsSlotsIds),A=o===ns.DOCUMENTS;return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",padding:"$3 $4"},gap:"2",onClick:()=>s(!p),children:[(0,i.jsx)(Tl,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(Yl,{icon:p?"chevron-down":"chevron-right"})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textSm semiBold",children:e.delegationsSpaceLayoutTab.name}),(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",disabled:e.isDownDisabled,leftIcon:"chevron-down",size:"sm",onClick:n=>{jc(n),e.moveDown(e.index)}})}),(0,i.jsx)(Dx,{placement:"top",children:n("d_placer_vers_l_52432")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",disabled:e.isUpDisabled,leftIcon:"chevron-up",size:"sm",onClick:n=>{jc(n),e.moveUp(e.index)}})}),(0,i.jsx)(Dx,{placement:"top",children:n("d_placer_vers_l_49863")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",leftIcon:d?"thumbtack":"thumbtack-slash",size:"sm",onClick:n=>{jc(n),e.onPin(e.index)}})}),(0,i.jsx)(Dx,{placement:"top",children:n("arriver_sur_ce_15500")})]}),a?(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onDelete})}),(0,i.jsx)(Dx,{placement:"top",children:n("supprimer_le_ta_78990")})]}):(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",leftIcon:r?"eye":"eye-slash",size:"sm",onClick:h})}),(0,i.jsx)(Dx,{placement:"top",children:n(r?"cacher_le_tab_97084":"afficher_le_tab_00199")})]})]})]}),p&&(0,i.jsx)(Tl,{css:{background:"$gray50",borderTop:"1px solid $gray200",padding:"$6"},direction:"column",children:(0,i.jsxs)(Tl,{css:{background:"white",bd:"gray200 2 xs",padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Zr.Yr,{name:`${e.prefix}name`,children:n=>{e.delegationsSpaceLayoutTab.canDelete&&!1===e.form.getFieldState(`${e.prefix}slug`).touched&&e.form.change(`${e.prefix}slug`,m(n))}}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)($c,{label:n("nom_du_tab_91688"),name:`${e.prefix}name`}),(0,i.jsx)($c,{disabled:!a,label:n("url_72719"),name:`${e.prefix}slug`})]}),I&&(0,i.jsxs)(ny,{label:n("type_de_vue_13048"),name:`${e.prefix}segmentType`,children:[(0,i.jsx)("option",{value:Bn.Volunteers,children:n("membres_11310")}),(0,i.jsx)("option",{value:Bn.Accreditations,children:n("accr_ditations_39450")})]}),x&&(0,i.jsx)(of,{label:n("type_de_visuali_85493"),name:`${e.prefix}rendering`,children:u.map(e=>(0,i.jsx)("option",{value:e,children:_h(n,e)},e))}),f&&(0,i.jsx)($b,{change:e.form.change,columns:e.delegationsSpaceLayoutTab.infos?.columns??qo,customFields:e.customFields,prefix:`${e.prefix}infos.`}),v&&(0,i.jsx)(df,{name:`${e.prefix}infos.matrixShowAccreditations`,children:n("afficher_les_ac_56952")}),y&&(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:(0,i.jsx)(Uv,{children:n("filtrer_pour_ce_14760")}),multiple:!0,name:`${e.prefix}infos.accreditationsSlotsIds`,children:e.accreditationsSlotsOptions}),S&&(0,i.jsx)(df,{name:`${e.prefix}infos.matrixShowProfiles`,children:n("afficher_les_pr_66300")}),C&&(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:(0,i.jsx)(Uv,{children:n("profils_d_accr_27825")}),multiple:!0,name:`${e.prefix}infos.accreditationsProfilesIds`,children:e.accreditationsProfilesOptions}),_&&(0,i.jsxs)(ny,{label:(0,i.jsx)(Uv,{children:n("grouper_les_acc_40252")}),name:`${e.prefix}infos.matrixRendering`,children:[(0,i.jsx)("option",{value:mh.Category,children:n("cat_gorie_00291")}),(0,i.jsx)("option",{value:mh.Date,children:n("Date")})]}),j&&(0,i.jsx)(df,{name:`${e.prefix}infos.matrixShowQuota`,children:n("afficher_les_qu_20761")}),b&&(0,i.jsx)(of,{isSearchVisible:!0,label:n("champ_personnal_96124"),name:`${e.prefix}infos.customFieldSlug`,children:g}),A&&(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("liste_des_docum_18767"),multiple:!0,name:`${e.prefix}infos.customDocumentsSlugs`,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})]})})]})},zq=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(wq),a=(0,V.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.delegationsSpaceLayout.name):n("cr_ation_d_un_l_62705"),[e.initialValues,e.isEdit]),r=(0,V.useCallback)(n=>{e.form.change("delegationsSpaceLayout.tabs",Qo(e.delegationsSpaceLayout.tabs,n,n+1))},[e.delegationsSpaceLayout,e.form]),d=(0,V.useCallback)(n=>{e.form.change("delegationsSpaceLayout.tabs",Qo(e.delegationsSpaceLayout.tabs,n,n-1))},[e.delegationsSpaceLayout,e.form]),l=(0,V.useCallback)(n=>{e.form.change("delegationsSpaceLayout.tabs",e.delegationsSpaceLayout.tabs.map((e,t)=>({...e,isPinned:t===n})))},[e.delegationsSpaceLayout.tabs,e.form]);return Au(a),(0,i.jsx)(Hx,{button:e.isEdit?(0,i.jsx)(tc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n("mettre_jour_l_99541")}):null,category:a,color:"dark",fallbackClosePath:xT.DELEGATIONS_SPACE_LAYOUTS({organizationId:t,eventId:s}),heading:e.isEdit?e.initialValues.delegationsSpaceLayout.name:n("nouveau_layout_19257"),children:(0,i.jsxs)(Gx,{ref:e.centeredContainerRef,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{heading:n("informations_su_00505"),children:(0,i.jsx)(Tl,{direction:"column",gap:"6",width:1,children:(0,i.jsx)($c,{label:n("nom_du_layout_81794"),name:"delegationsSpaceLayout.name"})})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:n("DelegationsSpaceLayout"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[e.delegationsSpaceLayout.tabs.map((n,t)=>(0,i.jsx)(Tq,{accreditationsProfilesOptions:e.accreditationsProfilesOptions,accreditationsSlotsOptions:e.accreditationsSlotsOptions,customDocuments:e.customDocuments,customFields:e.customFields,delegationsSpaceLayoutTab:n,form:e.form,index:t,isDownDisabled:t===e.delegationsSpaceLayout.tabs.length-1,isUpDisabled:0===t,moveDown:r,moveUp:d,prefix:`delegationsSpaceLayout.tabs[${t}].`,onDelete:()=>(n=>{e.form.change("delegationsSpaceLayout.tabs",Jo(e.delegationsSpaceLayout.tabs,n))})(t),onPin:l},t)),(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.form.change("delegationsSpaceLayout.tabs",[...e.delegationsSpaceLayout.tabs,o.delegationsSpaceLayoutTabInputDefault()])},children:n("ajouter_un_tab_01565")})]})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:e.submitting,textAlign:"center",onClick:e.handleSubmit,children:e.isEdit?n("mettre_jour_l_99541"):n("cr_er_le_layout_39460")})})]})})},Oq=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{showNotification:a}=AS(),r=ki(Jm),d=ki(Ol),l=ki($q),c=(0,V.useRef)(null),u=(0,V.useMemo)(()=>Bh(r,e.accreditationsCategories),[e.accreditationsCategories]),m=(0,V.useMemo)(()=>r$(e.accreditationsProfiles),[e.accreditationsProfiles]);return(0,i.jsx)(xc,{customErrorRef:c,height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(zq,{accreditationsProfilesOptions:m,accreditationsSlotsOptions:u,centeredContainerRef:c,customDocuments:e.customDocuments,customFields:e.customFields,delegationsSpaceLayout:o.delegationsSpaceLayout,form:n,handleSubmit:t,initialValues:e.initialValues,isEdit:e.isEdit,submitting:s}),validate:d.validateForForm(l.createUpdateDelegationSpaceLayout()),width:1,onSubmit:async i=>{await e.mutate({eventId:o,delegationsSpaceLayout:i.delegationsSpaceLayout}),a(t("le_layout_a_t_59662")),n.goBack(xT.DELEGATIONS_SPACE_LAYOUTS({organizationId:s,eventId:o}))}})},Rq=()=>{const{params:{organizationId:e,eventId:n}}=Kl(),t=ki($q),{data:s,loader:o}=Li("query DelegationsSpaceLayoutEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: Public) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n date\n name\n }\n }\n }\n\n customDocuments {\n slug\n name\n }\n }\n}\n",{organizationId:e,eventId:n},[$o.SegmentCustomFieldFragment]),{mutate:a}=function(e={}){return Ui("mutation DelegationsSpaceLayoutCreate(\n $eventId: EventId!\n $delegationsSpaceLayout : DelegationsSpaceLayoutInput!\n)\n{\n delegationsSpaceLayoutCreate(eventId: $eventId, delegationsSpaceLayout: $delegationsSpaceLayout) {\n id\n }\n}\n",e)}(),r=(0,V.useMemo)(()=>s.event?{delegationsSpaceLayout:t.delegationSpaceLayoutInputDefault()}:{},[s]);return o||(0,i.jsx)(Oq,{accreditationsCategories:s.event.accreditationsCategories,accreditationsProfiles:s.event.accreditationsProfiles.nodes,customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,initialValues:r,isEdit:!1,mutate:a})},Dq=()=>{const{params:{organizationId:e,eventId:n,delegationsSpaceLayoutId:t}}=Kl(),s=ki($q),{data:o,loader:a}=Li("query DelegationsSpaceLayoutToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: Public) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n date\n name\n }\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n delegationsSpaceLayout(id: $delegationsSpaceLayoutId) {\n name\n\n tabs {\n name\n description\n slug\n canDelete\n isVisible\n isPinned\n segmentType\n rendering\n infos\n }\n }\n }\n}\n",{organizationId:e,eventId:n,delegationsSpaceLayoutId:t},[$o.SegmentCustomFieldFragment]),{mutate:r}=function(e={}){return Ui("mutation DelegationsSpaceLayoutUpdate(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n $delegationsSpaceLayout: DelegationsSpaceLayoutInput!\n) {\n delegationsSpaceLayoutUpdate(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n delegationsSpaceLayout: $delegationsSpaceLayout\n ) {\n id\n }\n}\n",e)}(),d=(0,V.useMemo)(()=>o.event?{delegationsSpaceLayout:s.delegationSpaceLayoutInputDefault(o.event.delegationsSpaceLayout)}:{},[o]);return a||(0,i.jsx)(Oq,{accreditationsCategories:o.event.accreditationsCategories,accreditationsProfiles:o.event.accreditationsProfiles.nodes,customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,initialValues:d,isEdit:!0,mutate:async e=>r({...e,delegationsSpaceLayoutId:t})})};let Mq=class extends Rc{constructor(e){super(e)}customDocumentInputDefault(e){return{name:e?.name??"",slug:e?.slug??"",populationsIds:e?.populationsIds??[],configuration:e?.configuration??this.getConfigurationDefault(),shouldRegenerateTicketIdOnDownload:e?.shouldRegenerateTicketIdOnDownload??!1}}customDocumentInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_est_requ_61536")),slug:zc.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:pf,pages:[this.getPageDefault()],width:If}}getPageDefault(){return{id:W(),accreditationsSlotsIds:[],accreditationAcronym:"",conditionsCustomFields:[],elements:[],hasConditions:!1,positionsSlotsIds:[],segmentsIds:[]}}getContainerElementDefault(e,n,t){return{type:"container",id:e,inContainer:!!n,inGrid:"grid"===n?.type,backgroundColor:"",accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],direction:"row",elements:[],gap:0,hasBackground:!1,hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,justify:"start",left:0,name:this.t("conteneur_1_03989",t+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,segmentsIds:[],top:0,width:100,zIndex:1}}getGridElementDefault(e,n,t){return{type:"grid",id:e,inContainer:!!n,inGrid:"grid"===n?.type,backgroundColor:"",accreditationsSlotsIds:[],accreditationAcronym:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,columnGap:0,columns:2,conditionsCustomFields:[],elements:[],hasBackground:!1,hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,left:0,name:this.t("grille_1_66496",t+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,rowGap:0,rows:2,segmentsIds:[],top:0,width:100,zIndex:1}}getImageElementDefault(e,n,t){return{type:"image",id:e,inContainer:!!n,inGrid:"grid"===n?.type,accreditationsSlotsIds:[],accreditationAcronym:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,left:0,name:this.t("image_1_30956",t+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,segmentsIds:[],top:0,width:100,zIndex:1}}getTextElementDefault(e,n,t){return{type:"text",id:e,inContainer:!!n,inGrid:"grid"===n?.type,accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",hasBackground:!1,backgroundColor:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:20,isRatioLocked:!1,left:0,name:this.t("texte_1_59540",t+1),text:"",color:"#1d2939",fontFamily:"Open Sans",fontSize:14,fontWeight:400,justify:"start",lineHeight:1.4,positionsSlotsIds:[],px:0,py:0,rotateDegree:0,segmentsIds:[],textTransform:"none",top:0,width:100,zIndex:1}}};Mq=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],Mq);const Pq={Code39:"{user.code39}",Picture:"{user.picture}",QrCode:"{user.qrcode}",Skidata:"{user.skidata}"};function kq(e){return Object.values(Pq).includes(e)}function Fq(e){return`{user.${e}}`}function Nq(e){return kq(e)&&e!==Pq.Picture?null:e?.match(/^\{user\.([^{}\s]+)\}$/)?.[1]??null}function Lq(e){return"container"===e.type||"grid"===e.type}function Uq(e){const n=e=>e.flatMap(e=>Lq(e)?[e].concat(n(e.elements)):[e]);return e.configuration.pages.flatMap(e=>n(e.elements))}function Vq(e,n){const t=(e,i,s)=>{for(const o of i){if(o.id===n)return{ancestors:s,element:o,page:e};if(Lq(o)){const n=t(e,o.elements,[...s,o]);if(n)return n}}return null};for(const n of e.pages){const e=t(n,n.elements,[]);if(e)return e}return null}const Bq=(e,n)=>e<=1?e*n:e;function Wq(e,n,t){let i=n,s=t,o=n,a=t,r=null;for(const n of[...e.ancestors,e.element])"grid"===r?.type?(o=(i-r.columnGap*(r.columns-1))/r.columns,a=(s-r.rowGap*(r.rows-1))/r.rows):(o=Bq(n.width,i),a=Bq(n.height,s)),Lq(n)&&(i=o-2*((n.px||0)+n.borderSize),s=a-2*((n.py||0)+n.borderSize),r=n);return{height:Math.max(Math.round(a),2),width:Math.max(Math.round(o),2)}}function Gq(e,n,t){return e.toSpliced(Math.min(Math.max(n,0),e.length),0,t)}function qq(e,n){return e.filter(e=>e.id!==n).map(e=>Lq(e)?{...e,elements:qq(e.elements,n)}:e)}function Hq(e,n,t,i){return e.map(e=>Lq(e)?e.id===n?{...e,elements:Gq(e.elements,t,i)}:{...e,elements:Hq(e.elements,n,t,i)}:e)}function Yq(e,n,t){const i=Vq(e,n),s=e.pages.find(e=>e.id===t.pageId),o=t.parentId?Vq(e,t.parentId):null,a=o?.element??null;if(!i||!s||t.parentId&&(!a||!Lq(a)||o.page.id!==t.pageId||a.id===n||o.ancestors.some(e=>e.id===n)))return e;let r={...i.element,inContainer:!!a,inGrid:"grid"===a?.type};return!a&&i.ancestors.length>0&&(r={...r,...Wq(i,e.width,e.height),left:i.ancestors[0].left,top:i.ancestors[0].top}),{...e,pages:e.pages.map(e=>{if(e.id!==i.page.id&&e.id!==t.pageId)return e;let s=e.id===i.page.id?qq(e.elements,n):e.elements;return e.id===t.pageId&&(s=a?Hq(s,a.id,t.index,r):Gq(s,t.index,r)),{...e,elements:s}})}}function Zq(e,n,t){const i={...e,id:n,name:t};if(Lq(i)){const e=i.elements.map(e=>Zq(e,W(),e.name));return{...i,elements:e}}return i}function Kq(e,n){return e===pf&&n===If?"a4":e===xf&&n===ff?"a6":e===_f&&n===jf?"cb":"custom"}function Xq(e){return e.hasConditions&&(Yo(e.accreditationsSlotsIds)||g(e.accreditationAcronym)||Yo(e.positionsSlotsIds)||Yo(e.segmentsIds)||Yo(e.conditionsCustomFields))}function Qq(e,n,t,i,s,o){if(e.hasConditions){if(Yo(e.accreditationsSlotsIds))return Yo((0,mm.A)(e.accreditationsSlotsIds,n));if(g(e.accreditationAcronym)){const n=e.accreditationAcronym.split(",").map(e=>e.trim()).filter(g);return Yo((0,mm.A)(n,t))}return Yo(e.positionsSlotsIds)?Yo((0,mm.A)(e.positionsSlotsIds,i)):Yo(e.segmentsIds)?Yo((0,mm.A)(e.segmentsIds,s)):!Yo(e.conditionsCustomFields)||e.conditionsCustomFields.every(({slug:e,value:n})=>"isEmpty"===n?h(o[e]?.rawValue):"isNotEmpty"===n?g(o[e]?.rawValue):"boolean"==typeof n?o[e]?.rawValue===n:!!Array.isArray(n)&&Yo((0,mm.A)(Ho(o[e]?.rawValue),n)))}return!0}const Jq=(0,V.createContext)({}),eH=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Jm),o=ki(Bg),a=ki(Mq),[r,l]=(0,V.useState)(e.initialCustomDocument),[c,u]=(0,V.useState)(null),[h,p]=(0,V.useState)(null),[I,x]=(0,V.useState)("parameters"),[f,_]=(0,V.useState)(100),[j,v]=(0,V.useState)(null),[S,y]=(0,V.useState)(null),C=(0,V.useCallback)(e=>{l((0,dp.jM)(n=>{n.name=e}))},[r,l]),b=(0,V.useCallback)((e,n)=>{l((0,dp.jM)(t=>{t.configuration.pages.forEach(t=>{t.id===h&&(t[e]=n)})}))},[h,l]),A=(0,V.useCallback)(e=>{l((0,dp.jM)(n=>{n.populationsIds=e}))},[l]),E=(0,V.useCallback)(e=>{l((0,dp.jM)(n=>{n.slug=m(e,{replacer:d.Empty})}))},[l]),w=(0,V.useCallback)(e=>{l((0,dp.jM)(n=>{n.configuration.bleed=e}))},[r,l]),$=(0,V.useCallback)((e,n)=>{l((0,dp.jM)(t=>{t.configuration.height=e,t.configuration.width=n}))},[r,l]),T=(0,V.useCallback)(e=>{l((0,dp.jM)(n=>{n.shouldRegenerateTicketIdOnDownload=e}))},[r,l]),z=(0,V.useCallback)(()=>{u(null),p(null)},[u,p]),O=(0,V.useCallback)(()=>Uq(r).find(e=>e.id===c)||null,[r,c]),R=(0,V.useCallback)(()=>r.configuration.pages.find(e=>e.id===h)||null,[r,h]),D=(0,V.useCallback)(()=>{l((0,dp.jM)(e=>{e.configuration.pages.push(a.getPageDefault())}))},[l]),M=(0,V.useCallback)(e=>{l((0,dp.jM)(n=>{n.configuration.pages=n.configuration.pages.filter(n=>n.id!==e)}))},[l]),P=(0,V.useCallback)((e,n)=>{const t=W();l((0,dp.jM)(i=>{e?Uq(i).forEach(i=>{Lq(i)&&i.id===e.id&&i.elements.push(a[n](t,i,i.elements.length))}):i.configuration.pages.forEach(e=>{e.id===h&&e.elements.push(a[n](t,null,e.elements.length))})})),u(t)},[h,l,u]),k=(0,V.useCallback)(e=>{P(e,"getContainerElementDefault")},[P]),F=(0,V.useCallback)(e=>{P(e,"getGridElementDefault")},[P]),N=(0,V.useCallback)(e=>{P(e,"getImageElementDefault")},[P]),L=(0,V.useCallback)(e=>{P(e,"getTextElementDefault")},[P]),U=(0,V.useCallback)(e=>{l((0,dp.jM)(n=>{n.configuration.pages.forEach(n=>{n.elements=n.elements.filter(n=>n.id!==e)}),Uq(n).forEach(n=>{Lq(n)&&(n.elements=n.elements.filter(n=>n.id!==e))})})),u(null)},[r,l,u]),B=(0,V.useCallback)(e=>{const t=W();l((0,dp.jM)(i=>{Uq(i).forEach(i=>{if(Lq(i)){const s=i.elements.find(n=>n.id===e);s&&i.elements.push(Zq(s,t,n("copie_de_1_62900",s.name)))}}),i.configuration.pages.forEach(i=>{const s=i.elements.find(n=>n.id===e);s&&i.elements.push(Zq(s,t,n("copie_de_1_62900",s.name)))})})),u(t)},[r,l,u]),G=(0,V.useCallback)(e=>{const t=W();l((0,dp.jM)(i=>{const s=i.configuration.pages.find(n=>n.id===e);s&&i.configuration.pages.push(function(e,n,t){return{...e,id:n,name:t,elements:e.elements.map(e=>Zq(e,W(),e.name))}}(s,t,g(s.name)?n("copie_de_1_62900",s.name):""))}))},[]),q=(0,V.useCallback)((e,n)=>{u(e),p(n)},[r,u,p]),H=(0,V.useCallback)(e=>{p(e),u(null),x("design")},[u,p,x]),Y=(0,V.useCallback)((e,n,t)=>{l((0,dp.jM)(i=>{const s=Uq(i).find(n=>n.id===e);s&&(s[n]=t)}))},[r]),Z=(0,V.useCallback)((e,n,t)=>{l((0,dp.jM)(i=>{const s=Uq(i).find(n=>n.id===e);s&&(s.left+=n,s.top+=t)}))},[l]),K=(0,V.useCallback)((e,n)=>{l(t=>({...t,configuration:Yq(t.configuration,e,n)}))},[l]),X=(0,V.useCallback)((e,n)=>{l((0,dp.jM)(t=>{const i=Uq(t).find(n=>n.id===e);i&&Object.assign(i,n)}))},[l]),{data:Q}=Li("query CustomDocumentConditions($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{eventId:t},[]),J=(0,V.useMemo)(()=>Bh(s,Q.event?.accreditationsCategories??[]),[Q.event]),ee=(0,V.useMemo)(()=>Wh(o,Q.event?.positionsCategories??[]),[Q.event]),ne=(0,V.useMemo)(()=>(Q.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)),[Q.event]);return(0,i.jsx)(Jq.Provider,{value:{accreditationsOptions:J,addContainerElement:k,addGridElement:F,addImageElement:N,addPage:D,addTextElement:L,cleanSelecteds:z,customDocument:r,customFields:e.customFields,deleteElement:U,duplicateElement:B,duplicatePage:G,getSelectedElement:O,getSelectedPage:R,movingElementId:S,moveElement:K,offsetElementPosition:Z,population:e.population,positionsOptions:ee,removePage:M,segmentsOptions:ne,selectElement:q,selectPage:H,selectedElementId:c,selectedPageId:h,setBleed:w,setDimensions:$,setElementBox:X,setMovingElementId:y,setName:C,setPopulations:A,setShouldRegenerateTicketIdOnDownload:T,setSlug:E,setSnapGuides:v,setTab:x,setZoom:_,snapGuides:j,tab:I,updateElementProperty:Y,updatePageProperty:b,zoom:f},children:e.children})};function nH(){return(0,V.useContext)(Jq)}const tH=e=>{const{translate:n}=Kl(),{addContainerElement:t,addGridElement:s,addImageElement:o,addTextElement:a}=nH();return(0,i.jsxs)(Tl,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{a(e.container)},children:[(0,i.jsx)(Tl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Yl,{icon:"text"})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textSm medium",children:n("Text")}),(0,i.jsx)(tc,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{o(e.container)},children:[(0,i.jsx)(Tl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Yl,{icon:"image"})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textSm medium",children:n("image_40624")}),(0,i.jsx)(tc,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{t(e.container)},children:[(0,i.jsx)(Tl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Yl,{icon:"chart-simple"})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textSm medium",children:n("conteneur_33078")}),(0,i.jsx)(tc,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{s(e.container)},children:[(0,i.jsx)(Tl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(Yl,{icon:"table-cells"})}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textSm medium",children:n("grille_01987")}),(0,i.jsx)(tc,{color:"white",leftIcon:"plus",size:"sm"})]})]})},iH=e=>{const{translate:n}=Kl(),{accreditationsOptions:t,customFields:s,positionsOptions:o,segmentsOptions:a}=nH(),r=(0,V.useMemo)(()=>s.filter(e=>e.fieldType===Qe.Checkbox||e.fieldType===Qe.Select||e.fieldType===Qe.Text||e.fieldType===Qe.Validation).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[s]),d=e.element.conditionsCustomFields||[],l=d.map(e=>e.slug),c=(n,t)=>{const i=(0,dp.jM)(d,e=>{e[t].value=n});e.updateProperty(e.elementId,"conditionsCustomFields",i)},u=s.filter(e=>l.includes(e.slug));return(0,i.jsx)(WB,{css:{padding:"$4 $6"},title:n("condition_d_aff_68185"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(np,{value:e.element.hasConditions,onChange:n=>{n||(e.updateProperty(e.elementId,"accreditationsSlotsIds",[]),e.updateProperty(e.elementId,"accreditationAcronym",""),e.updateProperty(e.elementId,"positionsSlotsIds",[]),e.updateProperty(e.elementId,"segmentsIds",[]),e.updateProperty(e.elementId,"conditionsCustomFields",[])),e.updateProperty(e.elementId,"hasConditions",n)},children:n("afficher_en_fon_47208")}),e.element.hasConditions&&(0,i.jsxs)(Tl,{css:{background:"$gray100",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$3 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:n("afficher_en_fon_89756"),multiple:!0,values:e.element.accreditationsSlotsIds||qo,onChange:n=>{e.updateProperty(e.elementId,"accreditationsSlotsIds",n)},children:t}),(0,i.jsx)(wc,{label:n("afficher_en_fon_78748"),value:e.element.accreditationAcronym||"",onChange:n=>{e.updateProperty(e.elementId,"accreditationAcronym",n)}}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("afficher_en_fon_19925"),multiple:!0,values:e.element.positionsSlotsIds||qo,onChange:n=>{e.updateProperty(e.elementId,"positionsSlotsIds",n)},children:o}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("afficher_si_le_05366"),multiple:!0,values:e.element.segmentsIds||qo,onChange:n=>{e.updateProperty(e.elementId,"segmentsIds",n)},children:a}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("afficher_en_fon_56078"),multiple:!0,values:l,onChange:n=>{const t=(0,em.A)(n,l),i=s.filter(e=>t.includes(e.slug)),o=(0,em.A)(l,n),a=d.filter(e=>!o.includes(e.slug)).concat(i.map(e=>({slug:e.slug,value:e.fieldType===Qe.Checkbox||e.fieldType===Qe.Validation||(e.fieldType===Qe.Text?"isNotEmpty":[])})));e.updateProperty(e.elementId,"conditionsCustomFields",a)},children:r}),u.map((e,t)=>e.fieldType===Qe.Checkbox||e.fieldType===Qe.Validation?(0,i.jsxs)(Up,{label:n("afficher_si_la_42654",e.name),shouldParseAsBoolean:!0,value:d[t].value,onChange:e=>{c(e,t)},children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]},e.id):e.fieldType===Qe.Text?(0,i.jsxs)(Up,{label:n("afficher_si_la_42654",e.name),value:d[t].value,onChange:e=>{c(e,t)},children:[(0,i.jsx)("option",{value:"isEmpty",children:n("est_vide_96759")}),(0,i.jsx)("option",{value:"isNotEmpty",children:n("n_est_pas_vide_45804")})]},e.id):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("afficher_si_la_42654",e.name),multiple:!0,values:d[t].value||qo,onChange:e=>{c(e,t)},children:e.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))},e.id))]})]})})},sH=e=>{const{translate:n}=Kl(),{updateElementProperty:t}=nH();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(WB,{css:{padding:"$4 $6"},title:n("apparence_75510"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[!e.element.inGrid&&(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wc,{label:n("largeur_54184"),rightText:e.element.width<=1?"%":"px",shouldParseAsInt:!0,value:e.element.width,onChange:n=>{e.element.isRatioLocked&&t(e.element.id,"height",Math.round(e.element.height*n/e.element.width)),t(e.element.id,"width",n)}}),(0,i.jsx)(wc,{label:n("hauteur_56576"),rightText:e.element.height<=1?"%":"px",shouldParseAsInt:!0,value:e.element.height,onChange:n=>{e.element.isRatioLocked&&t(e.element.id,"width",Math.round(e.element.width*n/e.element.height)),t(e.element.id,"height",n)}}),(0,i.jsx)(Mr,{css:{alignSelf:"end"},width:40,children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:e.element.isRatioLocked?"primary":"white",leftIcon:e.element.isRatioLocked?"lock-keyhole":"lock-keyhole-open",onClick:()=>{t(e.element.id,"isRatioLocked",!e.element.isRatioLocked)}})}),(0,i.jsx)(Dx,{placement:"top",children:e.element.isRatioLocked?n("ne_pas_pr_serve_68003"):n("pr_server_le_ra_39750")})]})})]}),!e.element.inContainer&&(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wc,{label:"X",rightText:"px",shouldParseAsInt:!0,value:e.element.left,onChange:n=>{t(e.element.id,"left",n)}}),(0,i.jsx)(wc,{label:"Y",rightText:"px",shouldParseAsInt:!0,value:e.element.top,onChange:n=>{t(e.element.id,"top",n)}})]}),!e.element.inContainer&&(0,i.jsx)(wc,{hint:n("la_position_z_d_29473"),label:n("position_z_du_c_46647"),shouldParseAsInt:!0,value:e.element.zIndex,onChange:n=>{t(e.element.id,"zIndex",n)}}),("image"===e.element.type||"text"===e.element.type)&&!e.element.inContainer&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(np,{value:e.element.hasRotate,onChange:n=>{t(e.element.id,"hasRotate",n)},children:n("faire_pivoter_06431")}),e.element.hasRotate&&(0,i.jsx)(wc,{label:n("degr_79492"),rightText:"deg",shouldParseAsInt:!0,value:e.element.rotateDegree,onChange:n=>{t(e.element.id,"rotateDegree",n)}})]}),("container"===e.element.type||"grid"===e.element.type||"text"===e.element.type)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(np,{value:e.element.hasBackground,onChange:n=>{t(e.element.id,"hasBackground",n)},children:n("afficher_un_arr_96006")}),e.element.hasBackground&&(0,i.jsx)(RC,{label:n("couleur_de_fond_75677"),value:e.element.backgroundColor,onChange:n=>{t(e.element.id,"backgroundColor",n)}})]}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wc,{label:n("taille_de_la_bo_84060"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderSize,onChange:n=>{t(e.element.id,"borderSize",n)}}),(0,i.jsx)(RC,{label:n("couleur_de_la_b_84227"),value:e.element.borderColor,onChange:n=>{t(e.element.id,"borderColor",n)}})]}),(0,i.jsx)(wc,{label:n("rayon_de_la_bor_26070"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderRadius,onChange:n=>{t(e.element.id,"borderRadius",n)}}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wc,{label:n("padding_horizon_14268"),rightText:"px",shouldParseAsInt:!0,value:e.element.px,onChange:n=>{t(e.element.id,"px",n)}}),(0,i.jsx)(wc,{label:n("padding_vertica_78457"),rightText:"px",shouldParseAsInt:!0,value:e.element.py,onChange:n=>{t(e.element.id,"py",n)}})]})]})}),(0,i.jsx)(iH,{element:e.element,elementId:e.element.id,updateProperty:t})]})},oH=e=>{const{translate:n}=Kl(),{getSelectedPage:t,selectPage:s,updateElementProperty:o}=nH();return(0,i.jsxs)(Tl,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Tl,{css:{padding:"$2 $6"},children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(t().id)},children:n("retour_92202")})}),(0,i.jsxs)(WB,{css:{padding:"$4 $6"},title:n("initialisation_38640"),children:[(0,i.jsx)(wc,{label:n("nom_08311"),value:e.container.name,onChange:n=>{o(e.container.id,"name",n)}}),(0,i.jsx)(tH,{container:e.container})]}),(0,i.jsxs)(WB,{css:{padding:"$4 $6"},title:n("conteneur_33078"),children:[(0,i.jsxs)(Up,{label:n("direction_39738"),value:e.container.direction,onChange:n=>{o(e.container.id,"direction",n)},children:[(0,i.jsx)("option",{value:"column",children:n("de_haut_en_bas_72752")}),(0,i.jsx)("option",{value:"row",children:n("de_gauche_dro_21330")})]}),(0,i.jsx)(wc,{label:n("_cart_entre_les_62547"),rightText:"px",shouldParseAsInt:!0,value:e.container.gap,onChange:n=>{o(e.container.id,"gap",n)}}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("alignement_54247")}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsxs)(Tl,{children:[(0,i.jsx)(tc,{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)(tc,{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)(tc,{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)(Tl,{children:[(0,i.jsx)(tc,{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)(tc,{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)(tc,{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)(sH,{element:e.container})]})},aH=()=>{const{translate:e}=Kl(),{getSelectedPage:n,updatePageProperty:t}=nH(),s=n();return(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsxs)(WB,{css:{padding:"$4 $6"},title:e("initialisation_38640"),children:[(0,i.jsx)(wc,{label:e("nom_de_la_page_82146"),value:s.name||"",onChange:e=>{t("name",e)}}),(0,i.jsx)(tH,{container:null})]}),(0,i.jsx)(iH,{element:s,elementId:s.id,updateProperty:(e,n,i)=>{t(n,i)}})]})},rH=()=>{const{translate:e}=Kl(),{getSelectedPage:n}=nH();return n()?(0,i.jsx)(aH,{}):(0,i.jsx)(Tl,{css:{px:"$4"},height:1,width:1,children:(0,i.jsxs)(Tl,{align:"center",css:{bd:!0,px:"$9"},direction:"column",gap:"4",height:1,justify:"center",width:1,children:[(0,i.jsx)(Tl,{css:{border:"1px solid $gray200",borderRadius:"10px",padding:"$3"},children:(0,i.jsx)(Yl,{icon:"hand-pointer"})}),(0,i.jsx)(Mr,{font:"gray800 textMd medium",textAlign:"center",children:e("pour_ajouter_de_11528")})]})})},dH=e=>{const{translate:n}=Kl(),{getSelectedPage:t,selectPage:s,updateElementProperty:o}=nH();return(0,i.jsxs)(Tl,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Tl,{css:{padding:"$2 $6"},children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(t().id)},children:n("retour_92202")})}),(0,i.jsxs)(WB,{css:{padding:"$4 $6"},title:n("initialisation_38640"),children:[(0,i.jsx)(wc,{label:n("nom_08311"),value:e.grid.name,onChange:n=>{o(e.grid.id,"name",n)}}),(0,i.jsx)(tH,{container:e.grid})]}),(0,i.jsxs)(WB,{css:{padding:"$4 $6"},title:n("grille_01987"),children:[(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wc,{label:n("colonnes_73889"),shouldParseAsInt:!0,value:e.grid.columns,onChange:n=>{o(e.grid.id,"columns",Math.max(1,n))}}),(0,i.jsx)(wc,{label:n("lignes_66458"),shouldParseAsInt:!0,value:e.grid.rows,onChange:n=>{o(e.grid.id,"rows",Math.max(1,n))}})]}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wc,{label:n("_cart_entre_les_90779"),rightText:"px",shouldParseAsInt:!0,value:e.grid.columnGap,onChange:n=>{o(e.grid.id,"columnGap",n)}}),(0,i.jsx)(wc,{label:n("_cart_entre_les_05132"),rightText:"px",shouldParseAsInt:!0,value:e.grid.rowGap,onChange:n=>{o(e.grid.id,"rowGap",n)}})]})]}),(0,i.jsx)(sH,{element:e.grid})]})},lH=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{hasFeature:s}=XS(),{customFields:o,getSelectedPage:a,selectPage:r,updateElementProperty:d}=nH(),l=(0,V.useMemo)(()=>o.filter(e=>e.fieldType===Qe.File&&e.fileType===en.Picture&&Fq(e.slug)!==Pq.Picture),[o]),c=Nq(e.image.source),u=kq(e.image.source)||l.some(e=>e.slug===c)?e.image.source:"custom";return(0,i.jsxs)(Tl,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Tl,{css:{padding:"$2 $6"},children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{r(a().id)},children:n("retour_92202")})}),(0,i.jsxs)(WB,{css:{padding:"$4 $6"},title:n("initialisation_38640"),children:[(0,i.jsx)(wc,{label:n("nom_08311"),value:e.image.name,onChange:n=>{d(e.image.id,"name",n)}}),(0,i.jsxs)(Up,{label:n("source_16397"),value:u,onChange:n=>{d(e.image.id,"source","custom"===n?"":n)},children:[(0,i.jsx)("option",{value:Pq.Picture,children:n("photo_de_profil_08618")}),l.map(e=>(0,i.jsx)("option",{value:Fq(e.slug),children:e.name},e.slug)),(0,i.jsx)("option",{value:Pq.QrCode,children:n("qr_code_du_bill_78196")}),(0,i.jsx)("option",{value:Pq.Code39,children:n("code_barres_du_74438")}),(s(Ze.Skidata)||u===Pq.Skidata)&&(0,i.jsx)("option",{value:Pq.Skidata,children:n("qr_code_skidata_53182")}),(0,i.jsx)("option",{value:"custom",children:n("fichier_ou_lien_26488")})]}),"custom"===u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lv,{accept:gv.SmallImages,acl:"public-read",label:n("File"),organizationId:t,value:null,onChange:n=>{if(n){const t=`https://${F.HEAVENT_AWS_UPLOADS_BUCKET}.s3.eu-west-1.amazonaws.com/${n.key}`;d(e.image.id,"source",t)}}}),(0,i.jsx)(wc,{label:n("lien_de_l_image_40053"),placeholder:"https://",value:e.image.source||"",onChange:n=>{d(e.image.id,"source",n)}})]}),(0,i.jsx)(wc,{label:n("lien_68557"),value:e.image.link||"",onChange:n=>{d(e.image.id,"link",n)}})]}),(0,i.jsx)(sH,{element:e.image})]})},cH=()=>{const{translate:e}=Kl(),{customDocument:n,population:t,setBleed:s,setDimensions:o,setName:a,setPopulations:r,setShouldRegenerateTicketIdOnDownload:d,setSlug:l}=nH(),c=n.configuration.height,u=n.configuration.width,m=Kq(c,u),g=(0,V.useMemo)(()=>(0,Lm.A)(t.values,e=>e.value.toLowerCase()),[t]);return(0,i.jsxs)(Tl,{css:{px:"$4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(wc,{label:e("nom_du_document_73868"),value:n.name,onChange:a}),(0,i.jsxs)(Up,{label:e("format_du_docum_28991"),value:m,onChange:e=>{"a4"===e?o(pf,If):"a6"===e?o(xf,ff):"cb"===e?o(_f,jf):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"===m&&(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wc,{hint:`${Lr(n.configuration.width)}mm`,label:e("largeur_54184"),rightText:"px",shouldParseAsInt:!0,value:n.configuration.width,onChange:e=>{o(c,e)}}),(0,i.jsx)(wc,{hint:`${Lr(n.configuration.height)}mm`,label:e("hauteur_56576"),rightText:"px",shouldParseAsInt:!0,value:n.configuration.height,onChange:e=>{o(e,u)}})]}),n.configuration.bleed&&(0,i.jsx)(om,{state:n.configuration.bleed?"checked":"unchecked",onClick:e=>{s("checked"===e)},children:e("ajouter_des_fon_73494")}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(wc,{hint:e("ne_doit_conteni_53122"),label:e("nom_de_la_varia_81999"),value:n.slug,onChange:l}),(0,i.jsx)(_m,{isSearchVisible:!0,label:e("lier_ce_documen_79055"),multiple:!0,values:n.populationsIds,onChange:r,children:g.map(e=>(0,i.jsx)("option",{value:e.id,children:e.value},e.id))}),(0,i.jsx)(om,{state:n.shouldRegenerateTicketIdOnDownload?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:e("r_g_n_rer_le_co_99491")})]})},uH=(0,Lm.A)(["Arial","Georgia"].concat(["Anton","Archivo","Arimo","Asap","Barlow","Be Vietnam Pro","Bebas Neue","Big Shoulders","Bricolage Grotesque","Bungee","Chivo","Cossette Texte","Cossette Titre","Fira Sans","Fraunces","Google Sans Flex","IBM Plex Sans","Inter","Jost","Kumbh Sans","Lato","League Gothic","Lexend Deca","Merriweather","Montserrat","Noto Sans","Nunito","Open Sans","Oswald","Oxanium","PT Sans","Playfair Display","Plus Jakarta Sans","Poppins","Prompt","Raleway","Righteous","Roboto","Rubik","Saira","Ubuntu","Unbounded"]));function mH(){return(0,V.useMemo)(()=>uH.map(e=>(0,i.jsx)("option",{value:e,children:e},e)),[])}const gH=e=>{const{translate:n}=Kl(),{getSelectedPage:t,selectPage:s,updateElementProperty:o}=nH(),a=mH(),r=oS(["user","userRegistration","userDelegation","userDocuments","event","organization","delegation","assignments","accreditations"],{delegationsCustomFields:!1,eventsCustomFields:!1}),d=(0,V.useMemo)(()=>Object.entries((0,fm.A)(r,({group:e})=>e)).map(([e,n])=>(0,i.jsx)("optgroup",{label:n[0].groupLabel,children:n.map(({key:e,label:n})=>(0,i.jsx)("option",{"data-subtext":`{${e}}`,value:`{${e}}`,children:n},e))},e)),[r]),l=(0,V.useRef)(null),c=e.text.lineHeight||1.4,u=(0,QS.A)(e.text.fontSize*c,2);return(0,i.jsxs)(Tl,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Tl,{css:{padding:"$2 $6"},children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(t().id)},children:n("retour_92202")})}),(0,i.jsx)(WB,{css:{padding:"$4 $6"},title:n("initialisation_38640"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(wc,{label:n("nom_du_calque_77484"),value:e.text.name,onChange:n=>{o(e.text.id,"name",n)}}),(0,i.jsx)(af,{label:n("contenu_29668"),value:e.text.text,onChange:n=>{o(e.text.id,"text",n)},onSelect:n=>{l.current={elementId:e.text.id,start:n.currentTarget.selectionStart,end:n.currentTarget.selectionEnd}}}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("ajouter_une_var_79098"),values:qo,onChange:n=>{if(Yo(n)){const t=e.text.text,i=n[0];if(l.current?.elementId===e.text.id){const{start:n,end:s}=l.current;o(e.text.id,"text",t.slice(0,n)+i+t.slice(s)),l.current={elementId:e.text.id,start:n+i.length,end:n+i.length}}else o(e.text.id,"text",`${t} ${i}`.trim())}},children:d})]})}),(0,i.jsx)(WB,{css:{padding:"$4 $6"},title:n("typographie_11343"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:"Police",values:[e.text.fontFamily],onChange:n=>{o(e.text.id,"fontFamily",n[0]||"Open Sans")},children:a}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wc,{label:n("taille_de_la_po_58427"),shouldParseAsInt:!0,value:e.text.fontSize,onChange:n=>{o(e.text.id,"fontSize",n)}}),(0,i.jsx)(Jx,{hint:n("soit_1_px_73099",u),label:n("hauteur_de_lign_08120"),value:c,onChange:n=>{o(e.text.id,"lineHeight",n)}})]}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(RC,{label:n("couleur_du_text_32021"),value:e.text.color,onChange:n=>{o(e.text.id,"color",n)}}),(0,i.jsxs)(Up,{label:n("graisse_de_la_p_41139"),shouldParseAsInt:!0,value:e.text.fontWeight,onChange:n=>{o(e.text.id,"fontWeight",n)},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)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("alignement_54247")}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsxs)(Tl,{children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"start"===e.text.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{o(e.text.id,"justify","start")}})}),(0,i.jsx)(Dx,{placement:"top",children:n("aligner_gauch_04681")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"center"===e.text.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{o(e.text.id,"justify","center")}})}),(0,i.jsx)(Dx,{placement:"top",children:n("centrer_39779")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"end"===e.text.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{o(e.text.id,"justify","end")}})}),(0,i.jsx)(Dx,{placement:"top",children:n("aligner_droit_73883")})]})]}),(0,i.jsxs)(Tl,{children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"start"===e.text.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{o(e.text.id,"align","start")}})}),(0,i.jsx)(Dx,{placement:"top",children:n("aligner_en_haut_69916")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"center"===e.text.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{o(e.text.id,"align","center")}})}),(0,i.jsx)(Dx,{placement:"top",children:n("centrer_39779")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"end"===e.text.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{o(e.text.id,"align","end")}})}),(0,i.jsx)(Dx,{placement:"top",children:n("aligner_en_bas_42956")})]})]})]})]}),(0,i.jsxs)(Up,{label:n("transformation_09363"),value:e.text.textTransform,onChange:n=>{o(e.text.id,"textTransform",n)},children:[(0,i.jsx)("option",{value:"none",children:n("aucune_76773")}),(0,i.jsx)("option",{value:"capitalize",children:n("capitaliser_76627")}),(0,i.jsx)("option",{value:"uppercase",children:n("majuscules_64521")}),(0,i.jsx)("option",{value:"lowercase",children:n("minuscules_02420")})]})]})}),(0,i.jsx)(sH,{element:e.text})]})},hH=()=>{const{translate:e}=Kl(),{getSelectedElement:n,tab:t,setTab:s}=nH(),o=n();return"container"===o?.type?(0,i.jsx)(oH,{container:o}):"grid"===o?.type?(0,i.jsx)(dH,{grid:o}):"image"===o?.type?(0,i.jsx)(lH,{image:o}):"text"===o?.type?(0,i.jsx)(gH,{text:o}):(0,i.jsxs)(Tl,{css:{boxShadow:"$sm",overflow:"hidden auto",py:"$6",paddingBottom:"$11"},direction:"column",gap:"6",height:1,width:1,children:[(0,i.jsx)(Tl,{css:{px:"$4"},children:(0,i.jsxs)(Gv,{selectedItem:t,onChange:s,children:[(0,i.jsx)(qv,{item:"parameters",children:e("param_tres_78420")}),(0,i.jsx)(qv,{item:"design",children:e("design_15043")})]})}),"parameters"===t&&(0,i.jsx)(cH,{}),"design"===t&&(0,i.jsx)(rH,{})]})},pH=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{borderTop:"1px solid black",height:"1px",left:"0",position:"absolute",top:"19px",width:"11px"}}),(0,i.jsx)(Mr,{css:{borderRight:"1px solid black",height:"11px",left:"19px",position:"absolute",top:"0",width:"1px"}}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid black",height:"1px",position:"absolute",right:"0",top:"19px",width:"11px"}}),(0,i.jsx)(Mr,{css:{borderRight:"1px solid black",height:"11px",position:"absolute",right:"19px",top:"0",width:"1px"}}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",left:"0",position:"absolute",width:"11px"}}),(0,i.jsx)(Mr,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",left:"19px",position:"absolute",width:"1px"}}),(0,i.jsx)(Mr,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",position:"absolute",right:"0",width:"11px"}}),(0,i.jsx)(Mr,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",position:"absolute",right:"19px",width:"1px"}})]}),IH={x:null,y:null},xH=(e,n)=>e<=1?e*n:e;function fH(e,n,t){return{height:xH(e.height,t),left:e.left,top:e.top,width:xH(e.width,n)}}function _H(e,n,t,i){const s=[{height:i,left:0,top:0,width:t}].concat(e.filter(e=>e.id!==n&&!e.hasRotate).map(e=>fH(e,t,i)));return{x:s.flatMap(e=>[e.left,e.left+e.width/2,e.left+e.width]),y:s.flatMap(e=>[e.top,e.top+e.height/2,e.top+e.height])}}function jH(e,n){let t=IH;return i=>{i.x===t.x&&i.y===t.y||(t=i,n(null===i.x&&null===i.y?null:{...i,pageId:e}))}}function vH(e,n,t){let i=null;return n.forEach(n=>{Math.abs(n-e)<=t&&(null===i||Math.abs(n-e){const n=vH(e,t,i);null!==n&&(null===s.guide||Math.abs(n-e){const r=e.clientX-i,d=e.clientY-s;a||!o&&Math.hypot(r,d){m(),o&&(a||t.onEnd(),function(){const e=e=>{e.stopPropagation()};window.addEventListener("click",e,{capture:!0,once:!0}),setTimeout(()=>{window.removeEventListener("click",e,{capture:!0})},0)}())},l=()=>{o&&!a&&(a=!0,t.onCancel())},c=e=>{"Escape"===e.key&&l()},u=()=>{l(),d()},m=()=>{window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",u),document.removeEventListener("keydown",c)};return window.addEventListener("pointermove",r),window.addEventListener("pointerup",d),window.addEventListener("pointercancel",u),document.addEventListener("keydown",c),m}function CH(e,n){const{customDocument:t,offsetElementPosition:i,selectElement:s,setMovingElementId:o,setSnapGuides:a,zoom:r}=nH(),[d,l]=(0,V.useState)(null),c=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{c.current?.()},[]);const u=(0,V.useCallback)(d=>{if(e.inContainer||0!==d.button)return;const u=r/100,{height:m,pages:g,width:h}=t.configuration,p=g.find(e=>e.id===n)?.elements??[],I=fH(e,h,m),x=_H(p,e.id,h,m),f=jH(n,a);let _={left:0,top:0},j=!1;const v=()=>{j&&(j=!1,f(IH),o(null))};c.current?.();const S=yH(d,3,{onStart:()=>{j=!0,s(e.id,n),o(e.id)},onMove:(n,t,i)=>{let s=e.left+n/u,o=e.top+t/u;if(i.altKey||e.hasRotate)f(IH);else{const e=function(e,n,t){const i=SH(e.left,e.width,n.x,t),s=SH(e.top,e.height,n.y,t);return{guides:{x:i.guide,y:s.guide},left:e.left+i.delta,top:e.top+s.delta}}({...I,left:s,top:o},x,5/u);s=e.left,o=e.top,f(e.guides)}_={left:Math.round(s)-e.left,top:Math.round(o)-e.top},l(_)},onEnd:()=>{i(e.id,_.left,_.top),l(null),v()},onCancel:()=>{l(null),v()}});c.current=()=>{S(),v()}},[t,e,i,n,s,o,a,r]);return{cursor:e.inContainer?void 0:d?"grabbing":"move",left:e.left+(d?.left??0),onPointerDown:u,top:e.top+(d?.top??0)}}const bH=e=>{const{selectedElementId:n,selectElement:t}=nH(),s=CH(e.container,e.pageId);return(0,i.jsx)(Tl,{align:e.container.align,css:{backgroundColor:e.container.hasBackground?e.container.backgroundColor:"none",border:e.container.borderSize>0?`${e.container.borderSize}px solid ${e.container.borderColor}`:"",borderRadius:e.container.borderRadius>0?`${e.container.borderRadius}px`:"0",cursor:s.cursor,gap:`${e.container.gap}px`,left:`${s.left}px`,outline:n===e.container.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.container.py||0}px`,paddingLeft:`${e.container.px||0}px`,paddingRight:`${e.container.px||0}px`,paddingTop:`${e.container.py||0}px`,position:e.container.inContainer?"static":"absolute",top:`${s.top}px`,touchAction:e.container.inContainer?void 0:"none",zIndex:e.container.zIndex},direction:e.container.direction,height:e.container.inGrid?1:e.container.height,justify:e.container.justify,width:e.container.inGrid?1:e.container.width,wrap:"wrap",onClick:n=>{jc(n),t(e.container.id,e.pageId)},onPointerDown:s.onPointerDown,children:e.container.elements.map(n=>(0,i.jsx)($H,{element:n,pageId:e.pageId},n.id))})},AH=e=>{const{selectedElementId:n,selectElement:t}=nH(),s=CH(e.grid,e.pageId);return(0,i.jsx)(Mr,{css:{backgroundColor:e.grid.hasBackground?e.grid.backgroundColor:"none",border:e.grid.borderSize>0?`${e.grid.borderSize}px solid ${e.grid.borderColor}`:"",borderRadius:e.grid.borderRadius>0?`${e.grid.borderRadius}px`:"0",columnGap:`${e.grid.columnGap}px`,cursor:s.cursor,display:"grid",gridTemplateColumns:`repeat(${e.grid.columns}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${e.grid.rows}, minmax(0, 1fr))`,left:`${s.left}px`,outline:n===e.grid.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.grid.py||0}px`,paddingLeft:`${e.grid.px||0}px`,paddingRight:`${e.grid.px||0}px`,paddingTop:`${e.grid.py||0}px`,position:e.grid.inContainer?"static":"absolute",rowGap:`${e.grid.rowGap}px`,top:`${s.top}px`,touchAction:e.grid.inContainer?void 0:"none",zIndex:e.grid.zIndex},height:e.grid.inGrid?1:e.grid.height,width:e.grid.inGrid?1:e.grid.width,onClick:n=>{jc(n),t(e.grid.id,e.pageId)},onPointerDown:s.onPointerDown,children:e.grid.elements.map(n=>(0,i.jsx)($H,{element:n,pageId:e.pageId},n.id))})},EH=e=>{const{selectedElementId:n,selectElement:t}=nH(),s=CH(e.image,e.pageId);return(0,i.jsx)(Mr,{css:{border:e.image.borderSize>0?`${e.image.borderSize}px solid ${e.image.borderColor}`:"",borderRadius:e.image.borderRadius>0?`${e.image.borderRadius}px`:"0",cursor:s.cursor,left:`${s.left}px`,outline:n===e.image.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.image.py||0}px`,paddingLeft:`${e.image.px||0}px`,paddingRight:`${e.image.px||0}px`,paddingTop:`${e.image.py||0}px`,position:e.image.inContainer?"static":"absolute",top:`${s.top}px`,touchAction:e.image.inContainer?void 0:"none",transform:e.image.hasRotate?`rotate(${e.image.rotateDegree}deg)`:void 0,transformOrigin:e.image.hasRotate?"top left":void 0,zIndex:e.image.zIndex},height:e.image.inGrid?1:e.image.height,width:e.image.inGrid?1:e.image.width,onClick:n=>{jc(n),t(e.image.id,e.pageId)},onPointerDown:s.onPointerDown,children:g(e.image.source)&&(0,i.jsx)("img",{draggable:!1,height:"100%",src:(o=e.image.source,Nq(o)?`${F.HEAVENT_ASSETS_URL}/badges/profile.jpg`:o===Pq.QrCode||o===Pq.Skidata?bf(`https://${F.WEEZEVENT_DOMAIN}`,{height:360,width:360}):o===Pq.Code39?bf("12345678",{barcodeType:Cf.Code39,height:28,width:234}):o),width:"100%"})});var o},wH=e=>{const{selectedElementId:n,selectElement:t}=nH(),s=CH(e.text,e.pageId),o=jD(e.text.text);return(0,i.jsx)(Tl,{align:e.text.align,css:{backgroundColor:e.text.hasBackground?e.text.backgroundColor:"none",border:e.text.borderSize>0?`${e.text.borderSize}px solid ${e.text.borderColor}`:"",borderRadius:e.text.borderRadius>0?`${e.text.borderRadius}px`:"0",color:e.text.color,fontFamily:e.text.fontFamily,fontSize:`${e.text.fontSize}px`,fontWeight:e.text.fontWeight,cursor:s.cursor,left:`${s.left}px`,lineHeight:e.text.lineHeight||1.4,outline:n===e.text.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.text.py||0}px`,paddingLeft:`${e.text.px||0}px`,paddingRight:`${e.text.px||0}px`,paddingTop:`${e.text.py||0}px`,position:e.text.inContainer?"static":"absolute",textAlign:e.text.justify,textTransform:e.text.textTransform,top:`${s.top}px`,touchAction:e.text.inContainer?void 0:"none",transform:e.text.hasRotate?`rotate(${e.text.rotateDegree}deg)`:void 0,transformOrigin:e.text.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.text.zIndex,"& em":{fontStyle:"italic"},"& s":{textDecoration:"line-through"},"& strong":{fontWeight:700},"& u":{textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o},height:e.text.inGrid?1:e.text.height,justify:e.text.justify,width:e.text.inGrid?1:e.text.width,onClick:n=>{jc(n),t(e.text.id,e.pageId)},onPointerDown:s.onPointerDown})},$H=e=>"container"===e.element.type?(0,i.jsx)(bH,{container:e.element,pageId:e.pageId}):"grid"===e.element.type?(0,i.jsx)(AH,{grid:e.element,pageId:e.pageId}):"image"===e.element.type?(0,i.jsx)(EH,{image:e.element,pageId:e.pageId}):"text"===e.element.type?(0,i.jsx)(wH,{pageId:e.pageId,text:e.element}):null,TH=[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:1,y:0},{x:1,y:1},{x:0,y:1},{x:-1,y:1},{x:-1,y:0}],zH=1e4,OH=e=>0===e.x?"ns-resize":0===e.y?"ew-resize":e.x===e.y?"nwse-resize":"nesw-resize",RH=e=>{const{customDocument:n,setElementBox:t,setSnapGuides:s,zoom:o}=nH(),a=(0,V.useRef)(null),r=o/100,{height:d,pages:l,width:c}=n.configuration,u=fH(e.element,c,d),m=8/r;(0,V.useEffect)(()=>()=>{a.current?.()},[]);const g=n=>i=>{if(0!==i.button)return;const o=e.element,m=(0,Fr.A)(o,["height","left","top","width"]),g=_H(l.find(n=>n.id===e.pageId)?.elements??[],o.id,c,d),h=jH(e.pageId,s);a.current?.();const p=yH(i,0,{onMove:(e,i,s)=>{const a=function(e,n,t,i,s){const o=s.isRatioLocked&&e.width>0&&e.height>0,a=0!==n.x,r=0!==n.y&&(!o||0===n.x),d={...IH};let l=e.width+n.x*t,c=e.height+n.y*i;if(s.snapTargets){if(a){const t=1===n.x?e.left+l:e.left+e.width-l,i=vH(t,s.snapTargets.x,s.snapThreshold);null!==i&&(l+=n.x*(i-t),d.x=i)}if(r){const t=1===n.y?e.top+c:e.top+e.height-c,i=vH(t,s.snapTargets.y,s.snapThreshold);null!==i&&(c+=n.y*(i-t),d.y=i)}}if(o){const t=e.width/e.height;0!==n.x?c=l/t:l=c*t;const i=Math.max(1,10/l,10/c);l*=i,c*=i}else l=Math.max(10,l),c=Math.max(10,c);l=Math.round(l),c=Math.round(c);const u=-1===n.x?e.left+e.width-l:e.left,m=-1===n.y?e.top+e.height-c:e.top,g=-1===n.x?u:u+l,h=-1===n.y?m:m+c;return{box:{height:c,left:u,top:m,width:l},guides:{x:null!==d.x&&Math.abs(g-d.x)<=.5?d.x:null,y:null!==d.y&&Math.abs(h-d.y)<=.5?d.y:null}}}(u,n,e/r,i/r,{isRatioLocked:o.isRatioLocked||s.shiftKey,snapTargets:s.altKey?null:g,snapThreshold:5/r});t(o.id,a.box),h(a.guides)},onEnd:()=>{h(IH)},onCancel:()=>{t(o.id,m),h(IH)}});a.current=()=>{p(),h(IH)}};return(0,i.jsx)(Mr,{css:{height:`${u.height}px`,left:`${u.left}px`,pointerEvents:"none",position:"absolute",top:`${u.top}px`,width:`${u.width}px`,zIndex:zH},children:TH.map(e=>(0,i.jsx)(Mr,{css:{background:"white",border:1/r+"px solid $primary500",cursor:OH(e),height:`${m}px`,left:`calc(${50*(e.x+1)}% - ${m/2}px)`,pointerEvents:"auto",position:"absolute",top:`calc(${50*(e.y+1)}% - ${m/2}px)`,touchAction:"none",width:`${m}px`},"data-testid":`resize-handle-${e.x}-${e.y}`,onClick:jc,onPointerDown:g(e)},`${e.x},${e.y}`))})},DH=e=>{const{translate:n}=Kl(),{customDocument:t,addPage:s,movingElementId:o,removePage:a,selectedElementId:r,selectedPageId:d,selectPage:l,snapGuides:c}=nH(),u=c?.pageId===e.page.id?c:null,m=e.page.elements.find(e=>e.id===r&&!e.hasRotate&&e.id!==o),h=t.configuration.pages.length>1,p=t.configuration.bleed?19:0;return(0,i.jsxs)(Tl,{css:{height:"fit-content",width:"fit-content"},direction:"column",gap:"2",children:[(0,i.jsxs)(Tl,{align:"center",children:[(0,i.jsx)(Mr,{css:{cursor:"pointer",flex:"1"},fontWeight:"semiBold",onClick:n=>{jc(n),l(e.page.id)},children:g(e.page.name)?e.page.name:n("page_1_33637",e.index+1)}),(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsx)(tc,{color:"white",leftIcon:"plus",size:"sm",onClick:s}),(0,i.jsx)(tc,{color:"white",disabled:!h,leftIcon:"trash-can",size:"sm",onClick:()=>{a(e.page.id)}})]})]}),(0,i.jsxs)(Tl,{css:{background:"white",padding:`${p}px`,position:"relative"},height:2*p+t.configuration.height,width:2*p+t.configuration.width,children:[t.configuration.bleed&&(0,i.jsx)(pH,{}),(0,i.jsxs)(Tl,{css:{background:"white",outline:d===e.page.id?"2px solid $primary500":"",position:"relative",userSelect:"none"},height:t.configuration.height,width:t.configuration.width,onClick:n=>{jc(n),l(e.page.id)},children:[e.page.elements.map(n=>(0,i.jsx)($H,{element:n,pageId:e.page.id},n.id)),m&&(0,i.jsx)(RH,{element:m,pageId:e.page.id}),"number"==typeof u?.x&&(0,i.jsx)(Mr,{css:{background:"$primary500",left:`${u.x}px`,pointerEvents:"none",position:"absolute",top:0,zIndex:zH},height:1,width:"1px"}),"number"==typeof u?.y&&(0,i.jsx)(Mr,{css:{background:"$primary500",left:0,pointerEvents:"none",position:"absolute",top:`${u.y}px`,zIndex:zH},height:"1px",width:1})]})]})]})},MH={ArrowDown:{left:0,top:1},ArrowLeft:{left:-1,top:0},ArrowRight:{left:1,top:0},ArrowUp:{left:0,top:-1}},PH=()=>{const{customDocument:e,cleanSelecteds:n,getSelectedElement:t,offsetElementPosition:s,setZoom:o,zoom:a}=nH();return(0,V.useEffect)(()=>{const e=e=>{const n=MH[e.key],i=t();if(n&&i&&!i.inContainer&&!((o=e.target)instanceof HTMLElement&&(o.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(o.tagName)||null!==o.closest('[aria-pressed="true"]')))){const t=e.shiftKey?10:1;e.preventDefault(),s(i.id,n.left*t,n.top*t)}var o};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t,s]),(0,i.jsxs)(Mr,{css:{background:"$gray100",position:"relative"},height:1,width:1,children:[(0,i.jsx)(Tl,{align:"center",css:{overflow:"auto",padding:"$9",zoom:`${a}%`},direction:"column",gap:"7",height:1,width:1,onClick:n,children:e.configuration.pages.map((e,n)=>(0,i.jsx)(DH,{index:n,page:e},e.id))}),(0,i.jsx)(Mr,{css:{bottom:"24px",position:"absolute",right:"24px",zIndex:1e3},width:140,children:(0,i.jsxs)(Up,{shouldParseAsInt:!0,value:a,onChange:o,children:[(0,i.jsx)("option",{value:"50",children:"Zoom (50%)"}),(0,i.jsx)("option",{value:"66",children:"Zoom (66%)"}),(0,i.jsx)("option",{value:"80",children:"Zoom (80%)"}),(0,i.jsx)("option",{value:"100",children:"Zoom (100%)"}),(0,i.jsx)("option",{value:"120",children:"Zoom (120%)"}),(0,i.jsx)("option",{value:"150",children:"Zoom (150%)"}),(0,i.jsx)("option",{value:"200",children:"Zoom (200%)"})]})})]})},kH=e=>"page"===e.type?e.pageId:e.elementId;function FH(e,n){return"page"===e.type?"inside":e.canContain?n<.25?"before":n>.75?"after":"inside":n<.5?"before":"after"}function NH(e){return[e.id].concat(Lq(e)?e.elements.flatMap(NH):[])}const LH=(0,V.createContext)({activeId:null,dropTarget:null});const UH="$colors$primary500";function VH(e){const n=kH(e),{attributes:t,isDragging:i,listeners:s,setNodeRef:o}=(0,Ip.PM)({data:e,disabled:"page"===e.type,id:n}),{setNodeRef:a}=(0,Ip.zM)({data:e,id:n}),{dropTarget:r}=(0,V.useContext)(LH),d=(0,V.useCallback)(e=>{o(e),a(e)},[o,a]),l=r&&kH(r.row)===n?r.position:null,c="before"===l?`inset 0 2px 0 ${UH}`:"after"===l?`inset 0 -2px 0 ${UH}`:"inside"===l?`inset 0 0 0 2px ${UH}`:void 0;return{dragProps:"page"===e.type?{}:{...t,...s},dropBoxShadow:c,isDragging:i,setNodeRef:d}}const BH=e=>"container"===e.type?"column"===e.direction?"chart-simple-horizontal":"chart-simple":"grid"===e.type?"table-cells":"image"===e.type?"image":"text",WH=e=>{const{translate:n}=Kl(),{deleteElement:t,duplicateElement:s,selectedElementId:o,selectElement:a}=nH(),{dragProps:r,dropBoxShadow:d,isDragging:l,setNodeRef:c}=VH({type:"element",canContain:Lq(e.element),elementId:e.element.id,pageId:e.pageId});return(0,i.jsxs)(Tl,{css:{opacity:l?.4:1},direction:"column",children:[(0,i.jsxs)(Tl,{ref:c,align:"center",css:{background:o===e.element.id?"$primary100":"none",borderRadius:"$1",boxShadow:d,color:o===e.element.id?"$primary500":"$gray800",cursor:"pointer",padding:"$2","& .h-duplicate, & .h-delete":{display:"none"},"&:hover":{background:"$primary100",color:"$primary500","& .h-duplicate, & .h-delete":{display:"block"}}},gap:"3",width:250,onClick:()=>{a(e.element.id,e.pageId)},...r,children:[(0,i.jsx)(Mr,{fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:BH(e.element)})}),(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Mr,{css:{ellipsis:!0},fontSize:"textSm",fontWeight:"medium",title:e.element.name,width:1,children:e.element.name})}),Xq(e.element)&&(0,i.jsx)(Mr,{title:n("affich_sous_co_68172"),children:(0,i.jsx)(Yl,{icon:"filter"})}),(0,i.jsx)(Mr,{className:"h-duplicate",onClick:n=>{jc(n),s(e.element.id)},children:(0,i.jsx)(Yl,{icon:"copy"})}),(0,i.jsx)(Mr,{className:"h-delete",onClick:n=>{jc(n),t(e.element.id)},children:(0,i.jsx)(Yl,{icon:"trash-can"})})]}),Lq(e.element)&&(0,i.jsx)(Tl,{css:{paddingLeft:"$8"},direction:"column",children:e.element.elements.map(n=>(0,i.jsx)(WH,{element:n,pageId:e.pageId},n.id))})]})},GH=e=>(0,i.jsxs)(Tl,{align:"center",css:{background:"$primary100",borderRadius:"$1",boxShadow:"$md",color:"$primary500",cursor:"grabbing",padding:"$2"},gap:"3",width:250,children:[(0,i.jsx)(Mr,{fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:BH(e.element)})}),(0,i.jsx)(Mr,{css:{ellipsis:!0,flex:"1"},fontSize:"textSm",fontWeight:"medium",children:e.element.name})]}),qH=e=>{const{translate:n}=Kl(),{duplicatePage:t,selectedPageId:s,selectPage:o}=nH(),a=g(e.page.name)?e.page.name:n("page_1_33637",e.index+1),{dropBoxShadow:r,setNodeRef:d}=VH({type:"page",pageId:e.page.id});return(0,i.jsx)(WB,{css:{gap:"0",width:"fit-content"},title:(0,i.jsxs)(Tl,{ref:d,align:"center",css:{background:s===e.page.id?"$primary100":"",borderRadius:"$1",boxShadow:r,color:s===e.page.id?"$primary500":"$gray800",fontWeight:"$medium",padding:"$2","& .h-duplicate":{display:"none"},"&:hover":{background:"$primary100",color:"$primary500","& .h-duplicate":{display:"block"}}},gap:"3",width:250,onClick:n=>{jc(n),o(e.page.id)},children:[(0,i.jsx)(Mr,{fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"frame"})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:a}),Xq(e.page)&&(0,i.jsx)(Mr,{title:n("affich_sous_co_68172"),children:(0,i.jsx)(Yl,{icon:"filter"})}),(0,i.jsx)(Mr,{className:"h-duplicate",onClick:n=>{jc(n),t(e.page.id)},children:(0,i.jsx)(Yl,{icon:"copy"})})]}),titleCss:{gap:"$2"},children:(0,i.jsx)(Tl,{css:{paddingLeft:"$8"},direction:"column",children:e.page.elements.map(n=>(0,i.jsx)(WH,{element:n,pageId:e.page.id},n.id))})})},HH=()=>{const{customDocument:e}=nH(),{activeId:n,dndContextProps:t,dropTarget:s}=function(){const{customDocument:e,moveElement:n,selectedElementId:t,selectElement:i}=nH(),s=(0,Ip.FR)((0,Ip.MS)(Ip.AN,{activationConstraint:{distance:4}}),(0,Ip.MS)(Ip.uN)),[o,a]=(0,V.useState)(null),[r,d]=(0,V.useState)(null),l=(0,V.useRef)(null),c=(0,V.useRef)(new Set),u=(0,V.useCallback)(e=>{const n=e=>e?`${kH(e.row)}-${e.position}`:null;n(l.current)!==n(e)&&(l.current=e,d(e))},[]),m=(0,V.useCallback)(()=>{c.current=new Set,a(null),u(null)},[u]),g=(0,V.useCallback)(e=>{const n=e.droppableContainers.filter(e=>!c.current.has(e.id));return e.pointerCoordinates?(0,Ip.TT)({...e,droppableContainers:n}):(0,Ip.fp)({...e,droppableContainers:n})},[]),h=(0,V.useCallback)(({active:n})=>{const t=Vq(e.configuration,n.id);c.current=new Set(t?NH(t.element):[]),a(n.id)},[e]),p=(0,V.useCallback)(e=>{const n=(t=e.over,t?.data.current);var t;const i=function(e){const n=e.activatorEvent;if("number"==typeof n.clientY)return n.clientY+e.delta.y;{const n=e.active.rect.current.translated;return n?n.top+n.height/2:null}}(e);if(e.over&&n&&null!==i){const{height:t,top:s}=e.over.rect;u({position:FH(n,(i-s)/t),row:n})}else u(null)},[u]),I=(0,V.useCallback)(({active:s})=>{const o=s.id,a=l.current?function(e,n,t){const{position:i,row:s}=t,o=e=>e.filter(e=>e.id!==n);if("page"===s.type)return{index:0,pageId:s.pageId,parentId:null};const a=Vq(e,s.elementId);if(!a)return null;const{ancestors:r,element:d,page:l}=a;if(Lq(d)){if("inside"===i)return{index:o(d.elements).length,pageId:l.id,parentId:d.id};if("after"===i&&o(d.elements).length>0)return{index:0,pageId:l.id,parentId:d.id}}const c=r.at(-1);return{index:o(c?c.elements:l.elements).findIndex(e=>e.id===d.id)+("after"===i?1:0),pageId:l.id,parentId:c?.id??null}}(e.configuration,o,l.current):null;m(),a&&(n(o,a),o===t&&i(o,a.pageId))},[e,n,m,t,i]);return{activeId:o,dndContextProps:{collisionDetection:g,sensors:s,onDragCancel:m,onDragEnd:I,onDragMove:p,onDragOver:p,onDragStart:h},dropTarget:r}}(),o=n?Vq(e.configuration,n)?.element:null;return(0,i.jsxs)(Ip.Mp,{...t,children:[(0,i.jsx)(LH.Provider,{value:{activeId:n,dropTarget:s},children:(0,i.jsx)(Tl,{css:{overflowY:"auto"},direction:"column",height:1,width:1,children:e.configuration.pages.map((e,n)=>(0,i.jsx)(qH,{index:n,page:e},e.id))})}),(0,i.jsx)(Ip.Hd,{dropAnimation:null,children:o&&(0,i.jsx)(GH,{element:o})})]})},YH=()=>{const{history:e,params:{organizationId:n,eventId:t,customDocumentId:s},translate:o}=Kl(),{mutate:a,isLoading:r}=function(e={}){return Ui("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:d}=nH(),l=(0,V.useMemo)(()=>JSON.stringify(d),[r]),[c,u]=(0,V.useState)(!1),m=(0,V.useCallback)(()=>{JSON.stringify(d)===l?e.goBack(YO.DOCUMENTS({organizationId:n,eventId:t})):u(!0)},[d,l]);return Au(o("mise_jour_de_17055",d.name)),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hx,{button:(0,i.jsx)(tc,{isLoading:r,onClick:async()=>{await a({eventId:t,customDocumentId:s,customDocument:d})},children:o("enregistrer_06519")}),category:o("document_person_69340"),color:"dark",heading:d.name,onClose:m,children:(0,i.jsxs)(Tl,{height:1,width:1,children:[(0,i.jsx)(Mr,{height:1,width:420,children:(0,i.jsx)(hH,{})}),(0,i.jsx)(Mr,{css:{flex:"1"},height:1,children:(0,i.jsx)(PH,{})}),(0,i.jsx)(Mr,{height:1,width:340,children:(0,i.jsx)(HH,{})})]})}),(0,i.jsx)(Mz,{fallbackPath:YO.DOCUMENTS({organizationId:n,eventId:t}),isOpen:c,onClose:()=>u(!1)})]})},ZH=()=>{const{history:e,params:{organizationId:n,eventId:t,customDocumentId:s}}=Kl(),{data:o,loader:a}=Li('query CustomDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n population: customFieldBySlug(slug: "population") {\n values {\n id\n value\n }\n }\n\n customFields(\n eventId: $eventId\n variety: UserInfo\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n customDocument(customDocumentId: $customDocumentId) {\n name\n slug\n populationsIds\n configuration\n shouldRegenerateTicketIdOnDownload\n }\n }\n}\n',{organizationId:n,eventId:t,customDocumentId:s},[$o.ConditionCustomFieldFragment]),r=ki(Mq);return a||o.event?.customDocument||e.replace(YO.DOCUMENTS({organizationId:n,eventId:t})),a||(0,i.jsx)(eH,{customFields:o.organization.customFields.nodes,initialCustomDocument:r.customDocumentInputDefault(o.event.customDocument),population:o.organization.population,children:(0,i.jsx)(YH,{})})},KH=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{mutate:a}=function(e={}){return Ui("mutation CustomDocumentCreate($eventId :EventId!, $customDocument: CustomDocumentInput!){\n customDocumentCreate(eventId: $eventId, customDocument: $customDocument){\n id\n }\n}\n",e)}(),r=ki(Mq),[l,c]=(0,V.useState)(""),[u,h]=(0,V.useState)(""),[p,I]=(0,V.useState)(!1),x=(0,V.useCallback)(e=>{c(e),p||h(m(e,{replacer:d.Empty}))},[p,c,h]),f=(0,V.useCallback)(e=>{g(e)?(h(m(e,{replacer:d.Empty})),I(!0)):(h(""),I(!1))},[h,I]);return(0,i.jsxs)(xx,{isOpen:e.isOpen,children:[(0,i.jsx)(fx,{children:(0,i.jsx)(tc,{children:t("cr_er_un_docume_92512")})}),(0,i.jsxs)(Ix,{children:[(0,i.jsx)(px,{icon:"file",children:t("nouveau_documen_36722")}),(0,i.jsxs)(hx,{gap:"5",children:[(0,i.jsx)(wc,{label:t("nom_du_document_22604"),value:l,onChange:x}),(0,i.jsx)(wc,{hint:t("ne_doit_conteni_53122"),label:t("nom_de_la_varia_81999"),value:u,onChange:f})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{onClick:async()=>{const{customDocumentCreate:e}=await a({eventId:o,customDocument:{name:l,slug:u,populationsIds:[],configuration:r.getConfigurationDefault(),shouldRegenerateTicketIdOnDownload:!1}});n.push(YO.EDIT_CUSTOM_DOCUMENT({organizationId:s,eventId:o,customDocumentId:e.id}))},children:t("cr_er_le_docume_02657")})})]})]})},XH=e=>(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:e.title}),(0,i.jsx)(Tl,{css:{background:"white",bd:!0,"& > div:last-child":{borderBottom:"none"}},direction:"column",children:e.children})]}),QH=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{showNotification:a}=AS(),{mutate:r}=function(e={}){return Ui("mutation CustomDocumentDuplicate($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDuplicate(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),{mutate:d}=function(e={}){return Ui("mutation CustomDocumentDelete($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDelete(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),[l,c]=(0,V.useState)(!1),u=Kq(e.customDocument.configuration.height,e.customDocument.configuration.width),m=e.customDocument.populations.join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Tl,{align:"center",css:{background:"$success100",borderRadius:"$3",color:"$success700",fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(Yl,{icon:"pen-ruler"})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[e.disabled?(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:e.customDocument.name}):(0,i.jsx)(Xm,{css:{fontSize:"$textMd"},to:YO.USER_CUSTOM_DOCUMENT({organizationId:s,eventId:o,userInfoId:e.userInfoId,customDocumentId:e.customDocument.id}),children:e.customDocument.name}),(0,i.jsx)(Mr,{color:"gray500",children:t("cr_par_1_69201",e.customDocument.createdBy.nameOrEmail)})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:t("populations_48141")}),(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:m,width:1,children:g(m)?m:"-"})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:85,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:t("format_54368")}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:"custom"===u?t("personnalis_40360"):u.toUpperCase()})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:t("nom_de_la_varia_81999")}),(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:`{user.documents.${e.customDocument.slug}}`,width:1,children:`{user.documents.${e.customDocument.slug}}`})]}),(0,i.jsx)(ly,{permissions:sy.DOCUMENT_EDIT,children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{n.push(YO.EDIT_CUSTOM_DOCUMENT({organizationId:s,eventId:o,customDocumentId:e.customDocument.id}))}})}),(0,i.jsx)(Dx,{placement:"top",children:t("_diter_62574")})]})}),(0,i.jsx)(ly,{permissions:sy.DOCUMENT_EDIT,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{await r({eventId:o,customDocumentId:e.customDocument.id}),e.reload()},children:t("dupliquer_28256")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:t("supprimer_43083")})})]})]})})]}),l&&(0,i.jsx)(ow,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_81333"),text:t("suppression_de_73669",e.customDocument.name),onClose:()=>{c(!1)},onDelete:async()=>{await d({eventId:o,customDocumentId:e.customDocument.id}),a(t("le_document_1_14516",e.customDocument.name)),e.reload()}})]})},JH=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>(0,Lm.A)(e.customDocuments,e=>e.name.toLowerCase()),[e.customDocuments]),s=(0,V.useMemo)(()=>Object.values((0,fm.A)(t,e=>e.slug)).some(e=>e.length>1),[t]);return(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("plusieurs_docum_09566")}),(0,i.jsx)(uc,{children:n("lorsque_plusieu_27447")})]}),(0,i.jsx)(XH,{title:n("documents_perso_87374"),children:t.map(n=>(0,i.jsx)(QH,{customDocument:n,disabled:0===e.numberOfVolunteersRegistrations,reload:e.reload,userInfoId:e.userInfoId},n.id))})]})},eY=e=>{const{translate:n}=Kl();return(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Tl,{align:"center",css:{background:Ar.colors[`${e.color}100`],borderRadius:"$3",color:Ar.colors[`${e.color}700`],fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(Yl,{icon:e.icon})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[e.disabled?(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:e.title}):(0,i.jsx)(Xm,{css:{fontSize:"$textMd"},to:e.path,children:e.title}),e.disabled&&(0,i.jsx)(Ku,{color:"warning",size:"sm",children:n("le_document_n_e_47973")})]}),(0,i.jsx)(Mr,{color:"gray500",children:n("cr_par_1_69201","WeezCrew")})]}),g(e.variable)&&(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:n("nom_de_la_varia_81999")}),(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:"",width:1,children:`{user.documents.${e.variable}}`})]}),void 0!==e.count&&!e.disabled&&(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:150,children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:e.text}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:e.count})]})]})},nY=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl();return(0,i.jsx)(XH,{title:n("accr_ditations_39450"),children:(0,i.jsx)(eY,{color:"blueGray",count:e.numberOfAccreditationsSlots,disabled:0===e.numberOfAccreditationsSlots,icon:"list-ul",path:YO.ASO_PAX_MANIFEST({organizationId:t,eventId:s,accreditationSlotId:e.accreditationSlotId}),text:n("nombre_de_cr_ne_40593"),title:"PAX Manifest"})})},tY=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl();return(0,i.jsx)(XH,{title:n("d_l_gations_78318"),children:(0,i.jsx)(eY,{color:"blueGray",count:e.numberOfDelegations,disabled:0===e.numberOfDelegations,icon:"sitemap",path:YO.DELEGATION_CALENDAR({organizationId:t,eventId:s,delegationId:e.delegationId}),text:n("nombre_de_d_l_g_45708"),title:n("planning_des_ac_44426")})})},iY=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{event:o}=BS();return(0,i.jsxs)(XH,{title:n("_v_nement_22345"),children:[(0,i.jsx)(eY,{color:"pink",icon:"list-ul",path:YO.USERS_LISTING({organizationId:t,eventId:s,segmentId:e.volunteersSegmentId}),text:n("nombre_de_membr_87049"),title:n("liste_des_membr_89037")}),o.usePositions&&(0,i.jsx)(eY,{color:"purple",icon:"calendar-day",path:YO.POSITIONS_VOLUNTEERS_PLANNING({organizationId:t,eventId:s,segmentId:e.positionsSegmentId}),text:n("nombre_de_missi_56719"),title:n("planning_d_un_g_23684")}),o.usePositions&&(0,i.jsx)(eY,{color:"purple",icon:"calendar-day",path:YO.POSITIONS_PLANNING({organizationId:t,eventId:s,segmentId:e.positionsSegmentId}),text:n("nombre_de_missi_56719"),title:n("planning_de_l_96909")}),(0,i.jsx)(eY,{color:"purple",icon:"image",path:YO.USERS_PICTURES({organizationId:t,eventId:s,segmentId:e.volunteersSegmentId}),text:"",title:n("trombinoscope_11316")})]})},sY=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{organization:o}=XS();return(0,i.jsxs)(XH,{title:n("membres_11310"),children:[(0,i.jsx)(eY,{color:"pink",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"user",path:YO.USER_ASSIGNMENTS({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("fiche_d_affecta_91461"),variable:"assignments"}),(0,i.jsx)(eY,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:YO.USER_PLANNING({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("UserPlanning"),variable:"planning"}),(0,i.jsx)(eY,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:YO.USER_PLANNING_LIST({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("UserPlanningList"),variable:"planningList"}),(0,i.jsx)(eY,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:YO.USER_PLANNING_DAYS({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("UserPlanningDays"),variable:"planningDays"}),(0,i.jsx)(eY,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"certificate",path:YO.USER_CERTIFICATE({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("Certificate"),variable:"certificate"}),(0,i.jsx)(eY,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"id-card",path:YO.USER_BADGE({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId,badgeType:"generic"}),text:n("nombre_de_membr_87049"),title:n("BadgeCheck"),variable:"badge"}),(0,i.jsx)(eY,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"clock",path:YO.USER_HOURS({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("UserHours"),variable:"hours"}),o.customBadges.map(o=>(0,i.jsx)(eY,{color:"success",count:e.numberOfVolunteersRegistrations,disabled:!1,icon:"id-card",path:YO.USER_BADGE({organizationId:t,eventId:s,userInfoId:e.userInfoId,badgeType:o}),text:n("nombre_de_membr_87049"),title:M_(o),variable:o.toLowerCase()},o))]})},oY=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl();return(0,i.jsxs)(XH,{title:n("missions_63972"),children:[(0,i.jsx)(eY,{color:"blueGray",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"sitemap",path:YO.POSITION_SHEET({organizationId:t,eventId:s,positionId:e.positionId}),text:n("nombre_de_fiche_03009"),title:n("fiche_de_missio_00324")}),(0,i.jsx)(eY,{color:"purple",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"calendar-day",path:YO.POSITION_PLANNING({organizationId:t,eventId:s,positionId:e.positionId}),text:n("nombre_de_missi_56719"),title:n("planning_d_une_64581")})]})},aY=e=>{const{params:{organizationId:n}}=Kl(),{hasFeature:t}=XS(),{event:s}=BS(),o=e.event.volunteersRegistrations.nodes[0]?.userInfoId??-1;return(0,i.jsxs)(Tl,{direction:"column",gap:"7",children:[t(Ze.CustomDocument)&&Yo(e.event.customDocuments)&&(0,i.jsx)(JH,{customDocuments:e.event.customDocuments,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,reload:e.reload,userInfoId:o}),s.usePositions&&(0,i.jsx)(sY,{assignedUserInfoId:e.event.assignedVolunteersRegistrations.nodes[0]?.userInfoId??-1,numberOfAssignedVolunteersRegistrations:e.event.assignedVolunteersRegistrations.totalCount,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,userInfoId:o}),s.usePositions&&(0,i.jsx)(oY,{numberOfPositions:e.event.positions.totalCount,positionId:e.event.positions.nodes[0]?.id??-1}),yh(n)&&(0,i.jsx)(nY,{accreditationSlotId:e.event.accreditationsSlots.nodes[0]?.id??-1,numberOfAccreditationsSlots:e.event.accreditationsSlots.totalCount}),s.useDelegations&&(0,i.jsx)(tY,{delegationId:e.event.delegations.nodes[0]?.id??-1,numberOfDelegations:e.event.delegations.totalCount}),(0,i.jsx)(iY,{positionsSegmentId:e.event.positionSegment.id,volunteersSegmentId:e.event.volunteerSegment.id})]})},rY=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(Qu,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(Qu,{borderRadius:"$2",height:74,width:1})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(Qu,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(Qu,{borderRadius:"$2",height:74,width:1})]})]}),dY=e=>{const{translate:n,params:{eventId:t}}=Kl(),{hasFeature:s}=XS(),{event:{name:o}}=BS(),{canDocumentEdit:a}=oy();Au(`${o} ${n("Documents")}`);const{data:r,isLoading:d,reload:l}=Li('query Documents($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n id\n name\n slug\n configuration\n populations\n\n createdBy {\n nameOrEmail\n }\n }\n\n accreditationsSlots(limit: 1) {\n nodes {\n id\n }\n\n totalCount\n }\n\n delegations(limit: 1) {\n nodes {\n id\n }\n\n totalCount\n }\n\n positions(limit: 1) {\n nodes {\n id\n }\n\n totalCount\n }\n\n volunteersRegistrations(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n assignedVolunteersRegistrations: volunteersRegistrations(\n states: [Assigned]\n limit: 1\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n volunteerSegment: segment(segmentType: Volunteers) {\n id\n }\n\n positionSegment: segment(segmentType: Positions) {\n id\n }\n }\n}\n',{eventId:t},[]);return(0,i.jsxs)(Ay,{children:[(0,i.jsxs)(by,{gap:"3",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray900 displayXs semiBold",children:n("Documents")}),(0,i.jsx)(Mr,{color:"gray500",children:n("retrouver_et_pe_99652")})]}),s(Ze.CustomDocument)&&a&&(0,i.jsx)(KH,{isOpen:e.isCreateOpen})]}),(0,i.jsx)(yy,{children:s(Ze.Documents)?d?(0,i.jsx)(rY,{}):(0,i.jsx)(aY,{event:r.event,reload:l}):(0,i.jsx)(Tl,{align:"center",css:{flex:"1"},direction:"column",justify:"center",children:(0,i.jsx)(Vj,{icon:"folders"})})})]})},lY=e=>{const n=e.asoPaxManifest.event.accreditationSlot,t=n.accreditation,[s,o]=n.name.split("-"),a=n.date?.toFormat("dd/MM/yyyy")??"";return(0,i.jsxs)(Tl,{css:{background:"white",color:"black",fontSize:"12px",pageBreakBefore:"always",padding:"32px 68px"},direction:"column",height:pf,width:If,children:[(0,i.jsx)(Mr,{textAlign:"center",width:1,children:"PAX MANIFEST"}),(0,i.jsx)(Pl,{height:"9"}),(0,i.jsxs)(Tl,{align:"center",css:{background:"black",color:"white",fontSize:"20px"},height:38,justify:"center",width:1,children:[t.name," - ",a]}),(0,i.jsxs)(Tl,{css:{padding:"24px 36px 28px 36px"},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{width:1,children:[(0,i.jsx)(Mr,{css:{fontWeight:"700"},width:142,children:"Aircraft Type :"}),(0,i.jsx)(Mr,{width:140,children:"<>"}),(0,i.jsx)(Mr,{css:{fontWeight:"700"},width:132,children:"Flight number :"}),(0,i.jsx)(Mr,{children:"<>"})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{width:1,children:[(0,i.jsx)(Mr,{css:{fontWeight:"700"},width:142,children:"Departure Airport :"}),(0,i.jsx)(Mr,{width:140,children:s}),(0,i.jsx)(Mr,{width:140,children:a}),(0,i.jsx)(Mr,{css:{flex:"1"},textAlign:"end",children:"<>"})]}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{width:1,children:[(0,i.jsx)(Mr,{css:{fontWeight:"700"},width:142,children:"Arrival Airport :"}),(0,i.jsx)(Mr,{width:140,children:o}),(0,i.jsx)(Mr,{width:140,children:a}),(0,i.jsx)(Mr,{css:{flex:"1"},textAlign:"end",children:"<>"})]})]}),(0,i.jsx)(Mr,{css:{background:"black"},height:7,width:1}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsxs)(Tl,{css:{border:"1px solid black"},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"black",color:"white",fontWeight:"700"},height:40,width:1,children:[(0,i.jsx)(Mr,{css:{px:"$1"},width:35,children:"N°"}),(0,i.jsx)(Mr,{css:{flex:"1",px:"$1"},children:"Last name"}),(0,i.jsx)(Mr,{css:{flex:"1",px:"$1"},children:"First name"}),(0,i.jsx)(Mr,{css:{flex:"1",px:"$1"},children:"Passport number"}),(0,i.jsx)(Mr,{css:{flex:"1",px:"$1"},children:"Passport expire date"}),(0,i.jsx)(Mr,{css:{px:"$1"},width:85,children:"Nationality"})]}),n.volunteersRegistrations.map((e,n)=>{const t=Oo.c9.fromISO(e.userInfo.fields?.cf54609?.rawValue),s=Oo.c9.isDateTime(t)&&t.isValid?t.toFormat("dd/MM/yyyy"):"";return(0,i.jsxs)(Tl,{align:"center",css:{background:n%2==0?"#d9d9d9":"white",borderTop:0===n?"none":"1px solid black"},height:20,width:1,children:[(0,i.jsx)(Mr,{css:{px:"$1"},width:35,children:n+1}),(0,i.jsx)(Mr,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.lastName?.value?.toUpperCase()}),(0,i.jsx)(Mr,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.firstName?.value}),(0,i.jsx)(Mr,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.cf54607?.value}),(0,i.jsx)(Mr,{css:{flex:"1",px:"$1"},children:s}),(0,i.jsx)(Mr,{css:{px:"$1"},width:85,children:e.userInfo.fields?.nationality?.rawValue})]},e.id)})]}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsxs)(Tl,{css:{paddingRight:"48px"},gap:"9",justify:"end",width:1,children:[(0,i.jsx)(Mr,{children:"Passengers"}),(0,i.jsx)(Mr,{children:`${n.volunteersRegistrations.length}/${n.maxResources}`})]})]})},cY=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{user:o}=Yi(),{checkDocumentsExport:a}=AS(),[r,d]=(0,V.useState)([e.segmentsFolders[0].segments[0].id]),[l,c]=(0,V.useState)(e.languages[0]),[u,m]=(0,V.useState)(Oo.c9.invalid("Invalid")),[g,h]=(0,V.useState)(ke.OnePerPage),[p,I]=(0,V.useState)(!1),x=(0,V.useMemo)(()=>e.showStrategy&&!e.badgeType,[e.badgeType,e.showStrategy]);return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(Tl,{align:"center",css:{background:"$primary50",borderRadius:"48px",color:"$primary500",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(Yl,{icon:"envelope"})})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:e.title}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",dangerouslySetInnerHTML:{__html:n("en_2_clics_rec_97175")},textAlign:"center"}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(lc,{alertStyle:"gray",children:(0,i.jsx)(uc,{children:n("l_e_mail_peut_m_13253")})}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:n("vue_s_personna_35768"),multiple:!0,placeholder:n("s_lectionnez_un_53633"),values:r,onChange:d,children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))},e.id))}),e.languages.length>1&&(0,i.jsx)(Up,{label:n("Language"),placeholder:n("Language"),value:l,onChange:e=>{c(e)},children:e.languages.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.showDate&&(0,i.jsx)(Wp,{label:n("exportez_vos_do_87332"),max:e.endAt,min:e.startAt,value:u,onChange:m}),x&&(0,i.jsx)(Up,{label:n("strat_gie_44389"),value:g,onChange:e=>h(e),children:Nt.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),(0,i.jsx)(om,{state:p?"checked":"unchecked",onClick:e=>{I("checked"===e)},children:n("fusionner_les_d_64130")}),(0,i.jsx)(wc,{label:n("Email"),state:"disabled",value:o?.email??"",onChange:Bc.A})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{isLoading:e.isSendLoading,onClick:async()=>{const n=await e.onSend(r,l,p,g,u.isValid?u:void 0);a(n,t,s),e.onClose()},children:n("envoyer_26609")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},uY=e=>{const n=Fi(),{mutate:t,isLoading:s}=Fa(),[o,a]=V.useState(!1);return(0,i.jsx)(Cy,{breadcrumbs:(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:YO.DOCUMENTS({organizationId:e.organizationId,eventId:e.eventId}),children:n("Documents")}),(0,i.jsx)(AT,{isCurrent:!0,children:e.title})]}),buttons:(0,i.jsxs)(i.Fragment,{children:[e.extraButton,(0,i.jsx)(ly,{permissions:sy.DOCUMENT_READ,children:(0,i.jsx)(tc,{isLoading:s,onClick:()=>a(!0),children:n("param_trer_l_ex_83342")})}),o&&(0,i.jsx)(cY,{badgeType:e.badgeType,endAt:e.endAt,isSendLoading:s,languages:e.languages,segmentsFolders:e.segmentsFolders,showDate:e.showDate,showStrategy:e.showStrategy,startAt:e.startAt,title:n("envoi_de_vos_do_32953"),onClose:()=>a(!1),onSend:async(n,i,s,o,a)=>{const{jobId:r}=await t({organizationId:e.organizationId,eventId:e.eventId,documentsExport:{documentType:e.documentType,badgeType:e.badgeType,customDocumentSlug:e.customDocumentSlug,segmentsIds:n,language:i,oneFile:s,strategy:o,date:a}});return r}})]}),name:e.title})},mY=e=>(0,i.jsx)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",flex:"1",justifyContent:"center",padding:"$7",overflowX:"hidden",overflowY:"auto",...e.css},height:1,children:(0,i.jsx)(Tl,{css:{boxShadow:"$md",borderRadius:"$2",height:"fit-content",overflow:"hidden"},direction:"column",width:e.width,children:e.children})}),gY=e=>{const{history:n,translate:t,params:{eventId:s,accreditationSlotId:o}}=Kl(),a=ki(Jm),{data:r,isLoading:d}=Ja({eventId:s,loadIsBlocked:!1}),l=(0,V.useMemo)(()=>Bh(a,r.event?.accreditationsCategories??[]),[a,r.event]);return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_l_a_28765")}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(_m,{isSearchLoading:d,isSearchVisible:!0,values:[o],onChange:t=>{Yo(t)&&n.replace(e.getPath(t[0]))},children:l})}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})},hY=()=>{const{params:{organizationId:e,eventId:n,accreditationSlotId:t}}=Kl(),{user:s}=Yi(),{event:o}=BS(),{data:a,loader:r}=Li("query AsoPaxManifestDocument($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n ...DocumentAsoPaxManifest\n\n event(id: $eventId) {\n languages\n\n segmentsFolders(segmentType: Accreditations) {\n id\n name\n\n segments {\n id\n name\n rendering\n }\n }\n }\n}\n",{eventId:n,accreditationSlotId:t},[$o.DocumentAsoPaxManifestFragment]),d=(0,V.useMemo)(()=>(a.event?.segmentsFolders??[]).map(e=>({...e,segments:e.segments.filter(e=>"SlotsList"===e.rendering)})),[a.event]);return Au(`${o.name} PAX Manifest`),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.AsoPaxManifest,eventId:n,languages:a.event?.languages??[],organizationId:e,segmentsFolders:d,title:"PAX Manifest"}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},direction:"column",width:1,children:[(0,i.jsx)(gY,{downloadPath:Ef(a.event?.accreditationSlot?.links?.asoPaxManifestLink,"pdf",{lang:s?.language}),getPath:t=>YO.ASO_PAX_MANIFEST({organizationId:e,eventId:n,accreditationSlotId:t})}),(0,i.jsx)(mY,{width:1,children:(0,i.jsx)(lY,{asoPaxManifest:a})})]})})]})},pY=(e,n)=>{const t=Nq(e);if(t)return n.userInfo.fields?.[t]?.url||"";if(e===Pq.Skidata){const e=n.utid||"";return bf(e,{height:100,width:100})}if(e===Pq.QrCode){const e=n.ticketId;return bf(e,{height:100,width:100})}if(e===Pq.Code39){const e=n.ticketId;return bf(e,{barcodeType:Cf.Code39,height:28,width:234})}return e},IY=e=>{const n=g(e.element.source)&&g(pY(e.element.source,e.vr))?(0,i.jsx)("img",{height:"100%",src:pY(e.element.source,e.vr),width:"100%"}):null;return(0,i.jsx)(Mr,{css:{border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,zIndex:e.element.zIndex},height:e.element.inGrid?1:e.element.height,width:e.element.inGrid?1:e.element.width,children:g(e.element.link)?(0,i.jsx)("a",{href:e.element.link,rel:"noreferrer",target:"_blank",children:n}):n})};var xY=t(1184);const fY=e=>{const n=ki(hT),t=jD((0,xY.A)(n.renderText(e.element.text,{accreditations:e.vr.accreditationsUsersInfos,assignments:e.vr.positionsSlotsUsersInfos,userInfo:e.vr.userInfo,event:e.event,organization:e.organization,customFields:e.customFields,volunteerRegistration:e.vr,separator:"\n"}),{target:"_blank"}));return(0,i.jsx)(Tl,{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:t},height:e.element.inGrid?1:e.element.height,justify:e.element.justify,width:e.element.inGrid?1:e.element.width})},_Y=e=>{const n=n=>n.elements.map(n=>(0,i.jsx)(_Y,{accreditationsAcronyms:e.accreditationsAcronyms,accreditationsSlotsIds:e.accreditationsSlotsIds,customFields:e.customFields,element:n,event:e.event,organization:e.organization,positionsSlotsIds:e.positionsSlotsIds,segmentsIds:e.segmentsIds,vr:e.vr},n.id));return Qq(e.element,e.accreditationsSlotsIds,e.accreditationsAcronyms,e.positionsSlotsIds,e.segmentsIds,e.vr.userInfo.fields)?"container"===e.element.type?(0,i.jsx)(Tl,{align:e.element.align,css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",gap:`${e.element.gap}px`,left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.element.zIndex},direction:e.element.direction,height:e.element.inGrid?1:e.element.height,justify:e.element.justify,width:e.element.inGrid?1:e.element.width,wrap:"wrap",children:n(e.element)}):"grid"===e.element.type?(0,i.jsx)(Mr,{css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",columnGap:`${e.element.columnGap}px`,display:"grid",gridTemplateColumns:`repeat(${e.element.columns}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${e.element.rows}, minmax(0, 1fr))`,left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",rowGap:`${e.element.rowGap}px`,top:`${e.element.top}px`,whiteSpace:"pre-wrap",zIndex:e.element.zIndex},height:e.element.inGrid?1:e.element.height,width:e.element.inGrid?1:e.element.width,children:n(e.element)}):"image"===e.element.type?(0,i.jsx)(IY,{element:e.element,vr:e.vr}):"text"===e.element.type?(0,i.jsx)(fY,{customFields:e.customFields,element:e.element,event:e.event,organization:e.organization,vr:e.vr}):null:null},jY=e=>{const n=e.customDocument.configuration,t=e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot.id),s=e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>g(e.accreditation.acronym)?[e.accreditation.acronym]:[]),o=e.volunteerRegistration.positionsSlotsUsersInfos.map(e=>e.positionSlot.id),a=e.volunteerRegistration.segmentsIds,r=n.bleed?19:0;return(0,i.jsx)(i.Fragment,{children:n.pages.map(d=>Qq(d,t,s,o,a,e.volunteerRegistration.userInfo.fields)?(0,i.jsxs)(Tl,{css:{background:"white",padding:`${r}px`,position:"relative"},height:2*r+n.height,width:2*r+n.width,children:[n.bleed&&(0,i.jsx)(pH,{}),(0,i.jsx)(Tl,{css:{background:"white",pageBreakBefore:"always",position:"relative"},height:n.height,width:n.width,children:d.elements.map(n=>(0,i.jsx)(_Y,{accreditationsAcronyms:s,accreditationsSlotsIds:t,customFields:e.customFields,element:n,event:e.event,organization:e.organization,positionsSlotsIds:o,segmentsIds:a,vr:e.volunteerRegistration},n.id))})]},d.id):null)})},vY=()=>{const{translate:e,params:{eventId:n,customDocumentId:t}}=Kl(),[s,o]=(0,V.useState)(0),{data:a,isLoading:r}=Li("query UserCustomDocumentHistories(\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n $offset: Int\n) {\n event(id: $eventId) {\n id\n customDocument(customDocumentId: $customDocumentId) {\n id\n histories(offset: $offset, limit: 25) {\n nodes {\n ...HistoryRow\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{eventId:n,customDocumentId:t,offset:s},[$o.HistoryRowFragment]),d=a.event?.customDocument?.histories,{numberOfPages:l,totalCount:c}=Sx(d);return(0,i.jsx)(yy,{css:{overflowY:"auto"},children:(0,i.jsx)(HD,{getActionLabel:n=>e(`history_custom_documents_${n}`),histories:d?.nodes??[],isLoading:r,numberOfPages:l,offset:s,setOffset:o,totalCount:c})})},SY=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,userInfoId:o,customDocumentId:a}}=Kl(),{event:r}=BS(),{data:d,loader:l}=Li("query UserCustomDocumentExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n id\n name\n dateFormat\n datetimeFormat\n timeFormat\n\n customFields(eventId: $eventId) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n ...EventVolunteersExport\n\n id\n name\n organizationId\n startAt\n endAt\n fields\n\n customDocument(customDocumentId: $customDocumentId) {\n name\n slug\n configuration\n populationsIds\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...CustomBadgeVolunteerRegistration\n }\n }\n}\n",{organizationId:t,eventId:s,userInfoId:o,customDocumentId:a},[$o.CustomFieldWithConditionFragment,$o.EventVolunteersExportFragment,$o.CustomBadgeVolunteerRegistrationFragment]),c=(0,V.useMemo)(()=>{if(d.event){const e=d.event.customDocument,n=d.event.volunteerRegistration.userInfo.links;return Ef(n?.userCustomDocumentLinks[e?.slug||""]||"","pdf",{lang:d.event.volunteerRegistration.userInfo.fields?.language?.rawValue})}return""},[d.event]);return Au(`${r.name} ${d.event?.customDocument?.name??""}`),(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_CUSTOM_DOCUMENT({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(qi,{path:YO.USER_CUSTOM_DOCUMENT_PREVIEW({organizationId:t,eventId:s,userInfoId:o,customDocumentId:a}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{customDocumentSlug:d.event?.customDocument?.slug,documentType:Ne.UserCustomDocument,eventId:s,extraButton:(0,i.jsx)(ly,{permissions:sy.DOCUMENT_EDIT,children:(0,i.jsx)(tc,{color:"white",onClick:()=>{e.push(YO.EDIT_CUSTOM_DOCUMENT({organizationId:t,eventId:s,customDocumentId:a}))},children:n("_diter_le_docum_83590")})}),languages:d.event?.languages??[],organizationId:t,segmentsFolders:d.event?.segmentsFolders??[],title:d.event?.customDocument?.name??""}),(0,i.jsxs)(Ty,{css:{flex:"1",overflow:"hidden"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:YO.USER_CUSTOM_DOCUMENT_PREVIEW({organizationId:t,eventId:s,userInfoId:o,customDocumentId:a}),children:n("aper_u_25595")}),(0,i.jsx)(Ey,{path:YO.USER_CUSTOM_DOCUMENT_HISTORY({organizationId:t,eventId:s,userInfoId:o,customDocumentId:a}),children:n("historique_06296")})]}),(0,i.jsx)($y,{path:YO.USER_CUSTOM_DOCUMENT_PREVIEW({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(yy,{css:{overflow:"hidden"},children:l||(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:c,getPath:e=>YO.USER_CUSTOM_DOCUMENT_PREVIEW({organizationId:t,eventId:s,userInfoId:e,customDocumentId:a}),populationsIds:Yo(d.event?.customDocument?.populationsIds)?d.event.customDocument.populationsIds:void 0}),(0,i.jsx)(mY,{children:(0,i.jsx)(jY,{customDocument:d.event.customDocument,customFields:d.organization.customFields.nodes,event:d.event,organization:d.organization,volunteerRegistration:d.event.volunteerRegistration})})]})})}),(0,i.jsx)($y,{path:YO.USER_CUSTOM_DOCUMENT_HISTORY({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(vY,{})})]})]})})]})};var yY=t(8962),CY=t.n(yY);const bY=(e,n)=>"base64"===n?new Promise((n,t)=>{const i=new FileReader;i.onload=()=>{n(i.result?.toString()??"")},i.onerror=t,i.readAsDataURL(e)}):new Promise((n,t)=>{const i=new FileReader;i.onload=()=>{const e=new Uint8Array(i.result);n(CY().detect(e)||"UTF-8")},i.onerror=t,i.readAsArrayBuffer(e)}).then(n=>new Promise((t,i)=>{const s=new FileReader;s.onload=()=>t(s.result?.toString()??""),s.onerror=i,s.readAsText(e,n)})),AY=({css:e,label:n,description:t,icon:s,hint:o,maxSize:a,state:r,value:d,placeholder:l,accept:c,format:u,onChange:m,...h})=>{const p=Fi(),I=(0,V.useRef)(null),{inputId:x,descId:f,errorId:_}=Sc(),[j,v]=(0,V.useState)(""),S=(0,V.useMemo)(()=>g(j),[j]);return(0,i.jsxs)(Tl,{css:e,direction:"column",width:1,children:[(0,i.jsx)(bc,{htmlFor:x,isClickable:!1,children:n}),(0,i.jsx)(yc,{id:f,children:t}),(n||t)&&(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Ec,{cursor:"pointer",icon:s,rightIcon:"file",state:r,onClick:()=>{I.current?.click()},children:(0,i.jsxs)(Mr,{color:g(d?.name)?"gray800":"gray500",css:{flex:"1","& input":{display:"none"}},children:[g(d?.name)?d.name:l,(0,i.jsx)("input",{ref:I,accept:xv(c),"aria-describedby":t?f:void 0,"aria-errormessage":"error"===r?_:void 0,"aria-invalid":"error"===r,id:x,type:"file",onChange:async e=>{const n=e.target.files?.[0];n&&("number"==typeof a&&n.size>a?v(p("le_fichier_ne_d_59049",Rv.bytesToMegabytes(a))):(v(""),m({name:n.name,content:await bY(n,u)})))},...h})]})}),(0,i.jsx)(Cc,{id:_,state:S?"error":r,children:S?j:o})]})};var EY=t(3514);function wY(e){return{color:Hu(e.subtitleColor)?e.subtitleColor:"$gray800",fontFamily:e.titleFontFamily||"Open Sans",fontSize:"14px",fontWeight:"700",textTransform:"uppercase"}}const $Y=e=>{const n=Fi();return e.options.showInformations?(0,i.jsxs)(Tl,{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)(Mr,{css:{...wY(e.options),textAlign:"center"},width:1,children:g(e.informationsTitle)?e.informationsTitle:n("informations_22954")}),g(e.informationsContent)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Rf,{text:e.renderText(e.informationsContent)})})})]}):null},TY=e=>(0,i.jsx)(Tl,{css:{paddingTop:e.isAso?"180px":"73px",position:"relative"},direction:"column",gap:"5",width:e.isAso?157:178,children:e.children}),zY=e=>{const n=Fi(),t=ki(Jm),s=e.startDate,o=s.plus({week:1}).minus({day:1}),a=Hu(e.options.headerColor)?e.options.headerColor:"white",r=e.options.showInformations;return(0,i.jsxs)(Tl,{css:{color:Hu(e.options.textColor)?e.options.textColor:"$gray800",background:g(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",pageBreakBefore:"always",position:"relative"},height:If,width:pf,children:[(0,i.jsxs)(Tl,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{css:{color:a,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:n("r_capitulatif_74015",e.delegationCalendar.delegation.name)}),(0,i.jsx)(Mr,{css:{color:a,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:n("du_1_au_2_12974",t.toLocaleString(s,Uo.DateOnly.MonthLong),t.toLocaleString(o,Uo.DateOnly.MonthLong))})]}),(0,i.jsxs)(Tl,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[r&&(0,i.jsx)(TY,{children:(0,i.jsx)($Y,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText})}),(0,i.jsx)(Tl,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(Mr,{width:1,children:e.children})})]})]})},OY=e=>{const n=(0,V.useMemo)(()=>Gu(e.das.accreditation.color),[e.das]),t=(0,V.useMemo)(()=>({background:n[50],border:`1px solid ${n[500]}`,color:n[700]}),[n]);return(0,i.jsxs)(Tl,{align:"start",css:{...t,borderRadius:"$1",minHeight:"32px",padding:"$1 $2"},direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Mr,{css:{fontSize:"10px"},children:["x",e.das.assignedResources]}),(0,i.jsx)(Mr,{fontSize:"textXs",fontWeight:"medium",children:e.das.accreditation.name})]})},RY=e=>(0,i.jsx)(zY,{delegationCalendar:e.delegationCalendar,document:e.document,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(D$,{css:{border:"1px solid $gray200",borderRadius:"$2",height:"100%",overflow:"hidden","& .h-calendar-events-container":{height:"100% !important"}},date:e.startDate,display:"week",maxDate:e.delegationCalendar.endAt,minDate:e.delegationCalendar.startAt,children:e.accreditationsSlotsDates.map((e,n)=>(0,i.jsx)(R$,{endAt:e.accreditationSlot.date,startAt:e.accreditationSlot.date,children:(0,i.jsx)(OY,{das:e})},n))})}),DY=e=>{const{minDate:n,numberOfWeeks:t}=(0,V.useMemo)(()=>{const n=(0,Wg.A)(e.accreditationsSlotsDates.map(e=>e.accreditationSlot.date)).startOf("week"),t=(0,EY.A)(e.accreditationsSlotsDates.map(e=>e.accreditationSlot.date)).endOf("week");return{minDate:n,numberOfWeeks:Math.ceil(t.diff(n,"weeks").weeks)}},[e.accreditationsSlotsDates]);return(0,i.jsx)(i.Fragment,{children:(0,Om.A)(0,t).map(t=>(0,i.jsx)(RY,{accreditationsSlotsDates:e.accreditationsSlotsDates,delegationCalendar:e.delegationCalendar,document:e.document,options:e.options,renderText:e.renderText,startDate:n.plus({week:t})},t))})},MY=e=>{const n=ki(hT),t=e.delegationCalendar.delegation,s=(0,V.useMemo)(()=>t.allAccreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid&&e.assignedResources>0).filter(n=>{if(e.date?.isValid&&e.endDate?.isValid){const t=Oo.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return Oo.IX.fromDateTimes(n.accreditationSlot.date.startOf("day"),n.accreditationSlot.date.endOf("day")).overlaps(t)}return!e.date?.isValid||n.accreditationSlot.date.startOf("day").equals(e.date.startOf("day"))}),[e.date,e.endDate,t]),o=e=>n.renderText(e,{delegation:t});return Yo(s)?(0,i.jsx)(DY,{accreditationsSlotsDates:s,delegationCalendar:e.delegationCalendar,document:e.eventDocument,options:e.options,renderText:o}):(0,i.jsx)(zY,{delegationCalendar:e.delegationCalendar,document:e.eventDocument,options:e.options,renderText:o,startDate:e.delegationCalendar.startAt})},PY=15e5,kY=e=>{const n=Fi();return(0,i.jsx)(ly,{permissions:sy.DOCUMENT_EDIT,children:(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$6",overflowX:"hidden",overflowY:"auto",minWidth:"320px"},direction:"column",width:420,children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:n("param_tres_de_l_11729")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("s_lectionnez_le_59909")}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Tl,{direction:"column",gap:"3",width:1,children:e.children})]})})};function FY(e,n,t,i){const{canDocumentEdit:s}=oy(),{mutate:o}=function(e={}){return Ui("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)}(),[a,r]=(0,V.useState)({...n,...e}),[d,l]=(0,V.useState)(i.informations2Content||""),[c,u]=(0,V.useState)(i.informations2Title||""),[m,g]=(0,V.useState)(i.informationsContent||""),[h,p]=(0,V.useState)(i.informationsTitle||""),[I,x]=(0,V.useState)(i.signature||""),[f,_]=(0,V.useState)(i.title||""),j=(0,V.useCallback)((0,Vm.A)(async(e,n,a,r,d,l,c)=>{s&&await o({eventId:t,id:i.id,eventDocument:{options:e,informations2Content:n,informations2Title:a,informationsContent:r,informationsTitle:d,signature:l,title:c}})},200),[t,i.id,s]);return{eventDocument:{options:a,informations2Content:d,informations2Title:c,informationsContent:m,informationsTitle:h,signature:I,title:f},informations2Content:d,informations2Title:c,informationsContent:m,informationsTitle:h,options:a,signature:I,title:f,setInformations2Content:async e=>{l(e),await j(a,e,c,m,h,I,f)},setInformations2Title:async e=>{u(e),await j(a,d,e,m,h,I,f)},setInformationsContent:async e=>{g(e),await j(a,d,c,e,h,I,f)},setInformationsTitle:async e=>{p(e),await j(a,d,c,m,e,I,f)},setOptions:async e=>{const n={...a,...e};r(n),await j(n,d,c,m,h,I,f)},setSignature:async e=>{x(e),await j(a,d,c,m,h,e,f)},setTitle:async e=>{_(e),await j(a,d,c,m,h,I,e)}}}const NY=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,delegationId:a}}=Kl(),[r,d,l]=Wm(""),{delegationsOptions:c,isLoading:m}=function({delegationsIds:e,eventId:n,hasSelected:t,level:s,nameDebounced:o,organizationId:a}){const{data:r,isLoading:d}=(l={organizationId:a,level:s,eventId:n,hasSelected:t,name:g(o)?o:void 0,ids:e},Li(la,l,[]));var l;const c=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)((r.organization?.list.nodes??[]).concat(r.organization?.selected?.nodes??[]),e=>e.id),e=>u(e.name)),[r.organization]);return{delegationsOptions:(0,V.useMemo)(()=>c.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[c]),isLoading:d}}({organizationId:s,level:xn.Event,eventId:o,hasSelected:!0,delegationsIds:[a],nameDebounced:d});return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_la_06126")}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(_m,{isSearchLoading:m,isSearchVisible:!0,searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:t("rechercher_une_31213"),state:"search",value:r,onChange:l}),values:[a],onChange:t=>{Yo(t)&&n.replace(e.getPath(t[0]))},children:c})}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})},LY=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=oS(["delegation"],{delegationsCustomFields:!1}),{user:a}=Yi(),{eventDocument:r,informationsContent:d,informationsTitle:l,options:c,setInformationsContent:u,setInformationsTitle:m,setOptions:h}=FY(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",showInformations:!1,subtitleColor:"#1d2939",textColor:"#1d2939",titleFontFamily:"Open Sans"},s,{id:e.data.event.document.id,title:e.data.event.document.title,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent}),p=mH();return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:PY,placeholder:n("fond_du_documen_51758"),value:c.background,onChange:e=>{h({background:e})}}),g(c.background?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{h({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Up,{label:"Police",value:c.fontFamily,onChange:e=>{h({fontFamily:e})},children:p}),(0,i.jsx)(Up,{label:n("police_des_titr_37497"),value:c.titleFontFamily,onChange:e=>{h({titleFontFamily:e})},children:p}),(0,i.jsx)(RC,{label:n("couleur_du_text_32021"),value:c.textColor,onChange:e=>{h({textColor:e})}}),(0,i.jsx)(RC,{label:n("couleur_du_cont_17150"),value:c.headerColor,onChange:e=>{h({headerColor:e})}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(np,{value:c.showInformations,onChange:e=>{h({showInformations:e})},children:n("afficher_la_sec_84744")}),c.showInformations&&(0,i.jsxs)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(wc,{label:n("titre_de_la_sec_41575"),value:l,onChange:e=>{m(e)}}),(0,i.jsx)(tS,{initialValue:d,label:n("contenu_de_la_s_43102"),variables:o,onChange:e=>{u(e)}})]})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NY,{downloadPath:Ef(e.data.event.delegation.links.delegationCalendarLink,"pdf",{lang:a?.language}),getPath:e=>YO.DELEGATION_CALENDAR({organizationId:t,eventId:s,delegationId:e})}),(0,i.jsx)(mY,{children:(0,i.jsx)(MY,{delegationCalendar:e.data.event,eventDocument:r,options:c})})]})]})},UY=()=>{const{translate:e,params:{organizationId:n,eventId:t,delegationId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query DelegationCalendarDocument(\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n event(id: $eventId) {\n ...EventDelegationsExport\n ...DocumentDelegationCalendar\n }\n}\n",{eventId:t,delegationId:s,onlyVisible:!WS(n)},[$o.EventDelegationsExportFragment,$o.DocumentDelegationCalendarFragment]);return Au(`${o.name} ${e("planning_des_ac_44426")}`),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.DelegationCalendar,endAt:a.event?.endAt,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,startAt:a.event?.startAt,title:e("planning_des_ac_44426")}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsx)(LY,{data:a})})]})};var VY=t(7957);const BY=e=>{const n=Fi();return(0,i.jsx)(Tl,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:n("planning_1_14391",`${e.eventName} - ${e.segmentName}`)})})},WY=e=>{const n=Fi(),t=ki(Jm),s=(0,fm.A)(e.slots,e=>e.positionId);return(0,i.jsxs)(Tl,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[!0!==e.hideHeader&&(0,i.jsx)(BY,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Tl,{css:{background:"white",padding:"$6",position:"relative"},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{children:[(0,i.jsx)(k$,{width:240,children:n("jour_87026")}),(0,i.jsx)(k$,{width:720,children:t.toLocaleString(e.startDate,Uo.DateOnly.WeekdayLongMonthLong)})]}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(k$,{width:240,children:n("cr_neaux_33401")}),(0,Om.A)(0,6).map(n=>{const t=e.startDate.plus({hour:2*n}),s=t.plus({hour:2}),o=Oo.IX.fromDateTimes(t,s);return(0,i.jsx)(k$,{width:120,children:o.toFormat("HH:mm")},n)})]}),e.positions.map((n,t)=>{const o=s[n.id];return(0,i.jsxs)(V.Fragment,{children:[(0,i.jsxs)(Tl,{children:[(0,i.jsx)(k$,{css:{color:"$gray700",height:"48px"},width:240,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},textAlign:"start",width:1,children:n.name})}),(0,Om.A)(0,6).map(e=>(0,i.jsx)(k$,{css:{height:"48px"},width:120},e))]}),o.map(n=>{const s=n.range.start.diff(e.startDate).shiftTo("hours","minutes"),o=n.range.end.diff(n.range.start).shiftTo("hours","minutes"),a=264+60*s.hours+s.minutes,r=112+48*t,d=60*o.hours+o.minutes,l=`${g(n.name)?`${n.name} - `:""}${n.range.toFormat("HH:mm")}`;return(0,i.jsx)(Tl,{align:"center",css:{background:n.position.color,borderRadius:"$1",color:Uu(n.position.color),fontSize:"$textXs",height:"32px",left:`${a}px`,position:"absolute",top:`${r}px`,width:`${d}px`},children:(0,i.jsx)(Mr,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:l,width:1,children:l})},n.id)})]},n.id)})]})]})},GY=e=>{const n=(0,V.useMemo)(()=>{const n=Ng(e.event.positionsSlots.nodes);if(Yo(n)){const t=Vg(n.map(e=>e.range));let i;return i=8!==t.startHour||20!==t.endHour?n.flatMap(e=>{const n=e.range;return n.start.hour<12&&n.end.hour>=12?[{...e,range:Oo.IX.fromDateTimes(n.start,n.start.set({hour:12,minute:0}))},{...e,range:Oo.IX.fromDateTimes(n.end.set({hour:12,minute:0}),n.end)}]:[e]}):n,i.filter(n=>!e.date?.isValid||n.range.start.startOf("day").equals(e.date.startOf("day")))}return[]},[e.event,e.date]),t=(0,V.useMemo)(()=>Yo(n)?Vg(n.map(e=>e.range)):null,[n]),s=t&&(8!==t.startHour||20!==t.endHour);return(0,i.jsx)(i.Fragment,{children:t?(0,Om.A)(0,t.numberOfDays).map((o,a)=>(0,Om.A)(0,s?2:1).map((r,d)=>{const l=t.startDate.plus({day:o}).set({hour:s?0===d?0:12:8}),c=s?0===d?l.set({hour:12}):l.plus({day:1}).startOf("day"):l.set({hour:20}),u=Oo.IX.fromDateTimes(l,c),m=n.filter(e=>e.range.overlaps(u)),g=(0,Lm.A)((0,Rg.A)(m.map(e=>e.position),e=>e.id),e=>e.name);return Yo(m)?(0,VY.A)(g,11).map((n,t)=>(0,i.jsx)(WY,{eventName:e.event.name,hideHeader:e.hideHeader,positions:n,segmentName:e.event.segment.name,slots:m,startDate:l},`${a}-${d}-${t}`)):null})):!0!==e.hideHeader?(0,i.jsx)(BY,{eventName:e.event.name,segmentName:e.event.segment.name}):null})},qY=e=>{const{history:n,translate:t,params:{segmentId:s}}=Kl();return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_la_43833")}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(_m,{isSearchVisible:!0,values:[s],onChange:t=>{Yo(t)&&n.replace(e.getPath(t[0]))},children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})}),g(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})]})},HY=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query PositionsPlanningDocument($eventId: EventId!, $segmentId: SegmentId!, $date: Date) {\n event(id: $eventId) {\n ...DocumentPositionsPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:t,segmentId:s},[$o.DocumentPositionsPlanningFragment,$o.EventPositionsExportFragment]);return Au(`${o.name} ${e("planning_de_l_96909")}`),(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(uY,{documentType:Ne.Planning,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("planning_de_l_96909")}),(0,i.jsx)(yy,{children:r||(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qY,{getPath:e=>YO.POSITIONS_PLANNING({organizationId:n,eventId:t,segmentId:e}),segmentsFolders:a.event.segmentsFolders}),(0,i.jsx)(mY,{width:1,children:(0,i.jsx)(Mr,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(GY,{event:a.event})})})]})})]})};var YY;function ZY(){return ZY=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>Fg(e.slots.map(({range:e})=>e).reduce((e,n)=>e.union(n),e.slots[0].range)),[e.slots]),o=e.slots[0].range.start,a=n=>(0,Lm.A)(Xg(n,e.slots),[e=>e.position.name.toLowerCase(),e=>e.range.start.toMillis()]);return(0,i.jsxs)(Tl,{css:{background:"white",fontSize:"12px",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(BY,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Tl,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{children:[(0,i.jsx)(k$,{width:200,children:n("jours_88317")}),(0,Om.A)(0,s).map(n=>{const s=o.plus({days:n}),a=Xg(s,e.slots);return(0,i.jsx)(k$,{width:(a.length||1)*XY,children:t.toLocaleString(s,Uo.DateOnly.MonthShort)},n)})]}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(k$,{width:200,children:n("missions_63972")}),(0,Om.A)(0,s).map(n=>{const t=o.plus({days:n}),s=(0,Lm.A)(Object.values((0,fm.A)(Xg(t,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)(L$,{css:{height:"40px"},width:XY},n):s.map(({position:e,numberOfSlots:t})=>{const s=g(e.acronym)?e.acronym:e.name;return(0,i.jsx)(k$,{width:t*XY,children:(0,i.jsx)(Mr,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:s,width:1,children:s})},`${n}-${e.id}`)})})]}),(0,i.jsxs)(Tl,{children:[(0,i.jsx)(k$,{width:200,children:n("cr_neaux_33401")}),(0,Om.A)(0,s).map(e=>{const n=o.plus({days:e}),t=a(n);return 0===t.length?(0,i.jsx)(L$,{css:{height:"40px"},width:XY},e):t.map(n=>(0,i.jsx)(k$,{width:XY,children:n.range.toFormat("HH:mm",{separator:"-"})},`${e}-${n.id}`))})]}),e.volunteersRegistrations.map(e=>{const n=e.userInfo;return(0,i.jsxs)(Tl,{children:[(0,i.jsxs)(F$,{width:200,children:[(0,i.jsx)(t_,{email:n.email,image:n.picture?.url,name:n.name,size:24}),(0,i.jsx)(Mr,{css:{flex:"1",ellipsis:""},title:n.name,children:n.name})]}),(0,Om.A)(0,s).map(n=>{const t=o.plus({days:n}),s=a(t);return 0===s.length?(0,i.jsx)(L$,{width:XY},n):s.map(t=>{const s=`${n}-${t.id}`;return void 0!==e.positionsSlotsUsersInfos.find(({positionSlotId:e})=>e===t.id)?(0,i.jsx)(N$,{width:XY,children:(0,i.jsx)(Mr,{children:(0,i.jsx)(KY,{})})},s):(0,i.jsx)(L$,{width:XY},s)})})]},e.id)})]})]})},JY=e=>{const n=(0,Lm.A)(Ng(e.event.positionsSlots.nodes),e=>e.range.start),t=e.event.volunteersRegistrations.nodes;return(0,i.jsx)(i.Fragment,{children:(0,VY.A)(n,8).map((n,s)=>{const o=n.map(e=>e.id),a=t.filter(e=>{const n=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return(0,mm.A)(o,n).length>0});return(0,VY.A)(a,10).map((t,o)=>(0,i.jsx)(QY,{eventName:e.event.name,segmentName:e.event.segment.name,slots:n,volunteersRegistrations:t},`${s}-${o}`))})})},eZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query PositionsVolunteersPlanningDocument($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n ...DocumentPositionsVolunteersPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:t,segmentId:s},[$o.DocumentPositionsVolunteersPlanningFragment,$o.EventPositionsExportFragment]);return Au(`${o.name} ${e("planning_d_un_g_23684")}`),(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(uY,{documentType:Ne.PositionsVolunteersPlanning,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("planning_d_un_g_23684")}),(0,i.jsx)(yy,{children:r||(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qY,{getPath:e=>YO.POSITIONS_VOLUNTEERS_PLANNING({organizationId:n,eventId:t,segmentId:e}),segmentsFolders:a.event.segmentsFolders}),(0,i.jsx)(mY,{children:(0,i.jsx)(Mr,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(JY,{event:a.event})})})]})})]})},nZ=e=>{const n=Hu(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(Tl,{css:{color:Hu(e.options.textColor)?e.options.textColor:"$gray800",background:g(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",minHeight:`${pf}px`,pageBreakBefore:"always"},direction:"column",width:If,children:[(0,i.jsxs)(Tl,{align:"end",css:{marginTop:"51px",px:"16px"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{css:{color:n,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:e.headerTitle1}),(0,i.jsx)(Mr,{css:{color:n,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:e.headerTitle2})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{css:{minHeight:"971px",paddingBottom:"$6",paddingLeft:"$4",paddingRight:"$4"},gap:"4",width:1,children:(0,i.jsx)(Tl,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"$4"},direction:"column",children:e.children})})]})},tZ=e=>{const n=Fi(),t=ki(CC),s=(0,V.useMemo)(()=>e.slugsToDisplay||[],[e.slugsToDisplay]),o=(0,V.useMemo)(()=>Object.fromEntries(s.flatMap(n=>{const t=e.customFields.find(e=>e.slug===n);return t?[[n,t]]:[]})),[s,e.customFields]),a=(0,V.useMemo)(()=>(0,Lm.A)(e.volunteers,e=>e.userInfo.name),[e.volunteers]);return(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{css:{height:"32px"},children:s.map(e=>{const t=o[e];return"email"===e?(0,i.jsx)(Gm,{children:n("Email")},e):"fullName"===e?(0,i.jsx)(Gm,{children:n("full_name")},e):t?.fileType===en.Picture?(0,i.jsx)(Gm,{width:80,children:t.name},e):"teamCode"===e?(0,i.jsx)(Gm,{children:n("code_quipe_14296")},e):"delegationName"===e?(0,i.jsx)(Gm,{children:n("Delegation")},e):t?(0,i.jsx)(Gm,{children:t.name},e):(0,i.jsx)(Gm,{},e)})}),a.map(e=>{const n=e.userInfo;return(0,i.jsx)(km,{css:{height:"28px"},children:s.map(s=>{const a=o[s];if("email"===s)return(0,i.jsx)($m,{children:n.email},s);if("fullName"===s)return(0,i.jsx)(Gm,{css:{color:"$gray800"},children:n.name},s);if(a?.fileType===en.Picture){const e=t.getValueString(a,n.fields),o=a.fieldProperty===Ke.Picture;return(0,i.jsx)($m,{width:80,children:(g(e)||o)&&(0,i.jsx)(t_,{email:o?n.email:null,image:e,name:o?n.name:null,size:32})},s)}return"teamCode"===s?(0,i.jsx)($m,{children:e.teams.map(e=>e.teamCode).join(", ")},s):"delegationName"===s?(0,i.jsx)($m,{children:e.delegation?.name??""},s):a?(0,i.jsx)($m,{children:t.getValueString(a,n.fields)},s):(0,i.jsx)($m,{},s)})},n.id)})]})},iZ=e=>{const n=Fi(),t=e.documentUsersListing.organization.customFields.nodes,s=(0,V.useMemo)(()=>(0,Lm.A)(e.documentUsersListing.event.volunteersRegistrations.nodes,e=>e.userInfo.name),[e.documentUsersListing.event.volunteersRegistrations.nodes]),o=(0,V.useMemo)(()=>(0,VY.A)(s,30),[s]),a=e.documentUsersListing.event.segment;return Yo(s)?(0,i.jsx)(i.Fragment,{children:o.map((o,r)=>(0,i.jsx)(nZ,{headerTitle1:g(e.eventDocument.title)?e.eventDocument.title:n("liste_des_membr_89037"),headerTitle2:`${a.name} (${s.length})`,options:e.options,children:(0,i.jsx)(Tl,{css:{background:"white"},direction:"column",width:1,children:(0,i.jsx)(tZ,{customFields:t,slugsToDisplay:e.options.slugsToDisplay,volunteers:o})})},r))}):(0,i.jsx)(nZ,{headerTitle1:g(e.eventDocument.title)?e.eventDocument.title:n("liste_des_membr_89037"),headerTitle2:a.name,options:e.options})},sZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{user:o}=Yi(),{eventDocument:a,options:r,title:d,setOptions:l,setTitle:c}=FY(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=mH();return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:PY,placeholder:n("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),g(r.background?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(wc,{label:n("titre_du_docume_33508"),value:d,onChange:e=>{c(e)}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Up,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:u}),(0,i.jsx)(RC,{label:n("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(_m,{isSearchVisible:!0,label:n("champs_affich_17945"),multiple:!0,placeholder:n("champs_affich_17945"),values:r.slugsToDisplay,onChange:e=>{l({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:n("Email")}),(0,i.jsx)("option",{value:"fullName",children:n("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:n("code_quipe_14296")}),(0,i.jsx)("option",{value:"delegationName",children:n("Delegation")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qY,{downloadPath:Ef(e.data.event.segment.links.usersListingLink,"pdf",{lang:o?.language}),getPath:e=>YO.USERS_LISTING({organizationId:t,eventId:s,segmentId:e}),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(mY,{width:1,children:(0,i.jsx)(iZ,{documentUsersListing:e.data,eventDocument:a,options:r})})]})]})},oZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("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:n,eventId:t,segmentId:s},[$o.DocumentUsersListingFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("liste_des_membr_89037")}`),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.VolunteersListing,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("liste_des_membr_89037")}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsx)(sZ,{data:a,eventId:t})})]})},aZ=e=>{const n=ki(CC),t=(0,V.useMemo)(()=>e.customFields.find(n=>n.slug===e.options.customFieldSlug),[e.customFields,e.options.customFieldSlug]);return(0,i.jsx)(Tl,{css:{columnGap:"$2",rowGap:"$3"},wrap:"wrap",children:e.vrs.map(s=>{const o=s.userInfo,a=Qf(o.name,o.email);return(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:84,children:[(0,i.jsx)(Mr,{css:{borderRadius:"$1",overflow:"hidden"},height:84,width:84,children:g(o.picture?.url)?(0,i.jsx)("img",{height:"100%",src:o.picture.url,width:"100%"}):(0,i.jsx)(Tl,{align:"center",css:{background:e_(a)},height:1,justify:"center",width:1,children:(0,i.jsx)(Mr,{font:"white displaySm medium",children:a})})}),(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.lastName,children:(o.lastName||"-").toUpperCase()}),(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.firstName,children:o.firstName||"-"}),t&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0,fontSize:"9px"},title:n.getValueString(t,o.fields)||"-",children:n.getValueString(t,o.fields)||"-"}),e.options.showPhone&&(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0,fontSize:"9px"},title:o.phone?.internationalFormat||"-",children:o.phone?.internationalFormat||"-"})]})]},o.id)})})},rZ=e=>{const n=Fi(),t=e.documentUsersPictures.event.volunteersRegistrations.nodes,s=(0,V.useMemo)(()=>(0,VY.A)(t,48),[t]),o=e.documentUsersPictures.event.segment;return Yo(t)?(0,i.jsx)(i.Fragment,{children:s.map((s,a)=>(0,i.jsx)(nZ,{headerTitle1:g(e.eventDocument.title)?e.eventDocument.title:n("trombinoscope_11316"),headerTitle2:`${o.name} (${t.length})`,options:e.options,children:(0,i.jsx)(aZ,{customFields:e.documentUsersPictures.organization.customFields.nodes,options:e.options,vrs:s})},a))}):(0,i.jsx)(nZ,{headerTitle1:g(e.eventDocument.title)?e.eventDocument.title:n("trombinoscope_11316"),headerTitle2:o.name,options:e.options})},dZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{user:o}=Yi(),{eventDocument:a,options:r,title:d,setOptions:l,setTitle:c}=FY(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=mH();return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:PY,placeholder:n("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),g(r.background?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(wc,{label:n("titre_du_docume_33508"),value:d,onChange:e=>{c(e)}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Up,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:u}),(0,i.jsx)(RC,{label:n("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("champ_suppl_men_12652"),placeholder:n("champ_suppl_men_12652"),values:r.customFieldSlug?[r.customFieldSlug]:[],onChange:e=>{Yo(e)?l({customFieldSlug:e[0]}):l({customFieldSlug:null})},children:e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))}),r.showPhone&&(0,i.jsx)(np,{value:r.showPhone,onChange:e=>{l({showPhone:e})},children:n("afficher_le_num_37843")})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(qY,{downloadPath:Ef(e.data.event.segment.links.usersPicturesLink,"pdf",{lang:o?.language}),getPath:e=>YO.USERS_PICTURES({organizationId:t,eventId:s,segmentId:e}),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(mY,{children:(0,i.jsx)(rZ,{documentUsersPictures:e.data,eventDocument:a,options:r})})]})]})},lZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("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:n,eventId:t,segmentId:s},[$o.DocumentUsersPicturesFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("trombinoscope_11316")}`),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.UsersPictures,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("trombinoscope_11316")}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsx)(dZ,{data:a})})]})},cZ=e=>e.options.showQrCode?(0,i.jsxs)(Tl,{align:"center",css:{background:e.isAso?"transparent":"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Mr,{css:{...wY(e.options),textAlign:"center"},width:1,children:e.isAso?"QR Code pour valider ma prĂ©sence":e.isEtapeTour?"QR Code de prĂ©sence":"QR Code"}),(0,i.jsx)(Tl,{align:"center",css:{background:e.isAso?"white":"transparent",borderRadius:e.isAso?"$1":"none"},height:112,justify:"center",width:112,children:(0,i.jsx)(Mr,{height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:bf(e.ticketId,{height:90,width:90}),width:"100%"})})})]}):null,uZ=e=>{const n=Fi(),t=e.psuis[0].position,s=e.userInfo,o=168===e.organizationId,a=573===e.organizationId,r=858===e.organizationId,d=3676===e.organizationId,l=306===e.organizationId,c=Hu(e.options.headerColor)?e.options.headerColor:"white",u={color:Hu(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:o?"22px":"24px",fontWeight:o?"500":"800",lineHeight:o?"34px":void 0,textAlign:"center"},m=wY(e.options),h=e.options.showInformations||e.options.showInformations2||e.options.showQrCode,p=(0,Rg.A)(t.leaders.concat(t.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Tl,{css:{color:Hu(e.options.textColor)?e.options.textColor:"$gray800",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px","@media print":{breakBefore:"page"},"@media screen":{backgroundColor:t.color,backgroundImage:g(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"repeat-y",backgroundSize:"100% auto",height:`calc-size(auto, round(up, size, ${pf}px))`,width:`${If}px`},"@page":{size:"A4 portrait"}},direction:"column",children:[(0,i.jsx)(Mr,{css:{backgroundColor:t.color,backgroundImage:g(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"no-repeat",backgroundSize:"cover",position:"fixed",left:"0",top:"0",height:vf.A4.height,width:vf.A4.width,zIndex:"-1","@media screen":{display:"none"}}}),(0,i.jsxs)(Tl,{align:"center",css:{marginLeft:"210px",marginTop:"51px"},gap:"4",justify:l?"end":"center",width:568,children:[(0,i.jsxs)(Tl,{align:l?"end":"center",css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Mr,{css:{color:c,fontSize:"14px",fontWeight:"700",lineHeight:"18px"},children:g(e.document.title)?e.document.title:n("Assignments")}),(0,i.jsx)(Mr,{css:{color:c,fontSize:"28px",fontWeight:"700",lineHeight:"38px"},children:s.name})]}),l&&(0,i.jsx)(Mr,{css:{background:`url(${e.userInfo.picture?.url}) no-repeat`,backgroundSize:"contain",borderRadius:"$1",overflowX:"hidden"},height:74,width:74})]}),(0,i.jsx)(Pl,{height:l?"4":"7"}),(0,i.jsxs)(Tl,{css:{paddingLeft:r?"46px":"$4",paddingRight:"$4"},gap:"4",width:1,children:[h&&(0,i.jsxs)(TY,{isAso:r,children:[(0,i.jsx)($Y,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,isAso:r,options:e.options,renderText:e.renderText}),e.options.showInformations2&&(0,i.jsxs)(Tl,{css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Mr,{css:{...m,textAlign:"center"},width:1,children:g(e.document.informations2Title)?e.document.informations2Title:n("informations_se_69499")}),g(e.document.informations2Content)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Rf,{text:e.renderText(e.document.informations2Content)})})})]}),(0,i.jsx)(cZ,{isAso:r,isEtapeTour:d,options:e.options,ticketId:e.volunteerRegistration.ticketId}),r&&e.options.showLeaders&&p[0]&&(0,i.jsxs)(Mr,{css:{position:"absolute",textAlign:"center",top:"710px"},width:1,children:[(0,i.jsx)(Mr,{css:{...wY(e.options),marginBottom:"$1",textAlign:"center"},width:1,children:"TON RESPONSABLE"}),p[0].userInfo.name,(0,i.jsx)("br",{}),p[0].userInfo.phone?.internationalFormat]})]}),(0,i.jsxs)(Tl,{css:{alignSelf:"start",border:"2px solid transparent",background:r?void 0:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"32px 40px"},direction:"column",children:[a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{...u,fontSize:"12px",fontWeight:"700"},children:t.category.name}),(0,i.jsx)(Pl,{height:"1"})]}),(0,i.jsx)(Mr,{css:u,width:1,children:t.name}),e.children]})]})]})},mZ=e=>{const n=Fi(),t=ki(CC),s=ki(hT),o=ki(Di),a=e.psuis[0].position,r=(0,Lm.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),d=168===e.organizationId,l=573===e.organizationId,c=858===e.organizationId,u=2695===e.organizationId,m=426===e.organizationId,h=3618===e.organizationId,p=3676===e.organizationId,I=4372===e.organizationId,x=wY(e.options),f=(0,Rg.A)(a.leaders.concat(a.category.leaders),e=>e.userInfo.id),_="both"===e.options.leadersData||"email"===e.options.leadersData,j="both"===e.options.leadersData||"phone"===e.options.leadersData,v=n=>s.renderText(n,{userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(uZ,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:v,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[e.options.showLeaders&&!l&&!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Mr,{css:{color:Hu(e.options.subtitleColor)?e.options.subtitleColor:"$gray800",fontSize:"14px",fontWeight:"700"},textAlign:"center",width:1,children:[n("ton_responsable_16222",f.length)," ",f.map(e=>(0,kl.A)([e.userInfo.name,_?e.userInfo.email:"",j?e.userInfo.phone?.internationalFormat??"":""]).join(" ")).join(", ")]})]}),(0,i.jsx)(Pl,{height:"7"}),!c&&(0,i.jsxs)(Tl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Mr,{css:x,children:u?"Horaire":p?"Rendez-vous":I?"DĂ©tail de la confĂ©rence":n("date_de_ta_miss_18706")}),(0,i.jsx)(Tl,{direction:"column",gap:"1",children:r.map((e,n)=>{const t=e.range.start,s=e.range.end,a=t.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(Mr,{children:[g(e.name)?`${e.name} | `:"",(0,i.jsx)(mf,{css:{textTransform:"capitalize"},children:t.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})," ","-"," ",(0,i.jsx)(mf,{css:{textTransform:"capitalize"},children:a?s.toFormat("HH:mm"):s.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})]},n)})})]}),c&&(0,i.jsxs)(Tl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Mr,{css:x,children:"Rendez-vous"}),(0,i.jsx)(Tl,{direction:"column",gap:"1",children:r.map((e,n)=>(0,i.jsxs)(Mr,{children:[(0,i.jsx)(mf,{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"),")"]},n))})]}),(0,i.jsxs)(Tl,{direction:"column",children:[g(a.description)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Mr,{css:x,children:u?"Consignes du poste":n("description_de_15187")}),(0,i.jsx)(Mr,{css:{"& .h-rich-text > p":{margin:"0"},"& .h-rich-text figure, & .h-rich-text img":{maxWidth:"100%"}},children:(0,i.jsx)(Rf,{text:a.description})})]})]}),sh(a)&&(0,i.jsxs)(Tl,{css:{"@media print":{breakInside:"avoid",display:"block",overflow:"visible"}},direction:"column",children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{css:x,children:l?"Point de rendez-vous":m?"Lieu du poste":n("lieu_de_rendez_30016")}),th(a)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{children:a.address})]}),ih(a)&&(l||u||h)&&(0,i.jsxs)(Mr,{children:["Point GPS : ",a.latitude,", ",a.longitude]}),ih(a)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsxs)(Tl,{gap:"3",width:1,children:[(0,i.jsx)(Mr,{css:{width:"100%"},height:u?270:180,children:(0,i.jsx)("a",{href:Df(a.latitude,a.longitude),style:{background:`url(${F.HEAVENT_API_URL}/image/event/${e.eventId}/position/${a.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),d&&g(a.fields?.cf44697?.url)&&(0,i.jsx)(Mr,{css:{background:`url(${a.fields.cf44697.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204}),l&&g(a.fields?.cf46814?.url)&&(0,i.jsx)(Mr,{css:{background:`url(${a.fields.cf46814.url}) no-repeat`,backgroundSize:"contain"},height:180,width:1}),c&&g(a.fields?.cf45815?.url)&&(0,i.jsx)(Mr,{css:{background:`url(${a.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]})]}),l&&g(a.fields?.cf46813)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{children:a.fields.cf46813})]})]})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Mr,{css:x,children:"UNE QUESTION OU UN PROBLÈME ?"}),(0,i.jsxs)(Mr,{children:["Nous sommes lĂ  pour vous aider. Contactez votre responsable de secteur :"," ",(0,i.jsxs)(mf,{fontWeight:"bold",children:[f[0]?.userInfo.name," :"," ",f[0]?.userInfo.phone?.internationalFormat]})]})]})]}),e.customFields.map(n=>{const s=t.getValueString(n,a.fields,{fileReturnValue:"url"});return e.options.positionCustomFields?.includes(n.id)&&g(s)?(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Mr,{css:x,children:n.name}),n.fieldType===Qe.File?function(e){const{extension:n}=uv(e);return mv.includes(n)}(t.getValueString(n,a.fields,{fileReturnValue:"name"}))?(0,i.jsx)(Mr,{css:{background:`url(${s}) no-repeat`,backgroundPositionX:"left",backgroundSize:"contain"},height:180,width:1}):(0,i.jsx)(Mr,{css:{wordBreak:"break-word","& > a":{color:"inherit"}},children:(0,i.jsx)("a",{href:s,rel:"noreferrer",target:"_blank",children:s})}):(0,i.jsx)(Mr,{css:{wordBreak:"break-word","& a":{color:"inherit"}},dangerouslySetInnerHTML:{__html:(0,xY.A)(s,{nl2br:!0,target:"_blank"})}})]})]},n.id):null}),g(e.document.signature)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Rf,{text:v(e.document.signature)})})})]}),c&&g(a.fields?.cf24781?.url)&&(0,i.jsxs)(uZ,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:v,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{css:{color:Hu(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Annexe)"}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{css:{background:`url(${a.fields.cf24781.url}) no-repeat`,backgroundSize:"contain"},height:300,width:1})]}),p&&g(a.fields?.cf75967?.url)&&(0,i.jsxs)(uZ,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:v,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{css:{color:Hu(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Plan)"}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{css:{background:`url(${a.fields.cf75967.url}) no-repeat`,backgroundSize:"contain"},height:300,width:1})]}),u&&(0,i.jsx)(uZ,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:v,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsx)(Mr,{css:{background:"url(https://assets.recrewteer.com/badges/velotour/condition_2026.png) no-repeat",backgroundSize:"contain"},height:601})})]})},gZ=e=>{const n=e.assignmentsInfos.event.volunteerRegistration,t=(0,V.useMemo)(()=>zf(n.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())),[n,e.date,e.endDate]),s=(0,V.useMemo)(()=>(0,Lm.A)(Object.entries((0,fm.A)(t,e=>e.position.id)),([e,n])=>(0,Wg.A)(n.map(e=>e.positionSlot.range.start.toMillis()))),[t]);return(0,i.jsx)(i.Fragment,{children:s.map(([t,s],o)=>(0,i.jsx)(mZ,{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:n},o))})},hZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=oS(["user","userRegistration","userDelegation","delegation"],{delegationsCustomFields:!1,usersCustomFields:!1}),{eventDocument:a,informations2Content:r,informations2Title:d,informationsContent:l,informationsTitle:c,options:u,signature:m,title:h,setInformations2Content:p,setInformations2Title:I,setInformationsContent:x,setInformationsTitle:f,setOptions:_,setSignature:j,setTitle:v}=FY(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}),S=mH(),y=(0,V.useMemo)(()=>(0,Lm.A)(e.data.organization.customFields.nodes,e=>e.name.toLowerCase()),[e.data]),C=e.data.organization.userInfo;return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:PY,placeholder:n("fond_du_documen_51758"),value:u.background,onChange:e=>{_({background:e})}}),g(u.background?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{_({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(wc,{label:n("titre_du_docume_33508"),value:h,onChange:e=>{v(e)}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Up,{label:"Police",value:u.fontFamily,onChange:e=>{_({fontFamily:e})},children:S}),(0,i.jsx)(Up,{label:n("police_des_titr_37497"),value:u.titleFontFamily,onChange:e=>{_({titleFontFamily:e})},children:S}),(0,i.jsx)(RC,{label:n("couleur_du_titr_08509"),value:u.titleColor,onChange:e=>{_({titleColor:e})}}),(0,i.jsx)(RC,{label:n("couleur_des_sou_18968"),value:u.subtitleColor,onChange:e=>{_({subtitleColor:e})}}),(0,i.jsx)(RC,{label:n("couleur_du_text_32021"),value:u.textColor,onChange:e=>{_({textColor:e})}}),(0,i.jsx)(RC,{label:n("couleur_du_cont_17150"),value:u.headerColor,onChange:e=>{_({headerColor:e})}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(np,{value:u.showInformations,onChange:e=>{_({showInformations:e})},children:n("afficher_la_sec_84744")}),u.showInformations&&(0,i.jsxs)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(wc,{label:n("titre_de_la_sec_41575"),value:c,onChange:e=>{f(e)}}),(0,i.jsx)(tS,{initialValue:l,label:n("contenu_de_la_s_43102"),variables:o,onChange:e=>{x(e)}})]}),(0,i.jsx)(np,{value:u.showInformations2,onChange:e=>{_({showInformations2:e})},children:n("afficher_la_sec_67554")}),u.showInformations2&&(0,i.jsxs)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(wc,{label:n("titre_de_la_sec_41575"),value:d,onChange:e=>{I(e)}}),(0,i.jsx)(tS,{initialValue:r,label:n("contenu_de_la_s_43102"),variables:o,onChange:e=>{p(e)}})]}),(0,i.jsx)(np,{value:u.showQrCode,onChange:e=>{_({showQrCode:e})},children:n("afficher_le_qr_15635")}),(0,i.jsx)(np,{value:u.showLeaders,onChange:e=>{_({showLeaders:e})},children:n("afficher_les_re_08705")}),u.showLeaders&&(0,i.jsx)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsxs)(Up,{label:n("donn_es_des_res_45809"),value:u.leadersData,onChange:e=>{_({leadersData:e})},children:[(0,i.jsx)("option",{value:"both",children:n("afficher_le_num_37296")}),(0,i.jsx)("option",{value:"phone",children:n("afficher_unique_41829")}),(0,i.jsx)("option",{value:"email",children:n("afficher_unique_97964")}),(0,i.jsx)("option",{value:"none",children:n("afficher_aucune_38167")})]})}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(tS,{initialValue:m,label:n("signature_67521"),variables:o,onChange:e=>{j(e)}}),Yo(y)&&(0,i.jsx)(_m,{label:n("liste_des_champ_40847"),multiple:!0,values:u.positionCustomFields,onChange:e=>{_({positionCustomFields:e})},children:y.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:Ef(C.links?.userAssignmentsLink??"","pdf",{lang:C.language}),getPath:e=>YO.USER_ASSIGNMENTS({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(mY,{children:(0,i.jsx)(gZ,{assignmentsInfos:e.data,eventDocument:a,options:u})})]})]})},pZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("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:n,eventId:t,userInfoId:s},[$o.DocumentUserAssignmentsFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("fiche_d_affecta_91461")}`),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.Assignments,endAt:a.event?.endAt,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,startAt:a.event?.startAt,title:e("fiches_d_affect_98583")}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsx)(hZ,{data:a})})]})},IZ=e=>{const n=Fi(),t=ki(Bg),s=e.options.format===_n.A4Portrait?vf.A4:e.options.format===_n.A5Portrait?vf.A5:vf.A6,o=e.badgeDocumentFragment.volunteerRegistration;return(0,i.jsxs)(Mr,{width:s.width,children:[(0,i.jsxs)(Tl,{css:{background:`linear-gradient(190deg, ${e.options.color} 40%, white 40%)`},direction:"column",height:s.height,width:1,children:[(0,i.jsx)(Mr,{css:{height:"calc(40% - 40px)"}}),(0,i.jsxs)(Tl,{align:"center",direction:"column",width:1,children:[(0,i.jsx)(t_,{email:o.userInfo.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:96}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:o.userInfo.nameOrEmail}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textLg",children:g(e.options.name)?e.options.name:n("membre_45658")})]}),(0,i.jsx)(Mr,{css:{flex:"1"}}),g(e.options.logo?.content)&&(0,i.jsx)(Tl,{height:96,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(Pl,{height:"6"})]}),e.showPageSeparator&&(0,i.jsx)(Mr,{css:{background:"transparent",height:"$space$6"}}),(0,i.jsxs)(Tl,{css:{background:"white",pageBreakBefore:"always",padding:"$4 $6"},direction:"column",height:s.height,width:1,children:[g(e.options.logo?.content)&&(0,i.jsx)(Tl,{height:32,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(Pl,{height:"6"}),!1!==e.options.showAssignments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",children:n("affectation_plural")}),(0,i.jsx)(Pl,{height:"2"}),o.positionsSlotsUsersInfos.map(({position:e,positionSlot:s},o)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",children:n("affectation_n_78121",o+1)}),(0,i.jsxs)(Mr,{color:"gray800",children:[e.name," :"," ",t.toDisplayString(s.range)]}),(0,i.jsx)(Pl,{height:"2"})]},o))]}),g(e.options.infos)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",children:n("renseigements_c_00093")}),(0,i.jsx)(Mr,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]})]})]})},xZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{options:o,setOptions:a}=FY(e.data.event.document.options,{format:_n.A6Portrait,logo:{name:"",content:""},color:Ar.colors.gray900.value,name:"",infos:"",showAssignments:!0},s,{id:e.data.event.document.id}),r=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Up,{label:"Format",value:o.format,onChange:e=>{a({format:e})},children:[(0,i.jsx)("option",{value:_n.A4Portrait,children:"A4"}),(0,i.jsx)("option",{value:_n.A5Portrait,children:"A5"}),(0,i.jsx)("option",{value:_n.A6Portrait,children:"A6"})]}),(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("logo_18191"),maxSize:PY,placeholder:n("logo_18191"),value:o.logo,onChange:e=>{a({logo:e})}}),g(o.logo?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{a({logo:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(RC,{label:n("couleur_de_fond_75677"),value:o.color,onChange:e=>{a({color:e})}}),(0,i.jsx)(wc,{hint:n("ce_nom_sera_sit_11616"),label:n("nom_du_badge_36141"),placeholder:n("membre_45658"),value:o.name,onChange:e=>{a({name:e})}}),(0,i.jsx)(af,{label:n("renseigements_c_00093"),placeholder:n("ex_contact_d_11070"),value:o.infos,onChange:e=>{a({infos:e})}}),(0,i.jsx)(om,{state:o.showAssignments?"checked":"unchecked",onClick:e=>{a({showAssignments:"checked"===e})},children:n("afficher_les_af_46643")})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:Ef(r.links?.userBadgeLink??"","pdf",{lang:r.language}),getPath:e=>YO.USER_BADGE({organizationId:t,eventId:s,userInfoId:e,badgeType:"generic"})}),(0,i.jsx)(mY,{children:(0,i.jsx)(IZ,{badgeDocumentFragment:e.data.event,options:o,showPageSeparator:!0})})]})]})},fZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query UserBadgeDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:t,userInfoId:s},[$o.DocumentUserBadgeFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("BadgeCheck")}`),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.Badge,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("badges_37586")}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsx)(xZ,{data:a})})]})},_Z=e=>{const n=Fi(),t=ki(Jm),s=ki(Bg),o=(0,V.useMemo)(()=>(0,Lm.A)(e.certificateDocumentFragment.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.certificateDocumentFragment.volunteerRegistration]),a=Oo.c9.local(),r=e.certificateDocumentFragment.volunteerRegistration.userInfo,d=g(r.dateOfBirth)&&Oo.c9.fromISO(r.dateOfBirth).isValid,l=g(r.street)&&g(r.city)&&g(r.postalCode);return(0,i.jsxs)(Tl,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"5",width:1,children:[g(e.options.header.content)&&(0,i.jsx)(Mr,{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)(Mr,{color:"gray900",fontSize:"textXl",fontWeight:"semiBold",textAlign:"center",children:n("attestation_de_92734")}),(0,i.jsxs)(Tl,{css:{bd:!0,padding:"$4"},direction:"column",gap:"6",children:[(0,i.jsxs)(Mr,{color:"gray800",fontWeight:"semiBold",children:[n("je_soussign_e_04371",e.options.name)," ",(0,i.jsx)("br",{}),e.options.title]}),(0,i.jsxs)(Mr,{css:{"& > span":{fontWeight:"$semiBold"}},children:[n("certifie_que_13123")," ",(0,i.jsx)("span",{children:r.name}),(0,i.jsx)("br",{}),d&&(0,i.jsxs)(i.Fragment,{children:[n("n_e_le_14393")," ",(0,i.jsx)("span",{children:t.toLocaleString(Oo.c9.fromISO(r.dateOfBirth),Uo.DateOnly.MonthLong)}),(0,i.jsx)("br",{})]}),l&&(0,i.jsxs)(i.Fragment,{children:[n("demeurant_78485")," ",(0,i.jsx)("span",{children:g(r.street)?r.street:""}),(0,i.jsx)("br",{}),n("commune_48881")," ",(0,i.jsx)("span",{children:g(r.city)?r.city:""}),(0,i.jsx)("br",{}),n("code_postal_74563")," ",(0,i.jsx)("span",{children:g(r.postalCode)?r.postalCode:""})]})]}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"semiBold",children:n("a_t_b_n_vole_58773")}),(0,i.jsx)(Mr,{dangerouslySetInnerHTML:{__html:o.map(({position:e,positionSlot:n})=>`${e.name} : ${s.toDisplayString(n.range)}`).join("
")}}),(0,i.jsxs)(Mr,{color:"gray800",css:{whiteSpace:"pre-wrap","& > span":{fontWeight:"$semiBold"}},children:[(0,i.jsx)("span",{children:n("nom_et_adresse_96441")}),(0,i.jsx)("br",{}),e.options.address]}),g(e.options.infos)&&(0,i.jsx)(Mr,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]}),(0,i.jsx)(Mr,{color:"gray800",children:n("atteste_sur_l_h_37408")}),(0,i.jsxs)(eu,{gap:"6",gridtemplatecolumns:"repeat(3, 1fr)",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray800",children:n("signature_67521")}),g(e.options.signature.content)&&(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)("img",{src:e.options.signature.content,width:"100%"})})]}),(0,i.jsx)(Mr,{color:"gray800",children:n("fait_1_39349",e.options.place)}),(0,i.jsx)(Mr,{color:"gray800",children:t.toLocaleString(a,Uo.DateOnly.MonthLong)})]})]})},jZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{options:o,setOptions:a}=FY(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}),r=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsx)(wc,{label:n("full_name"),placeholder:"Antoine Dupont",value:o.name,onChange:e=>{a({name:e})}}),(0,i.jsx)(wc,{label:n("fonction_68322"),placeholder:n("pr_sident_30600"),value:o.title,onChange:e=>{a({title:e})}}),(0,i.jsx)(af,{label:n("nom_et_adresse_81953"),value:o.address,onChange:e=>{a({address:e})}}),(0,i.jsx)(af,{label:n("informations_su_09057"),value:o.infos,onChange:e=>{a({infos:e})}}),(0,i.jsx)(wc,{label:n("lieu_de_l_attes_84804"),placeholder:"Montpellier",value:o.place,onChange:e=>{a({place:e})}}),(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",hint:n("taille_de_l_ima_12660","682x260px"),label:n("en_t_te_11987"),maxSize:PY,placeholder:n("en_t_te_11987"),value:o.header,onChange:e=>{a({header:e})}}),g(o.header?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{a({header:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("signature_67521"),maxSize:PY,placeholder:n("signature_67521"),value:o.signature,onChange:e=>{a({signature:e})}}),g(o.signature?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{a({signature:{name:"",content:""}})},children:n("r_initialiser_77538")})]})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:Ef(r.links?.userCertificateLink??"","pdf",{lang:r.language}),getPath:e=>YO.USER_CERTIFICATE({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(mY,{children:(0,i.jsx)(_Z,{certificateDocumentFragment:e.data.event,options:o})})]})]})},vZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("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:n,eventId:t,userInfoId:s},[$o.OrganizationCertificateDefaultFragment,$o.DocumentUserCertificateFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("Certificate")}`),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.Certificate,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("attestations_98371")}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsx)(jZ,{data:a})})]})},SZ=e=>{const{translate:n,params:{organizationId:t,eventId:s,badgeType:o}}=Kl(),{options:a,setOptions:r}=FY(e.event.document.options,o===Ae.T24assignment?{logo:{name:"",content:""}}:{habits:""},s,{id:e.event.document.id}),d=e.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[o===Ae.Asoassignment&&(0,i.jsx)(kY,{children:(0,i.jsx)(tS,{initialValue:a.habits,label:"Habitudes",onChange:e=>{r({habits:e})}})}),o===Ae.T24assignment&&(0,i.jsx)(kY,{children:(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("logo_18191"),maxSize:PY,placeholder:n("logo_18191"),value:a.logo,onChange:e=>{r({logo:e})}})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:Ef(d.links?.userCustomBadgeLinks?.[o]||"","pdf",{lang:d.fields?.language?.rawValue}),getPath:e=>YO.USER_BADGE({organizationId:t,eventId:s,userInfoId:e,badgeType:o})}),(0,i.jsx)(mY,{children:D_(o,e.event,a,null)})]})]})},yZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s,badgeType:o}}=Kl(),{data:a,loader:r}=Li("query UserCustomBadgeDocument(\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customBadge: CustomBadge!\n) {\n event(id: $eventId) {\n ...DocumentUserCustomBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:t,userInfoId:s,customBadge:o},[$o.DocumentUserCustomBadgeFragment,$o.EventVolunteersExportFragment]);return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{badgeType:o,documentType:Ne.CustomBadge,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:o===Ae.Paris20kmassignment,showStrategy:!0,title:e("badge_1_89709",M_(o))}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsx)(SZ,{event:a.event})})]})},CZ=e=>{const n=Fi(),t=ki(Jm),s=ki(Xb),o=(0,V.useMemo)(()=>e.psuis.filter(n=>n.positionSlot.range.start.startOf("day").toMillis()===e.day.toMillis()),[e.day,e.psuis]),a=(0,V.useMemo)(()=>(0,ES.A)(o,e=>e.timeDifferenceMinutes),[o]);return(0,i.jsxs)(Tl,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Mr,{css:{padding:"$3 $4",textTransform:"capitalize"},font:"gray800 textSm semiBold",children:t.toLocaleString(e.day,Uo.DateOnly.WeekdayLongMonthLong)}),(0,i.jsxs)(ym,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(jm,{css:{height:"32px"},children:[(0,i.jsx)(Gm,{children:n("nom_de_la_missi_64605")}),(0,i.jsxs)(Gm,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(Mr,{children:n("d_but_41840")}),(0,i.jsx)(Mr,{css:{fontSize:"8px"},children:n("_point_missi_66864")})]}),(0,i.jsxs)(Gm,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(Mr,{children:n("fin_60104")}),(0,i.jsx)(Mr,{css:{fontSize:"8px"},children:n("_point_missi_66864")})]}),(0,i.jsx)(Gm,{width:120,children:n("pause_46709")}),(0,i.jsx)(Gm,{width:120,children:n("total_07173")})]}),o.map((n,o)=>(0,i.jsxs)(km,{css:{height:"32px"},children:[(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:n.position.name})}),(0,i.jsxs)($m,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(Mr,{children:n.checkInAt?.isValid?t.toLocaleString(n.checkInAt.setZone(e.timeZone),Uo.TimeOnly):"-"}),(0,i.jsx)(Mr,{css:{fontSize:"8px"},children:t.toLocaleString(n.positionSlot.range.start,Uo.TimeOnly)})]}),(0,i.jsxs)($m,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(Mr,{children:n.checkOutAt?.isValid?t.toLocaleString(n.checkOutAt.setZone(e.timeZone),Uo.TimeOnly):"-"}),(0,i.jsx)(Mr,{css:{fontSize:"8px"},children:t.toLocaleString(n.positionSlot.range.end,Uo.TimeOnly)})]}),(0,i.jsx)($m,{css:{color:"$gray500"},width:120,children:n.breakTime>0?s.minutesToHoursMinutesString(n.breakTime):"-"}),(0,i.jsx)($m,{css:{color:"$gray500"},justify:"end",width:120,children:s.minutesToHoursMinutesString(n.timeDifferenceMinutes)})]},o)),(0,i.jsxs)(jm,{css:{borderBottom:"none",height:"32px"},children:[(0,i.jsx)(Gm,{children:(0,i.jsx)(Mr,{font:"gray800 textXs semiBold",children:n("total_de_la_jou_73634")})}),(0,i.jsx)(Gm,{justify:"end",width:120,children:(0,i.jsx)(Mr,{font:"gray800 textXs semiBold",children:s.minutesToHoursMinutesString(a)})})]})]})]})},bZ=e=>{const n=Fi(),t=ki(Xb),s=e.event.volunteerRegistration,o=s.userInfo,a=(0,V.useMemo)(()=>zf(s.positionsSlotsUsersInfos,e.date,null),[s.positionsSlotsUsersInfos]),r=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)(a.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),[a]),d=(0,V.useMemo)(()=>(0,ES.A)(a,e=>e.timeDifferenceMinutes),[a]);return(0,i.jsx)(nZ,{headerTitle1:`${g(e.eventDocument.title)?e.eventDocument.title:n("UserHours")} ${o.name}`,headerTitle2:n("total_d_heures_11826",t.minutesToHoursMinutesString(d)),options:e.options,children:(0,i.jsx)(Tl,{direction:"column",gap:"4",width:1,children:r.map(n=>(0,i.jsx)(CZ,{day:n,psuis:a,timeZone:e.event.timeZone},n.toMillis()))})})},AZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{eventDocument:o,options:a,title:r,setOptions:d,setTitle:l}=FY(e.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",textColor:"#1d2939",title:""},s,{id:e.event.document.id}),c=mH(),u=e.event.volunteerRegistration.userInfo,m=u.links?.userHoursLink??"";return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:PY,placeholder:n("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),g(a.background?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(wc,{label:n("titre_du_docume_33508"),value:r,onChange:e=>{l(e)}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Up,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:c}),(0,i.jsx)(RC,{label:n("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:Ef(m,"pdf",{lang:u.language}),getPath:e=>YO.USER_HOURS({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(mY,{children:(0,i.jsx)(bZ,{event:e.event,eventDocument:o,options:a})})]})]})},EZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query UserHoursDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUsersHours\n ...EventVolunteersExport\n }\n}\n",{eventId:t,userInfoId:s},[$o.DocumentUsersHoursFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("UserHours")}`),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.UserHours,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,title:e("UserHours")}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:r||(0,i.jsx)(AZ,{event:a.event})})]})},wZ=e=>{const n=Fi(),t=ki(Jm),s=e.event.volunteerRegistration,o=s.userInfo,a=(0,V.useMemo)(()=>(0,Dg.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start)),[s.positionsSlotsUsersInfos]),r=(0,V.useMemo)(()=>(0,Mg.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.end)),[s.positionsSlotsUsersInfos]),d=(0,V.useMemo)(()=>(0,Lm.A)(Object.entries((0,fm.A)(s.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e,n])=>n[0].positionSlot.range.start.startOf("day").toMillis()).map(([e,n])=>{const i=n[0],s=(0,Lm.A)(Object.values((0,fm.A)(n,e=>e.position.id)),e=>(0,Wg.A)(e.map(e=>e.positionSlot.range.start.toMillis()))).map(e=>{const n=e[0].position,t=(0,Lm.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===n.organizationId&&g(n.address)?` (${n.address})`:"";return`${n.name} : ${t}${i}`});return[t.toLocaleString(i.positionSlot.range.start.startOf("day"),Uo.DateOnly.WeekdayLongMonthLong),s]}),[s.positionsSlotsUsersInfos]);return(0,i.jsxs)(Tl,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[g(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(Pl,{height:"7"})]}),(0,i.jsxs)(Tl,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Mr,{font:"primary800 displayXs semiBold",children:o.nameOrEmail}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray800",children:n("p_riode_du_1_89633",t.toLocaleString(a,Uo.DateTime),t.toLocaleString(r,Uo.DateTime))}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Tl,{direction:"column",gap:"4",children:d.map(([e,n],t)=>(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{css:{textTransform:"capitalize"},font:"gray800 textSm bold",children:e}),(0,i.jsx)(Tl,{direction:"column",children:n.map((e,n)=>(0,i.jsx)(Mr,{children:e},n))})]},t))})]})]})},$Z=e=>{const n=Fi(),t=e.event.volunteerRegistration,s=t.userInfo;return Yo(t.positionsSlotsUsersInfos)?(0,i.jsx)(wZ,{...e}):(0,i.jsxs)(Tl,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[g(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(Pl,{height:"7"})]}),(0,i.jsxs)(Tl,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Mr,{font:"primary800 displayXs semiBold",children:s.nameOrEmail}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray800",children:n("aucune_affectat_04761")})]})]})},TZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{options:o,setOptions:a}=FY(e.data.event.document.options,{logo:{name:"",content:""}},s,{id:e.data.event.document.id}),r=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(kY,{children:(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("logo_18191"),maxSize:PY,placeholder:n("logo_18191"),value:o.logo,onChange:e=>{a({logo:e})}})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:Ef(r.links?.userPlanningDaysLink??"","pdf",{lang:r.language}),getPath:e=>YO.USER_PLANNING_DAYS({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(mY,{children:(0,i.jsx)($Z,{event:e.data.event,options:o})})]})]})},zZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query UserPlanningDaysDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningDays\n ...EventVolunteersExport\n }\n}\n",{eventId:t,userInfoId:s},[$o.DocumentUserPlanningDaysFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("UserPlanningDays")}`),(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(uY,{documentType:Ne.UserPlanningDays,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("plannings_indiv_39650")}),(0,i.jsx)(yy,{children:r||(0,i.jsx)(TZ,{data:a})})]})},OZ=e=>{const n=Fi(),t=ki(Jm),s=e.event.volunteerRegistration,o=s.userInfo,a=e.startDate?Oo.c9.max(e.startDate,e.event.startAt):e.event.startAt,r=e.startDate?Oo.c9.min(e.startDate.plus({week:1}).minus({day:1}),e.event.endAt):e.event.endAt,d=Hu(e.options.headerColor)?e.options.headerColor:"white",l=e.options.showInformations||e.options.showQrCode;return(0,i.jsxs)(Tl,{css:{color:Hu(e.options.textColor)?e.options.textColor:"$gray800",background:g(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",pageBreakBefore:"always",position:"relative"},height:If,width:pf,children:[(0,i.jsxs)(Tl,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{css:{color:d,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:n("planning_indivi_05075",o.nameOrEmail)}),(0,i.jsx)(Mr,{css:{color:d,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:n("du_1_au_2_12974",t.toLocaleString(a,Uo.DateOnly.MonthLong),t.toLocaleString(r,Uo.DateOnly.MonthLong))})]}),(0,i.jsxs)(Tl,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[l&&(0,i.jsxs)(TY,{children:[(0,i.jsx)($Y,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText}),(0,i.jsx)(cZ,{isAso:!1,isEtapeTour:!1,options:e.options,ticketId:s.ticketId})]}),(0,i.jsx)(Tl,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(Mr,{width:1,children:e.children})})]})]})},RZ=e=>{const n=Fi(),t=ki(Bg),s=(0,V.useMemo)(()=>{const n=Gu(e.psui.position.color);return{background:n[50],color:n[700]}},[e.psui]),o=(0,V.useMemo)(()=>"number"==typeof e.startHour&&e.startHour>0&&e.psui.positionSlot.range.start.hour{const i=e.psui.positionSlot.range.start.day===e.psui.positionSlot.range.end.day,s=Zg(t,e.psui.positionSlot,"",{interval:{options:i?{hideDate:!0}:{formats:{localeFormat:{day:"numeric",month:"numeric"}}}},slot:{includeRange:!0}});return o?`${s} ${n("j_1_51317")}`:s},[e.psui,o]);return(0,i.jsxs)(Tl,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(Mr,{css:{fontSize:"10px"},children:a}),(0,i.jsx)(Mr,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]})},DZ=e=>(0,i.jsx)(OZ,{document:e.document,event:e.event,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(D$,{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((n,t)=>(0,i.jsx)(R$,{endAt:n.range.start,startAt:n.range.start,startHour:e.startHour,children:(0,i.jsx)(RZ,{psui:n,startHour:e.startHour})},t))})}),MZ=e=>{const{minDate:n,numberOfWeeks:t}=(0,V.useMemo)(()=>{const n=(0,Wg.A)(e.assignments.map(e=>e.positionSlot.range.start)).startOf("week"),t=(0,EY.A)(e.assignments.map(e=>e.positionSlot.range.end)).endOf("week");return{minDate:n,numberOfWeeks:Math.ceil(t.diff(n,"weeks").weeks)}},[e.assignments]);return(0,i.jsx)(i.Fragment,{children:(0,Om.A)(0,t).map(t=>(0,i.jsx)(DZ,{assignments:e.assignments,document:e.eventDocument,event:e.event,options:e.options,renderText:e.renderText,startDate:n.plus({week:t}),startHour:e.startHour},t))})},PZ=e=>{const n=ki(hT),[t]=(0,V.useMemo)(()=>Yg(e.event.dayStartTime),[e.event.dayStartTime]),s=(0,V.useMemo)(()=>{const n=Lg(e.event.volunteerRegistration.positionsSlotsUsersInfos.map(e=>({...e,range:e.positionSlot.range})),e.event.startAt,e.event.endAt,t);return(0,Lm.A)(zf(n,e.date,e.endDate),e=>e.positionSlot.range.start.toMillis())},[e.event,t]),o=t=>n.renderText(t,{userInfo:e.event.volunteerRegistration.userInfo,volunteerRegistration:e.event.volunteerRegistration});return Zo(s)?(0,i.jsx)(OZ,{document:e.eventDocument,event:e.event,options:e.options,renderText:o}):(0,i.jsx)(MZ,{assignments:s,event:e.event,eventDocument:e.eventDocument,options:e.options,renderText:o,startHour:t})},kZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=oS(["user","userRegistration","userDelegation","delegation"],{delegationsCustomFields:!1,usersCustomFields:!1}),{eventDocument:a,informationsTitle:r,informationsContent:d,options:l,setOptions:c,setInformationsTitle:u,setInformationsContent:m}=FY(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=mH(),p=e.data.event?.volunteerRegistration.userInfo,I=p.links?.userPlanningLink??"";return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:PY,placeholder:n("fond_du_documen_51758"),value:l.background,onChange:e=>{c({background:e})}}),g(l.background?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{c({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Up,{label:"Police",value:l.fontFamily,onChange:e=>{c({fontFamily:e})},children:h}),(0,i.jsx)(Up,{label:n("police_des_titr_37497"),value:l.titleFontFamily,onChange:e=>{c({titleFontFamily:e})},children:h}),(0,i.jsx)(RC,{label:n("couleur_des_sou_18968"),value:l.subtitleColor,onChange:e=>{c({subtitleColor:e})}}),(0,i.jsx)(RC,{label:n("couleur_du_text_32021"),value:l.textColor,onChange:e=>{c({textColor:e})}}),(0,i.jsx)(RC,{label:n("couleur_du_cont_17150"),value:l.headerColor,onChange:e=>{c({headerColor:e})}}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(np,{value:l.showInformations,onChange:e=>{c({showInformations:e})},children:n("afficher_la_sec_84744")}),l.showInformations&&(0,i.jsxs)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(wc,{label:n("titre_de_la_sec_41575"),value:r,onChange:e=>{u(e)}}),(0,i.jsx)(tS,{initialValue:d,label:n("contenu_de_la_s_43102"),variables:o,onChange:e=>{m(e)}})]}),(0,i.jsx)(np,{value:l.showQrCode,onChange:e=>{c({showQrCode:e})},children:n("afficher_le_qr_15635")})]}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:Ef(I,"pdf",{lang:p?.language}),getPath:e=>YO.USER_PLANNING({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(mY,{children:(0,i.jsx)(PZ,{event:e.data.event,eventDocument:a,options:l})})]})]})},FZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query UserPlanningDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanning\n ...EventVolunteersExport\n\n startAt\n endAt\n }\n}\n",{eventId:t,userInfoId:s},[$o.DocumentUserPlanningFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("UserPlanning")}`),(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(uY,{documentType:Ne.UserPlanning,endAt:a.event?.endAt,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,startAt:a.event?.startAt,title:e("plannings_indiv_80073")}),(0,i.jsx)(yy,{children:r||(0,i.jsx)(kZ,{data:a})})]})},NZ=e=>{const n=Fi(),t=ki(Bg);return(0,i.jsxs)(Tl,{css:{background:"$gray100",padding:"$4 56px"},direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textXl semiBold",children:n("planning_1_14391",e.nameOrEmail)}),e.interval&&(0,i.jsxs)(Tl,{gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",children:n("plage_de_dates_08875")}),(0,i.jsx)(Mr,{color:"gray500",children:t.toDisplayString(e.interval,{formats:{displayWeekday:!0},hideTime:!0})})]}),(0,i.jsxs)(Tl,{gap:"1",children:[(0,i.jsx)(Mr,{color:"gray800",children:n("nombre_d_affect_01587")}),(0,i.jsx)(Mr,{color:"gray500",children:e.numberOfAssignments})]})]})};var LZ=t(791);const UZ=e=>{const n=Fi(),t=ki(Jm),s=ki(Xb);return(0,i.jsx)(Tl,{css:{padding:"$6 $8"},children:(0,i.jsxs)(ym,{children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{css:{px:"$3"},children:n("nom_de_la_missi_64605")}),(0,i.jsx)(Gm,{css:{px:"$3"},width:380,children:n("Date")}),e.showHours&&(0,i.jsx)(Gm,{css:{px:"$3"},width:120,children:n("total_07173")})]}),e.assignments.map((n,o)=>{const a=Yo(n.slotsNames),r=(0,LZ.A)(n.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(km,{css:{height:a?"54px":"44px"},children:[(0,i.jsx)($m,{align:"center",css:{px:"$3"},children:(0,i.jsx)(Mr,{css:{clamp:"2"},font:"gray900 textSm medium",title:n.name,width:1,children:n.name})}),(0,i.jsxs)($m,{css:{px:"$3"},direction:"column",gap:"1",justify:"center",width:380,children:[a&&(0,i.jsx)(Mr,{color:"gray900",width:1,children:n.slotsNames.join(", ")}),(0,i.jsxs)(Mr,{width:1,children:[(0,au.A)(t.toLocaleString(n.ranges[0].start,Uo.DateOnly.WeekdayShortMonthLong))," ",n.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),e.showHours&&(0,i.jsx)($m,{css:{px:"$3"},width:120,children:s.minutesToHoursMinutesString(r)})]},o)})]})})},VZ=e=>{const n=(0,V.useMemo)(()=>{return n=zf(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,e.endDate),(0,Lm.A)(Object.entries((0,fm.A)(n,e=>`${e.position.name}-${e.positionSlot.range.start.startOf("day").toMillis()}`)).map(([e,n])=>{const t=(0,Lm.A)(n,e=>e.positionSlot.range.start.toMillis());return{name:n[0].position.name,ranges:t.map(e=>e.positionSlot.range),slotsNames:(0,kl.A)((0,wo.A)(t.map(({positionSlot:e})=>e.name)))}}),({ranges:e})=>e[0].start.toMillis());var n},[e.event.volunteerRegistration,e.date]);return(0,i.jsx)(i.Fragment,{children:(0,VY.A)(n,20).map((n,t)=>{const s=n.flatMap(e=>e.ranges),o=(0,Dg.A)(s.map(e=>e.start),e=>e.toMillis()),a=(0,Mg.A)(s.map(e=>e.end),e=>e.toMillis()),r=Oo.IX.fromDateTimes(o,a);return(0,i.jsxs)(Tl,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(NZ,{interval:r,nameOrEmail:e.event.volunteerRegistration.userInfo.nameOrEmail,numberOfAssignments:n.flatMap(e=>e.ranges).length}),(0,i.jsx)(UZ,{assignments:n,showHours:e.options.showHours})]},t)})})},BZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{options:o,setOptions:a}=FY(e.data.event.document.options,{showHours:!0},s,{id:e.data.event.document.id}),r=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(kY,{children:(0,i.jsx)(om,{state:o.showHours?"checked":"unchecked",onClick:e=>{a({showHours:"checked"===e})},children:n("afficher_le_tot_23855")})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ny,{downloadPath:Ef(r.links?.userPlanningListLink??"","pdf",{lang:r.language}),getPath:e=>YO.USER_PLANNING_LIST({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(mY,{width:1,children:(0,i.jsx)(VZ,{event:e.data.event,options:o})})]})]})},WZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query UserPlanningListDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningList\n ...EventVolunteersExport\n\n startAt\n endAt\n }\n}\n",{eventId:t,userInfoId:s},[$o.DocumentUserPlanningListFragment,$o.EventVolunteersExportFragment]);return Au(`${o.name} ${e("UserPlanningList")}`),(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(uY,{documentType:Ne.UserPlanningList,endAt:a.event?.endAt,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,startAt:a.event?.startAt,title:e("plannings_indiv_97766")}),(0,i.jsx)(yy,{children:r||(0,i.jsx)(BZ,{data:a})})]})};var GZ=t(6965);const qZ=e=>{const n=ki(Bg),t=(0,V.useMemo)(()=>{const n=e.slot.range.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*n.hours+n.minutes)},[e.slot,e.startOfDay]),s=(0,V.useMemo)(()=>{const n=e.slot.range.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*n.hours+n.minutes)},[e.slot,e.startOfDay]),o=(0,V.useMemo)(()=>Zg(n,e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsx)(Tl,{align:"center",css:{background:e.palette[50],border:`1px solid ${e.palette[500]}`,borderRadius:"$1",color:e.palette[700],fontSize:"10px",fontWeight:"500",gridColumnStart:t,gridColumnEnd:s,px:"$2"},height:20,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},width:1,children:o})},e.slot.id)},HZ=e=>{const n=(0,V.useMemo)(()=>e.slots.filter(n=>e.volunteerRegistration.positionsSlotsUsersInfos.some(e=>e.positionSlotId===n.id)),[e.slots,e.volunteerRegistration]);return(0,i.jsxs)(Tl,{css:{borderBottom:"1px solid $gray200",minHeight:"28px"},width:1,children:[(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",color:"$gray700",fontSize:"12px",fontWeight:"500",px:"$4"},width:180,children:e.volunteerRegistration.userInfo.name}),(0,i.jsx)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",color:"$gray700",fontSize:"12px",fontWeight:"500",px:"$4"},width:150,children:e.volunteerRegistration.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(Tl,{css:{flex:"1",py:"2px",position:"relative"},children:(0,i.jsx)(eu,{align:"center",css:{gridAutoFlow:"column",overflow:"hidden",rowGap:"2px"},gridtemplatecolumns:"repeat(1440, 1fr)",width:1,children:n.map(n=>(0,i.jsx)(qZ,{palette:e.palette,slot:n,startOfDay:e.startOfDay},n.id))})})]})},YZ=e=>{const n=Fi(),t=ki(Jm),s=Hu(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(Tl,{css:{background:g(e.options.background?.content)?`url(${e.options.background.content})`:e.position.color,backgroundRepeat:"no-repeat",backgroundSize:"cover",padding:"$7"},direction:"column",gap:"7",height:hf,width:gf,children:[(0,i.jsxs)(Tl,{justify:"between",children:[(0,i.jsx)(Mr,{height:65,children:g(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsxs)(Tl,{align:"end",css:{paddingTop:"26px"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Mr,{css:{color:s,fontSize:"13px",fontWeight:"700"},children:n("planning_missio_08082",e.position.name)}),(0,i.jsx)(Mr,{css:{color:s,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:t.toLocaleString(e.day,Uo.DateOnly.WeekdayLongMonthLong)})]})]}),(0,i.jsx)(Tl,{css:{background:"white",borderRadius:"$1",flex:"1",overflow:"hidden"},direction:"column",children:(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsxs)(Tl,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(Tl,{css:{borderRight:"1px solid $gray200"},width:180}),(0,i.jsx)(Tl,{css:{borderRight:"1px solid $gray200"},width:150}),(0,i.jsx)(Tl,{css:{flex:"1"},children:(0,i.jsxs)(eu,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(Mr,{css:{gridColumn:"span 60"}}),(0,Om.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(Tl,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,GZ.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.volunteersRegistrations.map(n=>(0,i.jsx)(HZ,{palette:e.palette,slots:e.slots,startOfDay:e.startOfDay,volunteerRegistration:n},n.id))]})})]})},ZZ=e=>{const n=e.event.position,t=(0,V.useMemo)(()=>{const n=Yg(e.event.dayStartTime);return n?.[0]??0},[e.event.dayStartTime]),s=(0,V.useMemo)(()=>Gu(n.color),[n.color]),o=(0,V.useMemo)(()=>Lg(n.slots,e.event.startAt,e.event.endAt,t).filter(n=>{if(e.date?.isValid&&e.endDate?.isValid){const t=Oo.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return n.range.overlaps(t)}return!e.date?.isValid||n.range.start.startOf("day").equals(e.date.startOf("day"))}),[e.date,e.endDate,e.event,n,t]),a=(0,V.useMemo)(()=>Math.ceil(e.event.endAt.plus({day:1}).diff(e.event.startAt,"days").days),[e.event.startAt,e.event.endAt]);return(0,i.jsx)(i.Fragment,{children:(0,Om.A)(0,a).map(a=>{const r=e.event.startAt.plus({day:a}).set({hour:t}),d=Oo.IX.fromDateTimes(r,r.plus({day:1})),l=o.filter(e=>d.engulfs(e.range));if(Yo(l)){const o=l.map(e=>e.id),d=e.event.volunteersRegistrations.nodes.filter(e=>{const n=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return Yo((0,mm.A)(o,n))});return(0,i.jsx)(V.Fragment,{children:(0,VY.A)(d,33).map((o,d)=>(0,i.jsx)(YZ,{day:r,options:e.options,palette:s,position:n,slots:l,startHour:t,startOfDay:r,volunteersRegistrations:o},`${a}-${d}`))},a)}return null})})};const KZ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,positionId:a}}=Kl(),[r,d,l]=Wm(""),{positionsOptions:c,isLoading:m}=function({eventId:e,hasSelected:n,nameDebounced:t,organizationId:s,positionsIds:o}){const{data:a,isLoading:r}=(d={organizationId:s,eventId:e,hasSelected:n,name:g(t)?t:void 0,ids:o},Li(ca,d,[]));var d;const l=(0,V.useMemo)(()=>(0,Lm.A)((0,Rg.A)((a.organization?.list.nodes??[]).concat(a.organization?.selected?.nodes??[]),e=>e.id),e=>u(e.name)),[a.organization]);return{positionsOptions:(0,V.useMemo)(()=>l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[l]),isLoading:r}}({organizationId:s,eventId:o,hasSelected:!0,positionsIds:[a],nameDebounced:d});return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_la_94895")}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(_m,{isSearchLoading:m,isSearchVisible:!0,searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),state:"search",value:r,onChange:l}),values:[a],onChange:t=>{Yo(t)&&n.replace(e.getPath(t[0]))},children:c})}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})},XZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{user:o}=Yi(),{options:a,setOptions:r}=FY(e.data.event.document.options,{background:{name:"",content:""},headerColor:"#ffffff",logo:{name:"",content:""}},s,{id:e.data.event.document.id});return(0,i.jsxs)(Tl,{css:{flex:"1"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:PY,placeholder:n("fond_du_documen_51758"),value:a.background,onChange:e=>{r({background:e})}}),g(a.background?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(AY,{accept:gv.Images,format:"base64",label:n("logo_18191"),maxSize:PY,placeholder:n("logo_18191"),value:a.logo,onChange:e=>{r({logo:e})}}),g(a.logo?.name)&&(0,i.jsx)(Mr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({logo:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(RC,{label:n("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{r({headerColor:e})}})]}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(KZ,{downloadPath:Ef(e.data.event.position.links.positionPlanningLink,"pdf",{lang:o?.language}),getPath:e=>YO.POSITION_PLANNING({organizationId:t,eventId:s,positionId:e})}),(0,i.jsx)(mY,{css:{justifyContent:"start",overflowX:"auto","& > div":{overflowX:"auto"}},width:gf,children:(0,i.jsx)(ZZ,{event:e.data.event,options:a})})]})]})},QZ=()=>{const{translate:e,params:{organizationId:n,eventId:t,positionId:s}}=Kl(),{event:o}=BS(),{data:a,loader:r}=Li("query PositionPlanningDocument($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n ...DocumentPositionPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:t,positionId:s},[$o.DocumentPositionPlanningFragment,$o.EventPositionsExportFragment]);return Au(`${o.name} ${e("planning_d_une_64581")}`),(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(uY,{documentType:Ne.PositionPlanning,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,title:e("planning_d_une_64581")}),(0,i.jsx)(yy,{children:r||(0,i.jsx)(XZ,{data:a})})]})},JZ=e=>{const n=Fi(),t=g(e.acronym)?`${e.name} (${e.acronym})`:e.name;return(0,i.jsxs)(Tl,{css:{background:"$gray100",padding:"$7 56px"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayXs",fontWeight:"medium",children:t}),(0,i.jsx)(Mr,{color:"gray800",children:n("fiche_de_missio_00324")})]})},eK=e=>{const n=Fi(),{isRenamed:t,finalName:s,rangeString:o}=KR(e.slot);return(0,i.jsx)(i.Fragment,{children:(0,VY.A)(e.volunteers,30).map((a,r)=>(0,i.jsxs)(Tl,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(JZ,{acronym:e.positionAcronym,name:e.positionName}),(0,i.jsxs)(Tl,{css:{padding:"$7 56px"},direction:"column",gap:"3",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Mr,{font:"gray800 textSm medium",children:[n("membres_pour_le_20317",s)," (",e.volunteers.length,")"]}),t&&(0,i.jsx)(Mr,{font:"gray800 textXs medium",children:o})]}),(0,i.jsx)(tZ,{customFields:e.customFields,slugsToDisplay:e.slugsToDisplay,volunteers:a})]})]},r))})};function nK(e,n){const t=[];return"both"!==n&&"email"!==n||t.push(e.userInfo.email),g(e.userInfo.name)&&t.unshift(e.userInfo.name),!e.userInfo.phone||"both"!==n&&"phone"!==n||t.push(`${e.userInfo.phone.internationalFormat}`),t.join("
")}const tK=e=>{const n=Fi(),t=ki(Bg),s=(0,V.useMemo)(()=>(0,Lm.A)(e.ranges,e=>e.range.start.toMillis()).map(({name:e,range:n})=>(0,kl.A)([g(e)?e:null,t.toDisplayString(n,{formats:{displayWeekday:!0}})]).join(" - ")),[e.ranges]),o=(0,Rg.A)(e.position.leaders.concat(e.position.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Tl,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"6",children:[e.displayPositionName&&(0,i.jsxs)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"medium",children:[e.position.category.name," | ",e.position.name]}),(0,i.jsxs)(Tl,{gap:"9",children:[(0,i.jsx)(Mr,{color:"gray500",width:150,children:n("date_de_la_miss_70346")}),(0,i.jsx)(Tl,{css:{flex:"1"},direction:"column",children:s.map((e,n)=>(0,i.jsx)(Mr,{color:"gray800",css:{textTransform:"capitalize"},children:e},n))})]}),o.map((t,s)=>(0,i.jsxs)(Tl,{gap:"9",children:[(0,i.jsx)(Mr,{color:"gray500",width:150,children:n("reponsable_82458")}),(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},dangerouslySetInnerHTML:{__html:nK(t,e.leadersData)}})]},s)),g(e.position.description)&&(0,i.jsxs)(Tl,{gap:"9",children:[(0,i.jsx)(Mr,{color:"gray500",width:150,children:n("description_58935")}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(Rf,{text:e.position.description})})]}),sh(e.position)&&(0,i.jsxs)(Tl,{gap:"9",children:[(0,i.jsx)(Mr,{color:"gray500",width:150,children:n("localisation_38416")}),(0,i.jsxs)(Tl,{color:"gray800",css:{flex:"1"},direction:"column",children:[th(e.position)&&(0,i.jsx)(Mr,{children:e.position.address}),ih(e.position)&&(0,i.jsx)(Mr,{children:n("point_gps_1_19889",e.position.latitude,e.position.longitude)}),ih(e.position)&&(0,i.jsx)("a",{href:Df(e.position.latitude,e.position.longitude),children:(0,i.jsx)("img",{alt:"Position map",src:`${F.HEAVENT_API_URL}/image/event/${e.position.eventId}/position/${e.position.id}.png`,width:"100%"})})]})]}),e.showResourcesInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{gap:"9",children:[(0,i.jsx)(Mr,{color:"gray500",width:150,children:n("nombre_de_cr_ne_40593")}),(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},children:e.position.numberOfSlots})]}),(0,i.jsxs)(Tl,{gap:"9",children:[(0,i.jsx)(Mr,{color:"gray500",width:150,children:n("nombre_de_membr_08851")}),(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},children:e.position.assignedResources})]})]})]})},iK=e=>{const{organization:n,event:t}=e.positionDocumentFragment,s=t.position,o=(0,V.useMemo)(()=>s.slots.filter(n=>!e.date?.isValid||n.range.start.startOf("day").equals(e.date.startOf("day"))),[s,e.date]);return(0,i.jsxs)(Mr,{css:{background:"white"},width:1,children:[e.options.showPositionData&&(0,i.jsxs)(Tl,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(JZ,{acronym:s.acronym,name:s.name}),(0,i.jsx)(tK,{displayPositionName:!1,leadersData:"both",position:s,ranges:s.range?[{name:null,range:s.range}]:[],showResourcesInfos:!0})]}),e.options.showVolunteersLists&&o.map(o=>{const a=(0,Lm.A)(t.volunteersRegistrations.nodes.filter(({positionsSlotsUsersInfos:e})=>e.map(({positionSlotId:e})=>e).includes(o.id)),e=>e.userInfo.name);return(0,i.jsx)(eK,{customFields:n.customFields.nodes,positionAcronym:s.acronym,positionName:s.name,slot:o,slugsToDisplay:e.options.slugsToDisplay,volunteers:a},o.id)})]})},sK=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{user:o}=Yi(),{event:a}=BS(),{options:r,setOptions:d}=FY(e.data.event.document.options,{format:_n.A4Portrait,showPositionData:!0,showVolunteersLists:!0,slugsToDisplay:["fullName","phone"]},s,{id:e.data.event.document.id});return Au(`${a.name} ${n("fiche_de_missio_00324")}`),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(kY,{children:[(0,i.jsxs)(Up,{value:r.format,onChange:e=>{d({format:e})},children:[(0,i.jsx)("option",{value:_n.A4Portrait,children:n("a4_portrait_92125")}),(0,i.jsx)("option",{value:_n.A4Landscape,children:n("a4_paysage_24039")})]}),(0,i.jsx)(om,{state:r.showPositionData?"checked":"unchecked",onClick:e=>{d({showPositionData:"checked"===e})},children:n("afficher_les_do_85282")}),(0,i.jsx)(om,{state:r.showVolunteersLists?"checked":"unchecked",onClick:e=>{d({showVolunteersLists:"checked"===e})},children:n("afficher_les_li_18523")}),(0,i.jsxs)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("champs_affich_17945"),values:r.slugsToDisplay,onChange:e=>{d({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:n("Email")}),(0,i.jsx)("option",{value:"fullName",children:n("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:n("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)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(KZ,{downloadPath:Ef(e.data.event.position.links.positionSheetLink,"pdf",{lang:o?.language}),getPath:e=>YO.POSITION_SHEET({organizationId:t,eventId:s,positionId:e})}),(0,i.jsx)(mY,{width:1,children:(0,i.jsx)(iK,{options:r,positionDocumentFragment:e.data})})]})]})},oK=()=>{const{translate:e,params:{organizationId:n,eventId:t,positionId:s}}=Kl(),{data:o,loader:a}=Li("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:n,eventId:t,positionId:s},[$o.DocumentPositionSheetFragment,$o.EventPositionsExportFragment]);return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(uY,{documentType:Ne.Position,eventId:t,languages:o.event?.languages??[],organizationId:n,segmentsFolders:o.event?.segmentsFolders??[],showDate:!0,title:e("fiche_de_missio_61604")}),(0,i.jsx)(yy,{css:{overflow:"hidden"},children:a||(0,i.jsx)(sK,{data:o})})]})},aK=e=>{const{history:n,translate:t}=Kl(),{data:s,loader:o}=Li("query EmailsTemplates($eventId: EventId!) {\n event(id: $eventId) {\n emailSender {\n ... on EmailsSender {\n domainStatus\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const[a,r]=(0,V.useState)(Ve.Assignments);return o||(0,i.jsxs)(i.Fragment,{children:[(!s.event.emailSender||s.event.emailSender.domainStatus!==Pe.Success)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{gap:"4",width:1,children:[s.event.emailSender&&s.event.emailSender.domainStatus!==Pe.Success&&(0,i.jsxs)(lc,{alertStyle:"error",width:1,children:[(0,i.jsx)(cc,{children:t("vos_entr_es_dns_68834")}),(0,i.jsx)(uc,{children:(0,i.jsx)(Tl,{width:1,children:(0,i.jsx)(tc,{color:"invisible",css:{color:"inherit",px:"0","&:hover":{color:"inherit"}},rightIcon:"arrow-right",onClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_EMAILS_DNS(e.organizationId))},children:t("configurer_les_65453")})})})]}),!s.event.emailSender&&(0,i.jsxs)(lc,{alertStyle:"warning",width:1,children:[(0,i.jsx)(cc,{children:t("aucun_metteur_26635",F.EMAIL_FROM)}),(0,i.jsx)(uc,{children:(0,i.jsx)(Tl,{width:1,children:(0,i.jsx)(tc,{color:"invisible",css:{color:"inherit",px:"0","&:hover":{color:"inherit"}},rightIcon:"arrow-right",onClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:t("configurer_les_56837")})})})]})]}),(0,i.jsx)(Pl,{height:"6"})]}),(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsxs)(Tl,{css:{flex:"1",py:"$3"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{children:(0,i.jsx)(Gm,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(mO,{isSelected:a===Ve.VolunteerRegistration,subtitle:t("cet_e_mail_est_75023"),title:t("UserInfoAdminCreate"),onClick:()=>r(Ve.VolunteerRegistration)}),(0,i.jsx)(mO,{isSelected:a===Ve.Assignments,subtitle:t("cet_e_mail_cont_98777"),title:t("affectation_u_11128"),onClick:()=>r(Ve.Assignments)}),(0,i.jsx)(mO,{isSelected:a===Ve.Refused,subtitle:t("cet_e_mail_est_69069"),title:t("refus_d_affecta_71455"),onClick:()=>r(Ve.Refused)}),(0,i.jsx)(mO,{isSelected:a===Ve.Accreditations,subtitle:t("cet_e_mail_cont_75798"),title:t("affectation_u_39802"),onClick:()=>r(Ve.Accreditations)}),(0,i.jsx)(mO,{isSelected:a===Ve.AccreditationsRefused,subtitle:t("cet_e_mail_est_69069"),title:t("refus_d_accr_di_89997"),onClick:()=>r(Ve.AccreditationsRefused)}),(0,i.jsx)(mO,{isSelected:a===Ve.DelegationCategoryLeaderAssign,subtitle:t("cet_e_mail_est_67392"),title:t("nomination_en_t_77654"),onClick:()=>r(Ve.DelegationCategoryLeaderAssign)}),(0,i.jsx)(mO,{isSelected:a===Ve.DelegationLeaderAssign,subtitle:t("email_sent_when_appointing_team_manager"),title:t("appointment_as_team_manager"),onClick:()=>r(Ve.DelegationLeaderAssign)}),(0,i.jsx)(mO,{isSelected:a===Ve.DelegationFormInvite,subtitle:t("cet_e_mail_est_19547"),title:t("envoi_du_formul_09434"),onClick:()=>r(Ve.DelegationFormInvite)}),(0,i.jsx)(mO,{isSelected:a===Ve.PositionLeaderAssign,subtitle:t("cet_e_mail_est_82173"),title:t("nomination_en_t_06971"),onClick:()=>r(Ve.PositionLeaderAssign)}),(0,i.jsx)(mO,{isSelected:a===Ve.PositionCategoryLeaderAssign,subtitle:t("cet_e_mail_est_70420"),title:t("nomination_en_t_02948"),onClick:()=>r(Ve.PositionCategoryLeaderAssign)}),(0,i.jsx)(mO,{isSelected:a===Ve.NotifyLeaders,subtitle:t("cet_e_mail_est_90425"),title:t("un_responsable_88525"),onClick:()=>r(Ve.NotifyLeaders)}),(0,i.jsx)(mO,{isSelected:a===Ve.Code,subtitle:t("cet_e_mail_est_49663"),title:t("code_20843"),onClick:()=>r(Ve.Code)})]})]}),(0,i.jsx)(Mr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Tl,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(hO,{emailType:a,eventId:e.eventId,formId:null,organizationId:e.organizationId,source:null})})]})]})},rK=()=>{const e=Fi(),{event:{name:n}}=BS();Au(`${n} ${e("e_mails_09850")}`);const{organizationId:t,eventId:s}=Vi();return(0,i.jsxs)(Tl,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(aK,{eventId:s,organizationId:t})]})};let dK=class extends Rc{constructor(e){super(e)}formParametersAccreditationsInputDefault(e){return{accreditationDisplay:e?.accreditationDisplay||Pn.None,accreditationFilter:e?.accreditationFilter||Nn.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 zc.Ik().shape({accreditationDisplay:zc.Yj().required(this.t("la_strat_gie_d_70458")).oneOf(li,this.t("la_strat_gie_d_70458")),accreditationFilter:zc.Yj().required(this.t("la_strat_gie_de_28051")).oneOf(mi,this.t("la_strat_gie_de_28051")),hiddenAccreditationsIds:zc.YO().of(zc.ai()),showFullAccreditation:zc.zM().required(),showAccreditationDescription:zc.zM().required(),accreditationTitle:zc.Yj(),accreditationSubtitle:zc.Yj()})}updateFormParametersAccreditationsSchema(){return zc.Ik().shape({form:this.formParametersAccreditationsInputSchema()})}};dK=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],dK);const lK=e=>{const n=Fi(),{data:t,loader:s}=Ja({eventId:e.eventId,loadIsBlocked:!1}),o=ki(Jm),[a,r]=(0,V.useState)(Yo(e.values.form.hiddenAccreditationsCategoriesIds)||Yo(e.values.form.hiddenAccreditationsIds)||Yo(e.values.form.hiddenAccreditationsSlotsIds)?"hidden":"displayed"),[d,l]=(0,V.useState)(Yo(e.values.form.hiddenAccreditationsCategoriesIds)?"checked":"unchecked"),[c,m]=(0,V.useState)(Yo(e.values.form.hiddenAccreditationsIds)?"checked":"unchecked"),[g,h]=(0,V.useState)(Yo(e.values.form.hiddenAccreditationsSlotsIds)?"checked":"unchecked"),[p,I]=(0,V.useState)(Yo(e.values.form.displayedAccreditationsCategoriesIds)?"checked":"unchecked"),[x,f]=(0,V.useState)(Yo(e.values.form.displayedAccreditationsIds)?"checked":"unchecked"),[_,j]=(0,V.useState)(Yo(e.values.form.displayedAccreditationsSlotsIds)?"checked":"unchecked"),v=(0,V.useMemo)(()=>(0,Lm.A)(t.event?.accreditationsCategories??[],e=>u(e.name)),[t.event]),S=(0,V.useMemo)(()=>v.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[v]),y=(0,V.useMemo)(()=>v.map(e=>{const n=uh(e.accreditations);return(0,i.jsx)("optgroup",{label:e.name,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[t.event]),C=(0,V.useMemo)(()=>Bh(o,v),[v]);return(0,i.jsx)(Tl,{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)(Mr,{font:"gray800 textSm semiBold",children:n("pr_f_rences_d_a_19371")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"hidden"===a?"checked":"unchecked",onClick:n=>{"checked"===n&&(r("hidden"),e.change("form.displayedAccreditationsCategoriesIds",[]),e.change("form.displayedAccreditationsIds",[]),e.change("form.displayedAccreditationsSlotsIds",[]))},children:n("cacher_des_cat_43848")}),(0,i.jsx)(Pl,{height:"3"}),"hidden"===a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(om,{state:d,onClick:n=>{l(n),"unchecked"===n&&e.change("form.hiddenAccreditationsCategoriesIds",[])},children:n("cacher_certaine_12220")}),"checked"===d&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsCategoriesIds",children:S})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:c,onClick:n=>{m(n),"unchecked"===n&&e.change("form.hiddenAccreditationsIds",[])},children:n("cacher_certaine_08734")}),"checked"===c&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsIds",children:y})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:g,onClick:n=>{h(n),"unchecked"===n&&e.change("form.hiddenAccreditationsSlotsIds",[])},children:n("cacher_certains_02997")}),"checked"===g&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsSlotsIds",children:C})]})]}),(0,i.jsx)(Pl,{height:"5"})]}),(0,i.jsx)(cm,{state:"displayed"===a?"checked":"unchecked",onClick:n=>{r("displayed"),"checked"===n&&(e.change("form.hiddenAccreditationsCategoriesIds",[]),e.change("form.hiddenAccreditationsIds",[]),e.change("form.hiddenAccreditationsSlotsIds",[]))},children:n("afficher_des_ca_68243")}),(0,i.jsx)(Pl,{height:"3"}),"displayed"===a&&(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(om,{state:p,onClick:n=>{I(n),"unchecked"===n&&e.change("form.displayedAccreditationsCategoriesIds",[])},children:n("afficher_certai_88457")}),"checked"===p&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsCategoriesIds",children:S})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:x,onClick:n=>{f(n),"unchecked"===n&&e.change("form.displayedAccreditationsIds",[])},children:n("afficher_certai_29161")}),"checked"===x&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsIds",children:y})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:_,onClick:n=>{j(n),"unchecked"===n&&e.change("form.displayedAccreditationsSlotsIds",[])},children:n("afficher_certai_38724")}),"checked"===_&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsSlotsIds",children:C})]})]})]})})},cK=e=>{const n=Fi(),[t,s]=(0,V.useState)(Yo(e.values.form.hiddenAccreditationsCategoriesIds)||Yo(e.values.form.hiddenAccreditationsIds)||Yo(e.values.form.hiddenAccreditationsSlotsIds)||Yo(e.values.form.displayedAccreditationsCategoriesIds)||Yo(e.values.form.displayedAccreditationsIds)||Yo(e.values.form.displayedAccreditationsSlotsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(np,{value:t,onChange:n=>{s(n),n||(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:n("afficher_masq_37398")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(lK,{change:e.change,eventId:e.eventId,values:e.values})]})]})},uK=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=oS(["user",...t?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:"form"}),{isNotSavedModalOpen:o,onClose:a,onNotSavedClose:r,onSave:d}=jO(e.initialValues,e.values,e.handleSubmit),l=e.slotDisplay!==Ln.Hide;return(0,i.jsx)(Oz,{button:(0,i.jsx)(tc,{isLoading:e.isMutateLoading,onClick:d,children:n("enregistrer_06519")}),title:e.name,onClose:a,children:(0,i.jsx)(_O,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{font:"gray800 textMd semiBold",children:n("param_tres_des_90955")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("comment_souhait_18471")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(xS,{name:"form.accreditationDisplay",value:Pn.Accreditation,children:n("afficher_les_ac_56952")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"form.accreditationDisplay",value:Pn.None,children:n("ne_rien_affiche_81467")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("personnalisatio_86385")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(df,{name:"form.showFullAccreditation",children:n("afficher_les_ac_56062")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cK,{change:e.change,eventId:e.eventId,values:e.values}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("affichage_des_d_57491")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Xx,{name:"form.showAccreditationDescription",children:n("afficher_la_des_94587")}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{font:"gray800 textMd semiBold",children:n("filtrer_les_acc_57840")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("d_cider_si_le_c_31187")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(xS,{name:"form.accreditationFilter",value:Nn.FilterWithSlots,children:n("filtrer_les_acc_66152")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"form.accreditationFilter",value:Nn.None,children:n("ne_pas_filtrer_97321")})]}),(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{font:"gray800 textMd semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_44808")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("nom_de_l_tape_85862"),name:"form.accreditationTitle"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(iS,{label:n("description_58935"),name:"form.accreditationSubtitle",variables:s})]})})})},mK=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=Kl(),{data:s,loader:o}=Li("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:t},[]);Au(s.organization?.form.name??"");const a=ki(Ol),r=ki(dK),{mutate:d,isLoading:l}=function(e={}){return Ui("mutation FormParametersAccreditationsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersAccreditationsInput!\n) {\n formParametersAccreditationsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=V.useMemo(()=>({form:r.formParametersAccreditationsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:a})=>(0,i.jsx)(uK,{change:e.change,eventId:n,handleSubmit:t,initialValues:c,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay||Ln.Hide,values:a}),validate:a.validateForForm(r.updateFormParametersAccreditationsSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:i.form})})};class gK extends Rc{constructor(e){super(e)}customSlotInputDefault(){return{name:"",startTime:"",endTime:""}}customSlotInputSchema(){return zc.Ik().shape({name:zc.Yj().nullable(),startTime:zc.Yj().required(this.t("le_d_but_du_cr_40745")),endTime:zc.Yj().required(this.t("la_fin_du_cr_ne_90351"))})}}let hK=class extends Rc{customSlotInputService;constructor(e,n){super(e),this.customSlotInputService=n}customSlotPeriodInputDefault(){return{name:"",customSlots:[this.customSlotInputService.customSlotInputDefault()],hideNameDates:!1,displayAsCalendar:!1,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}}customSlotPeriodInputSchema(){return zc.Ik().shape({customSlotPeriod:zc.Ik().shape({name:zc.Yj(),customSlots:zc.YO().of(this.customSlotInputService.customSlotInputSchema()).required("").min(1,"")})})}};hK=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di,gK])],hK);let pK=class extends Rc{constructor(e){super(e)}formParametersAvailabilitiesInputDefault(e){return{slotDisplay:e?.slotDisplay||Ln.Hide,minNumberOfSlots:e?.minNumberOfSlots??1,daysDisplay:e?.daysDisplay||kn.AllDays,customSlotsPeriods:(e?.customSlotsPeriods??[]).map(e=>(0,_r.A)(e,["id","conditionCustomField"])),slotTitle:e?.slotTitle||"",slotSubtitle:e?.slotSubtitle||""}}formParametersAvailabilitiesInputSchema(){return zc.Ik().shape({slotDisplay:zc.Yj().required(this.t("la_strat_gie_d_34961")).oneOf(gi,this.t("la_strat_gie_d_34961")),daysDisplay:zc.Yj().required(this.t("la_strat_gie_de_56435")).oneOf(ci,this.t("la_strat_gie_de_56435"))})}updateFormParametersAvailabilitiesSchema(){return zc.Ik().shape({form:this.formParametersAvailabilitiesInputSchema()})}};pK=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],pK);const IK=e=>{const n=Fi(),t=ki(hK),s=ki(gK);return(0,i.jsx)(xx,{isOpen:!0,onClose:e.onClose,children:(0,i.jsx)(Ix,{children:(0,i.jsx)(xc,{direction:"column",hideDefaultErrors:!0,initialValues:{customSlotPeriod:e.customSlotPeriod},render:({form:t,handleSubmit:o,submitting:a,values:r})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(px,{icon:"sliders-up",subtitle:n("param_trer_les_33935"),children:n("mise_jour_de_14984")}),(0,i.jsxs)(hx,{css:{overflowY:"auto"},gap:"7",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(hc,{hideSpacer:!0}),(0,i.jsx)($c,{hint:n("le_nom_de_la_p_49293"),label:(0,i.jsx)(Uv,{children:n("nom_de_la_p_rio_89140")}),name:"customSlotPeriod.name"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Qx,{label:(0,i.jsx)(Uv,{children:n("date_de_d_but_43380")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.startDate"}),(0,i.jsx)(Qx,{label:(0,i.jsx)(Uv,{children:n("date_de_fin_86920")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.endDate"})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(df,{name:"customSlotPeriod.hasCondition",children:n("conditionner_l_33629")}),r.customSlotPeriod.hasCondition&&(0,i.jsx)(Tl,{css:{background:"$gray50",bd:!0,padding:"$4"},direction:"column",gap:"4",children:(0,i.jsx)(sO,{conditionCustomFieldId:r.customSlotPeriod.conditionCustomFieldId,conditionCustomFields:e.conditionCustomFields,conditionValue:r.customSlotPeriod.conditionValue,setConditionCustomFieldId:n=>{const i=e.conditionCustomFields.find(e=>e.id===n);i&&(t.change("customSlotPeriod.conditionValue",i.fieldType===Qe.Checkbox||[]),t.change("customSlotPeriod.conditionCustomFieldId",n))},setConditionValue:e=>{t.change("customSlotPeriod.conditionValue",e)}})})]})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("cr_neaux_person_16330")}),r.customSlotPeriod.customSlots.map((e,s)=>{const o=`customSlotPeriod.customSlots[${s}].`;return(0,i.jsxs)(Tl,{align:"end",gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)($c,{label:n("nom_du_cr_neau_54351"),name:`${o}name`})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(rS,{label:n("SlotStart"),name:`${o}startTime`})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(rS,{label:n("SlotEnd"),name:`${o}endTime`})}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",onClick:()=>{t.change("customSlotPeriod.customSlots",Jo(r.customSlotPeriod.customSlots,s))}})]},s)}),(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>{t.change("customSlotPeriod.customSlots",[...r.customSlotPeriod.customSlots,s.customSlotInputDefault()])},children:n("ajouter_un_cr_n_63607")})]}),r.customSlotPeriod.customSlots.length<2&&(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("options_d_affic_10797")}),(0,i.jsx)(df,{name:"customSlotPeriod.hideNameDates",children:n("masquer_les_inf_78021")}),(0,i.jsx)(df,{name:"customSlotPeriod.displayAsCalendar",children:n("afficher_les_di_90328")})]})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{isLoading:a,onClick:o,children:n("mettre_jour_l_81276")})})]}),schema:t.customSlotPeriodInputSchema(),onSubmit:async n=>{await e.onSuccess(n.customSlotPeriod),e.onClose()}})})})},xK=e=>{const n=Fi(),t=ki(Jm),[s,o]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray900 textSm semiBold",children:g(e.customSlotPeriod.name)?e.customSlotPeriod.name:n("p_riode_de_l_v_78032")}),(0,i.jsxs)(Mr,{color:"gray500",children:[e.customSlotPeriod.startDate?t.toLocaleString(e.customSlotPeriod.startDate,Uo.DateOnly.WeekdayLongMonthLong):n("d_but_le_l_v_n_58366")," ","-"," ",e.customSlotPeriod.endDate?t.toLocaleString(e.customSlotPeriod.endDate,Uo.DateOnly.WeekdayLongMonthLong):n("fin_de_l_v_nem_88380")," ","- ",n("creneau",e.customSlotPeriod.customSlots.length)]})]}),(0,i.jsx)(tc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>o(!0)}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})]}),s&&(0,i.jsx)(IK,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:e.customSlotPeriod,event:e.event,onClose:()=>o(!1),onSuccess:async n=>{e.updateCustomSlotPeriod(n,e.index)}})]})},fK=e=>{const n=Fi();return(0,i.jsxs)(Tl,{css:{background:"$gray50",borderRadius:"$1",marginLeft:"$6",padding:"$6"},direction:"column",gap:"3",width:1,children:[e.customSlotsPeriods.map((n,t)=>(0,i.jsx)(xK,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:n,event:e.event,index:t,remove:()=>{e.remove(t)},updateCustomSlotPeriod:e.updateCustomSlotPeriod},t)),(0,i.jsxs)(Tl,{align:"center",css:{color:"$primary500",cursor:"pointer"},gap:"3",onClick:e.add,children:[(0,i.jsx)(Yl,{icon:"plus"}),(0,i.jsx)(Mr,{children:n("ajouter_une_p_r_04249")})]})]})},_K=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=oS(["user",...t?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:"form"}),o=ki(hK),{isNotSavedModalOpen:a,onClose:r,onNotSavedClose:d,onSave:l}=jO(e.initialValues,e.values,e.handleSubmit),c=(0,V.useCallback)(()=>{e.form.change("form.customSlotsPeriods",[...e.values.form.customSlotsPeriods,o.customSlotPeriodInputDefault()])},[e.values.form.customSlotsPeriods,e.form.change]),u=(0,V.useCallback)(n=>{e.form.change("form.customSlotsPeriods",Jo(e.values.form.customSlotsPeriods,n))},[e.values.form.customSlotsPeriods,e.form.change]),m=(0,V.useCallback)((n,t)=>{const i=[...e.values.form.customSlotsPeriods];i[t]=n,e.form.change("form.customSlotsPeriods",i)},[e.values.form.customSlotsPeriods,e.form.change]),g=e.values.form.slotDisplay===Ln.Custom,h=e.values.form.slotDisplay===Ln.DisplayDays||e.values.form.slotDisplay===Ln.Calendar||e.values.form.slotDisplay===Ln.Custom;return(0,i.jsx)(Oz,{button:(0,i.jsx)(tc,{isLoading:e.isMutateLoading,onClick:l,children:n("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(_O,{isNotSavedOpen:a,onNotSavedClose:d,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Kj,{heading:n("affichage_des_d_20852"),role:"radiogroup",subtitle:n("personnaliser_l_64536"),children:[(0,i.jsx)(xS,{name:"form.slotDisplay",value:Ln.Display,children:n("demander_au_mem_07520")}),(0,i.jsx)(xS,{name:"form.slotDisplay",value:Ln.DisplayDays,children:n("demander_au_mem_50067")}),(0,i.jsx)(xS,{name:"form.slotDisplay",value:Ln.Calendar,children:n("demander_au_mem_60083")}),(0,i.jsx)(xS,{name:"form.slotDisplay",value:Ln.Custom,children:n("demander_au_mem_31132")}),g&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(fK,{add:c,conditionCustomFields:e.conditionCustomFields,customSlotsPeriods:e.values.form.customSlotsPeriods,event:e.event,remove:u,updateCustomSlotPeriod:m})}),(0,i.jsx)(xS,{name:"form.slotDisplay",value:Ln.Hide,children:n("ne_pas_demander_46686")})]}),e.values.form.slotDisplay!==Ln.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("nombre_de_dispo_22220")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("le_membre_soit_74069")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)($c,{name:"form.minNumberOfSlots",shouldParseAsInt:!0})]}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("filtrer_les_dis_80634")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("d_cider_de_filt_81078")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(xS,{name:"form.daysDisplay",value:kn.AllDays,children:n("afficher_l_ense_11531")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"form.daysDisplay",value:kn.DaysWithSlots,children:n("filtrer_les_jou_51154")})]}),e.values.form.slotDisplay!==Ln.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"7"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_44808")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("nom_de_l_tape_85862"),name:"form.slotTitle"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(iS,{label:n("description_58935"),name:"form.slotSubtitle",variables:s})]})]})})})},jK=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=Kl(),{data:s,loader:o}=Li("query FormParametersAvailabilities(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n ...FormCustomFields\n\n form(id: $formId) {\n name\n ...FormSlotsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n }\n}\n",{organizationId:e,eventId:n,formId:t},[$o.FormCustomFieldsFragment,$o.FormSlotsOptionsFragment,$o.FormRegisterCustomSlotPeriodFragment]);Au(s.organization?.form.name??"");const a=ki(Ol),r=ki(pK),{mutate:d,isLoading:l}=function(e={}){return Ui("mutation FormParametersAvailabilitiesUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersAvailabilitiesInput!\n) {\n formParametersAvailabilitiesUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=(0,V.useMemo)(()=>(s.organization?.formCustomFields.nodes??[]).filter(e=>[Qe.Checkbox,Qe.Country,Qe.Language,Qe.Nationality,Qe.Select].includes(e.fieldType)),[s.organization]),u=(0,V.useMemo)(()=>({form:r.formParametersAvailabilitiesInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:u,render:({form:e,handleSubmit:n,values:t})=>(0,i.jsx)(_K,{conditionCustomFields:c,event:s.event,form:e,handleSubmit:n,initialValues:u,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",values:t}),validate:a.validateForForm(r.updateFormParametersAvailabilitiesSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:i.form})})};let vK=class extends Rc{constructor(e){super(e)}formParametersMissionsInputDefault(e){return{positionDisplay:e?.positionDisplay||Fn.None,positionFilter:e?.positionFilter||Nn.FilterWithSlots,positionRanking:e?.positionRanking||sn.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 zc.Ik().shape({positionDisplay:zc.Yj().required(this.t("la_strat_gie_d_44170")).oneOf(ui,this.t("la_strat_gie_d_44170")),positionFilter:zc.Yj().required(this.t("la_strat_gie_de_13294")).oneOf(mi,this.t("la_strat_gie_de_13294")),positionRanking:zc.Yj().required(this.t("le_type_de_clas_66819")).oneOf(Ht,this.t("le_type_de_clas_66819")),positionLimit:zc.ai().required(this.t("le_nombre_maxim_38249")).min(1,this.t("le_nombre_de_ch_27910")),hiddenPositionsCategoriesIds:zc.YO().of(zc.ai()),hiddenPositionsIds:zc.YO().of(zc.ai()),hiddenPositionsSlotsIds:zc.YO().of(zc.ai()),hiddenPositionsTagsIds:zc.YO().of(zc.ai()),displayedPositionsCategoriesIds:zc.YO().of(zc.ai()),displayedPositionsIds:zc.YO().of(zc.ai()),displayedPositionsSlotsIds:zc.YO().of(zc.ai()),displayedPositionsTagsIds:zc.YO().of(zc.ai()),showFullPosition:zc.zM().required(),showPositionCategoryDescription:zc.zM().required(),showPositionDescription:zc.zM().required(),positionTitle:zc.Yj(),positionSubtitle:zc.Yj(),willAutoAssign:zc.zM().required()})}updateFormParametersMissionsSchema(){return zc.Ik().shape({form:this.formParametersMissionsInputSchema()})}};vK=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],vK);const SK=e=>(0,i.jsxs)(Tl,{css:{cursor:"pointer",position:"relative"},direction:"column",gap:"1",onClick:e.onSelect,children:[e.isSelected&&(0,i.jsx)(Tl,{align:"center",css:{background:"$primary500",borderRadius:"20px",color:"white",fontSize:"$textMd",position:"absolute",right:"-10px",top:"-10px"},height:20,justify:"center",width:20,children:(0,i.jsx)(Yl,{icon:"check"})}),(0,i.jsx)(Mr,{css:{background:"$gray100",border:e.isSelected?"2px solid $primary500":"2px solid $gray100",borderRadius:"$1",padding:"$6",paddingBottom:"0"},height:135,width:240,children:(0,i.jsx)("img",{height:"107px",src:e.src,width:"188px"})}),(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:e.name})]}),yK=e=>{const n=Fi(),{data:t,loader:s}=Li("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=ki(Bg),[a,r]=(0,V.useState)(Yo(e.values.form.hiddenPositionsCategoriesIds)||Yo(e.values.form.hiddenPositionsIds)||Yo(e.values.form.hiddenPositionsSlotsIds)||Yo(e.values.form.hiddenPositionsTagsIds)?"hidden":"displayed"),[d,l]=(0,V.useState)(Yo(e.values.form.hiddenPositionsCategoriesIds)?"checked":"unchecked"),[c,m]=(0,V.useState)(Yo(e.values.form.hiddenPositionsIds)?"checked":"unchecked"),[g,h]=(0,V.useState)(Yo(e.values.form.hiddenPositionsSlotsIds)?"checked":"unchecked"),[p,I]=(0,V.useState)(Yo(e.values.form.hiddenPositionsTagsIds)?"checked":"unchecked"),[x,f]=(0,V.useState)(Yo(e.values.form.displayedPositionsCategoriesIds)?"checked":"unchecked"),[_,j]=(0,V.useState)(Yo(e.values.form.displayedPositionsIds)?"checked":"unchecked"),[v,S]=(0,V.useState)(Yo(e.values.form.displayedPositionsSlotsIds)?"checked":"unchecked"),[y,C]=(0,V.useState)(Yo(e.values.form.displayedPositionsTagsIds)?"checked":"unchecked"),b=(0,V.useMemo)(()=>(0,Lm.A)(t.event?.positionsCategories??[],e=>u(e.name)),[t.event]),A=(0,V.useMemo)(()=>b.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.positions.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[b]),E=(0,V.useMemo)(()=>Wh(o,b),[b,o]),w=(0,V.useMemo)(()=>(0,Lm.A)(t.organization?.tags.nodes??[],e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[t.organization]);return(0,i.jsx)(Tl,{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)(Mr,{font:"gray800 textSm semiBold",children:n("pr_f_rences_d_a_19371")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"hidden"===a?"checked":"unchecked",onClick:n=>{"checked"===n&&(r("hidden"),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]),e.change("form.displayedPositionsTagsIds",[]))},children:n("cacher_des_cat_31908")}),(0,i.jsx)(Pl,{height:"3"}),"hidden"===a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(om,{state:d,onClick:n=>{l(n),"unchecked"===n&&e.change("form.hiddenPositionsCategoriesIds",[])},children:n("cacher_certaine_12220")}),"checked"===d&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsCategoriesIds",children:b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:c,onClick:n=>{m(n),"unchecked"===n&&e.change("form.hiddenPositionsIds",[])},children:n("cacher_certaine_19933")}),"checked"===c&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsIds",children:A})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:g,onClick:n=>{h(n),"unchecked"===n&&e.change("form.hiddenPositionsSlotsIds",[])},children:n("cacher_certains_02997")}),"checked"===g&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsSlotsIds",children:E})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:p,onClick:n=>{I(n),"unchecked"===n&&e.change("form.hiddenPositionsTagsIds",[])},children:n("cacher_certains_66424")}),"checked"===p&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsTagsIds",children:w})]})]}),(0,i.jsx)(Pl,{height:"5"})]}),(0,i.jsx)(cm,{state:"displayed"===a?"checked":"unchecked",onClick:n=>{r("displayed"),"checked"===n&&(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.hiddenPositionsTagsIds",[]))},children:n("afficher_des_ca_37473")}),(0,i.jsx)(Pl,{height:"3"}),"displayed"===a&&(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(om,{state:x,onClick:n=>{f(n),"unchecked"===n&&e.change("form.displayedPositionsCategoriesIds",[])},children:n("afficher_certai_88457")}),"checked"===x&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsCategoriesIds",children:b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:_,onClick:n=>{j(n),"unchecked"===n&&e.change("form.displayedPositionsIds",[])},children:n("affficher_certa_32341")}),"checked"===_&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsIds",children:A})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:v,onClick:n=>{S(n),"unchecked"===n&&e.change("form.displayedPositionsSlotsIds",[])},children:n("afficher_certai_38724")}),"checked"===v&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsSlotsIds",children:E})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(om,{state:y,onClick:n=>{C(n),"unchecked"===n&&e.change("form.displayedPositionsTagsIds",[])},children:n("afficher_certai_47793")}),"checked"===y&&(0,i.jsxs)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(of,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsTagsIds",children:w})]})]})]})})},CK=e=>{const n=Fi(),[t,s]=(0,V.useState)(Yo(e.values.form.hiddenPositionsCategoriesIds)||Yo(e.values.form.hiddenPositionsIds)||Yo(e.values.form.hiddenPositionsSlotsIds)||Yo(e.values.form.hiddenPositionsTagsIds)||Yo(e.values.form.displayedPositionsCategoriesIds)||Yo(e.values.form.displayedPositionsIds)||Yo(e.values.form.displayedPositionsSlotsIds)||Yo(e.values.form.displayedPositionsTagsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(np,{value:t,onChange:n=>{s(n),n||(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:n("afficher_masq_74825")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(yK,{change:e.change,eventId:e.eventId,organizationId:e.organizationId,values:e.values})]})]})},bK=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=oS(["user",...s?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:"form"}),{isNotSavedModalOpen:a,onClose:r,onNotSavedClose:d,onSave:l}=jO(e.initialValues,e.values,e.handleSubmit),c=e.slotDisplay!==Ln.Hide&&e.values.form.positionDisplay!==Fn.None;return(0,i.jsx)(Oz,{button:(0,i.jsx)(tc,{isLoading:e.isMutateLoading,onClick:l,children:n("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(_O,{isNotSavedOpen:a,onNotSavedClose:d,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("param_tres_des_93365")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("d_cider_du_type_01830")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"8",children:[(0,i.jsx)(SK,{isSelected:e.values.form.positionRanking===sn.Unranked,name:n("choix_illimit_s_72460"),src:su.FormPositionUnranked,onSelect:()=>{e.change("form.positionRanking",sn.Unranked)}}),(0,i.jsx)(SK,{isSelected:e.values.form.positionRanking===sn.Ranked,name:n("classement_des_43897"),src:su.FormPositionRanked,onSelect:()=>{e.change("form.positionRanking",sn.Ranked),e.values.form.positionDisplay===Fn.None&&e.change("form.positionDisplay",Fn.Position)}})]}),e.values.form.positionRanking===sn.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)($c,{label:n("nombre_de_choix_19811"),name:"form.positionLimit",shouldParseAsInt:!0})]}),(0,i.jsx)(oI,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("affichage_des_m_65982")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_26207")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("comment_souhait_23788")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(xS,{name:"form.positionDisplay",value:Fn.Category,children:n("afficher_les_ca_26287")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"form.positionDisplay",value:Fn.Position,children:n("afficher_les_mi_31841")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"form.positionDisplay",value:Fn.Slot,children:n("afficher_les_cr_32311")}),e.values.form.positionRanking===sn.Unranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"form.positionDisplay",value:Fn.None,children:n("ne_rien_affiche_81467")})]}),e.values.form.positionDisplay!==Fn.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("personnalisatio_94071")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(df,{name:"form.showFullPosition",children:n("afficher_les_mi_35510")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(CK,{change:e.change,eventId:s,organizationId:t,values:e.values}),e.values.form.positionRanking!==sn.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:n("affichage_des_d_57491")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Xx,{name:"form.showPositionCategoryDescription",children:n("afficher_la_des_67852")}),e.values.form.positionDisplay!==Fn.Category&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Xx,{name:"form.showPositionDescription",children:n("afficher_la_des_21998")})]})]}),(0,i.jsx)(oI,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("automatisation_49411")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("d_cider_si_l_af_60345")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(df,{name:"form.willAutoAssign",children:e.values.form.positionDisplay===Fn.Category?n("la_pr_affectat_61978"):e.values.form.positionDisplay===Fn.Position?n("la_pr_affectat_20431"):n("l_affectation_s_68435")})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("filtrer_les_cat_63783")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("d_cider_si_le_c_98644")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(xS,{name:"form.positionFilter",value:Nn.FilterWithSlots,children:n("filtrer_les_cat_52780")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(xS,{name:"form.positionFilter",value:Nn.None,children:n("ne_pas_filtrer_73952")})]}),e.values.form.positionDisplay!==Fn.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:n("personnaliser_l_44808")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("nom_de_l_tape_85862"),name:"form.positionTitle"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(iS,{label:n("description_58935"),name:"form.positionSubtitle",variables:o})]})]})})})},AK=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=Kl(),{data:s,loader:o}=Li("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:t},[]);Au(s.organization?.form.name??"");const a=ki(Ol),r=ki(vK),{mutate:d,isLoading:l}=function(e={}){return Ui("mutation FormParametersMissionsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersMissionsInput!\n) {\n formParametersMissionsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=V.useMemo(()=>({form:r.formParametersMissionsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:t})=>(0,i.jsx)(bK,{change:e.change,handleSubmit:n,initialValues:c,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay??Ln.Hide,values:t}),validate:a.validateForForm(r.updateFormParametersMissionsSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:i.form})})},EK=e=>{const n=Fi(),t=ki(Jm),s=Um(),o=e.endpoint.params.some(e=>"endDate"===e.name),a=(0,V.useMemo)(()=>(0,Lm.A)(e.data.event.accreditationsCategories,e=>u(e.name)),[e.data.event]),r=(0,V.useMemo)(()=>(0,Lm.A)(e.data.event.positionsCategories,e=>u(e.name)),[e.data.event]),d=(0,V.useMemo)(()=>(0,Rg.A)(e.data.event.formsCustomsFields.concat(e.data.organization.usersInfosCustomFields.nodes),e=>e.slug),[e.data]),l={accreditationsCategoriesIds:n("cat_gories_d_ac_73496"),accreditationsIds:n("accr_ditations_39450"),accreditationsSlotsIds:n("cr_neaux_33401"),columns:n("colonnes_73889"),date:n(o?"date_de_d_but_43380":"Date"),delimiter:n("s_parateur_36232"),endDate:n("date_de_fin_86920"),includeLeaders:n("reponsable_82458"),includeMembers:n("membres_11310"),positionCategoryId:n("CatĂ©gorie de missions"),positionId:n("Position"),slugs:n("champs_91671"),sortAttribute:n("trier_par_05826"),sortDirection:n("ordre_78726"),state:n("statut_d_affect_57444"),states:n("statut_d_accr_d_75527")},c={assigned:n("attribu_es_48167"),quota:n("quota_00069"),scanned:n("scann_es_13169"),wished:n("souhait_es_78101"),[ot.AccreditationState]:n("statut_d_accr_d_75527"),[ot.Delegation]:n("Delegation"),[ot.Email]:n("e_mail_13869"),[ot.FirstName]:n("pr_nom_66988"),[ot.Id]:n("id_51738"),[ot.InsertedAt]:n("date_d_inscript_31369"),[ot.LastName]:n("nom_08311"),[ot.LocalId]:n("id_sur_l_v_nem_01171"),[ot.Name]:n("Nom complet"),[ot.PairedAt]:n("Date d'appairage"),[ot.State]:n("statut_d_affect_57444"),[ot.TeamCode]:n("code_quipe_14296"),[ot.UpdatedAt]:n("date_de_mise_74553"),[Gn.Asc]:n("croissant_68432"),[Gn.Desc]:n("d_croissant_08512")},m=e=>"slugs"===e.type?"all"===e.emptyMeans?n("tous_les_champs_57939"):n("aucun_champ_23523"):"states"===e.name?n("tous_les_status_67644"):n("tous_39916"),g=o=>{const g=e.values[o.name],h=l[o.name]??o.name,p=void 0===o.requires||void 0!==e.values[o.requires]&&null!==e.values[o.requires]&&""!==e.values[o.requires]?void 0:"disabled",I={flex:"1 1 0",minWidth:"160px"},x=n=>e.onChange(o.name,n);switch(o.type){case"boolean":return(0,i.jsxs)(Up,{css:I,label:h,shouldParseAsBoolean:!0,value:!0===g,onChange:x,children:[(0,i.jsx)("option",{value:"false",children:n("ne_pas_les_incl_04166")}),(0,i.jsx)("option",{value:"true",children:n("les_inclure_90965")})]},o.name);case"date":return(0,i.jsx)(Wp,{css:I,label:h,state:p,value:"string"==typeof g?g:null,onChange:e=>{x(e.isValid?e.toFormat("yyyyMMdd"):null)}},o.name);case"delimiter":return(0,i.jsxs)(Up,{css:I,label:h,value:"string"==typeof g?g:"",onChange:x,children:[(0,i.jsx)("option",{value:"",children:n("virgule_par_d_64346")}),(0,i.jsx)("option",{value:";",children:n("point_virgule_15722")}),(0,i.jsx)("option",{value:"\t",children:n("tabulation_85540")})]},o.name);case"enum":case"ids":case"slugs":{const l="enum"===o.type?(e=>e.every(e=>void 0!==c[e])?e.map(e=>(0,i.jsx)("option",{value:e,children:c[e]},e)):s([...e]))(o.values):"ids"===o.type?(e=>{switch(e.resource){case"accreditationsCategories":return a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id));case"accreditations":return a.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:uh(e.accreditations).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id));case"accreditationsSlots":return Bh(t,a);case"positionsCategories":return r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id));case"positions":return r.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Lm.A)(e.positions,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))}})(o):(t=>{const s=t.variety===Te.Position?e.data.organization.positionsCustomFields.nodes:d;return[...(t.extraSlugs??[]).map(e=>(0,i.jsx)("option",{value:e,children:"description"===e?n("Description"):e},e)),...s.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))]})(o);if("slugs"===o.type||o.multiple)return(0,i.jsx)(_m,{css:I,isSearchVisible:!0,isSelectAllVisible:!0,label:h,multiple:!0,placeholder:m(o),renderOnPortal:!0,state:p,values:Array.isArray(g)?g:[],onChange:x,children:l},o.name);{const e="ids"===o.type||void 0===o.defaultValue;return(0,i.jsxs)(Up,{css:I,label:h,shouldParseAsInt:"ids"===o.type,state:p,value:null==g?"":g.toString(),onChange:e=>{x("number"==typeof e&&Number.isNaN(e)?null:e)},children:[e&&(0,i.jsx)("option",{value:"",children:"positionId"===o.name?n("toutes_les_miss_87817"):"positionCategoryId"===o.name?n("toutes_les_cat_63746"):"sortAttribute"===o.name?n("aucun_tri_90071"):n("tous_les_status_67644")}),l]},o.name)}}}};return(0,i.jsx)(Tl,{direction:"column",gap:"6",children:(0,VY.A)(e.endpoint.params,5).map((e,n)=>(0,i.jsx)(Tl,{align:"start",css:{columnGap:"$4",rowGap:"$6"},wrap:"wrap",children:e.map(g)},n))})},wK=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{user:o}=Yi(),{isLoading:a,copy:r}=cS(),[d,l]=(0,V.useState)(!1),[c,u]=(0,V.useState)("api"),[m,g]=(0,V.useState)(()=>PV(e.endpoint)),h=Af({organizationId:t,eventId:s,lang:o?.language,pathComponent:e.endpoint.path,key:e.data.event.key,searchParams:kV(e.endpoint,m)}),p="sheets"===c?`=IMPORTDATA("${h}")`:h,I=function(e,n){const t=kV(e,n);return e.params.filter(e=>void 0!==t[e.name]&&("enum"!==e.type||e.defaultValue!==t[e.name])).length}(e.endpoint,m),x="string"==typeof m.delimiter&&""!==m.delimiter&&","!==m.delimiter;return(0,i.jsxs)(Tl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs",padding:"$5 $6"},direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Tl,{align:"center",gap:"3",justify:"between",children:[(0,i.jsxs)(Tl,{css:{minWidth:"0"},direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",wrap:"wrap",children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:e.title}),I>0&&(0,i.jsx)(Ku,{color:"primary",children:n("_1_param_tre_m_53568",I)})]}),(0,i.jsx)(Mr,{font:"gray500 textSm regular",children:e.description})]}),(0,i.jsx)(tc,{color:"white",css:{flexShrink:"0"},leftIcon:"sliders-up",rightIcon:d?"chevron-up":"chevron-down",onClick:()=>l(!d),children:n("personnaliser_84232")})]}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(wc,{css:{flex:"1",minWidth:"0","& .h-styled-input-container":{background:"white"}},state:"disabled",value:p,onChange:Bc.A}),(0,i.jsx)(tc,{isLoading:a,leftIcon:"copy",onClick:()=>r(p),children:n("copier_75889")})]})]}),d&&(0,i.jsxs)(Tl,{css:{borderTop:"1px solid $gray200",paddingTop:"$5"},direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{css:{maxWidth:"100%",width:"280px"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:n("Format du lien")}),(0,i.jsxs)(Gv,{color:"primary",selectedItem:c,onChange:e=>u(e),children:[(0,i.jsx)(qv,{item:"api",children:"API"}),(0,i.jsx)(qv,{item:"sheets",children:"Google Sheet"})]})]}),"sheets"===c&&x&&(0,i.jsx)(lc,{alertStyle:"warning",children:(0,i.jsx)(uc,{children:n("google_sheets_a_66636")})}),(0,i.jsx)(EK,{data:e.data,endpoint:e.endpoint,values:m,onChange:(e,n)=>{g(t=>({...t,[e]:n}))}}),(0,i.jsxs)(Tl,{align:"center",gap:"3",justify:"between",wrap:"wrap",children:[(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:n("les_param_tres_72412")}),(0,i.jsx)(tc,{color:"invisible-gray",leftIcon:"rotate-left",onClick:()=>g(PV(e.endpoint)),children:n("r_initialiser_l_27814")})]})]})]})},$K=e=>{const{translate:n}=Kl(),{hasFeature:t}=XS(),s={assignments:n("affectations_de_70985"),accreditations:n("accr_ditations_55053"),"accreditations-matrix":n("accr_ditations_29354"),"accreditations-slots":n("cr_neaux_d_accr_44687"),positions:n("missions_63972"),"delegations-matrix":n("d_l_gations_sou_41605")},o={assignments:n("exporter_vos_me_66217"),accreditations:n("exporter_toutes_28045"),"accreditations-matrix":n("exporter_toutes_67075"),"accreditations-slots":n("liste_des_cr_ne_56641"),positions:n("liste_des_missi_29192"),"delegations-matrix":n("accr_ditations_29277")};return(0,i.jsx)(Tl,{direction:"column",gap:"3",width:1,children:MV.filter(e=>void 0===e.feature||t(e.feature)).map(n=>(0,i.jsx)(wK,{data:e.data,description:o[n.path],endpoint:n,title:s[n.path]},n.path))})},TK=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl(),{event:{name:s}}=BS();Au(`${s} API`);const{hasFeature:o}=XS(),{data:a,loader:r}=Li("query EventApi($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n usersInfosCustomFields: customFields(\n variety: UserInfo\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n slug\n name\n }\n }\n\n positionsCustomFields: customFields(\n variety: Position\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n slug\n name\n }\n }\n }\n\n event(id: $eventId) {\n key\n\n formsCustomsFields {\n slug\n name\n }\n\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{organizationId:n,eventId:t},[]);return r||(0,i.jsxs)(Ay,{children:[(0,i.jsx)(by,{children:(0,i.jsx)(Mr,{font:"gray900 displayXs medium",children:"API"})}),(0,i.jsxs)(yy,{children:[(0,i.jsx)(lc,{alertStyle:"primary",children:(0,i.jsx)(uc,{children:e("l_api_permet_de_66672",uu)})}),(0,i.jsx)(Pl,{height:"7"}),o(Ze.Api)?(0,i.jsx)($K,{data:a}):(0,i.jsx)(Tl,{align:"center",css:{flex:"1"},height:1,justify:"center",width:1,children:(0,i.jsx)(Vj,{icon:"code-branch"})})]})]})},zK=[Ke.Eid,Ke.FirstName,Ke.LastName,Ke.Picture,Ke.Population],OK=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl(),{event:s}=BS();Au(`${s.name} Weezevent`);const{data:o}=Li("query WeezeventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, privacy: All, variety: UserInfo) {\n nodes {\n slug\n name\n }\n }\n\n weezaccessEvents {\n id\n name\n }\n }\n\n event(id: $eventId) {\n weezevent\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:n,eventId:t},[]),{mutate:a}=function(e={}){return Ui("mutation EventWeezeventUpdate($eventId: EventId!, $weezevent: EventWeezeventInput!) {\n eventWeezeventUpdate(eventId: $eventId, weezevent: $weezevent) {\n id\n }\n}\n",e)}(),r=(0,V.useMemo)(()=>(0,Lm.A)(o.organization?.customFields.nodes??[],e=>u(e.name)).filter(e=>!zK.includes(e.slug)).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[o]),d=(0,V.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]),l=(0,V.useMemo)(()=>(0,Lm.A)(o.event?.accreditationsCategories??[],e=>u(e.name)).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Lm.A)(e.accreditations,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o]),c=(0,V.useMemo)(()=>(0,Lm.A)(o.organization?.weezaccessEvents??[],e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o]);return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(by,{children:(0,i.jsx)(Mr,{font:"gray900 displayXs medium",children:"Weezevent"})}),(0,i.jsx)(yy,{children:(0,i.jsx)(xc,{initialValues:{accreditationsIds:o.event?.weezevent?.accreditationsIds||[],customFieldsSlugs:o.event?.weezevent?.customFieldsSlugs||[],segmentsIds:o.event?.weezevent?.segmentsIds||[],weezaccessEventId:o.event?.weezevent?.weezaccessEventId??null},render:({handleSubmit:n,submitting:t})=>(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(of,{isSearchVisible:!0,label:e("liste_des_champ_73852"),multiple:!0,name:"customFieldsSlugs",children:r}),(0,i.jsx)(of,{isSearchVisible:!0,label:e("liste_des_vues_82829"),multiple:!0,name:"segmentsIds",children:d}),(0,i.jsx)(of,{hint:e("toutes_les_accr_55233"),isSearchVisible:!0,label:e("liste_des_accr_50214"),multiple:!0,name:"accreditationsIds",children:l}),(0,i.jsx)(of,{isSearchVisible:!0,label:e("id_de_l_v_neme_87336"),name:"weezaccessEventId",children:c}),(0,i.jsx)(ly,{permissions:sy.WEEZEVENT_EDIT,children:(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:t,onClick:n,children:e("enregistrer_06519")})})})]}),onSubmit:e=>a({eventId:t,weezevent:e})})})]})};let RK=class{positionsCustomFieldInputSchema(){return zc.Ik().shape({customFieldId:zc.ai().required(),conditionValue:zc.gl().required()})}};RK=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)()],RK);let DK=class extends Rc{constructor(e){super(e)}positionsSlotInputDefault(e,n){return{id:n?.id,name:n?.name??"",startDate:n?.startDate??e,startTime:n?.startTime??e.toFormat("HH:mm"),endDate:n?.endDate??e,endTime:n?.endTime??e.plus({hour:1}).toFormat("HH:mm"),resources:n?.resources??1,assignedResources:n?.assignedResources}}createPositionSlotSchema(){return zc.Ik().shape({slot:this.positionsSlotInputSchema()})}positionsSlotInputSchema(){return zc.Ik().shape({name:zc.Yj(),startDate:lf.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),startTime:zc.Yj().required(this.t("heure_de_d_but_90785")),endDate:lf.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,n)=>Oo.c9.isDateTime(n.parent.startDate)&&n.parent.startDate.isValid&&Oo.c9.isDateTime(n.parent.endDate)&&n.parent.endDate.isValid&&n.parent.endDate>=n.parent.startDate),endTime:zc.Yj().required(this.t("l_heure_de_fin_78626")).test("after-start-time",this.t("la_date_de_fin_00429"),(e,n)=>{const t=Oo.c9.isDateTime(n.parent.startDate)&&n.parent.startDate.isValid,i=Hg(n.parent.startTime),s=Oo.c9.isDateTime(n.parent.endDate)&&n.parent.endDate.isValid,o=Hg(n.parent.endTime);if(t&&i&&s&&o){const[e,t]=Yg(n.parent.startTime),[i,s]=Yg(n.parent.endTime);return n.parent.startDate.set({hours:e,minutes:t})=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],DK);let MK=class extends Rc{positionsCustomFieldInputService;positionsSlotInputService;constructor(e,n,t){super(t),this.positionsCustomFieldInputService=e,this.positionsSlotInputService=n}positionInputDefault(e,{positionCategoryId:n,layer:t,latitude:i,longitude:s,startAt:o}){let a=e?.category.id??n;return Number.isInteger(a)||(a=null),{positionCategoryId:a,name:e?.name??"",description:e?.description??"",privateNote:e?.privateNote??"",acronym:e?.acronym??"",color:e?.color??Ar.colors.primary500.value,icon:e?.icon??rn.LocationDot,weezeventIsSynchronized:e?.weezeventIsSynchronized??!1,address:e?.address??null,latitude:e?.latitude??i??null,longitude:e?.longitude??s??null,zoom:e?.zoom??Wr,layer:e?.layer??t,tracesIds:e?.tracesIds??[],slots:e?.slots??[this.positionsSlotInputService.positionsSlotInputDefault(o)],positionDisplay:e?.positionDisplay??jn.List,conditionsOperator:e?.conditionsOperator??be.And,positionsCustomFields:e?.positionsCustomFields??[],tagsIds:e?.tagsIds??[],fields:e?.fields??{},leadersIds:e?.fields??[]}}createUpdatePositionSchema(e){const n=this.positionInputSchema();return zc.Ik().shape({position:e?n.shape({fields:e}):n})}positionInputSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_de_la_mi_74207")),positionCategoryId:zc.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:zc.Yj(),color:zc.Yj().required(this.t("la_couleur_est_95740")),icon:zc.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(Zt,this.t("l_ic_ne_est_req_15843")),description:zc.Yj(),privateNote:zc.Yj(),address:zc.Yj().nullable(),latitude:zc.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:zc.ai().nullable().typeError(this.t("la_longitude_do_35170")),traces:zc.YO().of(zc.ai()),slots:zc.YO().of(this.positionsSlotInputService.positionsSlotInputSchema()).required(this.t("vous_devez_avoi_26563")).min(1,this.t("vous_devez_avoi_26563")),positionDisplay:zc.Yj().required(this.t("le_type_d_affic_60154")).oneOf(si,this.t("le_type_d_affic_60154")),positionsCustomFields:zc.YO().of(this.positionsCustomFieldInputService.positionsCustomFieldInputSchema()),tagsIds:zc.YO().of(zc.ai())})}};MK=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[RK,DK,Di])],MK);const PK=e=>{const{mutate:n}=function(e={}){return Ui("mutation PositionCategoryCreate($eventId: EventId!, $positionCategory: PositionsCategoryInput!) {\n positionCategoryCreate(eventId: $eventId, positionCategory: $positionCategory) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(zb,{initialName:"",isEdit:!1,mutate:async t=>{const{positionCategoryCreate:i}=await n({eventId:e.eventId,positionCategory:{name:t}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},kK=e=>{const{mutate:n}=function(e={}){return Ui("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)(zb,{initialName:e.positionCategoryName,isEdit:!0,mutate:async t=>{const{positionCategoryUpdate:i}=await n({eventId:e.eventId,positionCategoryId:e.positionCategoryId,positionCategory:{name:t}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},FK=(0,V.memo)(function(e){const{params:{eventId:n},translate:t}=Kl(),[s,o]=(0,V.useState)(HC(e.event.positionsCategories)),{hasEventRole:a}=BS(),{canPositionEdit:r}=oy(),d=a&&r,[l,c]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($c,{label:t("nom_de_la_missi_64605"),name:"position.name"}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(of,{createText:t("cr_er_une_nouve_72722"),isCreateVisible:d,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"position.positionCategoryId",placeholder:t("rechercher_ou_c_16469"),onCreateClick:()=>{c(!0)},children:s.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:t("Acronym")}),name:"position.acronym"})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(DC,{label:t("Color"),name:"position.color"}),(0,i.jsx)(NC,{label:t("ic_ne_55554"),name:"position.icon"})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(iS,{label:(0,i.jsx)(Uv,{children:t("description_58935")}),name:"position.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{align:"center",gap:"3",children:[(0,i.jsx)(df,{name:"position.weezeventIsSynchronized",children:t("WeezeventIsSynchronized")}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(Yl,{icon:"circle-info"})})}),(0,i.jsx)(Dx,{placement:"top",children:t("cr_er_automatiq_66502")})]})]})]}),l&&(0,i.jsx)(PK,{eventId:n,onClose:()=>{c(!1)},onSuccess:n=>{o(HC([...s,n])),e.change("position.positionCategoryId",n.id)}})]})}),NK=()=>{const e=Fi();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(iS,{label:(0,i.jsx)(Uv,{children:e("note_priv_e_06303")}),name:"position.privateNote"})})},LK=e=>{const n=Fi(),t=ki(DK);return(0,i.jsx)(tb,{buttonText:n("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:t.createPositionSlotSchema(),size:"md",subtitle:n("param_trer_les_00874"),title:n("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async n=>{await e.onSuccess((0,Fr.A)(n.slot,["id","name","startDate","startTime","endDate","endTime","resources"])),e.onClose()},children:({form:t,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr.Yr,{name:"slot.startDate",children:e=>{e>s.slot.endDate&&t.change("slot.endDate",e)}}),(0,i.jsxs)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)($c,{hint:n("vous_pouvez_per_94218"),label:(0,i.jsx)(Uv,{children:n("nom_du_cr_neau_54351")}),name:"slot.name"}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Qx,{label:n("date_de_d_but_43380"),max:e.event.endAt,min:e.event.startAt,name:"slot.startDate"}),(0,i.jsx)(rS,{label:n("horaire_de_d_bu_02380"),name:"slot.startTime"})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(Qx,{label:n("date_de_fin_86920"),max:e.event.endAt,min:e.event.startAt,name:"slot.endDate"}),(0,i.jsx)(rS,{label:n("horaire_de_fin_10624"),name:"slot.endTime"})]}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)($c,{label:n("nombre_de_membr_08851"),name:"slot.resources",shouldParseAsInt:!0})]})]})})},UK=e=>{const n=Fi(),t=ki(Jm),s=(0,V.useMemo)(()=>g(e.slot.name)?e.slot.name:n("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,V.useMemo)(()=>{const i=t.toLocaleString(e.slot.startDate,Uo.DateOnly.WeekdayLongMonthLong),s=t.toLocaleString(e.slot.endDate,Uo.DateOnly.WeekdayLongMonthLong);return`${i} ${e.slot.startTime.substring(0,5)} - ${s} ${e.slot.endTime.substring(0,5)} - ${n("_1_membre_49737",e.slot.resources)}`},[e.slot.startDate,e.slot.startTime,e.slot.endDate,e.slot.endTime,e.slot.resources]),[a,r]=(0,V.useState)(e.initialIsEditOpen),[d,l]=(0,V.useState)(!1),c=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Mr,{color:"gray500",children:o})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{r(!0)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"arrows-repeat",size:"sm",onClick:()=>{l(!0)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",disabled:c,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n(c?"des_membres_son_92320":"supprimer_43083")})]})]}),a&&(0,i.jsx)(LK,{event:e.event,slot:e.slot,onClose:()=>{r(!1)},onSuccess:async n=>{e.updateSlots(n,e.index)}}),d&&(0,i.jsx)(fU,{showHours:!0,onClose:()=>{l(!1)},onSubmit:(n,t)=>{e.onRepeat(e.slot,n,t)}})]})},VK=e=>{const n=Fi(),t=ki(DK),[s,o]=(0,V.useState)(-1),a=(0,V.useCallback)((n,t)=>{const i=[...e.values.position.slots];i[t]=n,e.change("position.slots",i)},[e.values.position.slots,e.change]),r=(0,V.useCallback)((e,n,t)=>ko(e).overlaps(t),[]),d=(0,V.useCallback)(()=>{e.change("position.slots",e.values.position.slots.concat([t.positionsSlotInputDefault(e.event.startAt)])),o(e.values.position.slots.length)},[e.values.position.slots,e.change]),l=(0,V.useCallback)((n,t,i)=>{const s=function(e,n,t){const i=Yg(e.startTime);let s=e.startDate;i&&(s=s.set({hour:i[0],minute:i[1]}));const o=Yg(e.endTime);let a=e.endDate;return o&&(a=a.set({hour:o[0],minute:o[1]})),(0,Om.A)(1,n+1).map(n=>{if("hour"===t){const t=s.plus({hour:n}),i=a.plus({hour:n});return{name:e.name,startDate:t,startTime:t.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("day"===t){const t=s.plus({day:n}),i=a.plus({day:n});return{name:e.name,startDate:t,startTime:t.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("week"===t){const t=s.plus({week:n}),i=a.plus({week:n});return{name:e.name,startDate:t,startTime:t.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}throw new Error("Wrong unit")})}(n,t,i);e.change("position.slots",e.values.position.slots.concat(s))},[e.values.position.slots,e.change]),c=(0,V.useCallback)(n=>{e.change("position.slots",Jo(e.values.position.slots,n))},[e.values.position.slots,e.change]);return(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(xU,{event:e.event,matchDateFilter:r,renderSlot:n=>(0,i.jsx)(UK,{event:e.event,index:n.index,initialIsEditOpen:n.index===s,remove:c,slot:n,updateSlots:a,onRepeat:l},n.index),slots:e.values.position.slots,onNewSlot:d}),(0,i.jsx)(oI,{height:"5"}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textMd medium",children:n("type_d_affichag_09962")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("comment_souhait_62602")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(xS,{name:"position.positionDisplay",value:jn.List,children:n("afficher_sous_f_71276")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(xS,{name:"position.positionDisplay",value:jn.Radio,children:n("afficher_sous_f_61997")})]})]})},BK=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{showNotification:a}=AS(),r=ki(MK),d=ki(Ol),l=ki(zC),c=(0,V.useRef)(null),u=(0,V.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.position.name):t("cr_ation_d_une_10675"),[e.isEdit,e.initialValues]);Au(u);const m=(0,V.useMemo)(()=>Yo(e.initialValues.position.tracesIds)||g(e.initialValues.position.address)||"number"==typeof e.initialValues.position.latitude||"number"==typeof e.initialValues.position.longitude,[e.isEdit,e.initialValues]),h=(0,V.useMemo)(()=>!!e.isEdit&&Yo(e.initialValues.position.positionsCustomFields),[e.isEdit,e.initialValues]),p=(0,V.useMemo)(()=>!!e.isEdit&&Yo(Object.keys(e.initialValues.position.fields)),[e.isEdit,e.initialValues]),I=(0,V.useMemo)(()=>!!e.isEdit&&g(e.initialValues.position.privateNote),[e.isEdit,e.initialValues]),x=(0,V.useMemo)(()=>!!e.isEdit&&Yo(e.initialValues.position.tagsIds),[e.isEdit,e.initialValues]),f=(0,V.useCallback)(n=>d.validateForForm(r.createUpdatePositionSchema(l.changedFieldsSchema(e.positionCustomFields,e.initialValues.position.fields,n.position.fields)))(n),[e.positionCustomFields,e.initialValues]);return(0,i.jsx)(xc,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:a,submitting:r,values:d})=>(0,i.jsx)(Hx,{button:e.isEdit&&(0,i.jsx)(tc,{isLoading:r,onClick:a,children:t("mettre_jour_l_19061")}),category:u,color:"dark",fallbackClosePath:oo.POSITIONS({organizationId:s,eventId:o}),heading:e.isEdit?e.initialValues.position.name:t("nouvelle_missio_60727"),children:(0,i.jsxs)(Gx,{ref:c,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{heading:t("informations_su_61022"),children:(0,i.jsx)(FK,{change:n.change,event:e.event})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:t("cr_neaux_horair_62996"),subtitle:t("ajouter_les_dif_22779"),children:(0,i.jsx)(VK,{change:n.change,event:e.event,values:d})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:t("localisation_38416"),initialIsOpen:m,isToggleable:!0,subtitle:t("localiser_le_li_46319"),onToggle:t=>{t||(n.change("position.layer",e.event.layer),n.change("position.zoom",Wr),n.change("position.tracesIds",[]),n.change("position.address",null),n.change("position.latitude",null),n.change("position.longitude",null))},children:(0,i.jsx)($U,{center:e.event,layer:d.position.layer,name:"position.",point:d.position,traces:e.event.traces,tracesIds:d.position.tracesIds})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:t("conditions_77756"),initialIsOpen:h,isToggleable:!0,subtitle:t("ajouter_des_con_75357"),onToggle:e=>{e||n.change("position.positionsCustomFields",[])},children:(0,i.jsx)(mU,{change:n.change,conditionsOperator:d.position.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:d.position.positionsCustomFields,name:"position.positionsCustomFields",prefix:"position."})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:t("champs_de_formu_64126"),initialIsOpen:p,isToggleable:!0,subtitle:t("ajouter_des_inf_14340"),onToggle:e=>{e||n.change("position.fields",{})},children:(0,i.jsx)(vL,{change:n.change,customFields:e.positionCustomFields,formCustomFields:qo,formCustomFieldsValues:qo,prefix:"position.",showFormCustomFields:!1})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:t("note_priv_e_06303"),initialIsOpen:I,isToggleable:!0,subtitle:t("ajouter_une_not_81707"),onToggle:e=>{e||n.change("position.privateNote","")},children:(0,i.jsx)(NK,{})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:t("tags_79499"),initialIsOpen:x,isToggleable:!0,subtitle:t("ajouter_des_tag_64526"),onToggle:e=>{e||n.change("position.tagsIds",[])},children:(0,i.jsx)(sb,{change:n.change,name:"position.",organizationId:s,tags:e.tags,tagsIds:d.position.tagsIds})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:r,textAlign:"center",onClick:a,children:e.isEdit?t("mettre_jour_l_19061"):t("cr_er_la_missio_82644")})})]})}),validate:f,width:1,onSubmit:async i=>{const r=await e.mutate({eventId:o,position:{...i.position,slots:i.position.slots.map(e=>(0,_r.A)(e,["index"]))}});a(e.isEdit?t("la_mission_a_t_79916"):t("la_mission_a_t_14808")),e.isEdit?n.goBack(oo.POSITION({organizationId:s,eventId:o,positionId:r})):n.replace(oo.POSITION({organizationId:s,eventId:o,positionId:r}))}})},WK=()=>{const e=ki(MK),{organizationId:n,eventId:t,options:s}=Vi(),{data:o,loader:a}=Li("query PositionEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(eventId: $eventId, variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n }\n}\n",{organizationId:n,eventId:t},[$o.ConditionsCustomFieldsFragment,$o.CreatePositionTagsFragment,$o.AttachCustomFieldFragment,$o.CreatePositionEventFragment]),{mutate:r}=function(e={}){return Ui("mutation PositionCreate($eventId: EventId!, $position: PositionInput!) {\n positionCreate(eventId: $eventId, position: $position) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),{positionCategoryId:d,latitude:l,longitude:c}=(e=>{const[n,t]=(e??"").split(",");return g(n)&&g(t)?{latitude:parseFloat(n),longitude:parseFloat(t)}:g(e)?{positionCategoryId:parseInt(e,10)}:{}})(s);return a||(0,i.jsx)(BK,{conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,initialValues:{position:e.positionInputDefault(null,{layer:o.event.layer,startAt:o.event.startAt,positionCategoryId:d,latitude:l,longitude:c})},isEdit:!1,mutate:async e=>{const{positionCreate:{id:n}}=await r(e);return n},positionCustomFields:o.organization.positionCustomFields.nodes,tags:o.organization.tags.nodes})},GK=()=>{const{organizationId:e,eventId:n,positionId:t}=Vi(),{data:s,loader:o}=Li("query PositionToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(eventId: $eventId, variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n\n position(id: $positionId) {\n name\n description\n acronym\n color\n icon\n weezeventIsSynchronized\n privateNote\n address\n latitude\n longitude\n layer\n zoom\n tracesIds\n tagsIds\n fields\n conditionsOperator\n positionDisplay\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:n,positionId:t},[$o.ConditionsCustomFieldsFragment,$o.CreatePositionTagsFragment,$o.AttachCustomFieldFragment,$o.CreatePositionEventFragment]),a=ki(MK),{mutate:r}=function(e={}){return Ui("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)(BK,{conditionsCustomFields:s.organization.conditionsCustomFields.nodes,event:s.event,initialValues:{position:a.positionInputDefault(s.event.position,{layer:s.event.layer,startAt:s.event.startAt})},isEdit:!0,mutate:async e=>{const{positionUpdate:{id:n}}=await r({...e,positionId:t});return n},positionCustomFields:s.organization.positionCustomFields.nodes,tags:s.organization.tags.nodes})};var qK;let HK=class extends QM{static{qK=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...QM.IMPORT_COLUMNS_DEFAULT,PositionName:"positionName",PositionCategoryName:"positionCategoryName",SlotStart:"slotStart",SlotEnd:"slotEnd",MaxResources:"slotMaxResources",SlotName:"slotName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",ConditionsOperator:"conditionsOperator",Address:"address",Latitude:"latitude",Longitude:"longitude",MapLayer:"mapLayer",MapZoom:"mapZoom",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===dn.Update?[qK.IMPORT_COLUMNS_DEFAULT.Id]:[],qK.IMPORT_COLUMNS_DEFAULT.SlotStart,qK.IMPORT_COLUMNS_DEFAULT.SlotEnd,qK.IMPORT_COLUMNS_DEFAULT.MaxResources,qK.IMPORT_COLUMNS_DEFAULT.PositionName,qK.IMPORT_COLUMNS_DEFAULT.PositionCategoryName];constructor(e,n){super(e,n),this.csvInputService=e}};HK=qK=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[ZM,Di])],HK);const YK=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{mutate:s}=function(e={}){return Ui("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}=AS(),{data:a,loader:r}=jd({organizationId:e,variety:Te.Position});return r||(0,i.jsx)(qM,{alertDescriptionKey:"to_add_a_task_62291",children:(0,i.jsx)(yP,{ImportInputService:HK,checkImport:o,closePath:oo.POSITIONS({organizationId:e,eventId:n}),customFields:a.organization.customFields.nodes,heading:t("importing_tasks_31757"),importTagPrefix:"positions",localStorageKeyPrefix:"POSITIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(Xm,{to:oo.POSITIONS({organizationId:e,eventId:n}),children:t("revenir_aux_mis_73428")})})})};var ZK;function KK(e,n){return n===Ih.Map?{includeCheckedInRate:!1,includeCheckedOutRate:!1,includeConditions:!1,includeCreatedBy:!1,includeDescription:!1,includeLeaders:!1,includePositionTraces:!1,includeTags:!1,includeTraces:!0}:n===Ih.SlotsList?{includeCheckedInRate:e.includes(ZK.CheckedInRate),includeCheckedOutRate:e.includes(ZK.CheckedOutRate),includeConditions:e.includes(ZK.Conditions),includeCreatedBy:e.includes(ZK.CreatedBy),includeDescription:e.includes(ZK.Description),includeLeaders:e.includes(ZK.Leaders)||e.includes(ZK.CategoryLeaders),includePositionTraces:e.includes(ZK.Traces),includeTags:e.includes(ZK.Tags)}:{includeCheckedInRate:e.includes(ZK.CheckedInRate),includeCheckedOutRate:e.includes(ZK.CheckedOutRate),includeConditions:e.includes(ZK.Conditions),includeCreatedBy:e.includes(ZK.CreatedBy),includeDescription:e.includes(ZK.Description),includeLeaders:e.includes(ZK.Leaders)||e.includes(ZK.CategoryLeaders),includePositionTraces:e.includes(ZK.Traces),includeTags:e.includes(ZK.Tags),includeTraces:!1}}!function(e){e.Acronym="acronym",e.Address="address",e.Category="category",e.CategoryLeaders="categoryLeaders",e.CheckedInRate="checkedInRate",e.CheckedOutRate="checkedOutRate",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Latitude="latitude",e.Layer="layer",e.Leaders="leaders",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.MaxResources="resources",e.AssignedResources="assignedResources",e.Slot="slot",e.SlotName="slotName",e.State="state",e.Tags="tags",e.Traces="traces",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized",e.Zoom="zoom"}(ZK||(ZK={}));let XK=class extends Og{constructor(e,n,t){super(e,n,t)}getPositionsFilters(e,n){return(0,kl.A)([{slug:ZK.Name,name:this.t("nom_de_la_missi_64605"),category:this.t("missions_63972"),fieldType:nn.Text,hideEmpty:!0},{slug:"position",name:this.t("Position"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:ZK.Description,name:this.t("Description"),category:this.t("missions_63972"),fieldType:nn.Text},{slug:ZK.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("missions_63972"),fieldType:nn.Text},Yo(e.positionsCategories)?{slug:"positionCategory",name:this.t("cat_gorie_00291"),category:this.t("missions_63972"),fieldType:nn.Select,values:(0,Lm.A)(e.positionsCategories,e=>u(e.name)),hideEmpty:!0}:null,{slug:"positionSlot",name:this.t("cr_neau_11117"),category:this.t("missions_63972"),fieldType:nn.DateTimeRange,startAt:e.startAt,endAt:e.endAt},{slug:"positionSlotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("missions_63972"),fieldType:nn.Text},{slug:"tag",name:this.t("Tag"),category:this.t("missions_63972"),fieldType:nn.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:Yn.Positions},{slug:"positionCustomField",name:this.t("condition_61066"),category:this.t("missions_63972"),fieldType:nn.Select,needLoading:!0,organizationId:e.organizationId},Yo(e.traces)?{slug:ZK.Traces,name:this.t("Traces"),category:this.t("missions_63972"),fieldType:nn.Select,values:(0,Lm.A)(e.traces,e=>u(e.name))}:null,{slug:"acronym",name:this.t("Acronym"),category:this.t("missions_63972"),fieldType:nn.Text},{slug:"color",name:this.t("Color"),category:this.t("missions_63972"),fieldType:nn.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("missions_63972"),fieldType:nn.Select,values:Zt.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("missions_63972"),fieldType:nn.Text},{slug:"latitude",name:this.t("Latitude"),category:this.t("missions_63972"),fieldType:nn.Number},{slug:"longitude",name:this.t("Longitude"),category:this.t("missions_63972"),fieldType:nn.Number},{slug:"state",name:this.t("statut_des_ress_73550"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,values:di.map(e=>({id:e,name:this.t(e)}))},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:ZK.CheckedInRate,name:this.t("taux_de_pointag_87285"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:ZK.CheckedOutRate,name:this.t("taux_de_d_point_88315"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:ZK.Leaders,name:this.t("nombre_de_respo_19772"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:ZK.CategoryLeaders,name:this.t("nombre_de_respo_01994"),category:this.t("missions_63972"),fieldType:nn.Number,hideEmpty:!0},{slug:ZK.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("missions_63972"),fieldType:nn.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:ZK.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("missions_63972"),fieldType:nn.Datetime,hideEmpty:!0},e.isWeezeventConnected?{slug:ZK.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),category:this.t("missions_63972"),fieldType:nn.Number}:null,...this.customFieldsToFilters(n)])}getPositionsPossibleColumns(e,{isWeezeventConnected:n}){const t=[{slug:ZK.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:En.Id,width:100},{slug:ZK.Name,name:this.t("nom_de_la_missi_64605"),isSearchable:!0,isSortable:!0,sortAttribute:En.Name,minWidth:120},{slug:ZK.Acronym,name:this.t("acronymes_11499"),isSearchable:!0,isSortable:!0,sortAttribute:En.Acronym,minWidth:120},{slug:ZK.Description,name:this.t("Description"),minWidth:320},{slug:ZK.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:En.Category,minWidth:240},{slug:ZK.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:180},{slug:ZK.Slot,name:this.t("cr_neau_11117"),isSortable:!0,sortAttribute:En.Slot,minWidth:240},{slug:ZK.MaxResources,name:this.t("membres_n_cessa_55227"),minWidth:320},{slug:ZK.AssignedResources,name:this.t("membres_11310"),minWidth:320},{slug:"numberOfMinutesRequired",name:this.t("nombre_de_membr_60320_plural"),minWidth:320},{slug:"numberOfMinutesAssigned",name:this.t("nombre_de_membr_87779_plural"),minWidth:320},{slug:ZK.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:ZK.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:ZK.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:ZK.Layer,name:this.t("Layer"),minWidth:180},{slug:ZK.Traces,name:this.t("Traces"),minWidth:240},{slug:ZK.Zoom,name:this.t("Zoom"),isSearchable:!0,minWidth:180},{slug:ZK.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:ZK.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:ZK.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:ZK.Icon,name:this.t("ic_ne_55554"),width:80},{slug:ZK.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:ZK.State,name:this.t("statut_des_ress_73550"),minWidth:240},{slug:ZK.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:ZK.CheckedInRate,name:this.t("taux_de_pointag_87285"),minWidth:240},{slug:ZK.CheckedOutRate,name:this.t("taux_de_d_point_88315"),minWidth:240},{slug:ZK.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:ZK.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:En.CreatedAt,minWidth:180},{slug:ZK.Leaders,name:this.t("responsables_de_54941"),isSearchable:!0,minWidth:320},{slug:ZK.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320}];return n&&t.push({slug:ZK.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:ZK.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),t.concat(this.customFieldsToPossibleColumns(e))}};XK=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],XK);function QK(e){return e===Cn.StartDate||e===Cn.EndDate}function JK(e){return e===Cn.StartTime||e===Cn.EndTime}let eX=class extends Rc{constructor(e){super(e)}positionsSlotsMassEditSchema(){return zc.Ik().shape({massEdit:this.positionsSlotsMassEditInputSchema()})}positionsSlotsMassEditInputSchema(){return zc.Ik().shape({selecteds:zc.Ik().required(),property:zc.Yj().required().oneOf(ai),strategy:zc.Yj().required().oneOf(ri).when("property",{is:QK,then:e=>e.oneOf([bn.Replace])}),value:zc.gl().test("valid-value",(e,n)=>{const{property:t,strategy:i}=n.parent;return QK(t)?Oo.c9.isDateTime(e)&&e.isValid||"string"==typeof e&&Oo.c9.fromISO(e).isValid||n.createError({message:this.t("la_date_est_req_98470")}):JK(t)&&i===bn.Replace?Hg(e)||n.createError({message:this.t("l_heure_est_req_51396")}):JK(t)?Ur(e)||n.createError({message:this.t("le_nombre_de_mi_02803")}):Ur(e)||n.createError({message:this.t("le_nombre_de_me_04870")})})})}};eX=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],eX);const nX=e=>{const{translate:n}=Kl(),t=ki(eX),s=n=>QK(n)?e.event.startAt.startOf("day"):JK(n)?"":1,o=(e,n)=>{e.batch(()=>{e.change("massEdit.property",n),e.change("massEdit.strategy",bn.Replace),e.change("massEdit.value",s(n))})};return(0,i.jsx)(tb,{buttonText:n("mettre_jour_85141"),icon:"sliders",initialValues:{massEdit:{selecteds:e.selecteds,property:Cn.StartDate,strategy:bn.Replace,value:s(Cn.StartDate)}},schema:t.positionsSlotsMassEditSchema(),size:"md",title:n("_diter_une_prop_26724"),onClose:e.onClose,onSubmit:async({massEdit:n})=>{const t=await e.mutate({...n,value:QK(n.property)?n.value.toISODate():n.value});e.onSuccess(t),e.onClose()},children:({form:t,values:s})=>(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Zr.Yr,{name:"massEdit.strategy",children:e=>{JK(s.massEdit.property)&&t.change("massEdit.value",e===bn.Replace?"":null)}}),(0,i.jsx)(Mr,{font:"gray700 textSm medium",children:n("que_souhaitez_v_87607")}),(0,i.jsx)(RE,{isChecked:s.massEdit.property===Cn.StartDate,text:n("modifier_la_dat_77807"),onClick:()=>o(t,Cn.StartDate),children:(0,i.jsx)(Qx,{max:e.event.endAt,min:e.event.startAt,name:"massEdit.value"})}),(0,i.jsx)(RE,{isChecked:s.massEdit.property===Cn.StartTime,text:n("modifier_l_hora_50591"),onClick:()=>o(t,Cn.StartTime),children:(0,i.jsx)(tX,{values:s})}),(0,i.jsx)(RE,{isChecked:s.massEdit.property===Cn.EndDate,text:n("modifier_la_dat_16591"),onClick:()=>o(t,Cn.EndDate),children:(0,i.jsx)(Qx,{max:e.event.endAt,min:e.event.startAt,name:"massEdit.value"})}),(0,i.jsx)(RE,{isChecked:s.massEdit.property===Cn.EndTime,text:n("modifier_l_hora_56263"),onClick:()=>o(t,Cn.EndTime),children:(0,i.jsx)(tX,{values:s})}),(0,i.jsxs)(RE,{isChecked:s.massEdit.property===Cn.Resources,text:n("modifier_le_nom_22180"),onClick:()=>o(t,Cn.Resources),children:[(0,i.jsx)(iX,{}),(0,i.jsx)($c,{name:"massEdit.value",shouldParseAsInt:!0})]})]})})},tX=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iX,{}),e.values.massEdit.strategy===bn.Replace?(0,i.jsx)(rS,{name:"massEdit.value"}):(0,i.jsx)($c,{name:"massEdit.value",rightText:"min",shouldParseAsInt:!0})]}),iX=()=>{const{translate:e}=Kl();return(0,i.jsxs)(ny,{name:"massEdit.strategy",children:[(0,i.jsx)("option",{value:bn.Replace,children:e("d_finir_une_nou_83151")}),(0,i.jsx)("option",{value:bn.Add,children:e("ajouter_97327")}),(0,i.jsx)("option",{value:bn.Subtract,children:e("retirer_05155")})]})},sX=e=>{const{translate:n}=Kl(),{massActions:t,predicates:s}=pg(),{eventId:o,onMassEditSuccess:a}=ok(),{showNotification:r}=AS(),{mutate:d}=function(e={}){return Ui("mutation PositionsSlotsMassEdit($eventId: EventId!, $massEdit: PositionsSlotsMassEditInput!) {\n numberOfPositionsSlots: positionsSlotsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}(),[l,c]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{onClick:()=>c(!0),children:n("_diter_une_prop_26724")}),l&&(0,i.jsx)(nX,{event:e.event,mutate:async e=>(await d({eventId:o,massEdit:e})).numberOfPositionsSlots,selecteds:t.getSelectedsInput(s,null),onClose:()=>c(!1),onSuccess:e=>{r(n("_1_cr_neaux_on_11340",e)),a()}})]})},oX=e=>{const{params:{eventId:n}}=Kl(),{mutate:t}=Oa(),s=V.useCallback(async i=>{const s=Ho(e.property);for(const o of s){const a=1===s.length?i:i[o];await t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.positionId]},slug:o,strategy:hn.Replace,value:a}})}},[e.positionId,e.property,t]);return(0,i.jsx)(sA,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},aX=e=>{const{translate:n}=Kl();return(0,i.jsx)(oX,{column:e.column,initialValue:e.position.acronym||"",positionId:e.position.id,property:vn.Acronym,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("Acronym"),value:e,onChange:t}),renderValue:e.position.acronym||"",updatable:e.updatable})},rX=V.createContext({}),dX=e=>{const[n,t]=V.useState(),s=uF(Zd,{eventId:e.eventId},e=>e.event.positionsCategories),o=uF(Wa,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(rX.Provider,{value:{newPositionLatLng:n,getPositionsCategories:s,getTags:o,setNewPositionLatLng:t},children:e.children})};function lX(){return V.useContext(rX)}const cX=e=>{const n=Fi(),{getPositionsCategories:t}=lX(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("Category")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(Up,{label:n("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))})},uX=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),{isEditMode:s}=pg();return(0,i.jsx)(oX,{column:e.column,initialValue:e.positionCategory.id,positionId:e.positionId,property:vn.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(cX,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:s,title:e.positionCategory.name,updatable:e.updatable,children:(0,i.jsx)(Xm,{to:oo.POSITION_CATEGORY({organizationId:n,eventId:t,positionCategoryId:e.positionCategory.id}),children:e.positionCategory.name})}),updatable:e.updatable})},mX=e=>{const{translate:n}=Kl();return(0,i.jsx)(oX,{column:e.column,initialValue:e.position.color,positionId:e.position.id,property:vn.Color,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(RC,{label:n("Color"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Tl,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{css:{background:e.position.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{lS(e.position.color)}})}),(0,i.jsx)(Dx,{placement:"top",children:e.position.color})]})}),updatable:e.updatable})},gX=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>e.position.positionsCustomFields||[],[e.position]),s=(0,V.useMemo)(()=>t.map((e,t)=>({id:t,color:"gray",icon:null,text:`${e.customField.name} : ${HU(n,e.customField,e.conditionValue)}`})),[t]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:s})})},hX=e=>{const{params:{eventId:n}}=Kl(),{mutate:t}=Oa(),s=(0,V.useCallback)(i=>t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.position.id]},slug:vn.Description,strategy:hn.Replace,value:i}}),[n,e.position.id,t]);return(0,i.jsx)(ZF,{column:e.column,mutate:s,reload:e.reload,text:e.position.description,updatable:e.updatable})},pX=e=>{const{translate:n}=Kl();return(0,i.jsx)(oX,{column:e.column,initialValue:e.position.icon,positionId:e.position.id,property:vn.Icon,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(FC,{label:n("Icon"),renderOnPortal:!0,value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Yl,{icon:Hl(e.position.icon)}),updatable:e.updatable})},IX=e=>{const{translate:n}=Kl(),t=(0,V.useMemo)(()=>({[vn.Color]:e.position.color,[vn.Icon]:e.position.icon}),[e.position]);return(0,i.jsx)(oX,{column:e.column,initialValue:t,positionId:e.position.id,property:[vn.Color,vn.Icon],reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(RC,{label:n("Color"),value:e[ae.Color],onChange:n=>{t({...e,[ae.Color]:n})}}),(0,i.jsx)(FC,{label:n("Icon"),renderOnPortal:!0,value:e[ae.Icon],onChange:n=>{t({...e,[ae.Icon]:n})}})]}),renderValue:()=>(0,i.jsx)(xI,{color:e.position.color,icon:e.position.icon}),updatable:e.updatable})},xX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{isEditMode:o}=pg();return(0,i.jsx)(oX,{column:e.column,initialValue:e.position.name,positionId:e.position.id,property:vn.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("nom_de_la_missi_64605"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Rk,{isEditMode:o,title:e.position.name,updatable:e.updatable,children:(0,i.jsx)(Xm,{to:oo.POSITION({organizationId:t,eventId:s,positionId:e.position.id}),children:(0,i.jsx)(Mr,{css:{clamp:2},title:e.position.name,children:e.position.name})})}),updatable:e.updatable})},fX=e=>{const{translate:n}=Kl(),{getTags:t}=lX(),{result:s,isLoading:o}=RF(t);return o?(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(bc,{children:n("tags_79499")}),(0,i.jsx)(Qu,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(_m,{isSearchVisible:!0,label:n("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))})},_X=e=>{const n=(0,V.useMemo)(()=>e.position.tags||[],[e.position]),t=(0,V.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(oX,{column:e.column,initialValue:n.map(e=>e.id),positionId:e.position.id,property:vn.Tag,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(fX,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(pA,{badges:t}),updatable:e.updatable})},jX=e=>{const n=(0,V.useMemo)(()=>(e.position.traces||[]).map(e=>({id:e.id,color:e.color,icon:null,text:e.name})),[e.position]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},vX=e=>{const{translate:n,params:{eventId:t}}=Kl(),{mutate:s}=sl(),o=(0,V.useMemo)(()=>g(e.positionSlot.name)?e.positionSlot.name:"-",[e.positionSlot]);return(0,i.jsx)(sA,{column:e.column,initialValue:e.positionSlot.name,mutate:async n=>s({eventId:t,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:{...(0,Fr.A)(e.positionSlot,["id","startDate","startTime","endDate","endTime","resources"]),name:n}}),reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(wc,{label:n("nom_du_cr_neau_54351"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Mr,{css:{clamp:2},font:"gray900 textSm medium",title:o,width:1,children:o}),updatable:e.updatable})},SX=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.positionSlot.weezeventChecklistId){const n=$f(e.weezeventOrganizationId,e.positionSlot.weezeventChecklistId);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Xm,{to:n,children:e.positionSlot.weezeventChecklistId})})}return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},yX=e=>{const{translate:n}=Kl(),{hasEventRole:t}=BS(),{canPositionEdit:s}=oy(),o=t&&s,a=ki(Bg),r=ki(CC);return e.column.slug===ZK.Id?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===ZK.Category?(0,i.jsx)(uX,{column:e.column,positionCategory:e.row.positionCategory,positionId:e.row.position.id,reload:e.reload,updatable:o}):e.column.slug===ZK.Name?(0,i.jsx)(xX,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===ZK.Description?(0,i.jsx)(hX,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===ZK.Slot?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:a.toDisplayString(e.row.range)}):e.column.slug===ZK.SlotName?(0,i.jsx)(vX,{column:e.column,positionSlot:e.row,reload:e.reload,updatable:s}):e.column.slug===ZK.MaxResources||e.column.slug===ZK.AssignedResources?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(TF,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===ZK.Tags?(0,i.jsx)(_X,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===ZK.Conditions?(0,i.jsx)(gX,{column:e.column,position:e.row.position}):e.column.slug===ZK.Address?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.position.address}):e.column.slug===ZK.Traces?(0,i.jsx)(jX,{column:e.column,position:e.row.position}):e.column.slug===ZK.Latitude?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.position.latitude}):e.column.slug===ZK.Longitude?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.position.longitude}):e.column.slug===ZK.Acronym?(0,i.jsx)(aX,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===ZK.Color?(0,i.jsx)(mX,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===ZK.Icon?(0,i.jsx)(pX,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===ZK.IconColor?(0,i.jsx)(IX,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===ZK.State?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===wn.Full?(0,i.jsx)(Ku,{color:"success",children:n(e.row.state)}):(0,i.jsx)(Ku,{color:"warning",children:n(e.row.state)})}):e.column.slug===ZK.FillingRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug==ZK.CheckedInRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug==ZK.CheckedOutRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedOutRate||0,"%"]}):e.column.slug===ZK.CreatedAt?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===ZK.CreatedBy?(0,i.jsx)(Tk,{column:e.column,createdBy:e.row.position.createdBy}):e.column.slug===ZK.WeezeventIsSynchronized?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.position.weezeventIsSynchronized?n("oui_54361"):n("non_33516")}):e.column.slug===ZK.WeezeventChecklistId?(0,i.jsx)(SX,{column:e.column,positionSlot:e.row,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.customField?r.getValueString(e.customField,e.row.position.fields,{fileReturnValue:"name"}):""})},CX=e=>{const{translate:n,params:{eventId:t}}=Kl(),{reloadRow:s}=pg(),{mutate:o}=sl(),[a,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",onClick:()=>{r(!0)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),a&&(0,i.jsx)(LK,{event:e.event,slot:e.positionSlot,onClose:()=>{r(!1)},onSuccess:async n=>{await o({eventId:t,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:n}),s(e.positionSlot.id)}})]})},bX=e=>{const{canPositionEdit:n}=oy(),t=Kb(e.customFields);return(0,i.jsx)(kx,{renderCell:(n,s,o)=>(0,i.jsx)(yX,{column:n,customField:t.get(n.slug),reload:o,row:s,weezeventOrganizationId:e.weezeventOrganizationId}),renderRowDropdown:n=>(0,i.jsx)(CX,{event:e.event,positionSlot:n}),showMassActions:n,showRowDropdown:n,showRowEdit:!1})};let AX=class extends Sw{translationService;inputName="massConditions";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(ti)}}step2Fields(){return{customFieldId:zc.ai().required(this.t("le_champ_person_80074")),value:zc.gl().required(this.t("la_valeur_est_r_70136"))}}};AX=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],AX);const EX=()=>{const e=Fi();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",children:e("que_souhaitez_v_87607")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(qz,{label:e("ajouter_des_con_91773"),name:"massConditions.strategy",value:pn.Add}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(qz,{label:e("remplacer_les_c_78082"),name:"massConditions.strategy",value:pn.Replace}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(qz,{label:e("supprimer_toute_17358"),name:"massConditions.strategy",value:pn.Reset})]})},wX=e=>{const n=Fi(),{data:t,loader:s}=Li("query MassConditionsCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[$o.ConditionsCustomFieldsFragment]);const o=(0,V.useMemo)(()=>t.organization&&e.values.massConditions.customFieldId?t.organization.conditionsCustomFields.nodes.find(n=>n.id===e.values.massConditions.customFieldId):void 0,[t.organization,e.values.massConditions.customFieldId]);return(0,V.useEffect)(()=>{o?.fieldType===Qe.Checkbox?e.change("massConditions.value",!0):o?.fieldType===Qe.Select&&e.change("massConditions.value",[])},[o]),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ny,{label:n("CustomField"),name:"massConditions.customFieldId",shouldParseAsInt:!0,children:[(0,i.jsx)("option",{value:-1,children:n("s_lectionner_un_01451")}),t.organization.conditionsCustomFields.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),o?.fieldType===Qe.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(of,{isSearchVisible:!0,label:n("mission_accessi_77261"),multiple:!0,name:"massConditions.value",children:o.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]}),o?.fieldType===Qe.Checkbox&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsxs)(ny,{label:n("mission_accessi_77261"),name:"massConditions.value",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]})]})]})},$X=e=>{const n=Fi(),t=ki(AX),s=ki(Ol),{mutate:o}=function(e={}){return Ui("mutation PositionsMassConditions($eventId: EventId!, $massConditions: MassConditionsInput!) {\n numberOfPositions: positionsMassConditions(eventId: $eventId, massConditions: $massConditions)\n}\n",e)}(),[a,r]=(0,V.useState)(0);return(0,i.jsx)(dg,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Dl.lV,{initialValues:{massConditions:{customFieldId:-1,selecteds:e.selecteds,strategy:pn.Add,value:""}},initialValuesEqual:Yr.A,render:({form:t,handleSubmit:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(nb,{color:"primary",icon:"lock"})}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("_diter_les_cond_95618")}),(0,i.jsx)(Pl,{height:"7"}),0===a?(0,i.jsx)(EX,{}):(0,i.jsx)(wX,{change:t.change,eventId:e.eventId,organizationId:e.organizationId,values:o}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",children:[0!==a&&(0,i.jsx)(tc,{color:"white",leftIcon:"arrow-left",onClick:()=>{r(Math.max(0,a-1))},children:n("retour_92202")}),(0,i.jsx)(Mr,{css:{flex:"1"}}),0===a&&o.massConditions.strategy!==pn.Reset?(0,i.jsx)(tc,{rightIcon:"arrow-right",onClick:s,children:n("suivant_1_2_16815")}):(0,i.jsx)(tc,{onClick:s,children:n("appliquer_05753")})]})]}),validate:e=>0===a?s.validateForForm(t.step1Schema())(e):s.validateForForm(t.step2Schema())(e),onSubmit:async t=>{if(1===a||t.massConditions.strategy===pn.Reset){const i=(await o({eventId:e.eventId,massConditions:t.massConditions})).numberOfPositions;e.onSuccess(n("les_conditions_78548",i)),e.onClose()}else r(a+1)}})})},TX=()=>{const e=Fi(),{roles:n}=XS(),{massActions:t,predicates:s}=pg(),{eventId:o,onMassEditSuccess:a,organizationId:r,segment:d}=ok(),{showNotification:l}=AS(),{mutate:c}=Oa(),{mutate:u}=Ud(),{mutate:m}=Kd(),[h,p]=(0,V.useState)(!1),[I,x]=(0,V.useState)(!1),[f,_]=(0,V.useState)(!1),[j,v]=(0,V.useState)(!1),S=t.getSelectedsInput(s,null),y=t.isAllSelected?d.count:t.numberOfSelected,C=(0,V.useCallback)(e=>{g(e)&&l(e),a()},[a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{onClick:()=>{p(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"lock",onClick:()=>{x(!0)},children:e("_diter_les_cond_95618")}),(0,i.jsx)(Pu,{icon:"user-gear",onClick:()=>_(!0),children:e("_diter_les_resp_29588")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{v(!0)},children:e("supprimer_43083")})})]})]}),h&&(0,i.jsx)(hw,{eventId:o,mutate:e=>c({eventId:o,massEdit:e}),organizationId:r,selecteds:S,onClose:()=>{p(!1)},onSuccess:n=>{C(e("_1_missions_on_96803",n))}}),I&&(0,i.jsx)($X,{eventId:o,organizationId:r,selecteds:S,onClose:()=>{x(!1)},onSuccess:C}),f&&(0,i.jsx)(pF,{roles:n.positionRoles,showRoleSelect:!0,onClose:()=>_(!1),onSuccess:async(n,t)=>{const i=(await u({eventId:o,massLeaders:{leaders:t,strategy:n,selecteds:S}})).numberOfPositions;C(e("les_responsable_23291",i))}}),j&&(0,i.jsx)(ow,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_65487")],text:e("suppression_de_81835",y),onClose:()=>{v(!1)},onDelete:async()=>{const n=(await m({eventId:o,selecteds:S})).numberOfPositions;C(e("_1_missions_on_56713",n))}})]})};function zX(){const{history:e,params:{organizationId:n,eventId:t}}=Kl(),{mutate:i}=function(e={}){return Ui("mutation PositionDuplicate($eventId: EventId!, $positionId: PositionId!) {\n positionDuplicate(eventId: $eventId, positionId: $positionId) {\n id\n }\n}\n",e)}();return(0,V.useCallback)(async s=>{const{positionDuplicate:o}=await i({eventId:t,positionId:s});e.push(yo.EDIT_POSITION(n,t,o.id))},[n,t,i])}const OX=e=>{const{translate:n,params:{eventId:t}}=Kl(),{showNotification:s}=AS(),{mutate:o}=Kd(),a=[];return e.position.assignedResources>0&&a.push(n("_1_membre_est_66702",e.position.assignedResources)),(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_01544"),n("cela_supprimera_15744"),...a],text:n("suppression_de_73669",e.position.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:t,selecteds:{ids:[e.position.id]}}),s(n("la_mission_1_45985",e.position.name)),e.onSuccess()}})},RX=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl(),o=zX(),{hasEventRole:a}=BS(),{canPositionEdit:r}=oy(),[d,l]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1),m=a&&r;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",to:yo.EDIT_POSITION(n,t,e.position.id),children:s("_diter_62574")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{await o(e.position.id)},children:s("dupliquer_28256")}),(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{l(!0),Tu(e.target)},children:s("supprimer_43083")})]}),(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"plus",to:yo.CREATE_POSITION(n,t,e.position.category.id),children:s("ajouter_une_mis_99800")}),(0,i.jsx)(Pu,{icon:"eye",to:oo.POSITION_CATEGORY({organizationId:n,eventId:t,positionCategoryId:e.position.category.id}),children:s("voir_1_90465",e.position.category.name)}),m&&(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{u(!0)},children:s("renommer_1_40542",e.position.category.name)})]})]}),d&&(0,i.jsx)(OX,{position:e.position,onClose:()=>{l(!1)},onSuccess:e.reload}),c&&(0,i.jsx)(kK,{eventId:t,positionCategoryId:e.position.category.id,positionCategoryName:e.position.category.name,onClose:()=>{u(!1)},onSuccess:e.reload})]})},DX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl();return(0,i.jsxs)(ly,{permissions:sy.POSITION_EDIT,scope:{positionCategoryId:e.position.category.id},children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",to:yo.EDIT_POSITION(t,s,e.position.id)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(RX,{position:e.position,reload:e.reload})]})},MX=e=>{const n=(0,V.useMemo)(()=>(e.position.category?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},PX=e=>{const n=(0,V.useMemo)(()=>(e.position?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(pA,{badges:n})})},kX=e=>{const{translate:n}=Kl();return(0,i.jsx)(oX,{column:e.column,initialValue:e.position.weezeventIsSynchronized,positionId:e.position.id,property:vn.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Up,{label:n("WeezeventIsSynchronized"),shouldParseAsBoolean:!0,value:e,onChange:t,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]}),renderValue:e.position.weezeventIsSynchronized?n("oui_54361"):n("non_33516"),updatable:e.updatable})},FX=e=>{const{translate:n}=Kl(),t=ki(Jm),{mutate:s}=Oa(),o=(0,V.useCallback)((n,t)=>s({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:t,strategy:hn.Replace,value:n}}),[e.row,s]),a=(0,V.useMemo)(()=>{if(e.row.range){const n=e.row.range.start,i=e.row.range.end;return n.startOf("day").equals(i.startOf("day"))?t.toLocaleString(n,Uo.DateOnly.MonthShort):`${t.toLocaleString(n,Uo.DateOnly.MonthShort)} → ${t.toLocaleString(i,Uo.DateOnly.MonthShort)}`}return"-"},[e.row]),{hasEventRole:r}=BS(),{canPositionEdit:d}=oy(),l=r&&d;return e.column.slug==ZK.Id?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===ZK.Category?(0,i.jsx)(uX,{column:e.column,positionCategory:e.row.category,positionId:e.row.id,reload:e.reloadRow,updatable:l}):e.column.slug===ZK.Name?(0,i.jsx)(xX,{column:e.column,position:e.row,reload:e.reloadRow,updatable:d}):e.column.slug===ZK.Description?(0,i.jsx)(hX,{column:e.column,position:e.row,reload:e.reloadRow,updatable:d}):e.column.slug===ZK.Slot?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Tl,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:a}),(0,i.jsx)(Mr,{color:"gray500",children:n("creneau",e.row.numberOfSlots)})]})}):e.column.slug===ZK.SlotName?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===ZK.MaxResources||e.column.slug===ZK.AssignedResources?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(TF,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===ZK.Tags?(0,i.jsx)(_X,{column:e.column,position:e.row,reload:e.reloadRow,updatable:d}):e.column.slug===ZK.Conditions?(0,i.jsx)(gX,{column:e.column,position:e.row}):e.column.slug===ZK.Address?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===ZK.Layer?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.layer===gn.Google?"Plan":e.row.layer===gn.GoogleSatellite?"Satellite":"IGN Plan"}):e.column.slug===ZK.Traces?(0,i.jsx)(jX,{column:e.column,position:e.row}):e.column.slug===ZK.Zoom?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.zoom}):e.column.slug===ZK.Latitude?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===ZK.Longitude?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):"isVisible"===e.column.slug?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Tl,{align:"center",gap:"3",width:1,children:e.row.isVisible?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"square-check"})}),(0,i.jsx)(Mr,{children:n("visible_27909")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"square"})}),(0,i.jsx)(Mr,{children:n("non_visible_30040")})]})})}):e.column.slug===ZK.Acronym?(0,i.jsx)(aX,{column:e.column,position:e.row,reload:e.reloadRow,updatable:d}):e.column.slug===ZK.Color?(0,i.jsx)(mX,{column:e.column,position:e.row,reload:e.reloadRow,updatable:d}):e.column.slug===ZK.Icon?(0,i.jsx)(pX,{column:e.column,position:e.row,reload:e.reloadRow,updatable:d}):e.column.slug===ZK.IconColor?(0,i.jsx)(IX,{column:e.column,position:e.row,reload:e.reloadRow,updatable:d}):e.column.slug===ZK.State?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===wn.Full?(0,i.jsx)(Ku,{color:"success",children:n(e.row.state)}):(0,i.jsx)(Ku,{color:"warning",children:n(e.row.state)})}):e.column.slug===ZK.FillingRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===ZK.CheckedInRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug===ZK.CheckedOutRate?(0,i.jsxs)($m,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedOutRate||0,"%"]}):e.column.slug===ZK.CreatedAt?(0,i.jsx)($k,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===ZK.CreatedBy?(0,i.jsx)(Tk,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===ZK.Leaders?(0,i.jsx)(PX,{column:e.column,position:e.row}):e.column.slug===ZK.CategoryLeaders?(0,i.jsx)(MX,{column:e.column,position:e.row}):e.column.slug===ZK.WeezeventIsSynchronized?(0,i.jsx)(kX,{column:e.column,position:e.row,reload:e.reloadRow,updatable:d}):e.column.slug===ZK.WeezeventChecklistId?(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):(0,i.jsx)(jA,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:d})},NX=e=>{const{params:{eventId:n}}=Kl(),t=Kb(e.customFields);return(0,i.jsx)(kx,{renderCell:(e,s,o)=>(0,i.jsx)(FX,{column:e,customField:t.get(e.slug),eventId:n,reloadRow:o,row:s}),renderRowDropdown:(e,n)=>(0,i.jsx)(DX,{position:e,reload:n})})},LX=e=>{const n=Fi();return wu(e.onClose),Eu(e.onClose),(0,i.jsxs)(Tl,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("acronym")},children:[(0,i.jsx)(Mr,{fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"text"})}),(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},children:n("acronymes_11499")}),"acronym"===e.selectedAcronymIcon&&(0,i.jsx)(Tl,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Yl,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Ar.colors.primary600.value})})]}),(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("icon")},children:[(0,i.jsx)(Mr,{fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"location-dot"})}),(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},children:n("ic_nes_16022")}),"icon"===e.selectedAcronymIcon&&(0,i.jsx)(Tl,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Yl,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Ar.colors.primary600.value})})]})]})},UX=e=>(wu(e.onClose),Eu(e.onClose),(0,i.jsxs)(Tl,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a3")},children:(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},children:"A3 (420 x 297 mm)"})}),(0,i.jsx)(Tl,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a4")},children:(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},children:"A4 (297 x 210 mm)"})})]})),VX=e=>(0,i.jsxs)(Tl,{align:"center",css:{cursor:"pointer",py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",onClick:e.onClick,children:[(0,i.jsx)(Mr,{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)(Mr,{css:{flex:"1"},children:e.name}),e.isSelected&&(0,i.jsx)(Tl,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(Yl,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Ar.colors.primary600.value})})]}),BX=e=>{const n=Fi();return wu(e.onClose),Eu(e.onClose),(0,i.jsxs)(Tl,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(VX,{imageSrc:su.Maps.GooglePlan,isSelected:e.selectedLayer===gn.Google,name:"Plan",onClick:()=>{e.onChange(gn.Google)}}),(0,i.jsx)(VX,{imageSrc:su.Maps.GoogleSatellite,isSelected:e.selectedLayer===gn.GoogleSatellite,name:n("satellite_82253"),onClick:()=>{e.onChange(gn.GoogleSatellite)}}),(0,i.jsx)(VX,{imageSrc:su.Maps.IgnPlan,isSelected:e.selectedLayer===gn.IgnPlan,name:"IGN Plan",onClick:()=>{e.onChange(gn.IgnPlan)}})]})},WX=e=>(0,i.jsxs)(Tl,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",height:"48px",minWidth:"180px",padding:"$2 $3",userSelect:"none"},gap:"3",onClick:n=>{jc(n),e.onClick()},children:[e.children,(0,i.jsx)(Mr,{color:"gray700",children:e.isOpen?(0,i.jsx)(Yl,{icon:"chevron-up"}):(0,i.jsx)(Yl,{icon:"chevron-down"})})]});let GX=class extends Rc{constructor(e){super(e)}traceInputDefault(e){return{name:e?.name??"",color:e?.color??Ar.colors.primary500.value,points:e?.points??[],direction:e?.direction??Xn.None,startAt:e?.startAt??null,firstRunnerPace:e?.firstRunnerPace??null,lastRunnerPace:e?.lastRunnerPace??null}}traceInputSchema(e){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_du_trac_39859")),color:zc.Yj().required(this.t("la_couleur_du_t_36646")),points:zc.YO().required(this.t("le_trac_doit_c_20895")).min(2,this.t("le_trac_doit_c_20895")),startAt:zc.gl().nullable().test("start-at-during-event",this.t("l_heure_de_d_pa_04968"),n=>!Oo.c9.isDateTime(n)||!n.isValid||n>=e.startAt&&n<=e.endAt.endOf("day")),firstRunnerPace:this.paceSchema(),lastRunnerPace:this.paceSchema()})}paceSchema(){return zc.ai().nullable().typeError(this.t("l_allure_doit_06495")).integer(this.t("l_allure_doit_06495")).positive(this.t("l_allure_doit_06495"))}createTraceSchema(e){return zc.Ik().shape({trace:this.traceInputSchema(e)})}updateNameSchema(){return zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_du_trac_39859"))})}};GX=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],GX);const qX=Zw,HX=Yw,YX=qw,ZX=Hw,KX=({fieldProps:e,hint:n,state:t,...s})=>{const[o,a]=(0,V.useState)(()=>{return"number"==typeof(n=e.input.value)&&Number.isFinite(n)?`${Math.floor(n/60)}:${(n%60).toString().padStart(2,"0")}`:"";var n}),r=_c(e.meta);return(0,i.jsx)(wc,{hint:r?e.meta.error:n,placeholder:"5:30",rightText:"min/km",state:r?"error":t,value:o,onBlur:e.input.onBlur,onChange:n=>{a(n),e.input.onChange(function(e){if(g(e)){const n=Yg(e.trim());return n&&n[1]<60?60*n[0]+n[1]:NaN}return null}(n))},onFocus:e.input.onFocus,...s})},XX=({name:e,...n})=>(0,i.jsx)(Dl.D0,{name:e,render:e=>(0,i.jsx)(KX,{fieldProps:e,...n})});function QX(e){const n=e.replace(/<\?xml(.*)\?>/,""),t=(new DOMParser).parseFromString(n,"text/xml");if(0!==t.querySelectorAll("parsererror").length)throw new Error("Could not parse: "+e);return t}const JX=e=>{const n=parseFloat(e.getAttribute("lat")),t=parseFloat(e.getAttribute("lon")),i=parseFloat(e.querySelector("ele")?.textContent??"");return isNaN(n)||isNaN(t)?[]:isNaN(i)?[[n,t]]:[[n,t,i]]},eQ=e=>{const n=Fi(),t=ki(GX),s=ki(Ol),[o,a]=(0,V.useState)({name:e.trace?`${m(e.trace.name)}.gpx`:"",content:""}),{mutate:r,isLoading:d}=function(e={}){return Ui("mutation TraceCreate($eventId: EventId!, $trace: TraceInput!) {\n traceCreate(eventId: $eventId, trace: $trace) {\n id\n }\n}\n",e)}(),{mutate:l,isLoading:c}=function(e={}){return Ui("mutation TraceUpdate($eventId: EventId!, $traceId: TraceId!, $trace: TraceInput!) {\n traceUpdate(eventId: $eventId, traceId: $traceId, trace: $trace) {\n id\n }\n}\n",e)}(),{descId:u,labelId:g}=Sc();return(0,i.jsx)(xc,{hideDefaultErrors:!0,initialValues:{trace:t.traceInputDefault(e.trace)},render:({form:t,handleSubmit:s})=>(0,i.jsxs)(qX,{descId:u,isOpen:!0,labelId:g,setIsOpen:n=>{n||e.onClose()},size:"md",children:[(0,i.jsx)(HX,{heading:(0,i.jsx)(dc,{id:g,children:e.traceId?n("modifier_le_tra_68754"):n("ajouter_un_trac_05425")}),leftIcon:"route",leftIconBorder:"gray200",leftIconColor:"gray800",setIsOpen:e.onClose}),(0,i.jsx)(YX,{id:u,children:(0,i.jsxs)(Tl,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:[(0,i.jsx)(hc,{}),(0,i.jsx)($c,{label:n("nom_du_trac_16379"),name:"trace.name",placeholder:n("nom_du_trac_16379")}),(0,i.jsx)(AY,{accept:gv.Gpx,format:"string",label:n("fichier_gpx_55484"),placeholder:n("s_lectionnez_un_17918"),value:o,onChange:e=>{a(e),t.change("trace.points",function(e){const n=QX(e),t=Array.from(n.querySelectorAll("trk trkseg trkpt")),i=Array.from(n.querySelectorAll("wpt")),s=Array.from(n.querySelectorAll("rte rtept"));return t.length>0?t.flatMap(JX):i.length>0?i.flatMap(JX):s.flatMap(JX)}(e.content))}}),(0,i.jsx)(DC,{label:n("couleur_du_trac_28854"),name:"trace.color"}),(0,i.jsxs)(ny,{label:n("sens_du_trac_49290"),name:"trace.direction",children:[(0,i.jsx)("option",{value:Xn.None,children:n("aucun_93456")}),(0,i.jsx)("option",{value:Xn.Forward,children:n("en_avant_17614")}),(0,i.jsx)("option",{value:Xn.Backward,children:n("en_arri_re_24636")})]}),(0,i.jsx)(MC,{label:(0,i.jsx)(Uv,{children:n("heure_de_d_part_43498")}),max:e.event.endAt.endOf("day"),min:e.event.startAt,name:"trace.startAt"}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(XX,{label:(0,i.jsx)(Uv,{children:n("allure_du_premi_20993")}),name:"trace.firstRunnerPace"}),(0,i.jsx)(XX,{label:(0,i.jsx)(Uv,{children:n("allure_du_derni_15048")}),name:"trace.lastRunnerPace"})]})]})}),(0,i.jsx)(ZX,{handleSubmit:s,isLoading:d||c,setIsOpen:e.onClose,submitText:e.traceId?n("mettre_jour_85141"):n("ajouter_97327")})]}),validate:s.validateForForm(t.createTraceSchema(e.event)),onSubmit:async n=>{const t={...n.trace,startAt:n.trace.startAt?.isValid?n.trace.startAt:null};e.traceId?await l({eventId:e.eventId,traceId:e.traceId,trace:t}):await r({eventId:e.eventId,trace:t}),e.onClose(),e.reload()}})},nQ=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("mutation TraceDelete($eventId: EventId!, $traceId: TraceId!) {\n traceDelete(eventId: $eventId, traceId: $traceId) {\n id\n }\n}\n",e)}(),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(!1);return(0,i.jsxs)(Tl,{align:"center",css:{py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",children:[(0,i.jsx)(Mr,{css:{background:e.trace.color,borderRadius:"$1",height:"16px",width:"16px"}}),(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1",ellipsis:!0},children:e.trace.name}),(0,i.jsx)(Mr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{e.toggleVisible(e.trace.id)},children:(0,i.jsx)(Yl,{icon:e.isHidden?"eye-slash":"eye"})}),(0,i.jsx)(Mr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>r(!0),children:(0,i.jsx)(Yl,{icon:"pen"})}),(0,i.jsx)(Mr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>o(!0),children:(0,i.jsx)(Yl,{icon:"xmark"})}),s&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_34035"),text:n("suppression_de_73669",e.trace.name),onClose:()=>o(!1),onDelete:async()=>{await t({eventId:e.eventId,traceId:e.trace.id}),e.reload()}}),a&&(0,i.jsx)(eQ,{event:e.event,eventId:e.eventId,reload:e.reload,trace:e.trace,traceId:e.trace.id,onClose:()=>r(!1)})]})},tQ=e=>{const n=Fi();return wu(e.onClose),Eu(e.onClose),(0,i.jsxs)(Tl,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"240px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[e.traces.map(n=>(0,i.jsx)(nQ,{event:e.event,eventId:e.eventId,isHidden:e.hiddenTracesIds.includes(n.id),reload:e.reload,toggleVisible:e.toggleVisible,trace:n},n.id)),(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer",py:"$2"},onClick:()=>{e.onAddTrace(),e.onClose()},children:n("ajouter_un_trac_05425")})]})},iQ=e=>{const{translate:n,params:{eventId:t}}=Kl(),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(!1),[d,l]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1),[m,g]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{bottom:"12px",left:"12px",position:"absolute",zIndex:10},gap:"2",children:[(0,i.jsx)(Tl,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",fontSize:"$textLg"},height:48,justify:"center",width:48,onClick:()=>{e.onFullscreen()},children:(0,i.jsx)(Yl,{icon:"expand"})}),(0,i.jsxs)(WX,{isOpen:s,onClick:()=>{o(e=>!e),r(()=>!1),l(()=>!1),u(()=>!1)},children:[(0,i.jsx)(Mr,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32px"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:e.layer===gn.Google?su.Maps.GooglePlan:e.layer===gn.GoogleSatellite?su.Maps.GoogleSatellite:su.Maps.IgnPlan,width:"32px"})}),(0,i.jsx)(Mr,{color:"gray900",css:{flex:"1"},children:e.layer===gn.Google?"Plan":e.layer===gn.GoogleSatellite?n("satellite_82253"):"IGN Plan"})]}),(0,i.jsx)(WX,{isOpen:a,onClick:()=>{o(()=>!1),r(e=>!e),l(()=>!1),u(()=>!1)},children:(0,i.jsxs)(Tl,{align:"center",css:{flex:"1"},gap:"1",children:[(0,i.jsx)(Mr,{color:"gray900",children:n("Traces")}),(0,i.jsx)(Pl,{width:"1"}),e.traces.map(e=>(0,i.jsx)(Mr,{css:{background:e.color,borderRadius:"$1",height:"16px",width:"16px"}},e.id))]})}),e.showAcronymIcon&&(0,i.jsx)(WX,{isOpen:d,onClick:()=>{o(()=>!1),r(()=>!1),l(e=>!e),u(()=>!1)},children:(0,i.jsxs)(Tl,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Mr,{fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"acronym"===e.acronymIcon?"text":"location-dot"})}),(0,i.jsx)(Mr,{color:"gray900",children:"acronym"===e.acronymIcon?n("acronymes_11499"):n("ic_nes_16022")})]})}),e.showExport&&(0,i.jsx)(WX,{isOpen:c,onClick:()=>{o(()=>!1),r(()=>!1),l(()=>!1),u(e=>!e)},children:(0,i.jsxs)(Tl,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Mr,{fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"file-export"})}),(0,i.jsx)(Mr,{color:"gray900",children:n("exporter_59120")})]})})]}),s&&(0,i.jsx)(Mr,{css:{bottom:"64px",left:"68px",position:"absolute",zIndex:10},children:(0,i.jsx)(BX,{selectedLayer:e.layer,onChange:e.setLayer,onClose:()=>o(!1)})}),a&&(0,i.jsx)(Mr,{css:{bottom:"64px",left:"256px",position:"absolute",zIndex:10},children:(0,i.jsx)(tQ,{event:e.event,eventId:t,hiddenTracesIds:e.hiddenTracesIds,reload:e.reload,toggleVisible:n=>{e.setHiddenTracesIds(Xo(e.hiddenTracesIds,n))},traces:e.traces,onAddTrace:()=>{g(!0)},onClose:()=>{r(!1)}})}),m&&(0,i.jsx)(eQ,{event:e.event,eventId:t,reload:e.reload,onClose:()=>{g(!1)}}),d&&(0,i.jsx)(Mr,{css:{bottom:"64px",left:"444px",position:"absolute",zIndex:10},children:(0,i.jsx)(LX,{selectedAcronymIcon:e.acronymIcon,onChange:e.setAcronymIcon,onClose:()=>l(!1)})}),c&&(0,i.jsx)(Mr,{css:{bottom:"64px",left:"632px",position:"absolute",zIndex:10},children:(0,i.jsx)(UX,{onClose:()=>u(!1),onExport:e.onExport})})]})};function sQ(e,n,t,i){t.current.forEach(e=>e.setMap(null)),t.current=e.map(e=>{const t=e.points.map(([e,n])=>({lat:e,lng:n})),s=e.direction===Xn.None?[]:[{icon:{path:e.direction===Xn.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:e.color},offset:"0%",repeat:"200px"}],o=new google.maps.Polyline({path:t,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,visible:!n.includes(e.id),icons:s});return o.setMap(i.current),o})}const oQ=(0,V.memo)(e=>{const n=(0,V.useCallback)(n=>{n&&(t.current&&(s.current?.setMap(null),o.current?.setMap(null),t.current=null),t.current=new google.maps.Map(n,{...e.mapOptions??{},...Gr(e.initialCenter,e.initialZoom,e.layer)}),t.current.mapTypes.set(gn.IgnPlan,Kr()),s.current=new google.maps.OverlayView,s.current.draw=Bc.A,s.current.setMap(t.current),t.current.addListener("drag",()=>{e.onMapDrag?.()}),t.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:t.current.getCenter().lat(),lng:t.current.getCenter().lng()})}),t.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(t.current.getZoom())}),t.current.addListener("click",n=>{e.showMarker&&(o.current?.setMap(null),o.current=new google.maps.Marker({position:n.latLng,map:t.current,draggable:!0}),e.onMarkerDragEnd?.(n.latLng.lat(),n.latLng.lng()),o.current.addListener("dragend",()=>{const n=o.current.getPosition();e.onMarkerDragEnd?.(n.lat(),n.lng())}))}),t.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),d(),sQ(e.traces,e.hiddenTracesIds,r,t))},[]),t=(0,V.useRef)(null),s=(0,V.useRef)(null),o=(0,V.useRef)(null),a=(0,V.useRef)([]),r=(0,V.useRef)([]),d=()=>{a.current.forEach(e=>e.setMap(null)),a.current=e.positions.map(n=>{const i=Vr(qr(n)),o=new google.maps.Marker({position:i,map:t.current,icon:"acronym"===e.acronymIcon?`${F.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent(n.color)}&text=${n.acronym}`:`${F.HEAVENT_API_URL}/icons/${Hl(n.icon)}.svg?color=${encodeURIComponent(n.color)}`});return o.addListener("click",()=>{const t=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));t&&e.onPositionClick?.(n,t)}),o})};return(0,V.useEffect)(()=>{d()},[JSON.stringify(e.positions),e.acronymIcon]),(0,V.useEffect)(()=>{t.current?.setMapTypeId(Hr(e.layer))},[e.layer]),(0,V.useEffect)(()=>{sQ(e.traces,e.hiddenTracesIds,r,t)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(Mr,{ref:n,height:1,width:1})},Yr.A);oQ.displayName="PositionsMap";const aQ=e=>{const{organizationId:n,eventId:t}=Vi(),s=ki(Bg);return(0,i.jsx)(Tl,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:70,children:(0,i.jsxs)(ql,{to:oo.POSITION({organizationId:n,eventId:t,positionId:e.position.id}),children:[(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{color:"gray800",children:e.position.name}),(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",children:e.position.range?s.toDisplayString(e.position.range):"-"})]}),(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"chevron-right"})})]})})},rQ=e=>{const{translate:n,params:{eventId:t,segmentId:s}}=Kl(),{event:o,localEvent:a,updateLocalEvent:r}=BS(),{canPositionEdit:d}=oy(),{mutate:l}=Ca(),{setNewPositionLatLng:c}=lX(),[u,m]=(0,V.useState)(e.layer),[g,h]=(0,V.useState)([]),[p,I]=(0,V.useState)(null),[x,f]=zD("positionsMap.center",e.center),[_,j]=zD("positionsMap.zoom",Wr),[v,S]=zD("positionsMap.acronymIcon","icon"),[y,C]=(0,V.useState)(a?.isPositionsMapAlertVisible??!0),b=(0,V.useRef)(null),A=(0,V.useCallback)(e=>{const n=x?`${x.lat},${x.lng}`:"",i=new URLSearchParams;i.set("format",e),i.set("hiddenTracesIds",g.join(",")),i.set("center",n),i.set("acronymIcon",v),i.set("zoom",_.toString(10)),window.open(`${F.HEAVENT_API_URL}/image/event/${t}/positions/${s}/map.png?${i.toString()}`)},[x,_,g,v]);return(0,i.jsxs)(Tl,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[d&&y&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{alertStyle:"primary",onClose:async()=>{await r({isPositionsMapAlertVisible:!1}),C(!1)},children:(0,i.jsx)(uc,{children:n("pour_cr_er_une_11133")})}),(0,i.jsx)(Pl,{height:"6"})]}),(0,i.jsx)(Mr,{ref:b,css:{flex:"1",borderRadius:"$1"},width:1,children:(0,i.jsx)(oQ,{acronymIcon:v,hiddenTracesIds:g,initialCenter:x,initialZoom:_,layer:u,positions:e.positions,showMarker:d,traces:e.traces,onMapCenterChanged:f,onMapDrag:()=>I(null),onMapZoomchanged:e=>{I(null),j(e)},onMarkerDragEnd:(e,n)=>c({latitude:e,longitude:n}),onPositionClick:(e,n)=>I({position:e,left:n.x,top:n.y})})}),d&&(0,i.jsx)(iQ,{acronymIcon:v,event:o,hiddenTracesIds:g,layer:u,reload:e.reload,setAcronymIcon:S,setHiddenTracesIds:h,setLayer:async e=>{m(e),await l({eventId:t,layer:e})},showAcronymIcon:!0,showExport:!0,traces:e.traces,onExport:A,onFullscreen:()=>{b.current?.requestFullscreen()}}),b.current&&p&&(0,St.createPortal)((0,i.jsx)(Mr,{css:{left:`${p.left+32}px`,position:"absolute",top:p.top-35-16+"px",zIndex:10},children:(0,i.jsx)(aQ,{position:p.position})}),b.current)]})},dQ=e=>{const{params:{eventId:n}}=Kl(),{columns:t,rendering:s}=pg(),o=(0,V.useMemo)(()=>KK(t,s),[t,s]),{data:a,loader:r,reload:d}=(l={...o,eventId:n,name:g(e.name)?e.name:null,predicatesGroups:e.predicates,hasCoordinates:!0},Li(id,l,[$o.PositionsPositionFragment,$o.TraceFragment]));var l;return r?(0,i.jsx)(Tl,{css:{flex:"1"},children:r}):(0,i.jsx)(rQ,{center:P_(a.data),layer:a.data.layer,positions:a.data.rows.nodes,reload:d,traces:a.data.traces||[]})},lQ=e=>{const n=V.useMemo(()=>e.startOfDay.plus({day:1}).minus({second:1}),[e.startOfDay]),t=V.useMemo(()=>Oo.IX.fromDateTimes(e.startOfDay,n).overlaps(e.slot.range),[e.startOfDay,n,e.slot]),s=V.useMemo(()=>t?Oo.IX.fromDateTimes(Oo.c9.max(e.startOfDay,e.slot.range.start),Oo.c9.min(n,e.slot.range.end)):e.slot.range,[t,e.startOfDay,n,e.slot]),o=V.useMemo(()=>{const n=s.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*n.hours+n.minutes)},[e.startOfDay,s]),a=V.useMemo(()=>{const n=s.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*n.hours+n.minutes)},[e.startOfDay,s]);return t?(0,i.jsx)(Tl,{css:{gridColumnStart:o,gridColumnEnd:a},height:32,children:e.renderSlot(e.slot,e.row)},s.toISO()):null},cQ=e=>{const[n,t]=V.useState(null),s=V.useCallback(e=>{e&&t(e.getBoundingClientRect())},[]),[o,a]=V.useState(!1),[r,d]=V.useState(1),l=V.useMemo(()=>e.date.startOf("day").set({hour:e.startHour}),[e.date,e.startHour]),c=V.useCallback(e=>{const t=Math.floor(1440*(e.clientX-(n?.left??0))/(n?.width??0)),i=t-t%60+1;i!==r&&d(i)},[n,r,d]),u=V.useCallback(t=>{const i=Math.floor(1440*(t.clientX-(n?.left??0))/(n?.width??0)),s=i-i%60,o=l.plus({minute:s});e.onPlus?.(o,e.row)},[l,e.row,e.onPlus,n]);return(0,i.jsxs)(Tl,{className:"h-planning-data-row",css:{borderBottom:"1px solid $gray200"},width:1,children:[(0,i.jsx)(Tl,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"},children:e.renderLeftCell(e.row)}),(0,i.jsxs)(Tl,{css:{flex:"1",py:"$3",position:"relative"},children:[(0,i.jsx)(eu,{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:()=>{a(!1)},onMouseOver:()=>{a(!0)},children:e.row.slots.map((n,t)=>(0,i.jsx)(lQ,{renderSlot:e.renderSlot,row:e.row,slot:n,startOfDay:l},t))}),e.showPlus&&(0,i.jsx)(eu,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:5},gridtemplatecolumns:"repeat(1440, 1fr)",children:o&&(0,i.jsx)(Tl,{align:"center",css:{gridColumn:`${r} / span 60`,padding:"$1"},height:1,justify:"center",children:(0,i.jsx)(Tl,{align:"center",css:{background:"$gray100",borderRadius:"$1",color:"$gray800",cursor:"pointer",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(Yl,{icon:"plus"})})})}),(0,i.jsx)(eu,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1},gridtemplatecolumns:"repeat(1440, 1fr)",children:(0,Om.A)(0,23).map(e=>(0,i.jsx)(Mr,{css:{borderRightColor:"$gray200",borderInlineEndStyle:"dashed",borderInlineEndWidth:"1px","&:nth-child(2n)":{borderInlineEndStyle:"solid"},gridColumn:`${60*e+1} / ${60*e+61}`}},e))})]})]})},uQ=e=>{const n=ki(Jm),t=e.date.startOf("day").equals(e.minDate.startOf("day")),s=e.date.endOf("day").equals(e.maxDate.endOf("day"));return(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Tl,{css:{borderBottom:"1px solid $gray200"},height:52,width:1,children:[(0,i.jsxs)(Tl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:"calc(2 * $cellWidth)"},gap:"3",height:1,children:[(0,i.jsx)(Wp,{max:e.maxDate,min:e.minDate,value:e.date,onChange:e.onChange}),e.renderFilters?.()]}),(0,i.jsxs)(Tl,{align:"center",css:{flex:"1",px:"$2"},gap:"3",children:[(0,i.jsx)(tc,{color:"white",disabled:t,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.date.minus({day:1}))}}),(0,i.jsx)(Mr,{css:{flex:"1",textTransform:"capitalize"},font:"gray800 textSm medium",textAlign:"center",children:n.toLocaleString(e.date,Uo.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(tc,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.date.plus({day:1}))}})]})]}),(0,i.jsxs)(Tl,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(Tl,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"}}),(0,i.jsx)(Tl,{css:{flex:"1"},children:(0,i.jsxs)(eu,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(Mr,{css:{gridColumn:"span 60"}}),(0,Om.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(Tl,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,GZ.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.data.map(n=>(0,i.jsx)(cQ,{date:e.date,renderLeftCell:e.renderLeftCell,renderSlot:e.renderSlot,row:n,showPlus:e.showPlus,startHour:e.startHour,onPlus:e.onPlus},n.id.toString(10)))]})},mQ=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),s=g(e.position.acronym)?e.position.acronym:e.position.name;return(0,i.jsxs)(Tl,{css:{padding:"$1 $4"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Xm,{css:{overflow:"hidden",width:"100%"},to:oo.POSITION({organizationId:n,eventId:t,positionId:e.position.id}),children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:s,width:1,children:s})}),(0,i.jsx)(Mr,{color:"gray500",css:{ellipsis:!0},title:e.position.category.name,width:1,children:e.position.category.name})]})},gQ=({shouldShowAssignButton:e=!0,...n})=>{const{translate:t,params:{organizationId:s,eventId:o}}=Kl(),a=ki(Bg),r="number"==typeof n.slot.assignedResources&&"number"==typeof n.slot.fillingRate&&"number"==typeof n.slot.resources;return(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsxs)(Tl,{css:{borderBottom:"1px solid $gray200",padding:"$4 $3 $3 $6"},gap:"4",children:[(0,i.jsx)(xI,{color:n.position.color,icon:n.position.icon}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Xm,{to:oo.POSITION({organizationId:s,eventId:o,positionId:n.position.id}),children:(0,i.jsx)(Mr,{css:{ellipsis:!0},width:1,children:n.position.name})}),(0,i.jsx)(Mr,{color:"gray500",children:n.category.name})]})]}),(0,i.jsxs)(Tl,{css:{padding:"$5 $6 $4 $6"},direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:g(n.slot.name)?n.slot.name:"-"})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{color:"gray500",children:t("cr_neau_horaire_28150")}),(0,i.jsx)(Mr,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:a.toDisplayString(n.slot.range,{formats:{displayWeekday:!0}})})]}),r&&(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",children:t("membres_11310")}),(0,i.jsxs)(Mr,{color:"gray500",children:[n.slot.assignedResources,"/",n.slot.resources]})]}),(0,i.jsx)(Mr,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:(0,i.jsx)(lF,{percent:n.slot.fillingRate/100})})]})]}),e&&(0,i.jsx)(Tl,{css:{padding:"$4"},gap:"4",justify:"end",children:(0,i.jsx)(tc,{to:yo.POSITION_SLOT_ASSIGN_VOLUNTEERS(s,o,n.position.id,n.slot.id),children:t("affecter_sur_le_19590")})})]})},hQ=e=>{const n=Zg(ki(Bg),e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}});return(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Tl,{align:"center",css:{background:Yu(e.slot.fillingRate/100),borderRadius:"$1",cursor:"pointer",px:"$2",userSelect:"none"},height:1,width:1,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"white textXs medium",title:n,width:1,children:n})})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(gQ,{category:e.position.category,position:e.position,slot:e.slot})})]})},pQ=e=>{const{params:{eventId:n}}=Kl(),t=ki(DK),{isEditMode:s,limit:o,nameDebounced:a,offset:r,predicates:d,setLimit:l,setOffset:c}=pg(),{infos:u,setInfos:m}=ok(),{mutate:h}=function(e={}){return Ui("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:I}=Li("query PositionsPlanning(\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n rows: positions(\n name: $name\n predicatesGroups: $predicatesGroups\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...PositionPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,name:g(a)?a:void 0,predicatesGroups:d,limit:o,offset:r},[$o.PositionPlanningFragment]);const{numberOfPages:x,totalCount:f}=Sx(p.data?.rows),[_,j]=(0,V.useState)([]),v=(0,V.useMemo)(()=>Oo.c9.isDateTime(u.positionsPlanningStartAt)&&u.positionsPlanningStartAt?.isValid?u.positionsPlanningStartAt:Oo.c9.fromISO(u.positionsPlanningStartAt)?.isValid?Oo.c9.fromISO(u.positionsPlanningStartAt,{zone:"utc"}):Oo.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Oo.c9.utc())?Oo.c9.utc():e.startAt,[e.startAt,e.endAt,u]),S=(0,V.useCallback)(n=>{m({...u,positionsPlanningStartAt:n?.toISO()??e.startAt.toISO()})},[e.startAt,u,m]),[y,C]=(0,V.useState)(!1),[b,A]=(0,V.useState)(e.startAt),[E,w]=(0,V.useState)(-1),$=(0,V.useMemo)(()=>{const n=Yg(e.dayStartTime);return n?.[0]??0},[e.dayStartTime]),T=(0,V.useCallback)(async e=>{const{data:{row:t}}=await function(e,n){return oa("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:n||void 0,fragments:[$o.PositionPlanningFragment]})}({eventId:n,positionId:e},await X());j(n=>n.map(n=>n.id===e?t:n))},[n]);return(0,V.useEffect)(()=>{j(p.data?.rows.nodes??[])},[p.data]),I||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Tl,{css:{background:"white",flex:"1"},children:(0,i.jsx)(uQ,{data:_,date:v,maxDate:e.endAt,minDate:e.startAt,renderLeftCell:e=>(0,i.jsx)(mQ,{position:e}),renderSlot:(e,n)=>(0,i.jsx)(hQ,{position:n,slot:e}),showPlus:s,startHour:$,onChange:S,onPlus:(e,n)=>{A(e),C(!0),w(n.id)}})}),(0,i.jsx)(Fm,{children:(0,i.jsx)(Pm,{limit:o,numberOfPages:x,offset:r,setLimit:l,setOffset:c,showLimits:!0,totalCount:f})})]}),y&&(0,i.jsx)(LK,{event:{endAt:e.endAt,startAt:e.startAt},slot:t.positionsSlotInputDefault(b),onClose:()=>{C(!1)},onSuccess:async e=>(await h({eventId:n,positionId:E,positionSlot:e}),T(E))})]})};function IQ(e,n,t,i){const s=QX(e),o=(e=>Object.fromEntries(Array.from(e.querySelectorAll("Style")).map(e=>{const n=e.getAttribute("id"),[,,t,i,s,o,a,r]=(e.querySelector("color")?.textContent||"").trim().split("");return[`#${n}`,`#${a}${r}${s}${o}${t}${i}`]})))(s);return Array.from(s.querySelectorAll("Placemark")).map(e=>((e,n,t,i,s)=>{const[o,a]=(e.querySelector("Point coordinates")?.textContent||"").trim().split(",");return{positionCategoryId:n,name:(e.querySelector("name")?.textContent||"").trim(),description:(e.querySelector("description")?.textContent||"").trim(),privateNote:"",color:s[`${e.querySelector("styleUrl")?.textContent||""}-normal`]||Ar.colors.primary500.value,icon:rn.LocationDot,weezeventIsSynchronized:!1,layer:t,latitude:parseFloat(a),longitude:parseFloat(o),tracesIds:[],slots:[{startDate:i,startTime:"08:00",endDate:i,endTime:"09:00",resources:1}],positionDisplay:jn.List,conditionsOperator:be.And,positionsCustomFields:[],tagsIds:[],fields:{},leadersIds:[]}})(e,n,t,i,o))}const xQ=e=>{const n=Fi(),{data:t,loader:s}=Li("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:a}=function(e={}){return Ui("mutation PositionsCreate($eventId: EventId!, $positions: [PositionInput!]!) {\n positionsCreate(eventId: $eventId, positions: $positions) {\n id\n }\n}\n",e)}(),[r,d]=(0,V.useState)(),[l,c]=(0,V.useState)(-1),u=g(r?.content)&&-1!==l;return(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Mr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(Yl,{icon:"cloud-arrow-up"})}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:n("importer_des_mi_32264")}),(0,i.jsx)(Pl,{height:"7"}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AY,{accept:gv.Kml,format:"string",label:n("fichier_kml_55657"),placeholder:n("s_lectionnez_un_75984"),value:r,onChange:e=>{d(e)}}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsxs)(Up,{label:n("cat_gorie_00291"),shouldParseAsInt:!0,value:l??-1,onChange:e=>{c(e)},children:[(0,i.jsx)("option",{disabled:!0,value:"-1",children:n("choisissez_la_c_72356")}),t.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[(0,i.jsx)(tc,{disabled:!u,isLoading:a,onClick:async()=>{r&&(await o({eventId:e.eventId,positions:IQ(r.content,l,t.event.layer,t.event.startAt)}),window.location.reload())},children:n("importer_90688")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},fQ=({name:e,numberOfCategories:n,segment:t})=>{const{history:s,params:{organizationId:o,eventId:a},translate:r}=Kl(),{columns:d}=pg(),{user:l}=Yi(),{hasFeature:c}=XS(),{hasPermission:u}=BS(),{newPositionLatLng:m}=lX(),{data:g,isLoading:h}=Li("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:a,segmentId:t.id},[]);const{mutate:p}=function(e={}){return Ui("mutation PositionsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: positionsExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}(),[I,x]=(0,V.useState)(!1),[f,_]=(0,V.useState)(!1),[j,v]=(0,V.useState)(!1),{checkExport:S}=AS(),[y,C]=(0,V.useState)(!1),[b,A]=(0,V.useState)(!1),E=u(sy.POSITION_EDIT,{eventId:"ANY"}),w=u(sy.POSITION_EDIT,{positionCategoryId:"ANY"}),$=(0,V.useMemo)(()=>{let e;return m&&(e=`${m.latitude},${m.longitude}`),yo.CREATE_POSITION(o,a,e)},[m]);return(0,i.jsxs)(kk,{name:(0,i.jsxs)(Tl,{align:"center",css:{flex:"1",overflow:"hidden",position:"relative"},gap:"2",children:[(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray900 displayXs medium",title:e,children:e}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"gray500",children:(0,i.jsx)(Yl,{icon:"circle-exclamation"})})}),(0,i.jsxs)(Dx,{placement:"bottom-start",renderOnPortal:!0,children:[r("nombre_de_missi_06171",g.event?.segment.count??0),(0,i.jsx)("br",{}),r("nombre_de_membr_16367",g.event?.segment.stats?.assignedResources??0),(0,i.jsx)("br",{}),r("nombre_de_membr_29724",g.event?.segment.stats?.resources??0)]})]})]}),children:[E?(0,i.jsx)(Fz,{menu:(0,i.jsxs)(i.Fragment,{children:[c(Ze.KmlImport)&&(0,i.jsx)(Pu,{color:0===n?"disabled":"default",icon:"file-import",onClick:()=>{x(!1),A(!0)},children:r("importer_des_mi_32264")}),(0,i.jsx)(Pu,{icon:"file-import",to:oo.POSITION_IMPORT_CSV({organizationId:o,eventId:a}),children:r("import_tasks_fr_52548")})]}),path:$,children:r("cr_er_une_missi_66818")}):w?(0,i.jsx)(tc,{onClick:()=>{s.push($)},children:r("cr_er_une_missi_66818")}):null,E&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ou,{isOpen:I,onStateChange:x,children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"plus",onClick:()=>{x(!1),C(!0)},children:r("cr_er_une_cat_g_20051")})}),(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"calendar",to:Ef(g.event?.segment.links.positionsPlanningLink,"html"),children:r("voir_le_plannin_85187")}),(0,i.jsx)(Pu,{icon:"calendar",to:Ef(g.event?.segment.links.positionsVolunteersPlanningLink,"html"),children:r("voir_le_plannin_47650")}),(0,i.jsxs)(ly,{permissions:sy.POSITION_EDIT,children:[(0,i.jsx)(Pu,{icon:"plug-circle-bolt",onClick:e=>{Tu(e.target),_(!0)},children:r("exporter_via_l_09843")}),(0,i.jsx)(Pu,{icon:"file-xls",onClick:e=>{Tu(e.target),v(!0)},children:r("exporter_en_exc_51862")})]}),(0,i.jsx)(Pu,{download:`${t.name}-positions-planning`,icon:"arrow-down-to-bracket",to:Ef(g.event?.segment.links.positionsPlanningLink,"pdf"),children:r("t_l_charger_le_06050")}),(0,i.jsx)(Pu,{download:`${t.name}-positions-volunteers-planning`,icon:"arrow-down-to-bracket",to:Ef(g.event?.segment.links.positionsVolunteersPlanningLink,"pdf"),children:r("t_l_charger_le_02952")})]})]})]}),y&&(0,i.jsx)(PK,{eventId:a,onClose:()=>{C(!1)},onSuccess:({id:e})=>{s.push(oo.POSITION_CATEGORY({organizationId:o,eventId:a,positionCategoryId:e}))}}),b&&(0,i.jsx)(xQ,{eventId:a,onClose:()=>{A(!1)}}),!h&&(0,i.jsx)(_N,{isOpen:f,link:Af({organizationId:o,eventId:a,lang:l?.language,pathComponent:"positions",key:g.event.key}),onClose:()=>{_(!1)}}),!h&&(0,i.jsx)(jN,{isOpen:j,requestExport:async e=>{const{jobId:n}=await p({organizationId:o,eventId:a,segmentId:t.id,format:e,columns:d});S(n,o,a)},showIncludeFiles:!1,onClose:()=>{v(!1)}})]})]})},_Q=e=>{const n=Fi(),t=Wi(),{hasPermission:s,updateLocalEvent:o}=BS(),{limit:a,nameDebounced:r,predicates:d,rendering:l}=pg(),{segment:c}=ok(),u=s(sy.SEGMENT_EDIT)&&(l===Ih.List||l===Ih.SlotsList),m=s(sy.POSITION_EDIT,{eventId:"ANY"})&&(l===Ih.Calendar||l===Ih.List||l===Ih.SlotsList);return(0,V.useEffect)(()=>{o({positionBackPath:t.pathname,positionCategoryBackPath:t.pathname})},[c]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fQ,{name:c.name,numberOfCategories:e.event.positionsCategories.length,segment:c}),0===e.event.numberOfPositions&&l!==Ih.Map?(0,i.jsx)(yy,{css:{overflow:"hidden"},children:(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(UE,{subtitle:n("plus_besoin_de_08254"),title:n("vous_n_avez_pas_08610")})})}):(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:l===Ih.SlotsList?(0,i.jsx)(sX,{event:e.event}):(0,i.jsx)(TX,{}),searchPlaceholder:n("rechercher_une_69998"),showActions:s(sy.POSITION_EDIT),showEditColumns:u,showEditMode:m,showSearchColumns:s(sy.SEGMENT_EDIT)}),selectSegment:l===Ih.SlotsList?(0,i.jsx)(ap,{allSelectedText:n("les_1_cr_neau_33428",c.count,c.name),pageSelectedText:n("les_1_cr_neau_31538",a),selectAllText:n("s_lectionner_le_71777",c.count,c.name)}):(0,i.jsx)(ap,{allSelectedText:n("les_1_mission_38484",c.count,c.name),pageSelectedText:n("les_1_mission_95719",a),selectAllText:n("s_lectionner_le_71777",c.count,c.name)})}),l===Ih.List?(0,i.jsx)(NX,{customFields:e.customFields}):l===Ih.Map?(0,i.jsx)(dQ,{name:r,predicates:d}):l===Ih.SlotsList?(0,i.jsx)(bX,{customFields:e.customFields,event:e.event,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(pQ,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})]})]})},jQ={async loadDataList(e,n){const{event:t}=await function(e,n){return oa("query PositionsSlots(\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: PositionsSlotsSort\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeLeaders: Boolean!\n $includePositionTraces: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positionsSlots(\n name: $name\n predicatesGroups: $predicatesGroups\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",{variables:e,token:n||void 0,fragments:[$o.PositionsPositionSlotFragment]})}(e,n);return{data:{rows:t.positionsSlots}}},async loadRow(e,n){const{event:t}=await function(e,n){return oa("query PositionsPositionSlot(\n $eventId: EventId!\n $id: PositionsSlotId!\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeLeaders: Boolean!\n $includePositionTraces: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n positionSlot(id: $id) {\n ...PositionsPositionSlot\n }\n }\n}\n",{variables:e,token:n||void 0,fragments:[$o.PositionsPositionSlotFragment]})}(e,n);return{data:{row:t.positionSlot}}}},vQ=e=>e===Ih.SlotsList?jQ:e===Ih.List?{}:null,SQ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=Kl(),{hasPermission:r,localEvent:d,updateLocalEvent:l}=BS(),c=ki(XK),u=(0,V.useMemo)(()=>c.getPositionsFilters(e.event,e.customFields),[e.event,e.customFields]),m=(0,V.useMemo)(()=>c.getPositionsPossibleColumns(e.customFields,{isWeezeventConnected:e.event.isWeezeventConnected}),[e.customFields,e.event]);return(0,i.jsx)(dX,{eventId:o,organizationId:s,children:(0,i.jsx)(yk,{canSegmentEdit:r(sy.SEGMENT_EDIT),columnsToIncludes:KK,eventId:o,filters:u,filtersButtonText:t("filtrer_les_mis_43681"),filtersSubtitle:t("appliquer_des_f_16037"),getSegmentPath:e=>yo.POSITIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfPositions,initialLimit:d?.positionsLimit??Tm,initialSegmentsOpen:d?.arePositionsSegmentsOpen??!0,loadDataList:Qd,loadRow:Xd,organizationId:s,possibleColumns:m,possibleRenderings:[Ih.List,Ih.Calendar,Ih.Map,Ih.SlotsList],reload:e.reload,renderingLoaders:vQ,segmentId:a,segmentType:Bn.Positions,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{l({positionsLimit:e})},showMassActions:r(sy.POSITION_EDIT,{eventId:"ANY"}),showRowDropdown:r(sy.POSITION_EDIT),onSegmentClick:e=>{l({positionsSegmentId:e})},onSegmentDelete:async()=>{await l({positionsSegmentId:null}),n.push(oo.POSITIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await l({arePositionsSegmentsOpen:e})},children:(0,i.jsx)(_Q,{customFields:e.customFields,event:e.event,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},yQ=(0,V.memo)(function(){const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{event:{name:s},localEvent:o}=BS();Au(`${s} ${t("missions_63972")}`);const{data:a,loader:r,reload:d}=Li("query PositionsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, variety: Position) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n startAt\n endAt\n numberOfPositions\n dayStartTime\n isWeezeventConnected\n\n positionsCategories {\n id\n name\n\n leaders {\n ...LeaderInfos\n }\n }\n\n traces {\n id\n name\n }\n\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:n},[$o.SegmentCustomFieldFragment,$o.LeaderInfosFragment,$o.SegmentsFoldersSegmentsFragment]),l=(0,V.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(SQ,{customFields:a.organization.customFields.nodes,event:a.event,organization:a.organization,reload:d})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.POSITIONS_SEGMENT(e,n,o?.positionsSegmentId&&l.includes(o.positionsSegmentId)?o?.positionsSegmentId:l[0]),replace:!0})})]})}),CQ=br("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),bQ=br("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),AQ=e=>{const{translate:n}=Kl();return(0,i.jsx)(oT,{title:n("param_tres_78420"),children:(0,i.jsx)(Tl,{direction:"column",gap:"4",width:1,children:Yo(e.customFields)?(0,i.jsx)(ZV,{children:e.customFields.map(({customField:n,conditionValue:t})=>(0,i.jsx)(V.Fragment,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"1",justify:"between",children:[(0,i.jsx)(CQ,{children:n.name}),(0,i.jsx)(bQ,{children:e.renderValue(n,t)})]})},n.slug))}):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_conditio_36491")})})})};t(7411);const EQ=(0,V.forwardRef)((e,n)=>{const t=(0,V.useRef)(null),s=(0,V.useMemo)(()=>e.max===1/0?1:0===e.max?1/0:e.value/e.max,[e.max,e.value]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n circle-progress::part(base) {\n width: 70px;\n height: auto;\n }\n\n circle-progress::part(value) {\n stroke-width: 8;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke: ${Yu(s)};\n }\n\n circle-progress::part(text) {\n font-family: var(--fonts-grafik);\n fill: var(--colors-gray800);\n font-size: var(--fontSizes-textXs);\n font-size: 24px; /* For some reason the above rule applies the correct size value, but the text renders smaller. */\n font-weight: var(--fontWeights-medium);\n }\n `}}),(0,i.jsx)("circle-progress",{ref:e=>{t.current=e,"function"==typeof n?n(e):n&&(n.current=e)},max:e.max,"text-format":e.textFormat,value:e.value})]})});EQ.displayName="ProgressCircle";const wQ=e=>{const{translate:n}=Kl(),t=Dm();return(0,i.jsx)(oT,{css:{flex:"1 1 auto",inlineSize:"unset"},title:e.title,children:(0,i.jsxs)(Tl,{direction:"column",...t?{gap:"9"}:{gap:"7"},gap:"1",width:1,children:[(0,i.jsxs)(Tl,{gap:"4",height:78,children:[(0,i.jsx)(EQ,{"aria-label":e.title,max:e.position.resources,textFormat:"percent",value:e.position.assignedResources}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",justify:"center",children:[(0,i.jsxs)(rc,{css:{fontSize:"$textXl",lineHeight:"122.222%","& > .numerator":{fontSize:"$displayMd",fontWeight:"$semiBold",letterSpacing:"-0.72px"}},children:[(0,i.jsx)("span",{className:"numerator",children:e.position.assignedResources}),"/",(0,i.jsx)("span",{className:"denominator",children:e.position.resources})]}),e.position.numberOfSlots&&(0,i.jsx)(rc,{css:{fontSize:"$textXs"},textStyle:"subtitle",children:n("spread_over_1_54650",e.position.numberOfSlots)})]})]}),(0,i.jsx)(Tl,{children:(0,i.jsx)(Ku,{color:"orange",leftIcon:"user-group",children:n("_1_membre_pr_32812",e.position.preassignedResources)})})]})})},$Q=e=>(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",justify:"center",children:[(0,i.jsx)(rc,{css:{fontSize:"$displayMd",fontWeight:"$semiBold"},children:e.value}),(0,i.jsx)(rc,{textStyle:"subtitle",children:e.description})]}),TQ=e=>{const{params:{eventId:n,positionId:t},translate:s}=Kl(),{data:o,isLoading:a}=Li("query PositionKpis($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n slots {\n fillingRate\n }\n }\n }\n}\n",{eventId:n,positionId:t},[]),r=(0,V.useMemo)(()=>o.event?{below25:o.event.position.slots.filter(e=>e.fillingRate<25).length,between25and50:o.event.position.slots.filter(e=>e.fillingRate>=25&&e.fillingRate<50).length,between50and75:o.event.position.slots.filter(e=>e.fillingRate>=50&&e.fillingRate<75).length,above75:o.event.position.slots.filter(e=>e.fillingRate>=75&&e.fillingRate<100).length,complete:o.event.position.slots.filter(e=>100===e.fillingRate).length,overquota:o.event.position.slots.filter(e=>e.fillingRate>100).length}:{below25:1/0,between25and50:1/0,between50and75:1/0,above75:1/0,complete:1/0,overquota:1/0},[o.event?.position?.slots]);return(0,i.jsx)(oT,{css:{flex:"2 1 auto",inlineSize:"unset"},title:e.title,children:a?(0,i.jsx)(qm,{}):(0,i.jsxs)(Tl,{gap:"4",width:1,children:[(0,i.jsx)($Q,{description:s("below_25_26800"),value:r.below25}),(0,i.jsx)($Q,{description:s("between_25_and_61597"),value:r.between25and50}),(0,i.jsx)($Q,{description:s("between_50_and_79860"),value:r.between50and75}),(0,i.jsx)($Q,{description:s("over_75_74073"),value:r.above75}),(0,i.jsx)($Q,{description:s("complet_51600"),value:r.complete}),(0,i.jsx)($Q,{description:s("au_dessus_du_qu_60828"),value:r.overquota})]})})},zQ=e=>{const n=Fi(),{hasPermission:t}=BS(),s=t(sy.MEMBER_ASSIGN,{positionCategoryId:e.positionSlot.positionCategoryId,positionId:e.positionSlot.positionId}),{mutate:o}=Ua(),{mutate:a}=rr(),[r,d]=(0,V.useState)(!1),l=e.volunteerRegistration.positionSlotUserInfo;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[l.state===ye.Waiting&&(0,i.jsx)(Pu,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:Ce.CheckIn,positionsSlotsUsersInfosIds:[l.id]}}),e.reload()},children:n("pointer_1_57919",e.volunteerRegistration.userInfo.name)}),l.state===ye.CheckedIn&&(0,i.jsx)(Pu,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:Ce.CheckOut,positionsSlotsUsersInfosIds:[l.id]}}),e.reload()},children:n("d_pointer_1_08337",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(Pu,{icon:"circle-check",onClick:()=>d(!0),children:n("mettre_jour_l_00128")}),l.state!==ye.Waiting&&(0,i.jsx)(Pu,{icon:"arrows-rotate",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:Ce.Reset,positionsSlotsUsersInfosIds:[l.id]}}),e.reload()},children:n("remettre_z_ro_11572")}),s&&(0,i.jsx)(Pu,{color:"red",icon:"user-xmark",onClick:async()=>{await a({eventId:e.eventId,massAssign:{positionsSlotsIds:[e.positionSlot.id],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:hn.Delete}}),e.reload()},children:n("d_saffecter_du_47122")})]}),(0,i.jsx)(DE,{isOpen:r,positionSlotUserInfo:l,onClose:()=>{e.reload(),d(!1)}})]})},OQ=e=>{const{translate:n,params:{eventId:t}}=Kl(),s=ki(Jm),o=ki(Xb);return(0,i.jsxs)(km,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)($m,{children:(0,i.jsx)(My,{userInfo:e.volunteerRegistration.userInfo})}),(0,i.jsx)($m,{children:e.volunteerRegistration.positionSlotUserInfo.state===ye.CheckedOut?(0,i.jsx)(Ku,{leftIcon:"clock",children:n("temps_total_79448",o.minutesToHoursMinutesString(e.volunteerRegistration.positionSlotUserInfo.timeDifferenceMinutes))}):e.volunteerRegistration.positionSlotUserInfo.state===ye.CheckedIn?(0,i.jsx)(Ku,{color:"success",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:n("point_le_1_63576",s.toLocaleString(e.volunteerRegistration.positionSlotUserInfo.checkInAt.toLocal(),Uo.DateTime))}):(0,i.jsx)(Ku,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:n("non_point_42145")})}),(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsx)(zQ,{eventId:t,positionSlot:e.positionSlot,reload:e.reload,volunteerRegistration:e.volunteerRegistration})})]})},RQ=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,positionId:o,positionSlotId:a}}=Kl(),r=ki(Bg),[d,l]=(0,V.useState)(0),[c,u]=(0,V.useState)({direction:Gn.Asc,attribute:ot.Name}),{data:m,isLoading:g,reload:h}=Li("query PositionSlotVolunteers(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $offset: Int\n $sort: VolunteersRegistrationsSort\n) {\n event(id: $eventId) {\n positionSlot(id: $positionSlotId) {\n id\n positionId\n positionCategoryId\n name\n range\n assignedResources\n resources\n }\n\n volunteersRegistrations(\n positionSlotId: $positionSlotId\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n\n userInfo {\n id\n name\n email\n picture {\n url\n }\n }\n\n positionSlotUserInfo(positionSlotId: $positionSlotId) {\n breakTime\n checkInAt\n checkOutAt\n eventId\n id\n state\n timeDifferenceMinutes\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:s,positionSlotId:a,offset:d,sort:c},[]),{numberOfPages:p,totalCount:I}=Sx(m.event?.volunteersRegistrations),x=(0,V.useMemo)(()=>m.event?.positionSlot?m.event.positionSlot.resources-m.event.positionSlot.assignedResources:0,[m.event?.positionSlot]),{hasPermissions:f}=BS(),[_]=g?[!1]:f([sy.MEMBER_ASSIGN],{positionCategoryId:m.event.positionSlot.positionCategoryId,positionId:o});return(0,i.jsxs)(gp,{returnToFallback:oo.POSITION({organizationId:t,eventId:s,positionId:o}),size:"md",children:[(0,i.jsx)(Yy,{children:(0,i.jsx)(Tl,{direction:"column",gap:"1",width:1,children:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:28,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{children:m.event.positionSlot.name||"-"}),(0,i.jsx)(Mr,{font:"gray500 textSm regular",children:r.toDisplayString(m.event.positionSlot.range)})]})})}),(0,i.jsxs)(hp,{children:[(0,i.jsx)(Pl,{height:"5"}),(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{children:n("liste_des_membr_89037")}),m.event?x>0?(0,i.jsx)(Ku,{color:"warning",children:n("_1_membre_manq_31014",x)}):(0,i.jsx)(Ku,{color:"success",children:n("complet_51600")}):null]}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsxs)(ym,{children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)($x,{attribute:ot.Name,setSort:e=>{l(0),u(e)},sort:c,children:n("nom_08311")}),(0,i.jsx)(Gm,{children:n("State")}),(0,i.jsx)(Gm,{width:100})]}),g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):m.event.volunteersRegistrations.nodes.map(e=>(0,i.jsx)(OQ,{positionSlot:m.event.positionSlot,reload:h,volunteerRegistration:e},e.id)),(0,i.jsx)(Fm,{children:(0,i.jsx)(Pm,{numberOfPages:p,offset:d,setOffset:l,totalCount:I})})]}),(0,i.jsx)(Pl,{height:"5"})]}),(0,i.jsx)(pp,{children:(0,i.jsxs)(Tl,{gap:"3",justify:"end",children:[_&&(0,i.jsx)(tc,{onClick:()=>{e.push(yo.POSITION_SLOT_ASSIGN_VOLUNTEERS(t,s,o,a))},children:n("affecter_des_me_30349")}),(0,i.jsx)(tc,{color:"white",onClick:()=>e.goBack(oo.POSITION_SLOT({organizationId:t,eventId:s,positionId:o,positionSlotId:a})),children:n("fermer_62479")})]})})]})},DQ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),a=ki(Bg),{hasPermissions:r}=BS(),d=ki(DK),{mutate:l}=sl(),{mutate:c}=Ua(),{mutate:u}=function(e={}){return Ui("mutation PositionSlotDelete(\n $eventId: EventId!\n $positionId: PositionId!\n $positionSlotId: PositionsSlotId!\n) {\n positionSlotDelete(\n eventId: $eventId\n positionId: $positionId\n positionSlotId: $positionSlotId\n ) {\n id\n }\n}\n",e)}(),[m,h]=(0,V.useState)(!1),[p,I]=(0,V.useState)(!1),x=(0,V.useMemo)(()=>a.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}}),[e.slot]),[f,_]=r([sy.POSITION_EDIT,sy.MEMBER_ASSIGN],{positionCategoryId:e.slot.positionCategoryId,positionId:e.slot.positionId});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(km,{css:{cursor:"pointer"},onClick:()=>{n.push(yo.POSITION_SLOT_MEMBERS(s,o,e.slot.positionId,e.slot.id))},children:[(0,i.jsx)($m,{align:"start",direction:"column",justify:"center",children:(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:g(e.slot.name)?e.slot.name:"-"})}),(0,i.jsx)($m,{css:{textTransform:"capitalize"},children:x}),(0,i.jsx)($m,{children:(0,i.jsx)(TF,{assignedResources:e.slot.assignedResources,resources:e.slot.resources})}),(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsxs)(Km,{children:[_&&(0,i.jsx)(Pu,{icon:"wand-magic-sparkles",to:yo.POSITION_SLOT_ASSIGN_VOLUNTEERS(s,o,e.slot.positionId,e.slot.id),children:t("affecter_des_me_30349")}),f&&(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{h(!0)},children:t("_diter_62574")}),f&&(0,i.jsx)(Pu,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{I(!0)},children:t("supprimer_43083")}),(0,i.jsx)(Pu,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:Ce.CheckIn,positionsSlotsIds:[e.slot.id]}})},children:t("pointer_les_mem_50347")}),(0,i.jsx)(Pu,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:Ce.CheckOut,positionsSlotsIds:[e.slot.id]}})},children:t("d_pointer_les_m_17150")})]})})]}),m&&(0,i.jsx)(LK,{event:e.event,slot:d.positionsSlotInputDefault(e.event.startAt,e.slot),onClose:()=>{h(!1)},onSuccess:async n=>{await l({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id,positionSlot:n}),e.reload()}}),p&&(0,i.jsx)(ow,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_48876")],text:t("suppression_de_73669",x),onClose:()=>{I(!1)},onDelete:async()=>{await u({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id}),e.reload()}})]})},MQ=()=>{const{translate:e,params:{eventId:n,positionId:t}}=Kl(),[s,o,a]=Wm(""),[r,d]=zD("position.slots.date",Oo.c9.invalid("Invalid"),Ex),[l,c]=(0,V.useState)(0),[u,m]=zD("position.slots.sort",null),{data:h,isLoading:p,reload:I}=Li("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:n,positionId:t,name:g(o)?o:void 0,date:r.isValid?r:void 0,offset:l,sort:u},[$o.PositionPositionSlotFragment]);const{numberOfPages:x,totalCount:f}=Sx(h.event?.positionsSlots),_=(0,V.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:a})}),(0,i.jsx)(Mr,{width:200,children:(0,i.jsx)(Wp,{max:h.event?.endAt,min:h.event?.startAt,value:r,onChange:d})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($x,{attribute:An.Name,setSort:_,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)($x,{attribute:An.Range,setSort:_,sort:u,children:e("cr_neau_11117")}),(0,i.jsx)(Gm,{children:e("remplissage_75916")}),(0,i.jsx)(Gm,{width:100})]}),numberOfPages:x,offset:l,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:h.event.positionsSlots.nodes.map(e=>(0,i.jsx)(DQ,{event:h.event,reload:I,slot:e},e.id))}),setOffset:c,title:e("liste_des_cr_ne_86148"),totalCount:f})},PQ=()=>{const{params:{organizationId:e,eventId:n,positionId:t},translate:s}=Kl(),o=ki(Bg),{roles:a}=XS(),{hasPermission:r}=BS(),{data:d,loader:l,reload:c}=tl({organizationId:e,eventId:n,positionId:t}),{mutate:u}=Ud(),{mutate:m}=Oa(),g=r(sy.POSITION_EDIT,{positionCategoryId:d.event?.position.positionCategoryId,positionId:t}),h=(0,V.useMemo)(()=>d?.event?.position?.slots?.filter(e=>e.fillingRate>100),[d?.event?.position?.slots]),p=Ni();return l||(0,i.jsx)(yy,{gap:"4",children:(0,i.jsxs)(Am.Provider,{value:{designSystem:bm},children:[Yo(h)&&(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:s("certains_cr_nea_52758")}),(0,i.jsx)(uc,{children:[...p(s("les_cr_neaux_su_69909","{1}"),(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:h.map(e=>(0,i.jsx)("li",{children:Zg(o,e,d.event.position.name,{slot:{includeRange:!0}})},e.id))}))]})]}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)(wQ,{position:d.event.position,title:s("remplissage_de_52564")}),(0,i.jsx)(TQ,{position:d.event.position,title:s("taux_de_remplis_12961")})]}),Yo(d.organization.customFields.nodes)&&(0,i.jsx)(AQ,{customFields:d.organization.customFields.nodes.map(e=>({customField:e,conditionValue:null})),renderValue:e=>(0,i.jsx)(wE,{field:e,fields:d.event.position.fields})}),(0,i.jsx)(MQ,{}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(ez,{leaders:d.event.position.leaders,reload:c,roles:a.positionRoles,onSave:e=>u({eventId:n,massLeaders:{leaders:e,selecteds:{ids:[t]},strategy:hn.Replace}})}),(0,i.jsx)(AQ,{customFields:d.event.position.customFields,renderValue:(e,n)=>HU(s,e,n)}),(0,i.jsx)(yT,{modalSubtitle:s("ajouter_des_tag_64526"),reload:c,tags:d.event.position.tags,...g?{associateTags:e=>m({eventId:n,massEdit:{reset:!1,selecteds:{ids:[t]},slug:vn.Tag,strategy:hn.Replace,value:e}})}:{}})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(fT,{description:d.event.position.description}),(0,i.jsx)(nB,{location:d.event.position}),(0,i.jsx)(_T,{privateNote:d.event.position.privateNote})]})]}),(0,i.jsx)(kr.qh,{path:yo.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(RQ,{})})]})})},kQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Oh),{canCustomFieldRead:a,canMemberAccredit:r,canMemberAssign:d,canMemberEdit:l}=oy(),[c,u]=zD("positionMembers.columns",[Th.Name,Th.Positions]),[m,g]=zD("positionMembers.limit",Tm),[h,p]=zD("positionMembers.predicates",[]),I=(0,V.useMemo)(()=>xg(h),[h]),[x,f]=zD("positionMembers.sort",null),{data:_}=cr({organizationId:t,eventId:s,privacy:a&&l?Ee.All:Ee.Public,loadCustomDocuments:!1,loadForms:!1,loadSegments:!1}),j=(0,V.useMemo)(()=>_.organization?.customFields.nodes??[],[_.organization]),v=Kb(j),S=(0,V.useMemo)(()=>_.event?o.getPositionMembersFilters(t,s,j,_.event):[],[s,j,_.event]),y=(0,V.useMemo)(()=>o.getPositionMembersPossibleColumns(j),[j]),C=(0,V.useMemo)(()=>({positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId}),[e.positionCategoryId,e.positionId,e.preassignedPositionCategoryId,e.preassignedPositionId]);return(0,i.jsx)(yy,{children:(0,i.jsx)(Cx,{columns:c,columnsSearch:[],columnsToIncludes:zh,eventId:s,filters:S,getMassActionId:e=>e.userInfo.id,limit:m,loadDataList:hr,loadDataListParams:{includeCanRegistrationStateUpdate:!0,includeIsEditable:!0,positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId},loadRow:gr,loadRowParams:{includeCanRegistrationStateUpdate:!0,includeIsEditable:!0},organizationId:t,possibleColumns:y,predicates:I,renderActions:(e,n,t)=>(0,i.jsx)(MB,{massActions:e,predicates:I,scope:C,showOnlyMassEdit:!0,sort:x,totalNumberOfMembers:n,onMassEditSuccess:t}),renderAllSelectedText:e=>n("les_1_membres_31409",e),renderPageSelectedText:e=>n("les_1_membres_00895",e),renderSelectAllText:e=>n("s_lectionner_le_34300",e),rendering:xh.List,setColumns:u,setLimit:g,setPredicates:p,setSort:f,showEditColumns:l,showEditMode:l,showFilters:!0,showMassActions:l,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,showSelectAll:!0,sort:x,children:(0,i.jsx)(kx,{renderCell:(e,n,t)=>(0,i.jsx)(pE,{canChangeDelegation:l,canMemberAccredit:r,canMemberAssign:d,column:e,customField:v.get(e.slug),eventId:s,reloadRow:t,row:n})})})})},FQ=e=>(0,i.jsx)(Tl,{align:"center",css:{padding:"$2 $4"},direction:"column",height:1,justify:"center",width:1,children:(0,i.jsx)(My,{size:32,userInfo:e.vr.userInfo})}),NQ=()=>{const{translate:e}=Kl();return(0,i.jsx)(Tl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",px:"$2"},height:1,width:1,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},font:"gray800 textXs medium",textAlign:"center",width:1,children:e("disponible_69523")})})},LQ=e=>{const n=ki(Bg),t=(0,V.useMemo)(()=>Gu(e.slot.position.color),[e.slot]),s=(0,V.useMemo)(()=>Zg(n,e.slot.positionSlot,e.slot.position.name,{position:{includeName:e.shouldShowPositionName??!0},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(Tl,{align:"center",css:{background:t[50],border:`1px solid ${t[500]}`,borderRadius:"$1",color:t[700],cursor:"pointer",px:"$2"},height:1,width:1,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},fontSize:"textXs",fontWeight:"medium",textAlign:"center",title:s,width:1,children:s})})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(gQ,{category:e.slot.positionCategory,position:e.slot.position,shouldShowAssignButton:e.shouldShowAssignButton,slot:e.slot.positionSlot})})]})},UQ=e=>"assignment"===e.slot.type?(0,i.jsx)(LQ,{shouldShowAssignButton:e.shouldShowAssignButton,shouldShowPositionName:e.shouldShowPositionName,slot:e.slot}):(0,i.jsx)(NQ,{}),VQ=e=>{const{params:{organizationId:n,eventId:t,positionId:s},translate:o}=Kl(),[a,r]=(0,V.useState)(null),[d,l]=(0,V.useState)(0),[c,u,m]=Wm(""),h=ki(Oh),[p,I]=zD("positionMembers.columns",[Th.Name,Th.Positions]),[x,f]=zD("positionMembers.limit",Tm),[_,j]=zD("positionMembers.predicates",[]),v=(0,V.useMemo)(()=>xg(_),[_]),[S,y]=zD("positionMembers.sort",null),{data:C,loader:b}=pl({eventId:t,positionId:s,predicatesGroups:v,name:g(u)?u:void 0,limit:x,offset:d}),[A,E]=(0,V.useState)(!0),w=(0,V.useMemo)(()=>e.customFields.nodes??[],[e.customFields]),$=(0,V.useMemo)(()=>C.data?h.getPositionMembersFilters(n,t,w,C.data):[],[t,w,C.data]),T=(0,V.useMemo)(()=>h.getPositionMembersPossibleColumns(w),[w]),z=(0,V.useMemo)(()=>Oo.c9.isDateTime(a)&&a?.isValid?a:Oo.c9.fromISO(a)?.isValid?Oo.c9.fromISO(a,{zone:"utc"}):Oo.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Oo.c9.utc())?Oo.c9.utc():e.startAt,[e.startAt,e.endAt,a]),O=(0,V.useCallback)(n=>{r(n?.toISO()??e.startAt.toISO())},[e.startAt,r]),R=(0,V.useMemo)(()=>{const n=Yg(e.dayStartTime);return n?.[0]??0},[e.dayStartTime]),D=(0,V.useMemo)(()=>(C.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>A?[{type:"availability",range:e.range}]:[]).concat(e.positionsSlotsUsersInfos.map(e=>({type:"assignment",range:e.positionSlot.range,positionCategory:e.positionCategory,position:e.position,positionSlot:e.positionSlot})))})),[C.data,A]);return b||(0,i.jsx)(yy,{children:(0,i.jsxs)(Cx,{columns:p,columnsSearch:[],columnsToIncludes:zh,eventId:t,filters:$,limit:x,loadDataList:Il,loadDataListParams:{level:t?xn.Event:xn.Organization},loadRow:il,name:c,organizationId:n,possibleColumns:T,predicates:v,rendering:ph.List,setColumns:I,setLimit:f,setName:m,setPredicates:j,setSort:y,showEditColumns:!1,showEditMode:!1,showFilters:!0,showMassActions:!1,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:S,children:[(0,i.jsx)(Tl,{css:{background:"white",flex:"1"},children:(0,i.jsx)(uQ,{data:D,date:z,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(Mr,{width:40,children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",leftIcon:A?"eye":"eye-slash",onClick:()=>E(!A)})}),(0,i.jsx)(Dx,{placement:"top",children:o(A?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(FQ,{vr:e}),renderSlot:e=>(0,i.jsx)(UQ,{shouldShowAssignButton:!1,shouldShowPositionName:!1,slot:e}),showPlus:!1,startHour:R,onChange:O})}),(0,i.jsx)(Fm,{children:(0,i.jsx)(Pm,{itemName:o("membres_67337"),limit:x,numberOfPages:C.data.rows.numberOfPages,offset:d,setLimit:f,setOffset:l,showLimits:!0,totalCount:C.data.rows.totalCount})})]})})},BQ=e=>{const{params:{organizationId:n,eventId:t}}=Kl(),{data:s,loader:o}=Li("query OrganizationCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:n,eventId:t},[$o.OrganizationCustomFieldsFragment]);return o||(0,i.jsx)(VQ,{customFields:s.organization.customFields,...e})},WQ=e=>{const{params:{organizationId:n,eventId:t,positionId:s},translate:o}=Kl();return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:oo.POSITIONS({organizationId:n,eventId:t}),children:o("missions_63972")}),(0,i.jsx)(AT,{to:oo.POSITION_CATEGORY({organizationId:n,eventId:t,positionCategoryId:e.position.positionCategoryId}),children:e.position.positionCategoryName}),(0,i.jsx)(AT,{isCurrent:!0,to:oo.POSITION({organizationId:n,eventId:t,positionId:s}),children:e.position.name})]})},GQ=()=>{const{history:e,params:{organizationId:n,eventId:t,positionId:s},translate:o}=Kl(),{user:a}=Yi(),{data:r,isLoading:d}=Li("query PositionHeader($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n id\n name\n acronym\n icon\n color\n positionCategoryId\n positionCategoryName\n range\n assignedResources\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n }\n }\n}\n",{eventId:t,positionId:s},[]),{hasPermission:l}=BS(),c=!d&&l(sy.POSITION_EDIT,{positionCategoryId:r.event.position.positionCategoryId}),u=ki(Bg),m=zX(),g=FV(),[h,p]=(0,V.useState)(!1),I=(0,V.useMemo)(()=>r.event?.position,[r.event]);return(0,i.jsx)(Cy,{acronym:I?.acronym,breadcrumbs:I&&(0,i.jsx)(WQ,{position:I}),buttons:I&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tc,{color:"white",download:`${I.name}-position-sheet`,to:Ef(I.links.positionSheetLink,"pdf",{lang:a?.language}),children:o("t_l_charger_la_16259")}),(0,i.jsx)(ly,{permissions:sy.POSITION_EDIT,scope:{positionCategoryId:I.positionCategoryId,positionId:I.id},children:(0,i.jsx)(tc,{to:yo.EDIT_POSITION(n,t,I.id),children:o("_diter_la_missi_90442")})}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{download:`${I.name}-position-planning`,icon:"arrow-down-to-bracket",target:"_blank",to:Ef(I.links.positionPlanningLink,"pdf",{lang:a?.language}),children:o("t_l_charger_le_06050")}),(0,i.jsx)(Pu,{icon:"arrow-down-to-bracket",onClick:()=>g($V,{positionId:s}),children:o("exporter_les_me_63676")}),c&&(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>await m(I.id),children:o("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:c&&(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:async()=>p(!0),children:o("supprimer_43083")})})]})]}),h&&(0,i.jsx)(OX,{position:I,onClose:()=>p(!1),onSuccess:()=>e.replace(oo.POSITIONS({organizationId:n,eventId:t}))})]}),color:I?.color,icon:I?.icon,isLoading:d,name:I?.name,subtext:I?.range&&u.toComponents(I.range,{hideTime:!0,formats:{separator:" → ",localeFormat:Uo.DateOnly.MonthShort}})})},qQ=e=>{const{params:{organizationId:n,eventId:t,positionId:s},translate:o}=Kl();Au(e.event.position.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":t,positionId:e?":positionId":s});return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(GQ,{}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:oo.POSITION_DASHBOARD(a(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:oo.POSITION_MEMBERS(a(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)}),(0,i.jsx)(Ey,{path:oo.POSITION_PREASSIGNED_MEMBERS(a(!1)),children:o("membres_pr_aff_93093",e.event.position.preassignedResources)}),(0,i.jsx)(Ey,{path:oo.POSITION_PLANNING(a(!1)),children:o("planning_63989")})]}),(0,i.jsx)($y,{path:[oo.POSITION_DASHBOARD(a(!0)),yo.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId")],children:(0,i.jsx)(PQ,{})}),(0,i.jsx)($y,{path:oo.POSITION_MEMBERS(a(!0)),children:(0,i.jsx)(kQ,{positionId:s})}),(0,i.jsx)($y,{path:oo.POSITION_PREASSIGNED_MEMBERS(a(!0)),children:(0,i.jsx)(kQ,{preassignedPositionId:s})}),(0,i.jsx)($y,{path:oo.POSITION_PLANNING(a(!0)),children:(0,i.jsx)(BQ,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})})]})]})},HQ=()=>{const{params:{organizationId:e,eventId:n,positionId:t}}=Kl(),{data:s,loader:o}=Li("query Position($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n dayStartTime\n startAt\n endAt\n\n position(id: $positionId) {\n id\n name\n acronym\n positionCategoryId\n assignedResources\n preassignedResources\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n }\n\n volunteersRegistrations(positionId: $positionId) {\n totalCount\n }\n }\n}\n",{eventId:n,positionId:t},[]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:oo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(qi,{path:oo.POSITION_DASHBOARD({organizationId:e,eventId:n,positionId:t}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qQ,{event:s.event})})]})},YQ=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("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)(tb,{buttonText:n("mettre_jour_l_18158"),icon:"text",initialValues:{positionCategory:{description:e.positionCategory.description}},size:"md",subtitle:n("la_description_98866"),title:n("ajouter_une_des_10769"),onClose:e.onClose,onSubmit:async n=>{await t({eventId:e.eventId,positionCategoryId:e.positionCategory.id,description:n.positionCategory?.description??""}),e.reload(),e.onClose()},children:(0,i.jsx)(Mr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(iS,{label:n("description_58935"),name:"positionCategory.description"})})})},ZQ=e=>{const n=Fi(),{hasPermission:t}=BS(),s=t(sy.POSITION_EDIT,{positionCategoryId:e.category.id}),[o,a]=(0,V.useState)(!1),r=g(e.category.description);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oT,{rightIcon:s?r?"pen":"plus":void 0,rightIconClick:()=>{a(!0)},title:n("description_58935"),children:r?(0,i.jsx)(Rf,{text:e.category.description}):(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_descript_25737")})}),s&&o&&(0,i.jsx)(YQ,{eventId:e.eventId,positionCategory:e.category,reload:e.reload,onClose:()=>{a(!1)}})]})},KQ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),a=ki(Bg),r=(0,V.useMemo)(()=>e.position.resources-e.position.assignedResources,[e.position]);return(0,i.jsxs)(km,{onClick:()=>{n.push(oo.POSITION({organizationId:s,eventId:o,positionId:e.position.id}))},children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xm,{to:oo.POSITION({organizationId:s,eventId:o,positionId:e.position.id}),children:e.position.name})}),(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:e.position.range?a.toLocaleString(e.position.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"}),(0,i.jsx)(Mr,{font:"gray500 textSm regular",children:t("creneau",e.position.numberOfSlots)})]})}),(0,i.jsx)($m,{children:r>0?(0,i.jsx)(Ku,{color:"warning",children:t("_1_membre_manq_31014",r)}):(0,i.jsx)(Ku,{color:"success",children:t("complet_51600")})}),(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsxs)(Km,{children:[(0,i.jsx)(Pu,{icon:"eye",to:oo.POSITION({organizationId:s,eventId:o,positionId:e.position.id}),children:t("voir_la_mission_68087")}),(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{n.push(yo.EDIT_POSITION(s,o,e.position.id))},children:t("_diter_la_missi_90442")})]})})]})},XQ=()=>{const{translate:e,params:{eventId:n,positionCategoryId:t}}=Kl(),[s,o,a]=Wm(""),[r,d]=zD("positionCategory.positions.date",Oo.c9.invalid("Invalid"),Ex),[l,c]=(0,V.useState)(0),[u,m]=zD("positionCategory.positions.sort",null),{data:h,isLoading:p}=Li("query PositionCategoryPositions(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $name: String\n $date: Date\n $offset: Int\n $sort: PositionsSort\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positions(\n positionCategoriesIds: [$positionCategoryId]\n name: $name\n date: $date\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionCategoryPosition\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,positionCategoryId:t,name:g(o)?o:void 0,date:r.isValid?r:void 0,offset:l,sort:u},[$o.PositionCategoryPositionFragment]);const{numberOfPages:I,totalCount:x}=Sx(h.event?.positions),f=(0,V.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:a})}),(0,i.jsx)(Mr,{width:200,children:(0,i.jsx)(Wp,{max:h.event?.endAt,min:h.event?.startAt,value:r,onChange:d})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($x,{attribute:En.Name,setSort:f,sort:u,children:e("nom_de_la_missi_64605")}),(0,i.jsx)($x,{attribute:En.Slot,setSort:f,sort:u,children:e("Date")}),(0,i.jsx)(Gm,{children:e("State")}),(0,i.jsx)(Gm,{width:100})]}),numberOfPages:I,offset:l,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:h.event.positions.nodes.map(e=>(0,i.jsx)(KQ,{position:e},e.id))}),setOffset:c,title:e("liste_des_missi_40241"),totalCount:x})},QQ=e=>{const{translate:n,params:{eventId:t,positionCategoryId:s}}=Kl(),{roles:o}=XS(),a=ki(Bg),{mutate:r}=function(e={}){return Ui("mutation PositionsCategoriesMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n positionsCategoriesMassLeadersAssign(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}();return(0,i.jsx)(yy,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{gap:"6",width:1,children:[(0,i.jsx)(YT,{iconColor:"primary",text:n("nombre_de_missi_56719"),value:e.positionCategory.numberOfPositions}),(0,i.jsx)(YT,{iconColor:"primary",text:n("number_of_membe_24698"),value:e.positionCategory.assignedResources}),(0,i.jsx)(YT,{iconColor:"primary",text:n("nombre_de_membr_74699"),value:e.positionCategory.preassignedResources}),(0,i.jsx)(YT,{iconColor:"primary",text:n("Date"),value:e.positionCategory.range?a.toLocaleString(e.positionCategory.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"})]}),(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"6",width:470,children:[(0,i.jsx)(ez,{leaders:e.positionCategory.leaders,reload:e.reload,roles:o.positionRoles,onSave:e=>r({eventId:t,massLeaders:{leaders:e,selecteds:{ids:[s]},strategy:hn.Replace}})}),(0,i.jsx)(ZQ,{category:e.positionCategory,eventId:t,reload:e.reload})]}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(XQ,{})})]})]})})},JQ=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("mutation PositionCategoryDelete($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDelete(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954"),n("cela_supprimera_30946")],text:n("suppression_de_73669",e.positionCategory.name),onClose:e.onClose,onDelete:async()=>{await t({eventId:e.eventId,positionCategoryId:e.positionCategory.id}),e.onSuccess()}})},eJ=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl();return(0,i.jsxs)(ET,{children:[(0,i.jsx)(AT,{to:oo.POSITIONS({organizationId:n,eventId:t}),children:s("missions_63972")}),(0,i.jsx)(AT,{isCurrent:!0,to:oo.POSITION_CATEGORY({organizationId:n,eventId:t,positionCategoryId:e.category.id}),children:e.category.name})]})},nJ=({category:e,reload:n})=>{const{translate:t,history:s,params:{organizationId:o,eventId:a}}=Kl(),{hasPermission:r}=BS(),d=r(sy.POSITION_EDIT,{eventId:a}),l=FV(),{mutate:c}=function(e={}){return Ui("mutation PositionCategoryDuplicate($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDuplicate(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}(),[u,m]=(0,V.useState)(!1),[g,h]=(0,V.useState)(!1);return(0,i.jsx)(Cy,{breadcrumbs:(0,i.jsx)(eJ,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ly,{permissions:sy.POSITION_EDIT,scope:{positionCategoryId:e.id},children:[(0,i.jsx)(tc,{color:"white",onClick:()=>h(!0),children:t("_diter_62574")}),(0,i.jsx)(tc,{onClick:()=>{s.push(yo.CREATE_POSITION(o,a,e.id))},children:t("ajouter_une_mis_99800")})]}),d&&(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"arrow-down-to-bracket",onClick:()=>l($V,{positionCategoryId:e.id}),children:t("exporter_les_me_63676")}),(0,i.jsx)(Pu,{icon:"copy",onClick:async()=>{const{positionCategoryDuplicate:{id:n}}=await c({eventId:a,positionCategoryId:e.id});s.push(oo.POSITION_CATEGORY({organizationId:o,eventId:a,positionCategoryId:n}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{m(!0)},children:t("supprimer_43083")})})]})]}),g&&(0,i.jsx)(kK,{eventId:a,positionCategoryId:e.id,positionCategoryName:e.name,onClose:()=>{h(!1)},onSuccess:n}),u&&(0,i.jsx)(JQ,{eventId:a,positionCategory:e,onClose:()=>{m(!1)},onSuccess:()=>{s.replace(oo.POSITIONS({organizationId:o,eventId:a}))}})]}),name:e.name,subtext:t("_1_mission_33169",e.numberOfPositions)})},tJ=({event:e,reload:n})=>{const{translate:t,params:{organizationId:s,eventId:o,positionCategoryId:a}}=Kl(),r=Wi(),{updateLocalEvent:d}=BS();Au(e.positionCategory.name),(0,V.useEffect)(()=>{d({positionBackPath:r.pathname})},[]);const l=e=>({organizationId:e?":organizationId":s,eventId:e?":eventId":o,positionCategoryId:e?":positionCategoryId":a});return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(nJ,{category:e.positionCategory,reload:n}),(0,i.jsxs)(Ty,{css:{flex:"1"},children:[(0,i.jsxs)(wy,{css:{px:"$7"},children:[(0,i.jsx)(Ey,{path:oo.POSITION_CATEGORY_DASHBOARD(l(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(Ey,{path:oo.POSITION_CATEGORY_MEMBERS(l(!1)),children:t("membres_125561",e.volunteersRegistrations.totalCount)}),(0,i.jsx)(Ey,{path:oo.POSITION_CATEGORY_PREASSIGNED_MEMBERS(l(!1)),children:t("membres_pr_aff_93093",e.positionCategory.preassignedResources)})]}),(0,i.jsx)($y,{path:oo.POSITION_CATEGORY_DASHBOARD(l(!0)),children:(0,i.jsx)(QQ,{positionCategory:e.positionCategory,reload:n})}),(0,i.jsx)($y,{path:oo.POSITION_CATEGORY_MEMBERS(l(!0)),children:(0,i.jsx)(kQ,{positionCategoryId:a})}),(0,i.jsx)($y,{path:oo.POSITION_CATEGORY_PREASSIGNED_MEMBERS(l(!0)),children:(0,i.jsx)(kQ,{preassignedPositionCategoryId:a})})]})]})},iJ=()=>{const{params:{organizationId:e,eventId:n,positionCategoryId:t}}=Kl(),{data:s,loader:o,reload:a}=Li("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:n,positionCategoryId:t},[$o.LeaderInfosFragment]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:oo.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(qi,{path:oo.POSITION_CATEGORY_DASHBOARD({organizationId:e,eventId:n,positionCategoryId:t}),replace:!0})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(tJ,{event:s.event,reload:a})})]})},sJ=e=>(0,i.jsx)(Hx,{category:e.popup.category,fallbackClosePath:e.closePath,heading:e.popup.title,children:(0,i.jsxs)(Tl,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Tl,{css:{background:"$gray50",flex:"1",overflow:"auto",py:"$9"},justify:"center",children:(0,i.jsx)(Tl,{css:{height:"fit-content",overflow:"hidden"},direction:"column",width:1170,children:e.children})}),(0,i.jsx)(Tl,{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})]})}),oJ=()=>{const{params:{organizationId:e,eventId:n,positionId:t,positionSlotId:s},translate:o}=Kl(),a=ki(Jm),[r,d]=zD("positionsSlotsAssignVolunteers.filterAvailabilities",!0),[l,c]=zD("positionsSlotsAssignVolunteers.filterPositions",!1),[u,m]=zD("positionsSlotsAssignVolunteers.applyConditions",!0),[h,p]=(0,V.useState)(null),{data:I,isLoading:x}=Li("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:n,positionSlotId:s,filterAvailabilities:r,filterPositions:l,applyConditions:u,sort:h},[]),{mutate:f,isLoading:_}=rr(),[j,v]=(0,V.useState)(""),S=(0,V.useMemo)(()=>{const e=I.event?.positionSlot.availableVolunteersRegistrations??[];return g(j)?e.filter(e=>e.userInfo.name.toLowerCase().includes(j.toLowerCase())||e.userInfo.email.includes(j.toLowerCase())):e},[I.event,j]),{numberOfSelected:y,selectAllState:C,states:b,setStates:A,toggleRow:E,toggleSelectAll:w}=gg({}),$=(0,V.useMemo)(()=>(u?1:0)+(r?1:0)+(l?1:0),[u,r,l]);return(0,V.useEffect)(()=>{A(Object.fromEntries((I.event?.positionSlot.availableVolunteersRegistrations??[]).map(e=>[`ui${e.userInfo.id}`,{id:e.userInfo.id,state:e.isAssignedTo?"checked":"unchecked"}])))},[I.event]),(0,i.jsx)(sJ,{button:(0,i.jsx)(tc,{isLoading:_,to:oo.POSITION({organizationId:e,eventId:n,positionId:t}),onClick:async()=>{const e=(I.event?.positionSlot.availableVolunteersRegistrations??[]).flatMap(e=>e.isAssignedTo?[e.userInfo.id]:[]),t=Object.values(b).filter(({state:e})=>"checked"===e).map(({id:e})=>e),i=(0,em.A)(t,e),o=(0,em.A)(e,t);Yo(i)&&await f({eventId:n,massAssign:{positionsSlotsIds:[s],selecteds:{ids:i},strategy:hn.Add}}),Yo(o)&&await f({eventId:n,massAssign:{positionsSlotsIds:[s],selecteds:{ids:o},strategy:hn.Delete}})},children:0===y?o("ne_pas_affecter_05756"):o("affecter_1_me_46721",y)}),closePath:oo.POSITION({organizationId:e,eventId:n,positionId:t}),popup:{category:o("affectation_u_96975",I.event?.positionSlot.positionName??""),title:I.event?.positionSlot.nameOrRange??""},children:(0,i.jsx)(Nm,{filters:(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:o("rechercher_un_m_05904"),value:j,onChange:v})}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"gray",leftIcon:"sliders",children:o("filtres_1_41774",$)})}),(0,i.jsx)(Fu,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Tl,{css:{padding:"$4 $6"},direction:"column",width:440,children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:o("disponibilit_s_49923")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(cm,{state:r?"unchecked":"checked",onClick:e=>{d("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:r?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:o("filtrer_selon_l_35857")}),(0,i.jsx)(oI,{height:"4"}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:o("missions_63972")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(cm,{state:l?"unchecked":"checked",onClick:e=>{c("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:l?"checked":"unchecked",onClick:e=>{c("checked"===e)},children:o("filtrer_selon_l_42798")}),(0,i.jsx)(oI,{height:"4"}),(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:o("conditions_77756")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(cm,{state:u?"unchecked":"checked",onClick:e=>{m("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:u?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:o("filtrer_selon_l_59697")})]})})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{css:{paddingRight:0},width:48,children:(0,i.jsx)(sm,{state:C,onClick:w})}),(0,i.jsx)($x,{attribute:ot.Name,css:{paddingLeft:"$2",flexGrow:2},setSort:p,sort:h,children:o("nom_du_membre_69353")}),(0,i.jsx)(Gm,{children:o("nombre_d_affect_31455")}),(0,i.jsx)($x,{attribute:ot.InsertedAt,setSort:p,sort:h,children:o("date_d_inscript_31369")})]}),limit:S.length,numberOfPages:1,offset:0,rows:x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):S.map(e=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{css:{paddingRight:0},width:48,children:(0,i.jsx)(sm,{state:b[`ui${e.userInfo.id}`]?.state??"unchecked",onClick:(n,t)=>{jc(t),E(`ui${e.userInfo.id}`,n,t.shiftKey)}})}),(0,i.jsx)($m,{css:{paddingLeft:"$2",flexGrow:2},children:(0,i.jsx)(My,{userInfo:e.userInfo})}),(0,i.jsx)($m,{children:e.numberOfAssignments}),(0,i.jsx)($m,{children:a.toLocaleString(e.insertedAt.toLocal(),Uo.DateTime)})]},e.id)),setOffset:Bc.A,title:o("liste_des_membr_42505"),totalCount:S.length})})};function aJ(e){switch(e){case Rn.OrganizationNotLinked:case Rn.PartnersUnreachable:case Rn.PartnerNotFound:return"weezaccessPartnerId";case Rn.EventNotLinked:case Rn.GroupsUnreachable:case Rn.GroupNotFound:return"printerGroupId";case Rn.DocumentNotFound:return"zplDocumentId";default:return Zl()}}function rJ(e){return Oo.c9.isDateTime(e)&&e.isValid}let dJ=class extends Rc{constructor(e){super(e)}default(e){const n=e?.activationRange;return{weezaccessPartnerId:e?.weezaccessPartnerId??null,printerGroupId:e?.printerGroupId??null,zplDocumentId:e?.zplDocumentId??null,activationStart:n?.start?.toLocal()??null,activationEnd:n?.end?.toLocal()??null}}toInput({weezaccessPartnerId:e,printerGroupId:n,zplDocumentId:t,...i}){if(null===e||null===n||null===t)throw new Error("PrintTriggerInputService.toInput: the schema requires the partner, the printer group and the ZPL document.");return{...i,weezaccessPartnerId:e,printerGroupId:n,zplDocumentId:t,activationStart:rJ(i.activationStart)?i.activationStart:null,activationEnd:rJ(i.activationEnd)?i.activationEnd:null}}toSubmitErrors(e){return{printTrigger:Object.fromEntries(e.map(({code:e,message:n})=>[aJ(e),n]))}}schema(){return zc.Ik().shape({printTrigger:this.printTriggerInputSchema().required()}).required()}printTriggerInputSchema(){return zc.Ik().shape({weezaccessPartnerId:zc.ai().typeError(this.t("l_op_rateur_wee_26038")).required(this.t("l_op_rateur_wee_26038")),printerGroupId:zc.Yj().typeError(this.t("le_point_d_impr_71946")).required(this.t("le_point_d_impr_71946")),zplDocumentId:zc.ai().typeError(this.t("le_document_est_86403")).required(this.t("le_document_est_86403")),activationStart:zc.gl().nullable().test("required-with-end",this.t("la_date_de_d_bu_05030"),(e,{parent:n})=>rJ(e)||!rJ(n.activationEnd)),activationEnd:zc.gl().nullable().test("required-with-start",this.t("la_date_de_fin_32246"),(e,{parent:n})=>rJ(e)||!rJ(n.activationStart)).test("after-start",this.t("la_date_de_fin_00429"),(e,{parent:n})=>!rJ(e)||!rJ(n.activationStart)||e>n.activationStart)})}};dJ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],dJ);const lJ=e=>{const{input:{value:n}}=(0,Dl.Mt)(e.name,{subscription:{value:!0}}),t="nodes"in e.list?e.list.nodes:[],s=e.currentId,o=void 0!==s&&!t.some(({id:e})=>e===s),a="message"in e.list?e.list.message:o&&n===s?e.currentError:void 0;return(0,i.jsxs)(of,{hint:a,isSearchVisible:!0,name:e.name,placeholder:e.placeholder,state:a?"error":void 0,children:[o&&(0,i.jsx)("option",{value:s,children:s}),t.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))]})},cJ=e=>{const{translate:n}=Kl(),{organization:{weezeventOrganizationId:t}}=XS(),{event:s,organization:o,printTrigger:a}=e,r=null!==a&&(null===a.zplDocumentId||void 0===a.zplDocumentId),d="WeezaccessPartnerList"===o.weezaccessPartners.__typename&&0===o.weezaccessPartners.nodes.length,l="PrinterGroupList"===s.printerGroups.__typename&&0===s.printerGroups.nodes.length;return(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(hc,{}),d&&(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("incomplete_prin_64421")}),(0,i.jsxs)(uc,{children:[n("aucun_op_rateur_38215"),"number"==typeof t&&(0,i.jsx)(Xm,{target:"_blank",to:wf(t),children:n("cr_er_un_op_rat_60547")})]})]}),l&&(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("incomplete_prin_64421")}),(0,i.jsx)(uc,{children:n("no_printing_loc_73059")})]}),(0,i.jsxs)(sf,{heading:n("informations_su_47120"),children:[(0,i.jsx)(wb,{heading:n("op_rateur_weeza_31732"),children:(0,i.jsx)(lJ,{currentError:"WeezaccessPartnerError"===a?.weezaccessPartner.__typename?a.weezaccessPartner.message:void 0,currentId:a?.weezaccessPartnerId,list:o.weezaccessPartners,name:"printTrigger.weezaccessPartnerId",placeholder:n("op_rateur_weeza_31732")})}),(0,i.jsx)(wb,{heading:n("printing_locati_10729"),children:(0,i.jsx)(lJ,{currentError:"PrinterGroupError"===a?.printerGroup.__typename?a.printerGroup.message:void 0,currentId:a?.printerGroupId,list:s.printerGroups,name:"printTrigger.printerGroupId",placeholder:n("printing_locati_10729")})}),(0,i.jsxs)(wb,{heading:n("document_impr_83514"),children:[(0,i.jsx)(Up,{label:n("type_d_impressi_00431"),state:"disabled",value:On.Wristband,onChange:()=>{},children:(0,i.jsx)("option",{value:On.Wristband,children:n("bracelet_50672")})}),(0,i.jsx)(of,{hint:r?n("ce_d_clencheur_62408"):void 0,isSearchVisible:!0,label:n("document_87149"),name:"printTrigger.zplDocumentId",placeholder:n("document_87149"),children:s.zplDocuments.nodes.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]}),(0,i.jsxs)(wb,{heading:n("p_riode_d_activ_48213"),children:[(0,i.jsxs)(Tl,{gap:"4",width:1,children:[(0,i.jsx)(MC,{label:n("d_but_41840"),name:"printTrigger.activationStart",zone:Bo()}),(0,i.jsx)(MC,{label:n("fin_60104"),name:"printTrigger.activationEnd",zone:Bo()})]}),(0,i.jsx)(Mr,{font:"gray500 textSm regular",children:n("dans_votre_fuse_58273",Bo())})]})]}),e.children]})},uJ=({children:e})=>{const{translate:n}=Kl();return(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(sf,{heading:n("informations_su_47120"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)(Qu,{borderRadius:"$2",height:40,width:"100%"}),(0,i.jsx)(Qu,{borderRadius:"$2",height:40,width:"100%"}),(0,i.jsx)(Qu,{borderRadius:"$2",height:104,width:"100%"}),(0,i.jsx)(Qu,{borderRadius:"$2",height:64,width:"100%"})]})}),e]})},mJ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{event:a}=BS();Au(t("_1_d_clencheur_46793",a.name));const r=(0,V.useRef)(null),d=ki(dJ),{showNotification:l}=AS(),c=rU.PRINT_TRIGGERS({organizationId:s,eventId:o});return(0,i.jsx)(xc,{customErrorRef:r,height:1,initialValues:{printTrigger:d.default(e.printTrigger)},render:({handleSubmit:n,submitting:s})=>(0,i.jsx)(Hx,{button:(0,i.jsx)(tc,{css:{flexShrink:0},isLoading:s,onClick:n,children:e.submitText}),category:t("printing_06197"),color:"dark",fallbackClosePath:c,heading:t("d_clencheurs_de_12821"),children:(0,i.jsx)(Gx,{ref:r,children:(0,i.jsx)(cJ,{event:e.event,organization:e.organization,printTrigger:e.printTrigger,children:(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:s,textAlign:"center",onClick:n,children:e.submitText})})})})}),schema:d.schema(),onSubmit:async t=>{const i=await e.save(d.toInput(t.printTrigger));return"PrintTriggerErrors"===i.__typename?d.toSubmitErrors(i.errors):(l({color:"success",text:e.successText}),void n.goBack(c))}})},gJ=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl();return(0,i.jsx)(Hx,{category:e("printing_06197"),color:"dark",fallbackClosePath:rU.PRINT_TRIGGERS({organizationId:n,eventId:t}),heading:e("d_clencheurs_de_12821"),children:(0,i.jsx)(Gx,{children:(0,i.jsx)(uJ,{})})})},hJ=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl(),{data:s,isLoading:o}=Li("query PrintTriggerFormOptions($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...PrintTriggerFormOrganization\n }\n\n event(id: $eventId) {\n ...PrintTriggerFormEvent\n }\n}\n",{organizationId:n,eventId:t},[$o.PrintTriggerFormOrganizationFragment,$o.PrintTriggerFormEventFragment]),{mutate:a}=function(e={}){return Ui("mutation PrintTriggerCreate($eventId: EventId!, $printTrigger: PrintTriggerInput!) {\n printTriggerCreate(eventId: $eventId, printTrigger: $printTrigger) {\n __typename\n ... on PrintTrigger {\n id\n }\n ... on PrintTriggerErrors {\n errors {\n code\n message\n }\n }\n }\n}\n",e)}();return o?(0,i.jsx)(gJ,{}):(0,i.jsx)(mJ,{event:s.event,organization:s.organization,printTrigger:null,save:async e=>(await a({eventId:t,printTrigger:e})).printTriggerCreate,submitText:e("cr_er_le_d_clen_22168"),successText:e("le_d_clencheur_67270")})},pJ=()=>{const{translate:e,params:{organizationId:n,eventId:t,printTriggerId:s}}=Kl(),{data:o,isLoading:a}=Li("query PrintTrigger(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $printTriggerId: PrintTriggerId!\n) {\n organization(id: $organizationId) {\n ...PrintTriggerFormOrganization\n }\n\n event(id: $eventId) {\n ...PrintTriggerFormEvent\n\n printTrigger(id: $printTriggerId) {\n id\n weezaccessPartnerId\n weezaccessPartner {\n __typename\n\n ... on WeezaccessPartnerError {\n message\n }\n }\n printerGroupId\n printerGroup {\n __typename\n\n ... on PrinterGroupError {\n message\n }\n }\n zplDocumentId\n activationRange\n }\n }\n}\n",{organizationId:n,eventId:t,printTriggerId:s},[$o.PrintTriggerFormOrganizationFragment,$o.PrintTriggerFormEventFragment]),{mutate:r}=function(e={}){return Ui("mutation PrintTriggerUpdate(\n $eventId: EventId!\n $printTriggerId: PrintTriggerId!\n $printTrigger: PrintTriggerInput!\n) {\n printTriggerUpdate(\n eventId: $eventId\n printTriggerId: $printTriggerId\n printTrigger: $printTrigger\n ) {\n __typename\n ... on PrintTrigger {\n id\n }\n ... on PrintTriggerErrors {\n errors {\n code\n message\n }\n }\n }\n}\n",e)}();return a?(0,i.jsx)(gJ,{}):(0,i.jsx)(mJ,{event:o.event,organization:o.organization,printTrigger:o.event.printTrigger,save:async e=>(await r({eventId:t,printTriggerId:s,printTrigger:e})).printTriggerUpdate,submitText:e("mettre_jour_85141"),successText:e("le_d_clencheur_40617")})};var IJ;function xJ(e){return{}}!function(e){e.Id="id",e.WeezaccessPartner="weezaccessPartner",e.PrinterGroup="printerGroup",e.MediaType="mediaType",e.Document="document",e.CreatedBy="createdBy",e.CreatedAt="createdAt",e.ActivationRange="activationRange",e.Status="status"}(IJ||(IJ={}));class fJ extends Og{constructor(e,n,t){super(e,n,t)}getPrintTriggersPossibleColumns(){return[{slug:IJ.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Dn.Id,width:100},{slug:IJ.WeezaccessPartner,name:this.t("op_rateur_weeza_31732"),isSearchable:!0,isSortable:!0,sortAttribute:Dn.WeezaccessPartner,minWidth:280},{slug:IJ.PrinterGroup,name:this.t("printing_locati_10729"),isSearchable:!0,isSortable:!0,sortAttribute:Dn.PrinterGroup,minWidth:200},{slug:IJ.MediaType,name:this.t("type_d_impressi_00431"),isSortable:!0,sortAttribute:Dn.MediaType,minWidth:160},{slug:IJ.Document,name:this.t("document_87149"),isSearchable:!0,isSortable:!0,sortAttribute:Dn.Document,minWidth:200},{slug:IJ.CreatedBy,name:this.t("cr_par_41994"),minWidth:220},{slug:IJ.CreatedAt,name:this.t("cr_le_85046"),isSortable:!0,minWidth:180,sortAttribute:Dn.CreatedAt},{slug:IJ.ActivationRange,name:this.t("p_riode_d_activ_48213"),isSortable:!0,sortAttribute:Dn.ActivationRange,minWidth:280},{slug:IJ.Status,name:this.t("State"),isSortable:!0,sortAttribute:Dn.Status,minWidth:140}]}}const _J=({children:e})=>{const{translate:n,params:{eventId:t}}=Kl(),{data:s,isLoading:o}=Li("query PrintTriggersCount($eventId: EventId!) {\n event(id: $eventId) {\n numberOfPrintTriggers\n }\n}\n",{eventId:t},[]);return o?(0,i.jsx)(Ql,{}):s.event.numberOfPrintTriggers>0?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(UE,{css:{alignSelf:"center",maxWidth:"460px",[`& ${Dr}:first-child`]:{maxInlineSize:"180px"}},imageSrc:ou.WeezeventBlankSwissArmyKnife,subtitle:n("cr_er_une_corre_64867"),title:n("aucun_d_clenche_58334")})},jJ=e=>{const n=ki(Bg),t=ki(Di);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:e.activationRange?(0,i.jsxs)(Tl,{direction:"column",width:1,children:[(0,i.jsx)(Mr,{font:"gray800 textSm regular",children:n.toLocaleString(e.activationRange.mapEndpoints(e=>e.toLocal()),{locale:du(t.language)},{weekday:"short",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),(0,i.jsx)(Mr,{font:"gray500 textXs regular",children:Bo()})]}):"-"})},vJ=({column:e,document:n})=>{const{translate:t}=Kl();let s;switch(n.__typename){case"CustomDocument":case"EventsDocument":s={children:t("feuille_papier_12296"),color:"white",leftIcon:"print",size:"lg"};break;case"ZplDocument":s={children:t("bracelet_50672"),color:"white",leftIcon:"hand-back-fist",size:"lg"}}return(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ku,{...s})})},SJ=({column:e,message:n})=>(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:["-",(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"error500",css:{margin:"-3px",padding:"3px"},children:(0,i.jsx)(Yl,{icon:"circle-exclamation",iconStyle:"solid"})})}),(0,i.jsx)(Dx,{placement:"top",children:n})]})]})});function yJ(e){switch(e){case Mn.Active:return"actif_70318";case Mn.Past:return"r_volu_61847";case Mn.Upcoming:return"Upcoming";default:return Zl()}}function CJ(e){switch(e){case Mn.Active:return{color:"success",leftIcon:"play"};case Mn.Past:return{color:"gray",leftIcon:"hourglass-end"};case Mn.Upcoming:return{color:"purple",leftIcon:"hourglass-start"};default:return Zl()}}const bJ=({column:e,status:n})=>{const{translate:t}=Kl();return(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ku,{...CJ(n),children:t(yJ(n))})})},AJ=({column:e,row:n})=>{const{translate:t}=Kl();if(s=e.slug,!Object.values(IJ).includes(s))return(0,i.jsx)($m,{children:"ERR"});switch(e.slug){case IJ.Id:return(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:n.id});case IJ.WeezaccessPartner:return"WeezaccessPartner"===n.weezaccessPartner.__typename?(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Xm,{target:"_blank",to:n.weezaccessPartner.url,children:n.weezaccessPartner.name})}):(0,i.jsx)(SJ,{column:e,message:n.weezaccessPartner.message});case IJ.PrinterGroup:return"PrinterGroup"===n.printerGroup.__typename?(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:n.printerGroup.name}):(0,i.jsx)(SJ,{column:e,message:n.printerGroup.message});case IJ.Document:return"EventsDocument"===n.document.__typename?(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:t(Jj(n.document.documentType))}):(0,i.jsx)($m,{minWidth:e.minWidth,width:e.width,children:n.document.name});case IJ.MediaType:return(0,i.jsx)(vJ,{column:e,document:n.document});case IJ.ActivationRange:return(0,i.jsx)(jJ,{activationRange:n.activationRange,column:e});case IJ.Status:return(0,i.jsx)(bJ,{column:e,status:n.status});case IJ.CreatedBy:return(0,i.jsx)(Tk,{column:e,createdBy:n.createdBy});case IJ.CreatedAt:return(0,i.jsx)($k,{column:e,insertedAt:n.insertedAt});default:return Zl(e.slug)}var s},EJ=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=Kl(),{canPrintConfigEdit:s}=oy();return(0,i.jsxs)(by,{justify:"between",children:[(0,i.jsx)(Mr,{font:"gray900 displayXs medium",children:e("d_clencheurs_de_12821")}),s&&(0,i.jsx)(tc,{to:rU.CREATE({organizationId:n,eventId:t}),children:e("ajouter_un_d_cl_57675")})]})},wJ=({printTrigger:{id:e,printerGroup:n,weezaccessPartner:t},onClose:s,onDelete:o})=>{const{params:{eventId:a},translate:r}=Kl(),d=Ni(),{showNotification:l}=AS(),{mutate:c,isLoading:u}=function(e={}){return Ui("mutation PrintTriggerDelete($eventId: EventId!, $printTriggerId: PrintTriggerId!) {\n printTriggerDelete(eventId: $eventId, printTriggerId: $printTriggerId) {\n id\n }\n}\n",e)}(),{descId:m,labelId:g}=Sc(),h=e=>{e||s()};return(0,St.createPortal)((0,i.jsxs)(qX,{descId:m,isOpen:!0,labelId:g,role:"alertdialog",setIsOpen:h,size:"md",children:[(0,i.jsx)(HX,{heading:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(dc,{id:g,children:r("supprimer_le_d_48302")}),(0,i.jsx)(rc,{textStyle:"subtitle",children:r("l_action_est_ir_70153")})]}),leftIcon:"triangle-exclamation",leftIconColor:"error600",leftIconCss:{background:"$error100",borderColor:"$error100",boxShadow:"none",color:"$error600"},setIsOpen:h}),(0,i.jsx)(YX,{css:{padding:"$2 $7 $7 $7"},id:m,children:(0,i.jsx)(rc,{children:"PrinterGroup"===n.__typename&&"WeezaccessPartner"===t.__typename?[...d(r("vous_tes_sur_l_27614"),(0,i.jsx)("b",{children:n.name}),(0,i.jsx)("b",{children:t.name}))]:r("vous_tes_sur_l_83950",e)})}),(0,i.jsx)(ZX,{handleSubmit:async()=>{await c({eventId:a,printTriggerId:e}),l(r("le_d_clencheur_59821")),s(),o()},isLoading:u,setIsOpen:h,submitStyle:"error",submitText:r("supprimer_le_d_19736")})]}),document.body)},$J=({row:e,reload:n})=>{const{params:{organizationId:t,eventId:s},translate:o}=Kl(),[a,r]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"pen",to:rU.UPDATE({organizationId:t,eventId:s,printTriggerId:e.id}),children:o("_diter_62574")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),r(!0)},children:o("supprimer_43083")})})]}),a&&(0,i.jsx)(wJ,{printTrigger:e,onClose:()=>r(!1),onDelete:n})]})},TJ=()=>{const{event:e}=BS(),{translate:n,params:{organizationId:t,eventId:s}}=Kl();Au(n("_1_d_clencheur_46793",e.name));const[o,a]=zD("printTriggers.columns",[IJ.WeezaccessPartner,IJ.PrinterGroup,IJ.Document,IJ.MediaType,IJ.ActivationRange,IJ.Status]),r=ki(fJ),d=(0,V.useMemo)(()=>r.getPrintTriggersPossibleColumns(),[r]),[l,c]=zD("printTriggers.predicates",[]),u=(0,V.useMemo)(()=>xg(l),[l]),{canPrintConfigEdit:m}=oy(),[g,h]=zD("printTriggers.sort",null);return(0,i.jsxs)(Ay,{children:[(0,i.jsx)(EJ,{}),(0,i.jsx)(yy,{children:(0,i.jsx)(_J,{children:(0,i.jsx)(Cx,{columns:o,columnsSearch:[],columnsToIncludes:xJ,eventId:s,filters:[],limit:Tm,loadDataList:ol,loadRow:al,organizationId:t,possibleColumns:d,predicates:u,rendering:ph.List,setColumns:a,setPredicates:c,setSort:h,showEditColumns:!0,showEditMode:!1,showFilters:!1,showMassActions:!1,showPredicatesBadges:!0,showRowDropdown:m,showRowEdit:m,showSearchColumns:!1,sort:g,children:(0,i.jsx)(kx,{getEditPath:({id:e})=>rU.UPDATE({organizationId:t,eventId:s,printTriggerId:e}),renderCell:(e,n)=>(0,i.jsx)(AJ,{column:e,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)($J,{reload:n,row:e})})})})})]})},zJ=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=Kl(),a=e.userInfo.volunteerRegistration?.delegation,r=(0,V.useMemo)(()=>e.forms.map(e=>({...e,showFullAccreditation:!0,slotDisplay:Ln.Hide,accreditationFilter:Nn.None})),[e.forms]),d=(0,V.useMemo)(()=>e.forms.map(n=>{const t=e.userInfo.formsUsersInfos.find(e=>e.formId===n.id);return{profileId:t?.accreditationProfileId??null,slotsIds:t?.accreditationsSlotsIds??[]}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(FM,{forms:e.forms,getTabPath:e=>yo.EDIT_USER_ACCREDITATIONS_FORM(n,t,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:yo.VOLUNTEERS(n,t),title:o("mise_jour_des_60902",e.userInfo.nameOrEmail),children:e.forms.map((o,l)=>(0,i.jsxs)($y,{path:yo.EDIT_USER_ACCREDITATIONS_FORM(n,t,s,o.id),children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(LR,{accreditationProfileId:e.values.userInfo.accreditations[l].accreditationProfileId,accreditationsSlotsIds:e.values.userInfo.accreditations[l].accreditationsSlotsIds,alreadyAssignedProfileId:d[l].profileId,alreadyAssignedSlotsIds:d[l].slotsIds,change:e.change,delegationAccreditationsProfiles:a?.formId===o.id?a.accreditationsProfiles:qo,delegationAccreditationsSlots:a?.formId===o.id?a.accreditationsSlots:qo,displayFormCustomFields:!1,event:e.event,options:r[l],prefix:`userInfo.accreditations[${l}].`,scannedSlotsIds:qo,showAutoAccredit:!1,slots:qo,userInfosFields:e.userInfo.fields})]},o.id))})},OJ=e=>{const{history:n,params:{organizationId:t,eventId:s,userInfoId:o}}=Kl(),a=ki(wR),{mutate:r,isLoading:d}=function(e={}){return Ui("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)}(),l=(0,V.useMemo)(()=>e.forms.map(n=>{const t=e.userInfo.formsUsersInfos.find(e=>e.formId===n.id);return{formId:n.id,...a.volunteersRegistrationsWishedAccreditationsUpdateInputDefault(t)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:{userInfo:{accreditations:l}},render:({form:n,handleSubmit:t,values:s})=>(0,i.jsx)(zJ,{change:n.change,event:e.event,forms:e.forms,handleSubmit:t,isLoading:d,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await r({eventId:s,userInfoId:o,userInfoAccreditations:e.userInfo.accreditations}),n.goBack(yo.VOLUNTEERS(t,s))}})},RJ=()=>{const{organizationId:e,eventId:n,userInfoId:t}=Vi(),{data:s,loader:o}=Li("query UserUpdateAccreditationsInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $loadDelegation: Boolean!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...MemberRegistrationUserInfo\n ...FormsUsersInfosWished\n\n volunteerRegistration(eventId: $eventId) @include(if: $loadDelegation) {\n delegation {\n formId\n\n accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\n\n accreditationsSlots {\n ...DelegationAccreditationSlot\n }\n }\n }\n }\n }\n\n event(id: $eventId) {\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n\n accreditationsProfilesCategories {\n ...FormRegisterAccreditationProfileCategory\n }\n }\n}\n",{organizationId:e,eventId:n,userInfoId:t,loadDelegation:!0},[$o.MemberRegistrationUserInfoFragment,$o.FormsUsersInfosWishedFragment,$o.DelegationAccreditationProfileFragment,$o.DelegationAccreditationSlotFragment,$o.FormMemberRegistrationFragment,$o.FormRegisterAccreditationCategoryFragment,$o.FormRegisterAccreditationProfileCategoryFragment]),a=(0,V.useMemo)(()=>{if(s.organization&&s.event){const e=s.organization.userInfo.volunteerRegistration;return s.event.forms.nodes.filter(n=>n.accreditationDisplay!==Pn.None||e.delegation?.formId===n.id&&Yo(e.delegation.accreditationsSlots))}return[]},[s.organization,s.event]);return o||(Yo(a)?(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.EDIT_USER_ACCREDITATIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(OJ,{event:s.event,forms:a,userInfo:s.organization.userInfo})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.EDIT_USER_ACCREDITATIONS_FORM(e,n,t,a[0].id),replace:!0})})]}):(0,i.jsx)(qi,{}))},DJ=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=Kl();return(0,i.jsx)(FM,{forms:e.forms,getTabPath:e=>yo.EDIT_USER_MISSIONS_FORM(n,t,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:yo.VOLUNTEERS(n,t),title:o("mise_jour_des_02859",e.userInfo.nameOrEmail),children:e.forms.map((o,a)=>(0,i.jsxs)($y,{path:yo.EDIT_USER_MISSIONS_FORM(n,t,s,o.id),children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(nD,{change:e.change,event:e.event,options:{...o,showFullPosition:!0,slotDisplay:Ln.Hide,positionFilter:Nn.None},positionsCategoriesIds:e.values.userInfo.missions[a].positionsCategoriesIds,positionsIds:e.values.userInfo.missions[a].positionsIds,positionsSlotsIds:e.values.userInfo.missions[a].positionsSlotsIds,prefix:`userInfo.missions[${a}].`,slots:qo,userInfoFields:e.userInfo.fields})]},o.id))})},MJ=e=>{const{history:n,params:{organizationId:t,eventId:s,userInfoId:o}}=Kl(),a=ki(wR),{mutate:r,isLoading:d}=function(e={}){return Ui("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)}(),l=(0,V.useMemo)(()=>e.forms.map(n=>{const t=e.userInfo.formsUsersInfos.find(e=>e.formId===n.id);return{formId:n.id,...a.volunteersRegistrationsWishedPositionsUpdateInputDefault(t)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:{userInfo:{missions:l}},render:({form:n,handleSubmit:t,values:s})=>(0,i.jsx)(DJ,{change:n.change,event:e.event,forms:e.forms,handleSubmit:t,isLoading:d,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await r({eventId:s,userInfoId:o,userInfoPositions:e.userInfo.missions}),n.goBack(yo.VOLUNTEERS(t,s))}})},PJ=()=>{const{organizationId:e,eventId:n,userInfoId:t}=Vi(),{data:s,loader:o}=Li("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:n,userInfoId:t},[$o.MemberRegistrationUserInfoFragment,$o.FormsUsersInfosWishedFragment,$o.FormMemberRegistrationFragment,$o.FormRegisterCategoryFragment]),a=(0,V.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.positionDisplay!==Fn.None),[s.event]);return o||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.EDIT_USER_MISSIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(MJ,{event:s.event,forms:a,userInfo:s.organization.userInfo})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.EDIT_USER_MISSIONS_FORM(e,n,t,a[0].id),replace:!0})})]})},kJ=e=>{const{translate:n,params:{organizationId:t,eventId:s,userInfoId:o}}=Kl();return(0,i.jsx)(FM,{forms:e.forms,getTabPath:e=>yo.EDIT_USER_SLOTS_FORM(t,s,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:yo.VOLUNTEERS(t,s),title:n("mise_jour_des_28904",e.userInfo.nameOrEmail),children:e.forms.map((n,a)=>(0,i.jsxs)($y,{path:yo.EDIT_USER_SLOTS_FORM(t,s,o,n.id),children:[(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(mD,{change:e.change,currentSlots:e.values.userInfo.slots[a].slots,customSlotsPeriods:n.customSlotsPeriods,daysDisplay:n.daysDisplay,elements:n.elements,event:e.event,prefix:`userInfo.slots[${a}].`,slotDisplay:n.slotDisplay,userInfoFields:e.userInfo.fields})]},n.id))})},FJ=e=>{const{history:n,params:{organizationId:t,eventId:s,userInfoId:o}}=Kl(),a=ki(wR),{mutate:r,isLoading:d}=function(e={}){return Ui("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)}(),l=(0,V.useMemo)(()=>e.forms.map(n=>{const t=e.userInfo.formsUsersInfos.find(e=>e.formId===n.id);return{formId:n.id,slots:a.volunteersRegistrationsSlotsUpdateInputDefault(t?.slots)}}),[e.forms,e.userInfo]);return(0,i.jsx)(xc,{direction:"column",height:1,initialValues:{userInfo:{slots:l}},render:({form:n,handleSubmit:t,values:s})=>(0,i.jsx)(kJ,{change:n.change,event:e.event,forms:e.forms,handleSubmit:t,isLoading:d,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await r({eventId:s,userInfoId:o,userInfoSlots:e.userInfo.slots}),n.goBack(yo.VOLUNTEERS(t,s))}})},NJ=()=>{const{organizationId:e,eventId:n,userInfoId:t}=Vi(),{data:s,loader:o}=Li("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:n,userInfoId:t},[$o.MemberRegistrationUserInfoFragment,$o.FormsUsersInfosWishedFragment,$o.FormMemberRegistrationFragment]),a=(0,V.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==Ln.Hide),[s.organization,s.event]),{permissions:[r],isLoading:d}=iE(QA({eventId:n,userInfoId:t})),l=Bi();return d||r||l.push(yo.DASHBOARD(e,n)),o||d?o:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.EDIT_USER_SLOTS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(FJ,{event:s.event,forms:a,userInfo:s.organization.userInfo})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.EDIT_USER_SLOTS_FORM(e,n,t,a[0].id),replace:!0})})]})},LJ=()=>{const{params:{eventId:e}}=Kl(),{canMemberAccredit:n}=oy(),{infos:t,setInfos:s}=ok(),{data:o,idToLoading:a,isEditMode:r,isLoading:d,limit:l,numberOfPages:c,offset:u,reloadRow:m,setLimit:g,setOffset:h,totalCount:p}=pg(),{mutate:I}=ja(),{mutate:x}=fa(),{data:f,isLoading:_}=Li("query VolunteersAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n ...AccreditationProfileMatrix\n }\n }\n\n accreditationsSlots(includeHidden: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:e},[$o.AccreditationProfileMatrixFragment,$o.AccreditationSlotMatrixFragment]),j=(0,V.useMemo)(()=>t.volunteersMatrixRendering||mh.Category,[t]),v=(0,V.useCallback)(e=>s(n=>({...n,volunteersMatrixRendering:e})),[t,s]),S=(0,V.useMemo)(()=>t.volunteersMatrixSelectedSlotsIds||[],[t]),y=(0,V.useCallback)(e=>s(n=>({...n,volunteersMatrixSelectedSlotsIds:e})),[t,s]),C=(0,V.useMemo)(()=>t.volunteersMatrixSelectedProfilesIds||[],[t]),b=(0,V.useCallback)(e=>s(n=>({...n,volunteersMatrixSelectedProfilesIds:e})),[t,s]),A=(0,V.useMemo)(()=>t.volunteersMatrixShowAccreditations??!0,[t]),E=(0,V.useCallback)(e=>s(n=>({...n,volunteersMatrixShowAccreditations:e})),[s]),w=(0,V.useMemo)(()=>t.volunteersMatrixShowProfiles??!0,[t]),$=(0,V.useCallback)(e=>s(n=>({...n,volunteersMatrixShowProfiles:e})),[s]),T=(0,V.useMemo)(()=>t.volunteersMatrixShowQuota??!1,[t]),z=(0,V.useCallback)(e=>{s(n=>({...n,volunteersMatrixShowQuota:e}))},[t,s]),O=(0,V.useCallback)(e=>a[e]??!1,[a]),R=(0,V.useCallback)((n,t)=>x({eventId:e,massProfileUpdate:{accreditationProfileId:t,selecteds:{ids:[n]},strategy:hn.Add}}),[e,x]),D=(0,V.useCallback)((n,t)=>I({eventId:e,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[n]},strategy:hn.Add}}),[e,I]),M=(0,V.useCallback)((n,t)=>x({eventId:e,massProfileUpdate:{accreditationProfileId:t,selecteds:{ids:[n]},strategy:hn.Delete}}),[e,x]),P=(0,V.useCallback)((n,t)=>I({eventId:e,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[n]},strategy:hn.Delete}}),[e,I]);return(0,i.jsx)(m$,{addAccreditationProfile:R,addAccreditationSlot:D,allAccreditationsProfiles:f.event?.accreditationsProfiles.nodes??qo,allAccreditationsSlots:f.event?.accreditationsSlots.nodes??qo,canDeleteCheckedIn:n,deleteAccreditationProfile:M,deleteAccreditationSlot:P,editMode:"assigned",isEditMode:r,isLoading:d||_,isRowLoading:O,limit:l,members:o,numberOfPages:c,offset:u,reloadRow:m,rendering:j,selectedProfilesIds:C,selectedSlotsIds:S,setLimit:g,setOffset:h,setRendering:v,setSelectedProfilesIds:b,setSelectedSlotsIds:y,setShowAccreditations:E,setShowProfiles:$,setShowQuota:z,showAccreditations:A,showProfiles:w,showQuota:T,totalCount:p})},UJ=({eventId:e,organizationId:n,reload:t,reloadRow:s,volunteerRegistration:o})=>{const{history:a,translate:r}=Kl(),{hasFeature:d}=XS(),{event:l,hasEventRole:c}=BS(),{canMemberAccredit:u,canMemberAssign:m,canMemberAssignmentStateEdit:g,canMemberCreate:h,canMemberDelete:p,canMemberEdit:I}=oy(),{showNotification:x}=AS(),f=o.state,_=o.accreditationState,{mutate:j,isLoading:v}=lr(),{mutate:S,isLoading:y}=ar(),{mutate:C,isLoading:b}=or(),{mutate:A}=Na(),{mutate:E}=Ga(),w=g&&f!==it.WaitingAssignment,$=g&&f!==it.Refused,T=g&&(f===it.WaitingAssignment||f===it.Assigned),z=m&&f===it.Assigned,O=m&&f===it.PreAssigned,R=m&&f===it.WaitingAssignment,D=u&&_!==ge.WaitingAccreditation,M=u&&_!==ge.Refused,P=u&&(_===ge.WaitingAccreditation||_===ge.Accredited||_===ge.AutoAccredited),k=u&&(_===ge.Accredited||_===ge.AutoAccredited),F=u&&_===ge.WaitingAccreditation,[N,L]=(0,V.useState)(!1),[U,B]=(0,V.useState)(!1),[W,G]=(0,V.useState)(!1),q=c&&I&&l.useDelegations&&d(Ze.Delegation)&&o.delegation,H=h,Y=p&&o.canDelete;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[w&&(0,i.jsx)(Pu,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:it.WaitingAssignment}}),s())},children:r("changer_le_stat_90266")}),$&&(0,i.jsx)(Pu,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:it.Refused}}),s())},children:r("changer_le_stat_68392")}),T&&(0,i.jsx)(Pu,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:it.NotApplicable}}),s())},children:r("changer_le_stat_62507")}),z&&(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{v||a.push(yo.EDIT_ASSIGNMENT(n,e,o.userInfo.id))},children:r("_diter_les_affe_42283")}),O&&(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{v||a.push(yo.PRE_ASSIGNMENT(n,e,o.userInfo.id))},children:r("_diter_les_pr_10213")}),R&&(0,i.jsx)(Pu,{icon:"wand-magic-sparkles",onClick:()=>{v||a.push(yo.ASSIGNMENT(n,e,o.userInfo.id))},children:r("affecter_94255")})]}),(0,i.jsxs)(lw,{children:[D&&(0,i.jsx)(Pu,{icon:"arrow-right-arrow-left",onClick:async()=>{y||(await S({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:ge.WaitingAccreditation}}),s())},children:r("changer_le_stat_20528")}),M&&(0,i.jsx)(Pu,{icon:"arrow-right-arrow-left",onClick:async()=>{y||(await S({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:ge.Refused}}),s())},children:r("changer_le_stat_68392")}),P&&(0,i.jsx)(Pu,{icon:"arrow-right-arrow-left",onClick:async()=>{y||(await S({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:ge.NotApplicable}}),s())},children:r("changer_le_stat_62507")}),k&&(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{y||a.push(yo.EDIT_ACCREDIT(n,e,o.userInfo.id))},children:r("_diter_les_accr_86042")}),F&&(0,i.jsx)(Pu,{icon:"check",onClick:async()=>{b||(await C({eventId:e,selecteds:{ids:[o.userInfo.id]}}),s())},children:r("valider_les_acc_80801")}),F&&(0,i.jsx)(Pu,{icon:"badge-check",onClick:()=>{y||a.push(yo.ACCREDIT(n,e,o.userInfo.id))},children:r("accr_diter_70543")})]}),(0,i.jsxs)(lw,{children:[H&&(0,i.jsx)(Pu,{icon:"clone",onClick:()=>L(!0),children:r("dupliquer_28256")}),q&&(0,i.jsx)(Pu,{color:"red",icon:"minus",onClick:()=>B(!0),children:r("retirer_de_la_d_64963")}),Y&&(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>G(!0),children:r("d_sinscrire_de_06416")})]})]}),H&&N&&(0,i.jsx)(cw,{name:o.userInfo.nameOrEmail,reload:t,userInfoId:o.userInfo.id,onClose:()=>L(!1)}),q&&U&&(0,i.jsx)(ow,{buttonText:r("retirer_de_la_d_64963"),subtext:[r("_tes_vous_sur_d_34901",o.delegation.name)],text:r("suppression_de_73669",o.userInfo.name),onClose:()=>{B(!1)},onDelete:async()=>{await A({organizationId:n,eventId:e,delegationId:o.delegation.id,selecteds:{ids:[o.userInfo.id]}}),x(r("_1_a_t_retir_36729",o.userInfo.name,o.delegation.name)),s()}}),p&&W&&(0,i.jsx)(ow,{buttonText:r("d_sinscrire_de_06416"),subtext:[r("_tes_vous_sur_d_79932")],text:r("suppression_de_73669",o.userInfo.name),onClose:()=>{G(!1)},onDelete:async()=>{await E({eventId:e,selecteds:{ids:[o.userInfo.id]}}),x(r("_1_a_t_d_sin_66177",o.userInfo.name)),t()}})]})},VJ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{reloadRow:o}=pg(),{userInfo:a}=e.volunteerRegistration;return(0,i.jsxs)(i.Fragment,{children:[(a.isEditable??!0)&&(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",to:yo.EDIT_USER(t,s,a.id)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(UJ,{eventId:s,organizationId:t,reload:e.reload,reloadRow:()=>o(e.volunteerRegistration.id),volunteerRegistration:e.volunteerRegistration})]})},BJ=(0,V.memo)(function(e){const{params:{organizationId:n,eventId:t,segmentId:s}}=Kl(),{hasEventRole:o,hasPermission:a}=BS(),{canMemberAccredit:r,canMemberAssign:d,canMemberEdit:l}=oy(),c=Kb(e.customFields),u=o&&l,m=(0,V.useCallback)(e=>{const i=e.userInfo.id;return{accreditationsPanelPath:yo.VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS(n,t,s,i),availabilitiesPanelPath:yo.VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES(n,t,s,i),positionsPanelPath:yo.VOLUNTEERS_LIST_USER_PANEL_POSITIONS(n,t,s,i)}},[n,t,s]),g=(0,V.useCallback)((e,n)=>a(sy.POSITION_READ,{positionCategoryId:e,positionId:n}),[a]),h=(0,V.useCallback)((e,n)=>a(sy.MEMBER_ASSIGN,{positionCategoryId:e,positionId:n}),[a]);return(0,i.jsx)(kx,{renderCell:(e,n,s)=>(0,i.jsx)(pE,{...m(n),canChangeDelegation:u,canMemberAccredit:r,canMemberAssign:d,column:e,customField:c.get(e.slug),eventId:t,reloadRow:s,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)(VJ,{reload:n,volunteerRegistration:e}),renderRowPanels:(e,o)=>(0,i.jsx)(sw,{...m(e),canCheckIn:g,canDeleteCheckedIn:r,canDeletePosition:h,canMemberAccredit:r,canWishedAccreditationsEdit:!1,defaultHiddenAccreditationsSlotsIds:[],eventId:t,organizationId:n,reloadRow:o,returnPathFallback:yo.VOLUNTEERS(n,t),teamsPanelsPath:(e.teams||[]).map(i=>yo.VOLUNTEERS_LIST_USER_PANEL_TEAM(n,t,s,e.userInfo.id,i.teamCode)),volunteerRegistration:e})})}),WJ=(0,V.memo)(e=>{const n=(0,V.useCallback)(n=>{n&&(t.current&&(s.current?.setMap(null),t.current=null),t.current=new google.maps.Map(n,{...Gr(e.initialCenter,e.initialZoom,e.layer)}),t.current.mapTypes.set(gn.IgnPlan,Kr()),s.current=new google.maps.OverlayView,s.current.draw=Bc.A,s.current.setMap(t.current),t.current.addListener("drag",()=>{e.onMapDrag?.()}),t.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:t.current.getCenter().lat(),lng:t.current.getCenter().lng()})}),t.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(t.current.getZoom())}),t.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),r(),sQ(e.traces,e.hiddenTracesIds,a,t))},[]),t=(0,V.useRef)(null),s=(0,V.useRef)(null),o=(0,V.useRef)([]),a=(0,V.useRef)([]),r=(0,V.useCallback)(()=>{o.current.forEach(e=>e.setMap(null)),o.current=e.users.map(n=>{const i=Vr(n),o=Qf(n.name,n.email),a=new google.maps.Marker({position:i,map:t.current,icon:`${F.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent("#0284fe")}&text=${o}`});return a.addListener("click",()=>{const t=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));t&&e.onUserClick?.(n,t)}),a})},[e.users]);return(0,V.useEffect)(()=>{r()},[JSON.stringify(e.users)]),(0,V.useEffect)(()=>{t.current?.setMapTypeId(Hr(e.layer))},[e.layer]),(0,V.useEffect)(()=>{sQ(e.traces,e.hiddenTracesIds,a,t)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(Mr,{ref:n,height:1,width:1})},Yr.A);WJ.displayName="UsersMap";const GJ=e=>{const{params:{organizationId:n,eventId:t}}=Kl();return(0,i.jsx)(Tl,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:50,children:(0,i.jsxs)(ql,{to:Rj.MEMBER_INFORMATION({organizationId:n,eventId:t,userInfoId:e.user.id}),children:[(0,i.jsx)(Mr,{color:"gray800",children:e.user.name}),(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"chevron-right"})})]})})},qJ=e=>{const{params:{eventId:n}}=Kl(),{event:t,hasPermission:s}=BS(),o=s(sy.MEMBER_EDIT,{eventId:n}),{mutate:a}=Ca(),[r,d]=(0,V.useState)(e.layer),[l,c]=(0,V.useState)(null),[u,m]=(0,V.useState)([]),[g,h]=zD("volunteerssMap.center",e.center),[p,I]=zD("volunteerssMap.zoom",Wr),x=(0,V.useRef)(null);return(0,i.jsxs)(Tl,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[(0,i.jsx)(Mr,{ref:x,css:{flex:"1"},width:1,children:(0,i.jsx)(WJ,{hiddenTracesIds:u,initialCenter:g,initialZoom:p,layer:r,traces:e.traces,users:e.users,onMapCenterChanged:h,onMapDrag:()=>c(null),onMapZoomchanged:I,onUserClick:(e,n)=>c({user:e,left:n.x,top:n.y})})}),o&&(0,i.jsx)(iQ,{acronymIcon:"icon",event:t,hiddenTracesIds:u,layer:r,reload:e.reload,setAcronymIcon:Bc.A,setHiddenTracesIds:m,setLayer:async e=>{d(e),await a({eventId:n,layer:e})},showAcronymIcon:!1,showExport:!1,traces:e.traces,onExport:Bc.A,onFullscreen:()=>{x.current?.requestFullscreen()}}),x.current&&l&&(0,St.createPortal)((0,i.jsx)(Mr,{css:{left:`${l.left+32}px`,position:"absolute",top:l.top-25-16+"px",zIndex:10},children:(0,i.jsx)(GJ,{user:l.user})}),x.current)]})},HJ=()=>{const{params:{eventId:e}}=Kl(),{columns:n,columnsSearch:t,nameDebounced:s,predicates:o,rendering:a}=pg(),r=(0,V.useMemo)(()=>({...zh(n,a),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[n,a]),{data:d,loader:l,reload:c}=(u={...r,eventId:e,predicatesGroups:o,hasCoordinates:!0,name:g(s)?s:null,columnsSearch:Yo(t)?t:void 0,limit:250},Li(pa,u,[$o.VolunteerRegistrationFragment,$o.TraceFragment]));var u;const m=(0,V.useMemo)(()=>(d.data?.rows.nodes??[]).flatMap(e=>"number"==typeof e.userInfo.fields.latitude&&"number"==typeof e.userInfo.fields.longitude?[{id:e.userInfo.id,email:e.userInfo.email,latitude:e.userInfo.fields.latitude,longitude:e.userInfo.fields.longitude,name:e.userInfo.name}]:[]),[d.data]);return l||(0,i.jsx)(qJ,{center:P_(d.data),layer:d.data.layer,reload:c,traces:d.data.traces||[],users:m})},YJ=e=>{const{translate:n,params:{eventId:t}}=Kl(),{limit:s,nameDebounced:o,offset:a,predicates:r,setLimit:d,setOffset:l}=pg(),{infos:c,setInfos:u}=ok(),{data:m,loader:h}=pl({eventId:t,predicatesGroups:r,name:g(o)?o:void 0,limit:s,offset:a}),{numberOfPages:p,totalCount:I}=Sx(m.data?.rows),x=(0,V.useMemo)(()=>c?.volunteersPlanningshowAvailabilities??!0,[c]),f=(0,V.useCallback)(e=>{u({...c,volunteersPlanningshowAvailabilities:e})},[c,u]),_=(0,V.useMemo)(()=>(m.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>x?[{type:"availability",range:e.range}]:[]).concat(e.positionsSlotsUsersInfos.map(e=>({type:"assignment",range:e.positionSlot.range,positionCategory:e.positionCategory,position:e.position,positionSlot:e.positionSlot})))})),[m.data,x]),j=(0,V.useMemo)(()=>Oo.c9.isDateTime(c.volunteersPlanningStartAt)&&c.volunteersPlanningStartAt?.isValid?c.volunteersPlanningStartAt:Oo.c9.fromISO(c.volunteersPlanningStartAt)?.isValid?Oo.c9.fromISO(c.volunteersPlanningStartAt,{zone:"utc"}):Oo.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Oo.c9.utc())?Oo.c9.utc():e.startAt,[e.startAt,e.endAt,c]),v=(0,V.useCallback)(n=>{u({...c,volunteersPlanningStartAt:n?.toISO()??e.startAt.toISO()})},[e.startAt,c,u]),S=(0,V.useMemo)(()=>{const n=Yg(e.dayStartTime);return n?.[0]??0},[e.dayStartTime]);return h||(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Tl,{css:{background:"white",flex:"1"},children:(0,i.jsx)(uQ,{data:_,date:j,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(Mr,{width:40,children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",leftIcon:x?"eye":"eye-slash",onClick:()=>f(!x)})}),(0,i.jsx)(Dx,{placement:"top",children:n(x?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(FQ,{vr:e}),renderSlot:e=>(0,i.jsx)(UQ,{slot:e}),showPlus:!1,startHour:S,onChange:v})}),(0,i.jsx)(Fm,{children:(0,i.jsx)(Pm,{limit:s,numberOfPages:p,offset:a,setLimit:d,setOffset:l,showLimits:!0,totalCount:I})})]})},ZJ=()=>(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},children:[(0,i.jsx)(sm,{shouldPreventDefault:!1,state:"unchecked",onClick:Bc.A}),(0,i.jsx)(Pl,{width:"3"}),(0,i.jsx)(Qu,{size:40,variant:"circular"}),(0,i.jsx)(Pl,{width:"4"}),(0,i.jsxs)(Tl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:12,width:1}),(0,i.jsx)(Qu,{borderRadius:"$1",height:12,width:1})]})]}),KJ=e=>{const{data:n,isLoading:t}=gl({organizationId:e.organizationId,excludedEventId:e.eventId,name:g(e.nameOrEmail)?e.nameOrEmail:null});return t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ZJ,{}),(0,i.jsx)(ZJ,{}),(0,i.jsx)(ZJ,{})]}):(0,i.jsx)(i.Fragment,{children:n.organization.usersInfos.nodes.map(n=>{const t=e.usersInfosIds.includes(n.id)?"checked":"unchecked";return(0,i.jsx)(TT,{state:t,userInfo:n,onClick:()=>{e.select(n.id)}},n.id)})})},XJ=e=>{const n=Fi(),t=ki(wR),s=ki(Ol),[o,a,r]=Wm(""),{mutate:d,isLoading:l}=hl();return(0,i.jsx)(xc,{hideDefaultErrors:!0,initialValues:{usersInfosIds:[],sendVolunteerRegistrationEmail:!1},render:({form:t,handleSubmit:s,values:d})=>(0,i.jsxs)(dg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Mr,{color:"gray800",css:{height:"56px",textAlign:"center"},children:(0,i.jsx)("img",{alt:"Avatars",height:"100%",src:su.AvatarGroup})}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("ajouter_un_memb_33261")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:n("ajouter_un_ou_d_44771")}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_05904"),value:o,onChange:r}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(hc,{}),(0,i.jsx)(Tl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:(0,i.jsx)(KJ,{eventId:e.eventId,nameOrEmail:a,organizationId:e.organizationId,select:e=>{t.change("usersInfosIds",Xo(d.usersInfosIds,e))},usersInfosIds:d.usersInfosIds})}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsxs)(Tl,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(Xx,{name:"sendVolunteerRegistrationEmail",children:n("envoyer_l_e_mai_35622")}),(0,i.jsx)(tc,{isLoading:l,onClick:s,children:n("ajouter_97327")}),(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]}),validate:s.validateForForm(t.adminAddSchema()),onSubmit:async n=>{await d({eventId:e.eventId,usersInfosIds:n.usersInfosIds,sendVolunteerRegistrationEmail:n.sendVolunteerRegistrationEmail}),e.reload(),e.onClose()}})},QJ=({reload:e})=>{const{params:{organizationId:n,eventId:t,segmentId:s},translate:o}=Kl(),{user:a}=Yi(),{hasFeature:r}=XS(),{hasEventRole:d}=BS(),{canMemberCreate:l}=oy(),{columns:c}=pg(),{segment:u}=ok(),{mutate:m}=function(e={}){return Ui("mutation VolunteersCriblageExport($eventId: EventId!, $segmentId: SegmentId!) {\n jobId: volunteersCriblageExport(eventId: $eventId, segmentId: $segmentId)\n}\n",e)}(),{mutate:g}=function(e={}){return Ui("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:p}=Li("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:t,segmentId:s},[]),[I,x]=(0,V.useState)(!1),[f,_]=(0,V.useState)(!1),[j,v]=(0,V.useState)(!1),{checkExport:S}=AS();return(0,i.jsxs)(kk,{children:[l&&(0,i.jsx)(Fz,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pu,{icon:"user-group",onClick:e=>{Tu(e.target),x(!0)},children:o("ajouter_des_mem_06922")}),(0,i.jsx)(Pu,{icon:"file-import",to:yo.EVENT_VOLUNTEERS_IMPORT(n,t),onClick:e=>Tu(e.target),children:o("importer_via_un_61623")})]}),path:Rj.CREATE({organizationId:n,eventId:t}),children:o("ajouter_un_memb_33261")}),(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[d&&(0,i.jsx)(Pu,{icon:"plug-circle-bolt",onClick:e=>{Tu(e.target),_(!0)},children:o("exporter_via_l_09843")}),(0,i.jsx)(Pu,{icon:"file-xls",onClick:e=>{Tu(e.target),v(!0)},children:o("exporter_en_exc_51862")}),r(Ze.Criblage)&&(0,i.jsx)(Pu,{icon:"arrow-down-to-bracket",onClick:async e=>{Tu(e.target);const{jobId:i}=await m({eventId:t,segmentId:u.id});S(i,n,t)},children:o("exporter_pour_l_97136")}),(0,i.jsx)(Pu,{download:`${u.name}-users-listing`,icon:"arrow-down-to-bracket",to:Ef(h.event?.segment.links.usersListingLink,"pdf",{lang:a?.language}),children:o("t_l_charger_en_59616")}),(0,i.jsx)(ly,{permissions:sy.MEMBER_CREATE,children:(0,i.jsx)(Pu,{icon:"file-import",to:yo.EVENT_FILES_IMPORT(n,t),children:o("importer_des_do_55420")})})]})]}),I&&(0,i.jsx)(XJ,{eventId:t,organizationId:n,reload:e,onClose:()=>x(!1)}),!p&&(0,i.jsx)(_N,{isOpen:f,link:Af({organizationId:n,eventId:t,lang:a?.language,pathComponent:`volunteers/${s}`,key:h.event.key}),onClose:()=>_(!1)}),(0,i.jsx)(jN,{isOpen:j,requestExport:async(e,i)=>{const{jobId:s}=await g({eventId:t,segmentId:u.id,format:e,includeFiles:i,columns:c});S(s,n,t)},showIncludeFiles:!0,onClose:()=>v(!1)})]})},JJ=(0,V.memo)(function(e){const n=Fi(),{canAccreditationRead:t,canMemberAccredit:s,canMemberAssign:o,canMemberEdit:a,canSegmentEdit:r}=oy(),{limit:d,massActions:l,predicates:c,reload:u,rendering:m,sort:g}=pg(),{onMassEditSuccess:h,segment:p}=ok(),I=a||o||s,x=r&&m===xh.List,f=a&&m===xh.List||s&&m===xh.AccreditationsMatrix;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(QJ,{reload:u}),(0,i.jsxs)(yy,{children:[(0,i.jsx)(bk,{searchRow:(0,i.jsx)(Ck,{actions:(0,i.jsx)(MB,{massActions:l,predicates:c,scope:null,showOnlyMassEdit:!1,sort:g,totalNumberOfMembers:p.count,onMassEditSuccess:h}),searchPlaceholder:n("rechercher_un_m_05904"),showActions:I,showEditColumns:x,showEditMode:f,showSearchColumns:r}),selectSegment:(0,i.jsx)(ap,{allSelectedText:n("les_1_membres_56748",p.count,p.name),pageSelectedText:n("les_1_membres_00895",d),selectAllText:n("s_lectionner_le_71777",p.count,p.name)})}),t&&m===xh.AccreditationsMatrix?(0,i.jsx)(LJ,{}):m===xh.Calendar?(0,i.jsx)(YJ,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt}):m===xh.Map?(0,i.jsx)(HJ,{}):(0,i.jsx)(BJ,{customFields:e.customFields})]})]})}),e0=e=>e.userInfo.id,n0={columnsToIncludes:(e,n)=>({...zh(e,n),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1})},t0=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=Kl(),{event:r,hasEventRole:d,hasPermission:l,localEvent:c,updateLocalEvent:u}=BS(),{canAccreditationRead:m,canCampaignRead:g,canDocumentRead:h,canDelegationRead:p,canFormRead:I,canMemberAccredit:x,canMemberAssign:f,canMemberAssignmentStateEdit:_,canMemberCreate:j,canMemberDelete:v,canMemberEdit:S,canPositionRead:y,canSegmentEdit:C}=oy(),b=l(sy.MEMBER_ASSIGNMENT_STATE_EDIT,{eventId:o}),A=l(sy.MEMBER_EDIT,{eventId:o}),E=(0,V.useCallback)((e,n)=>({...zh(e,n,{includeWeezeventUrls:!0}),includeCanRegistrationStateUpdate:!b,includeIsEditable:!A}),[b,A]),w=(0,V.useCallback)(e=>e===xh.AccreditationsMatrix&&m?n0:e===xh.Map||e===xh.Calendar?null:{},[m]),$=ki(Oh),T=(0,V.useMemo)(()=>$.getVolunteersFilters(s,o,a,e.organization.customFields.nodes,e.event,{hasAccreditations:m,hasCampaigns:g,hasDelegations:p,hasForms:I,hasPositions:y,isWeezeventConnected:e.event.isWeezeventConnected}),[o,a,e.organization,e.event]),z=(0,V.useMemo)(()=>$.getVolunteersPossibleColumns(s,e.organization.customFields.nodes,e.event.forms.nodes,e.event.customDocuments,{hasAccreditations:m,hasCampaigns:g,hasCustomDocuments:h,hasDelegations:p,hasForms:I,hasPositions:y,isWeezeventConnected:e.event.isWeezeventConnected}),[s,r,e.organization,e.event]);return(0,i.jsx)(yk,{canSegmentEdit:C,columnsToIncludes:E,eventId:o,filters:T,filtersButtonText:t("filtrer_les_mem_47149"),filtersSubtitle:t("appliquer_des_f_48814"),getMassActionId:e0,getSegmentPath:e=>yo.VOLUNTEERS_SEGMENT(s,o,e),initialLimit:c?.volunteersLimit??Tm,initialSegmentsOpen:c?.areVolunteersSegmentsOpen??!0,loadDataList:hr,loadRow:gr,organizationId:s,possibleColumns:z,possibleRenderings:d?[xh.List,xh.Calendar,xh.AccreditationsMatrix,xh.Map]:[xh.List,xh.Calendar],reload:e.reload,renderingLoaders:w,segmentId:a,segmentType:Bn.Volunteers,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{u({volunteersLimit:e})},showMassActions:S||f||x,showRowDropdown:j||v||x||f||_,onSegmentClick:e=>{u({volunteersSegmentId:e})},onSegmentDelete:async()=>{await u({volunteersSegmentId:null}),n.replace(yo.VOLUNTEERS(s,o))},onSegmentsToggle:async e=>{await u({areVolunteersSegmentsOpen:e})},children:(0,i.jsx)(JJ,{customFields:e.organization.customFields.nodes,event:e.event})})},i0=(0,V.memo)(function(){const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{event:{name:s},localEvent:o}=BS();Au(`${s} ${t("membres_11310")}`);const{data:a,loader:r,reload:d}=cr({organizationId:e,eventId:n,privacy:Ee.All,loadCustomDocuments:!0,loadForms:!0,loadSegments:!0}),l=(0,V.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(t0,{event:a.event,organization:a.organization,reload:d})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.VOLUNTEERS_SEGMENT(e,n,o?.volunteersSegmentId&&l.includes(o?.volunteersSegmentId)?o.volunteersSegmentId:l[0]),replace:!0})})]})}),s0=e=>{const{params:{organizationId:n,eventId:t},translate:s}=Kl(),{data:o,loader:a}=vd({organizationId:n,eventId:t,includeIntro:!1,spaceType:qn.DelegationSpace}),r=ki(EO);return a||(0,i.jsx)(xc,{direction:"column",initialValues:{design:r.designInputDefault(o.organization.spaceDesign,o.organization.event?.spaceDesign)},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(sf,{footerActions:(0,i.jsx)(ly,{permissions:sy.DELEGATIONS_SPACE_PARAM_EDIT,children:(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:n,onClick:e,children:s("enregistrer_06519")})})}),heading:s("design_15043"),hideHeader:!0,children:[(0,i.jsx)(TO,{heading:s("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)($O,{initialValues:t?o.organization.spaceDesign?.colors:void 0})]}),onSubmit:async i=>await e.mutate({organizationId:n,eventId:t,spaceDesign:i.design,spaceType:qn.DelegationSpace})})},o0=()=>{const{mutate:e}=function(e={}){return Ui("mutation EventSpaceDesignUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $spaceDesign: DesignInput!\n $settings: EventsShowcaseSettingsDesignInput\n $spaceType: SpaceType!\n) {\n eventSpaceDesignUpdate(\n organizationId: $organizationId\n eventId: $eventId\n spaceDesign: $spaceDesign\n settings: $settings\n spaceType: $spaceType\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(s0,{mutate:async n=>(await e(n)).eventSpaceDesignUpdate.id})},a0=()=>{const{mutate:e}=Gd();return(0,i.jsx)(s0,{mutate:async n=>(await e(n)).organizationSpaceDesignUpdate.id})},r0=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=Kl(),{showNotification:a}=AS(),{canDelegationsSpaceParamEdit:r}=oy(),{mutate:d}=function(e={}){return Ui("mutation DelegationsSpaceLayoutDelete(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n delegationsSpaceLayoutDelete(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n ) {\n id\n }\n}\n",e)}(),{mutate:l}=function(e={}){return Ui("mutation DelegationsSpaceLayoutDuplicate(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n delegationsSpaceLayoutDuplicate(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n ) {\n id\n }\n}\n",e)}(),[c,u]=(0,V.useState)(!1),m=xT.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:s,eventId:o,delegationsSpaceLayoutId:e.layout.id});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:e.layout.name}),r&&(0,i.jsx)(Qm,{justify:"center",children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",to:m})})}),(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[(0,i.jsx)(Pu,{icon:"pen",to:m,children:t("_diter_62574")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{const{delegationsSpaceLayoutDuplicate:{id:t}}=await l({eventId:o,delegationsSpaceLayoutId:e.layout.id});n.push(xT.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:s,eventId:o,delegationsSpaceLayoutId:t}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:async()=>u(!0),children:t("supprimer_43083")})})]})]})})]}),c&&(0,i.jsx)(ow,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_86738"),text:t("suppression_de_73669",e.layout.name),onClose:()=>u(!1),onDelete:async()=>{await d({eventId:o,delegationsSpaceLayoutId:e.layout.id}),a(t("le_layout_1_51514",e.layout.name)),e.reload()}})]})},d0=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=Kl(),{canDelegationsSpaceParamEdit:o}=oy(),[a,r,d]=Wm(""),{data:l,isLoading:c,reload:u}=Li("query DelegationsSpaceLayouts($eventId: EventId!, $name: String) {\n event(id: $eventId) {\n delegationsSpaceLayouts(name: $name) {\n id\n name\n }\n }\n}\n",{eventId:s,name:g(r)?r:void 0},[]);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_l_04356"),value:a,onChange:d})}),(0,i.jsx)(ly,{permissions:sy.DELEGATIONS_SPACE_PARAM_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{e.push(xT.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:t,eventId:s}))},children:n("cr_er_un_layout_13164")})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("nom_du_layout_81794")}),o&&(0,i.jsx)(Gm,{width:100})]}),rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:l.event.delegationsSpaceLayouts.map(e=>(0,i.jsx)(r0,{layout:e,reload:u},e.id))}),title:n("liste_des_layou_11323")})},l0=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(by,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(dc,{children:t("espace_d_l_gati_59251")}),(0,i.jsxs)(wy,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(Ey,{path:xT.DELEGATIONS_SPACE_DESIGN({organizationId:e,eventId:n}),children:t("design_15043")}),(0,i.jsx)(Ey,{path:xT.DELEGATIONS_SPACE_LAYOUTS({organizationId:e,eventId:n}),children:t("layouts_27757")})]})]})}),(0,i.jsx)(yy,{css:{overflowY:"auto"},children:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)($y,{path:xT.DELEGATIONS_SPACE_DESIGN({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(o0,{})}),(0,i.jsx)($y,{path:xT.DELEGATIONS_SPACE_LAYOUTS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(d0,{})})]})})]})},c0=br(Tl,{variants:{active:{true:{color:"$blue600"}}}}),u0=({children:e,path:n,text:t,eventId:s})=>{const o=Wi(),a=null!==(0,kr.B6)(o.pathname,{path:n}),r=Vi(),d=Bi();return(0,i.jsxs)(c0,{active:a,align:"center",direction:"column",onClick:()=>{!1===a&&d.push((0,kr.tW)(n,{...r,eventId:r.eventId||s}))},children:[(0,i.jsx)(Mr,{children:e(a)}),(0,i.jsx)(Mr,{fontSize:"textXs",children:t})]})},m0=br("i",{fontSize:"18px"}),g0=({active:e,className:n})=>(0,i.jsx)(m0,{className:`${e?"fa-solid":"fa-regular"} ${n}`}),h0=br(Tl,{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)"}),p0=({user:e,eventId:n})=>{const t=Fi();return(0,i.jsxs)(h0,{justify:"evenly",children:[(0,i.jsx)(u0,{eventId:n,path:yo.DASHBOARD(":organizationId",":eventId"),text:t("accueil_70474"),children:e=>(0,i.jsx)(g0,{active:e,className:"fa-house"})}),(0,i.jsx)(u0,{eventId:n,path:yo.VOLUNTEERS(":organizationId",":eventId"),text:t("membres_11310"),children:e=>(0,i.jsx)(g0,{active:e,className:"fa-user-group"})}),(0,i.jsx)(u0,{eventId:n,path:oo.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),text:t("missions_63972"),children:e=>(0,i.jsx)(g0,{active:e,className:"fa-sitemap"})}),(0,i.jsx)(u0,{eventId:n,path:yo.ORGANIZATION_PARAMETERS(":organizationId"),text:t("profil_14444"),children:()=>(0,i.jsx)(t_,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:24})})]})},I0=({children:e,user:n,eventId:t})=>(0,i.jsxs)(Tl,{css:{height:"100%"},direction:"column",children:[(0,i.jsx)(Mr,{css:{flex:1,overflow:"auto"},children:e}),(0,i.jsx)(p0,{eventId:t,user:n})]}),x0=({header:e,value:n})=>(0,i.jsxs)(Tl,{css:{bd:!0,padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray500",fontSize:"textSm",fontWeight:"medium",children:e}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:n})]}),f0=({position:e})=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=Kl();return(0,i.jsx)(km,{css:{cursor:"pointer"},onClick:()=>{n.push(oo.POSITION({organizationId:t,eventId:s,positionId:e.id}))},children:(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(Mr,{color:"gray700",css:{flex:"1"},children:e.name}),(0,i.jsx)(Mr,{color:"gray700",children:o("_1_2_membres_04485",e.assignedResources,e.resources)})]}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsx)(lF,{percent:e.assignedResources/e.resources})})]})})},e.id)},_0=br("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),j0=br(Yl,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),v0=br("h2",{fontSize:"$textMd",fontWeight:"$semiBold",margin:0}),S0=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=Kl(),o=ki(Xb),{hasEventRole:a,hasPermission:r}=BS(),{data:d,loader:l}=Li("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,V.useMemo)(()=>d.event?(0,Lm.A)(d.event.positionsCategories,e=>e.name.toLowerCase()):[],[d.event]),u=()=>{e.push(yo.DASHBOARD_EVENT_SWITCH(t,s))};if(l)return l;{const e=a||c.some(e=>r(sy.POSITION_READ,{positionCategoryId:e.id}));return(0,i.jsxs)(Tl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(_0,{children:n("accueil_70474")}),(0,i.jsx)(j0,{icon:"arrow-down-arrow-up",onClick:u})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(v0,{children:d.event.name}),(0,i.jsx)(x0,{header:n("nombre_de_membr_60320",d.event.resources),value:d.event.resources}),(0,i.jsx)(x0,{header:n("nombre_de_missi_67304",d.event.positions.totalCount),value:d.event.positions.totalCount}),(0,i.jsx)(x0,{header:n("nombre_de_membr_87779",d.event.assigned.totalCount),value:d.event.assigned.totalCount}),(0,i.jsx)(x0,{header:n("nombre_de_membr_63555",d.event.waitingAssignment.totalCount),value:d.event.waitingAssignment.totalCount}),(0,i.jsx)(x0,{header:n("taux_de_remplis_11913"),value:`${0===d.event.resources?"0":Math.round(d.event.assignedResources/d.event.resources*100)}%`}),(0,i.jsx)(x0,{header:n("temps_de_b_n_vo_87924"),value:o.minutesToHoursMinutesString(d.event.volunteerMinutesNeeded)}),(0,i.jsx)(x0,{header:n("temps_de_b_n_vo_60725"),value:o.minutesToHoursMinutesString(d.event.volunteerMinutesAssigned)}),(0,i.jsx)(Mr,{css:{boxShadow:"$xs"},children:e?(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Gm,{children:n("cat_gories_24533")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:c.length>0?c.map(e=>(0,i.jsx)(aq,{category:e,clickable:!1,eventId:s,organizationId:t},e.id)):(0,i.jsx)(IE,{subtitle:n("vous_n_avez_pas_59681"),title:n("aucune_cat_gori_21347")})}),setOffset:Bc.A,title:n("liste_des_membr_59735"),totalCount:0}):(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Gm,{children:n("missions_63972")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:d.event.positions.nodes.map(e=>(0,i.jsx)(f0,{position:e},e.id))}),setOffset:Bc.A,title:n("liste_des_membr_57353"),totalCount:0})})]})]})}},y0=br("div",{alignSelf:"flex-end",cursor:"pointer",padding:"$4 $6 $3 $6",i:{color:"$gray500"}}),C0=({onClose:e})=>(0,i.jsx)(y0,{onClick:e,children:(0,i.jsx)("i",{className:"fa-regular fa-xmark"})}),b0=br(Tl,{overflowX:"hidden",overflowY:"auto"}),A0=br(Tl,{background:"rgba(0, 0, 0, 0.7)",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),E0=br(Tl,{background:"white",borderRadius:"20px 20px 0 0",marginTop:"44px",flex:"1",overflow:"auto"}),w0=({children:e,onClose:n})=>{const t=(0,kr.W6)(),s=n??t.goBack;return wu(s),(0,i.jsx)(A0,{"data-testid":"overlay-backdrop",direction:"column",onClick:s,children:(0,i.jsxs)(E0,{"data-testid":"overlay-body",direction:"column",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(C0,{onClose:s}),(0,i.jsx)(b0,{direction:"column",children:e})]})})},$0=({event:e})=>{const n=ki(Jm);return(0,i.jsx)(Mr,{children:(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray500"},children:[(0,i.jsx)(Mr,{width:25,children:(0,i.jsx)(Yl,{icon:"calendar"})}),(0,i.jsx)(Mr,{css:{flex:"1",ellipsis:!0},children:k_(n,e.startAt,e.endAt)})]})})},T0=({event:e})=>{const n=Fi();return(0,i.jsxs)(Tl,{align:"start",direction:"column",gap:"2",children:[(0,i.jsx)(Ku,{color:e.state===qe.Ongoing?"success":"error",children:n(e.state)}),(0,i.jsx)(Mr,{color:"gray800",fontSize:"textLg",fontWeight:"medium",width:1,children:e.name}),(0,i.jsx)($0,{event:e})]})},z0=({events:e})=>{const{organizationId:n,eventId:t}=Vi(),[s,o]=(0,V.useState)(t),a=Bi(),r=Fi();return(0,i.jsxs)(Tl,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Tl,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(Gz,{state:e.id===s?"checked":"unchecked",onClick:()=>o(e.id),children:(0,i.jsx)(T0,{event:e})},e.id))}),(0,i.jsx)(Pl,{height:7}),(0,i.jsx)(tc,{onClick:()=>{a.push(yo.DASHBOARD(n,s))},children:r("s_lectionner_l_77300")})]})},O0=br("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),R0=()=>{const{organizationId:e,eventId:n}=Vi(),{loader:t,data:s}=Li(td,{organizationId:e,includeCreatedBy:!1,includeDescription:!1,includeNumberOfMembers:!1},[$o.EventsEventFragment]),o=Bi(),a=Fi();return(0,i.jsxs)(w0,{onClose:()=>{o.push(yo.DASHBOARD(e,n))},children:[(0,i.jsx)(O0,{children:a("liste_de_vos_v_44993")}),t||(0,i.jsx)(z0,{events:s.data.rows.nodes})]})},D0=br("div",{display:"flex",flex:1,flexDirection:"column",margin:"0 $3"}),M0=br(Tl,{margin:"0 $3",padding:"$3 $4"}),P0=({back:e,children:n})=>(0,i.jsxs)(Tl,{align:"center",css:{padding:"10px 0",borderBottom:"1px solid $gray100"},children:[(0,i.jsx)(M0,{color:"gray700",onClick:e,children:(0,i.jsx)(Yl,{icon:"chevron-left"})}),n]}),k0=br("div",{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"}),F0=br("i",{fontSize:"$textXl"}),N0=({replaySearch:e})=>{const{eventId:n}=Vi(),{data:t,loader:s}=Li("query RecentPositionsSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentPositionsRegistrationsSearches\n }\n}\n",{eventId:n},[]),o=Fi();if(s)return s;{const n=t.event.recentPositionsRegistrationsSearches;return(0,i.jsxs)(Tl,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Mr,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",n.length)}),n.map((n,t)=>(0,i.jsxs)(Tl,{align:"center",gap:"2",onClick:()=>{e(n)},children:[(0,i.jsx)(F0,{className:"fa-regular fa-clock"}),(0,i.jsx)(Mr,{children:n})]},t))]})}},L0=(e,n)=>{switch(n.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:n.data,xs:n.xs,offset:n.offset}}};function U0(e,n,t){const[s,o]=(0,V.useReducer)(L0,{isLoading:!0,data:void 0,xs:void 0,offset:n.offset}),{setIsError:a}=(0,V.useContext)(jx);(0,V.useEffect)(()=>{let i=!1;return o({type:"FIRST_PAGE_INIT"}),X().then(t=>e(n,t||null)).then(e=>{!1===i&&o({type:"FIRST_PAGE_SUCCESS",data:e,xs:t(e),offset:n.offset})},e=>{!1===i&&a(!0,e)}),()=>{i=!0}},[e,JSON.stringify(n),t]);const r=()=>{o({type:"LOAD_MORE_INIT"});const i=s.offset+n.limit;X().then(t=>e({...n,offset:i},t||null)).then(e=>{const n=[...s.xs||[]];n.splice(i,0,...t(e)),o({type:"LOAD_MORE_SUCCESS",data:e,xs:n,offset:i})},e=>{a(!0,e)})};return(e=>e.isLoading&&void 0===e.data)(s)?{data:s.data,loader:(0,i.jsx)(Ql,{}),loadMore:r,xs:s.xs}:{data:s.data,loader:s.isLoading?(0,i.jsx)(Ql,{}):void 0,loadMore:r,xs:s.xs}}const V0=br(Mr,{display:"flex",flexDirection:"column",[`${tc} + .load-more-status`]:{paddingTop:"12px"}}),B0=({loadMore:e,pageInfo:n,isLoading:t,buttonText:s,statusText:o})=>!1===n.hasNextPage&&!1===n.hasPreviousPage?null:(0,i.jsxs)(V0,{children:[n.hasNextPage&&(0,i.jsx)(tc,{isLoading:t,textAlign:"center",onClick:e,children:s}),(0,i.jsx)(Mr,{className:"load-more-status",fontSize:"textSm",textAlign:"center",children:o})]});var W0=t(2872);const G0=br(Tl,{bd:!0,padding:"$4 $3"}),q0=({children:e,...n})=>(0,i.jsxs)(G0,{align:"center",...n,children:[(0,i.jsx)(Mr,{css:{flex:1},children:e}),(0,i.jsx)(Mr,{color:"gray700",css:{padding:"0 10px 0 $4"},children:(0,i.jsx)(Yl,{icon:"chevron-right"})})]}),H0=({open:e,position:n})=>{const t=Fi(),s=ki(Bg);return(0,i.jsxs)(q0,{onClick:()=>{e(n.id)},children:[(0,i.jsxs)(Tl,{gap:"2",children:[n.assignedResources>=n.resources?(0,i.jsx)(Ku,{color:"success",children:t("complet_51600")}):(0,i.jsx)(Ku,{color:"warning",children:t("incomplet_45915")}),!n.isVisible&&(0,i.jsx)(Ku,{color:"gray",children:t("Private")})]}),(0,i.jsx)(Mr,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:n.name}),(0,i.jsx)(Mr,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:`${t("creneau",n.slots.length)} · ${n.range?s.toLocaleString(n.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"}`}),(0,i.jsx)(Mr,{css:{marginTop:"$3"},children:(0,i.jsx)(lF,{percent:n.assignedResources/n.resources})})]})},Y0=br("div",{color:"$gray800",fontWeight:"$semiBold",lineHeight:"24px"}),Z0=br("div",{color:"$gray400",fontSize:"$textSm"}),K0=br("span",{color:"$gray800"}),X0=({category:e})=>{const n=Fi();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Y0,{children:e.name}),Yo(e.leaders)&&(0,i.jsxs)(Z0,{children:[`${n("responsable_category",e.leaders.length)} `,(0,i.jsx)(K0,{children:e.leaders.map(({userInfo:e})=>e.name).join(", ")})]})]})},Q0=({open:e,positions:n})=>{const t=(0,V.useMemo)(()=>(0,Lm.A)((0,W0.A)((0,fm.A)(n,e=>e.category.id)),e=>e[0].category.name),[n]);return(0,i.jsx)(i.Fragment,{children:t.map((n,t)=>(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(X0,{category:n[0].category}),n.map((n,t)=>(0,i.jsx)(H0,{open:e,position:n},t))]},t))})},J0=()=>{const e=Fi();return(0,i.jsx)(UE,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},e1=e=>e.event.positions.nodes,n1=({search:e})=>{const n=Fi(),{organizationId:t,eventId:s}=Vi(),o={eventId:s,predicatesGroups:fg(),limit:Tm,offset:0,name:e},{data:a,loader:r,loadMore:d,xs:l}=U0(Jd,o,e1),c=Bi();return r&&void 0===a?r:0===l.length?(0,i.jsx)(J0,{}):(0,i.jsxs)(Tl,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Mr,{fontSize:"textMd",fontWeight:"semiBold",children:n("r_sultat_de_la_64686",l.length)}),(0,i.jsx)(Q0,{open:n=>{c.push(yo.POSITION_SETTINGS(t,s,n),{from:"SEARCH_MOBILE",search:e})},positions:l}),(0,i.jsx)(B0,{buttonText:n("afficher_plus_d_49529"),isLoading:void 0!==r,loadMore:d,pageInfo:a.event.positions.pageInfo,statusText:n("_1_sur_2_mis_94157",l.length,a.event.positions.totalCount)})]})},t1=br(Tl,{color:"$blue600"}),i1=()=>{const{organizationId:e,eventId:n}=Vi(),t=Bi(),s=Fi(),o=Wi(),[a,r]=(0,V.useState)(o.state?.search||""),[d,l]=(0,V.useState)(o.state?.search||"");return(0,i.jsxs)(k0,{children:[(0,i.jsx)(P0,{back:()=>{t.push(oo.POSITIONS({organizationId:e,eventId:n}))},children:(0,i.jsxs)(Tl,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(wc,{icon:"search",placeholder:s("rechercher_une_69998"),value:a,onChange:e=>{r(e),e||l(e)},onKeyDown:e=>{"Enter"===e.key&&l(a)}}),d&&(0,i.jsx)(t1,{onClick:()=>{r(""),l("")},children:s("annuler_48254")})]})}),(0,i.jsx)(D0,{children:d?(0,i.jsx)(n1,{search:d}):(0,i.jsx)(N0,{replaySearch:e=>{r(e),l(e)}})})]})},s1=({folders:e,segmentId:n,...t})=>(0,i.jsx)(Up,{shouldParseAsInt:!0,value:n,...t,children:e.map((e,n)=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map((e,n)=>(0,i.jsxs)("option",{value:e.id,children:[e.name," (",e.count,")"]},n))},n))});var o1=t(4879);const a1=()=>{const e=Fi();return(0,i.jsx)(UE,{css:{flex:1,padding:"0 $4"},subtitle:e("cr_ez_de_nouvel_87003"),title:e("il_n_y_a_pas_de_55837")})},r1=e=>e.event.positions.nodes,d1=({segment:e})=>{const n=Fi(),{organizationId:t,eventId:s}=Vi(),o={eventId:s,predicatesGroups:e.predicatesGroups,limit:Tm,offset:0},{data:a,loader:r,loadMore:d,xs:l}=U0(Jd,o,r1),c=Bi();return r&&void 0===a?r:0===l.length?(0,i.jsx)(a1,{}):(0,i.jsxs)(Tl,{direction:"column",gap:"7",children:[(0,i.jsx)(Q0,{open:e=>{c.push(yo.POSITION_SETTINGS(t,s,e))},positions:l}),(0,i.jsx)(B0,{buttonText:n("afficher_plus_d_49529"),isLoading:void 0!==r,loadMore:d,pageInfo:a.event.positions.pageInfo,statusText:n("_1_sur_2_mis_94157",l.length,a.event.positions.totalCount)})]})},l1=br("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),c1=br(Yl,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),u1=({event:e})=>{const{organizationId:n,eventId:t,segmentId:s}=Vi(),o=Bi(),a=Fi(),r=(0,o1.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Tl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(l1,{children:a("missions_63972")}),(0,i.jsx)(c1,{icon:"search",onClick:()=>{o.push(yo.POSITIONS_SEARCH(n,t))}})]}),(0,i.jsx)(Mr,{children:(0,i.jsx)(s1,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push(yo.POSITIONS_SEGMENT(n,t,e))})}),(0,i.jsx)(Tl,{css:{flex:1},direction:"column",children:(0,i.jsx)(d1,{segment:r})})]})},m1=()=>{const{organizationId:e,eventId:n}=Vi(),{data:t,loader:s}=Li("query PositionsSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:n},[$o.SegmentsFoldersSegmentsFragment]);return s||(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.POSITIONS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(i1,{})}),(0,i.jsx)(kr.qh,{path:yo.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(u1,{event:t.event})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.POSITIONS_SEGMENT(e,n,t.event.segmentsFolders[0].segments[0].id)})})]})},g1=br(Tl,{backgroundColor:"$gray100",borderRadius:"$1",padding:"2px"}),h1=({children:e,...n})=>(0,i.jsx)(g1,{...n,children:e}),p1=br(Tl,{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"}}}}),I1=({children:e,path:n})=>{const t=Bi(),s=Wi().pathname===n;return(0,i.jsx)(p1,{isSelected:s,justify:"center",onClick:()=>{t.push(n)},children:e})},x1=({children:e,css:n,...t})=>(0,i.jsx)(Tl,{align:"center",css:{flex:1,marginRight:"66px",...n},direction:"column",...t,children:e}),f1=({back:e,position:n})=>(0,i.jsx)(P0,{back:e,children:(0,i.jsxs)(x1,{css:{minHeight:"40px"},children:[(0,i.jsx)(Mr,{color:"gray900",fontWeight:"medium",textAlign:"center",children:n.name}),(0,i.jsx)(Mr,{color:"gray500",fontSize:"textXs",textAlign:"center",children:n.positionCategoryName})]})}),_1=e=>{const{translate:n}=Kl(),t=Dm();return(0,i.jsx)(oT,{title:e.title,children:(0,i.jsxs)(Tl,{align:"center",direction:"column",...t?{gap:"9"}:{gap:"7"},gap:"4",width:1,children:[(0,i.jsx)(tT,{count:e.category.assignedResources,total:e.category.resources}),(0,i.jsx)(Ku,{leftIcon:"user",children:n("_1_membre_pr_32812",e.category.preassignedResources)})]})})},j1=({position:e})=>(0,i.jsx)(Mr,{color:"gray800",css:{background:e.color,borderRadius:"20px",height:"20px",width:"20px"}}),v1=({customFields:e,position:n})=>{const{translate:t}=Kl(),s=ki(Bg);return(0,i.jsx)(oT,{title:t("param_tres_78420"),children:(0,i.jsx)(Tl,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(ZV,{children:[(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:t("cat_gorie_00291")}),(0,i.jsx)(GV,{children:n.positionCategoryName})]}),(0,i.jsx)(UV,{direction:"horizontal"}),(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:t("Color")}),(0,i.jsx)(GV,{children:(0,i.jsx)(j1,{position:n})})]}),(0,i.jsx)(UV,{direction:"horizontal"}),(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:t("ic_ne_55554")}),(0,i.jsx)(GV,{children:(0,i.jsx)(Yl,{icon:Hl(n.icon)})})]}),(0,i.jsx)(UV,{direction:"horizontal"}),(0,i.jsxs)(HV,{children:[(0,i.jsx)(BV,{children:t("Date")}),(0,i.jsx)(GV,{children:n.range?s.toLocaleString(n.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"})]}),e.map(e=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsxs)(Tl,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Tl,{justify:"end",width:300,children:(0,i.jsx)(wE,{field:e,fields:n.fields})})]})]},e.slug))]})})})},S1=({customFields:e,position:n})=>{const t=Fi(),{roles:s}=XS();return(0,i.jsxs)(Tl,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(_1,{category:n,title:t("remplissage_des_84383")}),(0,i.jsx)(ez,{leaders:n.leaders,roles:s.positionRoles}),(0,i.jsx)(v1,{customFields:e,position:n}),(0,i.jsx)(fT,{description:n.description}),(0,i.jsx)(nB,{location:n}),(0,i.jsx)(JV,{customFields:n.customFields}),(0,i.jsx)(yT,{modalSubtitle:t("ajouter_des_tag_64526"),tags:n.tags}),(0,i.jsx)(_T,{privateNote:n.privateNote})]})},y1=(e,n)=>e.name||n.toLocaleString(e.range,void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),C1=({open:e,slot:n})=>{const t=Fi(),s=ki(Bg);return(0,i.jsxs)(q0,{onClick:()=>{e(n.id)},children:[(0,i.jsx)(Tl,{gap:"2",children:n.assignedResources>=n.resources?(0,i.jsx)(Ku,{color:"success",children:t("complet_51600")}):(0,i.jsx)(Ku,{color:"warning",children:t("_1_membre_manq_31014",n.resources-n.assignedResources)})}),(0,i.jsx)(Mr,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:n.name}),(0,i.jsx)(Mr,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:y1(n,s)}),(0,i.jsx)(Mr,{css:{marginTop:"$3"},children:(0,i.jsx)(lF,{percent:n.assignedResources/n.resources})})]})},b1=({open:e,slots:n})=>{const t=Fi();return(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:t("liste_des_cr_ne_94056")}),n.map((n,t)=>(0,i.jsx)(C1,{open:e,slot:n},t))]})},A1=e=>e.event.positionsSlots.nodes,E1=({open:e,eventId:n,positionId:t})=>{const s={eventId:n,positionId:t,limit:Tm,offset:0},{data:o,loader:a,loadMore:r,xs:d}=U0(nl,s,A1);return a&&void 0===o?a:(0,i.jsxs)(Tl,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(b1,{open:e,slots:d}),(0,i.jsx)(B0,{buttonText:"Afficher plus de crĂ©neaux",isLoading:void 0!==a,loadMore:r,pageInfo:o.event.positionsSlots.pageInfo,statusText:`${d.length} sur ${o.event.positionsSlots.totalCount} crĂ©neaux`})]})},w1=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,positionId:o}}=Kl(),{data:a,loader:r}=tl({organizationId:t,eventId:s,positionId:o}),d=Wi(),[l]=(0,V.useState)(d.state);if(d.pathname===oo.POSITION({organizationId:t,eventId:s,positionId:o}))return(0,i.jsx)(qi,{path:yo.POSITION_SETTINGS(t,s,o)});const c={settings:yo.POSITION_SETTINGS(t,s,o),slots:oo.POSITION_SLOTS({organizationId:t,eventId:s,positionId:o})};return r||(0,i.jsxs)(k0,{children:[(0,i.jsx)(f1,{back:()=>{"SEARCH_MOBILE"===l?.from?e.push(yo.POSITIONS_SEARCH(t,s),{search:l?.search}):e.push(oo.POSITIONS({organizationId:t,eventId:s}))},position:a.event.position}),(0,i.jsx)(D0,{children:(0,i.jsxs)(Ty,{children:[(0,i.jsxs)(h1,{css:{margin:"$6 0"},children:[(0,i.jsx)(I1,{path:c.settings,children:n("param_tres_78420")}),(0,i.jsx)(I1,{path:c.slots,children:n("cr_neaux_33401")})]}),(0,i.jsx)($y,{path:c.settings,children:(0,i.jsx)(S1,{customFields:a.organization.customFields.nodes,position:a.event.position})}),(0,i.jsx)($y,{path:c.slots,children:(0,i.jsx)(E1,{eventId:s,open:n=>{e.push(yo.POSITION_SLOT_MEMBERS(t,s,o,n))},positionId:a.event.position.id})})]})})]})},$1=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=Vi(),o=Bi(),a=Fi();return(0,i.jsx)(w0,{onClose:()=>{o.push(yo.POSITION_SLOT_MEMBERS(e,n,t,s))},children:(0,i.jsxs)(Tl,{css:{margin:"$3"},direction:"column",gap:"3",children:[(0,i.jsx)(tc,{onClick:()=>{o.push(yo.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(e,n,t,s))},children:a("pointer_des_mem_09244")}),(0,i.jsx)(tc,{onClick:()=>{o.push(yo.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(e,n,t,s))},children:a("d_pointer_des_m_31557")}),(0,i.jsx)(tc,{onClick:()=>{o.push(yo.POSITION_SLOT_CHECK_MEMBERS_RESET(e,n,t,s))},children:a("remettre_z_ro_65589")})]})})},T1=br(Tl,{fontSize:"$textSm",color:"$blue600"}),z1=({onSubmit:e,children:n,data:t,loader:s,loadMore:o,xs:a,disabled:r})=>{const d=Fi(),[l,c]=(0,V.useState)(a);(0,V.useEffect)(()=>{c(a.toSpliced(0,l.length,...l))},[a]);const u=l.filter(e=>"checked"===e.state&&!r.includes(e.positionSlotUserInfo.id)).map(e=>e.positionSlotUserInfo.id);return(0,i.jsxs)(Tl,{direction:"column",height:"100%",width:"100%",children:[(0,i.jsxs)(Tl,{css:{flex:1,overflow:"auto",padding:"$6 $4 $3 $4"},direction:"column",gap:"5",children:[(0,i.jsxs)(Tl,{justify:"between",children:[(0,i.jsx)(Mr,{fontSize:"textMd",fontWeight:"semiBold",children:d("liste_des_membr_86405",a.length)}),(0,i.jsx)(T1,{onClick:()=>{c(l.map(e=>({...e,state:"checked"})))},children:d("tout_s_l_ctionn_18234")})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[l.map((e,n)=>(0,i.jsx)(om,{disabled:r.includes(e.positionSlotUserInfo.id),state:e.state,onClick:e=>((e,n)=>{c(l.toSpliced(e,1,{...l[e],state:n}))})(n,e),children:e.userInfo.name},n)),(0,i.jsx)(B0,{buttonText:d("afficher_plus_d_41906"),isLoading:void 0!==s,loadMore:o,pageInfo:t.event.volunteersRegistrations.pageInfo,statusText:d("_1_sur_2_mem_14323",a.length,t.event.volunteersRegistrations.totalCount)})]})]}),(0,i.jsx)(Tl,{css:{boxShadow:"$mdReverse",padding:"$6 $4"},direction:"column",children:(0,V.isValidElement)(n)?(0,V.cloneElement)(n,{onClick:()=>e(u),disabled:0===u.length}):n})]})},O1=e=>e.event.volunteersRegistrations.nodes,R1=()=>{const{eventId:e,positionSlotId:n}=Vi(),t=Fi(),s={eventId:e,positionSlotId:n,predicatesGroups:xg([{operator:$n.IsNot,value:[ye.CheckedIn],value2:[n],slug:"checkInStatePositionSlot"}]),limit:50,offset:0},{data:o,loader:a,loadMore:r,xs:d}=U0(el,s,O1),{isLoading:l,mutate:c}=Ua(),[u,m]=(0,V.useState)([]);if(a&&void 0===o)return a;{const n=async n=>{await c({eventId:e,checkIn:{strategy:Ce.CheckIn,positionsSlotsUsersInfosIds:n}}),m([...u,...n])};return(0,i.jsx)(z1,{data:o,disabled:u,loadMore:r,loader:a,xs:d,onSubmit:n,children:(0,i.jsx)(tc,{isLoading:l,textAlign:"center",children:t("pointer_80927")})})}},D1=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=Vi(),o=Bi(),a=Fi();return(0,i.jsxs)(k0,{children:[(0,i.jsx)(P0,{back:()=>{o.push(yo.POSITION_SLOT_MEMBERS(e,n,t,s))},children:(0,i.jsx)(x1,{children:a("pointer_des_mem_09244")})}),(0,i.jsx)(D0,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(R1,{})})]})},M1=e=>e.event.volunteersRegistrations.nodes,P1=()=>{const{eventId:e,positionSlotId:n}=Vi(),t=Fi(),s={eventId:e,positionSlotId:n,predicatesGroups:xg([{operator:$n.IsNot,value:[ye.CheckedOut],value2:[n],slug:"checkInStatePositionSlot"}]),limit:50,offset:0},{data:o,loader:a,loadMore:r,xs:d}=U0(el,s,M1),{isLoading:l,mutate:c}=Ua(),[u,m]=(0,V.useState)([]);if(a&&void 0===o)return a;{const n=async n=>{await c({eventId:e,checkIn:{strategy:Ce.CheckOut,positionsSlotsUsersInfosIds:n}}),m([...u,...n])};return(0,i.jsx)(z1,{data:o,disabled:u,loadMore:r,loader:a,xs:d,onSubmit:n,children:(0,i.jsx)(tc,{isLoading:l,textAlign:"center",children:t("d_pointer_25328")})})}},k1=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=Vi(),o=Bi(),a=Fi();return(0,i.jsxs)(k0,{children:[(0,i.jsx)(P0,{back:()=>{o.push(yo.POSITION_SLOT_MEMBERS(e,n,t,s))},children:(0,i.jsx)(x1,{children:a("d_pointer_des_m_31557")})}),(0,i.jsx)(D0,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(P1,{})})]})},F1=e=>e.event.volunteersRegistrations.nodes,N1=()=>{const{eventId:e,positionSlotId:n}=Vi(),t=Fi(),s={eventId:e,positionSlotId:n,predicatesGroups:xg([{operator:$n.IsNot,value:[ye.Waiting],value2:[n],slug:"checkInStatePositionSlot"}]),limit:50,offset:0},{data:o,loader:a,loadMore:r,xs:d}=U0(el,s,F1),{isLoading:l,mutate:c}=Ua(),[u,m]=(0,V.useState)([]);if(a&&void 0===o)return a;{const n=async n=>{await c({eventId:e,checkIn:{strategy:Ce.Reset,positionsSlotsUsersInfosIds:n}}),m([...u,...n])};return(0,i.jsx)(z1,{data:o,disabled:u,loadMore:r,loader:a,xs:d,onSubmit:n,children:(0,i.jsx)(tc,{isLoading:l,textAlign:"center",children:t("remettre_z_ro_82376")})})}},L1=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=Vi(),o=Bi(),a=Fi();return(0,i.jsxs)(k0,{children:[(0,i.jsx)(P0,{back:()=>{o.push(yo.POSITION_SLOT_MEMBERS(e,n,t,s))},children:(0,i.jsx)(x1,{children:a("remettre_z_ro_11572")})}),(0,i.jsx)(D0,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(N1,{})})]})},U1=e=>{let n,t,s;return"registrationState"in e?(({color:n,leftIcon:s}=Ly(e.registrationState)),t=`${n}100`):(n=function(e){switch(e){case ye.CheckedIn:case ye.CheckedOut:return"success";case ye.Waiting:return"warning"}}(e.checkInState),t=`${n}500`),(0,i.jsx)(Tl,{align:"center",css:{background:Ar.colors[t].value,border:"2px solid white",borderRadius:`${e.size}px`,bottom:"0",color:Ar.colors[`${n}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)(Yl,{icon:s})})},V1=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}},B1=br("div",{position:"relative"}),W1=e=>{let n,t;if("registrationState"in e){n={registrationState:e.registrationState,size:V1(e.size)};const{registrationState:i,...s}=e;t=s}else{n={checkInState:e.checkInState,size:V1(e.size)};const{checkInState:i,...s}=e;t=s}return(0,i.jsxs)(B1,{children:[(0,i.jsx)(t_,{...t}),(0,i.jsx)(U1,{...n})]})},G1=br(Tl,{overflow:"hidden"}),q1=br("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"}}}}}),H1=({userInfo:e,size:n,...t})=>(0,i.jsxs)(G1,{direction:"column",...t,children:[g(e.name)&&(0,i.jsx)(q1,{size:n,children:e.name}),(0,i.jsx)(q1,{size:n,children:e.email})]}),Y1=e=>{const n={name:e.userInfo.name,email:e.userInfo.email,image:e.userInfo.picture?.url};return(0,i.jsxs)(Tl,{align:"center",onClick:e.openVolunteer,children:["registrationState"in e?(0,i.jsx)(W1,{...n,registrationState:e.registrationState,size:40}):"checkInState"in e?(0,i.jsx)(W1,{...n,checkInState:e.checkInState,size:40}):(0,i.jsx)(t_,{...n,size:40}),(0,i.jsx)(H1,{css:{marginLeft:"$3"},size:40,userInfo:e.userInfo})]})},Z1=()=>{const e=Fi();return(0,i.jsxs)(Tl,{align:"center",css:{flex:1},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(nb,{color:"primary",icon:"user-group"}),(0,i.jsx)(Mr,{color:"gray500",children:e("aucun_b_n_vole_19616")})]})},K1=br("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),X1=br(Yl,{color:"$gray800",margin:"0 $3",padding:"$3 $4"}),Q1=({back:e,slot:n})=>{const{organizationId:t,eventId:s,positionId:o,positionSlotId:a}=Vi(),r=ki(Bg),d=Bi(),{hasPermission:l}=BS(),c=l(sy.POSITION_READ,{positionCategoryId:n.positionCategoryId,positionId:o});return(0,i.jsxs)(P0,{back:e,children:[(0,i.jsx)(x1,{css:{minHeight:"40px",marginRight:"0"},children:(0,i.jsx)(K1,{children:y1(n,r)})}),c&&(0,i.jsx)(X1,{icon:"list-check",onClick:()=>{d.push(yo.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(t,s,o,a))}})]})},J1=e=>e.event.volunteersRegistrations.nodes,e2=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=Vi(),o=Fi(),a=Bi(),r={eventId:n,positionSlotId:s,predicatesGroups:fg(),limit:Tm,offset:0},{data:d,loader:l,loadMore:c,xs:u}=U0(el,r,J1);return l&&void 0===d?l:(0,i.jsxs)(k0,{children:[(0,i.jsx)(Q1,{back:()=>{a.push(oo.POSITION_SLOTS({organizationId:e,eventId:n,positionId:t}))},slot:d.event.positionSlot}),(0,i.jsx)(D0,{children:(0,i.jsx)(Tl,{css:{flex:1,margin:"$7 0"},direction:"column",gap:"7",children:0===u.length?(0,i.jsx)(Z1,{}):(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[u.map(o=>(0,i.jsx)(Y1,{checkInState:o.positionSlotUserInfo.state,openVolunteer:()=>{a.push(yo.POSITION_SLOT_MEMBERS_USER_INFORMATIONS(e,n,t,s,o.userInfo.id))},userInfo:o.userInfo},o.id)),(0,i.jsx)(B0,{buttonText:o("afficher_plus_d_41906"),isLoading:void 0!==l,loadMore:c,pageInfo:d.event.volunteersRegistrations.pageInfo,statusText:o("_1_sur_2_mem_14323",u.length,d.event.volunteersRegistrations.totalCount)})]})})})]})},n2=br("div",{minHeight:"$space$5","@tablet":{minHeight:"$space$6"}}),t2=e=>(0,i.jsx)(Mr,{color:"gray800",css:{fontSize:"$textLg","@tablet":{fontSize:"$textMd"},...e.css},fontWeight:"semiBold",children:e.children}),i2=e=>{const n=Dm(),t=Fi(),s=e.fieldsToDisplay.filter(e=>!["picture","firstName","lastName"].includes(e.fieldProperty)),o=s.length,a=e.privateCustomFields.length;return(0,i.jsxs)(Tl,{direction:"column",children:[o>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(t2,{children:t("informations_pe_37892")}),(0,i.jsx)(Pl,{height:"3"}),s.map(n=>AC(n,e.userInfo.fields,s)&&(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(TE,{field:n,fields:e.userInfo.fields}),(0,i.jsx)(n2,{})]},n.id)),!1===n&&(0,i.jsx)(Mr,{css:{borderBottom:"1px solid $gray200"},width:1})]}),a>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:n?5:6}),(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(t2,{children:(0,i.jsx)(Yl,{icon:"lock"})}),(0,i.jsx)(t2,{children:t("informations_pr_15873")})]}),(0,i.jsx)(Pl,{height:"3"}),e.privateCustomFields.map(n=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(TE,{field:n,fields:e.userInfo.fields}),(0,i.jsx)(n2,{})]},n.id)),!1===n&&(0,i.jsx)(Mr,{css:{borderBottom:"1px solid $gray200"},width:1})]}),!1===n&&e.editButton,!1===n&&(0,i.jsx)(Pl,{height:"6"})]})},s2=e=>{const n=Bi(),t=Dm(),s=g(e.path);return(0,i.jsxs)(Tl,{css:{cursor:s?"pointer":"initial"},direction:"column",onClick:()=>{s&&n.push(e.path)},children:[(0,i.jsx)(Mr,{color:"gray800",css:{fontSize:"$textSm",overflow:"hidden",textOverflow:"ellipsis"},fontWeight:"medium",children:e.text}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.subtext}),(0,i.jsx)(Pl,{height:t?5:6})]})},o2=e=>{const n=Fi(),{hasPermission:t}=BS(),s=ki(Jm),o=ki(Xb),a=ki(Bg),r=Dm(),d=t(sy.MEMBER_ASSIGN),l=(0,Lm.A)(e.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),c=(0,Lm.A)(e.volunteerRegistration.preassignPositions.map(({id:e,name:n,range:t})=>({id:e,name:n,range:t,isPosition:!0})).concat(e.volunteerRegistration.preassignPositionsCategories.map(({id:e,name:n,range:t})=>({id:e,name:n,range:t,isPosition:!1}))),e=>e.range?.start.toMillis()??0);return(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Pl,{height:"6"}),Yo(l)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t2,{children:n("affectation_plural")}),(0,i.jsx)(Pl,{height:"3"}),l.map((n,s)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(PE,{canCheckIn:t(sy.POSITION_READ,{positionCategoryId:n.positionCategoryId,positionId:n.position.id}),canDelete:d,positionSlotUserInfo:n,reloadCheckIn:e.reload,onDelete:e.reload}),(0,i.jsx)(Pl,{height:r?2:3})]},s)),(0,i.jsx)(Pl,{height:"3"}),!1===r&&(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Pl,{height:r?5:6})]}),Yo(c)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t2,{children:n("missions_et_cat_88954")}),(0,i.jsx)(Pl,{height:"3"}),c.map((n,t)=>(0,i.jsx)(s2,{path:n.isPosition?oo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:n.id}):oo.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:n.id}),subtext:n.range?a.toDisplayString(n.range):"-",text:n.name},t)),!1===r&&(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Pl,{height:r?5:6})]}),(Yo(e.volunteerRegistration.positionsCategories)||Yo(e.volunteerRegistration.positions)||Yo(e.volunteerRegistration.positionsSlots))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t2,{children:n("missions_souhai_23225")}),(0,i.jsx)(Pl,{height:"3"}),(0,Lm.A)(e.volunteerRegistration.positionsCategories,e=>e.range?.start?.toMillis()??0).map((n,t)=>(0,i.jsx)(s2,{path:oo.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:n.id}),subtext:n.range?a.toDisplayString(n.range):"-",text:n.name},t)),(0,Lm.A)(e.volunteerRegistration.positions,e=>e.range?.start?.toMillis()??0).map((n,t)=>(0,i.jsx)(s2,{path:oo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:n.id}),subtext:n.range?a.toDisplayString(n.range):"-",text:n.name},t)),(0,Lm.A)(e.volunteerRegistration.positionsSlots,e=>e.range.start.toMillis()).map((n,t)=>(0,i.jsx)(s2,{path:oo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:n.position.id}),subtext:n.nameOrRange,text:n.position.name},t)),!1===r&&(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Pl,{height:r?5:6})]}),Yo(e.volunteerRegistration.slots)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t2,{children:n("disponibilit_s_49923")}),(0,i.jsx)(Pl,{height:"3"}),e.volunteerRegistration.slots.map((e,t)=>(0,i.jsx)(s2,{subtext:a.toDisplayString(e.range),text:n("disponibilit_n_50484",t+1)},t)),!1===r&&(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Pl,{height:r?5:6})]}),e.volunteerRegistration.state===it.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t2,{children:n("statistiques_98073")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(s2,{subtext:o.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes),text:n("nombre_d_heures_36999")}),!1===r&&(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Pl,{height:r?5:6})]}),(0,i.jsx)(t2,{children:n("inscription_48144")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(s2,{subtext:s.toLocaleString(e.volunteerRegistration.insertedAt.toLocal(),Uo.DateTime),text:n("date_d_inscript_31369")})]})},a2=br(Mr,{lineHeight:"28px",marginTop:"$3",maxWidth:"100%",ellipsis:""}),r2=br(Mr,{lineHeight:"20px",maxWidth:"100%",ellipsis:""}),d2=({registration:e})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W1,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,registrationState:e.state,size:64}),(0,i.jsx)(a2,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e.userInfo.name}),(0,i.jsx)(r2,{color:"gray500",fontSize:"textSm",children:e.userInfo.email})]}),l2=({basePath:e,data:n,reload:t})=>{const s=Fi(),{organizationId:o,eventId:a}=Vi(),r=n.event.volunteerRegistration,d={informations:`${e}/${ns.INFORMATION}`,registration:`${e}/${ns.REGISTRATION}`};return(0,i.jsxs)(Tl,{align:"center",css:{alignSelf:"center",padding:"0 $4"},direction:"column",width:1,children:[(0,i.jsx)(d2,{registration:r}),(0,i.jsxs)(Ty,{css:{marginTop:"$5"},children:[(0,i.jsxs)(h1,{children:[(0,i.jsx)(I1,{path:d.informations,children:s("informations_22954")}),(0,i.jsx)(I1,{path:d.registration,children:s("missions_63972")})]}),(0,i.jsx)($y,{path:d.informations,children:(0,i.jsx)(i2,{fieldsToDisplay:n.event.formsCustomsFields,privateCustomFields:n.organization.customFields.nodes,userInfo:r.userInfo})}),(0,i.jsx)($y,{path:d.registration,children:(0,i.jsx)(o2,{eventId:a,organizationId:o,reload:t,volunteerRegistration:r})})]})]})},c2=({basePath:e,onClose:n})=>{const{organizationId:t,eventId:s,userInfoId:o}=Vi(),{data:a,loader:r,reload:d}=Li("query UserInfoMobile(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n state\n volunteerMinutes\n insertedAt\n\n slots {\n range\n }\n\n positionsSlots {\n nameOrRange\n range\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n userInfo {\n ...UserInfoOverlay\n }\n\n positionsSlotsUsersInfos {\n ...UserPositionSlotUserInfo\n }\n\n preassignPositions {\n id\n name\n range\n }\n\n preassignPositionsCategories {\n id\n name\n range\n }\n }\n }\n}\n",{organizationId:t,eventId:s,userInfoId:o},[$o.CustomFieldWithConditionFragment,$o.UserInfoOverlayFragment,$o.UserPositionSlotUserInfoFragment]);return(0,i.jsx)(w0,{onClose:n,children:r||(0,i.jsx)(l2,{basePath:e,data:a,reload:d})})},u2=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s,userInfoId:o}=Vi(),a=Bi(),r=yo.POSITION_SLOT_MEMBERS_USER(e,n,t,s,o);return(0,i.jsx)(c2,{basePath:r,onClose:()=>{a.push(yo.POSITION_SLOT_MEMBERS(e,n,t,s))}})},m2=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(D1,{})}),(0,i.jsx)(kr.qh,{path:yo.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(k1,{})}),(0,i.jsx)(kr.qh,{path:yo.POSITION_SLOT_CHECK_MEMBERS_RESET(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(L1,{})}),(0,i.jsx)(kr.qh,{path:yo.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(e2,{})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(w1,{})})]}),(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)($1,{})}),(0,i.jsx)(kr.qh,{path:yo.POSITION_SLOT_MEMBERS_USER(":organizationId",":eventId",":positionId",":positionSlotId",":userInfoId"),children:(0,i.jsx)(u2,{})})]})]}),g2=br("i",{fontSize:"$textXl"}),h2=({replaySearch:e})=>{const{eventId:n}=Vi(),{data:t,loader:s}=Li("query RecentVolunteersSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentVolunteersRegistrationsSearches\n }\n}\n",{eventId:n},[]),o=Fi();if(s)return s;{const n=t.event.recentVolunteersRegistrationsSearches;return(0,i.jsxs)(Tl,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Mr,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",n.length)}),n.map((n,t)=>(0,i.jsxs)(Tl,{align:"center",gap:"2",onClick:()=>{e(n)},children:[(0,i.jsx)(g2,{className:"fa-regular fa-clock"}),(0,i.jsx)(Mr,{children:n})]},t))]})}},p2=()=>{const e=Fi();return(0,i.jsx)(UE,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},I2=e=>e.event.volunteersRegistrations.nodes,x2=({search:e})=>{const n=Fi(),{organizationId:t,eventId:s}=Vi(),o={eventId:s,predicatesGroups:fg(),limit:Tm,offset:0,name:e},{data:a,loader:r,loadMore:d,xs:l}=U0(_l,o,I2),c=Bi();return r&&void 0===a?r:0===l.length?(0,i.jsx)(p2,{}):(0,i.jsxs)(Tl,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Mr,{fontSize:"textMd",fontWeight:"semiBold",children:n("r_sultat_de_la_64686",l.length)}),l.map((e,n)=>(0,i.jsx)(Y1,{openVolunteer:()=>{c.push(yo.VOLUNTEERS_SEARCH_USER_INFORMATIONS(t,s,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},n)),(0,i.jsx)(B0,{buttonText:n("afficher_plus_d_41906"),isLoading:void 0!==r,loadMore:d,pageInfo:a.event.volunteersRegistrations.pageInfo,statusText:n("_1_sur_2_mem_14323",l.length,a.event.volunteersRegistrations.totalCount)})]})},f2=br(Tl,{color:"$blue600"}),_2=()=>{const{organizationId:e,eventId:n}=Vi(),t=Bi(),s=Fi(),[o,a]=(0,V.useState)(""),[r,d]=(0,V.useState)("");return(0,i.jsxs)(k0,{children:[(0,i.jsx)(P0,{back:()=>{t.push(yo.VOLUNTEERS(e,n))},children:(0,i.jsxs)(Tl,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(wc,{icon:"search",placeholder:s("rechercher_un_m_05904"),value:o,onChange:e=>{a(e),e||d(e)},onKeyDown:e=>{"Enter"===e.key&&d(o)}}),r&&(0,i.jsx)(f2,{onClick:()=>{a(""),d("")},children:s("annuler_48254")})]})}),(0,i.jsx)(D0,{children:r?(0,i.jsx)(x2,{search:r}):(0,i.jsx)(h2,{replaySearch:e=>{a(e),d(e)}})})]})},j2=()=>{const{organizationId:e,eventId:n,userInfoId:t}=Vi(),s=Bi(),o=yo.VOLUNTEERS_SEARCH_USER(e,n,t);return(0,i.jsx)(c2,{basePath:o,onClose:()=>{s.push(yo.VOLUNTEERS_SEARCH(e,n))}})},v2=()=>{const e=Fi();return(0,i.jsx)(UE,{css:{flex:1,padding:"0 $4"},subtitle:e("diffusez_le_for_36054"),title:e("il_n_y_a_pas_de_22623")})},S2=e=>e.event.volunteersRegistrations.nodes,y2=({segment:e})=>{const n=Fi(),{organizationId:t,eventId:s,segmentId:o}=Vi(),a={eventId:s,predicatesGroups:e.predicatesGroups,limit:Tm,offset:0},{data:r,loader:d,loadMore:l,xs:c}=U0(_l,a,S2),u=Bi();return d&&void 0===r?d:0===c.length?(0,i.jsx)(v2,{}):(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[c.map((e,n)=>(0,i.jsx)(Y1,{openVolunteer:()=>{u.push(yo.VOLUNTEERS_LIST_USER_INFORMATIONS(t,s,o,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},n)),(0,i.jsx)(B0,{buttonText:n("afficher_plus_d_41906"),isLoading:void 0!==d,loadMore:l,pageInfo:r.event.volunteersRegistrations.pageInfo,statusText:n("_1_sur_2_mem_14323",c.length,r.event.volunteersRegistrations.totalCount)})]})},C2=br("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),b2=br(Yl,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),A2=({event:e})=>{const{organizationId:n,eventId:t,segmentId:s}=Vi(),o=Bi(),a=Fi(),r=(0,o1.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Tl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Tl,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(C2,{children:a("membres_11310")}),(0,i.jsx)(b2,{icon:"search",onClick:()=>{o.push(yo.VOLUNTEERS_SEARCH(n,t))}})]}),(0,i.jsx)(Mr,{children:(0,i.jsx)(s1,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push(yo.VOLUNTEERS_SEGMENT(n,t,e))})}),(0,i.jsx)(Tl,{css:{flex:1},direction:"column",children:(0,i.jsx)(y2,{segment:r})})]})},E2=()=>{const{organizationId:e,eventId:n,segmentId:t,userInfoId:s}=Vi(),o=Bi(),a=yo.VOLUNTEERS_LIST_USER(e,n,t,s);return(0,i.jsx)(c2,{basePath:a,onClose:()=>{o.push(yo.VOLUNTEERS_SEGMENT(e,n,t))}})},w2=()=>{const{organizationId:e,eventId:n}=Vi(),{data:t,loader:s}=Li("query VolunteersSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Volunteers) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:n},[$o.SegmentsFoldersSegmentsFragment]);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.VOLUNTEERS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(_2,{})}),(0,i.jsx)(kr.qh,{path:yo.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(A2,{event:t.event})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.VOLUNTEERS_SEGMENT(e,n,t.event.segmentsFolders[0].segments[0].id)})})]}),(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.VOLUNTEERS_SEARCH_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(j2,{})}),(0,i.jsx)(kr.qh,{path:yo.VOLUNTEERS_LIST_USER(":organizationId",":eventId",":segmentId",":userInfoId"),children:(0,i.jsx)(E2,{})})]})]})},$2=()=>{const{organizationId:e,eventId:n}=Vi(),{user:t}=XS();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(I0,{eventId:n,user:t,children:(0,i.jsx)(S0,{})})}),(0,i.jsx)(kr.qh,{path:yo.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(I0,{eventId:n,user:t,children:(0,i.jsx)(w2,{})})}),(0,i.jsx)(kr.qh,{path:oo.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(I0,{eventId:n,user:t,children:(0,i.jsx)(m1,{})})}),(0,i.jsx)(kr.qh,{path:oo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(m2,{})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.DASHBOARD(e,n)})})]}),(0,i.jsx)(kr.dO,{children:(0,i.jsx)(kr.qh,{path:yo.DASHBOARD_EVENT_SWITCH(":organizationId",":eventId"),children:(0,i.jsx)(R0,{})})})]})},T2=e=>{const n=e.isActive?e.isActive(location.pathname):location.pathname===e.to,[t,s]=V.useState(n),o=!!e.children&&(!e.isMenuOpen||t),a=()=>(0,i.jsxs)(Tl,{align:"center",className:n?"h-event-menu-group-active":"",css:{color:"$gray700",cursor:"pointer",padding:"$2 $3","&:hover, &.h-event-menu-group-active":{background:"$primary50",borderRadius:"6px",color:"$primary500"}},gap:"3",height:e.isMenuOpen?void 0:40,width:1,onClick:()=>{e.isMenuOpen&&s(!t)},children:[(0,i.jsx)(Yl,{icon:e.icon}),e.isMenuOpen&&(0,i.jsx)(Mr,{css:{flex:"1"},fontWeight:"medium",children:e.title}),e.isMenuOpen&&e.children&&(0,i.jsx)(Mr,{fontSize:"textXs",children:(0,i.jsx)(Yl,{icon:t?"chevron-up":"chevron-down"})})]});return(0,i.jsxs)(Tl,{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?a():(0,i.jsx)(ql,{to:e.to,children:a()}),o&&(0,i.jsx)(Tl,{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)(Tl,{css:e.isMenuOpen?{}:{background:"white",bd:"gray200 2 md",py:"$2",width:"100%"},direction:"column",children:[!e.isMenuOpen&&(0,i.jsx)(Mr,{css:{padding:"$2 $3"},font:"gray900 textSm semiBold",children:e.title}),e.children]})})]})},z2=e=>{const n=e.isActive(location.pathname);return(0,i.jsx)(ql,{"aria-label":e.children,"aria-selected":n,role:"menuitem",to:e.to,onClick:async()=>await(e.onClick?.()),children:(0,i.jsx)(Tl,{className:n?"h-event-menu-item-active":"",css:{color:"$gray800",cursor:"pointer",padding:"6px $3","&:hover, &.h-event-menu-item-active":{color:"$primary500"}},children:e.children})})},O2=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=Kl(),{hasFeature:o}=XS(),{event:a,hasEventRole:r,numberOfWaitingAccreditations:d,numberOfWaitingAssigments:l,updateLocalEvent:c}=BS(),{canAccreditationRead:u,canCampaignRead:m,canCustomFieldRead:g,canDelegationRead:h,canDelegationsSpaceParamRead:p,canDocumentRead:I,canEmailEdit:x,canFormRead:f,canMemberAccredit:_,canMemberAssign:j,canPositionRead:v,canPrintConfigRead:S,canWeezeventRead:y,canWorkflowRead:C}=oy(),b=tp(),A=(0,V.useCallback)(e=>e.endsWith("/volunteers")||null!==e.match(/\/volunteers\/\d+/)||null!==e.match(/\/member\/\d+/)&&(e.endsWith("informations")||e.endsWith("availabilities")||e.endsWith("positions")||e.endsWith("accreditations")||e.endsWith("actions")||e.endsWith("comments")||e.includes("history")),[]),E=(0,V.useCallback)(e=>(null!==e.match(/\/delegations\/\d+/)||null!==e.match(/\/delegation\/\d+/)||null!==e.match(/\/delegation-category\/\d+/))&&!e.includes("/documents/"),[]),w=(0,V.useCallback)(e=>A(e)||E(e),[A,E]),$=(0,V.useCallback)(e=>(null!==e.match(/\/positions\/\d+/)||null!==e.match(/\/position\/\d+/)||null!==e.match(/\/position-category\/\d+/))&&!e.includes("documents"),[]),T=(0,V.useCallback)(e=>e.endsWith("/assignments")||e.endsWith("/assignments/blank")||null!==e.match(/\/assignment\/\d+/)||null!==e.match(/\/pre-assignment\/\d+/)||null!==e.match(/\/team-assignment\/\w+/),[]),z=(0,V.useCallback)(e=>$(e)||T(e),[$,T]),O=(0,V.useCallback)(e=>null!==e.match(/\/accreditations\/\d+/)||null!==e.match(/\/accreditation\/\d+/)||null!==e.match(/\/accreditation-category\/\d+/),[]),R=(0,V.useCallback)(e=>e.endsWith("/accreditations-assignments")||null!==e.match(/\/accredit\/\d+/)||null!==e.match(/\/edit-accredit\/\d+/),[]),D=(0,V.useCallback)(e=>null!==e.match(/accreditation-profiles\/\d+/)||null!==e.match(/\/accreditation-profile\/\d+/)||null!==e.match(/\/accreditation-profile-category\/\d+/),[]),M=(0,V.useCallback)(e=>O(e)||R(e)||D(e),[O,R,D]),P=(0,V.useCallback)(e=>(e.endsWith("/forms")||e.endsWith("/forms/create"))&&!e.endsWith("/history/forms"),[]),k=(0,V.useCallback)(e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/campaign\/\d+/),[]),F=(0,V.useCallback)(e=>null!==e.match(/\/delegations-space\//),[]),N=(0,V.useCallback)(e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),[]),L=(0,V.useCallback)(e=>e.endsWith("/documents")||null!==e.match(/\/documents\//),[]),U=(0,V.useCallback)(e=>P(e)||k(e)||F(e)||N(e)||L(e),[P,k,F,N,L]),B=(0,V.useCallback)(e=>e.endsWith("/options/api"),[]),W=(0,V.useCallback)(e=>e.endsWith("options/weezevent"),[]),G=(0,V.useCallback)(e=>e.endsWith("/print-triggers")||null!==e.match(/\/print-trigger\/\d+/),[]),q=(0,V.useCallback)(e=>null!==e.match(/workflows\/\d+/)||null!==e.match(/\/workflow\/\d+/),[]),H=(0,V.useCallback)(e=>null!==e.match(/custom-fields\/\d+/),[]),Y=(0,V.useCallback)(e=>B(e)||W(e)||G(e)||q(e)||H(e),[B,W,G,q,H]),Z=r,K=o(Ze.Api)&&r,X=y,Q=S&&!!a.weezeventEventId&&!!a.numberOfZplDocuments,J=K||X||Q||C||g,ee=f||m||x||I||p;return(0,i.jsxs)(Tl,{css:{overflowY:e.isOpen?"auto":void 0,paddingTop:"$5",px:"$3"},direction:"column",gap:"5",width:1,children:[(0,i.jsxs)(Tl,{align:"center","aria-keyshortcuts":(b?"Meta":"Control")+"+K",css:{bd:"gray300 1",cursor:"pointer",padding:"$2 $3"},gap:"2",onClick:e=>{jc(e),e.target.dispatchEvent(new CustomEvent(aR,{bubbles:!0}))},children:[(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"sparkles"})}),e.isOpen&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{color:"gray800",css:{flex:"1"},children:n("action_rapide_97952")}),(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",bd:"gray200 1",padding:"2px $1"},justify:"center",children:[b?"⌘":"Ctrl","+k"]})]})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:1,children:[Z&&(0,i.jsx)(T2,{icon:"objects-column",isMenuOpen:e.isOpen,title:n("tableau_de_bord_24627"),to:yo.DASHBOARD(t,s)}),(0,i.jsxs)(T2,{icon:"user-group",isActive:w,isMenuOpen:e.isOpen,title:n("population_38615"),to:yo.VOLUNTEERS(t,s),children:[(0,i.jsx)(z2,{isActive:A,to:yo.VOLUNTEERS(t,s),onClick:()=>c({volunteersSegmentId:null}),children:n("membres_11310")}),h&&(0,i.jsx)(z2,{isActive:E,to:Js.DELEGATIONS({organizationId:t,eventId:s}),onClick:()=>c({delegationsSegmentId:null}),children:n("d_l_gations_78318")})]}),v&&(0,i.jsxs)(T2,{icon:"sitemap",isActive:z,isMenuOpen:e.isOpen,title:n("missions_63972"),to:oo.POSITIONS({organizationId:t,eventId:s}),children:[(0,i.jsx)(z2,{isActive:$,to:oo.POSITIONS({organizationId:t,eventId:s}),onClick:()=>c({positionsSegmentId:null}),children:n("missions_63972")}),j&&(0,i.jsx)(z2,{isActive:T,to:yo.ASSIGNMENTS(t,s),children:`${n("affectation_plural")} (${l})`})]}),u&&(0,i.jsxs)(T2,{icon:"badge-check",isActive:M,isMenuOpen:e.isOpen,title:n("accr_ditations_39450"),to:Ws.ACCREDITATIONS({organizationId:t,eventId:s}),children:[(0,i.jsx)(z2,{isActive:O,to:Ws.ACCREDITATIONS({organizationId:t,eventId:s}),onClick:()=>c({accreditationsSegmentId:null}),children:n("accr_ditations_39450")}),(0,i.jsx)(z2,{isActive:D,to:JO.ACCREDITATIONS_PROFILES({organizationId:t,eventId:s}),children:n("profils_d_accr_27825")}),_&&(0,i.jsx)(z2,{isActive:R,to:yo.ACCREDITATIONS_ASSIGNMENTS(t,s),children:`${n("mod_ration_09947")} (${d})`})]}),ee&&(0,i.jsxs)(T2,{icon:"message",isActive:U,isMenuOpen:e.isOpen,title:n("communication_05277"),to:$s.FORMS({organizationId:t,eventId:s}),children:[f&&(0,i.jsx)(z2,{isActive:P,to:$s.FORMS({organizationId:t,eventId:s}),children:n("Form_plural")}),m&&(0,i.jsx)(z2,{isActive:k,to:Gj.CAMPAIGNS({organizationId:t,eventId:s}),children:n("Campaigns")}),x&&(0,i.jsx)(z2,{isActive:e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),to:yo.EVENT_EMAILS_PARAMETERS(t,s),children:n("e_mails_09850")}),I&&(0,i.jsx)(z2,{isActive:L,to:YO.DOCUMENTS({organizationId:t,eventId:s}),children:n("Documents")}),p&&(0,i.jsx)(z2,{isActive:F,to:xT.DELEGATIONS_SPACE({organizationId:t,eventId:s}),children:n("espace_d_l_gati_59251")})]}),J&&(0,i.jsxs)(T2,{icon:"sliders-up",isActive:Y,isMenuOpen:e.isOpen,title:n("options_53186"),to:yo.OPTIONS_API(t,s),children:[K&&(0,i.jsx)(z2,{isActive:B,to:yo.OPTIONS_API(t,s),children:"API"}),X&&(0,i.jsx)(z2,{isActive:W,to:yo.OPTIONS_WEEZEVENT(t,s),children:"Weezevent"}),C&&(0,i.jsx)(z2,{isActive:q,to:Yj.WORKFLOWS({organizationId:t,eventId:s}),children:n("automatisations_60045")}),g&&(0,i.jsx)(z2,{isActive:H,to:mj.CUSTOM_FIELDS({organizationId:t,eventId:s}),children:n("champs_de_formu_64126")}),Q&&(0,i.jsx)(z2,{isActive:G,to:rU.PRINT_TRIGGERS({organizationId:t,eventId:s}),children:n("impressions_96006")})]})]})]})},R2=e=>{const{translate:n}=Kl();return(0,i.jsx)(Tl,{align:"center",css:{px:"$4"},height:48,justify:"end",children:(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(tc,{color:"white",css:{border:"none"},leftIcon:"sidebar",size:"sm",onClick:e.onToggle})}),(0,i.jsx)(Dx,{placement:"top",children:e.isOpen?n("masquer_le_menu_29008"):n("afficher_le_men_91936")})]})})},D2=()=>{const{params:{organizationId:e,eventId:n},translate:t}=Kl(),{event:s,hasEventRole:o,hasPermission:a}=BS(),r=a(sy.MEMBER_ASSIGN,{eventId:n}),{canAccreditationRead:d,canCampaignRead:l,canCustomFieldRead:c,canDelegationRead:u,canDelegationsSpaceParamRead:m,canDocumentEdit:g,canDocumentRead:h,canEmailEdit:p,canFormEdit:I,canFormRead:x,canMemberAccredit:f,canMemberAssign:_,canMemberEdit:j,canPositionRead:v,canPrintConfigRead:S,canWeezeventRead:y,canWorkflowRead:C}=oy();Au(s.name);const[b,A]=Yb(e,"isEventMenuOpen",!1);return(0,i.jsxs)(Tl,{height:1,width:1,children:[(0,i.jsxs)(Tl,{"aria-label":t("menu_de_l_v_ne_05526"),as:El.Nav,css:{borderRight:"1px solid $gray200"},direction:"column",width:b?240:64,children:[(0,i.jsx)(Tl,{css:{flex:"1",overflowY:b?"hidden":void 0},width:1,children:(0,i.jsx)(O2,{isOpen:b})}),(0,i.jsx)(R2,{isOpen:b,onToggle:()=>{A(!b)}})]}),(0,i.jsx)(Mr,{css:{flex:"1",height:"100%",overflowX:"hidden"},tabIndex:-1,children:(0,i.jsxs)(kr.dO,{children:[o&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(dq,{})}),v&&(0,i.jsx)(kr.qh,{path:oo.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(yQ,{})}),v&&(0,i.jsx)(kr.qh,{path:oo.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(iJ,{})}),v&&(0,i.jsx)(kr.qh,{path:oo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(HQ,{})}),(0,i.jsx)(kr.qh,{path:yo.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(i0,{})}),j&&(0,i.jsx)(kr.qh,{path:yo.EDIT_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(BM,{})}),f&&(0,i.jsx)(kr.qh,{path:yo.EDIT_USER_ACCREDITATIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(RJ,{})}),_&&(0,i.jsx)(kr.qh,{path:yo.EDIT_USER_MISSIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(PJ,{})}),(0,i.jsx)(kr.qh,{path:yo.EDIT_USER_SLOTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(NJ,{})}),u&&(0,i.jsx)(kr.qh,{path:Js.DELEGATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Eq,{})}),(0,i.jsx)(kr.qh,{path:Rj.MEMBER({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)($M,{})}),u&&(0,i.jsx)(kr.qh,{path:Js.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(dz,{isEvent:!0})}),u&&(0,i.jsx)(kr.qh,{path:Js.DELEGATION({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(HT,{})}),(o||_)&&(0,i.jsx)(kr.qh,{path:yo.ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(XG,{})}),_&&(0,i.jsx)(kr.qh,{path:yo.ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qG,{isEdit:!1})}),_&&(0,i.jsx)(kr.qh,{path:yo.EDIT_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qG,{isEdit:!0})}),r&&(0,i.jsx)(kr.qh,{path:yo.TEAM_ASSIGNMENT(":organizationId",":eventId",":teamCode"),children:(0,i.jsx)(sq,{})}),_&&(0,i.jsx)(kr.qh,{path:yo.PRE_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(qG,{isEdit:!1})}),f&&(0,i.jsx)(kr.qh,{path:yo.ACCREDITATIONS_ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(fW,{})}),f&&(0,i.jsx)(kr.qh,{path:yo.ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(mW,{isEdit:!1})}),f&&(0,i.jsx)(kr.qh,{path:yo.EDIT_ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(mW,{isEdit:!0})}),I&&(0,i.jsx)(kr.qh,{path:$s.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Cz,{isCreateOpen:!0})}),x&&(0,i.jsx)(kr.qh,{path:$s.FORMS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Cz,{isCreateOpen:!1})}),l&&(0,i.jsx)(kr.qh,{path:Gj.CAMPAIGNS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(oq,{})}),l&&(0,i.jsx)(kr.qh,{path:Gj.CAMPAIGN({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(tC,{})}),m&&(0,i.jsx)(kr.rd,{exact:!0,from:xT.DELEGATIONS_SPACE({organizationId:":organizationId",eventId:":eventId"}),push:!1,to:xT.DELEGATIONS_SPACE_DESIGN({organizationId:e,eventId:n})}),m&&(0,i.jsx)(kr.qh,{path:xT.DELEGATIONS_SPACE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Ay,{children:(0,i.jsx)(l0,{})})}),(o||p)&&(0,i.jsx)(kr.qh,{path:yo.EVENT_EMAILS(":organizationId",":eventId"),children:(0,i.jsx)(rK,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_PLANNING({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(FZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_PLANNING_LIST({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(WZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_PLANNING_DAYS({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(zZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_ASSIGNMENTS({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(pZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USERS_LISTING({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(oZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_BADGE({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",badgeType:"generic"}),children:(0,i.jsx)(fZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_BADGE({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",badgeType:":badgeType"}),children:(0,i.jsx)(yZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_CERTIFICATE({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(vZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.DELEGATION_CALENDAR({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(UY,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.ASO_PAX_MANIFEST({organizationId:":organizationId",eventId:":eventId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(hY,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USER_HOURS({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(EZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.POSITION_PLANNING({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(QZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.POSITIONS_VOLUNTEERS_PLANNING({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(eZ,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.POSITION_SHEET({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(oK,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.POSITIONS_PLANNING({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(HY,{})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.USERS_PICTURES({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(lZ,{})}),h&&(0,i.jsx)(kr.qh,{path:YO.USER_CUSTOM_DOCUMENT({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(SY,{})}),g&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.CREATE_CUSTOM_DOCUMENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(dY,{isCreateOpen:!0})}),h&&(0,i.jsx)(kr.qh,{exact:!0,path:YO.DOCUMENTS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(dY,{isCreateOpen:!1})}),y&&(0,i.jsx)(kr.qh,{path:yo.OPTIONS_WEEZEVENT(":organizationId",":eventId"),children:(0,i.jsx)(OK,{})}),C&&(0,i.jsx)(kr.qh,{path:Yj.WORKFLOWS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Vk,{})}),c&&(0,i.jsx)(kr.qh,{path:mj.CUSTOM_FIELDS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(uL,{})}),C&&(0,i.jsx)(kr.qh,{path:Yj.WORKFLOW({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(Kk,{})}),o&&(0,i.jsx)(kr.qh,{path:yo.OPTIONS_API(":organizationId",":eventId"),children:(0,i.jsx)(TK,{})}),d&&(0,i.jsx)(kr.qh,{path:JO.ACCREDITATIONS_PROFILES({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(mG,{})}),d&&(0,i.jsx)(kr.qh,{path:JO.ACCREDITATIONS_PROFILE({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(xG,{})}),d&&(0,i.jsx)(kr.qh,{path:JO.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),children:(0,i.jsx)(yG,{})}),d&&(0,i.jsx)(kr.qh,{path:Ws.ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(CV,{})}),d&&(0,i.jsx)(kr.qh,{path:Ws.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(wG,{})}),d&&(0,i.jsx)(kr.qh,{path:Ws.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(FB,{})}),d&&(0,i.jsx)(kr.qh,{path:Ws.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(wW,{})}),S&&(0,i.jsx)(kr.qh,{path:rU.PRINT_TRIGGERS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(TJ,{})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.VOLUNTEERS(e,n),replace:!0})})]})}),(0,i.jsx)(rR,{level:"event"})]})},M2=()=>{const{hasFeature:e}=XS(),{event:n,hasPermission:t}=BS(),s=t(sy.CAMPAIGN_SEND,{eventId:n.id}),o=t(sy.DELEGATION_EDIT,{eventId:n.id}),{canAccreditationEdit:a,canCampaignSend:r,canCustomFieldEdit:d,canDelegationEdit:l,canDelegationsSpaceParamEdit:c,canDocumentEdit:u,canFormRead:m,canMemberAssign:g,canMemberCreate:h,canMemberEdit:p,canPositionEdit:I,canPrintConfigEdit:x,canWorkflowEdit:f}=oy();return(0,i.jsxs)(kr.dO,{children:[n.usePositions&&I&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.CREATE_POSITION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(WK,{})}),n.usePositions&&I&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.EDIT_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(GK,{})}),n.usePositions&&g&&(0,i.jsx)(kr.qh,{path:yo.POSITION_SLOT_ASSIGN_VOLUNTEERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(oJ,{})}),s&&(0,i.jsx)(kr.qh,{exact:!0,path:Gj.CREATE_TEMPLATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(fy,{isTemplate:!0})}),r&&(0,i.jsx)(kr.qh,{exact:!0,path:Gj.CREATE({organizationId:":organizationId",eventId:":eventId",options:":options?"}),children:(0,i.jsx)(fy,{isTemplate:!1})}),r&&(0,i.jsx)(kr.qh,{exact:!0,path:Gj.UPDATE({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(_y,{})}),a&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.CREATE_ACCREDITATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(zU,{})}),a&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.EDIT_ACCREDITATION(":organizationId",":eventId",":accreditationId"),children:(0,i.jsx)(OU,{})}),a&&(0,i.jsx)(kr.qh,{exact:!0,path:[JO.ACCREDITATIONS_PROFILE_CREATE({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),JO.ACCREDITATIONS_PROFILE_CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(FW,{})}),a&&(0,i.jsx)(kr.qh,{exact:!0,path:JO.ACCREDITATIONS_PROFILE_EDIT({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(NW,{})}),a&&(0,i.jsx)(kr.qh,{exact:!0,path:Ws.ACCREDITATIONS_IMPORT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(MU,{})}),a&&(0,i.jsx)(kr.qh,{exact:!0,path:JO.ACCREDITATIONS_PROFILES_IMPORT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(BW,{})}),u&&(0,i.jsx)(kr.qh,{path:YO.EDIT_CUSTOM_DOCUMENT({organizationId:":organizationId",eventId:":eventId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(ZH,{})}),l&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.CREATE_DELEGATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(Wb,{})}),c&&(0,i.jsx)(kr.qh,{exact:!0,path:xT.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Rq,{})}),c&&(0,i.jsx)(kr.qh,{exact:!0,path:xT.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:":organizationId",eventId:":eventId",delegationsSpaceLayoutId:":delegationsSpaceLayoutId"}),children:(0,i.jsx)(Dq,{})}),l&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.EDIT_DELEGATION(":organizationId",":eventId",":delegationId"),children:(0,i.jsx)(qb,{})}),o&&(0,i.jsx)(kr.qh,{exact:!0,path:Js.DELEGATION_CATEGORY_UPDATE({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(IL,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_ELEMENTS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(uO,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(kO,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(RO,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_AVAILABILITIES({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(jK,{})}),n.usePositions&&m&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_MISSIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(AK,{})}),n.useAccreditations&&m&&e(Ze.Accreditation)&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(mK,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(CO,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_PARAMETERS_STATE({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(LO,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_INTEGRATION({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(Rz,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_EMAILS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(pO,{})}),m&&(0,i.jsx)(kr.qh,{path:$s.FORM_PREVIEW({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(Dz,{})}),l&&(0,i.jsx)(kr.qh,{path:yo.EVENT_DELEGATIONS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(uq,{})}),p&&(0,i.jsx)(kr.qh,{path:yo.EVENT_VOLUNTEERS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(AP,{})}),I&&(0,i.jsx)(kr.qh,{path:oo.POSITION_IMPORT_CSV({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(YK,{})}),h&&(0,i.jsx)(kr.qh,{path:yo.EVENT_FILES_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(Iz,{})}),h&&(0,i.jsx)(kr.qh,{path:[Rj.CREATE({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),Rj.CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(fD,{})}),f&&(0,i.jsx)(kr.qh,{path:Yj.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(tk,{})}),f&&(0,i.jsx)(kr.qh,{path:Yj.UPDATE({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(ik,{})}),d&&(0,i.jsx)(kr.qh,{path:mj.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Jz,{})}),d&&(0,i.jsx)(kr.qh,{path:mj.UPDATE({organizationId:":organizationId",eventId:":eventId",customFieldId:":customFieldId"}),children:(0,i.jsx)(eO,{})}),x&&(0,i.jsx)(kr.qh,{exact:!0,path:rU.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(hJ,{})}),x&&(0,i.jsx)(kr.qh,{exact:!0,path:rU.UPDATE({organizationId:":organizationId",eventId:":eventId",printTriggerId:":printTriggerId"}),children:(0,i.jsx)(pJ,{})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(bR,{children:(0,i.jsx)(D2,{})})})]})},P2=()=>{const{organizationId:e,eventId:n}=Vi(),{data:t,loader:s}=Li("query Event($organizationId: OrganizationId!, $eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n name\n startAt\n endAt\n languages\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n isWeezeventSynchronized\n numberOfZplDocuments\n weezeventEventId\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:n},[$o.UserPermissionsFragment]),{setSelectedEventId:o}=XS(),a=Dm(),r=(t.user?.roles??[]).some(e=>e.accessLevel===Un.Organization||e.accessLevel===Un.Event);if((0,V.useEffect)(()=>(o(n),()=>{o()}),[n]),s)return s;{const e=t.event.assignmentsStats;return(0,i.jsx)(MS,{userPermissions:t.user,children:(0,i.jsx)(VS,{event:t.event,numberOfWaitingAccreditations:t.event.accreditationsStats.numberOfWaitingAccreditation,numberOfWaitingAssigments:r?e.numberOfWaitingAssignment+e.numberOfPreAssigned:e.numberOfPreAssigned,children:a?(0,i.jsx)($2,{}):(0,i.jsx)(M2,{})})})}};var k2;!function(e){e.Delegation="delegation",e.Event="event",e.Id="id",e.Name="name",e.TicketId="ticket_id"}(k2||(k2={}));const F2="custom_field_value_",N2={slug:"cf80691",valueId:61410},L2={slug:"cf80691",valueId:61409},U2=[N2,L2];function V2({slug:e,valueId:n}){return`${F2}${e}_${n}`}function B2(e){return{includeCustomDocuments:e.some(Eh)}}let W2=class extends Og{constructor(e,n,t){super(e,n,t)}getPossibleColumns(e,n){return[{slug:k2.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:ot.Id,width:100},{slug:k2.Name,name:this.t("nom_08311"),isSortable:!0,sortAttribute:ot.Name,minWidth:280},{slug:k2.Event,name:this.t("_v_nement_22345"),minWidth:240},{slug:k2.TicketId,name:this.t("TicketId"),width:200},...this.getCustomDocumentsColumns(n),...this.getCustomFieldsValuesColumns(e),...this.customFieldsToPossibleColumns(e)]}getCustomFieldsValuesColumns(e){return U2.flatMap(({slug:n,valueId:t})=>{const i=e.find(e=>e.slug===n),s=i?.values.find(e=>e.id===t);return i&&s?[{slug:V2({slug:n,valueId:t}),name:s.value,label:i.name,customField:i,width:200}]:[]})}getCustomDocumentsColumns(e){return(0,Lm.A)(Object.entries((0,fm.A)(e,e=>e.slug)).map(([e,n])=>({slug:Ah(e),name:this.t("imprimer_1_75795",(0,Mg.A)(n,e=>e.id).name),label:e,minWidth:240})),e=>u(e.name))}};W2=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Ig,Jm,Di])],W2);const G2=(0,V.createContext)({active:!1,enable:Bc.A,disable:Bc.A});function q2(){return(0,V.useContext)(G2)}const H2=()=>{const{user:e}=Yi(),n=Dm(),t=Gi(),{active:i}=q2();return(0,V.useEffect)(()=>{if(F.USE_HUBSPOT&&g(e?.hubspotToken)){window.hsConversationsSettings={identificationEmail:e.email,identificationToken:e.hubspotToken};try{if(n||"true"===t.getItem(Tc.HIDE_HUBSPOT)||!i){const{loaded:e}=window.HubSpotConversations.widget.status();e?window.HubSpotConversations.widget.remove():window.HubSpotConversations.on("widgetLoaded",()=>{window.HubSpotConversations.widget.remove()})}else window.HubSpotConversations.clear({resetWidget:!0})}catch{}}},[n,i]),null},Y2=e=>{const{clearNameCursors:n,name:t}=pg();return(0,i.jsx)(FA,{column:e.column,customDocument:e.customDocument,eventId:e.row.event.id,reload:e.reload,search:{name:t,clearName:n},volunteerRegistration:e.row})},Z2=e=>{const{params:{organizationId:n}}=Kl(),{mutate:t}=Ha(),{slug:s,valueId:o}=(0,V.useMemo)(()=>function(e){const n=e.substring(19),t=n.lastIndexOf("_");return{slug:n.substring(0,t),valueId:parseInt(n.substring(t+1),10)}}(e.column.slug),[e.column.slug]),[a,r]=(0,V.useState)(!1),d=(0,V.useCallback)(async()=>{r(!0);try{await t({organizationId:n,userInfoId:e.row.userInfo.id,slug:s,value:e.column.customField?.canSelectMultiple?[o]:o})}finally{r(!1),e.reload()}},[n,e.column.customField,e.row.userInfo.id,e.reload,s,t,o]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(tc,{color:"white",css:{overflow:"hidden","& .h-button-content":{overflow:"hidden"}},isLoading:a,size:"sm",onClick:d,children:(0,i.jsx)(Mr,{css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name})})})},K2=e=>{const n=ki(Bg),t=(0,V.useMemo)(()=>(e.row.positionsSlotsUsersInfos||[]).map(({positionSlot:e,position:t})=>Zg(n,e,t.name,{slot:{includeRange:!0},position:{includeNameAtEnd:!0}})).join(", "),[n,e.row.positionsSlotsUsersInfos]);return(0,i.jsx)($m,{minWidth:e.column.minWidth,width:e.column.width,children:t})},X2=()=>Promise.resolve(),Q2=e=>{const{params:{organizationId:n}}=Kl();if(Eh(e.column.slug)){const n=e.column.slug.substring(16),o=(e.eventIdToCustomDocuments[e.row.event.id]??[]).filter(e=>e.slug===n);return(0,i.jsx)(Y2,{column:e.column,customDocument:(t=o,s=e.row.userInfo.fields?.population,t.length>1?t.find(e=>wh(e.populationsIds,s))??t[0]:t[0]),reload:e.reload,row:e.row})}var t,s;return e.column.slug.startsWith(F2)?(0,i.jsx)(Z2,{column:e.column,reload:e.reload,row:e.row}):e.column.slug===k2.Id?(0,i.jsx)($m,{width:e.column.width,children:e.row.userInfo.id}):e.column.slug===k2.Name?(0,i.jsx)($m,{minWidth:e.column.minWidth,children:(0,i.jsx)(My,{isClickDisabled:!0,userInfo:e.row.userInfo})}):e.column.slug===k2.Event?(0,i.jsx)($m,{minWidth:e.column.minWidth,children:(0,i.jsx)(Ku,{ellipsis:!0,title:e.row.event.name,children:e.row.event.name})}):e.column.slug===k2.Delegation?(0,i.jsx)($m,{width:e.column.width,children:e.row.delegation?.name??""}):e.column.slug===k2.TicketId?(0,i.jsx)($m,{width:e.column.width,children:e.row.ticketId}):"position"===e.column.slug?(0,i.jsx)(K2,{column:e.column,row:e.row}):(0,i.jsx)(jA,{avatarUser:e.row.userInfo,clickPath:Rj.MEMBER_INFORMATION({organizationId:n,eventId:e.row.event.id,userInfoId:e.row.userInfo.id}),column:e.column,customField:e.customField,fields:e.row.userInfo.fields??{},mutate:X2,reload:e.reload,updatable:!1})},J2=()=>{const{translate:e,params:{organizationId:n}}=Kl();Au(e("membres_11310"));const t=ki(W2),{disable:s}=q2(),{data:o,loader:a}=Li("query OrganizationMembersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n customDocuments {\n ...OrganizationMemberCustomDocument\n }\n }\n}\n",{organizationId:n},[$o.SegmentCustomFieldFragment,$o.OrganizationMemberCustomDocumentFragment]),r=(0,V.useMemo)(()=>o.organization?.customFields.nodes??[],[o.organization]),d=Kb(r),l=(0,V.useMemo)(()=>o.organization?.customDocuments??[],[o.organization]),c=(0,V.useMemo)(()=>t.getPossibleColumns(r,l),[r,l,t]),u=(0,V.useMemo)(()=>(0,fm.A)(l,e=>e.eventId),[l]),m=(0,V.useMemo)(()=>GS(n)?[k2.Name,"population",k2.Delegation,"cf80676",k2.TicketId,Ah("badgecompletr"),"cf80691",V2(N2),V2(L2),k2.Event]:function(e){return 306===e}(n)?[k2.Name,k2.Event]:[],[n]),g=(0,V.useMemo)(()=>GS(n)?[Th.Email,Th.Id,Th.LocalId,Th.Name,Th.WeezeventBarcodeVersion,Th.Delegations,"cf80676"]:[],[n]),[h,p,I]=Yb(n,"organizationMembers.limit",Tm),[x,f,_]=Yb(n,"organizationMembers.sort",null),j=I||_;return(0,V.useEffect)(()=>{s()},[]),(0,i.jsxs)(Ay,{children:[(0,i.jsx)(by,{children:(0,i.jsx)(Mr,{font:"gray900 displayXs medium",children:e("membres_11310")})}),(0,i.jsx)(yy,{css:{overflowY:"auto"},children:a||j?(0,i.jsx)(Ql,{}):(0,i.jsx)(Cx,{columns:m,columnsSearch:g,columnsToIncludes:B2,eventId:null,filters:[],limit:h,loadDataList:Wd,loadRow:Bd,organizationId:n,possibleColumns:c,predicates:fg(),rendering:xh.List,setColumns:Bc.A,setLimit:p,setSort:f,showEditColumns:!1,showEditMode:!1,showFilters:!1,showMassActions:!1,showPredicatesBadges:!1,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:x,children:(0,i.jsx)(kx,{renderCell:(e,n,t)=>(0,i.jsx)(Q2,{column:e,customField:d.get(e.slug),eventIdToCustomDocuments:u,reload:t,row:n})})})})]})};let e4=class extends Rc{documentInputService;constructor(e,n){super(e),this.documentInputService=n}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 zc.Ik().shape({header:this.documentInputService.documentInputSchemaNotRequired(),picture:this.documentInputService.documentInputSchemaNotRequired(),signature:zc.Yj(),name:zc.Yj().required(this.t("le_label_est_re_86986")),fromEmail:zc.Yj().required(this.t("l_e_mail_de_l_56279")),fromName:zc.Yj().required(this.t("le_nom_de_l_me_01331")),replyTo:zc.Yj()})}createUpdateEmailSenderSchema(){return zc.Ik().shape({emailSender:this.emailSenderInputSchema()})}};e4=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di,wC])],e4);const n4=e=>{const{history:n,translate:t,params:{organizationId:s}}=Kl(),{showNotification:o}=AS(),a=ki(e4),r=(0,V.useRef)(null),[d,l]=(0,V.useState)(e.initialValues.emailSender.isOrganizationDefault||Yo(e.initialValues.emailSender.eventsIds)),[c,u]=(0,V.useState)(e.initialValues.emailSender.eventsIds.concat(e.initialValues.emailSender.isOrganizationDefault?["community"]:[]));return(0,i.jsx)(xc,{customErrorRef:r,height:1,initialValues:e.initialValues,render:({handleSubmit:n,submitting:o,values:a})=>{return(0,i.jsx)(Hx,{button:e.isEdit&&(0,i.jsx)(tc,{isLoading:o,onClick:n,children:t("mettre_jour_l_14264")}),category:t("_metteur_d_e_ma_51878"),fallbackClosePath:yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s),heading:e.isEdit?(m=e.initialValues.emailSender,g(m.fromName)?`${m.fromName} (${m.fromEmail})`:m.fromEmail):t("nouvel_metteur_58381"),children:(0,i.jsxs)(Gx,{ref:r,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{heading:t("informations_su_10889"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)($c,{label:"Label",name:"emailSender.name"}),(0,i.jsx)($c,{hint:t("les_e_mails_ser_70662"),label:t("nom_de_l_mette_49412"),name:"emailSender.fromName"}),(0,i.jsx)($c,{hint:t("les_e_mails_ser_62925"),isEmail:!0,label:t("e_mail_de_l_me_98374"),name:"emailSender.fromEmail"}),(0,i.jsx)($c,{hint:t("cette_adresse_r_36038",a.emailSender.fromEmail),isEmail:!0,label:(0,i.jsx)(Uv,{children:t("adresse_de_r_po_86181")}),name:"emailSender.replyTo"}),(0,i.jsx)(PC,{accept:gv.Images,acl:"public-read",hint:t("chaque_e_mail_c_30386"),label:t("en_t_te_11987"),organizationId:s,prefix:"emailSender.header."}),(0,i.jsx)(BC,{label:t("photo_de_profil_08618"),organizationId:s,prefix:"emailSender.picture."}),(0,i.jsx)(iS,{label:t("signature_67521"),name:"emailSender.signature"}),(0,i.jsx)(PC,{accept:gv.Images,acl:"public-read",hint:t("chaque_e_mail_c_65078"),label:t("bas_de_page_86491"),organizationId:s,prefix:"emailSender.footer."}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(om,{state:d?"checked":"unchecked",onClick:e=>{l("checked"===e)},children:t("utiliser_cet_m_47949")}),d&&(0,i.jsxs)(Tl,{children:[(0,i.jsx)(Pl,{width:"6"}),(0,i.jsxs)(_m,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:c,onChange:u,children:[(0,i.jsx)("option",{value:"community",children:t("communaut_20896")}),e.events.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]})]})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:o,textAlign:"center",onClick:n,children:e.isEdit?t("mettre_jour_l_14264"):t("cr_er_l_metteu_36451")})})]})});var m},schema:a.createUpdateEmailSenderSchema(),width:1,onSubmit:async i=>{const a={...i.emailSender,eventsIds:c.filter(e=>"community"!==e),isOrganizationDefault:c.includes("community")};await e.mutate(a),o(e.isEdit?t("l_metteur_a_t_48335"):t("l_metteur_a_t_67653")),n.push(yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))}})},t4=()=>{const{params:{organizationId:e}}=Kl(),{data:n,loader:t}=ka({organizationId:e}),s=ki(e4),{mutate:o}=function(e={}){return Ui("mutation EmailSenderCreate($organizationId: OrganizationId!, $emailSender: EmailsSenderInput!) {\n emailSenderCreate(organizationId: $organizationId, emailSender: $emailSender) {\n id\n }\n}\n",e)}();return t||(0,i.jsx)(n4,{events:n.organization.events.nodes,initialValues:{emailSender:s.emailSenderInputDefault()},isEdit:!1,mutate:n=>o({organizationId:e,emailSender:n})})},i4=()=>{const{params:{organizationId:e,emailSenderId:n}}=Kl(),t=ki(e4),{data:s,loader:o}=Li("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:n},[]),{mutate:a}=function(e={}){return Ui("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)(n4,{events:s.organization.events.nodes,initialValues:{emailSender:t.emailSenderInputDefault(s.organization.emailSender)},isEdit:!0,mutate:t=>a({organizationId:e,emailSenderId:n,emailSender:t})})},s4=()=>{const{translate:e,params:{organizationId:n,emailSenderId:t}}=Kl(),{data:s,loader:o}=Li("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:n,emailSenderId:t},[]),a=(0,V.useMemo)(()=>s.organization?s.organization.emailSender.from:"-",[s.organization]);return(0,i.jsx)(Hx,{category:e("aper_u_d_un_me_46930"),fallbackClosePath:yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),heading:a,children:o||(0,i.jsx)(Mr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsx)(By,{content:s.organization.emailSender.preview,from:s.organization.emailSender.from,subject:e("e_mail_test_me_23293")})})})};let o4=class extends Rc{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",usersInfosIds:(e?.members??[]).map(({id:e})=>e),eventsAccesses:(e?.accesses??[]).filter(e=>e.scope===Un.Event&&e.eventId).map(e=>({eventId:e.eventId,roleId:e.roleId})),isWeezaccessSynchronized:e?.isWeezaccessSynchronized??!1}}eventAccessDefault(){return{eventId:null,roleId:null}}schema(){return zc.Ik().shape({group:zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_est_requ_61536")),description:zc.Yj(),usersInfosIds:zc.YO().of(zc.ai()).required(),eventsAccesses:zc.YO().of(zc.Ik().shape({eventId:zc.ai().nullable().required(this.t("vous_devez_s_le_61092")),roleId:zc.ai().nullable().required(this.t("vous_devez_s_le_18837"))})).required(),isWeezaccessSynchronized:zc.zM()}).required()}).required()}};o4=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],o4);const a4=e=>{const{history:n,translate:t,params:{organizationId:s}}=Kl(),o=ki(o4),{organization:a}=XS(),r=(0,V.useMemo)(()=>(0,Lm.A)(a.events.nodes,e=>u(e.name)),[a.events]),d=(0,V.useCallback)(n=>{const t=e.eventsAccesses.filter((e,t)=>t!==n&&e.eventId).map(({eventId:e})=>e);return r.filter(e=>!t.includes(e.id)).map(e=>(0,i.jsx)("option",{value:e.id,children:`${e.name} (${e.id})`},e.id))},[r,e.eventsAccesses]),l=(0,V.useMemo)(()=>(0,Lm.A)(a.roles.filter(e=>e.accessLevel===Un.Event),e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[a.roles]);return 0===l.length?(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:t("vous_n_avez_pas_57236")}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",children:t("pour_donner_acc_85410")}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(tc,{color:"white",onClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_ROLES(s))},children:t("cr_er_un_r_le_99947")})]}):(0,i.jsxs)(Tl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.eventsAccesses.map((n,s)=>(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("acc_s_n_1_17158",s+1)}),(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(of,{isSearchVisible:!0,label:t("_v_nement_22345"),menuWidth:1042,name:`group.eventsAccesses[${s}].eventId`,renderOnPortal:!0,shouldParseAsInt:!0,children:d(s)})}),(0,i.jsx)(Mr,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(Yl,{icon:"arrow-right"})}),(0,i.jsx)(Mr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(of,{label:t("r_le_59302"),name:`group.eventsAccesses[${s}].roleId`,renderOnPortal:!0,shouldParseAsInt:!0,children:l})}),(0,i.jsx)(Mr,{css:{paddingTop:"$6"},children:(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("group.eventsAccesses",Jo(e.eventsAccesses,s))}})})]})]},s)),(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change("group.eventsAccesses",e.eventsAccesses.concat([o.eventAccessDefault()]))},children:t("ajouter_un_v_n_49943")})})]})},r4=e=>{const{translate:n,params:{organizationId:t}}=Kl(),[s,o,a]=Wm(""),{usersInfosOptions:r,isLoading:d}=my({organizationId:t,eventId:null,hasSelected:Yo(e.usersInfosIds),nameDebounced:o,userInfoIds:e.usersInfosIds});return(0,i.jsx)(of,{isSearchLoading:d,isSearchVisible:!0,label:n("s_lectionnez_le_38252"),multiple:!0,name:"group.usersInfosIds",placeholder:n("ajouter_des_mem_15816"),searchElement:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_05904"),state:"search",value:s,onChange:a}),children:r})},d4=e=>{const{history:n,params:{organizationId:t},translate:s}=Kl(),{showNotification:o}=AS(),{organization:a}=XS(),r=ki(o4),d=(0,V.useRef)(null),l=(0,V.useMemo)(()=>e.isEdit?s("mise_jour_de_17055",e.initialValues.group.name):s("cr_ation_d_un_g_97053"),[e.isEdit,e.initialValues]);return Au(l),(0,i.jsx)(xc,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:o,submitting:r,values:c})=>(0,i.jsx)(Hx,{button:e.isEdit?(0,i.jsx)(tc,{isLoading:r,onClick:o,children:s("mettre_jour_l_46926")}):null,category:l,color:"dark",fallbackClosePath:yo.ORGANIZATION_PARAMETERS_GROUPS(t),heading:e.isEdit?e.initialValues.group.name:s("nouveau_groupe_17697"),children:(0,i.jsxs)(Gx,{ref:d,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{heading:s("informations_g_79325"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)($c,{label:s("nom_du_groupe_77088"),name:"group.name"}),(0,i.jsx)(rf,{label:s("Description"),name:"group.description"}),a.weezeventOrganizationId&&(0,i.jsx)(df,{name:"group.isWeezaccessSynchronized",subtext:s("un_op_rateur_we_64020"),children:s("WeezeventIsSynchronized")})]})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:s("membres_11310"),subtitle:s("les_membres_du_17237"),children:(0,i.jsx)(r4,{usersInfosIds:c.group.usersInfosIds})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:s("acc_s_aux_v_ne_33282"),subtitle:s("chaque_membre_d_91767"),children:(0,i.jsx)(a4,{change:n.change,eventsAccesses:c.group.eventsAccesses})}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:r,onClick:o,children:(0,i.jsx)(Mr,{textAlign:"center",children:e.isEdit?s("mettre_jour_l_46926"):s("cr_er_le_groupe_43408")})})})]})}),schema:r.schema(),width:1,onSubmit:async i=>{await e.mutate({group:i.group}),o(e.isEdit?s("le_groupe_a_bie_88132"):s("le_groupe_a_bie_19289")),n.goBack(yo.ORGANIZATION_PARAMETERS_GROUPS(t))}})},l4=()=>{const{params:{organizationId:e}}=Kl(),n=ki(o4),{mutate:t}=function(e={}){return Ui("mutation GroupCreate($organizationId: OrganizationId!, $group: GroupInput!) {\n groupCreate(organizationId: $organizationId, group: $group) {\n id\n }\n}\n",e)}();return(0,i.jsx)(d4,{initialValues:{group:n.default(null)},isEdit:!1,mutate:async({group:n})=>(await t({organizationId:e,group:n})).groupCreate.id})},c4=()=>{const{params:{organizationId:e,groupId:n}}=Kl(),t=ki(o4),{data:s,loader:o}=Li("query Group($organizationId: OrganizationId!, $groupId: GroupId!) {\n organization(id: $organizationId) {\n group(id: $groupId) {\n id\n name\n description\n isWeezaccessSynchronized\n\n members {\n id\n }\n\n accesses {\n scope\n eventId\n roleId\n }\n }\n }\n}\n",{organizationId:e,groupId:n},[]),{mutate:a}=function(e={}){return Ui("mutation GroupUpdate($organizationId: OrganizationId!, $groupId: GroupId!, $group: GroupInput!) {\n groupUpdate(organizationId: $organizationId, groupId: $groupId, group: $group) {\n id\n }\n}\n",e)}();return o||(0,i.jsx)(d4,{initialValues:{group:t.default(s.organization.group)},isEdit:!0,mutate:async({group:t})=>(await a({organizationId:e,groupId:n,group:t})).groupUpdate.id})},u4=br("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),m4=br("button",{background:"none",border:"none",color:"$error700",fontWeight:"$semiBold"}),g4=()=>{const{organizationId:e}=Vi(),n=Bi(),{mutate:t}=qd(),s=Fi(),o=()=>{n.push(yo.ORGANIZATION_PARAMETERS(e))};return(0,i.jsx)(w0,{onClose:o,children:(0,i.jsxs)(Tl,{align:"center",direction:"column",children:[(0,i.jsx)(nb,{color:"error",icon:"user-slash"}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(u4,{children:s("suppression_de_67160")}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:s("souhaitez_vous_30775")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(tc,{onClick:o,children:s("non_je_ne_souh_99960")}),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(m4,{onClick:async()=>{await t({}),J()},children:s("oui_je_souhait_87268")})]})})},h4=({icon:e,children:n,onClick:t})=>(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray800",fontWeight:"$medium"},gap:"5",onClick:t,children:[(0,i.jsx)(Yl,{icon:e}),(0,i.jsx)("span",{children:n})]}),p4=br(Tl,{background:"$white",borderRadius:"$2",boxShadow:"$sm",gap:"$6",padding:"$4 $3"}),I4=br("h3",{color:"$gray500",fontSize:"$textSm",margin:0}),x4=br(Tl,{backgroundColor:"$gray50",padding:"$6 $3",height:"100%"}),f4=br("h1",{color:"$gray800",fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),_4=({organization:e,user:n})=>{const{history:t,translate:s}=Kl();return(0,i.jsxs)(x4,{direction:"column",gap:"6",children:[(0,i.jsx)(f4,{children:s("profil_14444")}),(0,i.jsxs)(Tl,{align:"center",gap:"4",children:[(0,i.jsx)(t_,{email:n.email,image:n.userInfo.picture?.url,name:n.userInfo.name,size:64}),(0,i.jsx)(H1,{size:64,userInfo:{email:n.email,...n.userInfo}})]}),(0,i.jsx)(p4,{direction:"column",children:(0,i.jsxs)(Tl,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Mr,{css:{color:"$gray800",fontWeight:"$medium"},children:e.name}),(0,i.jsx)(tc,{onClick:()=>{t.push(yo.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(e.id))},children:s("changer_74000")})]})}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(I4,{children:s("profil_14444")}),(0,i.jsx)(p4,{direction:"column",children:(0,i.jsx)(h4,{icon:"user-gear",onClick:()=>{t.push(yo.ORGANIZATION_PARAMETERS_PROFILE(e.id))},children:s("informations_pe_37892")})})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"2",children:[(0,i.jsx)(I4,{children:s("g_n_ral_64953")}),(0,i.jsxs)(p4,{direction:"column",children:[(0,i.jsx)(h4,{icon:"shield",onClick:()=>{window.open(gu(cu(n?.language,new URL(location.href).searchParams)),"_blank")},children:s("cgu_51460")}),(0,i.jsx)(h4,{icon:"circle-question",onClick:()=>{window.open(`https://support.${F.WEEZEVENT_DOMAIN}/fr/weezcrew`,"_blank")},children:s("aide_et_support_49790")})]})]}),(0,i.jsxs)(p4,{direction:"column",children:[(0,i.jsx)(h4,{icon:"arrow-left-from-line",onClick:J,children:s("se_d_connecter_74151")}),(0,i.jsx)(h4,{icon:"user-xmark",onClick:()=>{t.push(yo.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(e.id))},children:s("supprimer_mon_c_07051")})]})]})},j4=({organizations:e})=>{const{organizationId:n}=Vi(),[t,s]=(0,V.useState)(n),o=Fi(),a=Bi();return(0,i.jsxs)(Tl,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Tl,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(Gz,{state:e.id===t?"checked":"unchecked",onClick:()=>s(e.id),children:e.name},e.id))}),(0,i.jsx)(Pl,{height:7}),(0,i.jsx)(tc,{onClick:()=>{a.push(yo.ORGANIZATION_PARAMETERS(t))},children:o("s_lectionner_l_18914")})]})},v4=br("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),S4=()=>{const{loader:e,data:n}=Vd({}),{organization:t}=XS(),s=Fi(),o=Bi();return(0,i.jsxs)(w0,{onClose:()=>{o.push(yo.ORGANIZATION_PARAMETERS(t.id))},children:[(0,i.jsx)(v4,{children:s("liste_de_vos_or_87919")}),e||(0,i.jsx)(j4,{organizations:n.organizations})]})},y4=({inputName:e})=>{const n=Fi(),t=Um();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{css:{gap:"$6","@tablet":{gap:"$4","> *":{flexGrow:1,width:"auto"}}},wrap:"wrap",children:[(0,i.jsx)($c,{autoComplete:"given-name",label:n("pr_nom_66988"),name:`${e}fields.firstName`}),(0,i.jsx)($c,{autoComplete:"family-name",label:n("last_name"),name:`${e}fields.lastName`})]}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)($c,{autoComplete:"email",isEmail:!0,label:n("e_mail_13869"),name:`${e}email`}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(ny,{autoComplete:"language",label:n("Language"),name:`${e}fields.language`,children:t(ru)}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(tj,{label:n("Phone"),prefix:`${e}fields.phone.`})]})},C4=br(Tl,{backgroundColor:"$gray900",height:"110px",marginBottom:"$11","> *":{transform:"translateY(50%)",boxShadow:"$md"}}),b4=()=>{const{user:e}=XS();return(0,i.jsx)(C4,{align:"end",justify:"center",children:(0,i.jsx)(t_,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:96})})},A4=()=>{const{organizationId:e}=Vi(),{data:n,loader:t}=Za({organizationId:e}),s=ki(AR),o=ki(Ol),{user:a}=Yi(),{mutate:r,isLoading:d}=Ka(),l=Fi();return t||(0,i.jsx)(xc,{initialValues:{userInfo:s.userInfoProfileInputDefault(n.user)},render:({handleSubmit:e})=>(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(b4,{}),(0,i.jsxs)(D0,{children:[(0,i.jsx)(y4,{inputName:"userInfo."}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(tc,{isLoading:d,textAlign:"center",onClick:e,children:l("enregistrer_06519")})]})]}),validate:o.validateForForm(s.updateProfileSchema()),onSubmit:async e=>{const{userProfileUpdate:{email:t,language:i}}=await r({userId:a.id,userInfoId:n.user.userInfo.id,userInfo:e.userInfo});a.email!==t?J():a.language!==i&&location.reload()}})},E4=br("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),w4=()=>{const{organizationId:e}=Vi(),n=Bi(),t=Fi();return(0,i.jsxs)(k0,{children:[(0,i.jsx)(P0,{back:()=>{n.push(yo.ORGANIZATION_PARAMETERS(e))},children:(0,i.jsx)(x1,{children:(0,i.jsx)(E4,{children:t("informations_pe_37892")})})}),(0,i.jsx)(A4,{})]})},$4=()=>{const{organization:e,user:n}=XS();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:yo.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(w4,{})}),Yo(e.events.nodes)&&(0,i.jsx)(kr.qh,{children:(0,i.jsx)(I0,{eventId:e.events.nodes[0].id,user:n,children:(0,i.jsx)(_4,{organization:e,user:n})})})]}),(0,i.jsx)(kr.dO,{children:(0,i.jsx)(kr.qh,{path:yo.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(":organizationId"),children:(0,i.jsx)(S4,{})})}),(0,i.jsx)(kr.dO,{children:(0,i.jsx)(kr.qh,{path:yo.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(":organizationId"),children:(0,i.jsx)(g4,{})})})]})};var T4,z4;!function(e){e.AccreditationCategoryCreate="AccreditationCategoryCreate",e.AccreditationCategoryDelete="AccreditationCategoryDelete",e.AccreditationCategoryDuplicate="AccreditationCategoryDuplicate",e.AccreditationCategoryUpdate="AccreditationCategoryUpdate",e.AccreditationCreate="AccreditationCreate",e.AccreditationDuplicate="AccreditationDuplicate",e.AccreditationProfileCategoryCreate="AccreditationProfileCategoryCreate",e.AccreditationProfileCategoryDelete="AccreditationProfileCategoryDelete",e.AccreditationProfileCategoryDuplicate="AccreditationProfileCategoryDuplicate",e.AccreditationProfileCategoryUpdate="AccreditationProfileCategoryUpdate",e.AccreditationProfileCreate="AccreditationProfileCreate",e.AccreditationProfileDuplicate="AccreditationProfileDuplicate",e.AccreditationProfileUpdate="AccreditationProfileUpdate",e.AccreditationSlotDelete="AccreditationSlotDelete",e.AccreditationSlotUpdate="AccreditationSlotUpdate",e.AccreditationUpdate="AccreditationUpdate",e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsExport="AccreditationsExport",e.AccreditationsImport="AccreditationsImport",e.AccreditationsImportResult="AccreditationsImportResult",e.AccreditationsMassDelete="AccreditationsMassDelete",e.AccreditationsMassEdit="AccreditationsMassEdit",e.AccreditationsProfilesImport="AccreditationsProfilesImport",e.AccreditationsProfilesImportResult="AccreditationsProfilesImportResult",e.AccreditationsProfilesMassAccreditationsEdit="AccreditationsProfilesMassAccreditationsEdit",e.AccreditationsProfilesMassDelete="AccreditationsProfilesMassDelete",e.AccreditationsProfilesMassEdit="AccreditationsProfilesMassEdit",e.AccreditationsSlotsUsersInfosCheckIn="AccreditationsSlotsUsersInfosCheckIn",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeInvoiceMarkAsWrittenOff="BackofficeInvoiceMarkAsWrittenOff",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignCreate="CampaignCreate",e.CampaignDelete="CampaignDelete",e.CampaignDuplicate="CampaignDuplicate",e.CampaignEstimate="CampaignEstimate",e.CampaignSend="CampaignSend",e.CampaignUpdate="CampaignUpdate",e.CommentCreate="CommentCreate",e.CommentDelete="CommentDelete",e.CommentUpdate="CommentUpdate",e.CreateEvent="CreateEvent",e.CustomDocumentCreate="CustomDocumentCreate",e.CustomDocumentDelete="CustomDocumentDelete",e.CustomDocumentDuplicate="CustomDocumentDuplicate",e.CustomDocumentUpdate="CustomDocumentUpdate",e.CustomFieldCategoryCreate="CustomFieldCategoryCreate",e.CustomFieldCategoryDelete="CustomFieldCategoryDelete",e.CustomFieldCategoryUpdate="CustomFieldCategoryUpdate",e.CustomFieldCreate="CustomFieldCreate",e.CustomFieldUpdate="CustomFieldUpdate",e.CustomFieldsMassDelete="CustomFieldsMassDelete",e.CustomFieldsMassDuplicate="CustomFieldsMassDuplicate",e.CustomFieldsMassEdit="CustomFieldsMassEdit",e.DelegationCategoryCreate="DelegationCategoryCreate",e.DelegationCategoryDelete="DelegationCategoryDelete",e.DelegationCategoryDuplicate="DelegationCategoryDuplicate",e.DelegationCategoryUpdate="DelegationCategoryUpdate",e.DelegationCreate="DelegationCreate",e.DelegationDuplicate="DelegationDuplicate",e.DelegationFormInvite="DelegationFormInvite",e.DelegationUpdate="DelegationUpdate",e.DelegationUpdateFields="DelegationUpdateFields",e.DelegationsCategoriesMassLeadersEdit="DelegationsCategoriesMassLeadersEdit",e.DelegationsExport="DelegationsExport",e.DelegationsImport="DelegationsImport",e.DelegationsImportResult="DelegationsImportResult",e.DelegationsMassAccreditationsProfilesEdit="DelegationsMassAccreditationsProfilesEdit",e.DelegationsMassAccreditationsSlotsEdit="DelegationsMassAccreditationsSlotsEdit",e.DelegationsMassDelete="DelegationsMassDelete",e.DelegationsMassEdit="DelegationsMassEdit",e.DelegationsMassLeadersEdit="DelegationsMassLeadersEdit",e.DelegationsMassLeadersEmailSend="DelegationsMassLeadersEmailSend",e.DelegationsMassMove="DelegationsMassMove",e.DelegationsSpaceLayoutCreate="DelegationsSpaceLayoutCreate",e.DelegationsSpaceLayoutDelete="DelegationsSpaceLayoutDelete",e.DelegationsSpaceLayoutDuplicate="DelegationsSpaceLayoutDuplicate",e.DelegationsSpaceLayoutUpdate="DelegationsSpaceLayoutUpdate",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderCreate="EmailSenderCreate",e.EmailSenderDelete="EmailSenderDelete",e.EmailSenderDuplicate="EmailSenderDuplicate",e.EmailSenderUpdate="EmailSenderUpdate",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EmailTemplateUpdate="EmailTemplateUpdate",e.EmailUpdate="EmailUpdate",e.EventDocumentUpdate="EventDocumentUpdate",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventDuplicate="EventDuplicate",e.EventInvite="EventInvite",e.EventLayerUpdate="EventLayerUpdate",e.EventOrganizationCreate="EventOrganizationCreate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventSpaceDesignUpdate="EventSpaceDesignUpdate",e.EventUpdate="EventUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.EventsImport="EventsImport",e.EventsImportResult="EventsImportResult",e.EventsMassArchive="EventsMassArchive",e.EventsMassEdit="EventsMassEdit",e.ExportResult="ExportResult",e.FilesImport="FilesImport",e.FilesImportResult="FilesImportResult",e.FormCreate="FormCreate",e.FormDelete="FormDelete",e.FormDuplicate="FormDuplicate",e.FormElementsUpdate="FormElementsUpdate",e.FormParametersAccreditationsUpdate="FormParametersAccreditationsUpdate",e.FormParametersAvailabilitiesUpdate="FormParametersAvailabilitiesUpdate",e.FormParametersBroadcastUpdate="FormParametersBroadcastUpdate",e.FormParametersDesignUpdate="FormParametersDesignUpdate",e.FormParametersGeneralUpdate="FormParametersGeneralUpdate",e.FormParametersMissionsUpdate="FormParametersMissionsUpdate",e.FormParametersStateUpdate="FormParametersStateUpdate",e.FormRegister="FormRegister",e.GroupCreate="GroupCreate",e.GroupDelete="GroupDelete",e.GroupMemberDelete="GroupMemberDelete",e.GroupUpdate="GroupUpdate",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationCreate="OrganizationCreate",e.OrganizationDelegationSpaceSettingsUpdate="OrganizationDelegationSpaceSettingsUpdate",e.OrganizationEventsShowcaseSettingsUpdate="OrganizationEventsShowcaseSettingsUpdate",e.OrganizationInvite="OrganizationInvite",e.OrganizationInviteGroups="OrganizationInviteGroups",e.OrganizationMembersSpaceSettingsUpdate="OrganizationMembersSpaceSettingsUpdate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.OrganizationSpaceDesignUpdate="OrganizationSpaceDesignUpdate",e.OrganizationUpdateInfos="OrganizationUpdateInfos",e.PositionCategoryCreate="PositionCategoryCreate",e.PositionCategoryDelete="PositionCategoryDelete",e.PositionCategoryDescriptionUpdate="PositionCategoryDescriptionUpdate",e.PositionCategoryDuplicate="PositionCategoryDuplicate",e.PositionCategoryUpdate="PositionCategoryUpdate",e.PositionCreate="PositionCreate",e.PositionDuplicate="PositionDuplicate",e.PositionSlotCreate="PositionSlotCreate",e.PositionSlotDelete="PositionSlotDelete",e.PositionSlotUpdate="PositionSlotUpdate",e.PositionUpdate="PositionUpdate",e.PositionsCategoriesMassLeadersEdit="PositionsCategoriesMassLeadersEdit",e.PositionsCreate="PositionsCreate",e.PositionsExport="PositionsExport",e.PositionsImport="PositionsImport",e.PositionsImportResult="PositionsImportResult",e.PositionsMassConditions="PositionsMassConditions",e.PositionsMassDelete="PositionsMassDelete",e.PositionsMassEdit="PositionsMassEdit",e.PositionsMassLeadersEdit="PositionsMassLeadersEdit",e.PositionsSlotsMassEdit="PositionsSlotsMassEdit",e.PositionsSlotsUsersInfosCheckIn="PositionsSlotsUsersInfosCheckIn",e.PrintTriggerCreate="PrintTriggerCreate",e.PrintTriggerDelete="PrintTriggerDelete",e.PrintTriggerUpdate="PrintTriggerUpdate",e.RoleCreate="RoleCreate",e.RoleDelete="RoleDelete",e.RoleDuplicate="RoleDuplicate",e.RoleUpdate="RoleUpdate",e.SegmentCreate="SegmentCreate",e.SegmentDelete="SegmentDelete",e.SegmentDuplicate="SegmentDuplicate",e.SegmentFolderCreate="SegmentFolderCreate",e.SegmentFolderDelete="SegmentFolderDelete",e.SegmentFolderDuplicate="SegmentFolderDuplicate",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentFolderUpdateName="SegmentFolderUpdateName",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveFolder="SegmentMoveFolder",e.SegmentMoveUp="SegmentMoveUp",e.SegmentUpdate="SegmentUpdate",e.SegmentUpdateMetadata="SegmentUpdateMetadata",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SendAccreditationsEmails="SendAccreditationsEmails",e.SendAssignmentsEmails="SendAssignmentsEmails",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataConnectionInfosDelete="SkidataConnectionInfosDelete",e.SkidataConnectionInfosUpsert="SkidataConnectionInfosUpsert",e.SkidataSynchronize="SkidataSynchronize",e.TagCreate="TagCreate",e.TagDelete="TagDelete",e.TagUpdateName="TagUpdateName",e.TeamAssign="TeamAssign",e.TeamAssignmentRefuse="TeamAssignmentRefuse",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TextMessageSend="TextMessageSend",e.TraceCreate="TraceCreate",e.TraceDelete="TraceDelete",e.TraceUpdate="TraceUpdate",e.TranslationUpdate="TranslationUpdate",e.UserAccessDelete="UserAccessDelete",e.UserAccessMassCreate="UserAccessMassCreate",e.UserAccessUpdate="UserAccessUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAccreditationsUpdate="UserInfoAccreditationsUpdate",e.UserInfoAdminCreate="UserInfoAdminCreate",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UserInfoPositionsUpdate="UserInfoPositionsUpdate",e.UserInfoSlotsUpdate="UserInfoSlotsUpdate",e.UserInfoUpdate="UserInfoUpdate",e.UserInfoUpdateField="UserInfoUpdateField",e.UserProfileUpdate="UserProfileUpdate",e.UserRolesDelete="UserRolesDelete",e.UsersInfosExport="UsersInfosExport",e.UsersInfosMassAddEvent="UsersInfosMassAddEvent",e.UsersInfosMassCampaignSend="UsersInfosMassCampaignSend",e.UsersInfosMassDelegationAdd="UsersInfosMassDelegationAdd",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UsersInfosMassDelete="UsersInfosMassDelete",e.UsersInfosMassEdit="UsersInfosMassEdit",e.UsersInfosMassFormAdd="UsersInfosMassFormAdd",e.UsersInfosMassFormRemove="UsersInfosMassFormRemove",e.UsersInfosMerge="UsersInfosMerge",e.VolunteerRegistrationAssignmentRefuse="VolunteerRegistrationAssignmentRefuse",e.VolunteerRegistrationCustomDocumentPrint="VolunteerRegistrationCustomDocumentPrint",e.VolunteerRegistrationUpdate="VolunteerRegistrationUpdate",e.VolunteerRegistrationUpdateField="VolunteerRegistrationUpdateField",e.VolunteersCriblageExport="VolunteersCriblageExport",e.VolunteersExport="VolunteersExport",e.VolunteersImport="VolunteersImport",e.VolunteersImportResult="VolunteersImportResult",e.VolunteersRegistrationsAccreditationsValidate="VolunteersRegistrationsAccreditationsValidate",e.VolunteersRegistrationsAdminAdd="VolunteersRegistrationsAdminAdd",e.VolunteersRegistrationsMassAccredit="VolunteersRegistrationsMassAccredit",e.VolunteersRegistrationsMassAccreditationProfileUpdate="VolunteersRegistrationsMassAccreditationProfileUpdate",e.VolunteersRegistrationsMassAccreditationStateUpdate="VolunteersRegistrationsMassAccreditationStateUpdate",e.VolunteersRegistrationsMassAssign="VolunteersRegistrationsMassAssign",e.VolunteersRegistrationsMassAvailabilitiesUpdate="VolunteersRegistrationsMassAvailabilitiesUpdate",e.VolunteersRegistrationsMassDelegationAdd="VolunteersRegistrationsMassDelegationAdd",e.VolunteersRegistrationsMassDelete="VolunteersRegistrationsMassDelete",e.VolunteersRegistrationsMassDuplicate="VolunteersRegistrationsMassDuplicate",e.VolunteersRegistrationsMassFormAdd="VolunteersRegistrationsMassFormAdd",e.VolunteersRegistrationsMassFormRemove="VolunteersRegistrationsMassFormRemove",e.VolunteersRegistrationsMassPreAssign="VolunteersRegistrationsMassPreAssign",e.VolunteersRegistrationsMassPrint="VolunteersRegistrationsMassPrint",e.VolunteersRegistrationsMassStateUpdate="VolunteersRegistrationsMassStateUpdate",e.VolunteersRegistrationsMassTicketIdRegenerate="VolunteersRegistrationsMassTicketIdRegenerate",e.VolunteersRegistrationsMassWishedAccreditationsUpdate="VolunteersRegistrationsMassWishedAccreditationsUpdate",e.VolunteersRegistrationsMassWishedProfileUpdate="VolunteersRegistrationsMassWishedProfileUpdate",e.WorkflowCreate="WorkflowCreate",e.WorkflowDuplicate="WorkflowDuplicate",e.WorkflowUpdate="WorkflowUpdate",e.WorkflowsMassEdit="WorkflowsMassEdit",e.WorkflowsMassExecute="WorkflowsMassExecute",e.WorkflowssMassDelete="WorkflowssMassDelete"}(T4||(T4={})),function(e){e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsProfilesImportResult="AccreditationsProfilesImportResult",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeInvoiceMarkAsWrittenOff="BackofficeInvoiceMarkAsWrittenOff",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignEstimate="CampaignEstimate",e.DelegationsExport="DelegationsExport",e.DelegationsImportResult="DelegationsImportResult",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventLayerUpdate="EventLayerUpdate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.ExportResult="ExportResult",e.FormRegister="FormRegister",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.PositionsImportResult="PositionsImportResult",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveUp="SegmentMoveUp",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataSynchronize="SkidataSynchronize",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TranslationUpdate="TranslationUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UserProfileUpdate="UserProfileUpdate",e.UsersInfosExport="UsersInfosExport",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.VolunteersCriblageExport="VolunteersCriblageExport",e.VolunteersExport="VolunteersExport",e.VolunteersImportResult="VolunteersImportResult"}(z4||(z4={}));const O4=e=>{const n=ki(Jm);return(0,i.jsxs)(km,{children:[(0,i.jsxs)($m,{align:"center",gap:"3",children:[(0,i.jsx)(Tl,{align:"center",css:{background:"$primary300",borderRadius:"32px",color:"$primary600",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(Yl,{icon:e.activity.icon})}),(0,i.jsx)(Mr,{font:"gray900 textSm medium",children:e.activity.text})]}),(0,i.jsx)($m,{children:n.toLocaleString(e.activity.date.toLocal(),Uo.DateTime)})]})},R4=()=>{const{translate:e,params:{organizationId:n}}=Kl(),[t,s]=(0,V.useState)([]),[o,a]=(0,V.useState)([]),[r,d]=(0,V.useState)(Oo.c9.invalid("Invalid")),[l,c]=(0,V.useState)(0),{data:u,isLoading:m}=Li("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:n,operations:t,eventsIds:o,date:r,offset:l},[]),{numberOfPages:g,totalCount:h}=Sx(u.organization?.activities),p=(0,V.useMemo)(()=>{const n=Object.keys(z4);return Object.keys(T4).filter(e=>!n.includes(e)).map(n=>(0,i.jsx)("option",{value:n,children:e(n)},n))},[]);return(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(by,{children:(0,i.jsx)(Mr,{font:"gray900 displayXs semiBold",children:e("activit_95747")})}),(0,i.jsx)(yy,{children:(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:e("op_ration_25453"),values:t,onChange:s,children:p})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:e("_v_nement_22345"),values:o,onChange:a,children:(u.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Mr,{width:200,children:(0,i.jsx)(Wp,{value:r,onChange:d})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("Description")}),(0,i.jsx)(Gm,{children:e("Date")})]}),numberOfPages:g,offset:l,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):u.organization.activities.nodes.map((e,n)=>(0,i.jsx)(O4,{activity:e},n)),setOffset:c,totalCount:h})})]})},D4=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{s(!0)},children:n("renommer_42135")}),(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{a(!0)},children:n("supprimer_43083")})]}),t&&(0,i.jsx)(pU,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(_W,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{a(!1)},onSuccess:e.reload})]})},M4=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canOrganizationParamEdit:t}=ay(),[s,o,a]=Wm(""),[r,d]=(0,V.useState)(-1),[l,c]=(0,V.useState)(0),{data:m,isLoading:h,reload:p}=Li("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:n,name:g(o)?o:void 0,eventId:-1!==r?r:void 0,offset:l},[]);const{numberOfPages:I,totalCount:x}=Sx(m.organization?.accreditationsCategories),f=(0,V.useMemo)(()=>(0,Lm.A)(m.organization?.events.nodes??[],e=>u(e.name)),[m.organization]),_=(0,V.useMemo)(()=>Object.fromEntries(f.map(e=>[e.id,e.name])),[f]);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(_m,{isSearchVisible:!0,menuWidth:300,values:[r],onChange:e=>{Yo(e)&&d(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),f.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gm,{children:e("_v_nement_22345")}),(0,i.jsx)(Gm,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Gm,{width:100})]}),numberOfPages:I,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):m.organization.accreditationsCategories.nodes.map(e=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xm,{to:Ws.ACCREDITATION_CATEGORY({organizationId:n,eventId:e.eventId,accreditationCategoryId:e.id}),children:e.name})}),(0,i.jsx)($m,{children:_[e.eventId]??""}),(0,i.jsx)($m,{children:e.numberOfAccreditations}),t&&(0,i.jsx)(Qm,{justify:"center",children:(0,i.jsx)(D4,{accreditationCategory:e,reload:p})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:x})},P4=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>s(!0),children:n("renommer_42135")}),(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>a(!0),children:n("supprimer_43083")})]}),t&&(0,i.jsx)(MW,{accreditationProfileCategory:e.accreditationProfileCategory,eventId:e.accreditationProfileCategory.eventId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(fG,{accreditationProfileCategory:e.accreditationProfileCategory,eventId:e.accreditationProfileCategory.eventId,onClose:()=>a(!1),onSuccess:e.reload})]})},k4=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canOrganizationParamEdit:t}=ay(),[s,o,a]=Wm(""),[r,d]=(0,V.useState)(-1),[l,c]=(0,V.useState)(0),{data:m,isLoading:h,reload:p}=Li("query OrganizationCategoriesAccreditationsProfiles(\n $organizationId: OrganizationId!\n $name: String\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n accreditationsProfilesCategories(\n name: $name\n eventId: $eventId\n offset: $offset\n limit: 25\n ) {\n nodes {\n id\n eventId\n name\n numberOfAccreditationsProfiles\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:n,name:g(o)?o:void 0,eventId:-1!==r?r:void 0,offset:l},[]);const{numberOfPages:I,totalCount:x}=Sx(m.organization?.accreditationsProfilesCategories),f=(0,V.useMemo)(()=>(0,Lm.A)(m.organization?.events.nodes??[],e=>u(e.name)),[m.organization]),_=(0,V.useMemo)(()=>Object.fromEntries(f.map(e=>[e.id,e.name])),[f]);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(_m,{isSearchVisible:!0,menuWidth:300,values:[r],onChange:e=>{Yo(e)&&d(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),f.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gm,{children:e("_v_nement_22345")}),(0,i.jsx)(Gm,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Gm,{width:100})]}),numberOfPages:I,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):m.organization.accreditationsProfilesCategories.nodes.map(e=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:e.name}),(0,i.jsx)($m,{children:_[e.eventId]??""}),(0,i.jsx)($m,{children:e.numberOfAccreditationsProfiles}),t&&(0,i.jsx)(Qm,{justify:"center",children:(0,i.jsx)(P4,{accreditationProfileCategory:e,reload:p})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:x})},F4=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("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)(ow,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954")],text:n("suppression_de_73669",e.customFieldCategory.name),onClose:e.onClose,onDelete:async()=>{await t({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id}),e.onSuccess()}})},N4=e=>{const{mutate:n}=function(e={}){return Ui("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)(zb,{initialName:e.customFieldCategory.name,isEdit:!0,mutate:async t=>(await n({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id,customFieldCategory:{name:t}})).customFieldCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},L4=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{s(!0)},children:n("renommer_42135")}),(0,i.jsx)(Pu,{color:0===e.customFieldCategory.numberOfCustomFields?"red":"disabled",icon:"trash-can",onClick:()=>{a(!0)},children:n("supprimer_43083")})]}),t&&(0,i.jsx)(N4,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(F4,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:e.reload})]})},U4=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canOrganizationParamEdit:t}=ay(),[s,o,a]=Wm(""),[r,d]=(0,V.useState)(0),{data:l,isLoading:c,reload:u}=Li("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:n,name:g(o)?o:void 0,offset:r},[]);const{numberOfPages:m,totalCount:h}=Sx(l.organization?.customFieldsCategories);return(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gm,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Gm,{width:100})]}),numberOfPages:m,offset:r,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):l.organization.customFieldsCategories.nodes.map(e=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:e.name}),(0,i.jsx)($m,{children:e.numberOfCustomFields}),t&&(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsx)(L4,{customFieldCategory:e,organizationId:n,reload:u})})]},e.id)),setOffset:d,title:e("liste_des_cat_g_39450"),totalCount:h})},V4=e=>{const{history:n,translate:t}=Kl(),[s,o]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>n.push(Js.DELEGATION_CATEGORY_UPDATE({organizationId:e.delegationCategory.organizationId,eventId:e.delegationCategory.eventId?e.delegationCategory.eventId:void 0,delegationCategoryId:e.delegationCategory.id})),children:t("renommer_42135")}),(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>o(!0),children:t("supprimer_43083")})]}),s&&(0,i.jsx)(iz,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{o(!1)},onSuccess:e.reload})]})},B4=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canOrganizationParamEdit:t}=ay(),[s,o,a]=Wm(""),[r,d]=(0,V.useState)(-1),[l,c]=(0,V.useState)(0),{data:m,isLoading:h,reload:p}=Li("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:n,name:g(o)?o:void 0,eventId:-1!==r?r:void 0,offset:l},[]);const{numberOfPages:I,totalCount:x}=Sx(m.organization?.delegationsCategories),f=(0,V.useMemo)(()=>(0,Lm.A)(m.organization?.events.nodes??[],e=>u(e.name)),[m.organization]),_=(0,V.useMemo)(()=>Object.fromEntries(f.map(e=>[e.id,e.name])),[f]);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(_m,{isSearchVisible:!0,menuWidth:300,values:[r],onChange:e=>{Yo(e)&&d(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),f.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gm,{children:e("_v_nement_22345")}),(0,i.jsx)(Gm,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Gm,{width:100})]}),numberOfPages:I,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):m.organization.delegationsCategories.nodes.map(s=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xm,{to:Js.DELEGATION_CATEGORY({organizationId:n,eventId:s.eventId,delegationCategoryId:s.id}),children:s.name})}),(0,i.jsx)($m,{children:s.eventId?_[s.eventId]??"":e("communaut_20896")}),(0,i.jsx)($m,{children:s.numberOfDelegations}),t&&(0,i.jsx)(Qm,{justify:"center",children:(0,i.jsx)(V4,{delegationCategory:s,reload:p})})]},s.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:x})},W4=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{s(!0)},children:n("renommer_42135")}),(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{a(!0)},children:n("supprimer_43083")})]}),t&&(0,i.jsx)(kK,{eventId:e.positionCategory.eventId,positionCategoryId:e.positionCategory.id,positionCategoryName:e.positionCategory.name,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(JQ,{eventId:e.positionCategory.eventId,positionCategory:e.positionCategory,onClose:()=>{a(!1)},onSuccess:e.reload})]})},G4=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canOrganizationParamEdit:t}=ay(),[s,o,a]=Wm(""),[r,d]=(0,V.useState)(-1),[l,c]=(0,V.useState)(0),{data:m,isLoading:h,reload:p}=Li("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:n,name:g(o)?o:void 0,eventId:-1!==r?r:void 0,offset:l},[]);const{numberOfPages:I,totalCount:x}=Sx(m.organization?.positionsCategories),f=(0,V.useMemo)(()=>(0,Lm.A)(m.organization?.events.nodes??[],e=>u(e.name)),[m.organization]),_=(0,V.useMemo)(()=>Object.fromEntries(f.map(e=>[e.id,e.name])),[f]);return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{width:200,children:(0,i.jsxs)(_m,{isSearchVisible:!0,menuWidth:300,values:[r],onChange:e=>{Yo(e)&&d(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),f.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gm,{children:e("_v_nement_22345")}),(0,i.jsx)(Gm,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Gm,{width:100})]}),numberOfPages:I,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):m.organization.positionsCategories.nodes.map(e=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xm,{to:oo.POSITION_CATEGORY({organizationId:n,eventId:e.eventId,positionCategoryId:e.id}),children:e.name})}),(0,i.jsx)($m,{children:_[e.eventId]??""}),(0,i.jsx)($m,{children:e.numberOfPositions}),t&&(0,i.jsx)(Qm,{justify:"center",children:(0,i.jsx)(W4,{positionCategory:e,reload:p})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:x})},q4=()=>{const{translate:e,params:{organizationId:n}}=Kl();return(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(by,{css:{padding:"$6 $7 0 $7"},children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(dc,{children:e("cat_gories_24533")}),(0,i.jsxs)(wy,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(Ey,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(n),children:e("champs_de_formu_64126")}),(0,i.jsx)(Ey,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(n),children:e("missions_63972")}),(0,i.jsx)(Ey,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(n),children:e("accr_ditations_39450")}),(0,i.jsx)(Ey,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES(n),children:e("profils_d_accr_27825")}),(0,i.jsx)(Ey,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(n),children:e("d_l_gations_78318")})]})]})}),(0,i.jsx)(yy,{children:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)($y,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(U4,{})}),(0,i.jsx)($y,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(":organizationId"),children:(0,i.jsx)(G4,{})}),(0,i.jsx)($y,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(":organizationId"),children:(0,i.jsx)(M4,{})}),(0,i.jsx)($y,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES(":organizationId"),children:(0,i.jsx)(k4,{})}),(0,i.jsx)($y,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(":organizationId"),children:(0,i.jsx)(B4,{})})]})})]})},H4=e=>{const{params:{organizationId:n},translate:t}=Kl(),s=Sf(n,e.linkPath),o=fI();return(0,i.jsxs)(Tl,{direction:o?void 0:"column",align:"start",gap:"6",children:[(0,i.jsx)(Yx,{heading:t("DelegationSpaceLink"),children:(0,i.jsx)(wz,{heading:t("lien_de_l_espac_85081"),link:s,qrCodeDescription:t("facilitez_la_co_59826")})}),(0,i.jsx)(Yx,{heading:t("iframe_27513"),children:(0,i.jsx)(Ez,{alert:e.alert,heading:e.iframeLabel,iframeLabel:e.iframeLabel,link:s})})]})},Y4=()=>{const{params:{organizationId:e},translate:n}=Kl(),[t,s]=(0,V.useState)(Ve.Code);return(0,i.jsx)(Yx,{children:(0,i.jsx)(Tl,{direction:"column",children:(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)(dc,{children:n("liste_des_e_mai_73508")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{children:(0,i.jsx)(Gm,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(mO,{isSelected:t===Ve.Code,subtitle:n("cet_e_mail_est_80490"),title:n("code_20843"),onClick:()=>s(Ve.Code)})]})]}),(0,i.jsx)(Mr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Tl,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(hO,{emailType:t,eventId:null,formId:null,organizationId:e,source:mn.DelegationsSpace})})]})})})},Z4=e=>{const n=Fi(),t="badge"===e.type?e.badge:e.customDocument.slug,s=ki(Jm);return(0,i.jsxs)(Tl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Tl,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(Yl,{icon:"file-lines"})}),(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(rc,{textStyle:"heading",children:"badge"===e.type?M_(e.badge):`${e.customDocument.event.name} - ${e.customDocument.name}`}),"customDocument"===e.type&&(0,i.jsx)(rc,{textStyle:"subtitle",children:n("ajout_par_1_48224",e.customDocument.createdBy.name,s.toLocaleString(e.customDocument.insertedAt.toLocal(),Uo.DateTime))})]}),(0,i.jsx)(np,{value:e.delegationsSpaceCustomBadges.includes(t),onChange:n=>{e.change("delegationsSpaceCustomBadges",Ko(e.delegationsSpaceCustomBadges,t,n))},children:n("document_t_l_ch_56704")})]})},K4=()=>{const{params:{organizationId:e},translate:n}=Kl(),{data:t,loader:s}=Li("query OrganizationDelegationSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customBadges\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n customDocuments {\n id\n slug\n name\n insertedAt\n\n event {\n id\n name\n }\n\n createdBy {\n ...CreatedBy\n }\n }\n }\n}\n",{organizationId:e},[$o.CreatedByFragment]),{mutate:o}=function(e={}){return Ui("mutation OrganizationDelegationSpaceSettingsUpdate(\n $organizationId: OrganizationId!\n $delegationSpaceSettings: DelegationSpaceSettingsInput!\n) {\n organizationDelegationSpaceSettingsUpdate(\n organizationId: $organizationId\n delegationSpaceSettings: $delegationSpaceSettings\n ) {\n id\n }\n}\n",e)}(),a=(0,V.useMemo)(()=>(0,Lm.A)(t.organization?.customDocuments??[],e=>`${e.event.name} - ${e.name}`.toLowerCase()),[t.organization]);return s||(0,i.jsx)(xc,{direction:"column",initialValues:{allowDelegationSpaceDownload:t.organization.allowDelegationSpaceDownload,delegationsSpaceCustomBadges:t.organization.delegationsSpaceCustomBadges},render:({form:e,handleSubmit:s,submitting:o,values:r})=>(0,i.jsxs)(sf,{footerActions:(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{isLoading:o,onClick:s,children:n("enregistrer_06519")})}),heading:n("Documents"),subtitle:n("personnaliser_l_64606"),children:[(0,i.jsx)(wb,{heading:n("allow_documents_96106"),children:(0,i.jsx)(df,{name:"allowDelegationSpaceDownload",children:n("allow_delegatio_08622")})}),r.allowDelegationSpaceDownload&&(0,i.jsx)(wb,{heading:n("documents_dispo_46996"),children:(0,i.jsxs)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:[t.organization.customBadges.map(n=>(0,i.jsx)(Z4,{badge:n,change:e.change,delegationsSpaceCustomBadges:r.delegationsSpaceCustomBadges,type:"badge"},n)),a.map(n=>(0,i.jsx)(Z4,{change:e.change,customDocument:n,delegationsSpaceCustomBadges:r.delegationsSpaceCustomBadges,type:"customDocument"},n.id))]})})]}),onSubmit:async n=>{await o({organizationId:e,delegationSpaceSettings:n})}})},X4=()=>{const{params:{organizationId:e},translate:n}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(by,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(dc,{children:n("espace_d_l_gati_59251")}),(0,i.jsxs)(wy,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:e}),children:n("design_15043")}),(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:e}),children:n("int_gration_10662")}),(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:e}),children:n("mod_les_e_mail_91257")}),(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:e}),children:n("param_tres_78420")})]})]})}),(0,i.jsx)(yy,{css:{overflowY:"auto"},children:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)($y,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(a0,{})}),(0,i.jsx)($y,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(H4,{alert:(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("comment_marche_79958")}),(0,i.jsx)(uc,{children:n("ce_code_va_vous_19546")})]}),iframeLabel:n("code_html_pour_86852"),linkPath:ts(us.ORGANIZATION_DELEGATIONS({organizationId:e}))})}),(0,i.jsx)($y,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(Y4,{})}),(0,i.jsx)($y,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(K4,{})})]})})]})},Q4=e=>{const n=Fi(),{isLoading:t,copy:s}=cS(),{isLoading:o,copy:a}=cS();return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{align:"center",css:{"& i":{cursor:"pointer"}},children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{width:20,children:t?(0,i.jsx)(Yl,{icon:"loader"}):(0,i.jsx)(Yl,{icon:"copy",onClick:()=>s(e.name)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("copier_75889")})]}),e.name]})}),(0,i.jsx)($m,{width:100,children:e.type}),(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{align:"center",css:{"& i":{cursor:"pointer"}},gap:"1",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{width:20,children:o?(0,i.jsx)(Yl,{icon:"loader"}):(0,i.jsx)(Yl,{icon:"copy",onClick:()=>a(e.value)})})}),(0,i.jsx)(Dx,{placement:"top",children:n("copier_75889")})]}),e.value]})})]})},J4=e=>{const n=Fi(),{mutate:t,isLoading:s}=function(e={}){return Ui("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)(Nm,{filters:(0,i.jsx)(i.Fragment,{children:e.domain.status===Pe.Failed&&(0,i.jsx)(tc,{color:"white",isLoading:s,leftIcon:"arrows-rotate",size:"sm",onClick:async()=>{await t({organizationId:e.organizationId,domain:e.domain.name}),e.reload()},children:n("r_essayer_43543")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("nom_08311")}),(0,i.jsx)(Gm,{width:100,children:n("type_35427")}),(0,i.jsx)(Gm,{children:n("valeur_22437")})]}),numberOfPages:0,offset:0,rows:(0,i.jsxs)(i.Fragment,{children:[e.domain.dnsEntries.map((e,n)=>(0,i.jsx)(Q4,{name:e.name,type:e.type,value:e.value},n)),(0,i.jsx)(Q4,{name:`_dmarc.${e.domain.name}`,type:"TXT",value:"v=DMARC1; p=quarantine; adkim=r;"})]}),setOffset:Bc.A,title:(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:n("liste_des_entr_35559",e.domain.name)}),e.domain.status===Pe.Success&&(0,i.jsx)(Ku,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:n("vos_entr_es_dns_05106")}),e.domain.status===Pe.Pending&&(0,i.jsx)(Ku,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:n("vos_entr_es_dns_31271")}),e.domain.status===Pe.Failed&&(0,i.jsx)(Ku,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:n("la_v_rification_65771")})]}),totalCount:0})},e3=`https://support.${F.WEEZEVENT_DOMAIN}/fr/param%C3%A9trer-ladresse-e-mail-de-lexp%C3%A9diteur`,n3=e=>{const{history:n,translate:t}=Kl(),{data:s,loader:o,reload:a}=Li("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.jsx)(i.Fragment,{children:0===s.organization.domains.length?(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{height:250,width:1,children:(0,i.jsx)(UE,{imageSrc:ou.DnsBlank,subtitle:t("pour_avoir_acc_02742"),title:t("les_entr_es_dns_52899")})}),(0,i.jsxs)(Tl,{gap:"3",justify:"center",children:[(0,i.jsx)(tc,{color:"white",onClick:()=>{open(e3)},children:t("lire_la_documen_25597")}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:t("ajouter_un_met_38216")})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{alertStyle:"gray",children:(0,i.jsx)(uc,{children:t("les_entr_es_dns_55177")})}),s.organization.domains.map((n,t)=>(0,i.jsxs)(V.Fragment,{children:[(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(J4,{domain:n,organizationId:e.organizationId,reload:a})]},t))]})})},t3=e=>{const{history:n,translate:t}=Kl(),{mutate:s}=function(e={}){return Ui("mutation EmailSenderDuplicate($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDuplicate(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:o}=function(e={}){return Ui("mutation EmailSenderDelete($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDelete(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:a}=function(e={}){return Ui("mutation EmailSenderVerificationResend(\n $organizationId: OrganizationId!\n $emailSenderId: EmailsSenderId!\n) {\n emailSenderVerificationResend(organizationId: $organizationId, emailSenderId: $emailSenderId)\n}\n",e)}(),[r,d]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{align:"center",css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{align:"center",gap:"2",children:[(0,i.jsx)(Mr,{color:"gray800",fontWeight:"medium",children:e.emailSender.name}),!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Ku,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:t("e_mail_non_conf_40343")})]}),(0,i.jsx)(Mr,{color:"gray500",children:e.emailSender.from})]}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{color:"white",onClick:()=>{n.push(yo.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId,e.emailSender.id))},children:t("_diter_62574")})}),(0,i.jsx)(tc,{color:"white",onClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(e.organizationId,e.emailSender.id))},children:t("aper_u_25595")}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsxs)(Ou,{children:[(0,i.jsx)(Nu,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Fu,{placement:"bottom-end",children:[(0,i.jsxs)(lw,{children:[!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Pu,{icon:"paper-plane",onClick:async()=>{await a({organizationId:e.organizationId,emailSenderId:e.emailSender.id})},children:t("r_envoyer_l_e_91472")}),(0,i.jsx)(Pu,{icon:"clone",onClick:async()=>{await s({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()},children:t("dupliquer_28256")})]}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:()=>{d(!0)},children:t("supprimer_43083")})})]})]})})]}),r&&(0,i.jsx)(ow,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_90786"),text:t("suppression_de_73669",e.emailSender.from),onClose:()=>{d(!1)},onDelete:async()=>{await o({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()}})]})},i3=e=>{const n=Fi();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{font:"gray900 textLg medium",children:n("liste_des_mett_28960")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Tl,{css:{border:"1px solid $gray200",borderRadius:"$2","& > div:not(:last-child)":{borderBottom:"1px solid $gray200"}},direction:"column",children:e.emailsSenders.map(n=>(0,i.jsx)(t3,{emailSender:n,organizationId:e.organizationId,reload:e.reload},n.id))})]})},s3=e=>{const{history:n,translate:t}=Kl(),{data:s,loader:o,reload:a}=Li("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[r,d]=(0,V.useState)(null),l=(0,V.useMemo)(()=>(s.organization?.emailsSenders??[]).filter(e=>!e.isValidToSendEmail),[s.organization]);return(0,V.useEffect)(()=>{!o&&s.organization.emailsSenders.length>0&&null===r&&d(s.organization.emailsSenders[0].id)},[o,r,s.organization?.emailsSenders,d]),o||(0===s.organization.emailsSenders.length?(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{height:250,width:1,children:(0,i.jsx)(UE,{subtitle:t("cr_er_des_mett_38995"),title:t("aucun_metteur_96777")})}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Tl,{justify:"center",children:(0,i.jsx)(tc,{onClick:()=>{n.push(yo.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:t("cr_er_un_mette_14030")})})})]}):(0,i.jsxs)(i.Fragment,{children:[Yo(l)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lc,{alertStyle:"error",children:[(0,i.jsx)(cc,{children:t("veuillez_confir_10865")}),(0,i.jsx)(uc,{children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:l.map(e=>(0,i.jsx)("li",{children:e.fromEmail},e.id))})})]}),(0,i.jsx)(Pl,{height:"7"})]}),(0,i.jsx)(i3,{emailsSenders:s.organization.emailsSenders,organizationId:e.organizationId,reload:a})]}))},o3=()=>{const{history:e,translate:n,params:{organizationId:t}}=Kl(),s=location.pathname.endsWith("emails/senders");return(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(by,{css:{padding:"$6 $7 0 $7"},children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Tl,{align:"center",gap:"6",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(dc,{children:n("e_mails_09850")}),(0,i.jsx)(Mr,{color:"gray500",children:n("param_trer_les_39470")})]}),s&&(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{e.push(yo.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t))},children:n("cr_er_une_nouve_77052")})})]}),(0,i.jsxs)(wy,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(Ey,{path:yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),children:n("_metteurs_74545")}),(0,i.jsx)(Ey,{path:yo.ORGANIZATION_PARAMETERS_EMAILS_DNS(t),children:n("entr_es_dns_11256")})]})]})}),(0,i.jsx)(yy,{children:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)($y,{path:yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),children:(0,i.jsx)(s3,{organizationId:t})}),(0,i.jsx)($y,{path:yo.ORGANIZATION_PARAMETERS_EMAILS_DNS(t),children:(0,i.jsx)(n3,{organizationId:t})})]})})]})};let a3=class extends Rc{constructor(e){super(e)}settingsDesignInputSchema(){return zc.Ik().shape({title:zc.Yj().required(),intro:zc.Yj()})}settingsInputSchema(){return zc.Ik().shape({events:zc.YO().of(zc.Ik().shape({buttonText:zc.Yj().required(),descriptionText:zc.Yj().max(70,this.t("the_maximum_len_30779",70)),eventId:zc.ai().required(),formId:zc.ai().nullable()}))})}};a3=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],a3);const r3=()=>{const{translate:e}=Kl();return(0,i.jsx)(Kj,{heading:e("contenu_persona_18596"),subtitle:e("personnaliser_l_09507"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)($c,{label:e("titre_de_l_intr_54141"),name:"settings.title"}),(0,i.jsx)($c,{label:e("contenu_29668"),name:"settings.intro"})]})})},d3=()=>{const{params:{organizationId:e},translate:n}=Kl(),{data:t,loader:s}=vd({organizationId:e,includeIntro:!0,spaceType:qn.EventsShowcase}),{mutate:o}=Gd(),a=ki(Ol),r=ki(EO),d=ki(a3);return s||(0,i.jsx)(xc,{direction:"column",initialValues:{design:r.designInputDefault(t.organization.spaceDesign),settings:{title:t.organization.eventsShowcaseSettings.title??n("liste_des_v_ne_29929"),intro:t.organization.eventsShowcaseSettings.intro??n("visualiser_tous_33187")}},render:({handleSubmit:e,submitting:t})=>(0,i.jsxs)(sf,{footerActions:(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{isLoading:t,onClick:e,children:n("enregistrer_06519")})}),heading:n("design_15043"),hideHeader:!0,children:[(0,i.jsx)(r3,{}),(0,i.jsx)(TO,{heading:n("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)($O,{})]}),validate:a.validateForForm(d.settingsInputSchema()),onSubmit:async n=>await o({organizationId:e,settings:n.settings,spaceDesign:n.design,spaceType:qn.EventsShowcase})})},l3=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(HX,{heading:(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(dc,{id:e.labelId,children:e.heading}),e.subtitle&&(0,i.jsx)(rc,{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)(YX,{id:e.descId,children:e.children}),(0,i.jsx)(ZX,{handleSubmit:()=>{e.setValue(),e.setIsOpen(!1)},isSubmitDisabled:e.isSubmitDisabled,setIsOpen:e.setIsOpen,submitStyle:e.submitStyle,submitText:e.submitText})]}),c3=({role:e,setShowModal:n,showModal:t,...s})=>{const[o,a]=(0,V.useState)(!1),r=Sc();return(0,V.useEffect)(()=>(a(!(!t||o)),()=>{a(!1)}),[t]),(0,i.jsx)(qX,{descId:r.descId,isOpen:o,labelId:r.labelId,role:e,setIsOpen:a,size:"md",onClose:()=>{n(null)},children:(0,i.jsx)(l3,{descId:r.descId,labelId:r.labelId,setIsOpen:a,...s,children:s.children})})},u3=e=>{const{params:{organizationId:n},translate:t}=Kl(),{data:s,loader:o}=Li("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:n,eventId:e.eventId},[]);return o||(Yo(s.organization.forms.nodes)?(0,i.jsxs)(Up,{label:t("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:t("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)(UE,{imageSrc:ou.WeezeventBlankPerson,title:t("you_have_no_for_84347")}))},m3=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(!!e.linkedFormId);return(0,V.useEffect)(()=>{!t&&e.linkedFormId&&e.setLinkedFormId(null)},[t,e.linkedFormId]),(0,i.jsxs)(Tl,{css:{bd:!0,borderRadius:"$1",backgroundColor:"$gray50",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(dc,{textStyle:"smallcapsheading",children:n("personnalisatio_98369")}),(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(wc,{hint:n("character_limit_93641",e.descriptionText.length,70),label:n("short_descripti_92906"),value:e.descriptionText,onChange:e.setDescriptionText}),(0,i.jsx)(wc,{label:n("personnalisatio_58948"),value:e.buttonText,onChange:e.setButtonText}),(0,i.jsx)(np,{value:t,onChange:s,children:(0,i.jsx)(Mr,{children:n("l_v_nement_est_24339")})}),t&&(0,i.jsx)(u3,{eventId:e.eventId,formId:e.linkedFormId,setFormId:e.setLinkedFormId})]})]})},g3=e=>{const{params:{organizationId:n},translate:t}=Kl(),[s,o]=(0,V.useState)(void 0),[a,r]=(0,V.useState)(t("s_inscrire_20304")),[d,l]=(0,V.useState)(""),[c,u]=(0,V.useState)(null),{data:m,loader:g}=Li("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:n,existingEventIds:e.eventIds},[]);return(0,i.jsx)(c3,{heading:t("nouvel_v_nemen_99684"),isSubmitDisabled:!s,leftIcon:"building",leftIconBorder:"gray200",leftIconColor:"gray800",setShowModal:e.setShowModal,setValue:()=>e.setValue({buttonText:a,descriptionText:d,eventId:s,formId:c}),showModal:e.showModal,submitText:t("ajouter_97327"),subtitle:t("ajouter_et_pers_06084"),children:e.eventIds&&g||(Yo(m.organization.events.nodes)?(0,i.jsxs)(Tl,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:[(0,i.jsxs)(Up,{label:t("quel_v_nement_57240"),shouldParseAsInt:!0,value:s??-1,onChange:o,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:t("s_lectionner_un_57793")}),m.organization.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),s&&(0,i.jsx)(m3,{buttonText:a,descriptionText:d,eventId:s,linkedFormId:c,setButtonText:r,setDescriptionText:l,setLinkedFormId:u})]}):(0,i.jsx)(UE,{imageSrc:ou.WeezeventBlankPerson,title:t("you_have_no_oth_58056")}))})},h3=e=>(0,i.jsx)(c3,{...e,leftIcon:"trash-can",leftIconBorder:"gray200",leftIconColor:"gray800",role:"alertdialog",submitStyle:"error"}),p3=e=>{const{translate:n}=Kl(),[t,s]=(0,V.useState)(e.event.buttonText),[o,a]=(0,V.useState)(e.event.descriptionText??""),[r,d]=(0,V.useState)(e.event.formId??null);return(0,i.jsx)(c3,{heading:n("mettre_jour_l_28846"),leftIcon:"building",leftIconBorder:"gray800",leftIconColor:"gray200",setShowModal:e.setShowModal,setValue:()=>e.setValue({buttonText:t,descriptionText:o,eventId:e.event.eventId,formId:r}),showModal:e.showModal,submitText:n("ajouter_97327"),subtitle:n("personalise_the_05652"),children:(0,i.jsx)(Tl,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:(0,i.jsx)(m3,{buttonText:t,descriptionText:o,eventId:e.event.eventId,linkedFormId:r,setButtonText:s,setDescriptionText:a,setLinkedFormId:d})})})},I3=e=>{const{translate:n}=Kl(),{setNodeRef:t,style:s,handleProps:o}=up(e.showcaseEvent.eventId),[a,r]=(0,V.useState)(null),[d,l]=(0,V.useState)(null),c=(0,V.useMemo)(()=>e.events?.find(n=>n.id===e.showcaseEvent.eventId)?.name??"",[e.showcaseEvent,e.events]),u=(0,V.useMemo)(()=>e.forms?.find(n=>n.id===e.showcaseEvent.formId)?.name??"",[e.showcaseEvent,e.forms]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tl,{ref:t,align:"center",css:{padding:"$4 $6",borderBlockStart:"1px solid $gray200"},gap:"4",style:s,children:[(0,i.jsx)(Mr,{color:"gray300",css:{cursor:"pointer"},...o,children:(0,i.jsx)(Yl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Tl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Tl,{css:{alignItems:"center"},gap:"2",children:[(0,i.jsx)(rc,{textStyle:"subheading",children:c}),e.showcaseEvent.formId&&(0,i.jsx)(Ku,{leftIcon:"pen",children:n("linked_to_form_64790",u)})]}),g(e.showcaseEvent.descriptionText)&&(0,i.jsx)(rc,{css:{color:"$gray500"},children:e.showcaseEvent.descriptionText})]}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsxs)(Tl,{gap:"2",children:[(0,i.jsx)(tc,{color:"white",leftIcon:"pen-line",onClick:()=>l(e.showcaseEvent.eventId)}),(0,i.jsx)(tc,{color:"white",leftIcon:"trash-can",onClick:()=>r(e.showcaseEvent.eventId)})]})]}),a&&a===e.showcaseEvent.eventId&&(0,i.jsx)(h3,{heading:n("vous_tes_sur_l_04795"),setShowModal:r,setValue:()=>{e.form.change("events",Jo(e.values.events,e.values.events.findIndex(n=>n.eventId===e.showcaseEvent.eventId)))},showModal:!!a,submitText:n("oui_supprimer_57212"),subtitle:n("la_suppression_96669"),children:(0,i.jsx)(rc,{children:n("vous_tes_sur_l_80749",c)})}),d&&d===e.showcaseEvent.eventId&&(0,i.jsx)(p3,{event:e.showcaseEvent,setShowModal:l,setValue:n=>{e.form.change("events",e.values.events.map(t=>t.eventId===e.showcaseEvent.eventId?n:t))},showModal:!!d})]})},x3=e=>{const{translate:n}=Kl(),t=(0,V.useCallback)((n,t)=>{e.form.change("events",Qo(e.values.events,n,t))},[e.values.events,e.form]);return(0,i.jsx)(_p,{ids:(e.values.events??[]).map(e=>e.eventId),onReorder:t,children:(0,i.jsx)(Tl,{css:{bd:!0,"& > div:first-child":{borderBlockStart:"none !important"}},direction:"column",children:Yo(e.values.events)?e.values.events.map(n=>(0,i.jsx)(I3,{showcaseEvent:n,...e},n.eventId)):(0,i.jsx)(Mr,{css:{padding:"$4"},children:(0,i.jsx)(UE,{title:n("no_events_selec_80121")})})})})},f3=()=>{const{params:{organizationId:e},translate:n}=Kl(),[t,s]=(0,V.useState)(!1),{data:o,loader:a}=Li("query OrganizationEventsShowcaseSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n forms(level: Event) {\n nodes {\n id\n name\n }\n }\n\n eventsShowcaseSettings {\n title\n intro\n events {\n eventId\n descriptionText\n buttonText\n formId\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:r}=function(e={}){return Ui("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=ki(Ol),l=ki(a3);return a||(0,i.jsx)(xc,{direction:"column",initialValues:{events:o.organization.eventsShowcaseSettings.events??[]},mutators:{setValue:([e,n],t,{changeValue:i})=>i(t,e,()=>n)},render:({form:e,handleSubmit:a,submitting:r,values:d})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sf,{footerActions:(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{isLoading:r,onClick:a,children:n("enregistrer_06519")})}),gap:"7",headerActions:(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{onClick:()=>s(!0),children:n("ajouter_un_v_n_49943")})}),heading:n("difusion_des_v_78418"),subtitle:n("personnaliser_l_19452"),children:(0,i.jsx)(Tl,{direction:"column",gap:"6",children:(0,i.jsx)(x3,{events:o.organization.events.nodes,form:e,forms:o.organization.forms.nodes,values:d})})}),t&&(0,i.jsx)(g3,{eventIds:d.events.map(e=>e.eventId),setShowModal:s,setValue:n=>{e.change("events",[...d.events,n])},showModal:t})]}),validate:d.validateForForm(l.settingsInputSchema()),onSubmit:async n=>{await r({organizationId:e,eventsShowcaseSettings:n})}})},_3=()=>{const{translate:e,params:{organizationId:n}}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(by,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(dc,{children:e("site_vitrine_17673")}),(0,i.jsxs)(wy,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:n}),children:e("design_15043")}),(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:n}),children:e("int_gration_10662")}),(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:n}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(yy,{css:{overflowY:"auto"},children:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{path:us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(d3,{})}),(0,i.jsx)(kr.qh,{path:us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(H4,{alert:(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:e("comment_marche_91826")}),(0,i.jsx)(uc,{children:e("ce_code_va_vous_11261")})]}),iframeLabel:e("code_html_pour_31742"),linkPath:Rs.EVENTS({organizationId:n})})}),(0,i.jsx)(kr.qh,{path:us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(f3,{})})]})})]})},j3=()=>{const{translate:e,params:{organizationId:n}}=Kl();return(0,i.jsxs)(by,{gap:"6",children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("groupes_34813")}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(tc,{to:yo.CREATE_ORGANIZATION_PARAMETERS_GROUP(n),children:e("cr_er_un_nouvea_64802")})})]})},v3=e=>`weezcrew-group-${e}`,S3=e=>{return(0,i.jsx)($m,{align:"center",width:100,children:e.group.isWeezaccessSynchronized&&e.group.weezaccessPartnerId&&(0,i.jsx)(RA,{name:e.group.name,size:30,value:(n=e.group.id,`${v3(n)}|${(e=>v3(e))(n)}`)})});var n},y3=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{canOrganizationUserEdit:s}=ay(),{mutate:o}=function(e={}){return Ui("mutation GroupDelete($organizationId: OrganizationId!, $groupId: GroupId!) {\n groupDelete(organizationId: $organizationId, groupId: $groupId)\n}\n",e)}(),{showNotification:a}=AS(),[r,d]=(0,V.useState)(!1),l=yo.EDIT_ORGANIZATION_PARAMETERS_GROUP(t,e.group.id);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(km,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{Tu(e.target)},children:[(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{ellipsis:!0,title:e.group.name,children:e.group.name})}),(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{ellipsis:!0,title:e.group.description,width:1,children:e.group.description})}),(0,i.jsx)($m,{width:200,children:e.group.numberOfMembers}),e.hasWeezaccessSynchronizedGroups&&(0,i.jsx)(S3,{group:e.group}),s&&(0,i.jsxs)(Qm,{justify:"end",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",to:l})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsxs)(Km,{children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"pen",to:l,children:n("_diter_62574")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),d(!0)},children:n("supprimer_43083")})})]})]})]}),r&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_51354"),text:n("suppression_de_73669",e.group.name),onClose:()=>{d(!1)},onDelete:async()=>{await o({organizationId:t,groupId:e.group.id}),a(n("le_groupe_a_bie_29146")),e.reload()}})]})},C3=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canOrganizationUserEdit:t}=ay(),[s,o,a]=Wm(""),[r,d]=(0,V.useState)(0),{data:l,isLoading:c,reload:u}=Li("query Groups($organizationId: OrganizationId!, $name: String, $offset: Int) {\n organization(id: $organizationId) {\n hasWeezaccessSynchronizedGroups\n\n groups(name: $name, offset: $offset, limit: 25) {\n nodes {\n id\n name\n description\n numberOfMembers\n isWeezaccessSynchronized\n weezaccessPartnerId\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:n,name:g(o)?o:void 0,offset:r},[]);const m=l.organization?.hasWeezaccessSynchronizedGroups??!1,{numberOfPages:h,totalCount:p}=Sx(l.organization?.groups);return(0,i.jsx)(Nm,{filters:(0,i.jsx)(Tl,{align:"center",gap:"3",width:1,children:(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("Rechercher un groupe"),value:s,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_08311")}),(0,i.jsx)(Gm,{children:e("Description")}),(0,i.jsx)(Gm,{width:200,children:e("nombre_de_membr_08851")}),m&&(0,i.jsx)(Gm,{width:100,children:e("qr_code_weezacc_68083")}),t&&(0,i.jsx)(Gm,{width:100})]}),numberOfPages:h,offset:r,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):l.organization.groups.nodes.map(e=>(0,i.jsx)(y3,{group:e,hasWeezaccessSynchronizedGroups:m,reload:u},e.id)),setOffset:d,totalCount:p})},b3=()=>{const e=Fi();return(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(j3,{}),(0,i.jsxs)(yy,{gap:"6",children:[(0,i.jsxs)(lc,{alertStyle:"primary",children:[(0,i.jsx)(cc,{children:e("regrouper_des_a_43481")}),(0,i.jsx)(uc,{children:e("un_groupe_porte_92378")})]}),(0,i.jsx)(C3,{})]})]})},A3=e=>{const{history:n,translate:t,params:{organizationId:s}}=Kl(),o=ki(Q_),a=ki(Ig),{mutate:r,isLoading:d}=function(e={}){return Ui("mutation OrganizationUpdateInfos(\n $organizationId: OrganizationId!\n $organization: OrganizationInfosInput!\n) {\n organizationUpdateInfos(organizationId: $organizationId, organization: $organization) {\n id\n }\n}\n",e)}(),l=(0,V.useMemo)(()=>({organization:e.initialValues}),[e.initialValues]),c=(0,V.useMemo)(()=>Y_.map((e,n)=>(0,i.jsx)("option",{value:e,children:e},n)),[]),u=Oo.c9.now();return(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(by,{children:(0,i.jsx)(Mr,{font:"gray900 displayXs medium",children:t("organisation_71863")})}),(0,i.jsx)(yy,{children:(0,i.jsx)(xc,{direction:"column",initialValues:l,render:({form:o,handleSubmit:r,values:l})=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(sf,{footerActions:(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{isLoading:d,onClick:r,children:t("enregistrer_les_30411")})}),heading:t("informations_g_79325"),children:[(0,i.jsxs)(wb,{heading:t("_propos_de_l_o_80406"),children:[(0,i.jsx)($c,{label:t("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(ab,{addressName:"organization.street",getAddress:e=>rb(e,a).street??e.formatted_address??"",label:t("Address"),onPlaceChange:e=>{const{postalCode:n,city:t,countryCode:i}=rb(e,a);o.batch(()=>{n&&o.change("organization.postalCode",n),t&&o.change("organization.city",t),i&&o.change("organization.country",i)})}}),(0,i.jsx)($c,{label:t("code_postal_40328"),name:"organization.postalCode"}),(0,i.jsx)($c,{label:t("ville_67740"),name:"organization.city"}),(0,i.jsx)(of,{isSearchVisible:!0,label:t("Country"),name:"organization.country",children:a.getCountriesIdName().map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(of,{isSearchVisible:!0,label:t("fuseau_horaire_14654"),name:"organization.timeZone",children:c})]}),(0,i.jsxs)(wb,{heading:t("responsable_de_20624"),children:[(0,i.jsx)($c,{label:t("nom_du_responsa_44907"),name:"organization.adminName"}),(0,i.jsx)($c,{isEmail:!0,label:t("e_mail_du_respo_66060"),name:"organization.adminEmail"})]}),(0,i.jsx)(wb,{heading:t("_metteur_de_e_m_77028"),children:(0,i.jsx)(of,{isCreateVisible:!0,isSearchVisible:!0,label:t("_metteur_des_e_27849"),name:"organization.emailSenderId",onCreateClick:()=>{n.push(yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsxs)(wb,{heading:t("date_time_for_13370"),children:[(0,i.jsx)($c,{hint:t("rendu_avec_la_d_41897",u.toFormat(l.organization.dateFormat)),label:t("format_de_date_82059"),name:"organization.dateFormat"}),(0,i.jsx)($c,{hint:t("rendu_avec_la_d_41897",u.toFormat(l.organization.datetimeFormat)),label:t("format_de_date_24474"),name:"organization.datetimeFormat"}),(0,i.jsx)($c,{hint:t("rendu_avec_la_d_41897",u.toFormat(l.organization.timeFormat)),label:t("format_d_heure_46798"),name:"organization.timeFormat"})]})]})}),schema:o.updateOrganizationGeneralSchema(),width:1,onSubmit:async e=>{await r({organizationId:s,organization:e.organization})}})})]})},E3=()=>{const e=ki(Q_),{organizationId:n}=Vi(),{data:t,loader:s}=La({organizationId:n});return s||(0,i.jsx)(A3,{emailsSenders:t.organization.emailsSenders,initialValues:e.organizationInfosInputDefault(t.organization)})},w3=()=>{const e=Fi(),{organizationId:n}=Vi(),{data:t,loader:s}=Li("query Invoices($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n invoices {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n currency\n paidAt\n url\n insertedAt\n isRefunded\n isWrittenOff\n }\n }\n}\n",{organizationId:n},[]);return s||(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(by,{children:(0,i.jsx)(Mr,{font:"gray900 displayXs medium",children:e("factures_03552")})}),(0,i.jsx)(yy,{children:(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("num_ro_de_factu_68150")}),(0,i.jsx)(Gm,{children:e("Date")}),(0,i.jsx)(Gm,{children:e("montant_55595")}),(0,i.jsx)(Gm,{children:e("State")}),(0,i.jsx)(Gm,{})]}),numberOfPages:1,offset:0,rows:(0,i.jsx)(i.Fragment,{children:t.organization.invoices.map((e,n)=>(0,i.jsx)(sg,{invoice:e,isBackoffice:!1,showColumn:()=>!0},n))}),setOffset:Bc.A,title:e("factures_03552"),totalCount:0})})]})},$3=()=>{const{params:{organizationId:e},translate:n}=Kl(),{data:t,loader:s}=vd({organizationId:e,includeIntro:!1,spaceType:qn.MembersSpace}),{mutate:o}=Gd(),a=ki(EO);return s||(0,i.jsx)(xc,{direction:"column",initialValues:{design:a.designInputDefault(t.organization.spaceDesign)},render:({handleSubmit:e,submitting:t})=>(0,i.jsxs)(sf,{footerActions:(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:t,onClick:e,children:n("enregistrer_06519")})})}),heading:n("design_15043"),hideHeader:!0,children:[(0,i.jsx)(TO,{heading:n("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)($O,{})]}),onSubmit:async n=>await o({organizationId:e,spaceDesign:n.design,spaceType:qn.MembersSpace})})},T3=()=>{const{params:{organizationId:e},translate:n}=Kl(),[t,s]=(0,V.useState)(Ve.Code);return(0,i.jsx)(Yx,{children:(0,i.jsx)(Tl,{direction:"column",children:(0,i.jsxs)(Tl,{gap:"7",children:[(0,i.jsxs)(Tl,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)(dc,{children:n("liste_des_e_mai_73508")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)(jm,{children:(0,i.jsx)(Gm,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(mO,{isSelected:t===Ve.Code,subtitle:n("cet_e_mail_est_80490"),title:n("code_20843"),onClick:()=>s(Ve.Code)})]})]}),(0,i.jsx)(Mr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Tl,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(hO,{emailType:t,eventId:null,formId:null,organizationId:e,source:mn.MembersSpace})})]})})})},z3=()=>{const{params:{organizationId:e},translate:n}=Kl(),{data:t,loader:s}=Li("query OrganizationMembersSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n showMembersSpaceCommunity\n\n membersSpaceExcludeAccreditations\n accreditationsCategories {\n nodes {\n id\n name\n\n accreditations {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:o}=function(e={}){return Ui("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)(xc,{direction:"column",initialValues:{hideAssignmentsUntilConfirmationEmailSent:t.organization.hideAssignmentsUntilConfirmationEmailSent,hideAccreditationsUntilConfirmationEmailSent:t.organization.hideAccreditationsUntilConfirmationEmailSent,membersSpaceExcludeAccreditations:t.organization.membersSpaceExcludeAccreditations,showMembersSpaceCommunity:t.organization.showMembersSpaceCommunity},render:({form:e,handleSubmit:s,submitting:o,values:a})=>(0,i.jsxs)(sf,{footerActions:(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{isLoading:o,onClick:s,children:n("enregistrer_06519")})}),heading:n("param_tres_de_l_83556"),subtitle:n("personnalisez_l_44387"),children:[(0,i.jsx)(wb,{heading:n("community_featu_56458"),children:(0,i.jsx)(df,{name:"showMembersSpaceCommunity",children:n("show_community_78811")})}),(0,i.jsx)(wb,{heading:n("diffusion_des_a_83706"),children:(0,i.jsx)(df,{name:"hideAssignmentsUntilConfirmationEmailSent",children:n("afficher_les_af_06759")})}),(0,i.jsx)(wb,{heading:n("diffusion_des_a_32535"),children:(0,i.jsx)(df,{name:"hideAccreditationsUntilConfirmationEmailSent",children:n("afficher_les_ac_55704")})}),(0,i.jsx)(wb,{heading:n("restriction_de_66151"),children:(0,i.jsxs)(Kj,{heading:n("quelle_s_accr_53793"),role:"radiogroup",children:[(0,i.jsx)(cm,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:a.membersSpaceExcludeAccreditations?"unchecked":"checked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",void 0)},children:n("afficher_toutes_12183")}),(0,i.jsx)(cm,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:a.membersSpaceExcludeAccreditations?"checked":"unchecked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",[])},children:n("seulement_certa_92801")}),a.membersSpaceExcludeAccreditations&&(0,i.jsx)(of,{multiple:!0,name:"membersSpaceExcludeAccreditations",placeholder:n("add_accreditati_64170"),children:t.organization.accreditationsCategories.nodes.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.accreditations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})]})})]}),onSubmit:async n=>{await o({organizationId:e,membersSpaceSettings:n})}})},O3=()=>{const{translate:e,params:{organizationId:n}}=Kl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(by,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(dc,{children:e("espace_membres_90896")}),(0,i.jsxs)(wy,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:n}),children:e("design_15043")}),(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:n}),children:e("int_gration_10662")}),(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:n}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Ey,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:n}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(yy,{css:{overflowY:"auto"},children:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)($y,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)($3,{})}),(0,i.jsx)($y,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(H4,{alert:(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:e("comment_marche_87686")}),(0,i.jsx)(uc,{children:e("ce_code_va_vous_50849")})]}),iframeLabel:e("code_html_pour_26450"),linkPath:ts(us.ORGANIZATION({organizationId:n}))})}),(0,i.jsx)($y,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(T3,{})}),(0,i.jsx)($y,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(z3,{})})]})})]})},R3=e=>{const n=Wi(),t=e.isActive?e.isActive(n.pathname):n.pathname===e.path;return(0,i.jsx)(ql,{to:e.path,children:(0,i.jsxs)(kC,{active:t,css:{gap:"$3",justifyContent:"flex-start",px:"$3",width:"100%"},children:[(0,i.jsx)(Mr,{width:20,children:(0,i.jsx)(Yl,{icon:e.icon})}),(0,i.jsx)(Mr,{children:e.title})]})})},D3=e=>{const{localOrganization:n,updateLocalOrganization:t}=XS(),[s,o]=V.useState(n?.areParametersMenuSectionsOpen?.[e.name]??!0),a=V.useCallback(async i=>{o(i),await t({areParametersMenuSectionsOpen:(0,Fl.A)(n?.areParametersMenuSectionsOpen,{[e.name]:i})})},[n,s,o]);return(0,i.jsxs)(Tl,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$1",paddingTop:"$4"},direction:"column",children:[(0,i.jsxs)(Tl,{align:"center",css:{color:"$gray800",cursor:"pointer",px:"$5"},gap:"3",onClick:async()=>{await a(!s)},children:[(0,i.jsx)(Mr,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(Mr,{css:{fontSize:"10px"},children:(0,i.jsx)(Yl,{icon:s?"chevron-down":"chevron-up"})})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(Tl,{css:{px:"$3"},direction:"column",children:e.children})]})]})},M3=()=>{const{translate:e,params:{organizationId:n}}=Kl();Au(e("param_tres_78420"));const{hasFeature:t}=XS(),{canOrganizationParamRead:s,canOrganizationUserRead:o}=ay();return(0,i.jsx)(Tl,{as:El.Nav,css:{background:"$gray100",overflowY:"auto",py:"$2"},height:1,children:(0,i.jsxs)(Tl,{"aria-orientation":"vertical",direction:"column",role:"menubar",width:240,children:[(0,i.jsxs)(D3,{name:"general",title:e("g_n_ral_64953"),children:[(0,i.jsx)(R3,{icon:"user",path:yo.ORGANIZATION_PARAMETERS_PROFILE(n),title:e("mon_profil_48224")}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(R3,{icon:"building",path:yo.ORGANIZATION_PARAMETERS_INFOS(n),title:e("organisation_71863")}),(0,i.jsx)(R3,{icon:"wave-pulse",path:yo.ORGANIZATION_PARAMETERS_ACTIVITY(n),title:e("activit_95747")})]})]}),s&&(0,i.jsxs)(D3,{name:"parameters",title:e("param_tres_78420"),children:[(0,i.jsx)(R3,{icon:"star",isActive:e=>e.includes(us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:n})),path:us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:n}),title:e("site_vitrine_17673")}),(0,i.jsx)(R3,{icon:"address-card",isActive:e=>e.includes(us.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:n})),path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:n}),title:e("espace_membres_90896")}),t(Ze.Delegation)&&(0,i.jsx)(R3,{icon:"users",isActive:e=>e.includes(us.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:n})),path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:n}),title:e("espace_d_l_gati_59251")}),(0,i.jsx)(R3,{icon:"at",isActive:e=>e.includes(yo.ORGANIZATION_PARAMETERS_EMAILS(n)),path:yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),title:e("e_mails_09850")}),(0,i.jsx)(R3,{icon:"layer-group",isActive:e=>e.includes(yo.ORGANIZATION_PARAMETERS_CATEGORIES(n)),path:yo.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(n),title:e("cat_gories_24533")}),(0,i.jsx)(R3,{icon:"tag",path:yo.ORGANIZATION_PARAMETERS_TAGS(n),title:e("tags_79499")}),(0,i.jsx)(R3,{icon:"language",path:yo.ORGANIZATION_PARAMETERS_TRANSLATIONS(n),title:e("traductions_88349")})]}),o&&(0,i.jsxs)(D3,{name:"users",title:e("utilisateurs_04975"),children:[(0,i.jsx)(R3,{icon:"user-group",path:yo.ORGANIZATION_PARAMETERS_TEAM(n),title:e("utilisateurs_04975")}),(0,i.jsx)(R3,{icon:"shield",path:yo.ORGANIZATION_PARAMETERS_ROLES(n),title:e("r_les_et_permis_27853")}),(0,i.jsx)(R3,{icon:"people-group",path:yo.ORGANIZATION_PARAMETERS_GROUPS(n),title:e("groupes_34813")})]}),s&&o&&(0,i.jsx)(D3,{name:"subscription",title:e("abonnement_98940"),children:(0,i.jsx)(R3,{icon:"receipt",path:yo.ORGANIZATION_PARAMETERS_INVOICES(n),title:e("factures_03552")})}),s&&t(Ze.Skidata)&&(0,i.jsx)(D3,{name:"integrations",title:e("int_grations_88619"),children:(0,i.jsx)(R3,{icon:"person-skiing",path:yo.ORGANIZATION_PARAMETERS_SKIDATA(n),title:"Skidata"})})]})})},P3=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{data:t,loader:s}=Za({organizationId:n}),o=ki(AR),a=ki(Ol),{mutate:r,isLoading:d}=Ka(),{mutate:l}=qd(),{user:c}=Yi(),{reload:u}=XS(),[m,g]=(0,V.useState)(!1);return s||(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(by,{children:(0,i.jsx)(Mr,{font:"gray900 displayXs medium",children:e("mon_profil_48224")})}),(0,i.jsx)(yy,{children:(0,i.jsx)(xc,{direction:"column",initialValues:{userInfo:o.userInfoProfileInputDefault(t.user)},render:({handleSubmit:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(sf,{footerActions:(0,i.jsx)(tc,{isLoading:d,onClick:t,children:e("enregistrer_les_30411")}),heading:e("informations_pe_37892"),children:[(0,i.jsx)(PC,{accept:gv.Images,acl:"public-read",allowCrop:!0,label:e("photo_de_profil_08618"),organizationId:n,prefix:"userInfo.fields.picture."}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(y4,{inputName:"userInfo."})]}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sf,{heading:e("compte_16579"),children:(0,i.jsx)(Mr,{color:"error700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{g(!0)},children:e("supprimer_mon_c_07051")})}),m&&(0,i.jsx)(ow,{buttonText:"Supprimer",subtext:e("_tes_vous_s_r_d_50084"),text:e("supprimer_mon_c_07051"),onClose:()=>{g(!1)},onDelete:async()=>{await l({}),J()}})]}),validate:a.validateForForm(o.updateProfileSchema()),width:1,onSubmit:async e=>{const{userProfileUpdate:{email:n,language:i}}=await r({userId:c.id,userInfoId:t.user.userInfo.id,userInfo:e.userInfo});c.email!==n||c.language!==i?J():u()}})})]})},k3=()=>{const{translate:e,params:{organizationId:n}}=Kl();return(0,i.jsxs)(by,{gap:"6",children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("r_les_et_permis_27853")}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(tc,{to:yo.CREATE_ORGANIZATION_PARAMETERS_ROLE(n),children:e("cr_er_un_nouvea_53551")})})]})},F3=({onClose:e,onDelete:n,role:t})=>{const{translate:s,params:{organizationId:o}}=Kl(),{mutate:a}=function(e={}){return Ui("mutation RoleDelete($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDelete(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(ow,{buttonText:s("supprimer_43083"),subtext:0===t.numberOfTimesUsed?s("ce_r_le_n_est_p_61959"):s("ce_r_le_est_uti_35113",t.numberOfTimesUsed),text:s("suppression_de_73669",t.name),onClose:e,onDelete:()=>a({organizationId:o,roleId:t.id}).then(e=>(n(),e))})},N3=({onDelete:e,role:n})=>{const{history:t,translate:s,params:{organizationId:o}}=Kl(),{mutate:a}=function(e={}){return Ui("mutation RoleDuplicate($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDuplicate(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}(),{canOrganizationUserEdit:r}=ay(),[d,l]=(0,V.useState)(!1),c=(0,V.useMemo)(()=>r&&n.type===Vn.Custom,[r,n]),u=async()=>{const{roleDuplicate:e}=await a({organizationId:o,roleId:n.id});t.push(yo.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,e.id))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsxs)(lw,{children:[c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pu,{icon:"pen",onClick:()=>{t.push(yo.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,n.id))},children:s("_diter_62574")}),(0,i.jsx)(Pu,{icon:"clone",onClick:u,children:s("dupliquer_28256")})]}),n.type!==Vn.Custom&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pu,{icon:"eye",onClick:()=>{t.push(yo.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,n.id))},children:s("voir_36533")}),(0,i.jsx)(Pu,{icon:"clone",onClick:u,children:s("dupliquer_28256")})]})]}),(0,i.jsx)(lw,{children:c&&(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),l(!0)},children:s("supprimer_43083")})})]}),d&&(0,i.jsx)(F3,{role:n,onClose:()=>l(!1),onDelete:e})]})},L3=()=>{const{history:e,translate:n,params:{organizationId:t}}=Kl(),{canOrganizationUserEdit:s}=ay(),[o,a,r]=Wm(""),[d,l]=(0,V.useState)([]),{data:c,isLoading:m,reload:h}=Li("query Roles($organizationId: OrganizationId!, $name: String, $levels: [RoleAccessLevel!]) {\n organization(id: $organizationId) {\n roles(name: $name, levels: $levels) {\n id\n name\n description\n accessLevel\n type\n numberOfTimesUsed\n }\n }\n}\n",{organizationId:t,name:g(a)?a:void 0,levels:Yo(d)?d:void 0},[]);const{showNotification:p}=AS(),{reload:I}=XS(),x=(0,V.useMemo)(()=>(0,Lm.A)(c.organization?.roles??[],e=>[e.accessLevel===Un.Organization?1:e.accessLevel===Un.Event?2:e.accessLevel===Un.Position?3:4,u(e.name)]),[c.organization]),f=()=>{p({color:"success",text:n("le_r_le_a_bien_53462")}),h(),I()};return(0,i.jsx)(Nm,{filters:(0,i.jsxs)(Tl,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Mr,{width:300,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:n("rechercher_un_r_39544"),value:o,onChange:r})}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(Mr,{width:240,children:(0,i.jsxs)(_m,{isSearchVisible:!0,menuWidth:320,multiple:!0,placeholder:"Niveau d'accĂšs",renderOnPortal:!0,values:d,onChange:l,children:[(0,i.jsx)("option",{value:Un.Organization,children:n("organisation_71863")}),(0,i.jsx)("option",{value:Un.Event,children:n("_v_nement_22345")}),(0,i.jsx)("option",{value:Un.DelegationCategory,children:n("Delegation")}),(0,i.jsx)("option",{value:Un.Position,children:n("Position")})]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("nom_du_r_le_38492")}),(0,i.jsx)(Gm,{children:n("niveau_d_acc_s_29898")}),(0,i.jsx)(Gm,{children:n("description_du_94520")}),(0,i.jsx)(Gm,{width:200,children:"nombre_d_utilis_99999"}),s&&(0,i.jsx)(Gm,{width:100})]}),rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):x.map(o=>(0,i.jsxs)(km,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{e.push(yo.EDIT_ORGANIZATION_PARAMETERS_ROLE(t,o.id))},onMouseLeave:e=>{Tu(e.target)},children:[(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{ellipsis:!0,title:o.name,children:o.name})}),(0,i.jsx)($m,{children:o.accessLevel===Un.Organization?n("administrateur_10076"):o.accessLevel===Un.Event?n("administrateur_99393"):o.accessLevel===Un.Position?n("responsable_de_82794"):n("responsable_de_75445")}),(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{title:o.description,width:1,children:o.description})}),(0,i.jsx)($m,{width:200,children:o.numberOfTimesUsed}),s&&(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsx)(N3,{role:o,onDelete:f})})]},o.id))})},U3=()=>{const e=Fi();return(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(k3,{}),(0,i.jsxs)(yy,{gap:"6",children:[(0,i.jsxs)(lc,{alertStyle:"primary",children:[(0,i.jsx)(cc,{children:e("contr_ler_les_p_50104")}),(0,i.jsx)(uc,{children:e("les_r_les_aiden_19371")})]}),(0,i.jsx)(L3,{})]})]})};let V3=class extends Rc{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??""}}};V3=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],V3);const B3=e=>{const n=Fi(),t=ki(Jm),{mutate:s}=function(e={}){return Ui("mutation SkidataConnectionInfoSeaonEventAdd($organizationId: OrganizationId!, $eventId: EventId!) {\n skidataConnectionInfoSeaonEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:o}=function(e={}){return Ui("mutation SkidataConnectionInfoSeaonEventDelete(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSeaonEventDelete(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:a}=function(e={}){return Ui("mutation SkidataConnectionInfoSynchronizedEventAdd(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSynchronizedEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:r}=function(e={}){return Ui("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)(Tl,{gap:"3",width:1,children:[(0,i.jsxs)(Tl,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Mr,{color:"gray700",fontWeight:"medium",children:e.title}),(0,i.jsx)(Mr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Mr,{width:1,children:(0,i.jsxs)(ym,{children:[(0,i.jsxs)(jm,{children:[(0,i.jsx)(Gm,{children:n("nom_de_l_v_nem_08711")}),(0,i.jsx)(Gm,{children:n("Date")}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{}),(0,i.jsx)(Gm,{})]}),"synchronized"===e.eventType&&(0,i.jsx)(Gm,{}),"season"===e.eventType&&(0,i.jsx)(Gm,{})]}),Yo(e.events)?e.events.map(d=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{color:"gray800",width:1,children:d.name})}),(0,i.jsx)($m,{children:k_(t,d.startAt,d.endAt)}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($m,{onClick:async()=>{await a({organizationId:e.organizationId,eventId:d.id}),e.reload()},children:(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:n("synchroniser_34754")})}),(0,i.jsx)($m,{onClick:async()=>{await s({organizationId:e.organizationId,eventId:d.id}),e.reload()},children:(0,i.jsx)(Mr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:n("_v_nement_saiso_67885")})})]}),"synchronized"===e.eventType&&(0,i.jsx)($m,{onClick:async()=>{await r({organizationId:e.organizationId,eventId:d.id}),e.reload()},children:(0,i.jsx)(Mr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:n("supprimer_43083")})}),"season"===e.eventType&&(0,i.jsx)($m,{onClick:async()=>{await o({organizationId:e.organizationId,eventId:d.id}),e.reload()},children:(0,i.jsx)(Mr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:n("supprimer_43083")})})]},d.id)):(0,i.jsx)(km,{css:{height:"auto"},children:(0,i.jsx)($m,{children:(0,i.jsxs)(Tl,{align:"center",css:{padding:"$8"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(nb,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(Mr,{fontSize:"textMd",fontWeight:"medium",children:n("aucun_v_nement_39620")})]})})})]})})]})},W3=()=>{const e=Fi(),{organizationId:n}=Vi(),t=ki(V3),{data:s,loader:o,reload:a}=Li("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:n},[]),{mutate:r}=function(e={}){return Ui("mutation SkidataConnectionInfosDelete($organizationId: OrganizationId!) {\n skidataConnectionInfosDelete(organizationId: $organizationId) {\n organizationId\n }\n}\n",e)}(),{mutate:d,isLoading:l}=function(e={}){return Ui("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 Ui("mutation SkidataSynchronize($organizationId: OrganizationId!) {\n skidataSynchronize(organizationId: $organizationId)\n}\n",e)}(),m=(0,V.useMemo)(()=>s.organization?.events.nodes??[],[s.organization]),g=(0,V.useMemo)(()=>m.map(({id:e})=>e),[m]),h=(0,V.useMemo)(()=>s.organization?.skidataConnectionInfos?.synchronizedEventsIds??[],[s.organization]),p=(0,V.useMemo)(()=>s.organization?.skidataConnectionInfos?.seasonEventsIds??[],[s.organization]),I=(0,V.useMemo)(()=>{const e=(0,em.A)(g,h.concat(p));return m.filter(n=>e.includes(n.id))},[m,h,p]),x=(0,V.useMemo)(()=>m.filter(e=>h.includes(e.id)),[m]),f=(0,V.useMemo)(()=>m.filter(e=>p.includes(e.id)),[m,p]);return o||(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsxs)(by,{gap:"3",children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 displayXs medium",children:"Skidata"}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:u?(0,i.jsx)(tc,{color:"white",leftIcon:"loader"}):(0,i.jsx)(tc,{color:"white",leftIcon:"arrows-rotate",onClick:async()=>{await c({organizationId:n})}})})}),(0,i.jsx)(Dx,{placement:"top",children:e("synchroniser_34754")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(tc,{color:"white",leftIcon:"arrow-right-from-bracket",onClick:async()=>{await r({organizationId:n}),a()}})})}),(0,i.jsx)(Dx,{placement:"top",children:e("se_d_connecter_74151")})]})]})]}),(0,i.jsxs)(yy,{children:[(0,i.jsx)(xc,{direction:"column",initialValues:{connectionInfos:t.connectionInfosInputDefault(s.organization.skidataConnectionInfos)},render:({handleSubmit:n})=>(0,i.jsxs)(sf,{footerActions:(0,i.jsx)(tc,{isLoading:l,onClick:n,children:s.organization.skidataConnectionInfos?e("enregistrer_06519"):e("se_connecter_63820")}),heading:e("connexion_05887"),children:[(0,i.jsx)(wb,{heading:e("adresse_du_web_92125"),children:(0,i.jsx)($c,{name:"connectionInfos.url"})}),(0,i.jsx)(wb,{heading:"Issuer",children:(0,i.jsx)($c,{name:"connectionInfos.issuer"})}),(0,i.jsx)(wb,{heading:"Receiver",children:(0,i.jsx)($c,{name:"connectionInfos.receiver"})}),(0,i.jsx)(wb,{heading:e("lieu_20541"),children:(0,i.jsx)($c,{name:"connectionInfos.place"})})]}),width:1,onSubmit:async e=>{await d({organizationId:n,connectionInfos:e.connectionInfos}),a()}}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(sI,{direction:"horizontal"}),(0,i.jsx)(Pl,{height:"5"}),(0,i.jsx)(B3,{eventType:"all",events:I,organizationId:n,reload:a,subtitle:"",title:e("liste_des_v_ne_29929")}),(0,i.jsx)(oI,{height:"5"}),(0,i.jsx)(B3,{eventType:"synchronized",events:x,organizationId:n,reload:a,subtitle:e("ces_v_nements_58722"),title:e("liste_des_v_ne_09741")}),(0,i.jsx)(oI,{height:"5"}),(0,i.jsx)(B3,{eventType:"season",events:f,organizationId:n,reload:a,subtitle:e("ces_v_nements_24479"),title:e("liste_des_v_ne_73078")})]})]})]})},G3=e=>{const n=Fi(),{mutate:t}=function(e={}){return Ui("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)(tb,{buttonText:n("renommer_42135"),icon:"tag",initialValues:{name:e.name},title:n("renommer_1_40542",e.name),onClose:e.onClose,onSubmit:async n=>{await t({organizationId:e.organizationId,tagId:e.tagId,name:n.name}),e.onSuccess(),e.onClose()},children:(0,i.jsx)($c,{label:n("nom_du_tag_95054"),name:"name"})})},q3=e=>{const n=Fi(),{canOrganizationParamEdit:t}=ay(),{mutate:s}=function(e={}){return Ui("mutation TagDelete($organizationId: OrganizationId!, $tagId: TagId!) {\n tagDelete(organizationId: $organizationId, tagId: $tagId) {\n id\n }\n}\n",e)}(),[o,a]=(0,V.useState)(!1),[r,d]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(km,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)($m,{css:{color:"$gray800"},children:e.tag.name}),(0,i.jsx)($m,{children:e.tag.numberOfTimesUsed}),t&&(0,i.jsxs)(Qm,{justify:"center",children:[(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{children:(0,i.jsx)(Yl,{icon:"pen",onClick:()=>{a(!0)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsxs)(Ox,{children:[(0,i.jsx)(Mx,{children:(0,i.jsx)(Mr,{color:"error700",children:(0,i.jsx)(Yl,{icon:"trash-can",onClick:()=>{d(!0)}})})}),(0,i.jsx)(Dx,{placement:"top",children:n("supprimer_02105")})]})]})]}),o&&(0,i.jsx)(G3,{name:e.tag.name,organizationId:e.organizationId,tagId:e.tag.id,onClose:()=>{a(!1)},onSuccess:e.reload}),r&&(0,i.jsx)(ow,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_70200"),text:n("suppression_de_73669",e.tag.name),onClose:()=>{d(!1)},onDelete:async()=>{await s({organizationId:e.organizationId,tagId:e.tag.id}),e.reload()}})]})},H3=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{canOrganizationParamEdit:t}=ay(),[s,o,a]=Wm(""),[r,d]=(0,V.useState)(0),{data:l,isLoading:c,reload:u}=Li("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:n,name:g(o)?o:void 0,offset:r},[]);const{numberOfPages:m,totalCount:h}=Sx(l.organization?.tags),[p,I]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsxs)(by,{gap:"6",children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("tags_79499")}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(tc,{onClick:()=>{I(!0)},children:e("cr_er_un_nouvea_56617")})})]}),(0,i.jsx)(yy,{children:(0,i.jsx)(Nm,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mr,{width:320,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_un_t_34829"),value:s,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("nom_08311")}),(0,i.jsx)(Gm,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Gm,{width:100})]}),numberOfPages:m,offset:r,rows:c?(0,i.jsx)(i.Fragment,{}):l.organization.tags.nodes.map(e=>(0,i.jsx)(q3,{organizationId:n,reload:u,tag:e},e.id)),setOffset:d,title:e("liste_des_tags_83521"),totalCount:h})})]}),p&&(0,i.jsx)(ib,{organizationId:n,onClose:()=>{I(!1)},onSuccess:u})]})};function Y3(e,n){const t=e[`${n.toLowerCase()}String`];return g(t)?t:g(e.enString)?e.enString:g(e.frString)?e.frString:g(e.esString)?e.esString:g(e.deString)?e.deString:g(e.nlString)?e.nlString:""}const Z3=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{user:s}=Yi(),{mutate:o,isLoading:a}=function(e={}){return Ui("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)}(),[r,d]=(0,V.useState)(!1),[l,c]=(0,V.useState)(Object.fromEntries(e.languages.map(n=>[n,e.translation[n.toLowerCase()]||""]))),u=s.language,m=e.languages.every(n=>e.translation[`is${n}Translated`]);return(0,i.jsxs)(Tl,{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)(Tl,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"2",width:1,onClick:()=>{d(!r)},children:[(0,i.jsx)(tc,{color:"invisible",css:{color:"$gray700"},leftIcon:r?"chevron-down":"chevron-right"}),(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray800 textMd medium",children:Y3(e.translation,u)}),(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(Ku,{children:n(e.translation.module)}),m?(0,i.jsx)(Ku,{color:"success",children:n("Translated")}):(0,i.jsx)(Ku,{color:"warning",children:n("NotTranslated")})]})]}),r&&(0,i.jsxs)(Tl,{css:{background:"$gray100",padding:"$6"},direction:"column",gap:"6",children:[e.languages.map(n=>{const t=`Version ${n}`;return e.translation.translationType===et.RichText?(0,i.jsx)(tS,{initialValue:l[n],label:t,onChange:e=>{c({...l,[n]:e})}},n):(0,i.jsx)(wc,{label:t,value:l[n],onChange:e=>{c({...l,[n]:e})}},n)}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Tl,{children:(0,i.jsx)(tc,{isLoading:a,onClick:async()=>{await o({organizationId:t,translationId:e.translation.id,translation:Object.fromEntries(Object.entries(l).map(([e,n])=>[e.toLowerCase(),n]))})},children:n("mettre_jour_85141")})})})]})]})},K3=e=>{const n=Fi(),t=Um(),[s,o]=(0,V.useState)(!1),[a,r]=(0,V.useState)(e.eventsIds),[d,l]=(0,V.useState)(e.modules),[c,u]=(0,V.useState)(e.translationStatus),m=(0,V.useMemo)(()=>(0,Lm.A)(e.organization.events.nodes,e=>e.name.toLowerCase()),[e.organization]);return(0,i.jsxs)(Tl,{css:{background:"white",bd:!0,padding:"$4"},gap:"3",children:[(0,i.jsx)(wc,{icon:"search",placeholder:n("rechercher_une_22159"),value:e.content,onChange:e.setContent}),(0,i.jsxs)(Nw,{apply:()=>{e.setEventsIds(a),e.setModules(d),e.setTranslationStatus(c),o(!1)},color:"gray",isOpen:s,reinit:()=>{e.setEventsIds([]),r([]),e.setModules([]),l([]),e.setTranslationStatus(Jn.TranslatedAndNotTranslated),u(Jn.TranslatedAndNotTranslated),o(!1)},showButtons:!0,onStateChange:o,children:[(0,i.jsx)(_m,{isSearchVisible:!0,label:n("_v_nements_53672"),multiple:!0,renderOnPortal:!0,values:a,onChange:r,children:m.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_m,{isSearchVisible:!0,label:n("module_67984"),multiple:!0,renderOnPortal:!0,values:d,onChange:l,children:t(_i)}),(0,i.jsx)(Up,{label:n("statut_de_tradu_58384"),value:c,onChange:u,children:t(ji)})]})]})},X3=e=>(0,i.jsx)(Tl,{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)(Qu,{borderRadius:"$2",height:32,width:1})}),Q3=e=>{const{translate:n}=Kl(),t=e.organization.translations.totalCount-e.organization.translated.totalCount;return(0,i.jsxs)(Tl,{css:{height:"fit-content"},gap:"6",width:1,children:[(0,i.jsx)(Mr,{width:.3,children:(0,i.jsx)(Wk,{css:{height:"100%"},children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:n("nombre_de_langu_75924")}),(0,i.jsx)(Mr,{font:"gray900 displayMd medium",children:e.organization.languages.length})]})})}),(0,i.jsx)(Mr,{css:{flex:"1"},children:(0,i.jsx)(Wk,{children:(0,i.jsxs)(Tl,{gap:"6",justify:"between",children:[(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:n("nombre_de_champ_26560")}),(0,i.jsx)(Mr,{font:"gray900 displayMd medium",children:e.organization.translations.totalCount})]}),(0,i.jsxs)(Tl,{direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{font:"gray700 textXs semiBold",children:n("dont_10477")}),(0,i.jsxs)(Tl,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:n("champs_tradui_47609")}),(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:t})]}),(0,i.jsxs)(Tl,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(Mr,{font:"gray500 textSm medium",children:n("champs_traduits_03119")}),(0,i.jsx)(Mr,{font:"gray900 textMd semiBold",children:e.organization.translated.totalCount})]})]})]})})})]})},J3=e=>{const{translate:n,params:{organizationId:t}}=Kl(),[s,o,a]=Wm(""),[r,d]=(0,V.useState)([]),[l,c]=(0,V.useState)(Jn.TranslatedAndNotTranslated),[u,m]=(0,V.useState)([]),[h,p]=(0,V.useState)(0),{data:I,isLoading:x}=Li("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:t,content:g(o)?o:null,eventsIds:r,modules:u,status:l,offset:h},[$o.TranslationFragment]);const{numberOfPages:f,totalCount:_}=Sx(I.organization?.translations),j=I.organization?.translations.nodes??[];return(0,i.jsxs)(Tl,{css:{overflowY:"auto"},direction:"column",height:1,children:[(0,i.jsxs)(Tl,{css:{borderBottom:"1px solid $gray200",padding:"$6 $7"},direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textXl medium",children:n("traductions_88349")}),(0,i.jsx)(Mr,{color:"gray500",children:n("g_rer_toutes_le_39107")})]}),(0,i.jsxs)(Tl,{css:{background:"$gray50",flex:"1",padding:"$7"},direction:"column",children:[(0,i.jsx)(Q3,{organization:e.organization}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(K3,{content:s,eventsIds:r,modules:u,organization:e.organization,setContent:a,setEventsIds:d,setModules:m,setTranslationStatus:c,translationStatus:l}),(0,i.jsx)(Pl,{height:"4"}),x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(X3,{isFirst:!0,isLast:!1}),(0,i.jsx)(X3,{isFirst:!1,isLast:!1}),(0,i.jsx)(X3,{isFirst:!1,isLast:!0})]}):j.map((n,t)=>(0,i.jsx)(Z3,{isFirst:0===t,isLast:t===j.length-1,languages:e.organization.languages,translation:n},n.id)),(0,i.jsx)(Pl,{height:"4"}),(0,i.jsx)(Pm,{numberOfPages:f,offset:h,setOffset:p,totalCount:_})]})]})},e5=()=>{const{params:{organizationId:e}}=Kl(),{data:n,loader:t}=Li("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 t||(0,i.jsx)(J3,{organization:n.organization})},n5=e=>{const{translate:n,params:{organizationId:t}}=Kl(),{showNotification:s}=AS(),{mutate:o}=function(e={}){return Ui("mutation UserRolesDelete($organizationId: OrganizationId!, $userId: UserId!) {\n userRolesDelete(organizationId: $organizationId, userId: $userId)\n}\n",e)}(),a=function(e,n){const{mutate:t}=ir();return(0,V.useCallback)(()=>Promise.all([Ve.PositionCategoryLeaderAssign,Ve.PositionLeaderAssign,Ve.DelegationCategoryLeaderAssign,Ve.DelegationLeaderAssign,Ve.EventInvite,Ve.OrganizationInvite].map(i=>t({organizationId:e,userInfoId:n,emailType:i}))),[t,e,n])}(t,e.userInfo.id),[r,d]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Km,{children:[(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{icon:"paper-plane",onClick:async e=>{Tu(e.target),await a()},children:n("r_envoyer_l_e_96215")})}),(0,i.jsx)(lw,{children:(0,i.jsx)(Pu,{color:"red",icon:"trash-can",onClick:e=>{Tu(e.target),d(!0)},children:n("supprimer_l_acc_85342")})})]}),r&&(0,i.jsx)(ow,{buttonText:n("supprimer_les_a_96621"),subtext:n("_tes_vous_s_r_d_35776",e.userInfo.nameOrEmail),text:n("supprimer_l_acc_85342"),onClose:()=>d(!1),onDelete:async()=>{await o({organizationId:t,userId:e.userInfo.userId}),s(n("tous_les_acc_s_26440",e.userInfo.nameOrEmail)),e.reload()}})]})},t5=e=>{const{history:n}=Kl(),{organization:t}=XS();return(0,i.jsx)(Ku,{css:{minWidth:0},cursor:"pointer",leftIcon:"people-group",onClick:()=>{n.push(yo.EDIT_ORGANIZATION_PARAMETERS_GROUP(t.id,e.group.id))},children:e.group.name})},i5=e=>{const{organization:n}=XS(),{canOrganizationUserEdit:t}=ay(),{mutate:s}=Yd(),[o,a]=(0,V.useState)(e.roleId);return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:e.group?(0,i.jsxs)(Tl,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(Mr,{ellipsis:!0,children:e.roles.find(({id:e})=>e===o)?.name}),(0,i.jsx)(t5,{group:e.group})]}):(0,i.jsx)(Up,{shouldParseAsInt:!0,state:t?"active":"disabled",value:o,onChange:t=>(a(t),(t=>s({organizationId:n.id,scope:e.scope,id:e.id,roleId:t}))(t)),children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)($m,{children:e.resource}),t&&(0,i.jsx)(Qm,{justify:"center",children:!e.group&&(0,i.jsx)(Mr,{color:"error700",onClick:async()=>{e.onDelete(e.scope,e.id)},children:(0,i.jsx)(Yl,{icon:"trash-can"})})})]})},s5=e=>{const{translate:n}=Kl(),{organization:t,roles:s}=XS(),{canOrganizationUserEdit:o}=ay(),{mutate:a}=Hd(),[r,d]=(0,V.useState)(e.userInfo.usersEvents.filter(n=>n.event.id===e.event.id)),[l,c]=(0,V.useState)(e.userInfo.usersDelegations.filter(n=>n.eventId===e.event.id)),[u,m]=(0,V.useState)(e.userInfo.usersDelegationsCategories.filter(n=>n.eventId===e.event.id)),[g,h]=(0,V.useState)(e.userInfo.usersPositions.filter(n=>n.eventId===e.event.id)),[p,I]=(0,V.useState)(e.userInfo.usersPositionsCategories.filter(n=>n.eventId===e.event.id)),x=n=>!n.group||!e.removedGroupsIds.includes(n.group.id),f=r.filter(x),_=u.filter(x),j=g.filter(x),v=p.filter(x),S=async(e,n)=>{await a({organizationId:t.id,scope:e,id:n}),d(e=>e.filter(e=>e.id!==n)),c(e=>e.filter(e=>e.id!==n)),m(e=>e.filter(e=>e.id!==n)),h(e=>e.filter(e=>e.id!==n)),I(e=>e.filter(e=>e.id!==n))};return Yo(f)||Yo(l)||Yo(_)||Yo(j)||Yo(v)?(0,i.jsx)(Nm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("r_le_59302")}),(0,i.jsx)(Gm,{}),o&&(0,i.jsx)(Gm,{width:100})]}),rows:(0,i.jsxs)(i.Fragment,{children:[f.map(n=>(0,i.jsx)(i5,{group:n.group,id:n.id,resource:"-",roleId:n.role.id,roles:s.eventRoles,scope:se.Event,userId:e.userInfo.userId,onDelete:S},n.id)),l.map(e=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:n("responsable_de_70462")}),(0,i.jsx)($m,{children:e.delegation.name}),o&&(0,i.jsx)(Qm,{justify:"center",children:(0,i.jsx)(Mr,{color:"error700",onClick:()=>S(se.Delegation,e.id),children:(0,i.jsx)(Yl,{icon:"trash-can"})})})]},e.id)),_.map(n=>(0,i.jsx)(i5,{group:n.group,id:n.id,resource:n.delegationCategory.name,roleId:n.role.id,roles:s.delegationCategoryRoles,scope:se.DelegationCategory,userId:e.userInfo.userId,onDelete:S},n.id)),j.map(n=>(0,i.jsx)(i5,{group:n.group,id:n.id,resource:n.position.name,roleId:n.role.id,roles:s.positionRoles,scope:se.Position,userId:e.userInfo.userId,onDelete:S},n.id)),v.map(n=>(0,i.jsx)(i5,{group:n.group,id:n.id,resource:n.positionCategory.name,roleId:n.role.id,roles:s.positionRoles,scope:se.PositionCategory,userId:e.userInfo.userId,onDelete:S},n.id))]}),title:e.event.name}):null},o5=e=>{const{history:n,translate:t}=Kl(),{organization:s}=XS(),{canOrganizationUserEdit:o}=ay(),{mutate:a}=function(e={}){return Ui("mutation GroupMemberDelete(\n $organizationId: OrganizationId!\n $groupId: GroupId!\n $userInfoId: UsersInfoId!\n) {\n groupMemberDelete(\n organizationId: $organizationId\n groupId: $groupId\n userInfoId: $userInfoId\n )\n}\n",e)}();return Yo(e.groups)?(0,i.jsx)(Nm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:t("nom_08311")}),o&&(0,i.jsx)(Gm,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:e.groups.map(r=>(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Mr,{css:{cursor:"pointer"},ellipsis:!0,title:r.name,onClick:()=>{n.push(yo.EDIT_ORGANIZATION_PARAMETERS_GROUP(s.id,r.id))},children:r.name})}),o&&(0,i.jsx)(Qm,{justify:"center",children:(0,i.jsx)(Mr,{color:"error700",title:t("Retirer du groupe"),onClick:()=>(async n=>{await a({organizationId:s.id,groupId:n,userInfoId:e.userInfo.id}),e.onDelete(n)})(r.id),children:(0,i.jsx)(Yl,{icon:"trash-can"})})})]},r.id))}),title:t("groupes_34813")}):null},a5=e=>{const{translate:n}=Kl(),{organization:t,roles:s}=XS(),{canOrganizationUserEdit:o}=ay(),{mutate:a}=Yd(),{mutate:r}=Hd(),d=e.userOrganization.group,[l,c]=(0,V.useState)(e.userOrganization.role.id),[u,m]=(0,V.useState)(e.userOrganization.sendNotifications),g=(n,i)=>a({organizationId:t.id,scope:se.Organization,id:e.userOrganization.id,sendNotifications:n,roleId:i});return(0,i.jsxs)(km,{children:[(0,i.jsx)($m,{children:d?(0,i.jsxs)(Tl,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(Mr,{ellipsis:!0,children:s.organizationRoles.find(({id:e})=>e===l)?.name}),(0,i.jsx)(t5,{group:d})]}):(0,i.jsx)(Up,{shouldParseAsInt:!0,state:o?"active":"disabled",value:l,onChange:e=>(c(e),g(u,e)),children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)($m,{children:(0,i.jsx)(np,{disabled:!o||!!d,value:u,onChange:e=>(m(e),g(e,l)),children:n("activer_38612")})}),o&&(0,i.jsx)(Qm,{justify:"center",children:!d&&(0,i.jsx)(Mr,{color:"error700",onClick:async()=>{await r({organizationId:t.id,scope:se.Organization,id:e.userOrganization.id}),e.onDelete(e.userOrganization.id)},children:(0,i.jsx)(Yl,{icon:"trash-can"})})})]})},r5=e=>{const{translate:n}=Kl(),{organization:t}=XS(),{canOrganizationUserEdit:s}=ay(),[o,a]=(0,V.useState)(e.userInfo.usersOrganizations),r=e=>{a(n=>n.filter(n=>n.id!==e))};return(0,i.jsx)(Nm,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:n("r_le_59302")}),(0,i.jsx)(Gm,{children:n("notifications_98765")}),s&&(0,i.jsx)(Gm,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:o.filter(n=>!n.group||!e.removedGroupsIds.includes(n.group.id)).map((n,t)=>(0,i.jsx)(a5,{userId:e.userInfo.userId,userOrganization:n,onDelete:r},t))}),title:t.name})},d5=e=>{const{translate:n}=Kl(),{organization:t}=XS(),{canOrganizationUserEdit:s}=ay(),[o,a]=(0,V.useState)(e.userInfo.groups),r=e.userInfo.groups.filter(({id:e})=>!o.some(n=>n.id===e)).map(({id:e})=>e);return(0,i.jsxs)(gp,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Yy,{children:e.userInfo.nameOrEmail}),(0,i.jsxs)(hp,{css:{gap:"$4",py:"$6"},children:[Yo(e.userInfo.usersOrganizations)&&(0,i.jsx)(r5,{removedGroupsIds:r,userInfo:e.userInfo}),(0,i.jsx)(o5,{groups:o,userInfo:e.userInfo,onDelete:e=>{a(n=>n.filter(n=>n.id!==e))}}),t.events.nodes.map(n=>(0,i.jsx)(s5,{event:n,removedGroupsIds:r,userInfo:e.userInfo},n.id)),s&&(0,i.jsx)(zN,{usersInfosIds:[e.userInfo.id],onClose:e.onClose})]}),(0,i.jsx)(pp,{children:(0,i.jsx)(Tl,{gap:"3",justify:"end",children:(0,i.jsx)(tc,{color:"white",onClick:e.onClose,children:n("fermer_62479")})})})]})},l5=e=>{const[n,t]=(0,V.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(km,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>t(!0),children:[(0,i.jsx)($m,{children:(0,i.jsx)(My,{size:32,userInfo:e.userInfo})}),(0,i.jsx)(CA,{userPermissions:e.userInfo}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Qm,{justify:"end",children:(0,i.jsx)(n5,{reload:e.reload,userInfo:e.userInfo})})})]}),n&&(0,i.jsx)(d5,{userInfo:e.userInfo,onClose:()=>{e.reloadUserInfo(e.userInfo.id),t(!1)}})]})},c5=e=>{const{translate:n}=Kl(),{organization:t}=XS(),{showNotification:s}=AS(),{onClose:o}=ux(),{mutate:a,isLoading:r}=function(e={}){return Ui("mutation OrganizationInvite(\n $organizationId: OrganizationId!\n $email: UserEmail!\n $roleId: RoleId!\n) {\n organizationInvite(organizationId: $organizationId, email: $email, roleId: $roleId) {\n id\n }\n}\n",e)}(),{mutate:d,isLoading:l}=function(e={}){return Ui("mutation EventInvite($eventId: EventId!, $email: UserEmail!, $roleId: RoleId!) {\n eventInvite(eventId: $eventId, email: $email, roleId: $roleId) {\n id\n }\n}\n",e)}(),{mutate:c,isLoading:m}=function(e={}){return Ui("mutation OrganizationInviteGroups(\n $organizationId: OrganizationId!\n $email: UserEmail!\n $groupsIds: [GroupId!]!\n) {\n organizationInviteGroups(organizationId: $organizationId, email: $email, groupsIds: $groupsIds) {\n id\n }\n}\n",e)}(),{data:g}=Li("query OrganizationUserInviteGroups($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n groups {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t.id},[]);const h=(0,V.useMemo)(()=>(0,Lm.A)(g.organization?.groups.nodes??[],e=>u(e.name)),[g.organization]),p=(0,V.useMemo)(()=>h.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[h]),I=t.roles.find(e=>e.type===Vn.OrganizationAdmin),x=t.roles.find(e=>e.type===Vn.OrganizationReader),f=t.roles.find(e=>e.type===Vn.EventAdmin),j=t.roles.find(e=>e.type===Vn.EventReader),[v,S]=(0,V.useState)(""),[y,C]=(0,V.useState)(I.id),[b,A]=(0,V.useState)([]),E=t.events.nodes,[w,$]=(0,V.useState)(E[0]?.id),T=(0,V.useMemo)(()=>E.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[E]),z=function(e){return _.test(e)}(v)&&("groups"!==y||Yo(b));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(px,{icon:"user-plus",children:n("inviter_un_util_06611")}),(0,i.jsxs)(hx,{gap:"6",children:[(0,i.jsx)(wc,{isEmail:!0,label:n("Email"),value:v,onChange:S}),(0,i.jsxs)(Tl,{direction:"column",children:[(0,i.jsx)(Mr,{font:"gray800 textSm medium",children:n("quel_r_le_souha_92592")}),(0,i.jsx)(Pl,{height:"2"}),(0,i.jsx)(cm,{state:y===I.id?"checked":"unchecked",onClick:()=>C(I.id),children:I.name}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:y===x.id?"checked":"unchecked",onClick:()=>C(x.id),children:x.name}),Yo(E)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:y===f.id?"checked":"unchecked",onClick:()=>C(f.id),children:f.name}),y===f.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Up,{shouldParseAsInt:!0,value:w,onChange:$,children:T})})]}),(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:y===j.id?"checked":"unchecked",onClick:()=>C(j.id),children:j.name}),y===j.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Up,{shouldParseAsInt:!0,value:w,onChange:$,children:T})})]})]}),Yo(h)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"3"}),(0,i.jsx)(cm,{state:"groups"===y?"checked":"unchecked",onClick:()=>C("groups"),children:n("acc_s_des_gro_61187")}),"groups"===y&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Tl,{css:{paddingLeft:"$6"},direction:"column",children:(0,i.jsx)(_m,{isSearchVisible:!0,multiple:!0,placeholder:n("SĂ©lectionner des groupes"),renderOnPortal:!0,values:b,onChange:A,children:p})})]})]})]})]}),(0,i.jsx)(gx,{children:(0,i.jsx)(tc,{disabled:!z,isLoading:r||l||m,onClick:async()=>{if("groups"===y)await c({organizationId:t.id,email:v,groupsIds:b}),s(n("_1_a_t_invit_99808",v,h.filter(e=>b.includes(e.id)).map(e=>e.name).join(", ")));else{const e=t.roles.find(e=>e.id===y);if(y===I.id||y===x.id)await a({organizationId:t.id,email:v,roleId:y}),s(n("_1_a_t_invit_38156",v,e.name));else{const t=E.find(e=>e.id===w);await d({eventId:w,email:v,roleId:y}),s(n("_1_a_t_invit_15646",v,e.name,t.name))}}e.reload(),o()},children:n("inviter_35349")})})]})},u5=e=>{const{translate:n}=Kl();return(0,i.jsxs)(by,{gap:"6",children:[(0,i.jsx)(Mr,{css:{flex:"1"},font:"gray900 displayXs medium",children:n("utilisateurs_04975")}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_USER_EDIT,children:(0,i.jsxs)(xx,{children:[(0,i.jsx)(fx,{children:(0,i.jsx)(tc,{children:n("inviter_un_util_06611")})}),(0,i.jsx)(Ix,{children:(0,i.jsx)(c5,{reload:e.reload})})]})})]})},m5=()=>{const{translate:e,params:{organizationId:n}}=Kl(),{organization:t,roles:s}=XS(),[o,a]=(0,V.useState)(!0),[r,d,l]=Wm(""),[c,u]=(0,V.useState)(-1),[m,h]=(0,V.useState)(-1),[p,I]=(0,V.useState)(Tm),[x,f]=(0,V.useState)(0),{data:_,isLoading:j,reload:v}=Li("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:n,hasRole:o,name:g(d)?d:void 0,roleId:-1!==c?c:void 0,eventId:-1!==m?m:void 0,limit:p,offset:x},[$o.UserInfoOrganizationFragment]);const{numberOfPages:S,totalCount:y}=Sx(_.organization?.usersInfos),[C,b]=(0,V.useState)([]),[A,E]=(0,V.useState)({}),w=(0,V.useCallback)(async e=>{E(n=>({...n,[e]:!0}));const{organization:{userInfo:n}}=await function(e,n){return oa("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:n||void 0,fragments:[$o.UserInfoOrganizationFragment]})}({organizationId:t.id,userInfoId:e},await X());b(t=>t.map(t=>t.id===e?n:t)),E(n=>({...n,[e]:!1}))},[t]);return(0,V.useEffect)(()=>{b(_.organization?.usersInfos.nodes??[])},[_.organization]),(0,i.jsxs)(Ay,{css:{overflowY:"auto"},children:[(0,i.jsx)(u5,{reload:v}),(0,i.jsx)(yy,{children:(0,i.jsx)(Nm,{filters:(0,i.jsxs)(Tl,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Mr,{width:300,children:(0,i.jsx)(wc,{icon:"magnifying-glass",placeholder:e("rechercher_un_m_05904"),value:r,onChange:l})}),(0,i.jsx)(Mr,{css:{flex:"1"}}),(0,i.jsx)(om,{state:o?"checked":"unchecked",onClick:e=>a("checked"===e),children:e("seulement_les_u_63675")}),(0,i.jsx)(Mr,{width:240,children:(0,i.jsxs)(_m,{isSearchVisible:!0,menuWidth:492,renderOnPortal:!0,values:[c],onChange:e=>{Yo(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)(Mr,{width:240,children:(0,i.jsxs)(_m,{isSearchVisible:!0,menuWidth:492,renderOnPortal:!0,values:[m],onChange:e=>{Yo(e)&&h(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),t.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:`${e.name} (${e.id})`},e.id))]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gm,{children:e("full_name")}),(0,i.jsx)(Gm,{children:e("r_les_61679")}),(0,i.jsx)(ly,{permissions:sy.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Gm,{width:100})})]}),limit:p,numberOfPages:S,offset:x,rows:j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0}),(0,i.jsx)(qm,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:C.map(e=>A[e.id]?(0,i.jsx)(qm,{bx:!0},e.id):(0,i.jsx)(l5,{reload:v,reloadUserInfo:w,userInfo:e},e.id))}),setLimit:I,setOffset:f,totalCount:y})})]})},g5=()=>{const{translate:e,params:{organizationId:n}}=Kl();Au(e("param_tres_78420"));const{hasFeature:t}=XS(),{canOrganizationParamRead:s,canOrganizationUserRead:o}=ay();return(0,i.jsxs)(Tl,{height:1,width:1,children:[(0,i.jsx)(M3,{}),(0,i.jsx)(Mr,{css:{flex:"1"},height:1,children:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(P3,{})}),s&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_INFOS(":organizationId"),children:(0,i.jsx)(E3,{})}),o&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_TEAM(":organizationId"),children:(0,i.jsx)(m5,{})}),o&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_ROLES(":organizationId"),children:(0,i.jsx)(U3,{})}),o&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_GROUPS(":organizationId"),children:(0,i.jsx)(b3,{})}),s&&(0,i.jsx)(kr.qh,{path:yo.ORGANIZATION_PARAMETERS_EMAILS(":organizationId"),children:(0,i.jsx)(o3,{})}),s&&(0,i.jsx)(kr.qh,{path:us.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:":organizationId"}),children:(0,i.jsx)(Ay,{children:(0,i.jsx)(_3,{})})}),s&&(0,i.jsx)(kr.qh,{path:us.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(Ay,{children:(0,i.jsx)(O3,{})})}),s&&t(Ze.Delegation)&&(0,i.jsx)(kr.qh,{path:us.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(Ay,{children:(0,i.jsx)(X4,{})})}),s&&(0,i.jsx)(kr.qh,{path:yo.ORGANIZATION_PARAMETERS_CATEGORIES(":organizationId"),children:(0,i.jsx)(q4,{})}),s&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_TAGS(":organizationId"),children:(0,i.jsx)(H3,{})}),s&&(0,i.jsx)(kr.qh,{path:yo.ORGANIZATION_PARAMETERS_TRANSLATIONS(":organizationId"),children:(0,i.jsx)(e5,{})}),s&&o&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_INVOICES(":organizationId"),children:(0,i.jsx)(w3,{})}),s&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_ACTIVITY(":organizationId"),children:(0,i.jsx)(R4,{})}),s&&t(Ze.Skidata)&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.ORGANIZATION_PARAMETERS_SKIDATA(":organizationId"),children:(0,i.jsx)(W3,{})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.ORGANIZATION_PARAMETERS_PROFILE(n)})})]})})]})},h5=Object.keys(sy).length/2;function p5(e){return new Array(h5).fill("0").map((n,t)=>e.includes(t)?"1":"0").join("")}const I5=p5([sy.POSITION_READ,sy.POSITION_EDIT,sy.MEMBER_EDIT,sy.MEMBER_ASSIGNMENT_STATE_EDIT,sy.COMMENT_READ,sy.COMMENT_ADD,sy.MEMBER_AVAILABILITIES_EDIT,sy.MEMBER_ASSIGN,sy.CAMPAIGN_SEND,sy.ACCREDITATION_READ,sy.ACCREDITATION_EDIT,sy.MEMBER_ACCREDIT,sy.DELEGATION_READ,sy.DELEGATION_EDIT,sy.FORM_READ,sy.FORM_EDIT,sy.EMAIL_EDIT,sy.CAMPAIGN_READ,sy.DOCUMENT_READ,sy.DOCUMENT_EDIT,sy.WORKFLOW_READ,sy.WORKFLOW_EDIT,sy.CUSTOM_FIELD_READ,sy.CUSTOM_FIELD_EDIT,sy.SEGMENT_EDIT,sy.MEMBER_CREATE,sy.MEMBER_DELETE,sy.EVENT_EDIT,sy.ORGANIZATION_PARAM_READ,sy.ORGANIZATION_PARAM_EDIT,sy.ORGANIZATION_USER_READ,sy.ORGANIZATION_USER_EDIT,sy.WEEZEVENT_READ,sy.WEEZEVENT_EDIT,sy.DELEGATIONS_SPACE_PARAM_READ,sy.DELEGATIONS_SPACE_PARAM_EDIT,sy.PRINT_CONFIG_READ,sy.PRINT_CONFIG_EDIT,sy.PRINT,sy.TICKET_ID_REGENERATE]),x5=p5([sy.POSITION_READ,sy.COMMENT_READ,sy.ACCREDITATION_READ,sy.DELEGATION_READ,sy.FORM_READ,sy.CAMPAIGN_READ,sy.DOCUMENT_READ,sy.WORKFLOW_READ,sy.CUSTOM_FIELD_READ,sy.ORGANIZATION_PARAM_READ,sy.ORGANIZATION_USER_READ,sy.WEEZEVENT_READ,sy.DELEGATIONS_SPACE_PARAM_READ,sy.PRINT_CONFIG_READ]),f5=p5([sy.POSITION_READ,sy.POSITION_EDIT,sy.MEMBER_EDIT,sy.MEMBER_ASSIGNMENT_STATE_EDIT,sy.COMMENT_READ,sy.COMMENT_ADD,sy.MEMBER_AVAILABILITIES_EDIT,sy.MEMBER_ASSIGN,sy.CAMPAIGN_SEND,sy.ACCREDITATION_READ,sy.ACCREDITATION_EDIT,sy.MEMBER_ACCREDIT,sy.DELEGATION_READ,sy.DELEGATION_EDIT,sy.FORM_READ,sy.FORM_EDIT,sy.EMAIL_EDIT,sy.CAMPAIGN_READ,sy.DOCUMENT_READ,sy.DOCUMENT_EDIT,sy.WORKFLOW_READ,sy.WORKFLOW_EDIT,sy.CUSTOM_FIELD_READ,sy.CUSTOM_FIELD_EDIT,sy.SEGMENT_EDIT,sy.MEMBER_CREATE,sy.MEMBER_DELETE,sy.WEEZEVENT_READ,sy.WEEZEVENT_EDIT,sy.DELEGATIONS_SPACE_PARAM_READ,sy.DELEGATIONS_SPACE_PARAM_EDIT,sy.PRINT_CONFIG_READ,sy.PRINT_CONFIG_EDIT,sy.PRINT,sy.TICKET_ID_REGENERATE]),_5=p5([sy.POSITION_READ,sy.COMMENT_READ,sy.ACCREDITATION_READ,sy.DELEGATION_READ,sy.FORM_READ,sy.CAMPAIGN_READ,sy.DOCUMENT_READ,sy.WORKFLOW_READ,sy.WEEZEVENT_READ,sy.DELEGATIONS_SPACE_PARAM_READ,sy.PRINT_CONFIG_READ]),j5=p5([sy.POSITION_READ,sy.POSITION_EDIT,sy.COMMENT_READ,sy.MEMBER_ASSIGN,sy.CAMPAIGN_SEND,sy.CAMPAIGN_READ]),v5=p5([sy.POSITION_READ,sy.COMMENT_READ]),S5=p5([sy.DELEGATION_READ]);let y5=class extends Rc{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",accessLevel:e?.accessLevel??Un.Position,permissions:e?.permissions??j5}}schema(){return zc.Ik().shape({role:zc.Ik().shape({name:zc.Yj().required(this.t("le_nom_est_requ_61536")),description:zc.Yj().required(this.t("la_description_46559")),accessLevel:zc.Yj().required(this.t("le_niveau_d_acc_94726")).oneOf(hi,this.t("le_niveau_d_acc_94726")),permissions:zc.Yj().matches(new RegExp(`^[01]{${h5}}$`),this.t("le_format_des_p_68818")).required(this.t("le_format_des_p_68818"))}).required()}).required()}};y5=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],y5);const C5=({children:e,disabled:n,permission:t,subtext:s,permissions:o,change:a})=>(0,i.jsx)(np,{css:{alignItems:"start","> *:first-child":{margin:"2px 0"}},disabled:n,subtext:s,value:"1"===o[t],onChange:e=>a("role.permissions",function(e,n,t){return[...e].toSpliced(n,1,t).join("")}(o,t,e?"1":"0")),children:e}),b5=e=>{const{translate:n}=Kl(),t=e.roleInput.accessLevel;return(0,i.jsxs)(sf,{heading:n("accr_ditations_39450"),children:[(0,i.jsxs)(wb,{heading:n("accr_ditations_39450"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.ACCREDITATION_READ,permissions:e.roleInput.permissions,children:n("voir_les_accr_d_34867")}),t!==Un.DelegationCategory&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.ACCREDITATION_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_accr_86042")})]}),(0,i.jsx)(wb,{heading:n("mod_ration_09947"),children:(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.MEMBER_ACCREDIT,permissions:e.roleInput.permissions,children:n("accr_diter_les_48281")})})]})},A5=e=>{const n=Fi(),t=e.roleInput.accessLevel===Un.Organization||e.roleInput.accessLevel===Un.Event,s=e.roleInput.accessLevel===Un.Organization||e.roleInput.accessLevel===Un.Event,o=e.roleInput.accessLevel===Un.DelegationCategory,a=!o,r=e.roleInput.accessLevel===Un.Organization||e.roleInput.accessLevel===Un.Event||o,d=!o;return(0,i.jsxs)(sf,{heading:n("communication_05277"),children:[t&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(wb,{heading:n("Form_plural"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.FORM_READ,permissions:e.roleInput.permissions,children:n("voir_les_formul_55824")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.FORM_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_form_10612")})]})}),a&&(0,i.jsxs)(wb,{heading:n("Campaigns"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.CAMPAIGN_READ,permissions:e.roleInput.permissions,children:n("voir_les_campag_02148")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.CAMPAIGN_SEND,permissions:e.roleInput.permissions,children:n("envoyer_une_cam_35768")})]}),s&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(wb,{heading:n("e_mails_09850"),children:(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.EMAIL_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_e_ma_05609")})})}),r&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(wb,{heading:n("Documents"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.DOCUMENT_READ,permissions:e.roleInput.permissions,children:n("voir_les_docume_33988")}),d&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.DOCUMENT_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_docu_87778")})]})})]})},E5=()=>{const e=Fi();return(0,i.jsx)(sf,{heading:e("communication_05277"),children:(0,i.jsx)(wb,{heading:e("Campaigns"),children:(0,i.jsx)(Qu,{borderRadius:"$1",height:20})})})},w5=e=>{const n=Fi();return(0,i.jsx)(sf,{heading:n("informations_su_20567"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)($c,{disabled:e.disabled,label:n("nom_du_r_le_38492"),name:"role.name"}),(0,i.jsx)(rf,{disabled:e.disabled,label:n("Description"),name:"role.description"}),(0,i.jsxs)(ny,{label:n("niveau_d_acc_s_29898"),name:"role.accessLevel",state:e.disabled||e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:Un.Organization,children:n("administrateur_10076")}),(0,i.jsx)("option",{value:Un.Event,children:n("administrateur_99393")}),(0,i.jsx)("option",{value:Un.Position,children:n("responsable_de_82794")}),(0,i.jsx)("option",{value:Un.DelegationCategory,children:n("responsable_de_75445")})]})]})})},$5=()=>{const e=Fi();return(0,i.jsx)(sf,{heading:e("informations_su_20567"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"6",children:[(0,i.jsx)(Qu,{borderRadius:"$2",height:64,width:"100%"}),(0,i.jsx)(Qu,{borderRadius:"$2",height:126,width:"100%"})]})})},T5=e=>{const n=Fi(),{user:t}=Yi(),s=e.roleInput.accessLevel,o=s===Un.Organization||s===Un.Event,a=s===Un.Organization||s===Un.Event||s===Un.Position,r=s===Un.Organization||s===Un.Event||s===Un.Position,d=s===Un.Organization||s===Un.Event||s===Un.DelegationCategory,l=s===Un.Organization||s===Un.Event,c=s===Un.Organization||s===Un.Event,u=s===Un.Organization||s===Un.Event,m=(0,kl.A)([(0,i.jsxs)(wb,{heading:n("membres_11310"),children:[o&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.MEMBER_CREATE,permissions:e.roleInput.permissions,children:n("cr_er_des_membr_28893")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.MEMBER_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_memb_39894")}),o&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.MEMBER_DELETE,permissions:e.roleInput.permissions,children:n("supprimer_les_m_98024")}),a&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.MEMBER_AVAILABILITIES_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_disp_75220")}),o&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.TICKET_ID_REGENERATE,permissions:e.roleInput.permissions,children:n("r_g_n_rer_le_co_27385")})]},"members"),r?(0,i.jsxs)(wb,{heading:n("commentaires_96492"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.COMMENT_READ,permissions:e.roleInput.permissions,subtext:n("sans_cette_perm_08373",n("Private")),children:n("lire_les_commen_55215")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.COMMENT_ADD,permissions:e.roleInput.permissions,children:n("ajouter_et_supp_32493")})]}):null,d?(0,i.jsxs)(wb,{heading:n("d_l_gations_78318"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.DELEGATION_READ,permissions:e.roleInput.permissions,children:n("voir_les_d_l_ga_71959")}),s!==Un.DelegationCategory&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.DELEGATION_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_d_l_60281")}),l&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.DELEGATIONS_SPACE_PARAM_READ,permissions:e.roleInput.permissions,children:n("voir_les_param_20270")}),l&&(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.DELEGATIONS_SPACE_PARAM_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_para_51447")})]}):null,c?(0,i.jsx)(wb,{heading:n("vues_personnali_80652"),children:(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.SEGMENT_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_vues_70658")})}):null,u?(0,i.jsxs)(wb,{heading:n("champs_de_formu_64126"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.CUSTOM_FIELD_READ,permissions:e.roleInput.permissions,children:n("voir_les_champs_59185")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.CUSTOM_FIELD_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_cham_47733")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled||(g=t.email,!["aurelie.priez@weezevent.com","benjamin.vuitton@weezevent.com","florent.odier@weezevent.com","jean-charles.wielfaert@weezevent.com","lucie.doumeng@gmail.com","marie.wielfaert@weezevent.com","matthieu.ravey@weezevent.com","victor.gasquet@weezevent.com"].includes(g)),permission:sy.CUSTOM_FIELD_DECRYPT,permissions:e.roleInput.permissions,children:n("d_chiffrer_les_23688")})]}):null]);var g;return(0,i.jsx)(sf,{heading:n("population_38615"),children:m.map((e,n)=>(0,i.jsx)(V.Fragment,{children:e},n))})},z5=()=>{const e=Fi();return(0,i.jsxs)(sf,{heading:e("membres_11310"),subtitle:e("permissions_rel_37045"),children:[(0,i.jsx)(wb,{heading:e("profil_du_membr_68116"),children:(0,i.jsx)(Qu,{borderRadius:"$1",height:20})}),(0,i.jsxs)(wb,{heading:e("commentaires_96492"),children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:40}),(0,i.jsx)(Qu,{borderRadius:"$1",height:20})]}),(0,i.jsx)(wb,{heading:e("disponibilit_s_49923"),children:(0,i.jsx)(Qu,{borderRadius:"$1",height:20})})]})},O5=e=>{const{translate:n}=Kl();return(0,i.jsxs)(sf,{heading:n("options_53186"),children:[(0,i.jsxs)(wb,{heading:n("automatisations_60045"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.WORKFLOW_READ,permissions:e.permissions,children:n("voir_les_automa_58340")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.WORKFLOW_EDIT,permissions:e.permissions,children:n("_diter_les_auto_80436")})]}),(0,i.jsxs)(wb,{heading:"Weezeent",children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.WEEZEVENT_READ,permissions:e.permissions,children:n("voir_les_param_22835")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.WEEZEVENT_EDIT,permissions:e.permissions,children:n("_diter_les_para_16626")})]}),(0,i.jsxs)(wb,{heading:n("printing_06197"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.PRINT_CONFIG_READ,permissions:e.permissions,children:n("read_the_config_50527")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.PRINT_CONFIG_EDIT,permissions:e.permissions,children:n("edit_the_config_24355")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.PRINT,permissions:e.permissions,children:n("print_22517")})]})]})},R5=e=>{const{translate:n}=Kl();return(0,i.jsxs)(sf,{heading:n("organisation_71863"),children:[(0,i.jsx)(wb,{heading:n("_v_nements_53672"),children:(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.EVENT_EDIT,permissions:e.permissions,children:n("_diter_les_v_n_84914")})}),(0,i.jsxs)(wb,{heading:n("param_tres_78420"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.ORGANIZATION_PARAM_READ,permissions:e.permissions,children:n("voir_les_param_41674")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.ORGANIZATION_PARAM_EDIT,permissions:e.permissions,children:n("_diter_les_para_86184")})]}),(0,i.jsxs)(wb,{heading:n("utilisateurs_et_83787"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.ORGANIZATION_USER_READ,permissions:e.permissions,children:n("voir_les_utilis_06462")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.ORGANIZATION_USER_EDIT,permissions:e.permissions,children:n("_diter_les_util_98017")})]})]})},D5=e=>{const n=Fi();return(0,i.jsxs)(sf,{heading:n("missions_63972"),children:[(0,i.jsxs)(wb,{heading:n("missions_63972"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.POSITION_READ,permissions:e.permissions,children:n("voir_les_missio_71964")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.POSITION_EDIT,permissions:e.permissions,subtext:n("si_le_r_le_est_05344"),children:n("_diter_les_miss_75420")})]}),(0,i.jsxs)(wb,{heading:n("affectation_plural"),children:[(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.MEMBER_ASSIGN,permissions:e.permissions,children:n("affecter_des_me_26669")}),(0,i.jsx)(C5,{change:e.change,disabled:e.disabled,permission:sy.MEMBER_ASSIGNMENT_STATE_EDIT,permissions:e.permissions,subtext:n("permet_notammen_90746",n("PreAssigned")),children:n("changer_le_stat_34124")})]})]})},M5=()=>{const e=Fi();return(0,i.jsxs)(sf,{heading:e("missions_63972"),children:[(0,i.jsx)(wb,{heading:e("informations_su_61022"),children:(0,i.jsx)(Qu,{borderRadius:"$1",height:60})}),(0,i.jsxs)(wb,{heading:e("affectation"),children:[(0,i.jsx)(Qu,{borderRadius:"$1",height:20}),(0,i.jsx)(Qu,{borderRadius:"$1",height:40})]})]})},P5=e=>{const{translate:n}=Kl(),t=e.values.role.accessLevel,s=t===Un.Organization,o=t===Un.Organization||t===Un.Event||t===Un.Position,a=t===Un.Organization||t===Un.Event||t===Un.DelegationCategory,r=t===Un.Organization||t===Un.Event||t===Un.Position||t===Un.DelegationCategory,d=t===Un.Organization||t===Un.Event;return(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(hc,{}),(0,i.jsx)(Zr.Yr,{name:"role.accessLevel",children:n=>{n===Un.Organization?e.change("role.permissions",I5):n===Un.Event?e.change("role.permissions",f5):n===Un.DelegationCategory?e.change("role.permissions",S5):n===Un.Position&&e.change("role.permissions",j5)}}),!e.isCustom&&(0,i.jsxs)(lc,{alertStyle:"warning",children:[(0,i.jsx)(cc,{children:n("impossible_de_m_46897")}),(0,i.jsx)(uc,{children:n("ce_r_le_est_pr_71742")})]}),(0,i.jsx)(w5,{disabled:e.disabled,isEdit:e.isEdit}),(0,i.jsx)(T5,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),s&&(0,i.jsx)(R5,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),o&&(0,i.jsx)(D5,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),a&&(0,i.jsx)(b5,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),r&&(0,i.jsx)(A5,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),d&&(0,i.jsx)(O5,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),e.children]})},k5=({children:e})=>(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)($5,{}),(0,i.jsx)(z5,{}),(0,i.jsx)(M5,{}),(0,i.jsx)(E5,{}),e]}),F5=()=>{const{history:e,translate:n,params:{organizationId:t}}=Kl(),s=(0,V.useRef)(null),o=ki(y5),{mutate:a}=function(e={}){return Ui("mutation RoleCreate($organizationId: OrganizationId!, $role: RoleInput!) {\n roleCreate(organizationId: $organizationId, role: $role) {\n id\n }\n}\n",e)}(),{showNotification:r}=AS(),{reload:d}=XS();return Au(n("cr_ation_d_un_r_27933")),(0,i.jsx)(xc,{customErrorRef:s,height:1,initialValues:{role:o.default(null)},render:({form:e,handleSubmit:o,submitting:a,values:r})=>(0,i.jsx)(Hx,{category:n("cr_ation_d_un_r_27933"),color:"dark",fallbackClosePath:yo.ORGANIZATION_PARAMETERS_ROLES(t),heading:n("nouveau_r_le_20981"),children:(0,i.jsx)(Gx,{ref:s,children:(0,i.jsx)(P5,{change:e.change,disabled:!1,isCustom:!0,isEdit:!1,values:r,children:(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:a,textAlign:"center",onClick:o,children:n("cr_er_le_r_le_55678")})})})})}),schema:o.schema(),onSubmit:async({role:i})=>{await a({organizationId:t,role:i}),d(),r({color:"success",text:n("le_r_le_a_bien_55424")}),e.goBack(yo.ORGANIZATION_PARAMETERS_ROLES(t))}})},N5=()=>{const{history:e,translate:n,params:{organizationId:t,roleId:s}}=Kl(),o=(0,V.useRef)(null),a=ki(y5),{mutate:r}=function(e={}){return Ui("mutation RoleUpdate($organizationId: OrganizationId!, $roleId: RoleId!, $role: RoleInput!) {\n roleUpdate(organizationId: $organizationId, roleId: $roleId, role: $role) {\n id\n }\n}\n",e)}(),{data:d,isLoading:l}=Li("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:t,roleId:s},[]),{canOrganizationUserEdit:c}=ay(),{showNotification:u}=AS();Au(n("mise_jour_de_17055",d.organization?.role.name));const m=(0,V.useMemo)(()=>c&&d.organization?.role.type===Vn.Custom,[d.organization,c]);return l?(0,i.jsx)(L5,{}):(0,i.jsx)(xc,{customErrorRef:o,height:1,initialValues:{role:a.default(d.organization.role)},render:({form:e,handleSubmit:s,submitting:a,values:r})=>(0,i.jsx)(Hx,{button:m?(0,i.jsx)(tc,{css:{flexShrink:0},isLoading:a,onClick:s,children:n("modifier_le_r_l_58957")}):void 0,category:n("mise_jour_de_17055",d.organization.role.name),color:"dark",fallbackClosePath:yo.ORGANIZATION_PARAMETERS_ROLES(t),heading:d.organization.role.name,children:(0,i.jsx)(Gx,{ref:o,children:(0,i.jsx)(P5,{change:e.change,disabled:!m,isCustom:d.organization.role.type===Vn.Custom,isEdit:!0,values:r,children:m&&(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{isLoading:a,textAlign:"center",onClick:s,children:n("modifier_le_r_l_58957")})})})})}),schema:a.schema(),onSubmit:async({role:i})=>{m&&(await r({organizationId:t,roleId:s,role:i}),u({color:"success",text:n("le_r_le_a_bien_48312")}),e.goBack(yo.ORGANIZATION_PARAMETERS_ROLES(t)))}})},L5=()=>{const{organizationId:e}=Vi();return(0,i.jsx)(Hx,{fallbackClosePath:yo.ORGANIZATION_PARAMETERS_ROLES(e),heading:(0,i.jsx)(Qu,{borderRadius:"$1",height:39,width:400}),children:(0,i.jsx)(Gx,{children:(0,i.jsx)(k5,{})})})};var U5,V5,B5,W5,G5,q5,H5,Y5,Z5,K5,X5,Q5,J5,e6,n6,t6,i6,s6,o6,a6,r6,d6,l6,c6,u6,m6,g6,h6,p6,I6,x6,f6,_6,j6,v6,S6,y6,C6,b6,A6,E6,w6,$6,T6,z6,O6,R6,D6,M6,P6,k6,F6,N6,L6,U6,V6,B6,W6,G6,q6,H6,Y6,Z6,K6,X6,Q6,J6,e8,n8,t8,i8,s8,o8,a8,r8,d8,l8,c8,u8,m8,g8,h8,p8,I8,x8,f8,_8,j8,v8,S8,y8,C8,b8,A8,E8,w8,$8,T8,z8,O8,R8,D8,M8,P8,k8,F8,N8,L8,U8,V8,B8,W8,G8,q8,H8,Y8,Z8,K8,X8,Q8,J8,e7,n7,t7,i7,s7,o7,a7,r7,d7,l7,c7,u7,m7,g7,h7,p7,I7,x7,f7,_7,j7,v7,S7,y7,C7,b7,A7,E7,w7,$7,T7,z7,O7,R7,D7,M7,P7,k7,F7,N7,L7,U7,V7,B7,W7;function G7(){return G7=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const e=Fi();return(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Tl,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(Mr,{css:{"& svg":{height:"100%",width:"100%"}},height:140,width:180,children:(0,i.jsx)(q7,{})}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_85226",uu)}),(0,i.jsxs)(Mr,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",mu,uu)]})]})})};var Y7;function Z7(){return Z7=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const e=Fi();return(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Tl,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(Mr,{width:280,children:(0,i.jsx)(K7,{})}),(0,i.jsx)(Mr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_64779",uu)}),(0,i.jsxs)(Mr,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",mu,uu)]})]})})},Q7=()=>{const e=Fi(),{user:n}=Yi();return(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("accepter_a_hre_50341",gu(cu(n?.language,new URL(location.href).searchParams)),uu)}})},J7=()=>{const{history:e,translate:n,params:{organizationId:t}}=Kl(),{data:s,loader:o}=Li('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:t},[]),a=ki(AR),r=ki(Ol),{mutate:d}=function(e={}){return Ui("mutation UserInfoAndTermsUpdate(\n $userInfoId: UsersInfoId!\n $userInfoAndTermsInput: UserInfoAndTermsInput!\n) {\n userInfoAndTermsUpdate(userInfoId: $userInfoId, userInfoAndTermsInput: $userInfoAndTermsInput) {\n id\n }\n}\n",e)}(),l=(0,V.useRef)(null),{reload:c}=XS();return o||(0,i.jsx)(xc,{customErrorRef:l,height:1,initialValues:{userInfoAndTerms:a.userInfoAndTermsInputDefault(s.user)},render:({handleSubmit:e})=>(0,i.jsxs)(H_,{ref:l,onClose:J,children:[(0,i.jsx)(hc,{}),(0,i.jsx)(sf,{centerHeader:!0,heading:n("conditions_g_n_79662"),subtitle:n("accepter_nos_co_49122"),children:(0,i.jsxs)(Tl,{direction:"column",gap:"4",children:[(0,i.jsx)(Xx,{name:"userInfoAndTerms.termsAccepted",shouldPreventDefault:!1,children:(0,i.jsx)(Q7,{})}),(0,i.jsxs)(Tl,{gap:"4",children:[(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:n("pr_nom_66988")}),name:"userInfoAndTerms.firstName"}),(0,i.jsx)($c,{label:(0,i.jsx)(Uv,{children:n("last_name")}),name:"userInfoAndTerms.lastName"})]}),(0,i.jsx)(tj,{label:(0,i.jsx)(Uv,{children:n("Phone")}),prefix:"userInfoAndTerms.phone."})]})}),(0,i.jsx)(Yx,{children:(0,i.jsx)(tc,{textAlign:"center",onClick:e,children:n("mettre_jour_85141")})})]}),validate:r.validateForForm(a.updateUserInfoAndTermsSchema()),width:1,onSubmit:async n=>{await d({userInfoId:s.user.userInfo.id,userInfoAndTermsInput:n.userInfoAndTerms}),c(),e.location.state?e.push(e.location.state):e.push(us.ORGANIZATION({organizationId:t}))}})},e9=()=>{const{organization:e}=XS(),{canCustomFieldEdit:n,canCustomFieldRead:t,canDelegationEdit:s,canEventEdit:o,canOrganizationParamEdit:a,canOrganizationParamRead:r,canOrganizationUserEdit:d,canOrganizationUserRead:l}=ay(),c=Dm();return(0,V.useEffect)(()=>{!function(e){const n=$r({colors:{...bO(e)}});document.getElementById("heavent-react-hook")?.classList.add(n.toString())}(Uj(e.id)?.theme)},[e.id]),(0,i.jsxs)(kr.dO,{children:[o&&(0,i.jsx)(kr.qh,{path:Rs.EVENTS_IMPORT({organizationId:":organizationId"}),children:(0,i.jsx)($L,{})}),o&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.CREATE_EVENT(":organizationId"),children:(0,i.jsx)(bL,{})}),o&&(0,i.jsx)(kr.qh,{exact:!0,path:yo.EDIT_EVENT(":organizationId",":eventId"),children:(0,i.jsx)(AL,{})}),s&&(0,i.jsx)(kr.qh,{path:Js.DELEGATION_CATEGORY_UPDATE({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(IL,{})}),(0,i.jsx)(kr.qh,{path:Rs.EVENTS({organizationId:":organizationId"}),children:c?(0,i.jsx)(sU,{}):(0,i.jsx)(bR,{children:(0,i.jsx)(iU,{})})}),(0,i.jsx)(kr.qh,{path:Rs.EVENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(P2,{})}),n&&(0,i.jsx)(kr.qh,{path:mj.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(Jz,{})}),n&&(0,i.jsx)(kr.qh,{path:mj.UPDATE({organizationId:":organizationId",customFieldId:":customFieldId"}),children:(0,i.jsx)(eO,{})}),t&&(0,i.jsx)(kr.qh,{path:mj.CUSTOM_FIELDS({organizationId:":organizationId"}),children:(0,i.jsx)(bR,{children:(0,i.jsx)(mL,{})})}),a&&(0,i.jsx)(kr.qh,{path:yo.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId"),children:(0,i.jsx)(t4,{})}),a&&(0,i.jsx)(kr.qh,{path:yo.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId",":emailSenderId"),children:(0,i.jsx)(i4,{})}),r&&(0,i.jsx)(kr.qh,{path:yo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(":organizationId",":emailSenderId"),children:(0,i.jsx)(s4,{})}),d&&(0,i.jsx)(kr.qh,{path:yo.CREATE_ORGANIZATION_PARAMETERS_GROUP(":organizationId"),children:(0,i.jsx)(l4,{})}),d&&(0,i.jsx)(kr.qh,{path:yo.EDIT_ORGANIZATION_PARAMETERS_GROUP(":organizationId",":groupId"),children:(0,i.jsx)(c4,{})}),d&&(0,i.jsx)(kr.qh,{path:yo.CREATE_ORGANIZATION_PARAMETERS_ROLE(":organizationId"),children:(0,i.jsx)(F5,{})}),l&&(0,i.jsx)(kr.qh,{path:yo.EDIT_ORGANIZATION_PARAMETERS_ROLE(":organizationId",":roleId"),children:(0,i.jsx)(N5,{})}),(0,i.jsx)(kr.qh,{path:yo.ORGANIZATION_PARAMETERS(":organizationId"),children:c?(0,i.jsx)($4,{}):(0,i.jsx)(bR,{children:(0,i.jsx)(g5,{})})}),(0,i.jsx)(kr.qh,{path:Rj.ORGANIZATION_MEMBERS({organizationId:":organizationId"}),children:(0,i.jsx)(J2,{})}),(0,i.jsx)(kr.qh,{path:hs.COMMUNITY({organizationId:":organizationId"}),children:(0,i.jsx)(GN,{})}),(0,i.jsx)(kr.qh,{path:us.IS_EXPIRED(us.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(bR,{children:(0,i.jsx)(X7,{})})}),(0,i.jsx)(kr.qh,{path:us.IS_BLOCKED(us.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(bR,{children:(0,i.jsx)(H7,{})})}),(0,i.jsx)(kr.qh,{exact:!0,path:yo.ACCEPT_TERMS_AND_CONDITIONS(":organizationId"),children:(0,i.jsx)(J7,{})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:Rs.EVENTS({organizationId:e.id}),replace:!0})})]})},n9=()=>(0,i.jsx)(KS,{children:(0,i.jsx)(e9,{})}),t9=()=>{const e=JSON.parse(window.HEAVENT_EXPORT_POSITIONS_MAP_DATA),[n,t]=(0,V.useState)(!1),{searchParams:s}=new URL(location.href),o=function(e){if(g(e)){const[n,t]=e.split(",");if(g(n)&&g(t)){const e=parseFloat(n),i=parseFloat(t);return isNaN(e)||isNaN(i)?null:{lat:e,lng:i}}return null}return null}(s.get("center")),a=s.get("acronymIcon")||"icon",r=s.get("zoom"),d=s.get("hiddenTracesIds")?.split(",").map(e=>parseInt(e,10))??[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(oQ,{acronymIcon:a,hiddenTracesIds:d,initialCenter:o,initialZoom:r?parseInt(r,10):null,layer:e.layer,mapOptions:{zoomControl:!1},positions:e.positions.nodes,showMarker:!1,traces:e.traces,onMapTilesloaded:()=>{t(!0)}})}),n&&(0,i.jsx)(Qr,{})]})},i9=()=>{const{eventId:e,positionId:n}=Vi(),{data:t,loader:s}=Li("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:n},[$o.TraceFragment]),[o,a]=(0,V.useState)(!1);if(s)return s;{const e=t.eventPublic.position;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Xr,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:qr(e),traces:e.traces,onTilesloaded:()=>{a(!0)}})}),o&&(0,i.jsx)(Qr,{})]})}},s9=()=>{const e=Fi(),n=new URL(location.href).searchParams,t=n.get("eventName")||n.get("organizationName")||"",s=`${F.HEAVENT_API_URL}/users/${n.get("userId")||""}/`,o=n.get("eventId")?`${s}blacklist-event?${n}`:`${s}blacklist-organization?${n}`;return(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",gap:"7",width:640,children:[(0,i.jsxs)(Tl,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray900 textXl semiBold",children:e("d_sinscription_61475")}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:e("vous_tes_sur_l_71517",t)})]}),(0,i.jsx)(tc,{color:"error",textAlign:"center",onClick:()=>{window.open(o,"_blank")},children:e("oui_je_souhait_20141")})]})})},o9=()=>{const{translate:e,params:{ticketId:n}}=Kl(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(!1),r=`${F.HEAVENT_API_URL}/users/${n}/check-in`;return(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(Tl,{justify:"center",width:1,children:o?(0,i.jsx)(Ku,{color:"success",leftIcon:"check",children:e("votre_pointage_47695")}):(0,i.jsx)(tc,{isLoading:t,leftIcon:"check",textAlign:"center",onClick:async()=>{s(!0),await fetch(r),a(!0),s(!1)},children:e("point_sur_ma_m_52527")})})})})},a9=()=>{const{translate:e,params:{ticketId:n}}=Kl(),[t,s]=(0,V.useState)(!1),[o,a]=(0,V.useState)(!1),r=`${F.HEAVENT_API_URL}/users/${n}/check-out`;return(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(Tl,{justify:"center",width:1,children:o?(0,i.jsx)(Ku,{color:"success",leftIcon:"check",children:e("votre_d_pointag_86150")}):(0,i.jsx)(tc,{isLoading:t,leftIcon:"check",textAlign:"center",onClick:async()=>{s(!0),await fetch(r),a(!0),s(!1)},children:e("d_point_sur_ma_60601")})})})})},r9=()=>{const{translate:e,params:{userInfoId:n,eventId:t}}=Kl(),s=(0,V.useMemo)(()=>new URL(location.href).searchParams.toString(),[]),[o,a]=(0,V.useState)(!1),[r,d]=(0,V.useState)(!1),[l,c]=(0,V.useState)(!1),u=`${F.HEAVENT_API_URL}/users/${n}/event/${t}/unregister?${s}`;return(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50",overflow:"hidden",px:"$3"},direction:"column",gap:"7",height:1,justify:"center",width:1,children:(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$7",width:"100%","@desktop":{width:"640px"}},direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textXl semiBold",children:e("_tes_vous_s_r_d_36428")}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{justify:"center",width:1,children:r?(0,i.jsx)(Ku,{color:"success",leftIcon:"check",children:e("vous_avez_t_d_46799")}):l?(0,i.jsx)(Ku,{color:"error",leftIcon:"triangle-exclamation",children:e("erreur_dans_le_52844")}):(0,i.jsx)(tc,{isLoading:o,leftIcon:"check",textAlign:"center",onClick:async()=>{try{a(!0),200===(await fetch(u)).status?(d(!0),a(!1)):(c(!0),a(!1))}catch{d(!0),a(!1)}},children:e("se_d_sinscrire_87896")})})]})})},d9=()=>{const{translate:e,params:{organizationId:n,userInfoId:t,customFieldSlug:s,value:o}}=Kl(),a=(0,V.useMemo)(()=>new URL(location.href).searchParams.toString(),[]),{data:r,loader:d}=rl({organizationId:n,slug:s}),[l,c]=(0,V.useState)(!1),[u,m]=(0,V.useState)(!1),[g,h]=(0,V.useState)(!1),p=r.organization?.customField.name??"",I=r.organization?.customField.description??"",x=(0,V.useMemo)(()=>{if(r.organization){const n=r.organization.customField;return n.fieldType===Qe.Select?n.values.find(({id:e})=>e===parseInt(o,10))?.value:e("je_valide_79615")}return""},[r.organization]),f=`${F.HEAVENT_API_URL}/users/${t}/field/${s}/update/${o}?${a}`;return(0,i.jsxs)(Tl,{align:"center",css:{background:"$gray50",overflow:"hidden",px:"$3"},direction:"column",gap:"7",height:1,justify:"center",width:1,children:[3720===n&&(0,i.jsxs)(Tl,{align:"center",direction:"column",gap:"3",children:[(0,i.jsx)(Mr,{textAlign:"center",width:300,children:(0,i.jsx)("img",{src:`${F.HEAVENT_ASSETS_URL}/logo_planetb.png`,width:"100%"})}),(0,i.jsx)(Mr,{css:{color:"#60624e",fontFamily:"$roboto",fontSize:"30px",textTransform:"uppercase"},textAlign:"center",children:"Invitation planet b - 30 ans"}),(0,i.jsx)(Mr,{css:{color:"#60624e",fontFamily:"$roboto",fontSize:"16px"},textAlign:"center",children:"Au plaisir de vous retrouver pour fĂȘter ensemble les 30 ans de PLANET B !"})]}),d||(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$7",width:"100%","@desktop":{width:"640px"}},direction:"column",children:[(0,i.jsx)(Mr,{font:"gray900 textXl semiBold",children:p}),(0,i.jsx)(Pl,{height:"1"}),(0,i.jsx)(Mr,{color:"gray500",textAlign:"center",children:I}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{justify:"center",width:1,children:u?(0,i.jsx)(Ku,{color:"success",leftIcon:"check",children:e("votre_r_ponse_a_83191")}):g?(0,i.jsx)(Ku,{color:"error",leftIcon:"triangle-exclamation",children:e("erreur_dans_le_52844")}):(0,i.jsx)(tc,{isLoading:l,leftIcon:"check",textAlign:"center",onClick:async()=>{try{c(!0),200===(await fetch(f)).status?(m(!0),c(!1)):(h(!0),c(!1))}catch{m(!0),c(!1)}},children:x})})]})]})},l9=()=>{const{translate:e,params:{organizationId:n,customFieldSlug:t}}=Kl(),{data:s,loader:o}=rl({organizationId:n,slug:t}),[a,r]=(0,V.useState)(!1),[d,l]=(0,V.useState)(!1),[c,u]=(0,V.useState)(!1),[m,g]=(0,V.useState)(""),[h,p]=(0,V.useState)(""),I=s.organization?.customField.name??"",x=s.organization?.customField.description??"",f=`${F.HEAVENT_API_URL}/users/organization/${n}/update-by-ticket-id`;return(0,i.jsx)(Tl,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:o||(0,i.jsxs)(Tl,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tl,{width:1,children:(0,i.jsx)(lc,{alertStyle:"success",width:1,onClose:()=>{l(!1)},children:(0,i.jsx)(uc,{children:e("le_champ_1_36490",I)})})}),(0,i.jsx)(Pl,{height:"6"})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tl,{width:1,children:(0,i.jsx)(lc,{alertStyle:"error",width:1,onClose:()=>{u(!1)},children:(0,i.jsx)(uc,{children:e("le_champ_1_46567",I)})})}),(0,i.jsx)(Pl,{height:"6"})]}),(0,i.jsx)(wc,{label:e("TicketId"),value:m,onChange:g}),(0,i.jsx)(Pl,{height:"6"}),(0,i.jsx)(wc,{hint:x,label:I,value:h,onChange:p}),(0,i.jsx)(Pl,{height:"7"}),(0,i.jsx)(Tl,{justify:"center",width:1,children:(0,i.jsx)(tc,{isLoading:a,textAlign:"center",onClick:async()=>{r(!0),l(!1),u(!1),200===(await fetch(f,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticketId:m,slug:t,value:h})})).status?(l(!0),g(""),p("")):u(!0),r(!1)},children:e("mettre_jour_34131",I)})})]})})},c9=()=>{const{history:e,translate:n,params:{weezeventOrganizationId:t}}=Kl(),{data:s,loader:o}=Li("query WeezeventOrganizatio($id: Int) {\n organization: organizationByWeezeventId(id: $id) {\n id\n }\n}\n",{id:parseInt(t,10)},[]);return o||(s.organization?.id?(0,i.jsx)(kr.rd,{to:us.ORGANIZATION({organizationId:s.organization.id})}):(0,i.jsxs)(Tl,{align:"center",css:{background:"white"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Tl,{align:"center",css:{background:Ar.colors.blueGray900.value},height:64,justify:"center",width:1,children:(0,i.jsx)(Tl,{align:"center",css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(Gc,{})})}),(0,i.jsxs)(Tl,{align:"center",css:{background:"white",flex:"1"},direction:"column",gap:"6",justify:"center",width:1,children:[(0,i.jsx)(Mr,{height:240,width:240,children:(0,i.jsx)("img",{height:"100%",src:su.WeezConstruction,width:"100%"})}),(0,i.jsxs)(Tl,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Mr,{font:"gray800 textMd medium",children:n("aucun_compte_we_48865")}),(0,i.jsx)(Mr,{color:"gray500",dangerouslySetInnerHTML:{__html:n("si_vous_d_sirez_19702")}})]}),(0,i.jsxs)(Tl,{gap:"3",children:[(0,i.jsx)(tc,{onClick:()=>window.open("mailto:benjamin.vuitton@gmail.com","_blank"),children:n("nous_contacter_38070")}),(0,i.jsx)(tc,{color:"invisible",onClick:()=>e.push(yo.CREATE_EVENT_WITH_ORGANIZATION(t)),children:n("essayer_mainten_36692")})]})]})]}))},u9=e=>(0,i.jsx)(Zi,{getRedirectPath:()=>yo.AUTH_SIGN_IN,shouldHaveUser:!0,children:e.children}),m9=e=>(0,i.jsx)(Zi,{getRedirectPath:()=>yo.HOME,shouldHaveUser:!1,children:e.children});const g9=async()=>{const{user:e}=await(async()=>{try{const e=await async function(){const e=await X();if(g(e)){const{user:n}=await function(e,n){return oa("query CurrentUser {\n user {\n id\n email\n hubspotToken\n insertedAt\n language\n profile\n termsAcceptedAt\n }\n}\n",{variables:{},token:n||void 0,fragments:[]})}(0,e);return{user:n}}throw new Error("No token")}();return Oo.wB.defaultLocale=e.user.language.toLowerCase(),e}catch{return{user:null}}})();return await(e=>{const n=new URL(location.href).searchParams.get("lang");let t=null;e&&(t=e.language.toLowerCase()),g(n)&&(t=n);const i=t?`lang=${t}`:"";return Sv(`${F.HEAVENT_API_URL}/translation/language.js?${i}`)})(e),{user:e}},h9=e=>{const[n,t]=(0,V.useState)(null);return(0,V.useEffect)(()=>{let e=!0;return g9().then(n=>{e&&t(n)}).catch(()=>{alert("Could not load application, please try again.")}),()=>{e=!1}},[]),n?e.render(n):(0,i.jsx)(Ql,{})},p9=window.matchMedia("(max-width: 1200px)"),I9=V.createContext({isMobile:!1}),x9=e=>{const[n,t]=V.useState(!1);return V.useEffect(()=>{t(p9.matches),p9.addListener(e=>{t(e.matches)})},[]),(0,i.jsx)(I9.Provider,{value:{isMobile:n},children:e.children})},f9=(0,i.jsx)(Ql,{});function _9(e,{redirectOnSuccess:n}={}){const[t,i]=(0,V.useState)(!1),{setIsError:s}=(0,V.useContext)(jx);let o=null;return t&&(o=f9),{isLoading:t,loader:o,mutate:async(t,o)=>{i(!0);try{const a=await X(),r=await((e,n,t)=>oa(e,{variables:n,token:t||void 0}))(e,t,o||a);return!0!==n&&(i(!1),s(!1)),r}catch(e){throw s(!0,e),i(!1),e}}}}const j9=(0,i.jsx)(Ql,{});function v9(e,n,t){const[i,s]=(0,V.useState)(!0),[o,a]=(0,V.useState)({}),[r,d]=(0,V.useState)(0),{setIsError:l}=(0,V.useContext)(jx),c=Object.keys(n).sort().map(e=>{const t=n[e];return`"${e}":${JSON.stringify(t)}`}).join(",");(0,V.useEffect)(()=>{let i=!1;var o;return s(!0),o=c,X().then(i=>oa(e,{reloadOnNewVersion:!0,variables:n,token:i,fragments:t})).then(e=>{i||o!==c||(a(e),l(!1),s(!1))},e=>{i||o!==c||l(!0,e)}),()=>{i=!0}},[e,c,r]);let u=null;return i&&(u=j9),{data:o,isLoading:i,loader:u,reload(){d(r+1)}}}function S9(){return function(e,n={}){return Object.fromEntries(Object.entries(e).map(([e,t])=>e.endsWith("Id")||"id"===e?[e,parseInt(t,10)]:n[e]?[e,n[e](t)]:[e,t]))}((0,kr.g)())}function y9(){const e=(0,kr.W6)();return{...e,goBack:n=>{"POP"===e.action&&e.length<=2?e.push(n):e.goBack()}}}function C9(){return(0,kr.zy)()}function b9(){return(0,V.useMemo)(()=>{try{return{clear:window.localStorage.clear.bind(window.localStorage),setItem:window.localStorage.setItem.bind(window.localStorage),getItem:window.localStorage.getItem.bind(window.localStorage),removeItem:window.localStorage.removeItem.bind(window.localStorage),key:window.localStorage.key.bind(window.localStorage),get length(){return window.localStorage.length},getItemInt(e){const n=parseInt(window.window.localStorage.getItem(e),10);return isNaN(n)?null:n}}}catch{return{clear(){},setItem(){},getItem:()=>null,removeItem(){},key:()=>null,get length(){return 0},getItemInt:()=>null}}},[])}let A9=class extends Rc{constructor(e){super(e)}delegationFormInviteValuesDefault(){return{usersInfos:[{email:"",fields:{firstName:"",lastName:""}}]}}delegationFormInviteValuesSchema(){return zc.Ik().shape({usersInfos:zc.YO().of(zc.Ik().shape({email:zc.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),fields:zc.gl()})).min(1,"Vous devez invitĂ© au moins une personne.")})}};A9=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],A9);let E9=class extends Rc{translationService;constructor(e){super(e),this.translationService=e}massStateUpdateSchema(){return zc.Ik().shape({state:zc.Yj().required(this.t("le_statut_est_r_13164")).oneOf([it.NotApplicable,it.PreAssigned,it.Refused,it.WaitingAssignment],this.t("le_statut_est_r_13164"))})}massAccreditationStateUpdateSchema(){return zc.Ik().shape({state:zc.Yj().required(this.t("le_statut_est_r_13164")).oneOf([ge.NotApplicable,ge.Refused,ge.WaitingAccreditation],this.t("le_statut_est_r_13164"))})}};E9=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],E9);let w9=class extends Rc{translationService;constructor(e){super(e),this.translationService=e}};w9=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",[Di])],w9);let $9=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,n){switch(e){case et.String:return g(n)?n:"";case et.StringArray:return Array.isArray(n)?n:[];case et.RichText:return g(n)?n:"";default:return Zl()}}};$9=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)()],$9);let T9=class{get(){return{[Vn.OrganizationAdmin]:{accessLevel:Un.Organization,permissions:I5,nameKey:"administrateur_11083",descriptionKey:"a_acc_s_toute_73520"},[Vn.OrganizationReader]:{accessLevel:Un.Organization,permissions:x5,nameKey:"acc_s_en_lectur_30252",descriptionKey:"a_acc_s_l_org_94388"},[Vn.EventAdmin]:{accessLevel:Un.Event,permissions:f5,nameKey:"administrateur_24785",descriptionKey:"a_acc_s_toute_25473"},[Vn.EventReader]:{accessLevel:Un.Event,permissions:_5,nameKey:"acc_s_en_lectur_33482",descriptionKey:"a_acc_s_l_v_17476"},[Vn.PositionEditor]:{accessLevel:Un.Position,permissions:j5,nameKey:"responsable_de_95683",descriptionKey:"peut_modifier_s_82832"},[Vn.PositionReader]:{accessLevel:Un.Position,permissions:v5,nameKey:"responsable_de_72569",descriptionKey:"a_acc_s_ses_m_09741"},[Vn.DelegationCategoryLeader]:{accessLevel:Un.DelegationCategory,permissions:S5,nameKey:"responsable_de_32820",descriptionKey:"a_acc_s_aux_d_l_87634"}}}};T9=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,yt._G)()],T9);const z9=new yt.i0(e=>{e(T9).toSelf().inSingletonScope(),e(Ig).toSelf().inSingletonScope(),e(Jm).toSelf().inSingletonScope(),e(Xb).toSelf().inSingletonScope(),e(Bg).toSelf().inSingletonScope(),e(Rv).toSelf().inSingletonScope(),e(hT).toSelf().inSingletonScope(),e(Ol).toSelf().inSingletonScope()}),O9=new yt.i0(e=>{e(cU).toSelf().inSingletonScope(),e($W).toSelf().inSingletonScope(),e(DU).toSelf().inSingletonScope(),e(UW).toSelf().inSingletonScope(),e(dU).toSelf().inSingletonScope(),e(lU).toSelf().inSingletonScope(),e(cz).toSelf().inSingletonScope(),e(Fc).toSelf().inSingletonScope(),e(cf).toSelf().inSingletonScope(),e(TS).toSelf().inSingletonScope(),e(_D).toSelf().inSingletonScope(),e(ZM).toSelf().inSingletonScope(),e(Mq).toSelf().inSingletonScope(),e(Nz).toSelf().inSingletonScope(),e(gK).toSelf().inSingletonScope(),e(hK).toSelf().inSingletonScope(),e(hL).toSelf().inSingletonScope(),e(gL).toSelf().inSingletonScope(),e(A9).toSelf().inSingletonScope(),e(EO).toSelf().inSingletonScope(),e(cq).toSelf().inSingletonScope(),e($q).toSelf().inSingletonScope(),e(wq).toSelf().inSingletonScope(),e(oC).toSelf().inSingletonScope(),e(wC).toSelf().inSingletonScope(),e(e4).toSelf().inSingletonScope(),e(gO).toSelf().inSingletonScope(),e(PL).toSelf().inSingletonScope(),e(wL).toSelf().inSingletonScope(),e(J_).toSelf().inSingletonScope(),e(a3).toSelf().inSingletonScope(),e(zC).toSelf().inSingletonScope(),e(uz).toSelf().inSingletonScope(),e(Qc).toSelf().inSingletonScope(),e(_z).toSelf().inSingletonScope(),e(dK).toSelf().inSingletonScope(),e(pK).toSelf().inSingletonScope(),e(IO).toSelf().inSingletonScope(),e(DO).toSelf().inSingletonScope(),e(vK).toSelf().inSingletonScope(),e(FO).toSelf().inSingletonScope(),e($R).toSelf().inSingletonScope(),e(XM).toSelf().inSingletonScope(),e(QM).toSelf().inSingletonScope(),e(yw).toSelf().inSingletonScope(),e(MN).toSelf().inSingletonScope(),e(hB).toSelf().inSingletonScope(),e(SB).toSelf().inSingletonScope(),e(AX).toSelf().inSingletonScope(),e(IF).toSelf().inSingletonScope(),e(jF).toSelf().inSingletonScope(),e(Gw).toSelf().inSingletonScope(),e(EB).toSelf().inSingletonScope(),e(E9).toSelf().inSingletonScope(),e(Jw).toSelf().inSingletonScope(),e(Q_).toSelf().inSingletonScope(),e(o4).toSelf().inSingletonScope(),e(X_).toSelf().inSingletonScope(),e(MK).toSelf().inSingletonScope(),e(HK).toSelf().inSingletonScope(),e(RK).toSelf().inSingletonScope(),e(DK).toSelf().inSingletonScope(),e(eX).toSelf().inSingletonScope(),e(dJ).toSelf().inSingletonScope(),e(y5).toSelf().inSingletonScope(),e(ak).toSelf().inSingletonScope(),e(w9).toSelf().inSingletonScope(),e(Nc).toSelf().inSingletonScope(),e(pu).toSelf().inSingletonScope(),e(V3).toSelf().inSingletonScope(),e(jT).toSelf().inSingletonScope(),e(GX).toSelf().inSingletonScope(),e($9).toSelf().inSingletonScope(),e(AR).toSelf().inSingletonScope(),e(wR).toSelf().inSingletonScope(),e(ER).toSelf().inSingletonScope(),e(eP).toSelf().inSingletonScope(),e(zP).toSelf().inSingletonScope()}),R9=new yt.i0(e=>{e(CC).toSelf().inSingletonScope(),e(Og).toSelf().inSingletonScope(),e(qW).toSelf().inSingletonScope(),e(FU).toSelf().inSingletonScope(),e(Nx).toSelf().inSingletonScope(),e(Xk).toSelf().inSingletonScope(),e(qN).toSelf().inSingletonScope(),e(Sh).toSelf().inSingletonScope(),e(OL).toSelf().inSingletonScope(),e(W2).toSelf().inSingletonScope(),e(I$).toSelf().inSingletonScope(),e(XK).toSelf().inSingletonScope(),e(fJ).toSelf().inSingletonScope(),e(Oh).toSelf().inSingletonScope(),e(Mh).toSelf().inSingletonScope()});function D9(){const e=new yt.mc,n=window.HEAVENT_TRANSLATIONS||{},t=window.HEAVENT_LANGUAGE;if(0===Object.keys(n).length)throw new Error("window.HEAVENT_TRANSLATIONS does not exist");if(!lu(t))throw new Error("window.HEAVENT_LANGUAGE is not valid");return e.bind(Di).toConstantValue(new Di(lu(t),n)),e.load(z9,O9,R9),e}const M9=e=>(0,i.jsx)(Mi.Provider,{value:{container:D9(),useQuery:v9,useMutation:_9,useExecuteQuery:aa,useParams:S9,useHistory:y9,useLocation:C9,useLocalStorage:b9},children:e.children});var P9=t(9132);const k9=V.createContext({}),F9=e=>{const n=V.useCallback((e,n)=>{F.USE_MIXPANEL&&P9.A.track(e,n)},[]);return V.useEffect(()=>{F.USE_MIXPANEL&&P9.A.init(F.MIXPANEL_TOKEN,{debug:!0})},[]),(0,i.jsx)(k9.Provider,{value:{track:n},children:e.children})};(0,St.render)((0,i.jsx)(V.StrictMode,{children:(0,i.jsxs)(({children:e})=>(0,i.jsx)(h9,{render:n=>(0,i.jsx)(Hi.Provider,{value:n,children:(0,i.jsx)(M9,{children:(0,i.jsx)(x9,{children:(0,i.jsx)(vx,{children:(0,i.jsx)(bS,{children:(0,i.jsx)(F9,{children:(0,i.jsx)(Am.Provider,{value:{designSystem:Cm},children:(0,i.jsx)(i.Fragment,{children:e})})})})})})})})}),{children:[(0,i.jsx)(()=>((0,V.useEffect)(()=>{X().then(e=>{"true"===F.LOG_TOKEN&&console.log(`"${U}": "${e||""}"`)})},[]),null),{}),(0,i.jsx)(({children:e})=>{const[n,t]=(0,V.useState)(!0);return(0,i.jsxs)(G2.Provider,{value:{active:n,enable:()=>{t(!0)},disable:()=>{t(!1)}},children:[(0,i.jsx)(H2,{}),e]})},{children:(0,i.jsx)(({children:e})=>{const n=(0,V.useCallback)(e=>{F.USE_INTERCOM&&window.Intercom&&g(e)&&window.Intercom("boot",{api_base:"https://api-iam.intercom.io",app_id:"tyoj39m1",hide_default_launcher:!0,intercom_user_jwt:e})},[]),t=(0,V.useCallback)(()=>{F.USE_INTERCOM&&window.Intercom&&window.Intercom("show")},[]);return(0,i.jsx)(qS.Provider,{value:{canShow:F.USE_INTERCOM,show:t,update:n},children:e})},{children:(0,i.jsx)(()=>(0,i.jsx)(Mr,{className:Rr,css:{color:"$gray800",height:"100%",overflow:"hidden",position:"relative",width:"100%"},children:(0,i.jsx)(Pr.Kd,{basename:F.HEAVENT_APP_URL.pathnameOptional,children:(0,i.jsxs)(kr.dO,{children:[(0,i.jsx)(kr.qh,{exact:!0,path:yo.HOME,children:(0,i.jsx)(u9,{children:(0,i.jsx)(rj,{})})}),(0,i.jsx)(kr.qh,{path:yo.USER_UPDATE_BY_TICKET_ID(":organizationId",":customFieldSlug"),children:(0,i.jsx)(l9,{})}),(0,i.jsx)(kr.qh,{path:yo.USER_FIELD_UPDATE(":organizationId",":userInfoId",":customFieldSlug",":value"),children:(0,i.jsx)(d9,{})}),(0,i.jsx)(kr.qh,{path:yo.USER_EVENT_UNREGISTER(":organizationId",":userInfoId",":eventId"),children:(0,i.jsx)(r9,{})}),(0,i.jsx)(kr.qh,{path:yo.USER_CHECK_IN(":organizationId",":ticketId"),children:(0,i.jsx)(o9,{})}),(0,i.jsx)(kr.qh,{path:yo.USER_CHECK_OUT(":organizationId",":ticketId"),children:(0,i.jsx)(a9,{})}),(0,i.jsx)(kr.qh,{path:yo.BACKOFFICE,children:(0,i.jsx)(u9,{children:(0,i.jsx)(W_,{})})}),(0,i.jsx)(kr.qh,{path:yo.POSITION_MAP(":eventId",":positionId"),children:(0,i.jsx)(i9,{})}),(0,i.jsx)(kr.qh,{path:yo.ACCREDITATION_MAP(":eventId",":accreditationId"),children:(0,i.jsx)(Al,{})}),(0,i.jsx)(kr.qh,{path:yo.EXPORT_POSITIONS_MAP(":eventId",":segmentId"),children:(0,i.jsx)(t9,{})}),(0,i.jsx)(kr.qh,{path:is(us.ORGANIZATIONS),children:(0,i.jsx)(u9,{children:(0,i.jsx)(dj,{})})}),(0,i.jsx)(kr.qh,{exact:!0,path:yo.CREATE_EVENT_WITH_ORGANIZATION(":weezeventOrganizationId?"),children:(0,i.jsx)(u9,{children:(0,i.jsx)(aj,{})})}),(0,i.jsx)(kr.qh,{path:us.ORGANIZATION({organizationId:":organizationId"}),children:(0,i.jsx)(u9,{children:(0,i.jsx)(n9,{})})}),(0,i.jsx)(kr.qh,{path:yo.AUTH,children:(0,i.jsx)(m9,{children:(0,i.jsx)(_u,{})})}),(0,i.jsx)(kr.qh,{path:yo.COGNITO_CALLBACK,children:(0,i.jsx)(m9,{children:(0,i.jsx)(vu,{})})}),(0,i.jsx)(kr.qh,{path:yo.MAGIC_LINK(":code",":source"),children:(0,i.jsx)(m9,{children:(0,i.jsx)(fr,{})})}),(0,i.jsx)(kr.qh,{path:yo.UNSUBSCRIBE_EMAIL,children:(0,i.jsx)(s9,{})}),(0,i.jsx)(kr.qh,{path:"/o:weezeventOrganizationId",children:(0,i.jsx)(c9,{})}),(0,i.jsx)(kr.qh,{children:(0,i.jsx)(qi,{path:yo.HOME})})]})})}),{})})})]})}),document.getElementById("heavent-react-hook"))},477:()=>{},539:(e,n,t)=>{"use strict";e.exports=t.p+"svg/fileZIP-8e94803f540ec1fbe349.svg"},911:e=>{"use strict";e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IldoaXRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQwMCA0MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQwMCA0MDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDojRkZGRkZGO308L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MDAsMjAwYzAsMTEwLjUtODkuNSwyMDAtMjAwLDIwMFMwLDMxMC41LDAsMjAwUzg5LjUsMCwyMDAsMFM0MDAsODkuNSw0MDAsMjAweiBNMTYzLjQsMzA1LjVjODguNywwLDEzNy4yLTczLjUsMTM3LjItMTM3LjJjMC0yLjEsMC00LjItMC4xLTYuMmM5LjQtNi44LDE3LjYtMTUuMywyNC4xLTI1Yy04LjYsMy44LTE3LjksNi40LTI3LjcsNy42YzEwLTYsMTcuNi0xNS40LDIxLjItMjYuN2MtOS4zLDUuNS0xOS42LDkuNS0zMC42LDExLjdjLTguOC05LjQtMjEuMy0xNS4yLTM1LjItMTUuMmMtMjYuNiwwLTQ4LjIsMjEuNi00OC4yLDQ4LjJjMCwzLjgsMC40LDcuNSwxLjMsMTFjLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40Yy00LjEsNy4xLTYuNSwxNS40LTYuNSwyNC4yYzAsMTYuNyw4LjUsMzEuNSwyMS41LDQwLjFjLTcuOS0wLjItMTUuMy0yLjQtMjEuOC02YzAsMC4yLDAsMC40LDAsMC42YzAsMjMuNCwxNi42LDQyLjgsMzguNyw0Ny4zYy00LDEuMS04LjMsMS43LTEyLjcsMS43Yy0zLjEsMC02LjEtMC4zLTkuMS0wLjljNi4xLDE5LjIsMjMuOSwzMy4xLDQ1LDMzLjVjLTE2LjUsMTIuOS0zNy4zLDIwLjYtNTkuOSwyMC42Yy0zLjksMC03LjctMC4yLTExLjUtMC43QzExMC44LDI5Ny41LDEzNi4yLDMwNS41LDE2My40LDMwNS41Ii8+PC9zdmc+"},1037:(e,n,t)=>{"use strict";e.exports=t.p+"svg/dnsBlank-d9b5a36b6d641e2b1cd9.svg"},1205:(e,n,t)=>{"use strict";e.exports=t.p+"img/formPositionUnranked-8efe2960cfc090ba51df.png"},1416:(e,n,t)=>{"use strict";e.exports=t.p+"img/googlePlan-b18cf281f99a8608e7a9.png"},1446:(e,n,t)=>{"use strict";e.exports=t.p+"img/googleMaps-093b110e04f11e43e677.png"},1931:(e,n,t)=>{"use strict";e.exports=t.p+"img/google-3994b2066e10d4d349a4.png"},2248:e=>{"use strict";e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMDI0cHgiIGhlaWdodD0iMTAyNHB4IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPiAgICAgICAgPHRpdGxlPkZpbGwgMTwvdGl0bGU+ICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiAgICA8ZGVmcz48L2RlZnM+ICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImZMb2dvX1doaXRlIiBmaWxsPSIjRkZGRkZFIj4gICAgICAgICAgICA8cGF0aCBkPSJNOTY3LjQ4NCwwIEw1Ni41MTcsMCBDMjUuMzA0LDAgMCwyNS4zMDQgMCw1Ni41MTcgTDAsOTY3LjQ4MyBDMCw5OTguNjk0IDI1LjI5NywxMDI0IDU2LjUyMiwxMDI0IEw1NDcsMTAyNCBMNTQ3LDYyOCBMNDE0LDYyOCBMNDE0LDQ3MyBMNTQ3LDQ3MyBMNTQ3LDM1OS4wMjkgQzU0NywyMjYuNzY3IDYyNy43NzMsMTU0Ljc0NyA3NDUuNzU2LDE1NC43NDcgQzgwMi4yNjksMTU0Ljc0NyA4NTAuODQyLDE1OC45NTUgODY1LDE2MC44MzYgTDg2NSwyOTkgTDc4My4zODQsMjk5LjAzNyBDNzE5LjM5MSwyOTkuMDM3IDcwNywzMjkuNTI5IDcwNywzNzQuMjczIEw3MDcsNDczIEw4NjAuNDg3LDQ3MyBMODQwLjUwMSw2MjggTDcwNyw2MjggTDcwNywxMDI0IEw5NjcuNDg0LDEwMjQgQzk5OC42OTcsMTAyNCAxMDI0LDk5OC42OTcgMTAyNCw5NjcuNDg0IEwxMDI0LDU2LjUxNSBDMTAyNCwyNS4zMDMgOTk4LjY5NywwIDk2Ny40ODQsMCIgaWQ9IkZpbGwtMSI+PC9wYXRoPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+"},2281:(e,n,t)=>{"use strict";e.exports=t.p+"img/login2x-a7058a62cb4dc68d53e5.png"},2599:(e,n,t)=>{"use strict";e.exports=t.p+"svg/weezeventBlankHandGlobe-724d35d1342815318f84.svg"},2630:(e,n,t)=>{"use strict";e.exports=t.p+"svg/alert-c575e88c07bbcb08605f.svg"},2647:(e,n,t)=>{"use strict";e.exports=t.p+"img/login-ba738216a561ebc04664.png"},3574:(e,n,t)=>{"use strict";e.exports=t.p+"svg/done2-fe55d02679b93e21cc5f.svg"},3691:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMCAwIDMuNzggMS42MWg0OS42MjFjMS42OTQgMCAzLjE5LS43OTggNC4xNDYtMi4wMzd6IiBmaWxsPSIjNWM4OGM1Ii8+PHBhdGggZD0iTTIyNi43NDIgMjIyLjk4OGMtOS4yNjYgMC0xNi43NzcgNy4xNy0xNi43NzcgMTYuMDE0LjAwNyAyLjc2Mi42NjMgNS40NzQgMi4wOTMgNy44NzUuNDMuNzAzLjgzIDEuNDA4IDEuMTkgMi4xMDcuMzMzLjUwMi42NSAxLjAwNS45NSAxLjUwOC4zNDMuNDc3LjY3My45NTcuOTg4IDEuNDQgMS4zMSAxLjc2OSAyLjUgMy41MDIgMy42MzcgNS4xNjguNzkzIDEuMjc1IDEuNjgzIDIuNjQgMi40NjYgMy45OSAyLjM2MyA0LjA5NCA0LjAwNyA4LjA5MiA0LjYgMTMuOTE0di4wMTJjLjE4Mi40MTIuNTE2LjY2Ni44NzkuNjY3LjQwMy0uMDAxLjc2OC0uMzE0LjkzLS43OTkuNjAzLTUuNzU2IDIuMjM4LTkuNzI5IDQuNTg1LTEzLjc5NC43ODItMS4zNSAxLjY3My0yLjcxNSAyLjQ2NS0zLjk5IDEuMTM3LTEuNjY2IDIuMzI4LTMuNCAzLjYzOC01LjE2OS4zMTUtLjQ4Mi42NDUtLjk2Mi45ODgtMS40MzkuMy0uNTAzLjYxNy0xLjAwNi45NS0xLjUwOC4zNTktLjcuNzYtMS40MDQgMS4xOS0yLjEwNyAxLjQyNi0yLjQwMiAyLTUuMTE0IDIuMDA0LTcuODc1IDAtOC44NDQtNy41MTEtMTYuMDE0LTE2Ljc3Ni0xNi4wMTR6IiBmaWxsPSIjZGQ0YjNlIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIHJ5PSI1LjU2NCIgcng9IjUuODI4IiBjeT0iMjM5LjAwMiIgY3g9IjIyNi43NDIiIGZpbGw9IiM4MDJkMjciIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjkgMC0uMzYyLS4wMjMtLjcyMi0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhjMC0uMDAyLS4wMDMtLjAwNC0uMDA0LS4wMDUtMS41ODgtMS41MjQtMy42Mi0yLjIxNS01Ljk1NS0yLjIxNXptNC40MyA1LjY2bC4wMDMuMDA2di0uMDAzeiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjE1LjE4NCAyNTEuOTI5bC03Ljk4IDcuOTc5IDI4LjQ3NyAyOC40NzVjLjI4Ny0uNjQ5LjQ0OS0xLjM2Ni40NDktMi4xMjN2LTMxLjE2NWMtLjQ2OS42NzUtLjkzNCAxLjM0OS0xLjM4MiAyLjAwNS0uNzkyIDEuMjc1LTEuNjgyIDIuNjQtMi40NjUgMy45OS0yLjM0NyA0LjA2NS0zLjk4MiA4LjAzOC00LjU4NSAxMy43OTQtLjE2Mi40ODUtLjUyNy43OTgtLjkzLjc5OS0uMzYzLS4wMDEtLjY5Ny0uMjU1LS44NzktLjY2N3YtLjAxMmMtLjU5My01LjgyMi0yLjIzNy05LjgyLTQuNi0xMy45MTQtLjc4My0xLjM1LTEuNjczLTIuNzE1LTIuNDY2LTMuOTktMS4xMzctMS42NjYtMi4zMjctMy40LTMuNjM3LTUuMTY5bC0uMDAyLS4wMDN6IiBmaWxsPSIjYzNjM2MzIi8+PHBhdGggZD0iTTIxMi45ODMgMjQ4LjQ5NWwtMzYuOTUyIDM2Ljk1M3YuODEyYTUuMjI3IDUuMjI3IDAgMCAwIDUuMjM4IDUuMjM4aDEuMDE1bDM1LjY2Ni0zNS42NjZhMTM2LjI3NSAxMzYuMjc1IDAgMCAwLTIuNzY0LTMuOSAzNy41NzUgMzcuNTc1IDAgMCAwLS45ODktMS40NGMtLjI5OS0uNTAzLS42MTYtMS4wMDYtLjk1LTEuNTA4LS4wODMtLjE2Mi0uMTc2LS4zMjYtLjI2NC0uNDg5eiIgZmlsbD0iI2ZkZGM0ZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjExLjk5OCAyNjEuMDgzbC02LjE1MiA2LjE1MSAyNC4yNjQgMjQuMjY0aC43ODFhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzktNS4yMzh2LTEuMDQ1eiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48L2c+PC9zdmc+"},3780:(e,n,t)=>{"use strict";e.exports=t.p+"svg/check-b496988ef222b46ee39a.svg"},4025:(e,n,t)=>{"use strict";e.exports=t.p+"img/ignPlan-d4659acd351e7c1a33e4.png"},4225:e=>{"use strict";e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI1MDRweCIgaGVpZ2h0PSI1MDRweCIgdmlld0JveD0iMCAwIDUwNCA1MDQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+ICAgICAgICA8dGl0bGU+Z2x5cGgtbG9nb19NYXkyMDE2PC90aXRsZT4gICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+ICAgIDxkZWZzPiAgICAgICAgPHBvbHlnb24gaWQ9InBhdGgtMSIgcG9pbnRzPSIwIDAuMTU5IDUwMy44NDEgMC4xNTkgNTAzLjg0MSA1MDMuOTQgMCA1MDMuOTQiPjwvcG9seWdvbj4gICAgPC9kZWZzPiAgICA8ZyBpZD0iZ2x5cGgtbG9nb19NYXkyMDE2IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4gICAgICAgIDxnIGlkPSJHcm91cC0zIj4gICAgICAgICAgICA8bWFzayBpZD0ibWFzay0yIiBmaWxsPSJ3aGl0ZSI+ICAgICAgICAgICAgICAgIDx1c2UgeGxpbms6aHJlZj0iI3BhdGgtMSI+PC91c2U+ICAgICAgICAgICAgPC9tYXNrPiAgICAgICAgICAgIDxnIGlkPSJDbGlwLTIiPjwvZz4gICAgICAgICAgICA8cGF0aCBkPSJNMjUxLjkyMSwwLjE1OSBDMTgzLjUwMywwLjE1OSAxNzQuOTI0LDAuNDQ5IDE0OC4wNTQsMS42NzUgQzEyMS4yNCwyLjg5OCAxMDIuOTI3LDcuMTU3IDg2LjkwMywxMy4zODUgQzcwLjMzNywxOS44MjIgNTYuMjg4LDI4LjQzNiA0Mi4yODIsNDIuNDQxIEMyOC4yNzcsNTYuNDQ3IDE5LjY2Myw3MC40OTYgMTMuMjI2LDg3LjA2MiBDNi45OTgsMTAzLjA4NiAyLjczOSwxMjEuMzk5IDEuNTE2LDE0OC4yMTMgQzAuMjksMTc1LjA4MyAwLDE4My42NjIgMCwyNTIuMDggQzAsMzIwLjQ5NyAwLjI5LDMyOS4wNzYgMS41MTYsMzU1Ljk0NiBDMi43MzksMzgyLjc2IDYuOTk4LDQwMS4wNzMgMTMuMjI2LDQxNy4wOTcgQzE5LjY2Myw0MzMuNjYzIDI4LjI3Nyw0NDcuNzEyIDQyLjI4Miw0NjEuNzE4IEM1Ni4yODgsNDc1LjcyMyA3MC4zMzcsNDg0LjMzNyA4Ni45MDMsNDkwLjc3NSBDMTAyLjkyNyw0OTcuMDAyIDEyMS4yNCw1MDEuMjYxIDE0OC4wNTQsNTAyLjQ4NCBDMTc0LjkyNCw1MDMuNzEgMTgzLjUwMyw1MDQgMjUxLjkyMSw1MDQgQzMyMC4zMzgsNTA0IDMyOC45MTcsNTAzLjcxIDM1NS43ODcsNTAyLjQ4NCBDMzgyLjYwMSw1MDEuMjYxIDQwMC45MTQsNDk3LjAwMiA0MTYuOTM4LDQ5MC43NzUgQzQzMy41MDQsNDg0LjMzNyA0NDcuNTUzLDQ3NS43MjMgNDYxLjU1OSw0NjEuNzE4IEM0NzUuNTY0LDQ0Ny43MTIgNDg0LjE3OCw0MzMuNjYzIDQ5MC42MTYsNDE3LjA5NyBDNDk2Ljg0Myw0MDEuMDczIDUwMS4xMDIsMzgyLjc2IDUwMi4zMjUsMzU1Ljk0NiBDNTAzLjU1MSwzMjkuMDc2IDUwMy44NDEsMzIwLjQ5NyA1MDMuODQxLDI1Mi4wOCBDNTAzLjg0MSwxODMuNjYyIDUwMy41NTEsMTc1LjA4MyA1MDIuMzI1LDE0OC4yMTMgQzUwMS4xMDIsMTIxLjM5OSA0OTYuODQzLDEwMy4wODYgNDkwLjYxNiw4Ny4wNjIgQzQ4NC4xNzgsNzAuNDk2IDQ3NS41NjQsNTYuNDQ3IDQ2MS41NTksNDIuNDQxIEM0NDcuNTUzLDI4LjQzNiA0MzMuNTA0LDE5LjgyMiA0MTYuOTM4LDEzLjM4NSBDNDAwLjkxNCw3LjE1NyAzODIuNjAxLDIuODk4IDM1NS43ODcsMS42NzUgQzMyOC45MTcsMC40NDkgMzIwLjMzOCwwLjE1OSAyNTEuOTIxLDAuMTU5IFogTTI1MS45MjEsNDUuNTUgQzMxOS4xODYsNDUuNTUgMzI3LjE1NCw0NS44MDcgMzUzLjcxOCw0Ny4wMTkgQzM3OC4yOCw0OC4xMzkgMzkxLjYxOSw1Mi4yNDMgNDAwLjQ5Niw1NS42OTMgQzQxMi4yNTUsNjAuMjYzIDQyMC42NDcsNjUuNzIyIDQyOS40NjIsNzQuNTM4IEM0MzguMjc4LDgzLjM1MyA0NDMuNzM3LDkxLjc0NSA0NDguMzA3LDEwMy41MDQgQzQ1MS43NTcsMTEyLjM4MSA0NTUuODYxLDEyNS43MiA0NTYuOTgxLDE1MC4yODIgQzQ1OC4xOTMsMTc2Ljg0NiA0NTguNDUsMTg0LjgxNCA0NTguNDUsMjUyLjA4IEM0NTguNDUsMzE5LjM0NSA0NTguMTkzLDMyNy4zMTMgNDU2Ljk4MSwzNTMuODc3IEM0NTUuODYxLDM3OC40MzkgNDUxLjc1NywzOTEuNzc4IDQ0OC4zMDcsNDAwLjY1NSBDNDQzLjczNyw0MTIuNDE0IDQzOC4yNzgsNDIwLjgwNiA0MjkuNDYyLDQyOS42MjEgQzQyMC42NDcsNDM4LjQzNyA0MTIuMjU1LDQ0My44OTYgNDAwLjQ5Niw0NDguNDY2IEMzOTEuNjE5LDQ1MS45MTYgMzc4LjI4LDQ1Ni4wMiAzNTMuNzE4LDQ1Ny4xNCBDMzI3LjE1OCw0NTguMzUyIDMxOS4xOTEsNDU4LjYwOSAyNTEuOTIxLDQ1OC42MDkgQzE4NC42NSw0NTguNjA5IDE3Ni42ODQsNDU4LjM1MiAxNTAuMTIzLDQ1Ny4xNCBDMTI1LjU2MSw0NTYuMDIgMTEyLjIyMiw0NTEuOTE2IDEwMy4zNDUsNDQ4LjQ2NiBDOTEuNTg2LDQ0My44OTYgODMuMTk0LDQzOC40MzcgNzQuMzc5LDQyOS42MjEgQzY1LjU2NCw0MjAuODA2IDYwLjEwNCw0MTIuNDE0IDU1LjUzNCw0MDAuNjU1IEM1Mi4wODQsMzkxLjc3OCA0Ny45OCwzNzguNDM5IDQ2Ljg2LDM1My44NzcgQzQ1LjY0OCwzMjcuMzEzIDQ1LjM5MSwzMTkuMzQ1IDQ1LjM5MSwyNTIuMDggQzQ1LjM5MSwxODQuODE0IDQ1LjY0OCwxNzYuODQ2IDQ2Ljg2LDE1MC4yODIgQzQ3Ljk4LDEyNS43MiA1Mi4wODQsMTEyLjM4MSA1NS41MzQsMTAzLjUwNCBDNjAuMTA0LDkxLjc0NSA2NS41NjMsODMuMzUzIDc0LjM3OSw3NC41MzggQzgzLjE5NCw2NS43MjIgOTEuNTg2LDYwLjI2MyAxMDMuMzQ1LDU1LjY5MyBDMTEyLjIyMiw1Mi4yNDMgMTI1LjU2MSw0OC4xMzkgMTUwLjEyMyw0Ny4wMTkgQzE3Ni42ODcsNDUuODA3IDE4NC42NTUsNDUuNTUgMjUxLjkyMSw0NS41NSBaIiBpZD0iRmlsbC0xIiBmaWxsPSIjRkZGRkZGIiBtYXNrPSJ1cmwoI21hc2stMikiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgICAgIDxwYXRoIGQ9Ik0yNTEuOTIxLDMzNi4wNTMgQzIwNS41NDMsMzM2LjA1MyAxNjcuOTQ3LDI5OC40NTcgMTY3Ljk0NywyNTIuMDggQzE2Ny45NDcsMjA1LjcwMiAyMDUuNTQzLDE2OC4xMDYgMjUxLjkyMSwxNjguMTA2IEMyOTguMjk4LDE2OC4xMDYgMzM1Ljg5NCwyMDUuNzAyIDMzNS44OTQsMjUyLjA4IEMzMzUuODk0LDI5OC40NTcgMjk4LjI5OCwzMzYuMDUzIDI1MS45MjEsMzM2LjA1MyBaIE0yNTEuOTIxLDEyMi43MTUgQzE4MC40NzQsMTIyLjcxNSAxMjIuNTU2LDE4MC42MzMgMTIyLjU1NiwyNTIuMDggQzEyMi41NTYsMzIzLjUyNiAxODAuNDc0LDM4MS40NDQgMjUxLjkyMSwzODEuNDQ0IEMzMjMuMzY3LDM4MS40NDQgMzgxLjI4NSwzMjMuNTI2IDM4MS4yODUsMjUyLjA4IEMzODEuMjg1LDE4MC42MzMgMzIzLjM2NywxMjIuNzE1IDI1MS45MjEsMTIyLjcxNSBaIiBpZD0iRmlsbC00IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgICAgICA8cGF0aCBkPSJNNDE2LjYyNywxMTcuNjA0IEM0MTYuNjI3LDEzNC4zIDQwMy4wOTIsMTQ3LjgzNCAzODYuMzk2LDE0Ny44MzQgQzM2OS43MDEsMTQ3LjgzNCAzNTYuMTY2LDEzNC4zIDM1Ni4xNjYsMTE3LjYwNCBDMzU2LjE2NiwxMDAuOTA4IDM2OS43MDEsODcuMzczIDM4Ni4zOTYsODcuMzczIEM0MDMuMDkyLDg3LjM3MyA0MTYuNjI3LDEwMC45MDggNDE2LjYyNywxMTcuNjA0IiBpZD0iRmlsbC01IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgIDwvZz48L3N2Zz4="},4236:(e,n,t)=>{"use strict";e.exports=t.p+"img/background404-7cbee4be29173b045b3e.jpg"},4362:(e,n,t)=>{"use strict";e.exports=t.p+"svg/weezeventBlankSwissArmyKnife-1600d89a247ad1dab4a9.svg"},4628:(e,n,t)=>{"use strict";e.exports=t.p+"img/formPositionRanked-376168a7e3c71ed7defd.png"},5095:(e,n,t)=>{"use strict";e.exports=t.p+"img/netflixWood-fa60c8d3bb65881cf071.jpg"},5376:(e,n,t)=>{"use strict";e.exports=t.p+"svg/sad-cbf74279d944b2baac65.svg"},5594:(e,n,t)=>{"use strict";e.exports=t.p+"img/member-7b0dc9a7cc229b5ba65b.png"},5682:()=>{},6041:(e,n,t)=>{"use strict";e.exports=t.p+"img/logoWeezeventSquare-9184b02c60dbc8695435.png"},6400:(e,n,t)=>{"use strict";e.exports=t.p+"img/weezConstruction-fb73dc7a26ba038c44b3.png"},6687:(e,n,t)=>{"use strict";e.exports=t.p+"svg/weezeventBlankMessages-76d6e6c79babc98388e9.svg"},6751:(e,n,t)=>{"use strict";e.exports=t.p+"svg/fileJPG-aed94d931a32b62e488d.svg"},6954:(e,n,t)=>{"use strict";e.exports=t.p+"img/googleSatellite-0706bcb1678d6e9f219c.png"},6959:(e,n,t)=>{"use strict";e.exports=t.p+"svg/filePNG-c7dc0a7230035611ad34.svg"},7008:(e,n,t)=>{"use strict";e.exports=t.p+"img/accreditation-7f66e46aebab965fa566.png"},7619:(e,n,t)=>{"use strict";e.exports=t.p+"svg/fileBlank-8285380bb91a4d9e73d7.svg"},7648:(e,n,t)=>{"use strict";e.exports=t.p+"svg/weezeventBlankPerson-e5c7b9cf3fcac68f3df8.svg"},8144:(e,n,t)=>{"use strict";e.exports=t.p+"img/asoHomeBackground-e46035697a28c8d248e6.jpg"},8184:(e,n,t)=>{"use strict";e.exports=t.p+"svg/dnsWrongDomain-3954cd8d9805c779a7bc.svg"},8242:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+"},8264:(e,n,t)=>{"use strict";e.exports=t.p+"img/userProfile-37c0493d81fa861def54.png"},8301:(e,n,t)=>{"use strict";e.exports=t.p+"img/aso-897aab2a976d58ba485d.png"},8652:(e,n,t)=>{"use strict";e.exports=t.p+"svg/done-d3eb25606e0846af3988.svg"},8798:(e,n,t)=>{"use strict";e.exports=t.p+"svg/recrewteerMarker-a76de3956f8adec5ded2.svg"},9191:()=>{},9625:(e,n,t)=>{"use strict";e.exports=t.p+"svg/fileCSV-6ea65d2431d3a4293aad.svg"},9848:(e,n,t)=>{"use strict";e.exports=t.p+"svg/filePDF-37cadc96dae9bc3a10ef.svg"},9882:(e,n,t)=>{"use strict";e.exports=t.p+"img/ign-3cfd31ba578060a32efa.png"}},e=>{e.O(0,[121],()=>e(e.s=418)),e.O()}]); //# sourceMappingURL=app-fca14b70ca72b6de081f.cjs.map