1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4084],{89459:function(e,t,s){s.d(t,{pm:function(){return h}});var i=s(2265);let n=0,a=new Map,r=e=>{if(a.has(e))return;let t=setTimeout(()=>{a.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);a.set(e,t)},o=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:s}=t;return s?r(s):e.toasts.forEach(e=>{r(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===s||void 0===s?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},l=[],c={toasts:[]};function d(e){c=o(c,e),l.forEach(e=>{e(c)})}function u(e){let{...t}=e,s=(n=(n+1)%Number.MAX_SAFE_INTEGER).toString(),i=()=>d({type:"DISMISS_TOAST",toastId:s});return d({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:e=>{e||i()}}}),{id:s,dismiss:i,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function h(){let[e,t]=i.useState(c);return i.useEffect(()=>(l.push(t),()=>{let e=l.indexOf(t);e>-1&&l.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},26763:function(e,t,s){s.r(t),s.d(t,{default:function(){return j}});var i=s(57437),n=s(2265),a=s(29827),r=s(16593),o=s(21770),l=s(5758),c=s(26280),d=s(89459),u=s(40257);let h=u.env.VENUE_206_ID||"venue-206-piccadilly";u.env.VENUE_206_FRONT_ID;let m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p="t-label inline-flex items-center gap-2 px-5 py-3 transition-transform hover:-translate-y-0.5 disabled:opacity-50 disabled:hover:translate-y-0",v="".concat(p," bg-door-a text-door-on"),b="".concat(p," border-2 border-ink text-ink hover:bg-ink hover:text-stock"),x="w-full border-2 border-ink bg-transparent px-3 py-2 text-ink";function f(e){return null==e?"not set":e%100==0?"$".concat(e/100):"$".concat((e/100).toFixed(2))}function y(e){switch(e.defaultPricingMode){case"free":return"Free to attend";case"fixed":return"".concat(f(e.defaultTicketPriceCents)," a ticket, members ").concat(null==e.defaultMemberPriceCents?"free":f(e.defaultMemberPriceCents));case"none":return"Not ticketed (drop in)";default:return"Pay what you can"}}function g(e){return new Intl.DateTimeFormat("en-CA",{timeZone:"UTC",weekday:"short",month:"short",day:"numeric",year:"numeric"}).format(new Date("".concat(e,"T00:00:00Z")))}let k={free:{label:"Will create",blurb:"Nothing is in this slot"},adoptable:{label:"Will adopt",blurb:"A booking already matches this exactly and will be linked, not duplicated"},already_in_series:{label:"Already in",blurb:"Nothing to do"},conflict:{label:"Skipped",blurb:"Something else is in the way"}};async function N(e,t,s){let i=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(s)}),n=await i.json().catch(()=>({}));if(!i.ok)throw Error(n.error||"Request failed");return n}function j(){var e,t,s,u,p,j,C,w;let S=(0,a.NL)(),{toast:M}=(0,d.pm)(),[T,P]=(0,n.useState)(null),[E,O]=(0,n.useState)(""),[A,R]=(0,n.useState)(""),[D,F]=(0,n.useState)(""),[_,I]=(0,n.useState)(""),[L,q]=(0,n.useState)(""),[U,K]=(0,n.useState)(""),V=(0,r.a)({queryKey:["/api/admin/series"],queryFn:async()=>{let e=await fetch("/api/admin/series",{credentials:"same-origin"});if(!e.ok)throw Error("Failed to load series");return e.json()}}),W=(0,r.a)({queryKey:["/api/admin/venues"],queryFn:async()=>{let e=await fetch("/api/admin/venues",{credentials:"same-origin"});if(!e.ok)throw Error("Failed to load venues");return e.json()}}),G=null!==(j=null===(e=W.data)||void 0===e?void 0:e.venues)&&void 0!==j?j:[],Z=e=>{var t,s;let i=null!=e?e:h;return null!==(s=null===(t=G.find(e=>e.id===i))||void 0===t?void 0:t.name)&&void 0!==s?s:W.isLoading?"Loadingâ¦":i},$=(0,r.a)({queryKey:["/api/admin/series",T,"plan"],enabled:!!T,queryFn:async()=>{let e=await fetch("/api/admin/series/".concat(T,"?plan=1"),{credentials:"same-origin"});if(!e.ok)throw Error("Failed to load the plan");return e.json()}}),H=(0,o.D)({mutationFn:e=>N("/api/admin/series/".concat(T),"PATCH",{lastDate:e}),onSuccess:()=>{M({title:"Range updated. Check the plan before generating."}),S.invalidateQueries({queryKey:["/api/admin/series"]})},onError:e=>M({title:"Could not update",description:e instanceof Error?e.message:"",variant:"destructive"})}),Q=(0,o.D)({mutationFn:e=>N("/api/admin/series/".concat(T),"PATCH",{clientEmail:e}),onSuccess:e=>{var t;let s=null!==(t=null==e?void 0:e.reassigned)&&void 0!==t?t:0;M({title:"Client changed",description:1===s?"1 booking moved with it.":"".concat(s," bookings moved with it.")}),R(""),S.invalidateQueries({queryKey:["/api/admin/series"]})},onError:e=>M({title:"Could not change the client",description:e instanceof Error?e.message:"",variant:"destructive"})}),Y=(0,o.D)({mutationFn:e=>N("/api/admin/series/".concat(T),"PATCH",{venueId:e}),onSuccess:()=>{M({title:"Space saved",description:"Dates generated from now on will be checked against it."}),S.invalidateQueries({queryKey:["/api/admin/series"]})},onError:e=>M({title:"Could not change the space",description:e instanceof Error?e.message:"",variant:"destructive"})}),z=(0,o.D)({mutationFn:e=>N("/api/admin/series/".concat(T),"PATCH",e),onSuccess:()=>{M({title:"Pricing saved",description:"Dates generated from now on will carry it."}),S.invalidateQueries({queryKey:["/api/admin/series"]})},onError:e=>M({title:"Could not save the pricing",description:e instanceof Error?e.message:"",variant:"destructive"})}),B=(0,o.D)({mutationFn:e=>N("/api/admin/series/".concat(T,"/generate"),"POST",{confirm:e}),onSuccess:e=>{M({title:"Created ".concat(e.created,", adopted ").concat(e.adopted),description:e.failed.length?"".concat(e.failed.length," could not be written. See the plan."):void 0}),S.invalidateQueries({queryKey:["/api/admin/series"]})},onError:e=>M({title:"Nothing was written",description:e instanceof Error?e.message:"",variant:"destructive"})}),J=null!==(C=null===(t=V.data)||void 0===t?void 0:t.series)&&void 0!==C?C:[],X=null===(s=$.data)||void 0===s?void 0:s.series,ee=null===(u=$.data)||void 0===u?void 0:u.summary,et=null!==(w=null===(p=$.data)||void 0===p?void 0:p.plan)&&void 0!==w?w:[],es=ee?ee.free+ee.adoptable:0;return(0,i.jsxs)(l.Wn,{door:"room",children:[(0,i.jsx)(c.default,{}),(0,i.jsxs)(l.yp,{volume:"poster",className:"mx-auto max-w-5xl px-6 py-10",children:[(0,i.jsx)(l.Yw,{door:"room",children:"Recurring series"}),(0,i.jsx)("h1",{className:"t-display mt-2",children:"Series"}),(0,i.jsx)("p",{className:"mt-3 max-w-2xl text-ink-soft",children:"A series holds the rule, the client and the rate. Generating applies the rule to the calendar: it creates the dates that are free and links the ones that already match, and it never writes anything you have not previewed."}),(0,i.jsx)(l.$9,{className:"my-8"}),V.isLoading&&(0,i.jsx)("p",{className:"text-ink-soft",children:"Loadingâ¦"}),(0,i.jsx)("ul",{className:"space-y-3",children:J.map(e=>{var t,s,n,a,r,o,c,d,u,h,p,N;return(0,i.jsxs)("li",{children:[(0,i.jsxs)("button",{type:"button",onClick:()=>{var t;let s=e.id!==T;P(s?e.id:null),O(e.lastDate),F(s?e.defaultPricingMode:""),I(s&&e.defaultTicketPriceCents?String(e.defaultTicketPriceCents/100):""),q(s&&null!=e.defaultMemberPriceCents?String(e.defaultMemberPriceCents/100):""),K(s&&null!==(t=e.venueId)&&void 0!==t?t:"")},className:"w-full border-2 border-ink px-4 py-3 text-left hover:bg-ink hover:text-stock",children:[(0,i.jsx)("span",{className:"t-label block",children:e.title}),(0,i.jsxs)("span",{className:"mt-1 block text-sm",children:[function(e){var t,s;
1let i=null==e.byWeekday?"":m[e.byWeekday],n="weekly"===e.freq?"Every ".concat(i):"fortnightly"===e.freq?"Alternate ".concat(i,"s"):"".concat(-1===e.monthlyNth?"Last":"".concat(e.monthlyNth).concat(1===(s=null!==(t=e.monthlyNth)&&void 0!==t?t:1)?"st":2===s?"nd":3===s?"rd":"th")," ").concat(i," of the month");return"".concat(n,", ").concat(e.startTimeLocal," to ").concat(e.endTimeLocal)}(e)," \xb7 through ",g(e.lastDate)," \xb7 ",null!==(c=e.occurrenceCount)&&void 0!==c?c:0," in the system"]}),(0,i.jsx)("span",{className:"mt-1 block text-sm",children:"none"===e.billingMode?"Not billed (Reimagine's own)":"".concat(f(e.negotiatedRateCents)," ").concat("per_month"===e.rateUnit?"per month":"per session").concat(e.cardRateCents?", card says ".concat(f(e.cardRateCents)):"")}),(0,i.jsxs)("span",{className:"mt-1 block text-sm",children:["public"===e.defaultVisibility?"Public":"Private"," \xb7 ",y(e)]}),!1===e.clientContactable&&(0,i.jsx)("span",{className:"t-label mt-1 block text-alert",children:"Placeholder contact. Cannot be invoiced until the real address is in."})]}),T===e.id&&(0,i.jsxs)("div",{className:"border-2 border-t-0 border-ink px-4 py-4",children:[$.isLoading&&(0,i.jsx)("p",{className:"text-ink-soft",children:"Working out the planâ¦"}),X&&ee&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"mb-5 border-2 border-ink bg-stock p-3",children:[(0,i.jsx)("p",{className:"t-label text-ink",children:"Client"}),(0,i.jsx)("p",{className:"mt-1 text-sm text-ink",children:(null===(s=$.data)||void 0===s?void 0:null===(t=s.client)||void 0===t?void 0:t.email)?(0,i.jsxs)(i.Fragment,{children:[[$.data.client.firstName,$.data.client.lastName].filter(Boolean).join(" ")," ",(0,i.jsxs)("span",{className:"font-mono",children:["(",$.data.client.email,")"]})]}):(0,i.jsx)("span",{className:"text-ink-soft",children:"No client on this series."})}),(0,i.jsxs)("p",{className:"mt-2 text-xs text-ink-soft",children:["This is the address every occurrence carries, and who confirmations and invoices go to. Changing it moves all ",null!==(d=X.occurrenceCount)&&void 0!==d?d:0," dates with it, past ones included."]}),(0,i.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-3",children:[(0,i.jsxs)("label",{className:"block",children:[(0,i.jsx)("span",{className:"t-label block",children:"Change to"}),(0,i.jsx)("input",{type:"email",value:A,placeholder:null!==(u=null===(a=$.data)||void 0===a?void 0:null===(n=a.client)||void 0===n?void 0:n.email)&&void 0!==u?u:"[email protected]",onChange:e=>R(e.target.value),className:"".concat(x," mt-1")})]}),(0,i.jsx)("button",{type:"button",className:b,disabled:Q.isPending||!A.includes("@")||A===(null===(o=$.data)||void 0===o?void 0:null===(r=o.client)||void 0===r?void 0:r.email),onClick:()=>Q.mutate(A),children:Q.isPending?"Movingâ¦":"Change client"})]})]}),(0,i.jsxs)("div",{className:"mb-5 border-2 border-ink bg-stock p-3",children:[(0,i.jsx)("p",{className:"t-label text-ink",children:"Space"}),(0,i.jsx)("p",{className:"mt-1 text-sm text-ink",children:Z(X.venueId)}),(0,i.jsxs)("p",{className:"mt-2 text-xs text-ink-soft",children:["Applies to dates generated from now on; the ",null!==(h=X.occurrenceCount)&&void 0!==h?h:0," ","already on the calendar keep the space they were made in."]}),(0,i.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-3",children:[(0,i.jsxs)("label",{className:"block",children:[(0,i.jsx)("span",{className:"t-label block",children:"Change to"}),(0,i.jsx)("select",{value:U,onChange:e=>K(e.target.value),className:"".concat(x," mt-1"),"data-testid":"series-venue-select",children:G.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)("button",{type:"button",className:b,disabled:Y.isPending||!U||U===(null!==(p=X.venueId)&&void 0!==p?p:""),onClick:()=>Y.mutate(U),children:Y.isPending?"Savingâ¦":"Change space"})]})]}),(0,i.jsxs)("div",{className:"mb-5 border-2 border-ink bg-stock p-3",children:[(0,i.jsx)("p",{className:"t-label text-ink",children:"At the door"}),(0,i.jsx)("p",{className:"mt-1 text-sm text-ink",children:y(X)}),(0,i.jsxs)("p",{className:"mt-2 text-xs text-ink-soft",children:["Applies to dates generated from now on. The ",null!==(N=X.occurrenceCount)&&void 0!==N?N:0," already on the calendar keep what they have; change those on the booking itself."]}),(0,i.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-3",children:[(0,i.jsxs)("label",{className:"block",children:[(0,i.jsx)("span",{className:"t-label block",children:"Mode"}),(0,i.jsxs)("select",{value:D,onChange:e=>F(e.target.value),className:"".concat(x," mt-1"),"data-testid":"series-pricing-mode",children:[(0,i.jsx)("option",{value:"free",children:"Free to attend"}),(0,i.jsx)("option",{value:"pwyc",children:"Pay what you can"}),(0,i.jsx)("option",{value:"fixed",children:"Fixed price"}),(0,i.jsx)("option",{value:"none",children:"Not ticketed (drop in)"})]})]}),"fixed"===D&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("label",{className:"block",children:[(0,i.jsx)("span",{className:"t-label block",children:"Ticket $"}),(0,i.jsx)("input",{type:"number",min:"0",step:"0.01",value:_,onCh
1ange:e=>I(e.target.value),className:"".concat(x," mt-1 w-28")})]}),(0,i.jsxs)("label",{className:"block",children:[(0,i.jsx)("span",{className:"t-label block",children:"Members $"}),(0,i.jsx)("input",{type:"number",min:"0",step:"0.01",value:L,placeholder:"free",onChange:e=>q(e.target.value),className:"".concat(x," mt-1 w-28")})]})]}),(0,i.jsx)("button",{type:"button",className:b,disabled:z.isPending||!D,onClick:()=>z.mutate("fixed"===D?{defaultPricingMode:"fixed",defaultTicketPriceCents:Math.round(100*Number(_||0)),defaultMemberPriceCents:""===L?null:Math.round(100*Number(L))}:{defaultPricingMode:D}),children:z.isPending?"Savingâ¦":"Save pricing"})]})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-end gap-4",children:[(0,i.jsxs)("label",{className:"block",children:[(0,i.jsx)("span",{className:"t-label block",children:"Generate through"}),(0,i.jsx)("input",{type:"date",value:E,onChange:e=>O(e.target.value),className:"".concat(x," mt-1")})]}),(0,i.jsx)("button",{type:"button",className:b,disabled:H.isPending||!E||E===X.lastDate,onClick:()=>H.mutate(E),children:H.isPending?"Updatingâ¦":"Update range"})]}),(0,i.jsxs)("p",{className:"mt-5",children:[(0,i.jsx)("strong",{children:ee.total})," dates in range."," ",(0,i.jsx)("strong",{children:ee.free})," to create, ",(0,i.jsx)("strong",{children:ee.adoptable})," ","to adopt, ",ee.alreadyInSeries," already in, ",ee.conflict," blocked."]}),(0,i.jsxs)("p",{className:"t-label mt-2 text-ink",children:["New dates will be ","public"===X.defaultVisibility?"public":"private",","," ",y(X).toLowerCase(),"."]}),ee.conflict>0&&(0,i.jsxs)("p",{className:"t-label mt-2 text-alert",children:[ee.conflict," date",1===ee.conflict?"":"s"," will be skipped, not overwritten."]}),(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsx)("button",{type:"button",className:v,disabled:B.isPending||0===es,onClick:()=>B.mutate(es),children:B.isPending?"Writingâ¦":0===es?"Nothing to write":"Generate ".concat(es," date").concat(1===es?"":"s")})}),(0,i.jsx)(l.$9,{className:"my-5"}),(0,i.jsx)("ol",{className:"space-y-1 text-sm",children:et.map(e=>{var t;return(0,i.jsxs)("li",{className:"flex flex-wrap gap-x-3",children:[(0,i.jsx)("span",{className:"w-44 shrink-0",children:g(e.date)}),(0,i.jsx)("span",{className:"t-label w-28 shrink-0",children:k[e.verdict].label}),(0,i.jsx)("span",{className:"conflict"===e.verdict?"text-alert":"text-ink-soft",children:"conflict"===e.verdict?null===(t=e.conflictsWith)||void 0===t?void 0:t.map(e=>e.eventTitle).join(", "):k[e.verdict].blurb})]},e.date)})})]})]})]},e.id)})}),!V.isLoading&&0===J.length&&(0,i.jsx)("p",{className:"text-ink-soft",children:"No series yet."})]})]})}},58293:function(e,t,s){s.d(t,{Z:function(){return i}});let i=(0,s(79205).Z)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},92369:function(e,t,s){s.d(t,{Z:function(){return i}});let i=(0,s(79205).Z)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},27648:function(e,t,s){s.d(t,{default:function(){return n.a}});var i=s(72972),n=s.n(i)},2894:function(e,t,s){s.d(t,{R:function(){return o},m:function(){return r}});var i=s(18238),n=s(7989),a=s(11255),r=class extends n.F{#e;#t;#s;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#t.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){this.#s=(0,a.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});
1let t="pending"===this.state.status,s=!this.#s.canStart();try{if(!t){this.#i({type:"pending",variables:e,isPaused:s}),await this.#t.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:s})}let i=await this.#s.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),this.#i({type:"success",data:i}),i}catch(t){try{throw await this.#t.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#t.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#i({type:"error",error:t})}}finally{this.#t.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),i.V.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21770:function(e,t,s){s.d(t,{D:function(){return u}});var i=s(2265),n=s(2894),a=s(18238),r=s(24112),o=s(45345),l=class extends r.l{#n;#a=void 0;#r;#o;constructor(e,t){super(),this.#n=e,this.setOptions(t),this.bindMethods(),this.#l()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#n.defaultMutationOptions(e),(0,o.VS)(this.options,t)||this.#n.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(t.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#l(),this.#c(e)}getCurrentResult(){return this.#a}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#l(),this.#c()}mutate(e,t){return this.#o=t,this.#r?.removeObserver(this),this.#r=this.#n.getMutationCache().build(this.#n,this.options),this.#r.addObserver(this),this.#r.execute(e)}#l(){let e=this.#r?.state??(0,n.R)();this.#a={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#c(e){a.V.batch(()=>{if(this.#o&&this.hasListeners()){let t=this.#a.variables,s=this.#a.context;e?.type==="success"?(this.#o.onSuccess?.(e.data,t,s),this.#o.onSettled?.(e.data,null,t,s)):e?.type==="error"&&(this.#o.onError?.(e.error,t,s),this.#o.onSettled?.(void 0,e.error,t,s))}this.listeners.forEach(e=>{e(this.#a)})})}},c=s(29827),d=s(51172);function u(e,t){let s=(0,c.NL)(t),[n]=i.useState(()=>new l(s,e));i.useEffect(()=>{n.setOptions(e)},[n,e]);let r=i.useSyncExternalStore(i.useCallback(e=>n.subscribe(a.V.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=i.useCallback((e,t)=>{n.mutate(e,t).catch(d.Z)},[n]);if(r.error&&(0,d.L)(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}},90535:function(e,t,s){s.d(t,{j:function(){return r}});var i=s(61994);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=i.W,r=(e,t)=>s=>{var i;if((null==t?void 0:t.variants)==null)return a(e,null==s?void 0:s.class,null==s?void 0:s.className);let{variants:r,defaultVariants:o}=t,l=Object.keys(r).map(e=>{let t=null==s?void 0:s[e],i=null==o?void 0:o[e];if(null===t)return null;let a=n(t)||n(i);return r[e][a]}),c=s&&Object.entries(s).reduce((e,t)=>
1{let[s,i]=t;return void 0===i||(e[s]=i),e},{});return a(e,l,null==t?void 0:null===(i=t.compoundVariants)||void 0===i?void 0:i.reduce((e,t)=>{let{class:s,className:i,...n}=t;return Object.entries(n).every(e=>{let[t,s]=e;return Array.isArray(s)?s.includes({...o,...c}[t]):({...o,...c})[t]===s})?[...e,s,i]:e},[]),null==s?void 0:s.class,null==s?void 0:s.className)}}}]);
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.