1import{q as ht,j as i,P,c as ve,r as w,u as Re,N as dn,D as wt,d as jt,B as se,h as et,g as Y,G as m,H as Ls,E as uo,i as Ne,v as ee,L as Me,b as ho,A as fo,e as po,w as $s,x as hn,y as zs,z as Q,J as ie,K as Fe,R as ze,F as le,O as ce,I as St,Q as Ue,U as Bs,o as mo,V as Qe,W as go,X as xo,Y as yo,Z as Ws,_ as qs,$ as fn,a0 as pn,a1 as mn,a2 as Ms,a3 as tr,a4 as gn,s as xn,a5 as Es,a6 as Vs,a7 as Gs,a8 as lr,a9 as yn,aa as cr,ab as Ys,ac as bo,ad as Mr,ae as Ks,af as Xs,ag as It,ah as Nn,ai as Qs,aj as Zs,ak as Js,al as ea,am as ta,an as vo,ao as ra,ap as na,aq as ia,ar as oa,as as sa,at as aa,au as la,av as Dn,aw as Un,m as ca,ax as ua,ay as da,az as ha,aA as fa,aB as pa,aC as ma,aD as ga,aE as xa,aF as ya}from"./index-DkE4hsq5.js";import{r as ba,g as va,a as _a}from"./calendly-Dsv8XgS8.js";import{f as Hn}from"./formatDate-Bq_hKQNd.js";import{d as wa,a as ja}from"./profile-wA0v2K5G.js";import{D as Sa}from"./DialogContentText-DuTCDuEw.js";import{D as bn}from"./Delete-BbweyAD_.js";import{P as ka}from"./PersonAdd-7x7hddeI.js";import{E as Ta,G as Ca,V as _o,a as Aa}from"./VisibilityOff-BHLxJGro.js";import{F as wo,T as Fa,N as Oa}from"./NearMeToHostEventCard-vsFUNd2H.js";import{R as rr}from"./Rating-BvkQB7lf.js";import{E as Ln}from"./EventHostDialog-C7Cw6C0J.js";import{p as Lt}from"./Porchlight_logo05-17-BsBRjcob.js";import"./ReactPhoneInput-CfEkFCcD.js";import"./index-CLORajXb.js";import{g as Ra,V as Pa,a as $n}from"./VerifyAttendeesDialog-CG3HCVxH.js";import{A as vt}from"./AttendeeDashboardEventCard-D7Q5Vd8Z.js";import"./Login-C1n2ab5n.js";import"./EditMyHostProfile-DaB_6s-T.js";import"./EventSpecificHostForm-CCzyasBY.js";import"./Stack-J0GLWA9b.js";const Ia=ht(i.jsx("path",{d:"M21 8h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2m0 4-3 7H9V9l4.34-4.34L12.23 10H21zM1 9h4v12H1z"})),Na=ht([i.jsx("path",{d:"M13.34 4.66 9 9v10h9l3-7v-2h-8.77z",opacity:".3"},"0"),i.jsx("path",{d:"M21 8h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2m0 4-3 7H9V9l4.34-4.34L12.23 10H21zM1 9h4v12H1z"},"1")]),zn=ht([i.jsx("path",{d:"M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1M3 18.5V7c1.1-.35 2.3-.5 3.5-.5 1.34 0 3.13.41 4.5.99v11.5C9.63 18.41 7.84 18 6.5 18c-1.2 0-2.4.15-3.5.5m18 0c-1.1-.35-2.3-.5-3.5-.5-1.34 0-3.13.41-4.5.99V7.49c1.37-.59 3.16-.99 4.5-.99 1.2 0 2.4.15 3.5.5z"},"0"),i.jsx("path",{d:"M11 7.49c-1.37-.58-3.16-.99-4.5-.99-1.2 0-2.4.15-3.5.5v11.5c1.1-.35 2.3-.5 3.5-.5 1.34 0 3.13.41 4.5.99z",opacity:".3"},"1"),i.jsx("path",{d:"M17.5 10.5c.88 0 1.73.09 2.5.26V9.24c-.79-.15-1.64-.24-2.5-.24-1.28 0-2.46.16-3.5.47v1.57c.99-.35 2.18-.54 3.5-.54m0 2.66c.88 0 1.73.09 2.5.26V11.9c-.79-.15-1.64-.24-2.5-.24-1.28 0-2.46.16-3.5.47v1.57c.99-.34 2.18-.54 3.5-.54m0 2.67c.88 0 1.73.09 2.5.26v-1.52c-.79-.15-1.64-.24-2.5-.24-1.28 0-2.46.16-3.5.47v1.57c.99-.35 2.18-.54 3.5-.54"},"2")]),jo=({calendly:{calendly:t},auth:{isAuthenticated:e,loading:r,user:n},addCalendlyAuthCode:o,getCalendlyUserInfo:a,refreshCalendlyAuth:s,history:c})=>{w.useEffect(()=>{n.calendly&&(s(),a(n.calendly.accessToken))},[a,s]);const[u,l]=w.useState({calendlyAuthCode:""}),{calendlyAuthCode:f}=u,h=_=>{l({...u,[_.target.name]:_.target.value})};return i.jsxs(w.Fragment,{children:[t?i.jsxs("p",{children:["It looks like you're connected to"," ",t.data.resource.name,"'s Calendly account"]}):"",!t&&n.calendly&&n.calendly.refreshToken?i.jsxs("button",{onClick:s,children:[i.jsx("i",{className:"fas fa-calendar-alt text-primary"})," Refresh your Calendly authentication"]}):"",e&&!n.calendly&&n.role==="ADMIN"?i.jsxs("div",{className:"dash-buttons",children:[i.jsxs("a",{href:"https://auth.calendly.com/oauth/authorize?client_id=By5JoX6LQeuUpNqAxfSTQG_C3SAjcLTamu_euRTkheo&response_type=code&redirect_uri=http://localhost:3000",className:"btn btn-light",children:[i.jsx("i",{className:"fas fa-calendar-alt text-primary"})," ","Connect your Calendly account"]}),i.jsx("br",{}),i.jsx("small",{children:'When you get redirected back, copy into this text box everything after "http://localhost:3000/?code=" in the address bar.'}),i.jsxs("form",{className:"form",onSubmit:_=>{_.preventDefault(),o(u,c)},children:[i.jsx("div",{className:"form-group",children:i.jsx("input",{type:"text",placeholder:"Something like f04281d639d8248435378b0365de7bd1f53bf452eda187d5f1e07ae7f04546
1d6",name:"calendlyAuthCode",value:f,onChange:_=>h(_),required:!0})}),i.jsx("input",{type:"submit",className:"btn btn-primary my-1"})]})]}):""]})};jo.propTypes={addCalendlyAuthCode:P.func.isRequired,getCalendlyUserInfo:P.func.isRequired,refreshCalendlyAuth:P.func.isRequired,auth:P.object.isRequired,calendly:P.object.isRequired};const Da=t=>({auth:t.auth,calendly:t.calendly});ve(Da,{addCalendlyAuthCode:_a,getCalendlyUserInfo:va,refreshCalendlyAuth:ba})(jo);const So=({education:t,deleteEducation:e})=>{const r=t.map(n=>i.jsxs("tr",{children:[i.jsx("td",{children:n.school}),i.jsx("td",{className:"hide-sm",children:n.degree}),i.jsxs("td",{children:[Hn(n.from)," - ",n.to?Hn(n.to):"Now"]}),i.jsx("td",{children:i.jsx("button",{onClick:()=>e(n._id),className:"btn btn-danger",children:"Delete"})})]},n._id));return i.jsxs(w.Fragment,{children:[i.jsx("h2",{className:"my-2",children:"Education Credentials"}),i.jsxs("table",{className:"table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"School"}),i.jsx("th",{className:"hide-sm",children:"Degree"}),i.jsx("th",{className:"hide-sm",children:"Years"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:r})]})]})};So.propTypes={education:P.array.isRequired,deleteEducation:P.func.isRequired};ve(null,{deleteEducation:wa})(So);const Ua=ht(i.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"})),Bn=ht(i.jsx("path",{d:"M18 16h-2v-1H8v1H6v-1H2v5h20v-5h-4zm2-8h-3V6c0-1.1-.9-2-2-2H9c-1.1 0-2 .9-2 2v2H4c-1.1 0-2 .9-2 2v4h4v-2h2v2h8v-2h2v2h4v-4c0-1.1-.9-2-2-2m-5 0H9V6h6z"})),ko=({thisEvent:t,artistViewedHostOffer:e,artistDeclinedHostOffer:r,thisOffer:n,artistMe:o,auth:a,onNotificationDialogClose:s})=>{const[c,u]=w.useState(!1),[l,f]=w.useState(!1),[h,_]=w.useState(!1),b=()=>{L({}),u(!1),_(!1),typeof s=="function"&&s()},S=()=>{f(!1)},[O,L]=w.useState({});w.useEffect(()=>{u(!0)},[O]);const I=v=>{L(v)},y=Re();return w.useEffect(()=>{const v=new URLSearchParams(y.search);if(v.get("open")!=="offer"||String(t._id)!==String(v.get("eventID")))return;const k=v.get("hostID"),T=n&&n.host&&n.host._id?n.host._id:n&&n.host;if(k){if(String(T)!==String(k))return}else{const H=(t.offersFromHosts||[]).filter(Boolean)[0],M=H&&H.host&&H.host._id?H.host._id:H&&H.host;if(String(T)!==String(M))return}const U=setTimeout(()=>{n&&!n.artistViewedOn&&n.host&&n.host._id&&e(n.host._id,t.bookingWhen),I(n)},dn);return()=>clearTimeout(U)},[y.search,y.key]),i.jsxs(i.Fragment,{children:[O&&O.host&&i.jsx(wt,{open:c,onClose:b,scroll:"body",fullWidth:!0,maxWidth:"md",className:"porchlightBG",children:i.jsxs(jt,{children:[i.jsx(se,{sx:{position:"absolute",top:0,right:0,backgroundColor:"rgba(0 0 0 /.6)",padding:"0",zIndex:100},children:i.jsx(et,{date:t.bookingWhen})}),t.status==="CANCELED"&&i.jsxs(se,{sx:{marginTop:"16px",backgroundColor:"rgba(0, 0, 0, .2)",padding:" 20px",border:"4px dashed var(--red)",backgroundImage:"repeating-linear-gradient(45deg, rgb(255 0 0 / 10%) 5px, rgb(255 0 0 / 10%) 15px, transparent 15px, transparent 30px)"},className:"canceledEventNotice",children:[i.jsxs(Y,{component:"span",sx:{color:"var(--red)",textAlign:"left",fontSize:"1.5em",fontWeight:"300",display:"inline"},children:[t.canceledBy==="HOST"?`This concert was canceled by ${O.host.firstName} ${O.host.lastName} on `:"You canceled this concert on ",new Date(t.canceledDate).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"})," ","with this reason:"," "]}),i.jsx(Y,{component:"span",sx:{fontFamily:"var(--casual-font)",fontSize:"1.3em"},children:t.canceledReason}),i.jsx(m,{container:!0,sx:{justifyContent:"center",alignItems:"start",margin:"8px 4px",flexDirection:"row"}})]}),t.preferredArtists&&t.preferredArtists.length>1&&i.jsxs("p",{style:{textAlign:"center",marginBottom:"8px"},children:["You are one of"," ",t.preferredArtists.length," artists invited to possibly perform this concert."]}),i.jsx(Ls,{theHost:O.host,theEvent:t,theOffer:O,eventDetailsDialogHandleClose:b}),t.createdBy==="ARTIST"&&i.jsx(i.Fragment,{children:i.jsxs(se,{sx:{marginTop:"16px",border:"double 5px var(--primary-color)"},children:[i.jsx(Y,{component:"h2",sx:{marginBottom:"4px",paddingTop:"8px"},children:"This was your proposal:"}),i.jsx(uo,{theEvent:{...t,artist:o}})]})})]})}),t.createdBy==="ARTIST"&&n.host.firstName&&n.host.lastName&&i.jsx(i.Fragment,{children:i.jsx(m,{item:!0,sx:{marginRight:"4px"},children:i.jsx(Ne,{arrow:!0,placement:"bottom",title:i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{textAlign:"center"},children:`${n.host.firstName} ${n.host.lastName}`}),n.status==="ACCEPTED"&&i.jsx("div",{style:{fontFamily:"var(--secondary-font)",color:"var(--link-color)",textAlign:"center"},children:"You accepted this offer"})]}),children:i.jsx(se,{className:"squareImgInACircle",sx:{height:"50px",width:"50px",maxHeight:"200px",maxWidth:"200px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${n.host.profileImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"2px",backgroundClip:"content-box",border:`${n.artistViewedOn?n.status==="ACCEPTED"?"1px solid var(--link-color)":"1px solid transparent":"1px solid var(--primary-color)"}`,margin:"0",cursor:"pointer",opacity:`${n.status==="ACCEPTED"?1:.8}`,transform:`${n.status==="ACCEPTED"?"scale(1.1)":"scale(1)"}`,filter:`${n.status==="ACCEPTED"?"grayscale(0%)":"grayscale(50%)"}`,"&:hover":{filter:"grayscale(0%)",opacity:1,transform:"scale(1.1)"},transition:"all 450ms cubic-bezier(0.23, 1, 0.32, 1)",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",zIndex:"0",aspectRatio:"1 / 1"},onClick:()=>{({...t,offeringHost:n.host},!n.artistViewedOn&&e(n.host._id,t.bookingWhen)),I(n)},children:n.status==="ACCEPTED"&&i.jsx(Ia,{sx:{fontSize:"2em",color:"var(--link-color)",filter:"drop-shadow(0 0 3px rgba(0,0,0, 1))",position:"relative",zIndex:"5",opacity:".8"}})})})})}),t.createdBy==="HOST"&&t.confirmedHost&&n.host.firstName&&n.host.lastName&&i.jsxs(i.Fragment,{children:[i.jsx(m,{item:!0,sx:{marginLeft:"0"},children:i.jsx(ee,{btnwidth:"200",onClick:()=>{({...t,offeringHost:n.host},!n.artistViewedOn&&e(n.host._id,t.bookingWhen)),I(n)},children:"Concert Details"})}),t.status==="CONFIRMED"&&i.jsx(m,{item:!0,sx:{marginLeft:"8px"},children:i.jsx(Me,{to:`/events/${t._id}`,style:{textDecoration:"none"},children:i.jsx(ee,{btnwidth:"160",children:"Event Page"})})}),t.status!=="CONFIRMED"&&t.status!=="CANCELED"&&(!t.declinedArtists||t.declinedArtists.filter(v=>v.artist===o._id).length<=0)&&i.jsxs(m,{item:!0,sx:{marginLeft:"8px"},children:[i.jsxs(wt,{open:l,onClose:S,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:"porchlightBG",children:[i.jsx(ho,{id:"alert-dialog-title",children:i.jsxs(m,{c
1ontainer:!0,sx:{flexDirection:"row",justifyContent:"space-around"},children:[i.jsx(m,{item:!0,sx:{width:"130px"},children:i.jsx(fo,{alt:`${n.host.profileImg}`,src:`${n.host.profileImg}`,sx:{width:"130px",height:"130px",margin:"0 auto"}})}),i.jsx(m,{item:!0,sx:{marginTop:"8px",minWidth:"150px"},children:"Are you sure you want to decline this offer from "+n.host.firstName+" "+n.host.lastName+"?"})]})}),i.jsxs(jt,{children:[i.jsx(se,{sx:{position:"absolute",top:0,right:0,backgroundColor:"rgba(0 0 0 /.6)",padding:"0",zIndex:100},children:i.jsx(et,{date:t.bookingWhen})}),i.jsx(Sa,{id:"alert-dialog-description"})]}),i.jsx(po,{children:i.jsxs(m,{container:!0,sx:{flexDirection:"row",justifyContent:"space-between",margin:"0 auto"},children:[i.jsx(m,{item:!0,children:i.jsx(ee,{onClick:S,children:"No"})}),i.jsx(m,{item:!0,children:i.jsx(ee,{onClick:v=>{S(),{...t,offeringHost:n.host},r(n.host._id,t.bookingWhen)},children:"Yes"})})]})})]}),i.jsx(ee,{btnwidth:"140",onClick:()=>{f(!0)},children:"Decline"})]})]})]})};ko.propTypes={thisOffer:P.object.isRequired,thisEvent:P.object.isRequired,artistViewedHostOffer:P.func.isRequired,artistDeclinedHostOffer:P.func.isRequired,artistMe:P.object,auth:P.object,onNotificationDialogClose:P.func};const Ha=t=>({artistMe:t.artist.me,auth:t.auth}),Wn=ve(Ha,{artistViewedHostOffer:hn,artistDeclinedHostOffer:$s})(ko);function La(){return new URLSearchParams(Re().search)}Object.filter=(t,e)=>Object.keys(t).filter(r=>e(t[r])).reduce((r,n)=>(r[n]=t[n],r),[]);xn("input")({display:"none"});const qn=t=>new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"}),To=({artistMe:t,theArtist:e,theEvent:r,editArtistEvent:n,getHostsLocations:o,hosts:a,getArtists:s,artists:c,history:u,auth:l,myArtistEvents:f,jumpTo:h,jumpToState:_})=>{zs(),t&&r&&r.artist&&(t._id===r.artist||(t._id,r.artist._id)),w.useEffect(()=>{o(),s()},[]);const[b,S]=w.useState({artistSlug:"",promotionApproval:"",costStructure:"donation",namedPrice:"",payoutPlatform:"PayPal",payoutHandle:"",tourVibe:[],bookingWhen:"",bookingWhere:{},hostReachRadius:40,showSchedule:{setupTime:"17:45",startTime:"19:00",doorsOpen:"18:30",hardWrap:"21:00",flexible:!0},overnight:"",openers:"",eventOpeners:[],travelingCompanions:[],hangout:"",merchTable:!1,allergies:[],familyFriendly:!1,alcohol:!1,soundSystem:"",agreeToPayAdminFee:!1,agreeToPromote:!1,artistNotes:"",financialHopes:"",fanActions:[],artistUpdated:new Date});w.useEffect(()=>{r?S({artistSlug:r.artistSlug?r.artistSlug:"",promotionApproval:r.promotionApproval?r.promotionApproval:"",costStructure:r.costStructure?r.costStructure:"donation",namedPrice:r.namedPrice?r.namedPrice:"",payoutPlatform:r.payoutPlatform?r.payoutPlatform:"PayPal",payoutHandle:r.payoutHandle?r.payoutHandle:"",tourVibe:r.tourVibe?r.tourVibe:[],bookingWhen:r.bookingWhen?r.bookingWhen:"",bookingWhere:r.bookingWhere?r.bookingWhere:{},hostReachRadius:r.hostReachRadius?r.hostReachRadius:40,showSchedule:r.showSchedule?r.showSchedule:{setupTime:"17:45",startTime:"19:00",doorsOpen:"18:30",hardWrap:"21:00",flexible:!0},overnight:r.overnight?r.overnight:"",openers:r.openers?r.openers:"",eventOpeners:r.eventOpeners?r.eventOpeners:[],travelingCompanions:r.travelingCompanions==null?[]:r.travelingCompanions,hangout:r.hangout==null?!1:r.hangout,merchTable:r.merchTable==null?!1:r.merchTable,allergies:r.allergies?r.allergies:[],familyFriendly:r.familyFriendly==null?!1:r.familyFriendly,alcohol:r.alcohol==null?!1:r.alcohol,soundSystem:r.soundSystem?r.soundSystem:"",agreeToPayAdminFee:r.agreeToPayAdminFee==null?!1:r.agreeToPayAdminFee,agreeToPromote:r.agreeToPromote==null?!1:r.agreeToPromote,artistNotes:r.artistNotes?r.artistNotes:"",financialHopes:r.financialHopes?r.financialHopes:"",fanActions:r.fanActions?r.fanActions:[],artistUpdated:new Date}):l.loading||S({email:l.user.email,artistSlug:"",promotionApproval:"",costStructure:"donation",namedPrice:"",payoutPlatform:"PayPal",payoutHandle:"",tourVibe:[],bookingWhen:"",bookingWhere:{},hostReachRadius:40,showSchedule:{setupTime:"17:45",startTime:"19:00",doorsOpen:"18:30",hardWrap:"21:00",flexible:!0},overnight:"",openers:"",eventOpeners:[],travelingCompanions:[],hangout:"",merchTable:!1,allergies:[],familyFriendly:!1,alcohol:!1,soundSystem:"",agreeToPayAdminFee:!1,agreeToPromote:!1,artistNotes:"",financialHopes:"",fanActions:[]})},[l.loading,n,e,r]);const{artistSlug:O,promotionApproval:L,costStructure:I,payoutPlatform:y,payoutHandle:v,tourVibe:k,namedPrice:T,bookingWhen:U,bookingWhere:H,hostReachRadius:M,showSchedule:B,overnight:re,openers:K,eventOpeners:ae,travelingCompanions:R,hangout:oe,merchTable:pe,allergies:x,familyFriendly:p,alcohol:g,soundSystem:A,agreeToPayAdminFee:F,agreeToPromote:C,artistNotes:G,financialHopes:Z,fanActions:X}=b,N=t.stageName,$=j=>{xe.current=!0;let W=j.target.value;switch(j.target.type){case"checkbox":W=j.target.checked;break;default:W=j.target.value}const V=j.target.name.split(".");V.length===1?S({...b,[V[0]]:W}):S(fe=>({...fe,[V[0]]:{...fe[V[0]],[V[1]]:W}}))},E=(j,W,V)=>{xe.current=!0;let fe=V;S({...b,[W]:fe})};w.useEffect(()=>{xe.current&&U&&H&&H.city&&(n(b,u,!0),xe.current=!1)},[H]);const[de,me]=w.useState([]);w.useEffect(()=>{f&&f.length>0&&me(f&&f.filter(j=>j.bookingWhen!==U&&j.status!=="CANCELED").map(j=>j.bookingWhen))},[f]),w.useEffect(()=>{},[de]);const ge=(j,W)=>{if(W&&W!=="finish")return;xe.current=!0;let V=j,fe=new Date(V).toISOString();S({...b,bookingWhen:[fe]})},Ge=(j,W)=>{let V=W.concat([{}]);W.concat([{name:"",role:"",email:""}]),S({...b,[j]:V})},He=(j,W,V)=>{let fe=W.filter((Xe,q)=>q!==V);S({...b,[j]:fe})},Le=(j,W,V,fe)=>{xe.current=!0,fe.target.value,fe.target.value;let Xe=W.map((q,ne)=>V!==ne?q:{...q,[j]:fe.target.value});S({...b,[fe.target.name]:Xe})},xe=w.useRef(!1);w.useRef(!0);const Pe=w.useRef(null),Te=j=>{j.preventDefault(),U&&H&&H.city&&(n(b,u,!0),xe.current=!1)},[$e,_e]=w.useState(!0),he={bookingWhen:[i.jsx(Y,{component:"h2",children:"Please select a date youâd like to try to play a concert:"}),[i.jsx(go,{dateAdapter:xo,children:i.jsx(yo,{id:"bookingWhen",name:"bookingWhen",open:!0,disablePast:"true",referenceDate:qs(de),shouldDisableDate:j=>Ws(j,de),onCancel:()=>_e(!1),onChange:(j,W)=>ge(j,W)})})]],bookingWhere:[i.jsxs(Q,{component:"legend",children:["Please select where youâd like to try to play a concert on"," ",qn(U),":"]}),H&&i.jsxs(i.Fragment,{children:[i.jsx(m,{className:"whenBooking",container:!0,direction:"row",justifyContent:"space-around",alignItems:"start",spacing:2,sx:{backgroundColor:"rgba(0,0,0,0.15)","&:hover":{},border:"1px var(--light-color) solid",padding:"15px 25px",margin:"10px auto 0",width:"100%"},children:i.jsxs(m,{item:!0,size:{xs:12,md:12},children:[i.jsx(Bs,{id:"bookingWhere",value:H.city&&H||null,options:a,disableClearable:!0,groupBy:j=>j.fullState,getOptionLabel:j=>j.city+", "+j.state||"",isOptionEqualToValue:(j,W)=>j.city===W.city&&j.state===W.state,onChange:(j,W)=>{E(j,"bookingWhere",W)},renderTags:(j,W)=>j.map((V,fe)=>i.jsx(mo,{variant:"outlined",name:"bookingWhere",label:V.city+", "+V.state,...W({index:fe})},`bookingWhere${fe}`)),renderInput:j=>i.jsx(ie,{...j,sx:{width:"100%"},variant:"standard",label:`On ${qn(U)}, Iâd love to play in or around`,name:"bookingWhere"})}),i.jsxs(Y,{sx:{display:"inline-block",margin:"4px 4px -4px 0"},children:["Within a radius of"," "]}),i.jsx(ie,{sx:{display:"inline-block",width:`calc(${String(M).length}ch + 8ch)`,textAlign:"center","& input":{textAlign:"center"}},variant:"standard",name:"hostReachRadius",id:"hostReachRadius",value:M,onChange:j=>Number(j.target.value)>0&&$(j),type:"number",InputProps:{endAdornment:i.jsx(Qe,{position:"end",children:M>1?"miles":"mile"})}})]})}),i.jsx(m,{item:!0,container:!0,className:"feoyGoogleMap",size:{xs:12},children:i.jsx(Ca,{markers:a,markerClick:E,radius:Number(M),circleCenter:H&&H.city&&H.anonLatLong,bookingWhereZip:H.zip})})]})],tourVibe:[i.jsx(Q,{component:"legend",children:"We want to make sure you and the host are on the same page about what to expect concerning who the audience is. How would you describe your ideal audience?"}),[i.jsx(m,{item:!0,size:{xs:12},sx:{width:"100%"},children:i.jsx(ie,{variant:"standard",name:"tourVibe",multiline:!0,id:"tourVibe",label:"Iâm most comfortable performing for an audie
1nce who is ",placeholder:"[adjectives that describe your ideal audience]",value:k,onChange:j=>$(j),InputLabelProps:{shrink:!0},sx:{width:"100%"}})})]],merchTable:[i.jsx(Q,{component:"legend",children:"Will you need the host to provide a merch table?"}),[i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"merchTable",value:pe,name:"merchTable",onChange:j=>$(j),children:[i.jsx(le,{value:"true",control:i.jsx(ce,{}),label:"Yes"}),i.jsx(le,{value:"false",control:i.jsx(ce,{}),label:"No"})]})})]],promotionApproval:[i.jsx(Q,{component:"legend",children:"Do you approve Porchlight to use video, photo, and audio captured, for promotional purposes?"}),[i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"promotionApproval",value:L,name:"promotionApproval",onChange:j=>$(j),children:[i.jsx(le,{value:"yes",control:i.jsx(ce,{}),label:"Yes"}),i.jsx(le,{value:"no",control:i.jsx(ce,{}),label:"No"})]})})]],openers:[i.jsx(Q,{component:"legend",children:"Letâs talk openers. Whatâs your preference?"}),[i.jsxs(ze,{id:"openers",value:K,name:"openers",onChange:j=>{xe.current=!0,S({...b,openers:j.target.value,...j.target.value!=="I plan on having an opener(s)."?{eventOpeners:[]}:{}})},children:[i.jsx(le,{value:"I plan on having an opener(s).",control:i.jsx(ce,{}),label:"I plan on having an opener(s)."}),i.jsx(le,{value:"I'd like Porchlight Hosts to invite local openers.",control:i.jsx(ce,{}),label:"I'd like Porchlight Hosts to invite local openers."}),i.jsx(le,{value:"I'd prefer a solo set.",control:i.jsx(ce,{}),label:"I'd prefer a solo set."}),i.jsx(le,{value:"I have no preference.",control:i.jsx(ce,{}),label:"I have no preference."})]}),i.jsx(Ue,{in:K==="I plan on having an opener(s).",timeout:"auto",unmountOnExit:!0,sx:{width:"100%"},children:i.jsx(m,{item:!0,size:{xs:12},sx:{width:"100%"},children:i.jsx(Ta,{value:ae,artists:c,excludeArtistId:t&&t._id,onChange:(j,W)=>E(j,"eventOpeners",W)})})})]],namedPrice:[i.jsx(Q,{component:"legend",children:"Name your price. What do you suggest?"}),[i.jsx(m,{item:!0,children:i.jsx(ie,{variant:"standard",name:"namedPrice",id:"namedPrice",label:I=="donation"?"I'd suggest a donation of":"Tickets should cost",value:T,onChange:j=>$(j),type:"number",InputProps:{startAdornment:i.jsx(Qe,{position:"start",children:"$"}),endAdornment:i.jsx(Qe,{position:"end",children:"per person"})}})})]],payoutPlatform:[i.jsx(Q,{component:"legend",children:"For show payout, what is the email address associated with your Paypal account?"}),i.jsx(m,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:i.jsx(m,{item:!0,children:i.jsx(ie,{variant:"standard",sx:{width:420,maxWidth:"90vw",m:"0 0 0 0"},name:"payoutHandle",id:"payoutHandle",label:"The handle for my "+y+" account is",value:v,onChange:j=>$(j),helperText:""})})})],familyFriendly:[i.jsx(Q,{component:"legend",children:"Would this show be family-friendly?"}),[i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"familyFriendly",value:p,name:"familyFriendly",onChange:j=>$(j),children:[i.jsx(le,{value:"true",control:i.jsx(ce,{}),label:"Yes"}),i.jsx(le,{value:"false",control:i.jsx(ce,{}),label:"No"})]})})]],alcohol:[i.jsx(Q,{component:"legend",children:"Would you be comfortable if there was alcohol at the show?"}),[i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"alcohol",value:g,name:"alcohol",onChange:j=>$(j),children:[i.jsx(le,{value:"true",control:i.jsx(ce,{}),label:"Yes"}),i.jsx(le,{value:"false",control:i.jsx(ce,{}),label:"No"})]})})]],soundSystem:[i.jsx(Q,{component:"legend",children:"Are you bringing your own sound system for this show?"}),[i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"soundSystem",value:A,name:"soundSystem",onChange:j=>$(j),children:[i.jsx(le,{value:"yes",control:i.jsx(ce,{}),label:"Yes"}),i.jsx(le,{value:"noButNeed",control:i.jsx(ce,{}),label:"No, but I will need one."}),i.jsx(le,{value:"no",control:i.jsx(ce,{}),label:`No, ${N} can play an acoustic show if it makes sense for the size of the space.`})]})})]],financialHopes:[i.jsx(Q,{component:"legend",children:"What are your financial expectations and/or hopes for this concert?"}),[i.jsx(m,{item:!0,children:i.jsx(ie,{variant:"standard",name:"financialHopes",id:"financialHopes",label:"It would be hard for me to make less than",value:Z,onChange:j=>$(j),type:"number",InputProps:{startAdornment:i.jsx(Qe,{position:"start",children:"$"}),endAdornment:i.jsxs(Qe,{position:"end",children:[" ","for this show"]})}})})]],fanActions:[i.jsx(Q,{component:"legend",children:"What are the top ONE or TWO actions youâd like to see new fans make?"}),[i.jsx(m,{item:!0,size:{xs:12},sx:{width:"100%"},children:i.jsx(ie,{variant:"standard",name:"fanActions",multiline:!0,id:"fanActions",label:`New fans of ${N} should `,value:X,onChange:j=>$(j),sx:{width:"100%"}})})]],agreeToPromote:[i.jsx(Q,{component:"legend",children:"Do you agree to promote each show to your audience, including email sends and social media?"}),[i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"agreeToPromote",value:C,name:"agreeToPromote",onCh
1ange:j=>$(j),children:[i.jsx(le,{value:"true",control:i.jsx(ce,{}),label:"Yes, to the best of my ability."}),i.jsx(le,{value:"false",control:i.jsx(ce,{}),label:"No, I'm not willing to commit to that."})]})})]],travelingCompanions:[i.jsx(Q,{component:"legend",children:"Will anybody be travelling with you?"}),[R&&R.length>0?R.map((j,W)=>i.jsxs(m,{className:"travelingCompanion",container:!0,direction:"row",justifyContent:"space-around",alignItems:"start",spacing:1,size:{xs:12},sx:{backgroundColor:"rgba(0,0,0,0.15)","&:hover":{},padding:"10px 10px 10px",margin:"0px auto",width:"100%"},children:[i.jsx(m,{item:!0,size:{xs:12,md:3},children:i.jsx(ie,{variant:"standard",name:"travelingCompanions",id:`travelingCompanionName${W}`,label:R.length>1?"One of their names is":"The person's name is",value:j.name,onChange:V=>Le("name",R,W,V),sx:{width:"100%"}})}),i.jsx(m,{item:!0,size:{xs:12,md:2},children:i.jsx(ie,{variant:"standard",name:"travelingCompanions",id:`travelingCompanionRole${W}`,label:j.name?`${j.name.split(" ")[0]}'s role is`:"Their role is",value:j.role,onChange:V=>Le("role",R,W,V),sx:{width:"100%"}})}),i.jsx(m,{item:!0,size:{xs:10,md:6},children:i.jsx(ie,{variant:"standard",name:"travelingCompanions",id:`travelingCompanionEmail${W}`,label:j.name?`${j.name.split(" ")[0]}'s email is`:"Their email is",value:j.email,onChange:V=>Le("email",R,W,V),sx:{width:"100%"}})}),i.jsx(m,{item:!0,size:{xs:2,md:.65},children:i.jsx(St,{onClick:V=>He("travelingCompanions",R,W),size:"large",children:i.jsx(bn,{})})})]},`travelingCompanion${W}`)):"",i.jsx(m,{container:!0,item:!0,direction:"row",justifyContent:"center",alignItems:"center",size:{xs:12},children:i.jsxs(ee,{onClick:j=>Ge("travelingCompanions",R),children:[i.jsx(ka,{}),"Add person"]})})]],overnight:[i.jsxs(Q,{component:"legend",children:["Would you like for your host to arrange for you"," ",R.length>0?" and your traveling companions ":""," ","to stay overnight?",i.jsx("br",{}),i.jsx("small",{children:"(60% of Porchlight Hosts are interested in putting up musicians overnight!)"})]}),[i.jsx(m,{item:!0,children:i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"overnight",value:re,name:"overnight",onChange:j=>$(j),children:[i.jsx(le,{value:"1",control:i.jsx(ce,{}),label:"Yes, for 1 person, please."}),R&&R.length>0?R.map((j,W)=>i.jsx(le,{value:W+2,control:i.jsx(ce,{}),label:"Yes, for "+(W+2)+" people, please."},`travelingCompanion${W}`)):"",i.jsx(le,{value:"0",control:i.jsx(ce,{}),label:"No, thank you."})]})})})]],hangout:[[i.jsx(m,{item:!0,size:{xs:12},children:i.jsx(Q,{component:"legend",sx:{},children:"The heart of Porchlight is to cultivate relationships between artists and hosts. Are you open to spending some informal time with your hosts?"})})],[i.jsx(m,{item:!0,children:i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"hangout",value:oe,name:"hangout",onChange:j=>$(j),children:[i.jsx(le,{value:"I'd rather not.",control:i.jsx(ce,{}),label:"I'd rather not."}),i.jsx(le,{value:"That sounds great! I prefer a private hangout AFTER the show.",control:i.jsx(ce,{}),label:"That sounds great! I prefer a private hangout AFTER the show."}),i.jsx(le,{value:"That sounds great! I prefer a private hangout BEFORE the show.",control:i.jsx(ce,{}),label:"That sounds great! I prefer a private hangout BEFORE the show."}),i.jsx(le,{value:"That sounds great! Either before or after works for me.",control:i.jsx(ce,{}),label:"That sounds great! Either before or after works for me."})]})})})]],allergies:[i.jsx(Q,{component:"legend",children:"Please list any food allergies, pet allergies, or sensitivities you have."}),[i.jsx(m,{item:!0,size:{xs:12},sx:{width:"100%"},children:i.jsx(ie,{variant:"standard",name:"allergies",multiline:!0,id:"allergies",label:"I'm allergic to ",value:x,onChange:j=>$(j),sx:{width:"100%"}})})]],showSchedule:[i.jsx(Q,{component:"legend",children:"If you would like to propose a different show schedule, please edit our standard timeline below."}),[i.jsxs(m,{item:!0,children:[N," will need to start setting up at",i.jsx(ie,{variant:"standard",id:"setupTime",type:"time",name:"showSchedule.setupTime",value:B.setupTime||"",onChange:j=>$(j),inputProps:{step:900},sx:{padding:"0 8px",'& input[type="time"]::-webkit-calendar-picker-indicator':{filter:"invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%)"}}})," ","to have âdoors openâ at",i.jsx(ie,{variant:"standard",i
1d:"doorsOpen",type:"time",name:"showSchedule.doorsOpen",value:B.doorsOpen||"",onChange:j=>$(j),inputProps:{step:900},sx:{padding:"0 8px",'& input[type="time"]::-webkit-calendar-picker-indicator':{filter:"invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%)"}}}),"for the show starting at",i.jsx(ie,{variant:"standard",id:"startTime",type:"time",name:"showSchedule.startTime",value:B.startTime||"",onChange:j=>$(j),inputProps:{step:900},sx:{padding:"0 0 0 8px",'& input[type="time"]::-webkit-calendar-picker-indicator':{filter:"invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%)"}}}),"with a hard wrap at about"," ",i.jsx(ie,{variant:"standard",id:"hardWrap",type:"time",name:"showSchedule.hardWrap",value:B.hardWrap||"",onChange:j=>$(j),inputProps:{step:900},sx:{padding:"0 0 0 8px",'& input[type="time"]::-webkit-calendar-picker-indicator':{filter:"invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%)"}}}),"."]})]],artistNotes:[i.jsx(Q,{component:"legend",children:"Do you have any final thoughts, questions, notes, or clarifications for us? Feel free to list them below."}),i.jsx(m,{item:!0,size:{xs:12},sx:{width:"100%"},children:i.jsx(ie,{variant:"standard",name:"artistNotes",multiline:!0,id:"artistNotes",label:"Artist Notes",value:G,onChange:j=>$(j),sx:{width:"100%"}})})],endSlide:[[i.jsx(Y,{component:"h2",sx:{textAlign:"center"},children:"Hosts will see the fields youâve filled out (nothing orange):"}),i.jsx(Y,{component:"p",sx:{textAlign:"center",marginTop:"0px"},children:"(click to edit)"})],[i.jsx(uo,{theEvent:{...r||f.find(j=>{if(U&&U.length>0&&U[0])return j.bookingWhen===U[0]}),artist:t}})]]},Ie=La().get("field");let be=0;if(Ie){const j=Object.keys(he);be=j.indexOf(Ie)>-1?j.indexOf(Ie):0}if(_!==""){const j=Object.keys(he);be=j.indexOf(_)>-1?j.indexOf(_):0}const[d,D]=w.useState(be),z=d,[J,ye]=w.useState(1);w.useEffect(()=>{if(_!==""){const j=Object.keys(he);let W=j.indexOf(_)>-1?j.indexOf(_):0;_==="endSlide"?ye(1):(Pe.current&&Pe.current.scrollIntoView({behavior:"smooth",block:"end"}),ye(-1)),D(W)}},[_]);const Ce=w.useRef(null),[pt,nt]=w.useState(0);w.useEffect(()=>{nt(Ce.current.scrollHeight)},[]),w.useEffect(()=>{if(U&&_===""&&(ye(1),D(j=>(j+1)%Object.keys(he).length),Array.isArray(f)&&f.length>0)){const j=f.filter(W=>W.createdBy==="ARTIST");if(j.length>0){const V={...j.reduce((fe,Xe)=>fe.updatedAt>Xe.updatedAt?fe:Xe)};delete V.createdBy,delete V._id,delete V.createdAt,delete V.bookingWhen,delete V.updatedAt,delete V.hostsInReach,delete V.hostsOfferingToBook,delete V.offersFromHosts,delete V.confirmedHost,delete V.confirmedHostUser,delete V.confirmedDate,delete V.status,delete V.updatedAt,delete V.geocodedBookingWhere,delete V.latLong,delete V.preferredArtists,delete V.declinedArtists,delete V.artistReviewOfHost,delete V.showSchedule,delete V.attendees,delete V.inviteTokens,delete V.attendeeSummaries,delete V.numAttendees,delete V.myRSVP,delete V.isAttending,delete V.hostNotes,delete V.canceledBy,delete V.canceledDate,delete V.canceledReason,S({...b,...V})}}},[U]);const Dt=fn(d,{key:d,initial:null,from:{opacity:0,transform:`translateX(${J*60}vw)`},enter:{opacity:1,transform:"translateX(0%)"},leave:{opacity:0,transform:`translateX(${J*-60}vw)`},config:{mass:2,tension:280,friction:60},exitBeforeEnter:!1}),Ut=j=>{h(""),ye(1),D(W=>(U&&W===Object.keys(he).length-1&&(W=(W+1)%Object.keys(he).length),(W+1)%Object.keys(he).length)),xe.current&&Te(j)},hr=j=>{h(""),ye(-1),D(W=>(U&&W===1&&(W=Object.keys(he).length),W-1)),xe.current&&Te(j)};return i.jsxs(w.Fragment,{children:[U&&i.jsx(se,{sx:{position:"absolute",top:0,right:0,backgroundColor:"rgba(0 0 0 /.6)",padding:"0",zIndex:100},children:i.jsx(et,{date:U})}),i.jsxs("form",{className:"form",onSubmit:j=>Te(j),children:[i.jsx(pn,{variant:"progress",steps:Object.keys(he).length||z.length,position:"static",activeStep:z,sx:{position:"absolute",top:0,padding:"0px",left:0,right:0,width:"100%","& .MuiLinearProgress-root":{width:"100%"}},backButton:void 0,nextButton:void 0,LinearProgressProps:{color:"primary"}}),i.jsx(m,{container:!0,sx:{padding:"20px!important",opacity:U?"1":"0",zIndex:U?"100":"-99999",transform:U?"translate(0px, 0)":"translate(0,-100px)",transition:"all 1s cubic-bezier(0.23, 1, 0.32, 1) 0ms",transitionDelay:U?".10s":".2s",overflow:"hidden",position:"relative"},className:"formNavContainer",ref:Ce,size:{xs:12}
1,spacing:1,children:i.jsxs(m,{container:!0,item:!0,sx:{width:"100%",marginTop:"20px"},direction:"row",justifyContent:"center",alignItems:"center",zIndex:"100",position:"relative",className:"formNav",ref:Pe,children:[i.jsx(m,{item:!0,children:i.jsxs(ee,{variant:"contained",component:"span",onClick:j=>hr(j),children:[i.jsx(mn,{}),"Previous"]})}),i.jsx(m,{item:!0,children:i.jsxs("label",{htmlFor:"submit",children:[i.jsx("input",{id:"submit",type:"submit",hidden:!0}),i.jsxs(ee,{variant:"contained",component:"span",onClick:j=>Te(j),children:["Save ",i.jsx(Ms,{})]})]})}),i.jsx(m,{item:!0,children:i.jsxs(ee,{variant:"contained",component:"span",onClick:j=>Ut(j),children:["Next",i.jsx(tr,{})]})}),_!==""&&_!=="endSlide"&&i.jsx(m,{item:!0,children:i.jsxs(ee,{variant:"contained",component:"span",onClick:j=>{xe.current&&Te(j),h("endSlide")},children:["To Summary",i.jsx(tr,{})]})})]})}),Dt((j,W)=>i.jsx(gn.div,{className:"animatedFormGroup",style:{...j,top:U?pt+"px":"0px",transition:"top 750ms cubic-bezier(0.23, 1, 0.32, 1) 0ms",transitionDelay:U&&W>0?".05s":"2s"},children:i.jsx("div",{className:"form-group",children:i.jsxs(m,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",spacing:1,sx:{width:"100%",margin:"0 auto"},size:{xs:12},children:[i.jsx(m,{item:!0,size:{xs:12},sx:{"--form-num":`'${W}'`},"data-form-num":W,className:"formInquiry",children:he[Object.keys(he)[W]][0]}),he[Object.keys(he)[W]][1]]})},"form-group"+W)},"animatedFormGroup"+W))]})]})};To.propTypes={getHostsLocations:P.func.isRequired,hosts:P.array.isRequired,getArtists:P.func.isRequired,artists:P.array.isRequired,editArtistEvent:P.func.isRequired,theArtist:P.object,theEvent:P.object,auth:P.object.isRequired,artistMe:P.object,myArtistEvents:P.array,jumpToState:P.string,jumpTo:P.func.isRequired};const $a=t=>({auth:t.auth,hosts:t.host.hosts,artists:t.artist.artists,artistMe:t.artist.me,myArtistEvents:t.event.myArtistEvents,jumpToState:t.app.jumpTo}),Co=ve($a,{jumpTo:lr,getHostsLocations:Gs,getArtists:Vs,editArtistEvent:Es})(To),Ao=({theEvent:t,jumpTo:e,closeEventEditDrawer:r,myArtistEvents:n})=>{const[o,a]=w.useState(!1),s=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent);let c="";return w.useEffect(()=>{Array.isArray(n)&&n.length>0&&(c=n.reduce((u,l)=>u.updatedAt>l.updatedAt?u:l)._id)},[n]),i.jsxs(i.Fragment,{children:[i.jsxs(yn,{anchor:"bottom",open:o,onClose:()=>{r(c),e(""),a(!1)},onOpen:()=>a(!0),disableBackdropTransition:!s,disableDiscovery:s,className:"porchlightBG",children:[i.jsx(se,{sx:{top:0,right:60,position:"absolute"},children:i.jsx(m,{container:!0,children:i.jsx(m,{item:!0,sx:{fontSize:"1.5em",marginLeft:"8px",lineHeight:"1.5",marginTop:"8px"},children:t.bookingWhere.city+", "+t.bookingWhere.state})})}),i.jsx(m,{item:!0,sx:{minHeight:"85vh"},children:o&&i.jsx(Co,{theEvent:t})})]}),i.jsx(ee,{btnwidth:"250",onClick:()=>{e("endSlide"),a(!0)},children:"Edit Concert Details"})]})};Ao.propTypes={theEvent:P.object,jumpTo:P.func,closeEventEditDrawer:P.func,myArtistEvents:P.array};const za=t=>({myArtistEvents:t.event.myArtistEvents}),Ba=ve(za,{jumpTo:lr,closeEventEditDrawer:cr})(Ao);function Wa(){return new URLSearchParams(Re().search)}Object.filter=(t,e)=>Object.keys(t).filter(r=>e(t[r])).reduce((r,n)=>(r[n]=t[n],r),[]);xn("input")({display:"none"});const Fo=({artistMe:t,history:e,auth:r,theEvent:n,artistReviewsHost:o,onNotificationDialogClose:a})=>{const[s,c]=w.useState({}),[u,l]=w.useState({}),[f,h]=w.useState({});w.useEffect(()=>{if(n&&n._id){const z=n.offersFromHosts.filter(J=>(J.status==="ACCEPTED",J))[0];l(z)}n.artistReviewOfHost&&c(n.artistReviewOfHost)},[n]),w.useEffect(()=>{n.artistReviewOfHost&&c(n.artistReviewOfHost)},[n.artistReviewOfHost]),w.useEffect(()=>{u&&u.host&&h(u.host)},[u]);const[_,b]=w.useState({eventId:"",artistId:"",hostId:"",bookingWhen:"",bookingWhere:{},communication:0,promotion:0,tipsDonations:0,merchSales:0,ticketSales:0,revenueExpectations:"",attendanceExpectations:"",audienceQuality:"",venueQuality:0,everythingNeeded:0,introductionByHost:0,hostExample:0,hostInteractions:0,hostAccommodations:0,hostCommitment:0,artistNotes:"",hostRating:0,hostFeedback:"",testimonial:"",hostCritique:"",otherArt
1istFeedback:"",otherArtistFeedbackPrivacy:"",porchlightRating:0,porchlightFeedback:"",porchlightTestimonial:"",totalTakeHome:"",audienceSize:""});w.useEffect(()=>{n._id&&s?b({eventId:n._id?n._id:"",artistId:t._id?t._id:"",hostId:!u.host||u.host&&!u.host._id?"":u.host._id,bookingWhen:n.bookingWhen?n.bookingWhen:"",bookingWhere:n.bookingWhere?n.bookingWhere:{},communication:s.communication?s.communication:0,promotion:s.promotion?s.promotion:0,tipsDonations:s.tipsDonations?s.tipsDonations:0,merchSales:s.merchSales?s.merchSales:0,ticketSales:s.ticketSales?s.ticketSales:0,revenueExpectations:s.revenueExpectations?s.revenueExpectations:"",attendanceExpectations:s.attendanceExpectations?s.attendanceExpectations:"",audienceQuality:s.audienceQuality?s.audienceQuality:"",venueQuality:s.venueQuality?s.venueQuality:0,everythingNeeded:s.everythingNeeded?s.everythingNeeded:0,introductionByHost:s.introductionByHost?s.introductionByHost:0,hostExample:s.hostExample?s.hostExample:0,hostInteractions:s.hostInteractions?s.hostInteractions:0,hostAccommodations:s.hostAccommodations?s.hostAccommodations:0,hostCommitment:s.hostCommitment?s.hostCommitment:0,artistNotes:s.artistNotes?s.artistNotes:"",hostRating:s.hostRating?s.hostRating:0,hostFeedback:s.hostFeedback?s.hostFeedback:"",testimonial:s.testimonial?s.testimonial:"",hostCritique:s.hostCritique?s.hostCritique:"",otherArtistFeedback:s.otherArtistFeedback?s.otherArtistFeedback:"",porchlightRating:s.porchlightRating?s.porchlightRating:0,porchlightFeedback:s.porchlightFeedback?s.porchlightFeedback:"",porchlightTestimonial:s.porchlightTestimonial?s.porchlightTestimonial:"",totalTakeHome:s.totalTakeHome?s.totalTakeHome:"",audienceSize:s.audienceSize?s.audienceSize:""}):n._id&&b({eventId:n._id?n._id:"",artistId:t._id?t._id:"",hostId:!u.host||u.host&&!u.host._id?"":u.host._id,bookingWhen:n.bookingWhen?n.bookingWhen:"",bookingWhere:n.bookingWhere?n.bookingWhere:{}})},[r.loading,t,n,u,s]);const{communication:S,promotion:O,tipsDonations:L,merchSales:I,ticketSales:y,revenueExpectations:v,attendanceExpectations:k,audienceQuality:T,venueQuality:U,everythingNeeded:H,introductionByHost:M,hostExample:B,hostInteractions:re,hostAccommodations:K,hostCommitment:ae,artistNotes:R,hostRating:oe,hostFeedback:pe,testimonial:x,hostCritique:p,otherArtistFeedback:g,porchlightRating:A,porchlightFeedback:F,porchlightTestimonial:C,totalTakeHome:G,audienceSize:Z}=_,X=z=>{N.current=!0;let J=z.target.value;switch(z.target.type){case"checkbox":J=z.target.checked;break;default:J=z.target.value}const ye=z.target.name.split(".");ye.length===1?b({..._,[ye[0]]:J}):b(Ce=>({...Ce,[ye[0]]:{...Ce[ye[0]],[ye[1]]:J}}))},N=w.useRef(!1);w.useRef(!0);const $=z=>{z.preventDefault(),o(_,e,!0),N.current=!1},E={hostRating:[[i.jsx(se,{className:"squareImgInACircle",sx:{height:"150px",width:"150px",maxHeight:"150px",maxWidth:"150px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${f.profileImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:"1px solid var(--primary-color)",margin:"0 auto",display:"flex",justifyContent:"center",alignItems:"end",aspectRatio:"1 / 1"}}),i.jsxs(Q,{component:"legend",children:["How was your overall experience with"," ",f.firstName+" "+f.lastName,"?"]})],[i.jsx(Fe,{component:"fieldset",children:i.jsx(rr,{size:"large",id:"hostRating",value:oe,name:"hostRating",onChange:z=>X(z)})})]],hostFeedback:[[i.jsx(se,{className:"squareImgInACircle",sx:{height:"150px",width:"150px",maxHeight:"150px",maxWidth:"150px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${f.profileImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:"1px solid var(--primary-color)",margin:"0 auto",display:"flex",justifyContent:"center",alignItems:"end",aspectRatio:"1 / 1"}}),i.jsxs(Q,{component:"legend",children:["INTERNAL USE ONLY: Tell us a bit more about your time with"," ",f.firstName,", including both highlights and challenges."]}),i.jsxs(Q,{component:"small",children:[i.jsx("em",{children:"For instance, did they make you feel welcome, introduce you to stage well, promote the show, model to others in the audience how they should be attentively listening, etc."}),"?"]})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"}
1,className:"hostFeedback_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"hostFeedback",id:"hostFeedback",placeholder:"Type your response here",value:pe,onChange:z=>X(z),sx:{width:"100%"}})})]],testimonial:[[i.jsx(se,{className:"squareImgInACircle",sx:{height:"150px",width:"150px",maxHeight:"150px",maxWidth:"150px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${f.profileImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:"1px solid var(--primary-color)",margin:"0 auto",display:"flex",justifyContent:"center",alignItems:"end",aspectRatio:"1 / 1"}}),i.jsx(Q,{component:"legend",children:"TESTIMONIAL TO SHARE: What would you like others to know about this host or this particular gathering?"})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"testimonial_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"testimonial",id:"testimonial",placeholder:"Type your response here",value:x,onChange:z=>X(z),sx:{width:"100%"}})})]],hostCritique:[[i.jsxs(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"80%"},className:"hostCritique_header",justifyContent:"center",children:[i.jsx(Q,{component:"legend",sx:{textAlign:"center"},children:"FOR HOST: Was there anything about the show, venue, or host interactions you think could have been improved?"}),i.jsx(Q,{component:"small",sx:{textAlign:"center"},children:"Be as long or short as you would like; the more specific your feedback, the more helpful!"})]})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"hostCritique_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"hostCritique",id:"hostCritique",placeholder:"Type your response here",value:p,onChange:z=>X(z),sx:{width:"100%"}})})]],otherArtistFeedback:[[i.jsx(Q,{component:"legend",children:"If there was another artist part of this event, please list their name here and any feedback you'd like to share."}),i.jsx(Q,{component:"small",sx:{textAlign:"center"},children:"Please indicate whether this feedback is intended for internal review or external testimonial."})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"otherArtistFeedback_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"otherArtistFeedback",i
1d:"otherArtistFeedback",placeholder:"Type your response here",value:g,onChange:z=>X(z),sx:{width:"100%"}})})]],porchlightRating:[[i.jsx(Q,{component:"legend",children:"How was your overall experience with Porchlight?"})],[i.jsx(Fe,{component:"fieldset",children:i.jsx(rr,{size:"large",id:"porchlightRating",value:A,name:"porchlightRating",onChange:z=>X(z)})})]],porchlightFeedback:[[i.jsx(Q,{component:"legend",children:"INTERNAL USE ONLY: Tell us a bit more about your experience with Porchlight, including both highlights and challenges."})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"porchlightFeedback_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"porchlightFeedback",id:"porchlightFeedback",placeholder:"Type your response here",value:F,onChange:z=>X(z),sx:{width:"100%"}})})]],porchlightTestimonial:[[i.jsx(Q,{component:"legend",children:"TESTIMONIAL TO SHARE: What would you like others to know about this network?"})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"porchlightTestimonial_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"porchlightTestimonial",id:"porchlightTestimonial",placeholder:"Type your response here",value:C,onChange:z=>X(z),sx:{width:"100%"}})})]],totalTakeHome:[[i.jsx(Q,{component:"legend",children:"Financials Breakdown"}),i.jsx(Q,{component:"small",sx:{textAlign:"center"},children:"(Note: We only ask these questions because they help our nonprofit (Renew the Arts) demonstrate the financial partnership cultivated through Porchlight to support artists throughout the year.)"})],[[i.jsx(Q,{component:"legend",children:"How much overall did you take home?"}),i.jsx(Fe,{component:"fieldset",children:i.jsx(ie,{variant:"standard",name:"totalTakeHome",id:"totalTakeHome",value:G,onChange:z=>X(z),type:"number",InputProps:{startAdornment:i.jsx(Qe,{position:"start",children:"$"})}})})],[i.jsx(Q,{component:"legend",children:"How much of this total was in merch sales?"}),i.jsx(Fe,{component:"fieldset",children:i.jsx(ie,{variant:"standard",name:"merchSales",id:"merchSales",value:I,onChange:z=>X(z),type:"number",InputProps:{startAdornment:i.jsx(Qe,{position:"start",children:"$"})}})})],[i.jsx(Q,{component:"legend",children:"Did this revenue live up to your expectations?"}),i.jsx(Fe,{component:"fieldset",children:i.jsxs(ze,{id:"revenueExpectations",value:v,name:"revenueExpectations",onChange:z=>X(z),children:[i.jsx(le,{value:"fellShort",control:i.jsx(ce,{}),label:"No, this revenue fell short of my expectations"}),i.jsx(le,{value:"met",control:i.jsx(ce,{}),label:"Yes, this revenue met my expectations."}),i.jsx(le,{value:"exceeded",control:i.jsx(ce,{}),label:"Did it ever?! This revenue exceeded my expectations!"})]})})]]],audienceSize:[[i.jsx(Q,{component:"legend",children:"How many attendees would you guess were there? How would you summarize their quality as an audience?"})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"audienceSize_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"audienceSize",id:"audienceSize",placeholder:"Type your response here",value:Z,onChange:z=>X(z),sx:{width:"100%"}})})]],endSlide:[[i.jsx(Y,{component:"h2",sx:{fontSize:"2.2em!important",textAlign:"center"},children:"Thanks so much!"}),i.jsx(Y,{component:"h2",sx:{fontSize:"2.2em!important",textAlign:"center"},children:"It helps more than you know..."}),i.jsxs(i.Fragment,{children:[i.jsx(Y,{component:"p",sx:{textAlign:"center",marginTop:"16px",textWrap:"balance"},children:"The Porchlight community is constantly growing and learning, and your insight is essential as we develop a network of hosts who exemplify the heart of Jesus as we all care for attendees, artists, and culture."}),i.jsx(Y,{component:"p",sx:{textAlign:"center",marginTop:"16px"},children:"Your collaboration and perspective is an essential part of this process."}),i.jsx(Y,{component:"p",sx:{textAlign:"center",marginTop:"16px"},children:"Thank you."}),i.jsx(m,{item:!0,container:!0,justifyContent:"center",sx:{marginTop:"16px"},children:i.jsx(ee,{btnwidth:"300",onClick:()=>{d(!1),typeof a=="function"&&a()},children:"Close This Window"})})]})]]};let de=Wa();const me=de.get("field"),ge=de.get("eventID"),Ge=de.get("open"),He=Re();let Le=0;if(me){const z=Object.keys(E);Le=z.indexOf(me)>-1?z.indexOf(me):0}const[xe,Pe]=w.useState(Le),Te=xe,[$e,_e]=w.useState(1),he=fn(xe,{key:xe,initial:null,from:{opacity:0,transform:`translateX(${$e*60}vw)`}
1,enter:{opacity:1,transform:"translateX(0%)"},leave:{opacity:0,transform:`translateX(${$e*-60}vw)`},config:{mass:2,tension:280,friction:60},exitBeforeEnter:!1}),Ke=z=>{_e(1),N.current&&$(z),Pe(J=>J===Object.keys(E).length-1?J:J+1)},Ie=z=>{_e(-1),N.current&&$(z),Pe(J=>J==0?J:J-1)},[be,d]=w.useState(!1),D=()=>{d(!1),typeof a=="function"&&a()};return w.useEffect(()=>{if(Ge!=="survey"||!n||!ge||String(n._id)!==String(ge))return;const z=setTimeout(()=>d(!0),dn);return()=>clearTimeout(z)},[Ge,ge,n._id,He.key]),i.jsxs(w.Fragment,{children:[i.jsxs(wt,{open:be,onClose:D,scroll:"body",fullWidth:!0,maxWidth:"lg",className:"porchlightBG",children:[i.jsx(pn,{variant:"progress",steps:Object.keys(E).length||Te.length,position:"static",activeStep:Te,sx:{position:"absolute",top:0,padding:"0px",left:0,right:0,width:"100%","& .MuiLinearProgress-root":{width:"100%"}},backButton:void 0,nextButton:void 0,LinearProgressProps:{color:"primary"}}),i.jsxs(jt,{sx:{},children:[i.jsx(se,{sx:{position:"absolute",top:0,right:0,backgroundColor:"rgba(0 0 0 /.6)",padding:"0"},children:i.jsx(et,{date:n.bookingWhen})}),i.jsxs("form",{className:"form",onSubmit:z=>$(z),children:[i.jsx(m,{container:!0,direction:"row",alignItems:"start",justifyContent:"center",height:"65vh",sx:{padding:"20px!important"},children:i.jsxs(m,{container:!0,item:!0,sx:{width:"100%"},direction:"row",justifyContent:"center",alignItems:"center",className:"cardNav",children:[i.jsx(m,{item:!0,children:i.jsxs(ee,{variant:"contained",component:"span",onClick:z=>Ie(z),sx:{opacity:Te>0?1:.2,transition:"opacity 450ms cubic-bezier(0.23, 1, 0.32, 1) 500ms"},children:[i.jsx(mn,{}),"Previous"]})}),i.jsx(m,{item:!0,children:i.jsxs(ee,{variant:"contained",component:"span",onClick:z=>Ke(z),sx:{opacity:Te!==Object.keys(E).length-1?1:.2,transition:"opacity 450ms cubic-bezier(0.23, 1, 0.32, 1) 500ms"},children:["Next",i.jsx(tr,{})]})})]})},"cardGrid"+n._id+t._id),he((z,J)=>i.jsx(gn.div,{className:"animatedFormGroup",style:{...z,minHeight:"inherit"},children:i.jsx("div",{className:"form-group",style:{maxWidth:"100%"},children:i.jsxs(m,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",sx:{width:"100%",margin:"0 auto"},children:[i.jsx(m,{item:!0,size:{xs:12},sx:{"--form-num":`'${J+1}'`},"data-form-num":J+1,className:"formInquiry",children:E[Object.keys(E)[J]][0]}),E[Object.keys(E)[J]][1]]},"bookingDetails"+n._id+J)},"form-group"+J)},"animatedFormGroup"+J))]})]})]}),(!n.artistReviewOfHost||!n.artistReviewOfHost._id)&&i.jsxs(se,{className:"createdAt",sx:{position:"absolute",top:"8px",right:"8px"},children:[" ",i.jsxs(Y,{component:"p",sx:{fontSize:".7em",fontFamily:"var(--secondary-font)",color:"var(--link-color)"},children:[i.jsx(wo,{style:{fontSize:"1.5em"}})," ","Please consider reviewing your experience with"," ",f.firstName," ",f.lastName,"."]})]}),i.jsx(m,{item:!0,style:{margin:"20px auto 0",alignSelf:"center"},children:i.jsx(ee,{btnwidth:"250",onClick:()=>d(!0),children:n.artistReviewOfHost&&n.artistReviewOfHost._id?"Edit Your Review":"Review Your Experience"})})]},"Fragment"+n._id+t._id)};Fo.propTypes={artistMe:P.object.isRequired,theEvent:P.object,auth:P.object.isRequired,artistReviewsHost:P.func.isRequired,onNotificationDialogClose:P.func};const qa=t=>({auth:t.auth,artistMe:t.artist.me}),Ma=ve(qa,{artistReviewsHost:Ys})(Fo),Oo=({thisEvent:t,artistViewedHostOffer:e,deleteArtistEvent:r,eventEditDrawer:n,artistMe:o,auth:a,onCancelStarted:s})=>{const[c,u]=w.useState(!1),[l,f]=w.useState(!1),h=Re(),{focused:_,releaseFocus:b}=bo(t&&t._id),[S,O]=w.useState({});w.useEffect(()=>{u(!0)},[S]);const L=Array.isArray(t.offersFromHosts)&&t.offersFromHosts.some(K=>K&&K.status==="ACCEPTED"),I=t.createdBy==="ARTIST"&&t.status==="CONFIRMED"&&L,y=w.useRef(null),[v,k]=w.useState(0),[T,U]=w.useState(0);w.useEffect(()=>{k(y.current.offsetHeight),U(y.current.offsetWidth)},[]),w.useEffect(()=>{t._id===n&&y.current&&y.current.scrollIntoView({behavior:"smooth",block:"center"})},[n]),w.useEffect(()=>{const K=new URLSearchParams(h.search).get("eventID");if(!K||String(t._id)!==String(K))return;const ae=setTimeout(()=>{y.current&&y.current.scrollIntoView({behavior:"smooth",block:"center"})},400);return()=>clearTimeout(ae)},[t._id,h.search,h.key]);const[H,M]=w.useState(!1);w.useEffect(()=>{t.declinedArtists&&t.declinedArtists.length>-1&&M(t.declinedArtists.filter(K=>K.artist===o._id).length>0)},[t.declinedArtists]);const[B,re]=w.useState(0);return w.useEffect(()=>{t.hostsInReach&&t.hostsInReach.length>0&&re(t.hostsInReach.filter(K=>K.declined?1:0).length)},[t.hostsInReach]),i.jsx(i.Fragment,{children:i.jsx(Ne,{arrow:!0,followCursor:!0,title:H?i.jsx("div",{style:{fontFamily:"var(--secondary-font)",color:"#fff",textAlign:"center"},children:"You declined this offer."}
1):"",children:i.jsxs(m,{container:!0,item:!0,className:(t._id===n?"ArtistDashboardEventCard bookingWhen mostRecent":"ArtistDashboardEventCard bookingWhen")+(_?" notificationFocus":""),size:{xs:12,sm:12},id:t._id?String(t._id):void 0,ref:y,sx:{backgroundColor:"rgba(0,0,0,0.35)","&:hover":{},padding:"16px",margin:"4px",color:"var(--light-color)",justifyContent:"flex-start",flexWrap:"nowrap",opacity:H?"0.6":"1",position:"relative",filter:H?"grayscale(100%)":"",flexDirection:t.status==="CONFIRMED"&&new Date(t.bookingWhen)<new Date?"column":"row",backgroundImage:t.status==="CANCELED"?"repeating-linear-gradient(45deg, rgb(255 0 0 / 10%) 5px, rgb(255 0 0 / 10%) 15px, transparent 15px, transparent 30px)":"none",maskImage:t.status==="CANCELED"?"radial-gradient(black 50%, transparent)":"none"},children:[i.jsx("svg",{width:T,height:v,className:"eventCardSvgBorder",style:{pointerEvents:"none"},children:i.jsx("polygon",{points:"0,"+v+" 0,0 "+T+",0 "+T+","+v,className:t._id===n?"borderEffect":"",style:{strokeDasharray:`${v*2} ${v*2+T*2}`,strokeDashoffset:t._id===n?`${v*2}`:`${v*2+T*3}`}})}),i.jsxs(m,{container:!0,item:!0,direction:"row",className:"dateLocationForBookingWrapper",sx:{justifyContent:{xs:"center",sm:"space-evenly"},margin:{xs:"10px auto",sm:"0px auto"},width:"100%"},size:{xs:12},children:[t.createdBy==="HOST"&&t.offersFromHosts&&t.offersFromHosts.length>0&&t.offersFromHosts[0]&&t.offersFromHosts[0].host&&t.offersFromHosts[0].host.profileImg&&i.jsx(m,{className:"feoyAvatarGridItem",item:!0,sx:{flexBasis:{xs:"80px",sm:"130px"},flexShrink:"3",flexGrow:"2"},size:{xs:12},children:i.jsx(se,{className:"squareImgInACircle",sx:{height:"auto",width:"auto",maxHeight:"130px",maxWidth:"130px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${t.offersFromHosts[0].host.profileImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:"1px solid var(--primary-color)",margin:{xs:"0 auto",sm:"0 8px 0 0"},aspectRatio:"1 / 1"}})}),i.jsxs(m,{container:!0,item:!0,direction:"column",alignItems:"flex-start",className:"dateLocationForBooking",sx:{flexBasis:{xs:"none",sm:"calc(100% - 130px)"},flexGrow:"1"},size:{xs:12},children:[t.createdBy==="HOST"&&t.offersFromHosts&&t.offersFromHosts.length>0&&t.offersFromHosts[0]&&t.offersFromHosts[0].host&&t.offersFromHosts[0].host.profileImg&&i.jsx(m,{item:!0,container:!0,className:"hostName",children:i.jsxs(Y,{component:"h2",children:[t.offersFromHosts[0].host.firstName," ",t.offersFromHosts[0].host.lastName," "]})}),i.jsxs(m,{container:!0,item:!0,direction:"row",alignItems:"center",className:"feoyDateLocation",sx:{flexWrap:"nowrap"},size:{xs:12},spacing:1.5,children:[i.jsx(m,{item:!0,sx:{},children:i.jsx(et,{date:t.bookingWhen})}),i.jsxs(m,{item:!0,size:{xs:12},className:"cityStateAndHostsDeclined",sx:{},children:[i.jsxs(m,{container:!0,sx:{flexDirection:"row"},size:{xs:12},children:[i.jsx(m,{item:!0,className:"cityST",sx:{fontSize:{xs:"1.2em",sm:"1.5em"},lineHeight:"1.5"},children:t.bookingWhere.city+", "+t.bookingWhere.state}),t.status==="PENDING"&&t.createdBy==="ARTIST"&&t.hostsInReach&&t.hostsInReach.length>0&&i.jsx(i.Fragment,{children:t.hostsInReach.length===1?i.jsxs(m,{item:!0,className:"hostsDeclined",sx:{fontSize:{xs:".8em"},margin:"6px 8px 0 8px",color:"var(--primary-color)"},children:["(",B===1?"The only host in the area declined":"The host in the area hasnât declined, yet",")"]}):t.hostsInReach.length===B?i.jsxs(m,{item:!0,className:"hostsDeclined",sx:{fontSize:{xs:".8em"},margin:"6px 8px 0 8px",color:"var(--primary-color)"},children:["(Each of the"," ",t.hostsInReach.length," ","hosts in the area declined)"]}):i.jsxs(m,{item:!0,className:"hostsDeclined",sx:{fontSize:{xs:".8em"},margin:"6px 8px 0 8px",color:"var(--primary-color)"},children:["(",B," of"," ",t.hostsInReach.length," ","hosts in the area declined, so far)"]})})]}),t.createdBy==="ARTIST"&&t.offersFromHosts&&t.offersFromHosts.length>0?i.jsxs(m,{item:!0,container:!0,className:"artistOffersFromHosts",sx:{width:"100%",alignItems:"center"},children:[t.offersFromHosts.filter(K=>K).map((K,ae)=>i.jsx(Wn,{thisOffer:K,thisEvent:t,onNotificationDialogClose:b})),I&&i.jsxs(m,{item:!0,sx:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx(Me,{to:`/events/${t._id}`,style:{textDecoration:"none"},children:i.jsx(ee,{btnwidth:"160",children:"Event Page"})}),i.jsx(Mr,{theEvent:t,canceledBy:"ARTIST",inline:!0,onCancelStarted:s})]})]}):t.createdBy==="ARTIST"?i.jsx(m,{item:!0,container:!0,className:"artistOffersFromHosts",children:i.jsx(Ba,{theEvent:t})}):t.createdBy==="HOST"&&t.confirmedHost?i.jsx(m,{item:!0,container:!0,className:"artistOffersFromHosts",children:t.offersFromHosts.filter(K=>K).map((K,ae)=>i.jsx(Wn,{thisOffer:K,thisEvent:t,onNotificationDialogClose:b}))}):i.jsx(i.Fragment,{})]})]})]})]}),t.createdBy==="ARTIST"&&t.status!=="CONFIRMED"&&t.status!=="CANCELED"&&i.jsx(m,{item:!0,className:"deleteBtn",size:{xs:1},children:i.jsx(St,{onClick:K=>r(t._id),size:"large",sx:{position:{xs:"absolute",sm:"relative"},top:{xs:"0",sm:"auto"},right:{xs:"0",sm:"auto"}},children:i.jsx(bn,{})})}),t.status==="CONFIRMED"&&(t.confirmedArtist===o._id||!t.confirmedArtist)&&new Date(t.bookingWhen)<new Date&&i.jsx(Ma,{theEvent:t,onNotificationDialogClose:b}),t.status==="CANCELED"&&t.canceledDate&&i.jsxs(Y,{component:"p",sx:{color:"var(--red)",fontSize:"10px",position:"absolute",bottom:"5px",left:"50%",transform:"translateX(-50%)",textAlign:"center"},children:["Canceled on:"," ",new Date(t.canceledDate).toLocaleDateString(void 0,{year:"numeric",month:"numeric",day:"numeric",timeZone:"UTC"})]}),!I&&i.jsx(Mr,{theEvent:t,canceledBy:"ARTIST",onCancelStarted:s})]},t._id)})})};Oo.propTypes={thisEvent:P.object.isRequired,artistViewedHostOffer:P.func.isRequired,deleteArtistEvent:P.func.isRequired,eventEditDrawer:P.string,artistMe:P.object.isRequired,auth:P.object,onCancelStarted:P.func};const Ea=t=>({eventEditDrawer:t.app.eventEditDrawer,artistMe:t.artist.me,auth:t.auth}),st=ve(Ea,{artistViewedHostOffer:hn,deleteArtistEvent:Ks})(Oo),ur=({isArriving:t,eventId:e,onAnimationComplete:r,scrollDelayMs:n=750,enterTimeoutMs:o=400,exitTimeoutMs:a=250,
1children:s})=>{const c=w.useRef(null),u=w.useRef(!!t),[l,f]=w.useState(!t);return w.useEffect(()=>{if(!u.current)return;if(c.current&&c.current.scrollIntoView)try{c.current.scrollIntoView({behavior:"smooth",block:"center"})}catch{c.current.scrollIntoView()}const h=setTimeout(()=>f(!0),n);return()=>clearTimeout(h)},[n]),i.jsx(Ue,{in:l,timeout:{enter:o,exit:a},sx:{width:"100%"},onEntered:()=>{u.current&&typeof r=="function"&&e&&r(e)},children:i.jsx(se,{ref:c,sx:{width:"100%"},children:s})})};ur.propTypes={isArriving:P.bool,eventId:P.string,onAnimationComplete:P.func,scrollDelayMs:P.number,enterTimeoutMs:P.number,exitTimeoutMs:P.number,children:P.node};const Ro=({jumpTo:t,myHostEvents:e,closeEventEditDrawer:r})=>{const[n,o]=w.useState(!1),a=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent);let s="";return w.useEffect(()=>{Array.isArray(e)&&e.length>0&&(s=e.reduce((c,u)=>c.updatedAt>u.updatedAt?c:u)._id)},[e]),i.jsxs(i.Fragment,{children:[i.jsx(yn,{anchor:"bottom",open:n,onClose:()=>{r(s),t(""),o(!1)},onOpen:()=>o(!0),disableBackdropTransition:!a,disableDiscovery:a,className:"porchlightBG",children:i.jsx(m,{item:!0,sx:{minHeight:"85vh"},children:n&&i.jsx(Xs,{setDrawerOpen:o})})}),i.jsx(ee,{btnwidth:"250",onClick:()=>o(!0),children:"Propose a New Concert"})]})};Ro.propTypes={jumpTo:P.func,closeEventEditDrawer:P.func,myHostEvents:P.array};const Va=t=>({myHostEvents:t.event.myHostEvents}),Ga=ve(Va,{jumpTo:lr,closeEventEditDrawer:cr})(Ro),Po=({jumpTo:t,myArtistEvents:e,closeEventEditDrawer:r,iConfirmed:n})=>{const[o,a]=w.useState(!1),s=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent);let c="";w.useEffect(()=>{Array.isArray(e)&&e.length>0&&(c=e.reduce((h,_)=>h.updatedAt>_.updatedAt?h:_)._id)},[e]);const[u,l]=w.useState(!1),f=new Date;return f.setDate(f.getDate()-2),w.useEffect(()=>{if(console.log("myArtistEvents updated"),e&&e.length>0){const h=new Date;h.setFullYear(h.getFullYear()-1),e.filter(_=>_.confirmedHost&&_.status==="CONFIRMED"&&n(_)&&new Date(_.bookingWhen)<f&&new Date(_.bookingWhen)>h&&(!_.artistReviewOfHost||!_.artistReviewOfHost._id)).length>0?l(!0):l(!1)}},[e]),i.jsxs(i.Fragment,{children:[i.jsx(yn,{anchor:"bottom",open:o,onClose:()=>{r(c),t(""),a(!1)},onOpen:()=>a(!0),disableBackdropTransition:!s,disableDiscovery:s,className:"porchlightBG",children:i.jsx(m,{item:!0,sx:{minHeight:"85vh"},children:o&&i.jsx(Co,{})})}),i.jsx(Ne,{arrow:!0,disableHoverListener:!u,disableFocusListener:!u,disableTouchListener:!u,title:"Please review all your past experiences first.",children:i.jsx("span",{children:i.jsx(ee,{disabled:u,btnwidth:"250",onClick:()=>a(!0),children:"Propose a New Concert"})})})]})};Po.propTypes={jumpTo:P.func,closeEventEditDrawer:P.func,myArtistEvents:P.array};const Ya=t=>({myArtistEvents:t.event.myArtistEvents}),Ka=ve(Ya,{jumpTo:lr,closeEventEditDrawer:cr})(Po),Xa=ht(i.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}));function Qa(t,e,r){const n=[];return t.forEach(o=>typeof o!="string"?n.push(o):e[Symbol.split](o).forEach((a,s,c)=>{a!==""&&n.push(a),s<c.length-1&&n.push(r)})),n}/** 2 * Takes a string with placeholder variables like `%{smart_count} file selected` 3 * and replaces it with values from options `{smart_count: 5}` 4 * 5 * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE 6 * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299 7 * 8 * @param phrase that needs interpolation, with placeholders 9 * @param options with values that will be used to replace placeholders 10 */function Mn(t,e){const r=/\$/g,n="$$$$";let o=[t];if(e==null)return o;for(const a of Object.keys(e))if(a!=="_"){let s=e[a];typeof s=="string"&&(s=r[Symbol.replace](s,n)),o=Qa(o,new RegExp(`%\\{${a}\\}`,"g"),s)}return o}const Za=t=>{throw new Error(`missing string: ${t}`)};class Io{locale;constructor(e,{onMissingKey:r=Za}={}){this.locale={strings:{},pluralize(n){return n===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=r}#e;#t(e){if(!e?.strings)return;const r=this.locale;Object.assign(this.locale,{strings:{...r.strings,...e.strings},pluralize:e.pluralize||r.pluralize})}translate(e,r){return this.translateArray(e,r).join("")}translateArray(e,r){let n=this.locale.strings[e];if(n==null&&(this.#e(e),n=e),typeof n=="object"){if(r&&typeof r.smart_count<"u"){const a=this.locale.pluralize(r.smart_count);return Mn(n[a],r)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}
10if(typeof n!="string")throw new Error("string was not a string");return Mn(n,r)}}class Ja{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,r){this.uppy=e,this.opts=r??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:r}=this.uppy.getState();this.uppy.setState({plugins:{...r,[this.id]:{...r[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new Io([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}function fr(t){return t<10?`0${t}`:t.toString()}function Xt(){const t=new Date,e=fr(t.getHours()),r=fr(t.getMinutes()),n=fr(t.getSeconds());return`${e}:${r}:${n}`}const el={debug:()=>{},warn:()=>{},error:(...t)=>console.error(`[Uppy] [${Xt()}]`,...t)},tl={debug:(...t)=>console.debug(`[Uppy] [${Xt()}]`,...t),warn:(...t)=>console.warn(`[Uppy] [${Xt()}]`,...t),error:(...t)=>console.error(`[Uppy] [${Xt()}]`,...t)};var dr,te,No,Ze,En,Do,Uo,Ho,vn,Er,Vr,Gr={},Lo=[],rl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Nt=Array.isArray;function Ee(t,e){for(var r in e)t[r]=e[r];return t}function _n(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Yr(t,e,r){var n,o,a,s={};for(a in e)a=="key"?n=e[a]:a=="ref"?o=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?dr.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)s[a]===void 0&&(s[a]=t.defaultProps[a]
vendor: 4,684 bytes, line 10
10);return _t(t,s,n,o,null)}function _t(t,e,r,n,o){var a={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++No,__i:-1,__u:0};return o==null&&te.vnode!=null&&te.vnode(a),a}function kt(t){return t.children}function Ve(t,e){this.props=t,this.context=e}function ut(t,e){if(e==null)return t.__?ut(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?ut(t):null}function $o(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return $o(t)}}function Vn(t){(!t.__d&&(t.__d=!0)&&Ze.push(t)&&!nr.__r++||En!=te.debounceRendering)&&((En=te.debounceRendering)||Do)(nr)}function nr(){for(var t,e,r,n,o,a,s,c=1;Ze.length;)Ze.length>c&&Ze.sort(Uo),t=Ze.shift(),c=Ze.length,t.__d&&(r=void 0,o=(n=(e=t).__v).__e,a=[],s=[],e.__P&&((r=Ee({},n)).__v=n.__v+1,te.vnode&&te.vnode(r),Wo(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[o]:null,a,o??ut(n),!!(32&n.__u),s),r.__v=n.__v,r.__.__k[r.__i]=r,ol(a,r,s),r.__e!=o&&$o(r)));nr.__r=0}function zo(t,e,r,n,o,a,s,c,u,l,f){var h,_,b,S,O,L,I=n&&n.__k||Lo,y=e.length;for(u=nl(r,e,I,u,y),h=0;h<y;h++)(b=r.__k[h])!=null&&(_=b.__i==-1?Gr:I[b.__i]||Gr,b.__i=h,L=Wo(t,b,_,o,a,s,c,u,l,f),S=b.__e,b.ref&&_.ref!=b.ref&&(_.ref&&wn(_.ref,null,b),f.push(b.ref,b.__c||S,b)),O==null&&S!=null&&(O=S),4&b.__u||_.__k===b.__k?u=Bo(b,u,t):typeof b.type=="function"&&L!==void 0?u=L:S&&(u=S.nextSibling),b.__u&=-7);return r.__e=O,u}function nl(t,e,r,n,o){var a,s,c,u,l,f=r.length,h=f,_=0;for(t.__k=new Array(o),a=0;a<o;a++)(s=e[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(u=a+_,(s=t.__k[a]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?_t(null,s,null,null,null):Nt(s)?_t(kt,{children:s},null,null,null):s.constructor==null&&s.__b>0?_t(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,c=null,(l=s.__i=il(s,r,u,h))!=-1&&(h--,(c=r[l])&&(c.__u|=2)),c==null||c.__v==null?(l==-1&&(o>f?_--:o<f&&_++),typeof s.type!="function"&&(s.__u|=4)):l!=u&&(l==u-1?_--:l==u+1?_++:(l>u?_--:_++,s.__u|=4))):t.__k[a]=null;if(h)for(a=0;a<f;a++)(c=r[a])!=null&&(2&c.__u)==0&&(c.__e==n&&(n=ut(c)),Mo(c,c));return n}function Bo(t,e,r){var n,o;if(typeof t.type=="function"){for(n=t.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=t,e=Bo(n[o],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=ut(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function We(t,e){return e=e||[],t==null||typeof t=="boolean"||(Nt(t)?t.some(function(r){We(r,e)}):e.push(t)),e}function il(t,e,r,n){var o,a,s,c=t.key,u=t.type,l=e[r],f=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||f&&c==l.key&&u==l.type)return r;if(n>(f?1:0)){for(o=r-1,a=r+1;o>=0||a<e.length;)if((l=e[s=o>=0?o--:a++])!=null&&(2&l.__u)==0&&c==l.key&&u==l.type)return s}return-1}function Gn(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||rl.test(e)?r:r+"px"}function $t(t,e,r,n,o){var a,s;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Gn(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||Gn(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")a=e!=(e=e.replace(Ho,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=r,r?n?r.u=n.u:(r.u=vn,t.addEventListener(e,a?Vr:Er,a)):t.removeEventListener(e,a?Vr:Er,a);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Yn(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=vn++;else if(e.t<r.u)return;return r(te.event?te.event(e):e)}}}function Wo(t,e,r,n,o,a,s,c,u,l){var f,h,_,b,S,O,L,I,y,v,k,T,U,H,M,B,re,K=e.type;if(e.constructor!=null)return null;128&r.__u&&(u=!!(32&r.__u),a=[c=e.__e=r.__e]),(f=te.__b)&&f(e);e:if(typeof K=="function")try{if(I=e.props,y="prototype"in K&&K.prototype.render,v=(f=K.contextType)&&n[f.__c],k=f?v?v.props.value:f.__:n,r.__c?L=(h=e.__c=r.__c).__=h.__E:(y?e.__c=h=new K(I,k):(e.__c=h=new Ve(I,k),h.constructor=K,h.render=al),v&&v.sub(h),h.props=I,h.state||(h.state={}),h.context=k,h.__n=n,_=h.__d=!0,h.__h=[],h._sb=[]),y&&h.__s==null&&(h.__s=h.state),y&&K.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Ee({}
vendor: 5,160 bytes, line 10
10,h.__s)),Ee(h.__s,K.getDerivedStateFromProps(I,h.__s))),b=h.props,S=h.state,h.__v=e,_)y&&K.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),y&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(y&&K.getDerivedStateFromProps==null&&I!==b&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(I,k),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(I,h.__s,k)===!1||e.__v==r.__v){for(e.__v!=r.__v&&(h.props=I,h.state=h.__s,h.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(ae){ae&&(ae.__=e)}),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[],h.__h.length&&s.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(I,h.__s,k),y&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(b,S,O)})}if(h.context=k,h.props=I,h.__P=t,h.__e=!1,U=te.__r,H=0,y){for(h.state=h.__s,h.__d=!1,U&&U(e),f=h.render(h.props,h.state,h.context),M=0;M<h._sb.length;M++)h.__h.push(h._sb[M]);h._sb=[]}else do h.__d=!1,U&&U(e),f=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++H<25);h.state=h.__s,h.getChildContext!=null&&(n=Ee(Ee({},n),h.getChildContext())),y&&!_&&h.getSnapshotBeforeUpdate!=null&&(O=h.getSnapshotBeforeUpdate(b,S)),B=f,f!=null&&f.type===kt&&f.key==null&&(B=qo(f.props.children)),c=zo(t,Nt(B)?B:[B],e,r,n,o,a,s,c,u,l),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),L&&(h.__E=h.__=null)}catch(ae){if(e.__v=null,u||a!=null)if(ae.then){for(e.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;a[a.indexOf(c)]=null,e.__e=c}else{for(re=a.length;re--;)_n(a[re]);Kr(e)}else e.__e=r.__e,e.__k=r.__k,ae.then||Kr(e);te.__e(ae,e,r)}else a==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):c=e.__e=sl(r.__e,e,r,n,o,a,s,u,l);return(f=te.diffed)&&f(e),128&e.__u?void 0:c}function Kr(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Kr)}function ol(t,e,r){for(var n=0;n<r.length;n++)wn(r[n],r[++n],r[++n]);te.__c&&te.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(a){a.call(o)})}catch(a){te.__e(a,o.__v)}})}function qo(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Nt(t)?t.map(qo):Ee({},t)}function sl(t,e,r,n,o,a,s,c,u){var l,f,h,_,b,S,O,L=r.props,I=e.props,y=e.type;if(y=="svg"?o="http://www.w3.org/2000/svg":y=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(l=0;l<a.length;l++)if((b=a[l])&&"setAttribute"in b==!!y&&(y?b.localName==y:b.nodeType==3)){t=b,a[l]=null;break}}if(t==null){if(y==null)return document.createTextNode(I);t=document.createElementNS(o,y,I.is&&I),c&&(te.__m&&te.__m(e,a),c=!1),a=null}if(y==null)L===I||c&&t.data==I||(t.data=I);else{if(a=a&&dr.call(t.childNodes),L=r.props||Gr,!c&&a!=null)for(L={},l=0;l<t.attributes.length;l++)L[(b=t.attributes[l]).name]=b.value;for(l in L)if(b=L[l],l!="children"){if(l=="dangerouslySetInnerHTML")h=b;else if(!(l in I)){if(l=="value"&&"defaultValue"in I||l=="checked"&&"defaultChecked"in I)continue;$t(t,l,null,b,o)}}for(l in I)b=I[l],l=="children"?_=b:l=="dangerouslySetInnerHTML"?f=b:l=="value"?S=b:l=="checked"?O=b:c&&typeof b!="function"||L[l]===b||$t(t,l,b,L[l],o);if(f)c||h&&(f.__html==h.__html||f.__html==t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(h&&(t.innerHTML=""),zo(e.type=="template"?t.content:t,Nt(_)?_:[_],e,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:r.__k&&ut(r,0),c,u),a!=null)for(l=a.length;l--;)_n(a[l]);c||(l="value",y=="progress"&&S==null?t.removeAttribute("value"):S!=null&&(S!==t[l]||y=="progress"&&!S||y=="option"&&S!=L[l])&&$t(t,l,S,L[l],o),l="checked",O!=null&&O!=t[l]&&$t(t,l,O,L[l],o))}return t}function wn(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(o){te.__e(o,r)}}function Mo(t,e,r){var n,o;if(te.unmount&&te.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||wn(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(a){te.__e(a,e)}n.base=n.__P=null}if(n=t.__k)for(o=0;o<n.length;o++)n[o]&&Mo(n[o],e,r||typeof t.type!="function");r||_n(t.__e),t.__c=t.__=t.__e=void 0}function al(t,e,r){return this.constructor(t,r)}function ll(t,e,r){var n,o,a,s,c=Ee({},t.props);for(a in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)a=="key"?n=e[a]:a=="ref"?o=e[a]:c[a]=e[a]===void 0&&s!=null?s[a]:e[a];return arguments.length>2&&(c.children=arguments.length>3?dr.call(arguments,2):r),_t(t.type,c,n||t.key,o||t.ref,null)}dr=Lo.slice,te={__e:function(t,e,r,n){for(var o,a,s;e=e.__;)if((o=e.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(t)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,n||{}),s=o.__d),s)return o.__E=o}catch(c){t=c}throw t}},No=0,Ve.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ee({},this.state),typeof t=="function"&&(t=t(Ee({},r),this.props)),t&&Ee(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Vn(this))},Ve.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Vn(this))},Ve.prototype.render=kt,Ze=[],Do=typeof Promise=="function"?Promise.prototype.then.bind(Prom
vendor: 2,058 bytes, line 10
10ise.resolve()):setTimeout,Uo=function(t,e){return t.__v.__b-e.__v.__b},nr.__r=0,Ho=/(PointerCapture)$|Capture$/i,vn=0,Er=Yn(!1),Vr=Yn(!0);var qe,pr,Kn,Eo=[],Se=te,Xn=Se.__b,Qn=Se.__r,Zn=Se.diffed,Jn=Se.__c,ei=Se.unmount,ti=Se.__;function cl(){for(var t;t=Eo.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Qt),t.__H.__h.forEach(Xr),t.__H.__h=[]}catch(e){t.__H.__h=[],Se.__e(e,t.__v)}}Se.__b=function(t){qe=null,Xn&&Xn(t)},Se.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ti&&ti(t,e)},Se.__r=function(t){Qn&&Qn(t);var e=(qe=t.__c).__H;e&&(pr===qe?(e.__h=[],qe.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.forEach(Qt),e.__h.forEach(Xr),e.__h=[])),pr=qe},Se.diffed=function(t){Zn&&Zn(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Eo.push(e)!==1&&Kn===Se.requestAnimationFrame||((Kn=Se.requestAnimationFrame)||ul)(cl)),e.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),pr=qe=null},Se.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Qt),r.__h=r.__h.filter(function(n){return!n.__||Xr(n)})}catch(n){e.some(function(o){o.__h&&(o.__h=[])}),e=[],Se.__e(n,r.__v)}}),Jn&&Jn(t,e)},Se.unmount=function(t){ei&&ei(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Qt(n)}catch(o){e=o}}),r.__H=void 0,e&&Se.__e(e,r.__v))};var ri=typeof requestAnimationFrame=="function";function ul(t){var e,r=function(){clearTimeout(n),ri&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);ri&&(e=requestAnimationFrame(r))}function Qt(t){var e=qe,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),qe=e}function Xr(t){var e=qe;t.__c=t.__(),qe=e}function dl(t,e){for(var r in e)t[r]=e[r];return t}function ni(t,e){for(var r in t)if(r!=="__source"&&!(r in e))return!0;for(var n in e)if(n!=="__source"&&t[n]!==e[n])return!0;return!1}function ii(t,e){this.props=t,this.context=e}(ii.prototype=new Ve).isPureReactComponent=!0,ii.prototype.shouldComponentUpdate=function(t,e){return ni(this.props,t)||ni(this.state,e)};var oi=te.__b;te.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),oi&&oi(t)};
vendor: 3,073 bytes, line 10
10var hl=te.__e;te.__e=function(t,e,r,n){if(t.then){for(var o,a=e;a=a.__;)if((o=a.__c)&&o.__c)return e.__e==null&&(e.__e=r.__e,e.__k=r.__k),o.__c(t,e)}hl(t,e,r,n)};var si=te.unmount;function Vo(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),t.__c.__H=null),(t=dl({},t)).__c!=null&&(t.__c.__P===r&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(n){return Vo(n,e,r)})),t}function Go(t,e,r){return t&&r&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(n){return Go(n,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=r)),t}function mr(){this.__u=0,this.o=null,this.__b=null}function Yo(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function zt(){this.i=null,this.l=null}te.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),si&&si(t)},(mr.prototype=new Ve).__c=function(t,e){var r=e.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=Yo(n.__v),a=!1,s=function(){a||(a=!0,r.__R=null,o?o(c):c())};r.__R=s;var c=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Go(u,u.__c.__P,u.__c.__O)}var l;for(n.setState({__a:n.__b=null});l=n.o.pop();)l.forceUpdate()}};n.__u++||32&e.__u||n.setState({__a:n.__b=n.__v.__k[0]}),t.then(s,s)},mr.prototype.componentWillUnmount=function(){this.o=[]},mr.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Vo(this.__b,r,n.__O=n.__P)}this.__b=null}var o=e.__a&&Yr(kt,null,t.fallback);return o&&(o.__u&=-33),[Yr(kt,null,e.__a?null:t.children),o]};var ai=function(t,e,r){if(++r[1]===r[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(r=t.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;t.i=r=r[2]}};(zt.prototype=new Ve).__a=function(t){var e=this,r=Yo(e.__v),n=e.l.get(t);return n[0]++,function(o){var a=function(){e.props.revealOrder?(n.push(o),ai(e,t,n)):o()};r?r(a):a()}},zt.prototype.render=function(t){this.i=null,this.l=new Map;var e=We(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var r=e.length;r--;)this.l.set(e[r],this.i=[1,0,this.i]);return t.children},zt.prototype.componentDidUpdate=zt.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,r){ai(t,r,e)})};var fl=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,pl=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ml=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,gl=/[A-Z0-9]/g,xl=typeof document<"u",yl=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};Ve.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Ve.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]}
10,set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var li=te.event;function bl(){}function vl(){return this.cancelBubble}function _l(){return this.defaultPrevented}te.event=function(t){return li&&(t=li(t)),t.persist=bl,t.isPropagationStopped=vl,t.isDefaultPrevented=_l,t.nativeEvent=t};var wl={enumerable:!1,configurable:!0,get:function(){return this.class}},ci=te.vnode;te.vnode=function(t){typeof t.type=="string"&&function(e){var r=e.props,n=e.type,o={},a=n.indexOf("-")===-1;for(var s in r){var c=r[s];if(!(s==="value"&&"defaultValue"in r&&c==null||xl&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var u=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&c===!0?c="":u==="translate"&&c==="no"?c=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?s="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||yl(r.type)?u==="onfocus"?s="onfocusin":u==="onblur"?s="onfocusout":ml.test(s)&&(s=u):u=s="oninput":a&&pl.test(s)?s=s.replace(gl,"-$&").toLowerCase():c===null&&(c=void 0),u==="oninput"&&o[s=u]&&(s="oninputCapture"),o[s]=c}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=We(r.children).forEach(function(l){l.props.selected=o.value.indexOf(l.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=We(r.children).forEach(function(l){l.props.selected=o.multiple?o.defaultValue.indexOf(l.props.value)!=-1:o.defaultValue==l.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",wl)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),e.props=o}(t),t.$$typeof=fl,ci&&ci(t)};var ui=te.__r;te.__r=function(t){ui&&ui(t),t.__c};var di=te.diffed;te.diffed=function(t){di&&di(t);var e=t.props,r=t.__e;r!=null&&t.type==="textarea"&&"value"in e&&e.value!==r.value&&(r.value=e.value==null?"":e.value)};const jl="4.3.2",Sl={version:jl};class kl{static VERSION=Sl.version;state={};#e=new Set;getState(){return this.state}setState(e){const r={...this.state},n={...this.state,...e};this.state=n,this.#t(r,n,e)}subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(...e){this.#e.forEach(r=>{r(...e)})}}function Ko(t){const e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}const hi={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Xo(t){if(t.type)return t.type;const e=t.name?Ko(t.name).extension?.toLowerCase():null;return e&&e in hi?hi[e]:"application/octet-stream"}function Tl(t){return t.charCodeAt(0).toString(32)}function fi(t){let e="";return t.replace(/[^A-Z0-9]/gi,r=>(e+=`-${Tl(r)}`,"/"))+e}function Cl(t,e){let r=e||"uppy";return typeof t.name=="string"&&(r+=`-${fi(t.name.toLowerCase())}`),t.type!==void 0&&(r+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(r+=`-${fi(t.meta.relativePath.toLowerCase())}`),t.data.size!==void 0&&(r+=`-${t.data.size}`),t.data.lastModified!==void 0&&(r+=`-${t.data.lastModified}`),r}function Al(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function Fl(t,e){if(Al(t))return t.id;const r=Xo(t);return Cl({...t,type:r},e)}var gr,pi;function jn(){if(pi)return gr;pi=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return gr=t,gr}var xr,mi;function Ol(){if(mi)return xr;mi=1;var t=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;return xr=t,xr}var yr,gi;function Qo(){if(gi)return yr;gi=1;var t=Ol(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return yr=r,yr}var br,xi;function Rl(){if(xi)return br;xi=1;var t=Qo(),e=function(){return t.Date.now()};return br=e,br}var vr,yi;function Pl(){if(yi)return vr;yi=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return vr=e,vr}var _r,bi;function Il(){if(bi)return _r;bi=1;var t=Pl(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return _r=r,_r}var wr,vi;function Zo(){if(vi)return wr;vi=1;var t=Qo(),e=t.Symbol;return wr=e,wr}var jr,_i;function Nl(){if(_i)return jr;_i=1;var t=Zo(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,o=t?t.toStringTag:void 0;function a(s){var c=r.call(s,o),u=s[o];try{s[o]=void 0;var l=!0}catch{}var f=n.call(s);return l&&(c?s[o]=u:delete s[o]),f}return jr=a,jr}var Sr,wi;function Dl(){if(wi)return Sr;wi=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Sr=r,Sr}var kr,ji;function Ul(){if(ji)return kr;ji=1;
10var t=Zo(),e=Nl(),r=Dl(),n="[object Null]",o="[object Undefined]",a=t?t.toStringTag:void 0;function s(c){return c==null?c===void 0?o:n:a&&a in Object(c)?e(c):r(c)}return kr=s,kr}var Tr,Si;function Hl(){if(Si)return Tr;Si=1;function t(e){return e!=null&&typeof e=="object"}return Tr=t,Tr}var Cr,ki;function Ll(){if(ki)return Cr;ki=1;var t=Ul(),e=Hl(),r="[object Symbol]";function n(o){return typeof o=="symbol"||e(o)&&t(o)==r}return Cr=n,Cr}var Ar,Ti;function $l(){if(Ti)return Ar;Ti=1;var t=Il(),e=jn(),r=Ll(),n=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;function u(l){if(typeof l=="number")return l;if(r(l))return n;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=t(l);var h=a.test(l);return h||s.test(l)?c(l.slice(2),h?2:8):o.test(l)?n:+l}return Ar=u,Ar}var Fr,Ci;function Jo(){if(Ci)return Fr;Ci=1;var t=jn(),e=Rl(),r=$l(),n="Expected a function",o=Math.max,a=Math.min;function s(c,u,l){var f,h,_,b,S,O,L=0,I=!1,y=!1,v=!0;if(typeof c!="function")throw new TypeError(n);u=r(u)||0,t(l)&&(I=!!l.leading,y="maxWait"in l,_=y?o(r(l.maxWait)||0,u):_,v="trailing"in l?!!l.trailing:v);function k(R){var oe=f,pe=h;return f=h=void 0,L=R,b=c.apply(pe,oe),b}function T(R){return L=R,S=setTimeout(M,u),I?k(R):b}function U(R){var oe=R-O,pe=R-L,x=u-oe;return y?a(x,_-pe):x}function H(R){var oe=R-O,pe=R-L;return O===void 0||oe>=u||oe<0||y&&pe>=_}function M(){var R=e();if(H(R))return B(R);S=setTimeout(M,U(R))}function B(R){return S=void 0,v&&f?k(R):(f=h=void 0,b)}function re(){S!==void 0&&clearTimeout(S),L=0,f=O=h=S=void 0}function K(){return S===void 0?b:B(e())}function ae(){var R=e(),oe=H(R);if(f=arguments,h=this,O=R,oe){if(S===void 0)return T(O);if(y)return clearTimeout(S),S=setTimeout(M,u),k(O)}return S===void 0&&(S=setTimeout(M,u)),b}return ae.cancel=re,ae.flush=K,ae}return Fr=s,Fr}var Or,Ai;function zl(){if(Ai)return Or;Ai=1;var t=Jo(),e=jn(),r="Expected a function";function n(o,a,s){var c=!0,u=!0;if(typeof o!="function")throw new TypeError(r);return e(s)&&(c="leading"in s?!!s.leading:c,u="trailing"in s?!!s.trailing:u),t(o,a,{leading:c,maxWait:a,trailing:u})}return Or=n,Or}var Bl=zl();const Wl=It(Bl);var Rr,Fi;function ql(){return Fi||(Fi=1,Rr=function(){var e={},r=e._fns={};e.emit=function(s,c,u,l,f,h,_){var b=n(s);b.length&&o(s,b,[c,u,l,f,h,_])},e.on=function(s,c){r[s]||(r[s]=[]),r[s].push(c)},e.once=function(s,c){function u(){c.apply(this,arguments),e.off(s,u)}this.on(s,u)},e.off=function(s,c){var u=[];if(s&&c){var l=this._fns[s],f=0,h=l?l.length:0;for(f;f<h;f++)l[f]!==c&&u.push(l[f])}u.length?this._fns[s]=u:delete this._fns[s]};function n(a){var s=r[a]?r[a]:[],c=a.indexOf(":"),u=c===-1?[a]:[a.substring(0,c),a.substring(c+1)],l=Object.keys(r),f=0,h=l.length;for(f;f<h;f++){var _=l[f];if(_==="*"&&(s=s.concat(r[_])),u.length===2&&u[0]===_){s=s.concat(r[_]);break}}return s}function o(a,s,c){var u=0,l=s.length;for(u;u<l&&s[u];u++)s[u].event=a,s[u].apply(s[u],c)}return e}),Rr}var Ml=ql();const El=It(Ml);let Vl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Gl=(t=21)=>{let e="",r=t|0;for(;r--;)e+=Vl[Math.random()*64|0];return e};const Yl="4.5.2",Kl={version:Yl};function Xl(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}const Ql={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};var Pr,Oi;function Zl(){return Oi||(Oi=1,Pr=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const r=e<0;let n=Math.abs(e);if(r&&(n=-n),n===0)return"0 B";const o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],a=Math.min(Math.floor(Math.log(n)/Math.log(1024)),o.length-1),s=Number(n/1024**a),c=o[a];return`${s>=10||s%1===0?Math.round(s):s.toFixed(1)} ${c}`}),Pr}var Jl=Zl();const Bt=It(Jl);var Ir,Ri;function ec(){if(Ri)return Ir;Ri=1;function t(e,r){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=r,this.parts=e.split(r)}return t.prototype.match=function(e){var r=!0,n=this.parts,o,a=n.length,s;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)r=!1;else{for(s=(e||"").split(this.separator),o=0;r&&o<a;o++)n[o]!=="*"&&(o<s.length?r=n[o]===s[o]:r=!1);r=r&&s}
10else if(typeof e.splice=="function")for(r=[],o=e.length;o--;)this.match(e[o])&&(r[r.length]=e[o]);else if(typeof e=="object"){r={};for(var c in e)this.match(c)&&(r[c]=e[c])}return r},Ir=function(e,r,n){var o=new t(e,n||/[\/\.]/);return typeof r<"u"?o.match(r):o},Ir}var Nr,Pi;function tc(){if(Pi)return Nr;Pi=1;var t=ec(),e=/[\/\+\.]/;return Nr=function(r,n){function o(a){var s=t(a,r,e);return s&&s.length>=2}return n?o(n.split(";")[0]):o},Nr}var rc=tc();const nc=It(rc),ic={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class De extends Error{isUserFacing;file;constructor(e,r){super(e),this.isUserFacing=r?.isUserFacing??!0,r?.file&&(this.file=r.file)}isRestriction=!0}class oc{getI18n;getOpts;constructor(e,r){this.getI18n=r,this.getOpts=()=>{const n=e();if(n.restrictions?.allowedFileTypes!=null&&!Array.isArray(n.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return n}}validateAggregateRestrictions(e,r){const{maxTotalFileSize:n,maxNumberOfFiles:o}=this.getOpts().restrictions;if(o&&e.filter(s=>!s.isGhost).length+r.length>o)throw new De(`${this.getI18n()("youCanOnlyUploadX",{smart_count:o})}`);if(n){const a=[...e,...r].reduce((s,c)=>s+(c.size??0),0);if(a>n)throw new De(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Bt(n),size:Bt(a)}))}}validateSingleFile(e){const{maxFileSize:r,minFileSize:n,allowedFileTypes:o}=this.getOpts().restrictions;if(o&&!o.some(s=>s.includes("/")?e.type?nc(e.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&e.extension?e.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){const s=o.join(", ");throw new De(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:e})}if(r&&e.size!=null&&e.size>r)throw new De(this.getI18n()("exceedsSize",{size:Bt(r),file:e.name??this.getI18n()("unnamed")}),{file:e});if(n&&e.size!=null&&e.size<n)throw new De(this.getI18n()("inferiorSize",{size:Bt(n)}),{file:e})}validate(e,r){r.forEach(n=>{this.validateSingleFile(n)}),this.validateAggregateRestrictions(e,r)}validateMinNumberOfFiles(e){const{minNumberOfFiles:r}=this.getOpts().restrictions;if(r&&Object.keys(e).length<r)throw new De(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:r}))}getMissingRequiredMetaFields(e){const r=new De(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:n}=this.getOpts().restrictions,o=[];for(const a of n)(!Object.hasOwn(e.meta,a)||e.meta[a]==="")&&o.push(a);return{missingFields:o,error:r}}}function sc(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;const e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;const n=e[1].split(".",2),o=parseInt(n[0],10),a=parseInt(n[1],10);return o<15||o===15&&a<15063||o>18||o===18&&a>=18218}const Wt={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class Sn{static VERSION=Kl.version;#e=Object.create(null);#t;#n;#i=El();#r=new Set;#a=new Set;#o=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=Ql;const r={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:ic,meta:{},onBeforeFileAdded:(o,a)=>!Object.hasOwn(a,o.id),onBeforeUpload:o=>o,store:new kl,logger:el,infoTimeout:5e3},n={...r,...e};this.opts={...n,restrictions:{...r.restrictions,...e?.restrictions}},e?.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e?.debug&&(this.opts.logger=tl),this.log(`Using Core v${Sn.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Wt,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:sc(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#t=new oc(()=>this.opts,()=>this.i18n),this.#n=this.store.subscribe((o,a,s)=>{this.emit("state-update",o,a,s),this.updateAll(a)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),this.#k()}emit(e,...r){this.#i.emit(e,...r)}on(e,r){return this.#i.on(e,r),this}once(e,r){return this.#i.once(e,r),this}off(e,r){return this.#i.off(e,r),this}updateAll(e){this.iteratePlugins(r=>{r.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const r=this.getState().files;this.setState({files:{...r,...Object.fromEntries(Object.entries(e).map(([n,o])=>[n,{...r[n],...o}]))}})}setFileState(e,r){if(!this.getState().files[e])throw new Error(`Canât set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:r})}i18nInit(){const e=n=>this.log(`Missing i18n string: ${n}`,"error"),r=new Io([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=r.translate.bind(r),this.i18nArray=r.translateArray.bind(r),this.locale=r.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(r=>{r.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null}
10,r={...this.getState().files},n=Object.create(null);Object.keys(r).forEach(o=>{n[o]={...r[o],progress:{...r[o].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:n,...Wt})}clear(){const{capabilities:e,currentUploads:r}=this.getState();if(Object.keys(r).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Wt,files:{}})}addPreProcessor(e){this.#r.add(e)}removePreProcessor(e){return this.#r.delete(e)}addPostProcessor(e){this.#o.add(e)}removePostProcessor(e){return this.#o.delete(e)}addUploader(e){this.#a.add(e)}removeUploader(e){return this.#a.delete(e)}setMeta(e){const r={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach(o=>{n[o]={...n[o],meta:{...n[o].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:r,files:n})}setFileMeta(e,r){const n={...this.getState().files};if(!n[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const o={...n[e].meta,...r};n[e]={...n[e],meta:o},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(r=>this.getFile(r))}getObjectOfFilesPerState(){const{files:e,totalProgress:r,error:n}=this.getState(),o=Object.values(e),a=[],s=[],c=[],u=[],l=[],f=[],h=[],_=[],b=[];for(const S of o){const{progress:O}=S;!O.uploadComplete&&O.uploadStarted&&(a.push(S),S.isPaused||_.push(S)),O.uploadStarted||s.push(S),(O.uploadStarted||O.preprocess||O.postprocess)&&c.push(S),O.uploadStarted&&u.push(S),S.isPaused&&l.push(S),O.uploadComplete&&f.push(S),S.error&&h.push(S),(O.preprocess||O.postprocess)&&b.push(S)}return{newFiles:s,startedFiles:c,uploadStartedFiles:u,pausedFiles:l,completeFiles:f,erroredFiles:h,inProgressFiles:a,inProgressNotPausedFiles:_,processingFiles:b,isUploadStarted:u.length>0,isAllComplete:r===100&&f.length===o.length&&b.length===0,isAllErrored:!!n&&h.length===o.length,isAllPaused:a.length!==0&&l.length===a.length,isUploadInProgress:a.length>0,isSomeGhost:o.some(S=>S.isGhost)}}#s(e){for(const s of e)s.isRestriction?this.emit("restriction-failed",s.file,s):this.emit("error",s,s.file),this.log(s,"warning");const r=e.filter(s=>
10s.isUserFacing),n=4,o=r.slice(0,n),a=r.slice(n);o.forEach(({message:s,details:c=""})=>{this.info({message:s,details:c},"error",this.opts.infoTimeout)}),a.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:a.length})})}validateRestrictions(e,r=this.getFiles()){try{this.#t.validate(r,[e])}catch(n){return n}return null}validateSingleFile(e){try{this.#t.validateSingleFile(e)}catch(r){return r.message}return null}validateAggregateRestrictions(e){const r=this.getFiles();try{this.#t.validateAggregateRestrictions(r,e)}catch(n){return n.message}return null}#l(e){const{missingFields:r,error:n}=this.#t.getMissingRequiredMetaFields(e);return r.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:r}),this.log(n.message),this.emit("restriction-failed",e,n),!1):(r.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#g(e){let r=!0;for(const n of Object.values(e))this.#l(n)||(r=!1);return r}#d(e){const{allowNewUpload:r}=this.getState();if(r===!1){const n=new De(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#s([n]),n}}checkIfFileAlreadyExists(e){const{files:r}=this.getState();return!!(r[e]&&!r[e].isGhost)}#x(e){const r=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e}:e,n=Xo(r),o=Xl(n,r),a=Ko(o).extension,s=Fl(r,this.getID()),c=r.meta||{};c.name=o,c.type=n;const u=Number.isFinite(r.data.size)?r.data.size:null;return{source:r.source||"",id:s,name:o,extension:a||"",meta:{...this.getState().meta,...c},type:n,data:r.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:u,uploadComplete:!1,uploadStarted:null},size:u,isGhost:!1,isRemote:r.isRemote||!1,remote:r.remote,preview:r.preview}}#h(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}#c(e){let{files:r}=this.getState(),n={...r};const o=[],a=[];for(const s of e)try{let c=this.#x(s);const u=r[c.id]?.isGhost;u&&(c={...r[c.id],isGhost:!1,data:s.data},this.log(`Replaced the blob in the restored ghost file: ${c.name}, ${c.id}`));const l=this.opts.onBeforeFileAdded(c,n);if(r=this.getState().files,n={...r,...n},!l&&this.checkIfFileAlreadyExists(c.id))throw new De(this.i18n("noDuplicates",{fileName:c.name??this.i18n("unnamed")}),{file:s});if(l===!1&&!u)throw new De("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:s});typeof l=="object"&&l!==null&&(c=l),this.#t.validateSingleFile(c),n[c.id]=c,o.push(c)}catch(c){a.push(c)}try{this.#t.validateAggregateRestrictions(Object.values(r),o)}catch(s){return a.push(s),{nextFilesState:r,validFilesToAdd:[],errors:a}}return{nextFilesState:n,validFilesToAdd:o,errors:a}}addFile(e){this.#d(e);const{nextFilesState:r,validFilesToAdd:n,errors:o}=this.#c([e]),a=o.filter(c=>c.isRestriction);if(this.#s(a),o.length>0)throw o[0];this.setState({files:r});const[s]=n;return this.emit("file-added",s),this.emit("files-added",n),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),this.#h(),s.id}addFiles(e){this.#d();const{nextFilesState:r,validFilesToAdd:n,errors:o}=this.#c(e),a=o.filter(c=>c.isRestriction);this.#s(a);const s=o.filter(c=>!c.isRestriction);if(s.length>0){let c=`Multiple errors occurred while adding files: 11`;if(s.forEach(u=>{c+=` 12 * ${u.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:s.length}),details:c},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(s,c);{const u=new Error(c);throw u.errors=s,u}}this.setState({files:r}
12),n.forEach(c=>{this.emit("file-added",c)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.values(n).forEach(c=>{this.log(`Added file: ${c.name} 13 id: ${c.id} 14 type: ${c.type}`)}),n.length>0&&this.#h()}removeFiles(e){const{files:r,currentUploads:n}=this.getState(),o={...r},a={...n},s=Object.create(null);e.forEach(f=>{r[f]&&(s[f]=r[f],delete o[f])});function c(f){return s[f]===void 0}Object.keys(a).forEach(f=>{const h=n[f].fileIDs.filter(c);if(h.length===0){delete a[f];return}const{capabilities:_}=this.getState();if(h.length!==n[f].fileIDs.length&&!_.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");a[f]={...n[f],fileIDs:h}});const u={currentUploads:a,files:o};Object.keys(o).length===0&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.#f();const l=Object.keys(s);l.forEach(f=>{this.emit("file-removed",s[f])}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const r=this.getFile(e),o=!(r.isPaused||!1);return this.setFileState(e,{isPaused:o}),this.emit("upload-pause",r,o),o}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{const o={...e[n],isPaused:!0};e[n]=o}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{const o={...e[n],isPaused:!1,error:null};e[n]=o}),this.setState({files:e}),this.emit("resume-all")}#b(){const{files:e}=this.getState();return Object.keys(e).filter(r=>e[r].error)}async#v(){const e=this.#b(),r={...this.getState().files};if(e.forEach(o=>{r[o]={...r[o],isPaused:!1,error:null}}),this.setState({files:r,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const n=this.#p(e,{forceAllowNewUpload:!0});return this.#m(n)}async retryAll(){const e=await this.#v();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),r=Object.keys(e);r.length&&this.removeFiles(r),this.setState(Wt)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const r=this.#p([e],{forceAllowNewUpload:!0});return this.#m(r)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#j=(e,r)=>{const n=e?this.getFile(e.id):void 0;if(e==null||!n){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}if(n.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}const o={bytesTotal:r.bytesTotal,percentage:r.bytesTotal!=null&&Number.isFinite(r.bytesTotal)&&r.bytesTotal>0?Math.round(r.bytesUploaded/r.bytesTotal*100):void 0};n.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...n.progress,...o,bytesUploaded:r.bytesUploaded}}):this.setFileState(e.id,{progress:{...n.progress,...o}}),this.#f()};#_(){const e=this.#S();let r=null;e!=null&&(r=Math.round(e*100),r>100?r=100:r<0&&(r=0)),this.emit("progress",r??0),this.setState({totalProgress:r??0})}#f=Wl(()=>this.#_(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#_()}#S(){const r=this.getFiles().filter(u=>u.progress.uploadStarted||u.progress.preprocess||u.progress.postprocess);if(r.length===0)return 0;if(r.every(u=>u.progress.uploadComplete))return 1;const n=u=>u.progress.bytesTotal!=null&&u.progress.bytesTotal!==0,o=r.filter(n),a=r.filter(u=>!n(u));if(o.every(u=>u.progress.uploadComplete)&&a.length>0&&!a.every(u=>u.progress.uploadComplete))return null;const s=o.reduce((u,l)=>u+(l.progress.bytesTotal??0),0),c=o.reduce((u,l)=>u+(l.progress.bytesUploaded||0),0);return s===0?0:c/s}#k(){const e=(o,a,s)=>{let c=o.message||"Unknown error";o.details&&(c+=` ${o.details}`),this.setState({error:c}
14),a!=null&&a.id in this.getState().files&&this.setFileState(a.id,{error:c,response:s})};this.on("error",e),this.on("upload-error",(o,a,s)=>{if(e(a,o,s),typeof a=="object"&&a.message){this.log(a.message,"error");const c=new Error(this.i18n("failedToUpload",{file:o?.name??""}));c.isUserFacing=!0,c.details=a.message,a.details&&(c.details+=` ${a.details}`),this.#s([c])}else this.#s([a])});let r=null;this.on("upload-stalled",(o,a)=>{const{message:s}=o,c=a.map(u=>u.meta.name).join(", ");r||(this.info({message:s,details:c},"warning",this.opts.infoTimeout),r=setTimeout(()=>{r=null},this.opts.infoTimeout)),this.log(`${s} ${c}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const n=o=>{const a=o.filter(c=>{const u=c!=null&&this.getFile(c.id);return u||this.log(`Not setting progress for a file that has been removed: ${c?.id}`),u}),s=Object.fromEntries(a.map(c=>[c.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:c.size}}]));this.patchFilesState(s)};this.on("upload-start",n),this.on("upload-progress",this.#j),this.on("upload-success",(o,a)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const s=this.getFile(o.id).progress;this.setFileState(o.id,{progress:{...s,postprocess:this.#o.size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:s.bytesTotal},response:a,uploadURL:a.uploadURL,isPaused:!1}),o.size==null&&this.setFileState(o.id,{size:a.bytesUploaded||s.bytesTotal}),this.#f()}),this.on("preprocess-progress",(o,a)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}this.setFileState(o.id,{progress:{...this.getFile(o.id).progress,preprocess:a}})}),this.on("preprocess-complete",o=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const a={...this.getState().files};a[o.id]={...a[o.id],progress:{...a[o.id].progress}},delete a[o.id].progress.preprocess,this.setState({files:a})}),this.on("postprocess-progress",(o,a)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}this.setFileState(o.id,{progress:{...this.getState().files[o.id].progress,postprocess:a}})}),this.on("postprocess-complete",o=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const a={...this.getState().files};a[o.id]={...a[o.id],progress:{...a[o.id].progress}},delete a[o.id].progress.postprocess,this.setState({files:a})}),this.on("restored",()=>{this.#f()}),this.on("dashboard:file-edit-complete",o=>{o&&this.#l(o)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",this.#u),window.addEventListener("offline",this.#u),setTimeout(this.#u,3e3))}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit
14("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}#u=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...r){if(typeof e!="function"){const s=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(s)}const n=new e(this,...r),o=n.id;if(!o)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const a=this.getPlugin(o);if(a){const s=`Already found a plugin named '${a.id}'. Tried to use: '${o}'. 15Uppy plugins must have unique \`id\` options.`;throw new Error(s)}return e.VERSION&&this.log(`Using ${o} v${e.VERSION}`),n.type in this.#e?this.#e[n.type].push(n):this.#e[n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(const r of Object.values(this.#e)){const n=r.find(o=>o.id===e);if(n!=null)return n}}[Symbol.for("uppy test: getPlugins")](e){return this.#e[e]}iteratePlugins(e){Object.values(this.#e).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const r=this.#e[e.type],n=r.findIndex(s=>s.id===e.id);n!==-1&&r.splice(n,1);const a={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(a)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",this.#u),window.removeEventListener("offline",this.#u))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,r="info",n=3e3){const o=typeof e=="object";this.setState({info:[...this.getState().info,{type:r,message:o?e.message:e,details:o?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,r){const{logger:n}=this.opts;switch(r){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e);break}}#w=new Map;registerRequestClient(e,r){this.#w.set(e,r)}
15getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const r=this.#w.get(e.remote.requestClientId);if(r==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return r}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?this.#m(e):(this.#y(e),Promise.reject(new Error("Nonexistent upload")))}#p(e,r={}){const{forceAllowNewUpload:n=!1}=r,{allowNewUpload:o,currentUploads:a}=this.getState();if(!o&&!n)throw new Error("Cannot create a new upload: already uploading.");const s=Gl();return this.emit("upload",s,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...a,[s]:{fileIDs:e,step:0,result:{}}}}),s}[Symbol.for("uppy test: createUpload")](...e){return this.#p(...e)}#T(e){const{currentUploads:r}=this.getState();return r[e]}addResultData(e,r){if(!this.#T(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:n}=this.getState(),o={...n[e],result:{...n[e].result,...r}};this.setState({currentUploads:{...n,[e]:o}})}#y(e){const r={...this.getState().currentUploads};delete r[e],this.setState({currentUploads:r})}async#m(e){const r=()=>{const{currentUploads:s}=this.getState();return s[e]};let n=r();const o=[...this.#r,...this.#a,...this.#o];try{for(let s=n.step||0;s<o.length&&n;s++){const c=o[s];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...n,step:s}}});const{fileIDs:u}=n;await c(u,e),n=r()}}catch(s){throw this.#y(e),s}if(n){n.fileIDs.forEach(l=>{const f=this.getFile(l);f?.progress.postprocess&&this.emit("postprocess-complete",f)});const s=n.fileIDs.map(l=>this.getFile(l)),c=s.filter(l=>!l.error),u=s.filter(l=>l.error);this.addResultData(e,{successful:c,failed:u,uploadID:e}),n=r()}let a;return n&&(a=n.result,this.#y(e)),a==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),a={successful:[],failed:[],uploadID:e}),a}async upload(){this.#e.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#b().length>0){const o=await this.#v();if(!(this.getFiles().filter(s=>s.progress.uploadStarted==null).length>0))return this.emit("complete",o),o;({files:e}=this.getState())}const n=this.opts.onBeforeUpload(e);return n===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&typeof n=="object"&&(e=n,this.setState({files:e})),Promise.resolve().then(()=>this.#t.validateMinNumberOfFiles(e)).catch(o=>{throw this.#s([o]),o}).then(()=>{if(!this.#g(e))throw new De(this.i18n("missingRequiredMetaField"))}).catch(o=>{throw o}).then(async()=>{const{currentUploads:o}=this.getState(),a=Object.values(o).flatMap(l=>l.fileIDs),s=[];Object.keys(e).forEach(l=>{const f=this.getFile(l);!f.progress.uploadStarted&&a.indexOf(l)===-1&&s.push(f.id)});const c=this.#p(s),u=await this.#m(c);return this.emit("complete",u),u}).catch(o=>{throw this.emit("error",o),this.log(o,"error"),o}))}}class ac{#e;#t=[];constructor(e){this.#e=e}on(e,r){return this.#t.push([e,r]),this.#e.on(e,r)}remove(){for(const[e,r]of this.#t.splice(0))this.#e.off(e,r)}onFilePause(e,r){this.on("upload-pause",(n,o)=>{e===n?.id&&r(o)})}onFileRemove(e,r){this.on("file-removed",n=>{e===n.id&&r(n.id)})}onPause(e,r){this.on("upload-pause",(n,o)=>{e===n?.id&&r(o)})}onRetry(e,r){this.on("upload-retry",n=>{e===n?.id&&r()})}onRetryAll(e,r){this.on("retry-all",()=>{this.#e.getFile(e)&&r()})}onPauseAll(e,r){this.on("pause-all",()=>{this.#e.getFile(e)&&r()})}onCancelAll(e,r){this.on("cancel-all",(...n)=>{this.#e.getFile(e)&&r(...n)})}onResumeAll(e,r){this.on("resume-all",()=>{this.#e.getFile(e)&&r()})}}function lc(t){const e=r=>"error"in r&&!!r.error;return t.filter(r=>!e(r))}function cc(t){return t.filter(e=>!e.progress?.uploadStarted||!e.isRestored)}function uc(t,e){return t===!0?Object.keys(e):Array.isArray(t)?t:[]}function Dr(t,e){return Object.hasOwn(t,e)}function dc(t){return t?t.readyState!==0&&t.readyState!==4||t.status===0:!1}
15class hc extends Error{cause;isNetworkError;request;constructor(e,r=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=r}}function fc(t){return new Error("Cancelled",{cause:t})}function Ii(t){if(t!=null){const e=()=>this.abort(t.reason);t.addEventListener("abort",e,{once:!0});const r=()=>{t.removeEventListener("abort",e)};this.then?.(r,r)}return this}class pc{#e=0;#t=[];#n=!1;#i;#r=1;#a;#o;limit;constructor(e){typeof e!="number"||e===0?this.limit=1/0:this.limit=e}#s(e){this.#e+=1;let r=!1,n;try{n=e()}catch(o){throw this.#e-=1,o}return{abort:o=>{r||(r=!0,this.#e-=1,n?.(o),this.#l())},done:()=>{r||(r=!0,this.#e-=1,this.#l())}}}#l(){queueMicrotask(()=>this.#g())}#g(){if(this.#n||this.#e>=this.limit||this.#t.length===0)return;const e=this.#t.shift();if(e==null)throw new Error("Invariant violation: next is null");const r=this.#s(e.fn);e.abort=r.abort,e.done=r.done}#d(e,r){const n={fn:e,priority:r?.priority||0,abort:()=>{this.#x(n)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},o=this.#t.findIndex(a=>n.priority>a.priority);return o===-1?this.#t.push(n):this.#t.splice(o,0,n),n}#x(e){const r=this.#t.indexOf(e);r!==-1&&this.#t.splice(r,1)}run(e,r){return!this.#n&&this.#e<this.limit?this.#s(e):this.#d(e,r)}wrapSyncFunction(e,r){return(...n)=>{const o=this.run(()=>(e(...n),queueMicrotask(()=>o.done()),()=>{}),r);return{abortOn:Ii,abort(){o.abort()}}}}wrapPromiseFunction(e,r){return(...n)=>{let o;const a=new Promise((s,c)=>{o=this.run(()=>{let u,l;try{l=Promise.resolve(e(...n))}catch(f){l=Promise.reject(f)}return l.then(f=>{u?c(u):(o.done(),s(f))},f=>{u?c(u):(o.done(),c(f))}),f=>{u=fc(f)}},r)});return a.abort=s=>{o.abort(s)},a.abortOn=Ii,a}}resume(){this.#n=!1,clearTimeout(this.#i);for(let e=0;e<this.limit;e++)this.#l()}#h=()=>this.resume();pause(e=null){this.#n=!0,clearTimeout(this.#i),e!=null&&(this.#i=setTimeout(this.#h,e))}rateLimit(e){clearTimeout(this.#o),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(this.#a=this.limit-1,this.limit=this.#r,this.#o=setTimeout(this.#c,e))}#c=()=>{if(this.#n){this.#o=setTimeout(this.#c,0);return}this.#r=this.limit,this.limit=Math.ceil((this.#a+this.#r)/2);for(let e=this.#r;e<=this.limit;e++)this.#l();this.#a-this.#r>3?this.#o=setTimeout(this.#c,2e3):this.#r=Math.floor(this.#r/2)};get isPaused(){return this.#n}}function Qr(t){"@babel/helpers - typeof";return Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qr(t)}function mc(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}function gc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xc(t,e,r){return e=Ct(e),yc(t,kn()?Reflect.construct(e,r||[],Ct(t).constructor):e.apply(t,r))}function yc(t,e){if(e&&(Qr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bc(t)}function bc(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vc(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tt(t,e)}function Zr(t){var e=typeof Map=="function"?new Map:void 0;return Zr=function(n){if(n===null||!wc(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,o)}function o(){return _c(n,arguments,Ct(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Tt(o,n)},Zr(t)}function _c(t,e,r){if(kn())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&Tt(o,r.prototype),o}function kn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kn=function(){return!!t})()}function wc(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Tt(t,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Tt(t,e)}function Ct(t){return Ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ct(t)}var qt=function(t){function e(r){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(gc(this,e),n=xc(this,e,[r]),n.originalRequest=a,n.originalResponse=s,n.causingError=o,o!=null&&(r+=", caused by ".concat(o.toString())),a!=null){var c=a.getHeader("X-Request-ID")||"n/a",u=a.getMethod(),l=a.getURL(),f=s?s.getStatus():"n/a",h=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(f,", response text: ").concat(h,", request id: ").concat(c,")")}return n.message=r,n}return vc(e,t),mc(e)}(Zr(Error));function At(t){"@babel/helpers - typeof";return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(t)}function jc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Tc(n.key),n)}}function kc(t,e,r){return e&&Sc(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Tc(t){var e=Cc(t,"string");return At(e)=="symbol"?e:e+""}function Cc(t,e){if(At(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(At(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Ac=function(){function t(){jc(this,t)}return kc(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}();const es="3.7.7",Fc=es,ft=typeof Buffer=="function",Ni=typeof TextDecoder=="function"?new TextDecoder:void 0,Di=typeof TextEncoder=="function"?new TextEncoder:void 0,Oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 10,814 bytes, line 15
15+/=",yt=Array.prototype.slice.call(Oc),Mt=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(yt),Rc=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ke=String.fromCharCode.bind(String),Ui=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),ts=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),rs=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),ns=t=>{let e,r,n,o,a="";const s=t.length%3;for(let c=0;c<t.length;){if((r=t.charCodeAt(c++))>255||(n=t.charCodeAt(c++))>255||(o=t.charCodeAt(c++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|o,a+=yt[e>>18&63]+yt[e>>12&63]+yt[e>>6&63]+yt[e&63]}return s?a.slice(0,s-3)+"===".substring(s):a},Tn=typeof btoa=="function"?t=>btoa(t):ft?t=>Buffer.from(t,"binary").toString("base64"):ns,Jr=ft?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,o=t.length;n<o;n+=4096)r.push(ke.apply(null,t.subarray(n,n+4096)));return Tn(r.join(""))},Zt=(t,e=!1)=>e?ts(Jr(t)):Jr(t),Pc=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?ke(192|e>>>6)+ke(128|e&63):ke(224|e>>>12&15)+ke(128|e>>>6&63)+ke(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return ke(240|e>>>18&7)+ke(128|e>>>12&63)+ke(128|e>>>6&63)+ke(128|e&63)}},Ic=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,is=t=>t.replace(Ic,Pc),Hi=ft?t=>Buffer.from(t,"utf8").toString("base64"):Di?t=>Jr(Di.encode(t)):t=>Tn(is(t)),ct=(t,e=!1)=>e?ts(Hi(t)):Hi(t),Li=t=>ct(t,!0),Nc=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Dc=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return ke((r>>>10)+55296)+ke((r&1023)+56320);case 3:return ke((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return ke((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},os=t=>t.replace(Nc,Dc),ss=t=>{if(t=t.replace(/\s+/g,""),!Rc.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,o;for(let a=0;a<t.length;)e=Mt[t.charAt(a++)]<<18|Mt[t.charAt(a++)]<<12|(n=Mt[t.charAt(a++)])<<6|(o=Mt[t.charAt(a++)]),r+=n===64?ke(e>>16&255):o===64?ke(e>>16&255,e>>8&255):ke(e>>16&255,e>>8&255,e&255);return r},Cn=typeof atob=="function"?t=>atob(rs(t)):ft?t=>Buffer.from(t,"base64").toString("binary"):ss,as=ft?t=>Ui(Buffer.from(t,"base64")):t=>Ui(Cn(t).split("").map(e=>e.charCodeAt(0))),ls=t=>as(cs(t)),Uc=ft?t=>Buffer.from(t,"base64").toString("utf8"):Ni?t=>Ni.decode(as(t)):t=>os(Cn(t)),cs=t=>rs(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),en=t=>Uc(cs(t)),Hc=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},us=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),ds=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,us(r));t("fromBase64",function(){return en(this)}),t("toBase64",function(e){return ct(this,e)}),t("toBase64URI",function(){return ct(this,!0)}),t("toBase64URL",function(){return ct(this,!0)}),t("toUint8Array",function(){return ls(this)})},hs=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,us(r));t("toBase64",function(e){return Zt(this,e)}),t("toBase64URI",function(){return Zt(this,!0)}),t("toBase64URL",function(){return Zt(this,!0)})},Lc=()=>{ds(),hs()},$c={version:es,VERSION:Fc,atob:Cn,atobPolyfill:ss,btoa:Tn,btoaPolyfill:ns,fromBase64:en,toBase64:ct,encode:ct,encodeURI:Li,encodeURL:Li,utob:is,btou:os,decode:en,isValid:Hc,fromUint8Array:Zt,toUint8Array:ls,extendString:ds,extendUint8Array:hs,extendBuiltins:Lc};var Ur,$i;function zc(){return $i||($i=1,Ur=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}),Ur}var Et={},zi;function Bc(){if(zi)return Et;zi=1;var t=Object.prototype.hasOwnProperty,e;function r(s){try{return decodeURIComponent(s.replace(/\+/g," "))}catch{return null}}function n(s){try{return encodeURIComponent(s)}catch{return null}}function o(s){for(var c=/([^=?#&]+)=?([^&]*)/g,u={},l;l=c.exec(s);){var f=r(l[1]),h=r(l[2]);f===null||h===null||f in u||(u[f]=h)}return u}function a(s,c){c=c||"";var u=[],l,f;typeof c!="string"&&(c="?");for(f in s)if(t.call(s,f)){if(l=s[f],!l&&(l===null||l===e||isNaN(l))&&(l=""),f=n(f),l=n(l),f===null||l===null)continue;u.push(f+"="+l)}return u.length?c+u.join("&"):""}return Et.stringify=a,Et.parse=o,Et}var Hr,Bi;function Wc(){if(Bi)return Hr;Bi=1;var t=zc(),e=Bc(),r=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,n=/[\n\r\t]/g,o=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=/:\d+$/,s=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function u(y){return(y||"").toString().replace(r,"")}var l=[["#","hash"],["?","query"],function(v,k){return _(k.protocol)?v.replace(/\\/g,"/"):v},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],f={hash:1,query:1};function h(y){var v;typeof window<"u"?v=window:typeof globalThis<"u"?v=globalThis:typeof self<"u"?v=self:v={};var k=v.location||{};y=y||k;var T={},U=typeof y,H;if(y.protocol==="blob:")T=new O(unescape(y.pathname),{});else if(U==="string"){T=new O(y,{});for(H in f)delete T[H]}else if(U==="object"){for(H in y)H in f||(T[H]=y[H]);T.slashes===void 0&&(T.slashes=o.test(y.href))}return T}function _(y){return y==="file:"||y==="ftp:"||y==="http:"||y==="https:"||y==="ws:"||y==="wss:"}function b(y,v){y=u(y),y=y.replace(n,""),v=v||{};var k=s.exec(y),T=k[1]?k[1].toLowerCase():"",U=!!k[2],H=!!k[3],M=0,B;return U?H?(B=k[2]+k[3]+k[4],M=k[2].length+k[3].length):(B=k[2]+k[4],M=k[2].length):H?(B=k[3]+k[4],M=k[3].length):B=k[4],T==="file:"?M>=2&&(B=B.slice(2)):_(T)?B=k[4]:T?U&&(B=B.slice(2)):M>=2&&_(v.protocol)&&(B=k[4]),{protocol:T,slashes:U||_(T),slashesCount:M,rest:B}}function S(y,v){if(y==="")return v;for(var k=(v||"/").split("/").slice(0,-1).concat(y.split("/")),T=k.length,U=k[T-1],H=!1,M=0;T--;)k[T]==="."?k.splice(T,1):k[T]===".."?(k.splice(T,1),M++):M&&(T===0&&(H=!0),k.splice(T,1),M--);return H&&k.unshift(""),(U==="."||U==="..")&&k.push(""),k.join("/")}function O(y,v,k){if(y=u(y),y=y.replace(n,""),!(this instanceof O))return new O(y,v,k);var T,U,H,M,B,re,K=l.slice(),ae=typeof v,R=this,oe=0;for(ae!=="object"&&ae!=="string"&&(k=v,v=null),k&&typeof k!="function"&&(k=e.parse),v=h(v),U=b(y||"",v),T=!U.protocol&&!U.slashes,R.slashes=U.slashes||T&&v.slashes,R.protocol=U.protocol||v.protocol||"",y=U.rest,(U.protocol==="file:"&&(U.slashesCount!==2||c.test(y))||!U.slashes&&(U.protocol||U.slashesCount<2||!_(R.protocol)))&&(K[3]=[/(.*)/,"pathname"]);oe<K.length;oe++){if(M=K[oe],typeof M=="function"){y=M(y,R);continue}H=M[0],re=M[1],H!==H?R[re]=y:typeof H=="string"?(B=H==="@"?y.lastIndexOf(H):y.indexOf(H),~B&&(typeof M[2]=="number"?(R[re]=y.slice(0,B),y=y.slice(B+M[2])):(R[re]=y.slice(B),y=y.slice(0,B)))):(B=H.exec(y))&&(R[re]=B[1],y=y.slice(0,B.index)),R[re]=R[re]||T&&M[3]&&v[re]||"",M[4]&&(R[re]=R[re].toLowerCase())}k&&(R.query=k(R.query)),T&&v.slashes&&R.pathname.charAt(0)!=="/"&&(R.pathname!==""||v.pathname!=="")&&(R.pathname=S(R.pathname,v.pathname)),R.pathname.charAt(0)!=="/"&&_(R.protocol)&&(R.pathname="/"+R.pathname),t(R.port,R.protocol)||(R.host=R.hostname,R.port=""),R.username=R.password="",R.auth&&(B=R.auth.indexOf(":"),~B?(R.username=R.auth.slice(0,B),R.username=encodeURIComponent(decodeURIComponent(R.username)),R.password=R.auth.slice(B+1),R.password=encodeURIComponent(decodeURIComponent(R.password))):R.username=encodeURIComponent(decodeURIComponent(R.auth)),R.auth=R.password?R.username+":"+R.password:R.username),R.origin=R.protocol!=="file:"&&_(R.protocol)&&R.host?R.protocol+"//"+R.host:"null",R.href=R.toString()}function L(y,v,k){var T=this;switch(y){case"query":typeof v=="string"&&v.length&&(v=(k||e.parse)(v)),T[y]=v;break;case"port":T[y]=v,t(v,T.protocol)?v&&(T.host=T.hostname+":"+v):(T.host=T.hostname,T[y]="");break;case"hostname":T[y]=v,T.port&&(v+=":"+T.port),T.host=v;break;case"host":T[y]=v,a.test(v)?(v=v.split(":"),T.port=v.pop(),T.hostname=v.join(":")):(T.hostname=v,T.port="");break;case"protocol":T.protocol=v.toLowerCase(),T.slashes=!k;break;case"pathname":case"hash":if(v){var U=y==="pathname"?"/":"#";T[y]=v.charAt(0)!==U?U+v:v}else T[y]=v;break;case"username":case"password":T[y]=encodeURIComponent(v);break;case"auth":var H=v.indexOf(":");~H?(T.username=v.slice(0,H),T.username=encodeURIComponent(decodeURIComponent(T.username)),T.password=v.slice(H+1),T.password=encodeURIComponent(decodeURIComponent(T.password))):T.username=encodeURIComponent(decodeURIComponent(v))}for(var M=0;M<l.length;M++){var B=l[M];B[4]&&(T[B[1]]=T[B[1]].toLowerCase())}return T.auth=T.password?T.username+":"+T.password:T.username,T.origin=T.protocol!=="file:"&&_(T.protocol)&&T.host?T.protocol+"//"+T.host:"null",T.href=T.toString(),T}function I(y){(!y||typeof y!="function")&&(y=e.stringify);var v,k=this,T=k.host,U=k.protocol;U&&U.charAt(U.length-1)!==":"&&(U+=":");var H=U+(k.protocol&&k.slashes||_(k.protocol)?"//":"");return k.username?(H+=k.username,k.password&&(H+=":"+k.password),H+="@"):k.password?(H+=":"+k.password,H+="@"):k.protocol!=="file:"&&_(k.protocol)&&!T&&k.pathname!=="/"&&(H+="@"),(T[T.length-1]===":"||a.test(k.hostname)&&!k.port)&&(T+=":"),H+=T+k.pathname,v=typeof k.query=="object"?y(k.query):k.query,v&&(H+=v.charAt(0)!=="?"?"?"+v:v),k.hash&&(H+=k.hash),H}return O.prototype={set:L,toString:I},O.extractProtocol=b,O.location=h,O.trimLeft=u,O.qs=e,Hr=O,Hr}var qc=Wc();const Mc=It(qc);function Ec(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}function tn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */tn=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(x,p,g){x[p]=g.value},a=typeof Symbol=="function"?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(x,p,g){return Object.defineProperty(x,p,{value:g,enumerable:!0,configurable:!0,writable:!0}),x[p]}try{l({},"")}catch{l=function(g,A,F){return g[A]=F}}function f(x,p,g,A){var F=p&&p.prototype instanceof I?p:I,C=Object.create(F.prototype),G=new oe(A||[]);return o(C,"_invoke",{value:re(x,g,G)}),C}function h(x,p,g){try{return{type:"normal",arg:x.call(p,g)}}catch(A){return{type:"throw",arg:A}}}e.wrap=f;var _="suspendedStart",b="suspendedYield",S="executing",O="completed",L={};function I(){}function y(){}function v(){}var k={};l(k,s,function(){return this});
vendor: 5,385 bytes, line 15
15var T=Object.getPrototypeOf,U=T&&T(T(pe([])));U&&U!==r&&n.call(U,s)&&(k=U);var H=v.prototype=I.prototype=Object.create(k);function M(x){["next","throw","return"].forEach(function(p){l(x,p,function(g){return this._invoke(p,g)})})}function B(x,p){function g(F,C,G,Z){var X=h(x[F],x,C);if(X.type!=="throw"){var N=X.arg,$=N.value;return $&&tt($)=="object"&&n.call($,"__await")?p.resolve($.__await).then(function(E){g("next",E,G,Z)},function(E){g("throw",E,G,Z)}):p.resolve($).then(function(E){N.value=E,G(N)},function(E){return g("throw",E,G,Z)})}Z(X.arg)}var A;o(this,"_invoke",{value:function(C,G){function Z(){return new p(function(X,N){g(C,G,X,N)})}return A=A?A.then(Z,Z):Z()}})}function re(x,p,g){var A=_;return function(F,C){if(A===S)throw Error("Generator is already running");if(A===O){if(F==="throw")throw C;return{value:t,done:!0}}for(g.method=F,g.arg=C;;){var G=g.delegate;if(G){var Z=K(G,g);if(Z){if(Z===L)continue;return Z}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(A===_)throw A=O,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);A=S;var X=h(x,p,g);if(X.type==="normal"){if(A=g.done?O:b,X.arg===L)continue;return{value:X.arg,done:g.done}}X.type==="throw"&&(A=O,g.method="throw",g.arg=X.arg)}}}function K(x,p){var g=p.method,A=x.iterator[g];if(A===t)return p.delegate=null,g==="throw"&&x.iterator.return&&(p.method="return",p.arg=t,K(x,p),p.method==="throw")||g!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+g+"' method")),L;var F=h(A,x.iterator,p.arg);if(F.type==="throw")return p.method="throw",p.arg=F.arg,p.delegate=null,L;var C=F.arg;return C?C.done?(p[x.resultName]=C.value,p.next=x.nextLoc,p.method!=="return"&&(p.method="next",p.arg=t),p.delegate=null,L):C:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,L)}function ae(x){var p={tryLoc:x[0]};1 in x&&(p.catchLoc=x[1]),2 in x&&(p.finallyLoc=x[2],p.afterLoc=x[3]),this.tryEntries.push(p)}function R(x){var p=x.completion||{};p.type="normal",delete p.arg,x.completion=p}function oe(x){this.tryEntries=[{tryLoc:"root"}],x.forEach(ae,this),this.reset(!0)}function pe(x){if(x||x===""){var p=x[s];if(p)return p.call(x);if(typeof x.next=="function")return x;if(!isNaN(x.length)){var g=-1,A=function F(){for(;++g<x.length;)if(n.call(x,g))return F.value=x[g],F.done=!1,F;return F.value=t,F.done=!0,F};return A.next=A}}throw new TypeError(tt(x)+" is not iterable")}return y.prototype=v,o(H,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:y,configurable:!0}),y.displayName=l(v,u,"GeneratorFunction"),e.isGeneratorFunction=function(x){var p=typeof x=="function"&&x.constructor;return!!p&&(p===y||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(x){return Object.setPrototypeOf?Object.setPrototypeOf(x,v):(x.__proto__=v,l(x,u,"GeneratorFunction")),x.prototype=Object.create(H),x},e.awrap=function(x){return{__await:x}},M(B.prototype),l(B.prototype,c,function(){return this}),e.AsyncIterator=B,e.async=function(x,p,g,A,F){F===void 0&&(F=Promise);var C=new B(f(x,p,g,A),F);return e.isGeneratorFunction(p)?C:C.next().then(function(G){return G.done?G.value:C.next()})},M(H),l(H,u,"Generator"),l(H,s,function(){return this}),l(H,"toString",function(){return"[object Generator]"}),e.keys=function(x){var p=Object(x),g=[];for(var A in p)g.push(A);return g.reverse(),function F(){for(;g.length;){var C=g.pop();if(C in p)return F.value=C,F.done=!1,F}return F.done=!0,F}},e.values=pe,oe.prototype={constructor:oe,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!p)for(var g in this)g.charAt(0)==="t"&&n.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=t)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var g=this;function A(N,$){return G.type="throw",G.arg=p,g.next=N,$&&(g.method="next",g.arg=t),!!$}for(var F=this.tryEntries.length-1;F>=0;--F){var C=this.tryEntries[F],G=C.completion;if(C.tryLoc==="root")return A("end");if(C.tryLoc<=this.prev){var Z=n.call(C,"catchLoc"),X=n.call(C,"finallyLoc");if(Z&&X){if(this.prev<C.catchLoc)return A(C.catchLoc,!0);if(this.prev<C.finallyLoc)return A(C.finallyLoc)}else if(Z){if(this.prev<C.catchLoc)return A(C.catchLoc,!0)}else{if(!X)throw Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return A(C.finallyLoc)}}}},abrupt:function(p,g){for(var A=this.tryEntries.length-1;A>=0;--A){var F=this.tryEntries[A];if(F.tryLoc<=this.prev&&n.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var C=F;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=g&&g<=C.finallyLoc&&(C=null);var G=C?C.completion:{};return G.type=p,G.arg=g,C?(this.method="next",this.next=C.finallyLoc,L):this.complete(G)},complete:function(p,g){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&g&&(this.next=g),L},finish:function(p){for(var g=this.tryEntries.length-1;g>=0;--g){var A=this.tryEntries[g];if(A.finallyLoc===p)return this.complete(A.completion,A.afterLoc),R(A),L}},catch:function(p){for(var g=this.tryEntries.length-1;g>=0;--g){var A=this.tryEntries[g];
15if(A.tryLoc===p){var F=A.completion;if(F.type==="throw"){var C=F.arg;R(A)}return C}}throw Error("illegal catch attempt")},delegateYield:function(p,g,A){return this.delegate={iterator:pe(p),resultName:g,nextLoc:A},this.method==="next"&&(this.arg=t),L}},e}function Wi(t,e,r,n,o,a,s){try{var c=t[a](s),u=c.value}catch(l){r(l);return}c.done?e(u):Promise.resolve(u).then(n,o)}function Vc(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function s(u){Wi(a,n,o,s,c,"next",u)}function c(u){Wi(a,n,o,s,c,"throw",u)}s(void 0)})}}function fs(t,e){return Kc(t)||Yc(t,e)||ps(t,e)||Gc()}function Gc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 16In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yc(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,o,a,s,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(f){l=!0,o=f}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return c}}function Kc(t){if(Array.isArray(t))return t}function tt(t){"@babel/helpers - typeof";return tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tt(t)}function Xc(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ps(t))||e){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 17In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,c;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return a=l.done,l},e:function(l){s=!0,c=l},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(s)throw c}}}}function ps(t,e){if(t){if(typeof t=="string")return qi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qi(t,e)}}function qi(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Mi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function it(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Mi(Object(r),!0).forEach(function(n){Qc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mi(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Qc(t,e,r){return e=ms(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ei(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ms(n.key),n)}}function Jc(t,e,r){return e&&Ei(t.prototype,e),r&&Ei(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ms(t){var e=eu(t,"string");return tt(e)=="symbol"?e:e+""}function eu(t,e){if(tt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(tt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Jt="tus-v1",er="ietf-draft-03",bt="ietf-draft-05",tu={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:gs,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,
vendor: 4,757 bytes, line 17
17storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Jt},ir=function(){function t(e,r){Zc(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return Jc(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![Jt,er,bt].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var o=this.options.retryDelays;if(o!=null&&Object.prototype.toString.call(o)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var a=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];a<s.length;a++){var c=s[a];if(this.options[c]){this._emitError(new Error("tus: cannot use the ".concat(c," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,o=this._size,a=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,c=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:nu(this._source.size,s);this._parallelUploadUrls&&c.forEach(function(f,h){f.uploadUrl=n._parallelUploadUrls[h]||null}),this._parallelUploadUrls=new Array(c.length);var u=c.map(function(f,h){var _=0;return n._source.slice(f.start,f.end).then(function(b){var S=b.value;return new Promise(function(O,L){var I=it(it({},n.options),{},{uploadUrl:f.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:it(it({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:O,onError:L,onProgress:function(k){a=a-_+k,_=k,n._emitProgress(a,o)},onUploadUrlAvailable:function(){n._parallelUploadUrls[h]=y.url,n._parallelUploadUrls.filter(function(k){return!!k}).length===c.length&&n._saveUploadInUrlStorage()}}),y=new t(S,I);y.start(),n._parallelUploads.push(y)})})}),l;Promise.all(u).then(function(){l=n._openRequest("POST",n.options.endpoint),l.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var f=Vi(n.options.metadata);return f!==""&&l.setHeader("Upload-Metadata",f),n._sendRequest(l,null)}).then(function(f){if(!ot(f.getStatus(),200)){n._emitHttpError(l,f,"tus: unexpected response while creating upload");return}var h=f.getHeader("Location");
17if(h==null){n._emitHttpError(l,f,"tus: invalid or missing Location header");return}n.url=Xi(n.options.endpoint,h),"Created upload at ".concat(n.url),n._emitSuccess(f)}).catch(function(f){n._emitError(f)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){"Resuming upload from previous URL: ".concat(this.url),this._resumeUpload();return}if(this.options.uploadUrl!=null){"Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var o=Xc(this._parallelUploads),a;try{for(o.s();!(a=o.n()).done;){var s=a.value;s.abort(r)}}catch(c){o.e(c)}finally{o.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,o,a){this._emitError(new qt(o,a,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var o=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(o&&(this._retryAttempt=0),Ki(r,this._retryAttempt,this.options)){var a=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},a);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,o){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,o)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var o=Vi(this.options.metadata);o!==""&&n.setHeader("Upload-Metadata",o);var a;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,a=this._addChunkToRequest(n)):((this.options.protocol===er||this.options.protocol===bt)&&n.setHeader("Upload-Complete","?0"),a=this._sendRequest(n,null)),a.then(function(s){if(!ot(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var c=s.getHeader("Location");if(c==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=Xi(r.options.endpoint,c),"Created upload at ".concat(r.url),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),o=this._sendRequest(n,null);o.then(function(a){var s=a.getStatus();if(!ot(s,200)){if(s===423){r._emitHttpError(n,a,"tus: upload is currently locked; retry later");return}if(ot(s,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,a,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var c=Number.parseInt(a.getHeader("Upload-Offset"),10);if(Number.isNaN(c)){r._emitHttpError(n,a,"tus: invalid or missing offset value");return}var u=Number.parseInt(a.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===Jt){r._emitHttpError(n,a,"tus: invali
17d or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(c===u){r._emitProgress(u,u),r._emitSuccess(a);return}r._offset=c,r._performUpload()})}).catch(function(a){r._emitHttpError(n,null,"tus: failed to resume upload",a)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var o=this._addChunkToRequest(n);o.then(function(a){if(!ot(a.getStatus(),200)){r._emitHttpError(n,a,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,a)}).catch(function(a){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),a)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,o=this._offset,a=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(o+s,n._size)}),this.options.protocol===Jt?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===bt&&r.setHeader("Content-Type","application/partial-upload"),(a===Number.POSITIVE_INFINITY||a>this._size)&&!this.options.uploadLengthDeferred&&(a=this._size),this._source.slice(o,a).then(function(s){var c=s.value,u=s.done,l=c!=null&&c.size?c.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+l,r.setHeader("Upload-Length","".concat(n._size)));var f=n._offset+l;return!n.options.uploadLengthDeferred&&u&&f!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(f," bytes"))):c===null?n._sendRequest(r):((n.options.protocol===er||n.options.protocol===bt)&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,c))})}},{key:"_handleUploadResponse",value:function(r,n){var o=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(o)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(o,this._size),this._emitChunkComplete(o-this._offset,o,this._size),this._offset=o,o===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var o=Gi(r,n,this.options);return this._req=o,o}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(o){r._urlStorageKey=o})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Yi(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=Gi("DELETE",r,n);return Yi(o,null,n).then(function(a){if(a.getStatus()!==204)throw new qt("tus: unexpected response while terminating upload",null,o,a)}).catch(function(a){if(a instanceof qt||(a=new qt("tus: failed to terminate upload",a,o,null)),!Ki(a,0,n))throw a;var s=n.retryDelays[0],c=n.retryDelays.slice(1),u=it(it({},n),{},{retryDelays:c});return new Promise(function(l){return setTimeout(l,s)}).then(function(){return t.terminate(r,u)})})}}])}();function Vi(t){return Object.entries(t).map(function(e){var r=fs(e,2),n=r[0],o=r[1];return"".concat(n," ").concat($c.encode(String(o)))}).join(",")}function ot(t,e){return t>=e&&t<e+100}function Gi(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===er?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===bt?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},a=0,s=Object.entries(o);a<s.length;a++){var c=fs(s[a],2),u=c[0],l=c[1];n.setHeader(u,l)}if(r.addRequestId){var f=Ec();n.setHeader("X-Request-ID",f)}return n}function Yi(t,e,r){return rn.apply(this,arguments)}function rn(){return rn=Vc(tn().mark(function t(e,r,n){var o;return tn().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(typeof n.onBeforeRequest!="function"){s.next=3;break}return s.next=3,n.onBeforeRequest(e);case 3:return s.next=5,e.send(r);case 5:if(o=s.sent,typeof n.onAfterResponse!="function"){s.next=9;break}return s.next=9,n.onAfterResponse(e,o);case 9:return s.abrupt("return",o);case 10:case"end":return s.stop()}},t)})),rn.apply(this,arguments)}function ru(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function Ki(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):gs(t)}function gs(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ot(e,400)||e===409||e===423)&&ru()}function Xi(t,e){return new Mc(e,t).toString()}function nu(t,e){for(var r=Math.floor(t/e),n=[],o=0;o<e;o++)n.push({start:r*o,end:r*(o+1)});return n[e-1].end=t,n}ir.defaultOptions=tu;var xs=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"};function iu(t){return new Promise(function(e,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var o=n.response;e(o)},n.onerror=function(o){r(o)},n.open("GET",t),n.send()})}var ou=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")};function su(t){return new Promise(function(e,r){var n=new FileReader;n.onload=function(){var o=new Uint8Array(n.result);e({value:o})},n.onerror=function(o){r(o)},n.readAsArrayBuffer(t)})}function Ft(t){"@babel/helpers - typeof";return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ft(t)}function au(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uu(n.key),n)}}function cu(t,e,r){return e&&lu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function uu(t){var e=du(t,"string");return Ft(e)=="symbol"?e:e+""}function du(t,e){if(Ft(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ft(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Qi=function(){function t(e){au(this,t),this._file=e,this.size=e.size}return cu(t,[{key:"slice",value:function(r,n){if(ou())return su(this._file.slice(r,n));var o=this._file.slice(r,n),a=n>=this.size;return Promise.resolve({value:o,done:a})}},{key:"close",value:function(){}}])}();function Ot(t){"@babel/helpers - typeof";return Ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ot(t)}function hu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mu(n.key),n)}}function pu(t,e,r){return e&&fu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function mu(t){var e=gu(t,"string");return Ot(e)=="symbol"?e:e+""}function gu(t,e){if(Ot(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ot(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Zi(t){return t===void 0?0:t.size!==void 0?t.size:t.length}function xu(t,e){if(t.concat)return t.concat(e);
17if(t instanceof Blob)return new Blob([t,e],{type:t.type});if(t.set){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}throw new Error("Unknown data type")}var yu=function(){function t(e){hu(this,t),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return pu(t,[{key:"slice",value:function(r,n){return r<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(r,n)}},{key:"_readUntilEnoughDataOrDone",value:function(r,n){var o=this,a=n<=this._bufferOffset+Zi(this._buffer);if(this._done||a){var s=this._getDataFromBuffer(r,n),c=s==null?this._done:!1;return Promise.resolve({value:s,done:c})}return this._reader.read().then(function(u){var l=u.value,f=u.done;return f?o._done=!0:o._buffer===void 0?o._buffer=l:o._buffer=xu(o._buffer,l),o._readUntilEnoughDataOrDone(r,n)})}},{key:"_getDataFromBuffer",value:function(r,n){r>this._bufferOffset&&(this._buffer=this._buffer.slice(r-this._bufferOffset),this._bufferOffset=r);var o=Zi(this._buffer)===0;return this._done&&o?null:this._buffer.slice(0,n-r)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])}();function rt(t){"@babel/helpers - typeof";return rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rt(t)}function nn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */nn=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(x,p,g){x[p]=g.value},a=typeof Symbol=="function"?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(x,p,g){return Object.defineProperty(x,p,{value:g,enumerable:!0,configurable:!0,writable:!0}),x[p]}try{l({},"")}catch{l=function(g,A,F){return g[A]=F}}function f(x,p,g,A){var F=p&&p.prototype instanceof I?p:I,C=Object.create(F.prototype),G=new oe(A||[]);return o(C,"_invoke",{value:re(x,g,G)}),C}function h(x,p,g){try{return{type:"normal",arg:x.call(p,g)}}catch(A){return{type:"throw",arg:A}}}e.wrap=f;var _="suspendedStart",b="suspendedYield",S="executing",O="completed",L={};function I(){}function y(){}function v(){}var k={};l(k,s,function(){return this});var T=Object.getPrototypeOf,U=T&&T(T(pe([])));U&&U!==r&&n.call(U,s)&&(k=U);var H=v.prototype=I.prototype=Object.create(k);function M(x){["next","throw","return"].forEach(function(p){l(x,p,function(g){return this._invoke(p,g)})})}function B(x,p){function g(F,C,G,Z){var X=h(x[F],x,C);if(X.type!=="throw"){var N=X.arg,$=N.value;return $&&rt($)=="object"&&n.call($,"__await")?p.resolve($.__await).then(function(E){g("next",E,G,Z)},function(E){g("throw",E,G,Z)}):p.resolve($).then(function(E){N.value=E,G(N)},function(E){return g("throw",E,G,Z)})}Z(X.arg)}var A;o(this,"_invoke",{value:function(C,G){function Z(){return new p(function(X,N){g(C,G,X,N)})}return A=A?A.then(Z,Z):Z()}})}function re(x,p,g){var A=_;return function(F,C){if(A===S)throw Error("Generator is already running");if(A===O){if(F==="throw")throw C;return{value:t,done:!0}}for(g.method=F,g.arg=C;;){var G=g.delegate;if(G){var Z=K(G,g);if(Z){if(Z===L)continue;return Z}}if(g.method==="next")g.sent=g._sent=g.arg;else if(g.method==="throw"){if(A===_)throw A=O,g.arg;g.dispatchException(g.arg)}else g.method==="return"&&g.abrupt("return",g.arg);A=S;var X=h(x,p,g);if(X.type==="normal"){if(A=g.done?O:b,X.arg===L)continue;return{value:X.arg,done:g.done}}X.type==="throw"&&(A=O,g.method="throw",g.arg=X.arg)}}}function K(x,p){var g=p.method,A=x.iterator[g];if(A===t)return p.delegate=null,g==="throw"&&x.iterator.return&&(p.method="return",p.arg=t,K(x,p),p.method==="throw")||g!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+g+"' method")),L;var F=h(A,x.iterator,p.arg);if(F.type==="throw")return p.method="throw",p.arg=F.arg,p.delegate=null,L;var C=F.arg;return C?C.done?(p[x.resultName]=C.value,p.next=x.nextLoc,p.method!=="return"&&(p.method="next",p.arg=t),p.delegate=null,L):C:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,L)}
17function ae(x){var p={tryLoc:x[0]};1 in x&&(p.catchLoc=x[1]),2 in x&&(p.finallyLoc=x[2],p.afterLoc=x[3]),this.tryEntries.push(p)}function R(x){var p=x.completion||{};p.type="normal",delete p.arg,x.completion=p}function oe(x){this.tryEntries=[{tryLoc:"root"}],x.forEach(ae,this),this.reset(!0)}function pe(x){if(x||x===""){var p=x[s];if(p)return p.call(x);if(typeof x.next=="function")return x;if(!isNaN(x.length)){var g=-1,A=function F(){for(;++g<x.length;)if(n.call(x,g))return F.value=x[g],F.done=!1,F;return F.value=t,F.done=!0,F};return A.next=A}}throw new TypeError(rt(x)+" is not iterable")}return y.prototype=v,o(H,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:y,configurable:!0}),y.displayName=l(v,u,"GeneratorFunction"),e.isGeneratorFunction=function(x){var p=typeof x=="function"&&x.constructor;return!!p&&(p===y||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(x){return Object.setPrototypeOf?Object.setPrototypeOf(x,v):(x.__proto__=v,l(x,u,"GeneratorFunction")),x.prototype=Object.create(H),x},e.awrap=function(x){return{__await:x}},M(B.prototype),l(B.prototype,c,function(){return this}),e.AsyncIterator=B,e.async=function(x,p,g,A,F){F===void 0&&(F=Promise);var C=new B(f(x,p,g,A),F);return e.isGeneratorFunction(p)?C:C.next().then(function(G){return G.done?G.value:C.next()})},M(H),l(H,u,"Generator"),l(H,s,function(){return this}),l(H,"toString",function(){return"[object Generator]"}),e.keys=function(x){var p=Object(x),g=[];for(var A in p)g.push(A);return g.reverse(),function F(){for(;g.length;){var C=g.pop();if(C in p)return F.value=C,F.done=!1,F}return F.done=!0,F}},e.values=pe,oe.prototype={constructor:oe,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!p)for(var g in this)g.charAt(0)==="t"&&n.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=t)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var g=this;function A(N,$){return G.type="throw",G.arg=p,g.next=N,$&&(g.method="next",g.arg=t),!!$}for(var F=this.tryEntries.length-1;F>=0;--F){var C=this.tryEntries[F],G=C.completion;if(C.tryLoc==="root")return A("end");if(C.tryLoc<=this.prev){var Z=n.call(C,"catchLoc"),X=n.call(C,"finallyLoc");if(Z&&X){if(this.prev<C.catchLoc)return A(C.catchLoc,!0);if(this.prev<C.finallyLoc)return A(C.finallyLoc)}else if(Z){if(this.prev<C.catchLoc)return A(C.catchLoc,!0)}else{if(!X)throw Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return A(C.finallyLoc)}}}},abrupt:function(p,g){for(var A=this.tryEntries.length-1;A>=0;--A){var F=this.tryEntries[A];if(F.tryLoc<=this.prev&&n.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var C=F;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=g&&g<=C.finallyLoc&&(C=null);var G=C?C.completion:{};return G.type=p,G.arg=g,C?(this.method="next",this.next=C.finallyLoc,L):this.complete(G)},complete:function(p,g){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&g&&(this.next=g),L},finish:function(p){for(var g=this.tryEntries.length-1;g>=0;--g){var A=this.tryEntries[g];if(A.finallyLoc===p)return this.complete(A.completion,A.afterLoc),R(A),L}},catch:function(p){for(var g=this.tryEntries.length-1;g>=0;--g){var A=this.tryEntries[g];if(A.tryLoc===p){var F=A.completion;if(F.type==="throw"){var C=F.arg;R(A)}return C}}throw Error("illegal catch attempt")},delegateYield:function(p,g,A){return this.delegate={iterator:pe(p),resultName:g,nextLoc:A},this.method==="next"&&(this.arg=t),L}},e}function Ji(t,e,r,n,o,a,s){try{var c=t[a](s),u=c.value}catch(l){r(l);return}c.done?e(u):Promise.resolve(u).then(n,o)}function bu(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function s(u){Ji(a,n,o,s,c,"next",u)}function c(u){Ji(a,n,o,s,c,"throw",u)}s(void 0)})}}function vu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ju(n.key),n)}}function wu(t,e,r){return e&&_u(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ju(t){var e=Su(t,"string");return rt(e)=="symbol"?e:e+""}function Su(t,e){if(rt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(rt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ku=function(){function t(){vu(this,t)}return wu(t,[{key:"openFile",value:function(){var e=bu(nn().mark(function n(o,a){var s;return nn().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(xs()&&o&&typeof o.uri<"u")){u.next=11;break}return u.prev=1,u.next=4,iu(o.uri);case 4:return s=u.sent,u.abrupt("return",new Qi(s));case 8:throw u.prev=8,u.t0=u.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(u.t0));
17case 11:if(!(typeof o.slice=="function"&&typeof o.size<"u")){u.next=13;break}return u.abrupt("return",Promise.resolve(new Qi(o)));case 13:if(typeof o.read!="function"){u.next=18;break}if(a=Number(a),Number.isFinite(a)){u.next=17;break}return u.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return u.abrupt("return",Promise.resolve(new yu(o,a)));case 18:return u.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return u.stop()}},n,null,[[1,8]])}));function r(n,o){return e.apply(this,arguments)}return r}()}])}();function Tu(t,e){return xs()?Promise.resolve(Cu(t,e)):Promise.resolve(["tus-br",t.name,t.type,t.size,t.lastModified,e.endpoint].join("-"))}function Cu(t,e){var r=t.exif?Au(JSON.stringify(t.exif)):"noexif";return["tus-rn",t.name||"noname",t.size||"nosize",r,e.endpoint].join("/")}function Au(t){var e=0;if(t.length===0)return e;for(var r=0;r<t.length;r++){var n=t.charCodeAt(r);e=(e<<5)-e+n,e&=e}return e}function Rt(t){"@babel/helpers - typeof";return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rt(t)}function An(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ou(n.key),n)}}function Fn(t,e,r){return e&&Fu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ou(t){var e=Ru(t,"string");return Rt(e)=="symbol"?e:e+""}function Ru(t,e){if(Rt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Rt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Pu=function(){function t(){An(this,t)}return Fn(t,[{key:"createRequest",value:function(r,n){return new Iu(r,n)}},{key:"getName",value:function(){return"XHRHttpStack"}}])}(),Iu=function(){function t(e,r){An(this,t),this._xhr=new XMLHttpRequest,this._xhr.open(e,r,!0),this._method=e,this._url=r,this._headers={}}return Fn(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._xhr.setRequestHeader(r,n),this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(n){n.lengthComputable&&r(n.loaded)})}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(o,a){r._xhr.onload=function(){o(new Nu(r._xhr))},r._xhr.onerror=function(s){a(s)},r._xhr.send(n)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}(),Nu=function(){function t(e){An(this,t),this._xhr=e}return Fn(t,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(r){return this._xhr.getResponseHeader(r)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}();function Pt(t){"@babel/helpers - typeof";return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(t)}function Du(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Lu(n.key),n)}}function Hu(t,e,r){return e&&Uu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lu(t){var e=$u(t,"string");return Pt(e)=="symbol"?e:e+""}function $u(t,e){if(Pt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Pt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var on=!1;try{on="localStorage"in window;var Lr="tusSupport",eo=localStorage.getItem(Lr);localStorage.setItem(Lr,eo),eo===null&&localStorage.removeItem(Lr)}catch(t){if(t.code===t.SECURITY_ERR||t.code===t.QUOTA_EXCEEDED_ERR)on=!1;else throw t}var zu=on,Bu=function(){function t(){Du(this,t)}return Hu(t,[{key:"findAllUploads",value:function(){var r=this._findEntries("tus::");return Promise.resolve(r)}},{key:"findUploadsByFingerprint",value:function(r){var n=this._findEntries("tus::".concat(r,"::"));return Promise.resolve(n)}},{key:"removeUpload",value:function(r){return localStorage.removeItem(r),Promise.resolve()}},{key:"addUpload",value:function(r,n){var o=Math.round(Math.random()*1e12),a="tus::".concat(r,"::").concat(o);return localStorage.setItem(a,JSON.stringify(n)),Promise.resolve(a)}},{key:"_findEntries",value:function(r){for(var n=[],o=0;o<localStorage.length;o++){var a=localStorage.key(o);if(a.indexOf(r)===0)try{var s=JSON.parse(localStorage.getItem(a));s.urlStorageKey=a,n.push(s)}catch{}}return n}}])}();function dt(t){"@babel/helpers - typeof";return dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dt(t)}
17function Wu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bs(n.key),n)}}function Mu(t,e,r){return r&&qu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Eu(t,e,r){return e=or(e),Vu(t,ys()?Reflect.construct(e,r||[],or(t).constructor):e.apply(t,r))}function Vu(t,e){if(e&&(dt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gu(t)}function Gu(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ys(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ys=function(){return!!t})()}function or(t){return or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},or(t)}function Yu(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sn(t,e)}function sn(t,e){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sn(t,e)}function to(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function at(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?to(Object(r),!0).forEach(function(n){Ku(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):to(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ku(t,e,r){return e=bs(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bs(t){var e=Xu(t,"string");return dt(e)=="symbol"?e:e+""}function Xu(t,e){if(dt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(dt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var an=at(at({},ir.defaultOptions),{},{httpStack:new Pu,fileReader:new ku,urlStorage:zu?new Bu:new Ac,fingerprint:Tu}),Qu=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Wu(this,e),n=at(at({},an),n),Eu(this,e,[r,n])}return Yu(e,t),Mu(e,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=at(at({},an),o),ir.terminate(n,o)}}])}(ir);const Zu="4.3.2",Ju={version:Zu};function ed(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")}function td(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"}function rd(t){return(e,r)=>{if(ed()||td())return an.fingerprint(e,r);const n=["tus",t.id,r.endpoint].join("-");return Promise.resolve(n)}}const vs={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[100,1e3,3e3,5e3],parallelUploads:1,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},nd={limit:20,retryDelays:vs.retryDelays,withCredentials:!1,allowedMetaFields:!0};class id extends Ja{static VERSION=Ju.version;#e;requests;uploaders;uploaderEvents;constructor(e,r){if(super(e,{...nd,...r}),this.type="uploader",this.id=this.opts.id||"Tus",r?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");if("autoRetry"in r)throw new Error("The `autoRetry` option was deprecated and has been removed.");this.requests=this.opts.rateLimitedQueue??new pc(this.opts.limit),this.#e=this.opts.retryDelays?.values(),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}resetUploaderReferences(e,r){const n=this.uploaders[e];n&&(n.abort(),r?.abort&&n.abort(!0),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}#t(e){return this.resetUploaderReferences(e.id),new Promise((r,n)=>{let o,a,s;const c={...this.opts,...e.tus||{}};typeof c.headers=="function"&&(c.headers=c.headers(e));const{onShouldRetry:u,onBeforeRequest:l,...f}=c,h={...vs,...f};h.fingerprint=rd(e),h.onBeforeRequest=async I=>{const y=I.getUnderlyingObject();y.withCredentials=!!c.withCredentials;let v;if(typeof l=="function"&&(v=l(I,e)),Dr(o,"shouldBeRequeued")){if(!o.shouldBeRequeued)return Promise.reject();let k;const T=new Promise(U=>{k=U});o=this.requests.run(()=>(e.isPaused&&o.abort(),k(),()=>{})),await Promise.all([T,v]);return}return v},h.onError=I=>
17{this.uppy.log(I);const y=I.originalRequest!=null?I.originalRequest.getUnderlyingObject():null;dc(y)&&(I=new hc(I,y)),this.resetUploaderReferences(e.id),o?.abort(),typeof c.onError=="function"&&c.onError(I),n(I)},h.onProgress=(I,y)=>{this.onReceiveUploadUrl(e,s.url),typeof c.onProgress=="function"&&c.onProgress(I,y);const v=this.uppy.getFile(e.id);this.uppy.emit("upload-progress",v,{uploadStarted:v.progress.uploadStarted??0,bytesUploaded:I,bytesTotal:y})},h.onSuccess=I=>{const y={uploadURL:s.url??void 0,status:200,body:{xhr:I.lastResponse.getUnderlyingObject()}};if(this.uppy.emit("upload-success",this.uppy.getFile(e.id),y),this.resetUploaderReferences(e.id),o.done(),s.url){const{name:v}=s.file;this.uppy.log(`Download ${v} from ${s.url}`)}typeof c.onSuccess=="function"&&c.onSuccess(I),r(s)};const _=I=>{const y=I?.originalResponse?.getStatus();if(y===429){if(!this.requests.isPaused){const v=this.#e?.next();if(v==null||v.done)return!1;this.requests.rateLimit(v.value)}}else{if(y!=null&&y>=400&&y<500&&y!==409&&y!==423)return!1;typeof navigator<"u"&&navigator.onLine===!1&&(this.requests.isPaused||(this.requests.pause(),window.addEventListener("online",()=>{this.requests.resume()},{once:!0})))}return o.abort(),o={shouldBeRequeued:!0,abort(){this.shouldBeRequeued=!1},done(){throw new Error("Cannot mark a queued request as done: this indicates a bug")},fn(){throw new Error("Cannot run a queued request: this indicates a bug")}},!0};u!=null?h.onShouldRetry=(I,y)=>u(I,y,c,_):h.onShouldRetry=_;const b=(I,y,v)=>{Dr(I,y)&&!Dr(I,v)&&(I[v]=I[y])},S={};
17uc(c.allowedMetaFields,e.meta).forEach(I=>{S[I]=String(e.meta[I])}),b(S,"type","filetype"),b(S,"name","filename"),h.metadata=S,s=new Qu(e.data,h),this.uploaders[e.id]=s;const L=new ac(this.uppy);this.uploaderEvents[e.id]=L,a=()=>(e.isPaused||s.start(),()=>{}),s.findPreviousUploads().then(I=>{const y=I[0];y&&(this.uppy.log(`[Tus] Resuming upload of ${e.id} started at ${y.creationTime}`),s.resumeFromPreviousUpload(y)),o=this.requests.run(a)}),L.onFileRemove(e.id,I=>{o.abort(),this.resetUploaderReferences(e.id,{abort:!!s.url}),r(`upload ${I} was removed`)}),L.onPause(e.id,I=>{o.abort(),I?s.abort():o=this.requests.run(a)}),L.onPauseAll(e.id,()=>{o.abort(),s.abort()}),L.onCancelAll(e.id,()=>{o.abort(),this.resetUploaderReferences(e.id,{abort:!!s.url}),r(`upload ${e.id} was canceled`)}),L.onResumeAll(e.id,()=>{o.abort(),e.error&&s.abort(),o=this.requests.run(a)})}).catch(r=>{throw this.uppy.emit("upload-error",e,r),r})}onReceiveUploadUrl(e,r){const n=this.uppy.getFile(e.id);n&&(!n.tus||n.tus.uploadUrl!==r)&&(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(n.id,{tus:{...n.tus,uploadUrl:r}}))}#n(e){const r={...this.opts};return e.tus&&Object.assign(r,e.tus),typeof r.headers=="function"&&(r.headers=r.headers(e)),{...e.remote?.body,endpoint:r.endpoint,uploadUrl:r.uploadUrl,protocol:"tus",size:e.data.size,headers:r.headers,metadata:e.meta}}async#i(e){const r=lc(e),n=cc(r);this.uppy.emit("upload-start",n),await Promise.allSettled(r.map(o=>{if(o.isRemote){const a=()=>this.requests,s=new AbortController,c=l=>{l.id===o.id&&s.abort()};this.uppy.on("file-removed",c);
17const u=this.uppy.getRequestClientForFile(o).uploadRemoteFile(o,this.#n(o),{signal:s.signal,getQueue:a});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",c)},{priority:-1})(),u}return this.#t(o)}))}#r=async e=>{if(e.length===0){this.uppy.log("[Tus] No files to upload");return}this.opts.limit===0&&this.uppy.log("[Tus] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/tus/#limit-0","warning"),this.uppy.log("[Tus] Uploading...");const r=this.uppy.getFilesByIds(e);await this.#i(r)};install(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!0}}),this.uppy.addUploader(this.#r)}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(this.#r)}}function od(t,e){return Object.assign(t,e)}function sd(t,e){return t?.key??e}function ad(t,e){const r=t._ptgLinkedRefs||(t._ptgLinkedRefs={});return r[e]||(r[e]=n=>{t.refs[e]=n})}function mt(t){const e={};for(let r=0;r<t.length;r++)if(t[r]!=null){const n=sd(t[r],r.toString(36));e[n]=t[r]}return e}function ld(t,e){t=t||{},e=e||{};const r=s=>Object.hasOwn(e,s)?e[s]:t[s],n={};let o=[];for(const s in t)Object.hasOwn(e,s)?o.length&&(n[s]=o,o=[]):o.push(s);const a={};for(const s in e){if(Object.hasOwn(n,s))for(let c=0;c<n[s].length;c++){const u=n[s][c];a[n[s][c]]=r(u)}a[s]=r(s)}for(let s=0;s<o.length;s++)a[o[s]]=r(o[s]);return a}const cd=t=>t;class ud extends Ve{constructor(e,r){super(e,r),this.refs={},this.state={children:mt(We(We(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const r in e)e[r]&&this.performAppear(r)}componentWillReceiveProps(e){const r=mt(We(e.children)||[]),n=this.state.children;this.setState(a=>({children:ld(a.children,r)}));let o;for(o in r)if(Object.hasOwn(r,o)){const a=n&&Object.hasOwn(n,o);r[o]&&a&&this.currentlyTransitioningKeys[o]?(this.keysToEnter.push(o),this.keysToAbortLeave.push(o)):r[o]&&!a&&!this.currentlyTransitioningKeys[o]&&this.keysToEnter.push(o)}for(o in n)if(Object.hasOwn(n,o)){const a=r&&Object.hasOwn(r,o);n[o]&&!a&&!this.currentlyTransitioningKeys[o]&&this.keysToLeave.push(o)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:r}=this;this.keysToLeave=[],r.forEach(this.performLeave)}_finishAbort(e){const r=this.keysToAbortLeave.indexOf(e);r!==-1&&this.keysToAbortLeave.splice(r,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const r=this.refs[e];r?.componentWillAppear?r.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const r=this.refs[e];r?.componentDidAppear&&r.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=mt(We(this.props.children)||[]);(!n||!Object.hasOwn(n,e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const r=this.refs[e];r?.componentWillEnter?r.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const r=this.refs[e];r?.componentDidEnter&&r.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=mt(We(this.props.children)||[]);(!n||!Object.hasOwn(n,e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const n=this.refs[e];n?.componentWillLeave?n.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const n=this.refs[e];n?.componentDidLeave&&n.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const o=mt(We(this.props.children)||[]);if(o&&Object.hasOwn(o,e))this.performEnter(e);else{const a=od({},this.state.children);delete a[e],this.setState({children:a})}}render({childFactory:e,transitionLeave:r,transitionName:n,transitionAppear:o,transitionEnter:a,transitionLeaveTimeout:s,transitionEnterTimeout:c,transitionAppearTimeout:u,component:l,...f},{children:h}){const _=Object.entries(h).map(([b,S])=>{if(!S)return;const O=ad(this,b);return ll(e(S),{ref:O,key:b})}
17).filter(Boolean);return Yr(l,f,_)}}ud.defaultProps={component:"span",childFactory:cd};function ue(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var dd=typeof self<"u"?self:globalThis;const hd=typeof navigator<"u";typeof globalThis>"u"||typeof process>"u"||!process.versions||process.versions.node;const _s=dd.Buffer,ws=!!_s,fd=t=>t!==void 0;function pd(t){return t===void 0||(t instanceof Map?t.size===0:Object.values(t).filter(fd).length===0)}function Oe(t){let e=new Error(t);throw delete e.stack,e}function ro(t){let e=function(r){let n=0;return r.ifd0.enabled&&(n+=1024),r.exif.enabled&&(n+=2048),r.makerNote&&(n+=2048),r.userComment&&(n+=1024),r.gps.enabled&&(n+=512),r.interop.enabled&&(n+=100),r.ifd1.enabled&&(n+=1024),n+2048}(t);return t.jfif.enabled&&(e+=50),t.xmp.enabled&&(e+=2e4),t.iptc.enabled&&(e+=14e3),t.icc.enabled&&(e+=6e3),e}const $r=t=>String.fromCharCode.apply(null,t),no=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;class Ye{static from(e,r){return e instanceof this&&e.le===r?e:new Ye(e,void 0,void 0,r)}constructor(e,r=0,n,o){if(typeof o=="boolean"&&(this.le=o),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){n===void 0&&(n=e.byteLength-r);let a=new DataView(e,r,n);this._swapDataView(a)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof Ye){n===void 0&&(n=e.byteLength-r),(r+=e.byteOffset)+n>e.byteOffset+e.byteLength&&Oe("Creating view outside of available memory in ArrayBuffer");let a=new DataView(e.buffer,r,n);this._swapDataView(a)}else if(typeof e=="number"){let a=new DataView(new ArrayBuffer(e));this._swapDataView(a)}else Oe("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,r,n=Ye){return e instanceof DataView||e instanceof Ye?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||Oe("BufferView.set(): Invalid data argument."),this.toUint8().set(e,r),new n(this,r,e.byteLength)}subarray(e,r){return r=r||this._lengthToEnd(e),new Ye(this,e,r)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,r){return new Uint8Array(this.buffer,this.byteOffset+e,r)}getString(e=0,r=this.byteLength){return o=this.getUint8Array(e,r),no?no.decode(o):ws?Buffer.from(o).toString("utf8"):decodeURIComponent(escape($r(o)));var o}getLatin1String(e=0,r=this.byteLength){let n=this.getUint8Array(e,r);return $r(n)}getUnicodeString(e=0,r=this.byteLength){const n=[];for(let o=0;o<r&&e+o<this.byteLength;o+=2)n.push(this.getUint16(e+o));return $r(n)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,r=this.le){return this.dataView.getInt16(e,r)}getInt32(e,r=this.le){return this.dataView.getInt32(e,r)}getUint16(e,r=this.le){return this.dataView.getUint16(e,r)}getUint32(e,r=this.le){return this.dataView.getUint32(e,r)}getFloat32(e,r=this.le){return this.dataView.getFloat32(e,r)}getFloat64(e,r=this.le){return this.dataView.getFloat64(e,r)}getFloat(e,r=this.le){return this.dataView.getFloat32(e,r)}getDouble(e,r=this.le){return this.dataView.getFloat64(e,r)}getUintBytes(e,r,n){switch(r){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}getUint(e,r,n){switch(r){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function ln(t,e){Oe(`${t} '${e}' was not loaded, try using full build of exifr.`)}class On extends Map{constructor(e){super(),this.kind=e}get(e,r){return this.has(e)||ln(this.kind,e),r&&(e in r||function(n,o){Oe(`Unknown ${n} '${o}'.`)}(this.kind,e),r[e].enabled||ln(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var md=new On("file parser"),Be=new On("segment parser"),gd=new On("file reader");const io=t=>new Promise((e,r)=>{let n=new FileReader;n.onloadend=()=>e(n.result||new ArrayBuffer),n.onerror=r,n.readAsArrayBuffer(t)}),Rn=new Map,xd=new Map,yd=new Map,Vt=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],js=["jfif","xmp","icc","iptc","ihdr"],cn=["tiff",...js],we=["ifd0","ifd1","exif","gps","interop"],Gt=[...cn,...we],Yt=["makerNote","userComment"],Ss=["translateKeys","translateValues","reviveValues","multiSegment"],Kt=[...Ss,"sanitize","mergeOutput","silentErrors"];class ks{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class gt extends ks{get needed(){return this.enabled||this.deps.size>0}constructor(e,r,n,o){if(super(),ue(this,"enabled",!1),ue(this,"skip",new Set),ue(this,"pick",
vendor: 7,655 bytes, line 17
17new Set),ue(this,"deps",new Set),ue(this,"translateKeys",!1),ue(this,"translateValues",!1),ue(this,"reviveValues",!1),this.key=e,this.enabled=r,this.parse=this.enabled,this.applyInheritables(o),this.canBeFiltered=we.includes(e),this.canBeFiltered&&(this.dict=Rn.get(e)),n!==void 0)if(Array.isArray(n))this.parse=this.enabled=!0,this.canBeFiltered&&n.length>0&&this.translateTagSet(n,this.pick);else if(typeof n=="object"){if(this.enabled=!0,this.parse=n.parse!==!1,this.canBeFiltered){let{pick:a,skip:s}=n;a&&a.length>0&&this.translateTagSet(a,this.pick),s&&s.length>0&&this.translateTagSet(s,this.skip)}this.applyInheritables(n)}else n===!0||n===!1?this.parse=this.enabled=n:Oe(`Invalid options argument: ${n}`)}applyInheritables(e){let r,n;for(r of Ss)n=e[r],n!==void 0&&(this[r]=n)}translateTagSet(e,r){if(this.dict){let n,o,{tagKeys:a,tagValues:s}=this.dict;for(n of e)typeof n=="string"?(o=s.indexOf(n),o===-1&&(o=a.indexOf(Number(n))),o!==-1&&r.add(Number(a[o]))):r.add(n)}else for(let n of e)r.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,sr(this.pick,this.deps)):this.enabled&&this.pick.size>0&&sr(this.pick,this.deps)}}var Ae={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},oo=new Map;class Ts extends ks{static useCached(e){let r=oo.get(e);return r!==void 0||(r=new this(e),oo.set(e,r)),r}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):Oe(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=hd?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Vt)this[e]=Ae[e];for(e of Kt)this[e]=Ae[e];for(e of Yt)this[e]=Ae[e];for(e of Gt)this[e]=new gt(e,Ae[e],void 0,this)}setupFromTrue(){let e;for(e of Vt)this[e]=Ae[e];for(e of Kt)this[e]=Ae[e];for(e of Yt)this[e]=!0;for(e of Gt)this[e]=new gt(e,!0,void 0,this)}setupFromArray(e){let r;for(r of Vt)this[r]=Ae[r];for(r of Kt)this[r]=Ae[r];for(r of Yt)this[r]=Ae[r];for(r of Gt)this[r]=new gt(r,!1,void 0,this);this.setupGlobalFilters(e,void 0,we)}setupFromObject(e){let r;for(r of(we.ifd0=we.ifd0||we.image,we.ifd1=we.ifd1||we.thumbnail,Object.assign(this,e),Vt))this[r]=zr(e[r],Ae[r]);for(r of Kt)this[r]=zr(e[r],Ae[r]);for(r of Yt)this[r]=zr(e[r],Ae[r]);for(r of cn)this[r]=new gt(r,Ae[r],e[r],this);for(r of we)this[r]=new gt(r,Ae[r],e[r],this.tiff);this.setupGlobalFilters(e.pick,e.skip,we,Gt),e.tiff===!0?this.batchEnableWithBool(we,!0):e.tiff===!1?this.batchEnableWithUserValue(we,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,we):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,we)}batchEnableWithBool(e,r){for(let n of e)this[n].enabled=r}batchEnableWithUserValue(e,r){for(let n of e){let o=r[n];this[n].enabled=o!==!1&&o!==void 0}}setupGlobalFilters(e,r,n,o=n){if(e&&e.length){for(let s of o)this[s].enabled=!1;let a=so(e,n);for(let[s,c]of a)sr(this[s].pick,c),this[s].enabled=!0}else if(r&&r.length){let a=so(r,n);for(let[s,c]of a)sr(this[s].skip,c)}}filterNestedSegmentTags(){let{ifd0:e,exif:r,xmp:n,iptc:o,icc:a}=this;this.makerNote?r.deps.add(37500):r.skip.add(37500),this.userComment?r.deps.add(37510):r.skip.add(37510),n.enabled||e.skip.add(700),o.enabled||e.skip.add(33723),a.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:r,gps:n,interop:o}=this;o.needed&&(r.deps.add(40965),e.deps.add(40965)),r.needed&&e.deps.add(34665),n.needed&&e.deps.add(34853),this.tiff.enabled=we.some(a=>this[a].enabled===!0)||this.makerNote||this.userComment;for(let a of we)this[a].finalizeFilters()}get onlyTiff(){return!js.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of cn)this[e].enabled&&!Be.has(e)&&ln("segment parser",e)}}function so(t,e){let r,n,o,a,s=[];for(o of e){for(a of(r=Rn.get(o),n=[],r))(t.includes(a[0])||t.includes(a[1]))&&n.push(a[0]);n.length&&s.push([o,n])}return s}function zr(t,e){return t!==void 0?t:e!==void 0?e:void 0}function sr(t,e){for(let r of e)t.add(r)}ue(Ts,"default",Ae);class lt{static findPosition(e,r){let n=e.getUint16(r+2)+2,o=typeof this.headerLength=="function"?this.headerLength(e,r,n):this.headerLength,a=r+o,s=n-o;return{offset:r,length:n,headerLength:o,start:a,size:s,end:a+s}}static parse(e,r={}){return new this(e,new Ts({[this.type]:r}),e).parse()}normalizeInput(e){return e instanceof Ye?e:new Ye(e)}constructor(e,r={},n){ue(this,"errors",[]),ue(this,"raw",new Map),ue(this,"handleError",o=>{if(!this.options.silentErrors)throw o;this.errors.push(o.message)}),this.chunk=this.normalizeInput(e),this.file=n,this.type=this.constructor.type,this.globalOptions=this.options=r,this.localOptions=r[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,r){let n=yd.get(r),o=xd.get(r),a=Rn.get(r),s=this.options[r],c=s.reviveValues&&!!n,u=s.translateValues&&!!o,l=s.translateKeys&&!!a,f={};for(let[h,_]of e)c&&n.has(h)?_=n.get(h)(_):u&&o.has(h)&&(_=this.translateValue(_,o.get(h))),l&&a.has(h)&&(h=a.get(h)||h),f[h]=_;return f}translateValue(e,r){return r[e]||r.DEFAULT||e}assignToOutput(e,r){this.assignObjectToOutput(e,this.constructor.type,r)}assignObjectToOutput(e,r,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[r]?Object.assign(e[r],n):e[r]=n}}ue(lt,"headerLength",4),ue(lt,"type",void 0),ue(lt,"multiSegment",!1),ue(lt,"canHandle",()=>!1);function bd(t){return t===192||t===194||t===196||t===219||t===221||t===218||t===254}function vd(t){return t>=224&&t<=239}function _d(t,e,r){for(let[n,o]of Be)if(o.canHandle(t,e,r))return n}class ao extends class{constructor(e,r,n){ue(this,"errors",[]),ue(this,"ensureSegmentChunk",async o=>{let a=o.start,s=o.size||65536;if(this.file.chunked)if(this.file.available(a,s))o.chunk=this.file.subarray(a,s);else try{o.chunk=await this.file.readChunk(a,s)}catch(c){Oe(`Couldn't read segment: ${JSON.stringify(o)}. ${c.message}`)}else this.file.byteLength>a+s?o.chunk=this.file.subarray(a,s):o.size===void 0?o.chunk=this.file.subarray(a):Oe("Segment unreachable: "+JSON.stringify(o));return o.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=r,this.parsers=n}injectSegment(e,r){this.options[e].enabled&&this.createParser(e,r)}createParser(e,r){let n=new(Be.get(e))(r,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let r of e){let{type:n,chunk:o}=r,a=this.options[n];if(a&&a.enabled){let s=this.parsers[n];s&&s.append||s||this.createParser(n,o)}}}async readSegments(e){let r=e.map(this.ensureSegmentChunk);await Promise.all(r)}}{constructor(...e){super(...e),ue(this,"appSegments",[]),ue(this,"jpegSegments",[]),ue(this,"unknownSegments",[])}static canHandle(e,r){return r===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Be.keyList())):(e=e===void 0?Be.ke
vendor: 3,651 bytes, line 17
17yList().filter(r=>this.options[r].enabled):e.filter(r=>this.options[r].enabled&&Be.has(r)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,r){this.setupSegmentFinderArgs(r);let{file:n,findAll:o,wanted:a,remaining:s}=this;if(!o&&this.file.chunked&&(o=Array.from(a).some(c=>{let u=Be.get(c),l=this.options[c];return u.multiSegment&&l.multiSegment}),o&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let c=!1;for(;s.size>0&&!c&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:u}=n,l=this.appSegments.some(f=>!this.file.available(f.offset||f.start,f.length||f.size));if(c=e>u&&!l?!await n.readNextChunk(e):!await n.readNextChunk(u),(e=this.findAppSegmentsInRange(e,n.byteLength))===void 0)return}}}findAppSegmentsInRange(e,r){r-=2;let n,o,a,s,c,u,{file:l,findAll:f,wanted:h,remaining:_,options:b}=this;for(;e<r;e++)if(l.getUint8(e)===255){if(n=l.getUint8(e+1),vd(n)){if(o=l.getUint16(e+2),a=_d(l,e,o),a&&h.has(a)&&(s=Be.get(a),c=s.findPosition(l,e),u=b[a],c.type=a,this.appSegments.push(c),!f&&(s.multiSegment&&u.multiSegment?(this.unfinishedMultiSegment=c.chunkNumber<c.chunkCount,this.unfinishedMultiSegment||_.delete(a)):_.delete(a),_.size===0)))break;b.recordUnknownSegments&&(c=lt.findPosition(l,e),c.marker=n,this.unknownSegments.push(c)),e+=o+1}else if(bd(n)){if(o=l.getUint16(e+2),n===218&&b.stopAfterSos!==!1)return;b.recordJpegSegments&&this.jpegSegments.push({offset:e,length:o,marker:n}),e+=o+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(r=>r.multiSegment))return;let e=function(r,n){let o,a,s,c=new Map;for(let u=0;u<r.length;u++)o=r[u],a=o[n],c.has(a)?s=c.get(a):c.set(a,s=[]),s.push(o);return Array.from(c)}(this.appSegments,"type");this.mergedAppSegments=e.map(([r,n])=>{let o=Be.get(r,this.options);return o.handleMultiSegments?{type:r,chunk:o.handleMultiSegments(n)}:n[0]})}getSegment(e){return this.appSegments.find(r=>r.type===e)}async getOrFindSegment(e){let r=this.getSegment(e);return r===void 0&&(await this.findAppSegments(0,[e]),r=this.getSegment(e)),r}}ue(ao,"type","jpeg"),md.set("jpeg",ao);const wd=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class jd extends lt{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,r,n=new Map){let{pick:o,skip:a}=this.options[r];o=new Set(o);let s=o.size>0,c=a.size===0,u=this.chunk.getUint16(e);e+=2;for(let l=0;l<u;l++){let f=this.chunk.getUint16(e);if(s){if(o.has(f)&&(n.set(f,this.parseTag(e,f,r)),o.delete(f),o.size===0))break}else!c&&a.has(f)||n.set(f,this.parseTag(e,f,r));e+=12}return n}parseTag(e,r,n){let{chunk:o}=this,a=o.getUint16(e+2),s=o.getUint32(e+4),c=wd[a];if(c*s<=4?e+=8:e=o.getUint32(e+8),(a<1||a>13)&&Oe(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${r.toString(16)}, type: ${a}, offset ${e}`),e>o.byteLength&&Oe(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${r.toString(16)}, type: ${a}, offset ${e} is outside of chunk size ${o.byteLength}`),a===1)return o.getUint8Array(e,s);if(a===2)return(u=function(l){for(;l.endsWith("\0");)l=l.slice(0,-1);return l}(u=o.getString(e,s)).trim())===""?void 0:u;var u;if(a===7)return o.getUint8Array(e,s);if(s===1)return this.parseTagValue(a,e);{let l=new(function(h){switch(h){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}
vendor: 7,466 bytes, lines 17-18
17(a))(s),f=c;for(let h=0;h<s;h++)l[h]=this.parseTagValue(a,e),e+=f;return l}}parseTagValue(e,r){let{chunk:n}=this;switch(e){case 1:return n.getUint8(r);case 3:return n.getUint16(r);case 4:return n.getUint32(r);case 5:return n.getUint32(r)/n.getUint32(r+4);case 6:return n.getInt8(r);case 8:return n.getInt16(r);case 9:return n.getInt32(r);case 10:return n.getInt32(r)/n.getInt32(r+4);case 11:return n.getFloat(r);case 12:return n.getDouble(r);case 13:return n.getUint32(r);default:Oe(`Invalid tiff type ${e}`)}}}class Br extends jd{static canHandle(e,r){return e.getUint8(r+1)===225&&e.getUint32(r+4)===1165519206&&e.getUint16(r+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let r=this[e]();return r.catch!==void 0&&(r=r.catch(this.handleError)),r}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),r=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(r)}}parseBlock(e,r){let n=new Map;return this[r]=n,this.parseTags(e,r,n),n}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Oe("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&Oe(`IFD0 offset points to outside of file. 18this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,ro(this.options));let r=this.parseBlock(this.ifd0Offset,"ifd0");return r.size!==0?(this.exifOffset=r.get(34665),this.interopOffset=r.get(40965),this.gpsOffset=r.get(34853),this.xmp=r.get(700),this.iptc=r.get(33723),this.icc=r.get(34675),this.options.sanitize&&(r.delete(34665),r.delete(40965),r.delete(34853),r.delete(700),r.delete(33723),r.delete(34675)),r):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,ro(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,r){let n=e.get(r);n&&n.length===1&&e.set(r,n[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",lo(...e.get(2),e.get(1))),e.set("longitude",lo(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),r=this.ifd1.get(514);return this.chunk.getUint8Array(e,r)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,r,n,o={};for(r of we)if(e=this[r],!pd(e))if(n=this.canTranslate?this.translateBlock(e,r):Object.fromEntries(e),this.options.mergeOutput){if(r==="ifd1")continue;Object.assign(o,n)}else o[r]=n;return this.makerNote&&(o.makerNote=this.makerNote),this.userComment&&(o.userComment=this.userComment),o}assignToOutput(e,r){if(this.globalOptions.mergeOutput)Object.assign(e,r);else for(let[n,o]of Object.entries(r))this.assignObjectToOutput(e,n,o)}}function lo(t,e,r,n){var o=t+e/60+r/3600;return n!=="S"&&n!=="W"||(o*=-1),o}ue(Br,"type","tiff"),ue(Br,"headerLength",10),Be.set("tiff",Br);const Pn={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},Pn,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},Pn,{tiff:!1,ifd1:!0,mergeOutput:!1});Object.assign({},Pn,{firstChunkSize:4e4,ifd0:[274]});if(typeof navigator=="object"){let t=navigator.userAgent;if(t.includes("iPad")||t.includes("iPhone")){let e=t.match(/OS (\d+)_(\d+)/);if(e){let[,r,n]=e}}else if(t.includes("OS X 10")){let[,e]=t.match(/OS X 10[_.](\d+)/)}if(t.includes("Chrome/")){let[,e]=t.match(/Chrome\/(\d+)/)}else if(t.includes("Firefox/")){let[,e]=t.match(/Firefox\/(\d+)/)}}class Sd extends Ye{constructor(...e){super(...e),ue(this,"ranges",new kd),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,r,n){if(e===0&&this.byteLength===0&&n){let o=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(o)}else{let o=e+r;if(o>this.byteLength){let{dataView:a}=this._extend(o);this._swapDataView(a)}}}_extend(e){let r;r=ws?_s.allocUnsafe(e):new Uint8Array(e);let n=new DataView(r.buffer,r.byteOffset,r.byteLength);return r.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:r,dataView:n}}subarray(e,r,n=!1){return r=r||this._lengthToEnd(e),n&&this._tryExtend(e,r),this.ranges.add(e,r),super.subarray(e,r)}set(e,r,n=!1){n&&this._tryExtend(r,e.byteLength,e);let o=super.set(e,r);return this.ranges.add(r,o.byteLength),o}async ensureChunk(e,r){this.chunked&&(this.ranges.available(e,r)||await this.readChunk(e,r))}available(e,r){return this.ranges.available(e,r)}}class kd{constructor(){ue(this,"list",[])}get length(){return this.list.length}add(e,r,n=0){let o=e+r,a=this.list.filter(s=>co(e,s.offset,o)||co(e,s.end,o));if(a.length>0){e=Math.min(e,...a.map(c=>c.offset)),o=Math.max(o,...a.map(c=>c.end)),r=o-e;let s=a.shift();s.offset=e,s.length=r,s.end=o,this.list=this.list.filter(c=>!a.includes(c))}else this.list.push({offset:e,length:r,end:o})}available(e,r){let n=e+r;return this.list.some(o=>o.offset<=e&&n<=o.end)}}function co(t,e,r){return t<=e&&e<=r}class Td extends Sd{constructor(e,r){super(0),ue(this,"chunksRead",0),this.input=e,this.options=r}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let r=this.options.chunkSize,n=await this.readChunk(e,r);return!!n&&n.byteLength===r}async readChunk(e,r){if(this.chunksRead++,(r=this.safeWrapAddress(e,r))!==0)return this._readChunk(e,r)}safeWrapAddress(e,r){return this.size!==void 0&&e+r>this.size?Math.max(0,this.size-e):r}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}gd.set("blob",class extends Td{async readWhole(){this.chunked=!1;let t=await io(this.input);this._swapArrayBuffer(t)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}
18async _readChunk(t,e){let r=e?t+e:void 0,n=this.input.slice(t,r),o=await io(n);return this.set(o,t,!0)}});Jo();w.createContext({uppy:void 0,status:"init",progress:0});function Cd(){return new URLSearchParams(Re().search)}Object.filter=(t,e)=>Object.keys(t).filter(r=>e(t[r])).reduce((r,n)=>(r[n]=t[n],r),[]);xn("input")({display:"none"});const Cs=({hostMe:t,history:e,auth:r,theEvent:n,hostReviewsEvent:o,onNotificationDialogClose:a})=>{let s=0;const c=new Sn({id:"uppity",autoProceed:!1,formData:!0,theme:"dark",allowedFileTypes:["image/*","video/*"],meta:{thisEvent:n._id}}).use(id,{endpoint:"https://app.porchlight.art/api/uploads/file",headers:{"x-auth-token":localStorage.token},onBeforeRequest:async(q,ne)=>{if(s===0)try{s++;const je={headers:{"Content-Type":"application/json"}},Ht=await Nn.post("/api/uploads/createDriveFolder",{thisEvent:ne.meta.thisEvent},je)}catch(je){console.log("error: "+je)}}});async function u(q,ne=2e3){try{const je=await Nn.get(`/api/uploads/eventUploadedFiles/${q}`);if(console.log("updatedEvent.data",je.data),y(je.data.uploadedFiles),je.data.uploadedFiles.filter(Hs=>!Hs.driveID).length===0){console.log("All images have driveIDs now.");return}setTimeout(async()=>{await u(q,ne+2e3)},ne)}catch(je){console.error(je);return}}c.on("upload-success",async(q,ne)=>{console.log("Rusty upload-success file, response",q,ne),console.log("Rusty upload-success theEvent._id",n._id),console.log("Rusty upload-success file.meta.thisEvent",q.meta.thisEvent);try{u(n._id)}catch(je){console.error(je)}});const[l,f]=w.useState({}),[h,_]=w.useState({}),[b,S]=w.useState({}),[O,L]=w.useState({}),[I,y]=w.useState([]);w.useEffect(()=>{n&&n.uploadedFiles&&n.uploadedFiles.length>0&&y(n.uploadedFiles)},[n.uploadedFiles]),w.useEffect(()=>{if(n&&n._id&&n.offersFromHosts&&n.offersFromHosts.length>0&&n.offersFromHosts.filter(q=>q.status==="ACCEPTED"?q:!1).length>0){const q=n.offersFromHosts.filter(ne=>(console.log("thisOffer.status",ne.status),ne.status==="ACCEPTED"?ne:!1))[0];_(q)}n.hostReviewOfEvent&&f(n.hostReviewOfEvent),n.artist?L(n.artist):n.confirmedArtist&&n.preferredArtists&&n.preferredArtists.length>0&&n.preferredArtists.map(q=>{q._id===n.confirmedArtist&&L(q)})},[n]),w.useEffect(()=>{n.hostReviewOfEvent&&f(n.hostReviewOfEvent)},[n?.hostReviewOfEvent]),w.useEffect(()=>{h&&h.host&&S(h.host),t&&S(t)},[h,t]);const[v,k]=w.useState({eventId:"",artistId:"",hostId:"",bookingWhen:"",bookingWhere:{},processOfConnecting:0,curationSuggestions:"",howMuchAttentionToGuide:"",howHelpfulWasGuide:0,guideSuggestions:"",eventbriteExperience:0,eventbriteSuggestions:"",porchlightCommunications:0,artistCommunications:0,attendanceExpectations:"",promotionInsight:"",experienceMeetingArtist:"",audienceInteraction:"",artistVibe:0,artistMusicalSkill:0,artistVocalSkill:0,artistSongwritingSkill:0,overnightExperience:0,critiqueOfArtist:"",critiqueOfPorchlight:"",experienceWithPorchlight:"",mediaContent:[],testimonial:"",willingToShareMore:"",obstacleOvercome:"",artistRating:0,artistFeedback:"",otherArtistFeedback:"",otherArtistFeedbackPrivacy:"",porchlightRating:0,porchlightFeedback:"",porchlightTestimonial:"",recommendations:""});w.useEffect(()=>{n._id&&l?k({eventId:n._id?n._id:"",artistId:!O?._id&&!n?.confirmedArtist?._id?"":O?._id||n?.confirmedArtist?._id,hostId:b._id?b._id:"",bookingWhen:n.bookingWhen?n.bookingWhen:"",bookingWhere:n.bookingWhere?n.bookingWhere:{},processOfConnecting:l.processOfConnecting?l.processOfConnecting:0,curationSuggestions:l.curationSuggestions?l.curationSuggestions:"",howMuchAttentionToGuide:l.howMuchAttentionToGuide?l.howMuchAttentionToGuide:"",howHelpfulWasGuide:l.howHelpfulWasGuide?l.howHelpfulWasGuide:0,guideSuggestions:l.guideSuggestions?l.guideSuggestions:"",eventbriteExperience:l.eventbriteExperience?l.eventbriteExperience:0,eventbriteSuggestions:l.eventbriteSuggestions?l.eventbriteSuggestions:"",porchlightCommunications:l.porchlightCommunications?l.porchlightCommunications:0,artistCommunications:l.artistCommunications?l.artistCommunications:0,attendanceExpectations:l.attendanceExpectations?l.attendanceExpectations:"",promotionInsight:l.promotionInsight?l.promotionInsight:"",experienceMeetingArtist:l.experienceMeetingArtist?l.experienceMeetingArtist:"",audienceInteraction:l.audienceInteraction?l.audie
18nceInteraction:"",artistVibe:l.artistVibe?l.artistVibe:0,artistMusicalSkill:l.artistMusicalSkill?l.artistMusicalSkill:0,artistVocalSkill:l.artistVocalSkill?l.artistVocalSkill:0,artistSongwritingSkill:l.artistSongwritingSkill?l.artistSongwritingSkill:0,overnightExperience:l.overnightExperience?l.overnightExperience:0,critiqueOfArtist:l.critiqueOfArtist?l.critiqueOfArtist:"",critiqueOfPorchlight:l.critiqueOfPorchlight?l.critiqueOfPorchlight:"",experienceWithPorchlight:l.experienceWithPorchlight?l.experienceWithPorchlight:"",mediaContent:l.mediaContent?l.mediaContent:[],testimonial:l.testimonial?l.testimonial:"",willingToShareMore:l.willingToShareMore?l.willingToShareMore:"",obstacleOvercome:l.obstacleOvercome?l.obstacleOvercome:"",artistRating:l.artistRating?l.artistRating:0,artistFeedback:l.artistFeedback?l.artistFeedback:"",otherArtistFeedback:l.otherArtistFeedback?l.otherArtistFeedback:"",otherArtistFeedbackPrivacy:l.otherArtistFeedbackPrivacy?l.otherArtistFeedbackPrivacy:"",porchlightRating:l.porchlightRating?l.porchlightRating:0,porchlightFeedback:l.porchlightFeedback?l.porchlightFeedback:"",porchlightTestimonial:l.porchlightTestimonial?l.porchlightTestimonial:"",recommendations:l.recommendations?l.recommendations:""}):n._id&&k({eventId:n._id?n._id:"",artistId:!O?._id&&!n?.confirmedArtist?._id?"":O?._id||n?.confirmedArtist?._id,hostId:!t._id&&!b._id?"":t._id||b._id,bookingWhen:n.bookingWhen?n.bookingWhen:"",bookingWhere:n.bookingWhere?n.bookingWhere:{}})},[r.loading,O,n,h,l,b,t]);const{processOfConnecting:T,curationSuggestions:U,howMuchAttentionToGuide:H,howHelpfulWasGuide:M,guideSuggestions:B,eventbriteExperience:re,eventbriteSuggestions:K,porchlightCommunications:ae,artistCommunications:R,attendanceExpectations:oe,promotionInsight:pe,experienceMeetingArtist:x,audienceInteraction:p,artistVibe:g,artistMusicalSkill:A,artistVocalSkill:F,artistSongwritingSkill:C,overnightExperience:G,critiqueOfArtist:Z,critiqueOfPorchlight:X,experienceWithPorchlight:N,mediaContent:$,testimonial:E,willingToShareMore:de,obstacleOvercome:me,artistRating:ge,artistFeedback:Ge,otherArtistFeedback:He,otherArtistFeedbackPrivacy:Le,porchlightRating:xe,porchlightFeedback:Pe,porchlightTestimonial:Te,recommendations:$e}=v,_e=q=>{he.current=!0;let ne=q.target.value;switch(q.target.type){case"checkbox":ne=q.target.checked;break;default:ne=q.target.value}const je=q.target.name.split(".");je.length===1?k({...v,[je[0]]:ne}):k(Ht=>({...Ht,[je[0]]:{...Ht[je[0]],[je[1]]:ne}}))},he=w.useRef(!1);w.useRef(!0);const Ke=q=>{q.preventDefault(),o(v,e,!0),he.current=!1},Ie=Ra(n?.bookingWhen),be={whoShowedUp:[[i.jsx(Q,{component:"legend",children:Ie.title}),i.jsx(Q,{component:"small",sx:{textAlign:"center",display:"block"},children:Ie.subtitle})],[i.jsx(se,{sx:{width:"100%",marginTop:"8px"},children:i.jsx(Pa,{eventId:n._id,theEvent:n,attendeeSummaries:n.attendeeSummaries,canVerify:Ie.canVerify})})]],artistRating:[[i.jsx(se,{className:"squareImgInACircle",sx:{height:"150px",width:"150px",maxHeight:"150px",maxWidth:"150px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${O?.squareImg||n?.confirmedArtist?.squareImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:"1px solid var(--primary-color)",margin:"0 auto",display:"flex",justifyContent:"center",alignItems:"end",aspectRatio:"1 / 1"}}),i.jsxs(Q,{component:"legend",children:["How was your overall experience hosting"," ",O?.stageName||n?.confirmedArtist?.stageName," ","on"," ",new Date(n?.bookingWhen).toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric",timeZone:"UTC"}),"?"]}),i.jsx(Q,{component:"small",sx:{textAlign:"center",display:"block"},children:"1 star being worst, 5 stars being best."})],[i.jsx(Fe,{component:"fieldset",children:i.jsx(rr,{size:"large",id:"artistRating",value:ge,name:"artistRating",onChange:q=>_e(q)})})]],artistFeedback:[[i.jsx(se,{className:"squareImgInACircle",sx:{height:"150px",width:"150px",maxHeight:"150px",maxWidth:"150px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${O?.squareImg||n?.confirmedArtist?.squareImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:"1px solid var(--primary-color)",margin:"0 auto",display:"flex",justifyContent:"center",alignItems:"end",as
18pectRatio:"1 / 1"}}),i.jsxs(Q,{component:"legend",children:["FOR INTERNAL USE ONLY: Tell us a bit more about hosting"," ",O?.stageName||n?.confirmedArtist?.stageName,", ","including both highlights and challenges."]})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"artistNotes_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"artistFeedback",id:"artistFeedback",placeholder:"Type your response here",value:Ge,onChange:q=>_e(q),sx:{width:"100%"}})})]],testimonial:[[i.jsx(se,{className:"squareImgInACircle",sx:{height:"150px",width:"150px",maxHeight:"150px",maxWidth:"150px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${O?.squareImg||n?.confirmedArtist?.squareImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:"1px solid var(--primary-color)",margin:"0 auto",display:"flex",justifyContent:"center",alignItems:"end",aspectRatio:"1 / 1"}}),i.jsxs(Q,{component:"legend",sx:{paddingTop:"10px",textWrap:"balance"},children:["TESTIMONIAL: What would you like others to know about"," ",O?.stageName||n?.confirmedArtist?.stageName,", their work, or this particular gathering?"]})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"artistNotes_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"testimonial",id:"testimonial",placeholder:"Type your response here",value:E,onChange:q=>_e(q),sx:{width:"100%"}})})]],critiqueOfArtist:[[i.jsx(se,{className:"squareImgInACircle",sx:{height:"150px",width:"150px",maxHeight:"150px",maxWidth:"150px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${O?.squareImg||n?.confirmedArtist?.squareImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:"1px solid var(--primary-color)",margin:"0 auto",display:"flex",justifyContent:"center",alignItems:"end",aspectRatio:"1 / 1"}}),i.jsxs(Q,{component:"legend",children:["FOR ARTIST: Artists often ask us for constructive feedback on their performances. Do you have any you'd like us to share with"," ",O?.stageName||n?.confirmedArtist?.stageName,"?"]})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"artistNotes_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"critiqueOfArtist",id:"critiqueOfArtist",placeholder:"Type your response here",value:Z,onChange:q=>_e(q),sx:{width:"100%"}})})]],otherArtistFeedback:[[i.jsx(Q,{component:"legend",children:"If there was another artist part of this event, please list their name here and any feedback you'd like to share."}),i.jsx(Q,{component:"small",children:"Please indicate whether this feedback is intended for internal review or external testimonial."})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"artistNotes_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"otherArtistFeedback",i
18d:"otherArtistFeedback",placeholder:"Type your response here",value:He,onChange:q=>_e(q),sx:{width:"100%"}})})]],porchlightRating:[[i.jsxs(se,{sx:{width:"220px",maxWidth:"220px",backgroundSize:"cover",backgroundClip:"content-box",margin:"-20px auto -20px"},children:[" ",i.jsx("img",{src:Lt,alt:"",className:"porchlightLogo"})]}),i.jsx(Q,{component:"legend",sx:{marginTop:"0px"},children:"How was your overall experience with Porchlight?"})],[i.jsx(Fe,{component:"fieldset",children:i.jsx(rr,{size:"large",id:"porchlightRating",value:xe,name:"porchlightRating",onChange:q=>_e(q)})})]],porchlightFeedback:[[i.jsxs(se,{sx:{width:"220px",maxWidth:"220px",backgroundSize:"cover",backgroundClip:"content-box",margin:"-20px auto -20px"},children:[" ",i.jsx("img",{src:Lt,alt:"",className:"porchlightLogo"})]}),i.jsx(Q,{component:"legend",children:"FOR INTERNAL USE ONLY: Tell us a bit more about your experience with Porchlight, including both highlights and challenges."})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"artistNotes_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"porchlightFeedback",i
18d:"porchlightFeedback",placeholder:"Type your response here",value:Pe,onChange:q=>_e(q),sx:{width:"100%"}})})]],porchlightTestimonial:[[i.jsxs(se,{sx:{width:"220px",maxWidth:"220px",backgroundSize:"cover",backgroundClip:"content-box",margin:"-20px auto -20px"},children:[" ",i.jsx("img",{src:Lt,alt:"",className:"porchlightLogo"})]}),i.jsx(Q,{component:"legend",children:"TESTIMONIAL: What would you like others to know about this network?"})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"artistNotes_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"porchlightTestimonial",id:"porchlightTestimonial",placeholder:"Type your response here",value:Te,onChange:q=>_e(q),sx:{width:"100%"}})})]],obstacleOvercome:[[i.jsx(Q,{component:"legend",sx:{paddingTop:"10px",textWrap:"balance"},children:"Practicing hospitality often requires creative problem solving. What is an obstacle you experienced and how did you overcome it?"})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"artistNotes_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"obstacleOvercome",id:"obstacleOvercome",placeholder:"Type your response here",value:me,onChange:q=>_e(q),sx:{width:"100%"}})})]],recommendations:[[i.jsx(Q,{component:"legend",children:"Please share one tool, resource, or tip you'd recommend to others when it comes to hosting."})],[i.jsx(m,{item:!0,size:{xs:12},sx:{margin:"16px auto",width:"70%"},className:"artistNotes_textarea",justifyContent:"center",children:i.jsx(ie,{multiline:!0,variant:"standard",name:"recommendations",id:"recommendations",placeholder:"Type your response here",value:$e,onChange:q=>_e(q),sx:{width:"100%"}})})]],endSlide:[[i.jsx(m,{item:!0,sx:{width:"250px",margin:"-40px auto -20px",textAlign:"center"},children:i.jsx("img",{src:Lt,alt:"",className:"porchlightLogo"})}),i.jsx(Y,{component:"h2",sx:{fontSize:"2.2em!important",textAlign:"center"},children:"Thank you!"}),i.jsxs(i.Fragment,{children:[i.jsx(Y,{component:"p",sx:{textAlign:"center",marginTop:"16px",textWrap:"balance"},children:"Porchlight is constantly growing and learning from each other, and your insight is essential as we cultivate this network of hosts, artists, and attendees."}),i.jsx(m,{item:!0,container:!0,justifyContent:"center",sx:{marginTop:"16px"},children:i.jsx(ee,{btnwidth:"300",onClick:()=>{fe(!1),typeof a=="function"&&a()},children:"Close This Window"})})]})]]};let d=Cd();const D=d.get("field"),z=d.get("eventID"),J=d.get("open"),ye=Re();if(D){const q=Object.keys(be);q.indexOf(D)>-1&&q.indexOf(D)}const[Ce,pt]=w.useState(0),nt=Ce,[Dt,Ut]=w.useState(1),hr=fn(Ce,{key:Ce,initial:null,from:{opacity:0,transform:`translateX(${Dt*60}vw)`},enter:{opacity:1,transform:"translateX(0%)"},leave:{opacity:0,transform:`translateX(${Dt*-60}vw)`},config:{mass:2,tension:280,friction:60},exitBeforeEnter:!1}),j=q=>{Ut(1),he.current&&Ke(q),pt(ne=>ne===Object.keys(be).length-1?ne:ne+1)},W=q=>{Ut(-1),he.current&&Ke(q),pt(ne=>ne==0?ne:ne-1)},[V,fe]=w.useState(!1),Xe=()=>{fe(!1),typeof a=="function"&&a()};return w.useEffect(()=>{if(J!=="survey"||!z||String(n._id)!==String(z))return;const q=setTimeout(()=>fe(!0),dn);return()=>clearTimeout(q)},[J,z,n._id,ye.key]),i.jsxs(w.Fragment,{children:[i.jsxs(wt,{open:V,onClose:Xe,scroll:"body",fullWidth:!0,maxWidth:"lg",className:"porchlightBG",PaperProps:{style:{minHeight:"82vh",height:"82vh"}},children:[i.jsx(pn,{variant:"progress",steps:Object.keys(be).length||nt.length,position:"static",activeStep:nt,sx:{position:"absolute",top:0,padding:"0px",left:0,right:0,width:"100%","& .MuiLinearProgress-root":{width:"100%"}},backButton:void 0,nextButton:void 0,LinearProgressProps:{color:"primary"}}),i.jsxs(jt,{sx:{},children:[i.jsx(se,{sx:{position:"absolute",top:0,right:0,backgroundColor:"rgba(0 0 0 /.6)",padding:"0"},children:i.jsx(et,{date:n?.bookingWhen})}),i.jsxs("form",{className:"form",onSubmit:q=>Ke(q),children:[i.jsx(m,{container:!0,direction:"row",alignItems:"start",justifyContent:"center",height:"65vh",sx:{padding:"20px!important"}
18,children:i.jsxs(m,{container:!0,item:!0,sx:{width:"100%"},direction:"row",justifyContent:"center",alignItems:"center",className:"cardNav",children:[i.jsx(m,{item:!0,children:i.jsxs(ee,{variant:"contained",component:"span",onClick:q=>W(q),sx:{opacity:nt>0?1:.2,transition:"opacity 450ms cubic-bezier(0.23, 1, 0.32, 1) 500ms"},children:[i.jsx(mn,{}),"Previous"]})}),i.jsx(m,{item:!0,children:i.jsxs(ee,{variant:"contained",component:"span",onClick:q=>j(q),sx:{opacity:nt!==Object.keys(be).length-1?1:.2,transition:"opacity 450ms cubic-bezier(0.23, 1, 0.32, 1) 500ms"},children:["Next",i.jsx(tr,{})]})})]})},"cardGrid"+n._id+O._id),hr((q,ne)=>i.jsx(gn.div,{className:"animatedFormGroup",style:{...q,minHeight:"inherit"},children:i.jsx("div",{className:"form-group",style:{maxWidth:"100%"},children:i.jsxs(m,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",sx:{width:"100%",margin:"0 auto"},children:[i.jsx(m,{item:!0,size:{xs:12},sx:ne>=0&&{"--form-num":`'${ne+1}'`},"data-form-num":ne,className:"formInquiry",children:be[Object.keys(be)[ne]][0]}),be[Object.keys(be)[ne]][1]]},"bookingDetails"+n._id+ne)},"form-group"+ne)},"animatedFormGroup"+ne))]})]})]}),(!n.hostReviewOfEvent||!n.hostReviewOfEvent._id)&&i.jsxs(se,{className:"createdAt",sx:{position:"absolute",top:"8px",right:"8px"},children:[" ",i.jsxs(Y,{component:"p",sx:{fontSize:".7em",fontFamily:"var(--secondary-font)",color:"var(--link-color)"},children:[i.jsx(wo,{style:{fontSize:"1.5em"}})," ","Please consider reviewing your experience hosting"," ",O?.stageName||n?.confirmedArtist?.stageName,"."]})]}),i.jsx(m,{item:!0,style:{margin:"20px auto 0",alignSelf:"center"},children:i.jsx(ee,{btnwidth:"250",onClick:()=>fe(!0),children:n&&n.hostReviewOfEvent&&n.hostReviewOfEvent._id?"Edit Your Review":"Review Your Experience"})})]},"Fragment"+n._id+O._id)};Cs.propTypes={hostMe:P.object.isRequired,theEvent:P.object.isRequired,auth:P.object.isRequired,hostReviewsEvent:P.func.isRequired,onNotificationDialogClose:P.func};const Ad=(t,e)=>({auth:t.auth,hostMe:t.host.me}),Fd=ve(Ad,{hostReviewsEvent:Qs})(Cs),As=({thisEvent:t,artistViewedHostOffer:e,deleteHostEvent:r,eventEditDrawer:n,host:o,myHostEvents:a,updateEventDate:s,auth:c,onCancelStarted:u})=>{const l=N=>!N||!N.bookingWhen?!1:new Date(N.bookingWhen)>new Date,f=N=>l(N)&&(N.createdBy==="HOST"&&N.status==="PENDING"||N.status==="CONFIRMED"),[h,_]=w.useState(!1),[b,S]=w.useState(null),[O,L]=w.useState(!1),I=Re(),{focused:y,releaseFocus:v}=bo(t&&t._id),k=N=>{const $=N&&N.bookingWhen?na(new Date(N.bookingWhen)):null;S($),L(!1),_(!0)},T=()=>{_(!1),S(null),L(!1)},U=N=>N?String(typeof N=="string"?N:N._id||N):null,H=N=>{const $=U(o.me?._id);return!$||!N.offersFromHosts?null:N.offersFromHosts.find(E=>U(E.host)===$)||null},M=N=>!!(N.createdBy!=="HOST"&&N.confirmedHost&&U(N.confirmedHost)===U(o.me?._id)),B=N=>{const $=U(o.me?._id);return!!(N.createdBy==="HOST"&&N.status==="CONFIRMED"&&$&&(U(N.confirmedHost)===$||H(N)))},re=N=>M(N)||B(N),K=t.status==="CONFIRMED"&&U(t.confirmedHost)===U(o.me?._id),ae=U(t.confirmedHost)===U(o.me?._id),R=Zs(t.attendanceVisibility),oe=Js.find(N=>N.value===R),pe=oe&&oe.shortLabel||"Invite-only",x=w.useRef(null),[p,g]=w.useState(0),[A,F]=w.useState(0);w.useEffect(()=>{g(x.current.offsetHeight),F(x.current.offsetWidth)},[]),w.useEffect(()=>{t._id===n&&x.current&&x.current.scrollIntoView({behavior:"smooth",block:"center"})},[n]),w.useEffect(()=>{const N=new URLSearchParams(I.search).get("eventID");if(!N||String(t._id)!==String(N))return;const $=setTimeout(()=>{x.current&&x.current.scrollIntoView({behavior:"smooth",block:"center"})},400);return()=>clearTimeout($)},[t._id,I.search,I.key]);const C=N=>!!H(N),G=()=>t.status!=="PENDING"||!C(t)?!1:!!(t.artist||t.preferredArtists&&t.preferredArtists.length>0),Z=()=>{if(t.artist&&t.artist.stageName)return`${t.artist.stageName} is still considering your offer.`;if(t.preferredArtists&&t.preferredArtists.length>0){const N=t.preferredArtists.length,$=t.declinedArtists?t.declinedArtists.length:0,E=N-$;if(E<=0)return"All of the artists declined your offer.";if(E<4){const de=t.declinedArtists?t.declinedArtists.map(ge=>ge.artist.toString()):[],me=t.preferredArtists.filter(ge=>!de.includes(ge._id.toString())).map(ge=>ge.stageName||"Unknown Artist");if(N===1)return`Waiting for ${t.preferredArtists[0].stageName||"the artist"} to respond.`;if(me.length===2)return`${me[0]} and ${me[1]} are still considering your offer.`;if(me.length===1)return`Waiting for ${me[0]||"the artist"} to respond.`;{const ge=me.pop();return`${me.join(", ")}, and ${ge} are still considering your offer.`}}else return`${E} artists are still considering your offer.`}return"Waiting for artist response."},X=H(t);
18return i.jsxs(i.Fragment,{children:[i.jsxs(m,{container:!0,item:!0,className:(t._id===n?"bookingWhen mostRecent":"bookingWhen")+(y?" notificationFocus":""),direction:"row",size:{xs:12,sm:12},id:t._id?String(t._id):void 0,ref:x,sx:{backgroundColor:"rgba(0,0,0,0.35)","&:hover":{},padding:"16px",margin:"4px",color:"var(--light-color)",justifyContent:"space-between",flexWrap:{xs:"wrap",sm:"nowrap"},position:"relative",backgroundImage:t.status==="DRAFT"?"repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 5px, rgba(255,255,255,.03) 15px, transparent 15px, transparent 30px)":t.status==="CANCELED"?"repeating-linear-gradient(45deg, rgb(255 0 0 / 10%) 5px, rgb(255 0 0 / 10%) 15px, transparent 15px, transparent 30px)":"none",border:t.status==="DRAFT"?"4px dashed var(--primary-color)!important":"1px solid transparent",maskImage:t.status==="CANCELED"?"radial-gradient(black 50%, transparent)":"none",opacity:t.status==="DRAFT"?"0.7":"1",flexDirection:t.status==="CONFIRMED"&&new Date(t.bookingWhen)<new Date?"column":"row"},children:[i.jsx("svg",{width:A,height:p,className:t.status==="DRAFT"?"eventCardSvgBorder eventDraft":"eventCardSvgBorder",style:{pointerEvents:"none"},children:i.jsx("polygon",{points:"0,"+p+" 0,0 "+A+",0 "+A+","+p,className:t._id===n?"borderEffect":"",style:{strokeDasharray:`${p*2} ${p*2+A*2}`,strokeDashoffset:t._id===n?`${p*2}`:`${p*2+A*3}`}})}),i.jsxs(m,{container:!0,item:!0,direction:"row",alignItems:"center",className:"dateLocationForBookingWrapper",sx:{margin:{xs:"10px auto",sm:"0px auto"},justifyContent:{xs:"center",sm:"space-evenly"},width:"100%"},size:{xs:12},children:[t.artist&&t.artist.squareImg&&t.artist.slug&&i.jsx(m,{className:"feoyAvatarGridItem",item:!0,sx:{flexBasis:{xs:"80px",sm:"130px"},flexShrink:"3",flexGrow:"2"},children:i.jsx(Me,{to:"/artists/"+t.artist.slug,className:"feoyartist"+t.artist._id+t._id,children:i.jsx(Ne,{title:t.artist&&t.artist.stageName+" accepted your offer.",arrow:!0,placement:"bottom",disableHoverListener:!M(t),disableFocusListener:!M(t),disableTouchListener:!M(t),children:i.jsx(se,{className:"squareImgInACircle",sx:{height:"auto",width:"auto",maxHeight:"130px",maxWidth:"130px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${t.artist&&t.artist.squareImg}")`,backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:M(t)?"1px solid var(--link-color)":"1px solid var(--primary-color)",margin:{xs:"auto",sm:"0 8px 0 0"},aspectRatio:"1 / 1"}})})})}),t.preferredArtists&&t.preferredArtists.length>0&&i.jsx(m,{item:!0,sx:{width:"130px",height:"130px",display:"flex",flexWrap:"wrap",flexDirection:"row",margin:"0 8px 0 0",justifyContent:"space-around",alignContent:"space-evenly"},className:"preferredArtistsWrapper",children:t.preferredArtists.map(N=>{let $=130/t.preferredArtists.length-4*(t.preferredArtists.length-1),E=!1;t.confirmedArtist&&(t.confirmedArtist===N._id||t.confirmedArtist._id===N._id)&&(E=!0);let de=!1;if(t.declinedArtists&&t.declinedArtists.length>-1&&(de=t.declinedArtists.filter(me=>me.artist===N._id).length>0),t.preferredArtists.length>2){const me=Math.sqrt(t.preferredArtists.length),ge=Math.ceil(me);$=130/ge-4*(ge-1)}return i.jsx(w.Fragment,{children:i.jsx(Ne,{title:!E&&!de&&t.status!=="DRAFT"?"Havenât heard from "+N.stageName+".":E===!0?N.stageName+" accepted your offer.":de===!0?N.stageName+" declined your offer.":N.stageName,placement:"bottom",arrow:!0,children:i.jsx(se,{className:"squareImgInACircle",sx:{display:"flex",width:$+"px",height:$+"px",maxHeight:$+"px",maxWidth:$+"px",borderRadius:"50%",overflow:"hidden",backgroundImage:`url("${N.squareImg}")`,backgroundBlendMode:E?"normal":"soft-light",filter:de?"grayscale(100%)":"",backgroundColor:"rgba(0,0,0,0.5)",backgroundPosition:"50% 25%",backgroundSize:"cover",padding:"4px",backgroundClip:"content-box",border:E?"1px solid var(--link-color)":de?"1px solid #777":"1px dashed var(--primary-color)",justifyContent:"center",alignItems:"center",aspectRatio:"1 / 1"},children:!E&&!de?i.jsx(Y,{sx:{fontFamily:"Tahoma",margin:"auto",fontSize:$*.8+"px",opacity:".2",lineHeight:"1",textShadow:"0 0 5px rgba(0,0,0,1), 0 0 5px rgba(0,0,0,1), 0 0 5px rgba(0,0,0,1);",cursor:"default",width:"100%",textAlign:"center",borderRadius:"100%"},children:"?"}):i.jsx(Y,{sx:{fontFamily:"Tahoma",margin:"auto",fontSize:$*.8+"px",opacity:".2",lineHeight:"1",textShadow:"0 0 5px rgba(0,0,0,1), 0 0 5px rgba(0,0,0,1), 0 0 5px rgba(0,0,0,1);",cursor:"default",width:"100%",textAlign:"center",borderRadius:"100%"}})})})},"preffedArtistFragment"+N._id+t._id)})}
18),i.jsxs(m,{container:!0,item:!0,direction:"column",alignItems:"flex-start",className:"dateLocationForBooking",sx:{flexBasis:{sm:t.confirmedHost?"calc(100% - 150px - 25px)":"calc(100% - 150px)",xs:"none"},flexGrow:"1"},children:[i.jsx(m,{item:!0,container:!0,children:i.jsx(Me,{to:"/artists/"+(t.artist&&t.artist.slug),children:i.jsx(Y,{component:"h2",children:t.artist&&t.artist.stageName})})}),i.jsxs(m,{container:!0,item:!0,className:"feoyDateLocation",sx:{flexWrap:"nowrap"},size:{xs:12},children:[i.jsx(m,{item:!0,className:"dateGrid",children:i.jsxs(se,{sx:{position:"relative",display:"inline-block","&:hover .dateEditBtn":{opacity:1,pointerEvents:"auto"}},className:"dateBox",children:[i.jsx(et,{date:t.bookingWhen}),f(t)&&i.jsx(Ne,{title:"Change the date",placement:"top",arrow:!0,children:i.jsx(St,{size:"large",onClick:()=>k(t),className:"dateEditBtn",sx:{position:"absolute",inset:0,width:"100%",height:"100%",zIndex:2,borderRadius:"0px",p:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.25)","&:hover":{backgroundColor:"rgba(0,0,0,0.45)"},opacity:0,pointerEvents:"none",transition:"opacity 150ms ease-in-out"},children:i.jsx(Xa,{fontSize:"large"})})})]})}),i.jsxs(m,{item:!0,className:"locationGridItem",size:{xs:t.artist&&t.artist.squareImg?10:11},sx:{marginLeft:"8px"},children:[i.jsxs(m,{item:!0,sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap",minWidth:0},size:{xs:12},className:"locationCityStateGridItem",children:[i.jsx(se,{component:"span",sx:{fontSize:{xs:"1.2em",sm:"1.5em"},lineHeight:"1.5"},children:t.bookingWhere.city+", "+t.bookingWhere.state}),ae&&t.status!=="CANCELED"&&i.jsx(Ne,{title:ea(R),placement:"bottom",arrow:!0,children:i.jsx(mo,{variant:"outlined",color:"warning",size:"small",icon:i.jsx(_o,{fontSize:"small"}),label:pe,sx:{fontFamily:"var(--secondary-font)",height:"24px",flexShrink:0}})})]}),t.createdBy==="HOST"&&t.status==="DRAFT"&&i.jsx(m,{item:!0,container:!0,children:i.jsx(ta,{theEvent:t})}),t.createdBy==="HOST"&&t.status!="DRAFT"&&i.jsxs(m,{item:!0,container:!0,sx:{gap:"8px"},children:[i.jsx(Ln,{theHost:o.me,theEvent:t,theOffer:t.offersFromHosts[0],children:i.jsx(ee,{btnwidth:"200",children:"CONCERT DETAILS"})}),t.status==="CONFIRMED"&&re(t)&&i.jsx(Me,{to:`/events/${t._id}`,style:{textDecoration:"none"},children:i.jsx(ee,{btnwidth:"160",children:"Event Page"})}),K&&i.jsx($n,{theEvent:t})]}),t.createdBy==="ARTIST"&&i.jsxs(m,{item:!0,container:!0,sx:{gap:"8px"},children:[i.jsx(Ln,{theHost:o.me,theEvent:t,theOffer:X,children:i.jsx(ee,{btnwidth:"200",children:"CONCERT DETAILS"})}),t.status==="CONFIRMED"&&re(t)&&i.jsx(Me,{to:`/events/${t._id}`,style:{textDecoration:"none"},children:i.jsx(ee,{btnwidth:"160",children:"Event Page"})}),K&&i.jsx($n,{theEvent:t})]})]})]})]}),M(t)||B(t)?i.jsx(m,{item:!0,alignContent:"center",container:!0,size:{xs:.5},className:"confirmedThumbUp",sx:{zIndex:"10"},children:i.jsx(Ne,{title:t.artist&&t.artist.stageName?t.artist.stageName+" accepted your offer.":"Confirmed",placement:"bottom",arrow:!0,children:i.jsx(Na,{sx:{color:"var(--link-color)"}})})}):t.createdBy!=="HOST"&&t.confirmedHost&&!M(t)&&i.jsx(m,{item:!0,alignContent:"center",container:!0,sx:{flexBasis:"25px",flexGrow:"0",marginLeft:"8px"},style:{zIndex:"5"},children:i.jsx(Ne,{title:(t.artist&&t.artist.stageName)+" accepted a different hostâs offer.",placement:"bottom",arrow:!0,children:i.jsx(Fa,{sx:{color:"var(--primary-color)"}})})}),G()&&i.jsx(m,{item:!0,sx:{position:"absolute",top:"5px",right:"5px",color:"var(--primary-color)",padding:"2px 8px",fontSize:"11px",zIndex:10},children:Z()})]}),t.status==="DRAFT"&&!t.artist&&i.jsxs(m,{container:!0,item:!0,flexDirection:{xs:"row-reverse",sm:"column"},flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",size:{xs:12,sm:1},className:"draftEventStuff",children:[i.jsx(m,{item:!0,className:"deleteBtn",style:{justifyContent:"center"},children:i.jsx(St,{onClick:N=>r(t._id),size:"large",children:i.jsx(bn,{})})}),i.jsxs(m,{item:!0,className:"warningIcon",style:{color:"var(--primary-color)",justifyContent:"center",zIndex:"5"},children:[i.jsx(Ne,{arrow:!0,placement:"bottom",title:i.jsx(i.Fragment,{children:i.jsx("div",{style:{textAlign:"center"},children:`This offer is still a DRAFT and has not been sent to ${t.preferredArtists.length>1?"the artists":t.preferredArtists[0]&&t.preferredArtists[0].stageName?t.preferredArtists[0].stageName:"the artist"}, yet.`})}),children:i.jsx(vo,{})}
18),i.jsx(se,{className:"draftEventWarning",sx:{display:{xs:"inline",sm:"none"},textAlign:"center",marginLeft:"5px",fontSize:"11px"},children:`This offer is still a DRAFT and has not been sent to ${t.preferredArtists.length>1?"the artists":t.preferredArtists[0]&&t.preferredArtists[0].stageName?t.preferredArtists[0].stageName:"the artist"}, yet.`})]})]}),t.status==="CONFIRMED"&&new Date(t.bookingWhen)<new Date&&i.jsx(Fd,{theEvent:t,onNotificationDialogClose:v}),i.jsx(Mr,{theEvent:t,canceledBy:"HOST",onCancelStarted:u}),t.status==="CANCELED"&&t.canceledDate&&i.jsxs(Y,{component:"p",sx:{color:"var(--red)",fontSize:"10px",position:"absolute",bottom:"5px",left:"50%",transform:"translateX(-50%)",textAlign:"center"},children:["Canceled on:"," ",new Date(t.canceledDate).toLocaleDateString(void 0,{year:"numeric",month:"numeric",day:"numeric",timeZone:"UTC"})]})]}),i.jsxs(wt,{open:h,onClose:T,fullWidth:!0,maxWidth:"xs",className:"porchlightBG",children:[i.jsx(ho,{children:"Change the date"}),i.jsxs(jt,{children:[i.jsx(go,{dateAdapter:xo,children:i.jsx(yo,{disablePast:!0,value:b,onChange:N=>{S(N)},shouldDisableDate:N=>{if(!Array.isArray(a))return!1;const $=N&&typeof N.toDate=="function"?N.toDate().toISOString():new Date(N).toISOString(),E=t&&t.bookingWhen?new Date(t.bookingWhen).toISOString():"";return a.filter(de=>de.status!=="CANCELED").some(de=>de.bookingWhen===$&&$!==E)}})}),t.status==="CONFIRMED"&&t.confirmedArtist&&i.jsxs(se,{sx:{mt:2,display:"flex",alignItems:"center"},children:[i.jsx(fo,{src:t?.confirmedArtist?.squareImg,alt:t?.confirmedArtist?.stageName,sx:{width:40,height:40,mr:1}}),i.jsxs(Y,{component:"p",sx:{color:"var(--primary-color)"},children:["Please confirm youâve reached out to"," ",t?.confirmedArtist?.stageName," to discuss this change. An email will be sent to anyone who needs to know about the change."]})]}),t.status==="CONFIRMED"&&i.jsx(le,{sx:{mt:1},control:i.jsx(ra,{checked:O,onChange:N=>L(N.target.checked)}),label:`Yes, Iâve reached out to ${t?.confirmedArtist?.stageName||"the artist"} about this change.`})]}),i.jsxs(po,{sx:{justifyContent:"center"},children:[i.jsx(ee,{onClick:T,children:"Cancel"}),i.jsx(ee,{onClick:()=>{if(b&&b.isValid?.()){const N=b.toDate().toISOString(),$=t.status==="CONFIRMED";s(t._id,N,{notify:$,hostContacted:O})}T()},disabled:!b||!b.isValid?.()||t.status==="CONFIRMED"&&!O,variant:"contained",children:"Save"})]})]})]})};As.propTypes={thisEvent:P.object.isRequired,artistViewedHostOffer:P.func.isRequired,deleteHostEvent:P.func.isRequired,eventEditDrawer:P.string,host:P.object.isRequired,myHostEvents:P.array,auth:P.object,onCancelStarted:P.func};const Od=t=>({eventEditDrawer:t.app.eventEditDrawer,host:t.host,myHostEvents:t.event&&t.event.myHostEvents,auth:t.auth}),ar=ve(Od,{artistViewedHostOffer:hn,deleteHostEvent:oa,updateEventDate:ia})(As),Fs=({hostMe:t,myArtistEvents:e,iConfirmed:r})=>{const n=Re(),[o,a]=w.useState(!1),[s,c]=w.useState(!1),u=new Date;u.setDate(u.getDate()-2);const l=S=>S.confirmedHost&&S.status==="CONFIRMED"&&r(S)&&new Date(S.bookingWhen)<u,f=(Array.isArray(e)?e:[]).filter(l).sort((S,O)=>{const L=new Date(S?.bookingWhen||0).getTime();return new Date(O?.bookingWhen||0).getTime()-L}),h=new URLSearchParams(n.search).get("eventID"),_=!!h&&f.some(S=>String(S._id)===String(h)),b=s?!1:!!(o||_);return w.useEffect(()=>{e&&e.length>0&&e.forEach(S=>{e.filter(O=>l(O)&&(!O.artistReviewOfHost||!O.artistReviewOfHost._id)).length>0&&a(!0)})},[e]),w.useEffect(()=>{const S=new URLSearchParams(n.search).get("eventID");if(!S||!e||e.length===0)return;e.some(L=>l(L)&&String(L._id)===String(S))&&(a(!0),c(!1))},[n.search,e]),i.jsx(i.Fragment,{children:f.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Y,{onClick:()=>{b?(c(!0),a(!1)):(c(!1),a(!0))},sx:{color:"var(--link-color)",cursor:"pointer",margin:b?"16px 16px 0px 16px":"16px 16px 16px 16px",textAlign:"center",transition:"margin 0.3s ease-in-out"},children:b?"Hide Past Events":"Show Past Events"}),i.jsx(Ue,{in:b,timeout:300,sx:{overflow:"visible","& .MuiCollapse-wrapper":{overflow:"visible"},"& .MuiCollapse-wrapperInner":{overflow:"visible"}}
18,children:i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px",marginTop:o?"0px":"-20px",transition:"margin 0.3s ease-in-out"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",children:[f.length>1?`You booked these ${f.length} concerts, in the past`:"You booked this concert, in the past",":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"}}),f.map((S,O)=>S.bookingWhen&&S.bookingWhere&&i.jsx(st,{thisEvent:S},O))]})})]})})};Fs.propTypes={artist:P.object,myArtistEvents:P.array,iConfirmed:P.func.isRequired};const Rd=t=>({artist:t.artist,myArtistEvents:t.event.myArtistEvents}),Pd=ve(Rd,{})(Fs),Os=({hostMe:t,myHostEvents:e})=>{const r=Re(),[n,o]=w.useState(!1),[a,s]=w.useState(!1),c=new Date;c.setDate(c.getDate()-2);const u=b=>b.confirmedHost&&b.status==="CONFIRMED"&&new Date(b.bookingWhen)<c,l=(Array.isArray(e)?e:[]).filter(u).sort((b,S)=>{const O=new Date(b?.bookingWhen||0).getTime();return new Date(S?.bookingWhen||0).getTime()-O}
18),f=new URLSearchParams(r.search).get("eventID"),h=!!f&&l.some(b=>String(b._id)===String(f)),_=a?!1:!!(n||h);return w.useEffect(()=>{e&&e.length>0&&e.forEach(b=>{e.filter(S=>u(S)&&(!S.hostReviewOfEvent||!S.hostReviewOfEvent._id)).length>0&&o(!0)})},[e]),w.useEffect(()=>{const b=new URLSearchParams(r.search).get("eventID");if(!b||!e||e.length===0)return;e.some(O=>u(O)&&String(O._id)===String(b))&&(o(!0),s(!1))},[r.search,e]),i.jsx(i.Fragment,{children:l.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Y,{onClick:()=>{_?(s(!0),o(!1)):(s(!1),o(!0))},sx:{color:"var(--link-color)",cursor:"pointer",margin:_?"16px 16px 0px 16px":"16px 16px 16px 16px",textAlign:"center",transition:"margin 0.3s ease-in-out"},children:_?"Hide Past Events":"Show Past Events"}),i.jsx(Ue,{in:_,timeout:300,sx:{overflow:"visible","& .MuiCollapse-wrapper":{overflow:"visible"},"& .MuiCollapse-wrapperInner":{overflow:"visible"}},children:i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px",marginTop:n?"0px":"-20px",transition:"margin 0.3s ease-in-out"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",children:[l.length>1?`You hosted these ${l.length} concerts, in the past`:"You hosted this concert, in the past",":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"}}),l.map((b,S)=>b.bookingWhen&&b.bookingWhere&&i.jsx(ar,{thisEvent:b},S))]})})]})})};Os.propTypes={host:P.object,myHostEvents:P.array};const Id=t=>({host:t.host,myHostEvents:t.event.myHostEvents}),Nd=ve(Id,{})(Os),Rs=({hostMe:t,myHostEvents:e,recentlyCanceledIds:r,onAnimationComplete:n})=>{const[o,a]=w.useState(!1);return w.useEffect(()=>{e&&e.length>0&&e.forEach(s=>{e.filter(c=>c.confirmedHost&&c.status==="CANCELED").length>0&&a(!0)})},[e]),w.useEffect(()=>{Array.isArray(r)&&r.length>0&&a(!0)},[r]),i.jsx(i.Fragment,{children:e&&e.length>0&&e.filter(s=>s.confirmedHost&&s.status==="CANCELED").length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Y,{onClick:()=>a(!o),sx:{color:"var(--link-color)",cursor:"pointer",margin:o?"16px 16px 0px 16px":"16px 16px 16px 16px",textAlign:"center"},children:o?"Hide Canceled Events":"Show Canceled Events"}),i.jsx(Ue,{in:o,timeout:300,children:i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px",marginTop:o?"0px":"-20px",transition:"margin 0.3s ease-in-out"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",children:[e.filter(s=>s.confirmedHost&&s.status==="CANCELED").length>1?`These ${e.filter(s=>s.confirmedHost&&s.status==="CANCELED").length} concerts got canceled`:"This concert got canceled",":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"},children:e.filter(s=>s.confirmedHost&&s.status==="CANCELED").sort((s,c)=>{const u=new Date(s?.bookingWhen||0).getTime();return new Date(c?.bookingWhen||0).getTime()-u}).map((s,c)=>s.bookingWhen&&s.bookingWhere&&i.jsx(ur,{eventId:s._id,isArriving:Array.isArray(r)&&r.includes(s._id),onAnimationComplete:n,children:i.jsx(ar,{thisEvent:s})},s&&s._id||c))})]})})]})})};Rs.propTypes={host:P.object,myHostEvents:P.array,recentlyCanceledIds:P.array,onAnimationComplete:P.func};const Dd=t=>({host:t.host,myHostEvents:t.event.myHostEvents}),Ud=ve(Dd,{})(Rs),Je=t=>t?.event?typeof t.event=="object"?t.event._id?String(t.event._id):null:String(t.event):null,In=t=>!!(t?.event&&typeof t.event=="object"&&t.event.status==="CANCELED"),Ps=({invitedEvents:t})=>{const e=Re(),[r,n]=w.useState(!1),o=(t||[]).filter(In).sort((a,s)=>{const c=a?.event&&typeof a.event=="object"?a.event.bookingWhen:null,u=s?.event&&typeof s.event=="object"?s.event.bookingWhen:null;return new Date(u||0).getTime()-new Date(c||0).getTime()});return w.useEffect(()=>{o.length>0&&n(!0)},[o.length]),w.useEffect(()=>{const a=new URLSearchParams(e.search).get("eventID");if(!a||o.length===0)return;o.some(c=>String(Je(c))===String(a))&&n(!0)},[e.search,t]),o.length===0?null:i.jsxs(i.Fragment,{children:[i.jsx(Y,{onClick:()=>n(!r),sx:{color:"var(--link-color)",cursor:"pointer",margin:r?"16px 16px 0px 16px":"16px 16px 16px 16px",textAlign:"center"},children:r?"Hide Canceled Events":"Show Canceled Events"}
18),i.jsx(Ue,{in:r,timeout:300,children:i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px",marginTop:r?"0px":"-20px",transition:"margin 0.3s ease-in-out"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",sx:{color:"var(--red)!important"},children:[o.length>1?`These ${o.length} concerts got canceled`:"This concert got canceled",":"]})}),o.map(a=>a?.event&&i.jsx(vt,{invite:a},Je(a)+(a.addedAt||"")))]})})]})};Ps.propTypes={invitedEvents:P.array};const Hd=t=>({invitedEvents:Array.isArray(t.attendee?.me?.invitedEvents)?t.attendee.me.invitedEvents:[]}),Ld=ve(Hd,{})(Ps),un=t=>t?.event&&typeof t.event=="object"?t.event.bookingWhen:null,$d=(t,e)=>{if(!t?.event||In(t))return!1;const r=un(t);return r?new Date(r)<e:!1},zd=(t,e)=>{const r=new Date(un(t)||0).getTime();return new Date(un(e)||0).getTime()-r},Is=({invitedEvents:t})=>{const e=Re(),[r,n]=w.useState(!1),[o,a]=w.useState(!1),s=new Date;s.setDate(s.getDate()-2);const c=(t||[]).filter(h=>$d(h,s)).sort(zd),u=new URLSearchParams(e.search).get("eventID"),l=!!u&&c.some(h=>String(Je(h))===String(u)),f=o?!1:!!(r||l);return w.useEffect(()=>{const h=new URLSearchParams(e.search).get("eventID");if(!h||c.length===0)return;c.some(b=>String(Je(b))===String(h))&&(n(!0),a(!1))},[e.search,t]),c.length===0?null:i.jsxs(i.Fragment,{children:[i.jsx(Y,{onClick:()=>{f?(a(!0),n(!1)):(a(!1),n(!0))},sx:{color:"var(--link-color)",cursor:"pointer",margin:f?"16px 16px 0px 16px":"16px 16px 16px 16px",textAlign:"center",transition:"margin 0.3s ease-in-out"},children:f?"Hide Past Events":"Show Past Events"}),i.jsx(Ue,{in:f,timeout:300,sx:{overflow:"visible","& .MuiCollapse-wrapper":{overflow:"visible"},"& .MuiCollapse-wrapperInner":{overflow:"visible"}},children:i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px",marginTop:r?"0px":"-20px",transition:"margin 0.3s ease-in-out"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",children:[c.length>1?`You were invited to these ${c.length} concerts, in the past`:"You were invited to this concert, in the past",":"]})}),c.map(h=>h?.event&&i.jsx(vt,{invite:h},Je(h)+(h.addedAt||"")))]})})]})};Is.propTypes={invitedEvents:P.array};const Bd=t=>({invitedEvents:Array.isArray(t.attendee?.me?.invitedEvents)?t.attendee.me.invitedEvents:[]}),Wd=ve(Bd,{})(Is),Ns=({resendVerificationEmail:t,auth:{user:e}})=>{const[r,n]=sa.useState(!1),o=async()=>{if(!r){n(!0);try{await t()}finally{n(!1)}}};return i.jsx(i.Fragment,{children:i.jsxs(m,{container:!0,item:!0,className:"activationPending",direction:{xs:"column",md:"row"},size:{xs:12},sx:{backgroundColor:"rgba(0,0,0,0.35)",padding:"16px",margin:"4px",color:"var(--light-color)",justifyContent:"center",alignItems:"center",position:"relative",backgroundImage:"repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 5px, rgba(255,255,255,.03) 15px, transparent 15px, transparent 30px)",border:"4px dashed var(--primary-color)",opacity:"0.9"},children:[i.jsxs(m,{container:!0,flexDirection:"row",sx:{alignItems:"center",flexWrap:"nowrap",justifyContent:"center"},children:[i.jsx(m,{item:!0,className:"warningIcon",style:{color:"var(--primary-color)",zIndex:"5",margin:"0 8px 0 0 "},children:i.jsx(vo,{})}),i.jsx(m,{item:!0,children:i.jsx(Y,{component:"p",sx:{textAlign:"center",color:"var(--primary-color)",textWrap:"balance"},children:e&&e.email?i.jsxs(i.Fragment,{children:["We sent a verification link to"," ",i.jsx("span",{style:{color:"var(--light-color)",opacity:.8},children:e.email}),". Please click the link in the email to verify your email address to unlock your account and continue."]}):"Please verify your email address to continue."})})]}),i.jsx(m,{item:!0,sx:{display:"flex",alignItems:"center",marginTop:"10px"},children:i.jsx(ee,{btnwidth:"250",onClick:o,disabled:r,children:r?"Sendingâ¦":"Resend Verification Email"})})]})})};Ns.propTypes={resendVerificationEmail:P.func.isRequired,auth:P.object.isRequired};const qd=t=>({auth:t.auth}),Md=ve(qd,{resendVerificationEmail:aa})(Ns),Ds=({hostMe:t,myArtistEvents:e,iConfirmed:r,recentlyCanceledIds:n=[],onAnimationComplete:o})=>{const[a,s]=w.useState(!1);w.useEffect(()=>{e&&e.length>0&&e.forEach(u=>{e.filter(l=>l.confirmedHost&&l.status==="CANCELED").length>0&&s(!0)})},[e]),w.useEffect(()=>{n&&n.length>0&&s(!0)},[n]);const c=new Date;return c.setDate(c.getDate()-2),i.jsx(i.Fragment,{children:e&&e.length>0&&e.filter(u=>u.confirmedHost&&u.status==="CANCELED").length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Y,{onClick:()=>s(!a),sx:{color:"var(--link-color)",cursor:"pointer",margin:a?"16px 16px 0px 16px":"16px 16px 16px 16px",textAlign:"center",transition:"margin 0.3s ease-in-out"},children:a?"Hide Canceled Events":"Show Canceled Events"}
18),i.jsx(Ue,{in:a,timeout:300,children:i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px",marginTop:a?"0px":"-20px",transition:"margin 0.3s ease-in-out"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",sx:{color:"var(--red)!important"},children:[e.filter(u=>u.confirmedHost&&u.status==="CANCELED").length>1?`These ${e.filter(u=>u.confirmedHost&&u.status==="CANCELED").length} concerts got canceled`:"This concert got canceled",":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"}}),e.filter(u=>u.confirmedHost&&u.status==="CANCELED").sort((u,l)=>{const f=new Date(u?.bookingWhen||0).getTime();return new Date(l?.bookingWhen||0).getTime()-f}).map((u,l)=>u.bookingWhen&&u.bookingWhere&&i.jsx(ur,{eventId:u._id,isArriving:n.includes(u._id),onAnimationComplete:o,children:i.jsx(st,{thisEvent:u})},u&&u._id||l))]})})]})})};Ds.propTypes={artist:P.object,myArtistEvents:P.array,iConfirmed:P.func.isRequired,recentlyCanceledIds:P.array,onAnimationComplete:P.func};const Ed=t=>({artist:t.artist,myArtistEvents:t.event.myArtistEvents}),Vd=ve(Ed,{})(Ds),Gd='<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2500 2500"><defs><style>.b{fill:#494949;}</style></defs><rect class="b" x="788.809" y="1500.382" width="301.185" height="302.469"/><path class="b" d="M1090.834,2424.282c-.531-2.046-.904-4.207-.903-6.648l.062-289.765-301.136-.028.153,213.814c94.891,40.284,196.142,68.376,301.825,82.627Z"/><rect class="b" x="1395.517" y="1493.392" width="301.127" height="302"/><path class="b" d="M1696.736,2347.66l-.117-227.571-301.077-.02.019,300.264c0,2.091-.449,3.942-.895,5.792,105.618-12.913,206.966-39.566,302.07-78.465Z"/><path class="b" d="M1250,73.875C597.921,73.875,69.306,602.49,69.306,1254.57c0,338.365,142.558,643.253,370.619,858.523l-.165-939.958,464.913-465.643,328.576-328.485c10.165-11.911,23.254-11.029,33.913-.36l785.309,786.067c5.896,5.902,7.752,11.486,7.752,20.062l-.019,928.192c227.985-215.263,370.489-520.099,370.489-858.399,0-652.08-528.615-1180.694-1180.694-1180.694Z"/></svg>',Yd=Gd.replace(/<\?xml[^?]*\?>\s*/,"").replace(/<defs>[\s\S]*?<\/defs>/,"").replace('<svg id="a"','<svg aria-hidden="true" focusable="false" width="24" height="24"').replaceAll(' class="b"',' fill="currentColor"');function Kd(){return i.jsx("span",{style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:Yd}})}function Xd(){return new URLSearchParams(Re().search)}function xt(t){const e=t?.role;return Array.isArray(e)?e:typeof e=="string"&&e.trim()?[e.trim()]:[]}function Wr(t){return t.filter(e=>["ARTIST","HOST","ATTENDEE"].includes(e))}function qr(t){return!t||t.length===0?"":t.length===1?t[0]:["ARTIST","HOST","ATTENDEE"].find(e=>t.includes(e))||t[0]}const Us=({changeHats:t,deleteAccount:e,auth:{user:r,loading:n},event:{myHostEvents:o,myArtistEvents:a,nearMeToHost:s,discoverableEvents:c},getCurrentArtist:u,artist:l,getCurrentHost:f,host:h,attendee:_,app:b,getEventsNearMeToHost:S,getMyArtistEventsOffers:O,getCurrentAttendee:L,getDiscoverableEvents:I,updateEventDiscoveryRadius:y,closeEventEditDrawer:v})=>{const[k,T]=w.useState(!1),[U,H]=w.useState(40),[M,B]=w.useState([]),[re,K]=w.useState([]),ae=d=>{d&&B(D=>D.includes(d)?D:[...D,d])},R=d=>{d&&K(D=>D.includes(d)?D:[...D,d])},oe=d=>{d&&(typeof v=="function"&&v(d),B(D=>D.filter(z=>z!==d)),K(D=>D.filter(z=>z!==d)))},pe=Xd(),x=Re(),p=pe.get("hat"),g=pe.get("eventID"),A=w.useRef(""),F=d=>!!(l&&l.me&&d&&d.confirmedArtist&&d.confirmedArtist===l.me._id||l&&l.me&&d&&d.artist&&d.artist===l.me._id);w.useEffect(()=>{const d=r?xt(r):[];if(!r||!d.includes("ATTENDEE"))return;const D=Wr(d);(b.profileHat&&D.includes(b.profileHat)?b.profileHat:qr(D))==="ATTENDEE"&&(L(),I())},[r,b.profileHat,L,I]),w.useEffect(()=>{const d=Number(_?.me?.eventDiscoveryRadius);Number.isFinite(d)&&d>0&&H(d)},[_?.me?.eventDiscoveryRadius]),w.useEffect(()=>{const d=r?xt(r):[];r&&d.includes("ARTIST")&&(u(),O())},[u,r]),w.useEffect(()=>{const d=r?xt(r):[];r&&d.includes("HOST")&&(f(),S())},[f,r]),w.useEffect(()=>{if(!r)return;const d=Wr(xt(r));if(d.length===0)return;const D=b.profileHat,z=!!(D&&d.includes(D)),J=!!(p&&d.includes(p)),ye=x.state&&(x.state.openedAt||x.state.fromNotification)||x.search||"";if(J&&A.current!==String(ye)){A.current=String(ye),D!==p&&t(p);return}if(d.length===1){D!==d[0]&&t(d[0]);return}z||t(qr(d))},[r,b.profileHat,t,p,x.state,x.search]);const C=new Date;C.setDate(C.getDate()-2);const G=d=>new Date(d)>=C,Z=()=>
18{if(!r)return!1;const d=r.verifiedEmail;if(!d)return!1;const D=new Date(d).getTime();return!isNaN(D)},X=h&&h.me&&h.me._id,N=xt(r),$=Wr(N),E=b.profileHat&&$.includes(b.profileHat)?b.profileHat:qr($),de=Array.isArray(_?.me?.invitedEvents)?_.me.invitedEvents:[],me=d=>d?.event&&typeof d.event=="object"?d.event.bookingWhen:null,ge=(d,D)=>{const z=new Date(d||0).getTime(),J=new Date(D||0).getTime();return z-J},Ge=de.filter(d=>d?.event&&!In(d)),He=Ge.filter(d=>{const D=me(d);return!D||G(D)}).sort((d,D)=>ge(me(d),me(D))),Le=new Set(Ge.map(d=>Je(d)).filter(Boolean).map(d=>String(d))),xe=Array.isArray(c)?c:[],Pe=xe.filter(d=>{const D=d&&d._id?String(d._id):"";return d?.attendanceVisibility==="VERIFIED"&&D&&!Le.has(D)}).sort((d,D)=>ge(d?.bookingWhen,D?.bookingWhen)),Te=xe.filter(d=>{const D=d&&d._id?String(d._id):"";return d?.attendanceVisibility==="PUBLIC"&&D&&!Le.has(D)}).sort((d,D)=>ge(d?.bookingWhen,D?.bookingWhen)),$e=_?.me?.latLong&&Array.isArray(_.me.latLong.coordinates)&&_.me.latLong.coordinates.length===2&&!(Number(_.me.latLong.coordinates[0])===0&&Number(_.me.latLong.coordinates[1])===0),_e=xe.filter(d=>{const D=d?.mapLocation?.coordinates;return d.status!=="CANCELED"&&Array.isArray(D)&&D.length===2&&Number.isFinite(Number(D[0]))&&Number.isFinite(Number(D[1]))&&!(Number(D[0])===0&&Number(D[1])===0)}).map(d=>{const D=d.confirmedArtist||d.artist||{};return{_id:d._id,slug:D.slug||String(d._id),stageName:D.stageName,squareImg:D.squareImg,city:d.bookingWhere?.city,state:d.bookingWhere?.state,zipCode:d.bookingWhere?.zipCode,bookingWhen:d.bookingWhen,latLong:d.mapLocation}}),he=Array.isArray(s)?s.filter(d=>!k||!X||!d||!d.declinedHosts||d.declinedHosts.length===0?!0:d.declinedHosts.every(D=>!D||!D.host||D.host!==X)):[],Ke=d=>!X||!d||!d.declinedHosts||d.declinedHosts.length===0?!1:d.declinedHosts.some(D=>D&&D.host&&D.host===X);w.useEffect(()=>{if(!g||p&&E!==p)return;let d=!1,D=0;const z=30,J=()=>{if(d)return!0;const Ce=document.getElementById(String(g));return!Ce||Ce.getBoundingClientRect().height<8?!1:(Ce.scrollIntoView({behavior:"smooth",block:"center"}),!0)};if(J())return()=>{d=!0};const ye=setInterval(()=>{D+=1,(J()||D>=z)&&clearInterval(ye)},120);return()=>{d=!0,clearInterval(ye)}},[g,p,E,x.key,x.state,s,de,o,a]);const Ie=d=>h.me&&h.me._id&&d.offersFromHosts&&d.offersFromHosts.some(D=>D.host&&(typeof D.host=="string"?D.host:D.host._id)===h.me._id),be=d=>(d.confirmedHost&&(d.status==="CONFIRMED"||d.status==="PENDING")||d.status==="PENDING"&&Ie(d))&&G(d.bookingWhen);return n&&r===null?i.jsx(la,{}):r&&!Z()?i.jsx(w.Fragment,{children:i.jsx(m,{container:!0,justifyContent:"center",alignItems:"start",sx:{minHeight:"80vh",padding:"20px!important",width:"100vw",maxWidth:"100vw",margin:"0 auto",flexDirection:{xs:"column",md:"row"}},children:i.jsx(m,{item:!0,container:!0,direction:"column",className:"middle",size:{xs:12,md:6},sx:{padding:{xs:"0",md:"0 20px"},width:{xs:"100%",md:"75%"},maxWidth:{md:"750px"}},children:i.jsx(Md,{})})})}):i.jsx(w.Fragment,{children:i.jsxs(m,{container:!0,justifyContent:"center",alignItems:"start",sx:{minHeight:"80vh",padding:"20px!important",width:"100vw",maxWidth:"100vw",margin:"0 auto",flexDirection:{xs:"column",md:"row"}},children:[i.jsxs(m,{item:!0,container:!0,direction:"column",className:"leftSide",size:{xs:12,md:3},sx:{flex:1,maxWidth:{md:"25%",xs:"100%"}},children:[i.jsxs(m,{item:!0,container:!0,direction:"column",className:"welcomeSection",children:[i.jsx(m,{item:!0,textAlign:"center",children:i.jsxs(Y,{component:"h2",children:["Welcome to your Porchlight Dashboard",r&&r.name?", "+r.name.split(" ")[0]+"!":"!"]})}),i.jsx(m,{item:!0,sx:{margin:"8px auto"},children:i.jsx("p",{className:"welcomeNote",children:E==="ARTIST"?"Weâre excited to connect you to our growing network of amazing hosts. Make sure you check out the musician guide (below). Thanks for joining us in this mission to curate profound experiences and relationships around the true and beautiful.":E==="HOST"?"Weâre honored to serve you as you host profound experiences and develop relationships around the true and beautiful.":"For now, weâll notify you about once a month about upcoming Porchlight events and opportunities. Soon, youâll be able to view upcoming local Porchlight events right on your dashboard. If you ever decide youâd like to host a Porchlight event, just sign up to host below!"})})]}),$.length>1&&i.jsxs(m,{item:!0,container:!0,className:"changeProfileHat",children:[i.jsxs(Y,{component:"p",children:["It looks like you have multiple Porchlight hats. Youâre currently viewing your"," ",i.jsx("span",{style:{fontWeight:"bold",color:"var(--light-color)"},children:E})," ","stuff. Switch hats to see your other stuff."]}),i.jsx(m,{item:!0,container:!0,spacing:1,justifyContent:"center",sx:{margin:"8px auto 8px"},children:$.filter(d=>d!==E).map(d=>i.jsx(m,{item:!0,children:i.jsxs(ee,{btnwidth:"250",onClick:()=>t(d),children:[i.jsx(Ua,{}),"Put on my ",d," hat"]})},d))})]}),E==="ARTIST"&&r&&N.includes("ARTIST")?i.jsx(m,{item:!0,container:!0,className:"artistStuff",size:{xs:12},children:l.me&&l.me._id?[i.jsx(m,{item:!0,sx:{margin:"8px auto"},children:i.jsx("a",{target:"_blank",href:"https://docs.google.com/document/d/1skxIQjIhEOs07k06ymmss1lMO-Q9Q4j8kI68Vc0u5hE/edit?usp=sharing",children:i.jsxs(ee,{btnwidth:"250",className:"",children:[i.jsx(zn,{})," Musician Guide"]})})}),i.jsxs(m,{className:"artistToolkit",item:!0,sx:{margin:"8px auto"},children:[i.jsx("p",{children:" "}),i.jsx("a",{target:"_blank",href:"https://drive.google.com/drive/u/0/folders/1Zl_BAAvia0G9xyyVKGPTadq08kNs3l9R",children:i.jsxs(ee,{btnwidth:"250",className:"",children:[i.jsx(Bn,{}),"Artist Toolkit"]})})]}),i.jsx(m,{item:!0,sx:{margin:"8px auto"},children:i.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://theneighborhood.digital/share/kJMmEOBZ5v14MMQ6?utm_source=manual",children:i.jsxs(ee,{btnwidth:"250",className:"",children:[i.jsx(Kd,{}),"The Neighborhood"]})})},"neighborhood"),i.jsx(m,{item:!0,sx:{margin:"8px auto"},children:i.jsx(Me,{to:"/edit-artist-profile",children:i.jsxs(ee,{btnwidth:"250",className:"",children:[i.jsx(Dn,{})," Edit My Artist Profile"]})})})]:i.jsxs(w.Fragment,{children:[i.jsx(m,{item:!0,sx:{margin:"8px auto"},children:i.jsx("p",{className:"",children:"Please make sure the information in your profile is always accurate and up-to-date. Your answers help us connect you with folks who want to host concerts in their space
18s."})}),i.jsxs(m,{item:!0,sx:{margin:"8px auto"},children:[i.jsx("p",{children:" "}),i.jsx(Me,{to:"/edit-artist-profile",children:i.jsxs(ee,{btnwidth:"250",className:"",children:[i.jsx(Un,{}),"Create My Profile"]})})]})]})}):i.jsx(i.Fragment,{}),E==="ATTENDEE"&&r&&r.role&&r.role.indexOf("ATTENDEE")!=-1&&i.jsx(m,{item:!0,container:!0,className:"attendeeStuff",children:r.role.indexOf("HOST")===-1&&i.jsxs(m,{item:!0,sx:{margin:"8px auto"},children:[i.jsx("p",{children:" "}),i.jsx(Me,{to:"/edit-host-profile",children:i.jsxs(ee,{btnwidth:"250",className:"",children:[i.jsx(Un,{}),"Sign Up to Host"]})})]})}),E==="HOST"&&r&&r.role&&r.role.indexOf("HOST")!=-1&&i.jsxs(i.Fragment,{children:[" ",i.jsx(m,{item:!0,sx:{margin:"8px auto"},className:"hostGuideBtn",children:i.jsx("a",{target:"_blank",href:"https://docs.google.com/document/d/10jINNrRtF1UCXpXnNS21b2riUUJAfnTBDfPG61bZSsk/edit?usp=sharing",children:i.jsxs(ee,{btnwidth:"250",children:[i.jsx(zn,{sx:{marginRight:"5px"}})," ","The Hosting Guide"]})})}),i.jsx(m,{item:!0,container:!0,className:"hostToolkit",children:i.jsxs(m,{item:!0,sx:{margin:"8px auto"},children:[i.jsx("p",{children:" "}),i.jsx("a",{target:"_blank",href:"https://drive.google.com/drive/u/0/folders/1WHzyTePAMnuJexj9_n7ht-vRo0AUA0vJ",children:i.jsxs(ee,{btnwidth:"250",className:"",children:[i.jsx(Bn,{}),"Host Toolkit"]})})]})})," ",i.jsx(m,{item:!0,container:!0,className:"hostStuff",children:i.jsxs(m,{item:!0,sx:{margin:"8px auto"},children:[i.jsx("p",{children:" "}),i.jsx(Me,{to:"/edit-host-profile",children:i.jsxs(ee,{btnwidth:"250",className:"",children:[i.jsx(Dn,{}),"Edit My Host Profile"]})})]})})]})]}),E==="ATTENDEE"&&r&&N.includes("ATTENDEE")&&i.jsx(m,{item:!0,container:!0,direction:"column",className:"middle",size:{xs:12,md:6},sx:{padding:{xs:"0",md:"0 20px"},width:{xs:"100%",md:"75%"},maxWidth:{md:"750px"}},children:i.jsxs(m,{item:!0,container:!0,className:"attendeeStuff artistStuff",size:{xs:12},direction:"column",children:[i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px"},children:[i.jsx(m,{item:!0,xs:12,children:i.jsx(Y,{component:"h2",children:"Concerts near you"})}),$e?xe.length===0?i.jsx(Y,{sx:{mt:1,opacity:.85},children:"Thereâs nothing to show right now."}):i.jsxs(m,{item:!0,sx:{display:"flex",alignItems:"baseline",gap:1,flexWrap:"wrap",mt:1},children:[i.jsx(Y,{component:"span",children:"Within a radius of"}),i.jsx(ie,{variant:"standard",type:"number",name:"eventDiscoveryRadius",value:U,onChange:d=>H(d.target.value),onBlur:async()=>{const d=Math.min(Math.max(Number(U)||40,1),500);H(d),d!==Number(_?.me?.eventDiscoveryRadius||40)&&(await y(d),I())},inputProps:{min:1,max:500,step:1},sx:{width:"72px"}}),i.jsx(Y,{component:"span",children:"miles"})]}):i.jsx(Y,{sx:{mt:1,opacity:.85},children:"Add your city to your attendee profile so we can show concerts within a mileage radius."}),_e.length>0&&i.jsx(ca,{markers:_e,radius:$e?Number(U)||40:void 0,circleCenter:$e?_.me.latLong:void 0,preferredArtists:[],offsetOverlapping:!0,mapHeight:"320px",zoom:$e?7:4.25,onPinClick:d=>{if(!d?._id)return;const D=document.getElementById(String(d._id));D&&D.scrollIntoView({behavior:"smooth",block:"center"})}})]}),He.length>0&&i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px"},children:[i.jsx(m,{item:!0,xs:12,children:i.jsxs(Y,{component:"h2",children:[He.length>1?`Youâve been invited to these ${He.length} concerts`:"Youâve been invited to this concert",":"]})}),He.map(d=>d?.event&&i.jsx(vt,{invite:d},Je(d)+(d.addedAt||"")))]}),Pe.length>0&&i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px"},children:[i.jsx(m,{item:!0,xs:12,children:i.jsx(Y,{component:"h2",children:"Open to verified attendees"})}),Pe.map(d=>i.jsx(vt,{event:d,invite:{event:d._id},showInvitedChip:!0},d._id))]}),Te.length>0&&i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px"},children:[i.jsx(m,{item:!0,xs:12,children:i.jsx(Y,{component:"h2",children:"Public concerts nearby"})}),Te.map(d=>i.jsx(vt,{event:d,invite:{event:d._id},showInvitedChip:!1},d._id))]}),i.jsx(Wd,{}),i.jsx(Ld,{})]})}),E==="ARTIST"&&r&&r.role&&r.role.indexOf("ARTIST")!=-1&&l.me&&l.me._id&&(l.me.active||Array.isArray(r.role)&&r.role.indexOf("ARTIST")!=-1&&r.role.indexOf("ADMIN")!=-1)&&i.jsx(m,{item:!0,container:!0,direction:"column",className:"middle",size:{xs:12,md:6},sx:{padding:{xs:"0",md:"0 20px"},width:{xs:"100%",md:"75%"},maxWidth:{md:"750px"}},children:i.jsxs(m,{item:!0,container:!0,className:"artistStuff",size:{xs:12},direction:"column",children:[a&&a.length>0&&a.filter(d=>
18(!d.confirmedHost||d.createdBy==="HOST"&&d.status==="PENDING")&&d.offersFromHosts&&d.offersFromHosts.length>0).length>0&&i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",children:[a.filter(d=>(!d.confirmedHost||d.createdBy==="HOST"&&d.status==="PENDING")&&d.offersFromHosts&&d.offersFromHosts.length>0).length>1?`These ${a.filter(d=>(!d.confirmedHost||d.createdBy==="HOST"&&d.status==="PENDING")&&d.offersFromHosts&&d.offersFromHosts.length>0).length} concerts have booking offers for you to consider`:`This concert has ${a.filter(d=>(!d.confirmedHost||d.createdBy==="HOST"&&d.status==="PENDING")&&d.offersFromHosts&&d.offersFromHosts.length>0)[0]&&a.filter(d=>(!d.confirmedHost||d.createdBy==="HOST"&&d.status==="PENDING")&&d.offersFromHosts&&d.offersFromHosts.length>0)[0].offersFromHosts&&a.filter(d=>(!d.confirmedHost||d.createdBy==="HOST"&&d.status==="PENDING")&&d.offersFromHosts&&d.offersFromHosts.length>0)[0].offersFromHosts.length>1?"booking offers":"a booking offer"} for you to consider`,":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"},children:a.filter(d=>(!d.confirmedHost||d.createdBy==="HOST"&&d.status==="PENDING")&&d.offersFromHosts&&d.offersFromHosts.length>0).map((d,D)=>d.bookingWhen&&d.bookingWhere&&i.jsx(st,{thisEvent:d},D))})]}),a&&a.length>0&&a.filter(d=>d.confirmedHost&&d.status==="CONFIRMED"&&F(d)&&new Date(d.bookingWhen)>C).length>0&&i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",children:[a.filter(d=>d.confirmedHost&&d.status==="CONFIRMED"&&F(d)&&new Date(d.bookingWhen)>C).length>1?`You booked these ${a.filter(d=>d.confirmedHost&&d.status==="CONFIRMED"&&F(d)&&new Date(d.bookingWhen)>C).length} upcoming concerts`:"You booked this upcoming concert",":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"}}),a.filter(d=>d.confirmedHost&&d.status==="CONFIRMED"&&F(d)&&new Date(d.bookingWhen)>C).map((d,D)=>d.bookingWhen&&d.bookingWhere&&i.jsx(Ue,{in:!re.includes(d._id),timeout:{enter:300,exit:350},unmountOnExit:!0,sx:{width:"100%"},children:i.jsx(st,{thisEvent:d,onCancelStarted:R})},d&&d._id||D))]}),a&&a.length>0&&a.filter(d=>d.confirmedHost&&d.status==="CONFIRMED"&&!F(d)&&new Date(d.bookingWhen)>C).length>0&&i.jsxs(m,{container:!0,direction:"column",sx:{marginBottom:"20px"},children:[i.jsx(m,{item:!0,children:i.jsxs(Y,{component:"h2",children:[a.filter(d=>d.confirmedHost&&d.status==="CONFIRMED"&&!F(d)&&new Date(d.bookingWhen)>C).length>1?`These ${a.filter(d=>d.confirmedHost&&d.status==="CONFIRMED"&&!F(d)&&new Date(d.bookingWhen)>C).length} concerts were booked by another artist`:"This concert was booked by another artist",":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"}}),a.filter(d=>d.confirmedHost&&d.status==="CONFIRMED"&&!F(d)&&new Date(d.bookingWhen)>C).map((d,D)=>d.bookingWhen&&d.bookingWhere&&i.jsx(st,{thisEvent:d},D))]}),a&&a.length>0&&a.filter(d=>d.offersFromHosts&&d.offersFromHosts.length===0).length>0&&i.jsxs(m,{container:!0,direction:"column",sx:{margin:"8px auto"},size:{xs:12},children:[i.jsx(m,{item:!0,size:{xs:12},children:i.jsxs(Y,{component:"h2",children:[a.filter(d=>d.offersFromHosts&&d.offersFromHosts.length===0).length>1?`These ${a.filter(d=>d.offersFromHosts&&d.offersFromHosts.length===0).length} concerts are waiting for a host`:"This concert is waiting for a host",":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"},size:{xs:12},children:a.filter(d=>d.offersFromHosts&&d.offersFromHosts.length===0).map((d,D)=>d.bookingWhen&&d.bookingWhere&&i.jsx(st,{thisEvent:d},D))})]}),i.jsx(Pd,{iConfirmed:F}),i.jsx(m,{item:!0,sx:{margin:"40px auto"},children:i.jsx(Ka,{iConfirmed:F})}),i.jsx(Vd,{iConfirmed:F,recentlyCanceledIds:re,onAnimationComplete:oe})]})}),E==="HOST"&&r&&r.role&&r.role.indexOf("HOST")!=-1&&i.jsxs(m,{item:!0,container:!0,direction:"column",className:"middle",size:{xs:12,md:6},sx:{padding:{xs:"0",md:"0 20px"},width:{xs:"100%",md:"75%"},maxWidth:{md:"750px"}},children:[o&&o.length>0&&o.filter(d=>d.confirmedHost&&d.status==="DRAFT"&&G(d.bookingWhen)).length>0&&i.jsxs(m,{item:!0,container:!0,direction:"column",size:{xs:12,md:12},className:"DRAFTs",children:[i.jsx(m,{item:!0,size:{xs:12},children:i.jsxs(Y,{component:"h2",children:[o.filter(d=>d.confirmedHost&&d.status==="DRAFT"&&G(d.bookingWhen)).length>1?`These ${o.filter(d=>d.confirmedHost&&d.status==="DRAFT"&&G(d.bookingWhen)).length} offers have`:"This offer has"," ","NOT been sent yet:"]}
18)}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"}}),o.filter(d=>d).map((d,D,z)=>d.bookingWhen&&d.bookingWhere&&d.status==="DRAFT"&&G(d.bookingWhen)&&i.jsx(ar,{thisEvent:d},D))]}),o&&o.length>0&&o.filter(be).length>0&&i.jsxs(m,{item:!0,container:!0,direction:"column",size:{xs:12,md:12},children:[i.jsx(m,{item:!0,size:{xs:12},children:i.jsxs(Y,{component:"h2",children:["You have offered to host"," ",o.filter(be).length>1?`these ${o.filter(be).length} concerts`:"this concert",":"]})}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"}}),o.filter(d=>d).map((d,D,z)=>be(d)&&i.jsx(Ue,{in:!re.includes(d._id),timeout:{enter:300,exit:350},unmountOnExit:!0,sx:{width:"100%"},children:i.jsx(ur,{eventId:d._id,isArriving:M.includes(d._id),onAnimationComplete:oe,children:i.jsx(ar,{thisEvent:d,onCancelStarted:R})})},d&&d._id||D))]}),Array.isArray(r.role)&&r.role.indexOf("HOST")!=-1&&h.me&&h.me.adminActive&&i.jsx(m,{item:!0,sx:{margin:"40px auto"},children:i.jsx(Ga,{})}),h&&h.me&&h.me.adminActive!=!0&&i.jsx(m,{className:"adminActiveFalse",container:!0,sx:{marginBottom:"16px"},children:i.jsx(ua,{})}),s&&s.length>0&&i.jsxs(m,{item:!0,container:!0,direction:"column",size:{xs:12,md:12},children:[i.jsxs(m,{item:!0,container:!0,size:{xs:12},alignItems:"center",justifyContent:"space-between",children:[i.jsxs(Y,{component:"h2",children:[he.length>1?`There are these ${he.length} potential events `:he.length===0?"There arenât any other events ":`There is this ${he.length} potential event `,"looking to be hosted in your area:"]}),i.jsx(Ne,{arrow:!0,placement:"left",title:k?"Show declined events":"Hide declined events",children:i.jsx(St,{size:"small",onClick:()=>T(d=>!d),sx:{color:"var(--primary-color)"},children:k?i.jsx(Aa,{}):i.jsx(_o,{})})})]}),i.jsx(m,{container:!0,className:"whenBooking",direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{margin:"0px auto 16px",width:"100%"}}),(Array.isArray(s)?s:[]).filter(d=>d).map((d,D,z)=>{const J=k&&Ke(d),ye=M.includes(d._id),Ce=J||ye;return i.jsx(Ue,{in:!Ce,timeout:{enter:250,exit:300},unmountOnExit:!0,sx:{width:"100%"},children:d.bookingWhen&&d.bookingWhere&&i.jsx(Oa,{thisEvent:d,idx:D,onHostOfferStarted:ae},d&&d._id||D)},d&&d._id||D)})]}),i.jsx(Nd,{iConfirmed:F}),i.jsx(Ud,{iConfirmed:F,recentlyCanceledIds:re,onAnimationComplete:oe})]})]})})};Us.propTypes={getCurrentArist:P.func,getCurrentHost:P.func,getCurrentAttendee:P.func,getDiscoverableEvents:P.func,updateEventDiscoveryRadius:P.func,deleteAccount:P.func.isRequired,auth:P.object.isRequired,artist:P.object.isRequired,app:P.object.isRequired,host:P.object.isRequired,event:P.object.isRequired,attendee:P.object};const Qd=t=>({auth:t.auth,artist:t.artist,host:t.host,event:t.event,app:t.app,attendee:t.attendee}),yh=ve(Qd,{changeHats:ya,getCurrentArtist:xa,getCurrentHost:ga,getCurrentAttendee:ma,getDiscoverableEvents:pa,updateEventDiscoveryRadius:fa,deleteAccount:ja,getEventsNearMeToHost:ha,getMyArtistEventsOffers:da,closeEventEditDrawer:cr})(Us);export{yh as default}; 19//# sourceMappingURL=Dashboard-DF9bNlzm.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.