1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f45b-c744-7f83-9179-186e69b4fbfc")}catch(e){}}();import{r as P,j as t}from"./1_rjLJJT.js";import{c as W,t as U,i as Je,B as Z,u as Oe,z as tt,L as lt,ac as Be,ad as Ie,al as De,H as $e,a as pe,T as ie,b$ as rt,bn as ws,a3 as Cs,c_ as Ns,j as He,cv as Fs,a5 as Mt,cl as As,an as Zt,fc as Xt,fd as St,bB as Jt,bt as _s,k as es,F as ts,C as ss,bC as Ds,cA as Ts,bl as Bs,bo as Is,Y as ot,c1 as Ee,cV as Os,bw as Ms,a2 as wt,b8 as ns,fe as $s,ff as Rs,bb as Ps,bM as Es,aq as $t,cw as ut,cx as ft,cy as mt,b7 as Us,fg as Hs,fh as is,b3 as Ls,m as zs,o as Rt,X as Ws,c2 as ls}from"./Cnl0lOne.js";import{b as Qe,c as qe,a as Ve,e as Ge,D as Ye,d as Ke,t as Pt,j as Et,W as Ut,h as Qs,A as qs,T as Vs,i as Gs}from"./CrTs0UAI.js";import{D as Ct,m as ct,bf as pt,an as Ht,aS as Lt,q as Nt,ar as Ys,U as Ks,Z as os,$ as Zs,ab as Xs,E as as,bg as Js,aB as yt,bh as en,H as tn,bi as sn,bj as nn,bk as kt,G as zt,ad as rs,a0 as ln,a8 as on,bl as an,bm as rn,bn as cn,bo as dn,R as ht,z as un,Q as fn}from"./YLLfQEvQ.js";import{b as st,u as Le,L as _e,O as cs,a as Ft}from"./IR4uT189.js";import{N as mn,D as hn,C as pn}from"./D9PE5tjd.js";import{P as jt,C as xn}from"./iM2HpF5v.js";import{I as dt,T as et}from"./GqtihGQd.js";import{S as Ue}from"./BmB9UXLw.js";import{g as bn,b as ve,e as gn,f as yn,c as ds,a as we,d as Ae,h as kn,D as Ce}from"./1wdvSDDz.js";import{t as jn,z as se,j as vt,v as Wt,f as us,e as vn,U as Sn}from"./B5dUIQ6s.js";import{S as fs}from"./C_YBBnf9.js";import{b as ms,d as Xe,S as hs,a as ps,c as xs}from"./Bt3tkbpM.js";import{U as wn,S as Cn}from"./DWGrnnTO.js";import{u as Te,f as nt,D as Nn}from"./D_1K9NW_.js";import{b as At,g as _t,d as Dt,e as Tt,f as Bt,h as bs,S as It,a as Ot}from"./B35B_vHQ.js";import{C as Fn}from"./DZHzfiV9.js";import{T as Qt}from"./DtHomfFm.js";import{r as Me}from"./DWeaxL46.js";import{t as An,a as _n,r as Dn,b as Tn,z as Bn}from"./uzzN2ZB4.js";import{L as In}from"./D9b_k9T3.js";import{u as On}from"./DRBDQbwj.js";import{g as Mn,f as $n}from"./D5sCs59G.js";import{A as Rn}from"./BLFYoUEs.js";import{a as Pn}from"./Bq04fuRX.js";import"./BnWyCVyG.js";import"./C66g93i7.js";import"./DSfjkjoJ.js";import"./Bz_KDPNB.js";import"./DRzjZk4d.js";import"./x1xV_SpL.js";import"./CUjK3Dfv.js";import"./D_DWzXlY.js";import"./BKMJuJR8.js";import"./DdVGmexM.js";function En(s){const e=W.c(42),{bookId:n,bookName:l,isGuestBook:a,onRedirect:u,onHidden:o}=s,d=a===void 0?!1:a,r=U.useUtils();let c;e[0]!==l||e[1]!==d||e[2]!==u||e[3]!==r?(c=()=>{Je({title:d?"Guest spot cancelled":`Book ${l} archived`,variant:"success"}),r.getPersonSettings.invalidate(),r.getBookSettings.invalidate(),d&&(r.getStudioJobApplicationCounts.invalidate(),r.getPageOfStudioJobApplications.invalidate()),u()},e[0]=l,e[1]=d,e[2]=u,e[3]=r,e[4]=c):c=e[4];const i=c;let f;e[5]!==d?(f=M=>{Je({title:d?"Unable to cancel guest spot. Try again.":"Unable to archive book. Try again.",description:M.message,variant:"error"})},e[5]=d,e[6]=f):f=e[6];const m=f;let g;e[7]!==m||e[8]!==i?(g={onSuccess:i,onError:m},e[7]=m,e[8]=i,e[9]=g):g=e[9];const{mutateAsync:x,isPending:h}=U.archiveBook.useMutation(g);let y;e[10]!==m||e[11]!==i?(y={onSuccess:i,onError:m},e[10]=m,e[11]=i,e[12]=y):y=e[12];const{mutateAsync:j,isPending:k}=U.cancelGuestSpot.useMutation(y),b=h||k,[p,v]=P.useState(!0);let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=()=>v(!1),e[13]=S):S=e[13];let w;e[14]!==o||e[15]!==p?(w=()=>{p||o()},e[14]=o,e[15]=p,e[16]=w):w=e[16];const C=d?"Cancel guest spot?":"Archive book?";let A;e[17]!==C?(A=t.jsx(Qe,{children:C}),e[17]=C,e[18]=A):A=e[18];const F=d?"This archives this guest book and its unbooked requests, and ends the guesting agreement with the studio. Booked appointments will stay for your reference. This cannot be undone.":"Archiving a book archives all unbooked requests within this book. Booked appointments will stay for your reference. This cannot be undone.";let N;e[19]!==F?(N=t.jsx(qe,{className:"leading-snug",children:F}),e[19]=F,e[20]=N):N=e[20];let D;e[21]!==N||e[22]!==A?(D=t.jsxs(Ve,{children:[A,N]}),e[21]=N,e[22]=A,e[23]=D):D=e[23];let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Ct,{asChild:!0,children:t.jsx(Z,{variant:"secondary",children:"No, never mind"})}),e[24]=T):T=e[24];let _;e[25]!==n||e[26]!==d||e[27]!==b||e[28]!==x||e[29]!==j?(_=()=>{b||(d?j({bookId:n}):x(n))},e[25]=n,e[26]=d,e[27]=b,e[28]=x,e[29]=j,e[30]=_):_=e[30];const O=d?"Yes, cancel guest spot":"Yes, archive book";let B;e[31]!==b||e[32]!==_||e[33]!==O?(B=t.jsxs(Ge,{children:[T,t.jsx(Z,{variant:"destructive",disabled:b,isLoading:b,onClick:_,children:O})]}),e[31]=b,e[32]=_,e[33]=O,e[34]=B):B=e[34];let I;e[35]!==D||e[36]!==B||e[37]!==w?(I=t.jsxs(Ye,{showClose:!1,onAnimationEndCapture:w,children:[D,B]}),e[35]=D,e[36]=B,e[37]=w,e[38]=I):I=e[38];let $;return e[39]!==p||e[40]!==I?($=t.jsx(Ke,{open:p,onOpenChange:S,children:I}),e[39]=p,e[40]=I,e[41]=$):$=e[41],$}function ko(){const s=W.c(21),{personId:e}=Oe(),{bookId:n}=st(),l=!!n;let a;s[0]!==l?(a={enabled:l},s[0]=l,s[1]=a):a=s[1];const{data:u,isLoading:o}=U.getBookSettings.useQuery(n,a),d=Le(),r=tt(),c=u&&!u.hasMultipleBooks&&!u.isGuestBook;let i,f;if(s[2]!==c||s[3]!==d?(i=()=>{c&&d("../",{preventScrollReset:!0})}
1,f=[c,d],s[2]=c,s[3]=d,s[4]=i,s[5]=f):(i=s[4],f=s[5]),P.useEffect(i,f),o||c){let h;return s[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(lt,{}),s[6]=h):h=s[6],h}if(!n){let h;return s[7]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Be,{code:Ie.hookUseParams_bookId}),s[7]=h):h=s[7],h}if(!u){let h;return s[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Be,{code:Ie.getBookSettings}),s[8]=h):h=s[8],h}let m;s[9]!==r||s[10]!==d||s[11]!==e?(m=()=>{d(r("personSettings",{personId:e}))},s[9]=r,s[10]=d,s[11]=e,s[12]=m):m=s[12];let g;s[13]!==d?(g=()=>{d("../",{preventScrollReset:!0})},s[13]=d,s[14]=g):g=s[14];let x;return s[15]!==n||s[16]!==u.isGuestBook||s[17]!==u.name||s[18]!==m||s[19]!==g?(x=t.jsx(En,{bookId:n,bookName:u.name,isGuestBook:u.isGuestBook,onRedirect:m,onHidden:g}),s[15]=n,s[16]=u.isGuestBook,s[17]=u.name,s[18]=m,s[19]=g,s[20]=x):x=s[20],x}function Un(s){const e=W.c(12),{minDate:n,maxDate:l,quantity:a,unit:u}=s;if(!a&&!n&&!l)return"Indefinite";if(n||l){let r;e[0]!==n?(r=n&&t.jsxs("div",{children:["From: ",n]}),e[0]=n,e[1]=r):r=e[1];let c;e[2]!==l?(c=l&&t.jsxs("div",{children:["To: ",l]}),e[2]=l,e[3]=c):c=e[3];let i;return e[4]!==r||e[5]!==c?(i=t.jsxs("div",{children:[r,c]}),e[4]=r,e[5]=c,e[6]=i):i=e[6],i}let o;e[7]!==u?(o=u?.toLowerCase(),e[7]=u,e[8]=o):o=e[8];let d;return e[9]!==a||e[10]!==o?(d=t.jsxs("div",{className:"capitalize",children:[a," ",o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11],d}const Hn={DAYS:"day",WEEKS:"week",MONTHS:"month"},Ln={DAYS:"days",WEEKS:"weeks",MONTHS:"months"};function zn(s){const e=W.c(3),{quantity:n,unit:l}=s;if(!n)return"Disabled";const a=l?n===1?Hn[l]:Ln[l]:null;let u;return e[0]!==a||e[1]!==n?(u=t.jsxs("div",{children:[n," ",a]}),e[0]=a,e[1]=n,e[2]=u):u=e[2],u}function Wn(s){const e=W.c(50),{bookSettings:n}=s,l=U.useUtils(),{toast:a}=De(),[u,o]=P.useState(null);let d;e[0]!==l?(d=async()=>{await l.getBookSettings.invalidate(),await l.getBooksTypeformInfo.invalidate(),await l.getPersonSettings.invalidate()},e[0]=l,e[1]=d):d=e[1];let r;e[2]!==n.isArchived||e[3]!==a?(r=R=>{if(n.isArchived){a({title:"Cannot update an archived book",description:"Please unarchive the book first.",variant:"error"});return}a({title:"Couldn't update your book",description:R.message||"Please try again.",variant:"error"})},e[2]=n.isArchived,e[3]=a,e[4]=r):r=e[4];let c;e[5]!==d||e[6]!==r?(c={onSuccess:d,onError:r},e[5]=d,e[6]=r,e[7]=c):c=e[7];const{mutateAsync:i,isPending:f}=U.updateBook.useMutation(c),m=n.isOpen&&n.isFlashEnabled&&!n.isCustomTattooEnabled?"open-flash-only":n.isOpen&&n.isCustomTattooEnabled?"open":"closed",g=!f&&!n.isArchived;let x;e[8]!==n.id||e[9]!==g||e[10]!==m||e[11]!==i?(x=R=>{if(!g||R===m)return;const E=R==="open"?{isOpen:!0,isCustomTattooEnabled:!0}:R==="open-flash-only"?{isOpen:!0,isCustomTattooEnabled:!1}:{isOpen:!1,isCustomTattooEnabled:!0};i({bookId:n.id,...E}).catch(Qn)},e[8]=n.id,e[9]=g,e[10]=m,e[11]=i,e[12]=x):x=e[12];const h=x,y=n.isFlashEnabled,j=!!n.customForm||!!n.requestTypeformFormId;let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx($e,{className:"px-1",children:"Book status"}),e[13]=k):k=e[13];const b=m==="open",p=!g||!j;let v;e[14]!==h?(v=()=>{h("open")},e[14]=h,e[15]=v):v=e[15];let S;e[16]!==n.tagColor||e[17]!==b||e[18]!==p||e[19]!==v?(S=t.jsx(xt,{selected:b,disabled:p,title:"Open",dotColor:n.tagColor,onClick:v}),e[16]=n.tagColor,e[17]=b,e[18]=p,e[19]=v,e[20]=S):S=e[20];let w;e[21]!==j||e[22]!==u?(w=!j&&t.jsx(qt,{content:"Add an intake form to take custom requests",isShown:u==="open",onOpenChange:R=>{o(R?"open":null)}}),e[21]=j,e[22]=u,e[23]=w):w=e[23];let C;e[24]!==w||e[25]!==S?(C=t.jsxs("div",{className:"relative shrink-0 w-40",children:[S,w]}),e[24]=w,e[25]=S,e[26]=C):C=e[26];const A=m==="open-flash-only",F=!g||!y;let N;e[27]!==h?(N=()=>{h("open-flash-only")},e[27]=h,e[28]=N):N=e[28];let D;e[29]!==n.tagColor||e[30]!==A||e[31]!==F||e[32]!==N?(D=t.jsx(xt,{selected:A,disabled:F,title:"Open",subtitle:"Flash only",dotColor:n.tagColor,onClick:N}),e[29]=n.tagColor,e[30]=A,e[31]=F,e[32]=N,e[33]=D):D=e[33];let T;e[34]!==y||e[35]!==u?(T=!y&&t.jsx(qt,{content:"Available if you have bookable flash",isShown:u==="flash",onOpenChange:R=>{o(R?"flash":null)}}),e[34]=y,e[35]=u,e[36]=T):T=e[36];let _;e[37]!==D||e[38]!==T?(_=t.jsxs("div",{className:"relative shrink-0 w-40",children:[D,T]}),e[37]=D,e[38]=T,e[39]=_):_=e[39];const O=m==="closed",B=!g;let I;e[40]!==h?(I=()=>{h("closed")},e[40]=h,e[41]=I):I=e[41];let $;e[42]!==O||e[43]!==B||e[44]!==I?($=t.jsx("div",{className:"shrink-0 w-40",children:t.jsx(xt,{selected:O,disabled:B,title:"Closed",onClick:I})}),e[42]=O,e[43]=B,e[44]=I,e[45]=$):$=e[45];let M;return e[46]!==C||e[47]!==_||e[48]!==$?(M=t.jsxs("div",{className:"flex flex-col gap-6",children:[k,t.jsxs("div",{className:"invisible-scrollbar -mx-5 flex gap-3 overflow-x-auto overflow-y-hidden px-5 py-1",children:[C,_,$]})]}),e[46]=C,e[47]=_,e[48]=$,e[49]=M):M=e[49],M}function Qn(){}function qt(s){const e=W.c(17),{content:n,isShown:l,onOpenChange:a}=s,u=`Why is this unavailable? ${n}`;let o;e[0]!==l||e[1]!==a?(o=m=>{m.preventDefault(),m.stopPropagation(),a(!l)},e[0]=l,e[1]=a,e[2]=o):o=e[2];const d=l?"text-ink-black":"text-ink-black-300";let r;e[3]!==d?(r=pe("stroke-none",d),e[3]=d,e[4]=r):r=e[4];let c;e[5]!==r?(c=t.jsx(dt,{size:16,className:r}),e[5]=r,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==u||e[9]!==o||e[10]!==c?(i=t.jsx("button",{type:"button","aria-label":u,"aria-expanded":l,onClick:o,children:c}),e[7]=l,e[8]=u,e[9]=o,e[10]=c,e[11]=i):i=e[11];let f;return e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==i?(f=t.jsx("div",{className:"absolute right-4 top-4",children:t.jsx(rt,{content:n,open:l,onOpenChange:a,className:"w-48",children:i})}),e[12]=n,e[13]=l,e[14]=a,e[15]=i,e[16]=f):f=e[16],f}function xt(s){const e=W.c(26),{selected:n,disabled:l,title:a,subtitle:u,dotColor:o,onClick:d}=s,r=n?"border-2 border-ink-black dark:border-ink-white":"border border-ink-black/10 dark:border-ink-white/10",c=l&&"opacity-50";let i;e[0]!==r||e[1]!==c?(i=pe("flex min-h-36 w-full flex-col gap-4 roun
1ded-3xl p-5 text-left","bg-ink-paper text-ink-black dark:text-ink-white transition-colors duration-200",r,c),e[0]=r,e[1]=c,e[2]=i):i=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={type:"spring",bounce:0,duration:.3},e[3]=f):f=e[3];const m=n?"gap-1 px-2 bg-ink-black/5 dark:bg-ink-white/5":"w-5 justify-center border border-ink-black-200 dark:border-ink-black-700";let g;e[4]!==m?(g=pe("flex h-5 items-center overflow-hidden whitespace-nowrap rounded-full",m),e[4]=m,e[5]=g):g=e[5];let x;e[6]!==o||e[7]!==n?(x=n&&t.jsxs(ct.span,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.15,duration:.2},className:"flex items-center gap-1",children:[o?t.jsxs("span",{className:"relative inline-flex shrink-0 h-1.5 w-1.5",children:[t.jsx("span",{className:"absolute inset-0 rounded-full opacity-75 animate-ping motion-reduce:animate-none",style:{backgroundColor:o}}),t.jsx("span",{className:"relative inline-block h-1.5 w-1.5 rounded-full",style:{backgroundColor:o}})]}):t.jsx("span",{className:"inline-block shrink-0 h-1.5 w-1.5 rounded-full bg-ink-black-300"}),t.jsx(ie,{variant:"label",size:"xs",element:"span",inactive:!0,children:"ACTIVE"})]}),e[6]=o,e[7]=n,e[8]=x):x=e[8];let h;e[9]!==g||e[10]!==x?(h=t.jsx("div",{className:"flex items-center",children:t.jsx(ct.span,{layout:!0,transition:f,className:g,children:x})}),e[9]=g,e[10]=x,e[11]=h):h=e[11];let y;e[12]!==a?(y=t.jsx($e,{size:"lg",children:a}),e[12]=a,e[13]=y):y=e[13];let j;e[14]!==n||e[15]!==u?(j=u&&t.jsx(ie,{size:"sm",className:"truncate leading-snug",inactive:!n,children:u}),e[14]=n,e[15]=u,e[16]=j):j=e[16];let k;e[17]!==j||e[18]!==y?(k=t.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[y,j]}),e[17]=j,e[18]=y,e[19]=k):k=e[19];let b;return e[20]!==l||e[21]!==d||e[22]!==k||e[23]!==i||e[24]!==h?(b=t.jsxs("button",{type:"button",onClick:d,disabled:l,className:i,children:[h,k]}),e[20]=l,e[21]=d,e[22]=k,e[23]=i,e[24]=h,e[25]=b):b=e[25],b}function qn(s){const e=W.c(11),{children:n}=s,[l,a]=P.useState(!1);let u;e[0]!==n?(u=n??t.jsx(Ue,{hasChevron:!0,icon:mn,label:"Custom form"}),e[0]=n,e[1]=u):u=e[1];let o;e[2]!==u?(o=t.jsx(bn,{asChild:!0,children:u}),e[2]=u,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(ve,{children:"Hey..."}),e[4]=d):d=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs(gn,{className:"pt-3 gap-4",children:[t.jsx(yn,{className:"font-bold text-3xl",children:"We got you, but..."}),t.jsx(ds,{className:"text-base leading-snug",children:"We're working hard to make it possible to edit your form yourself, but in the meantime, we're happy to make changes if you DM us!"})]}),e[5]=r):r=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsxs(ws,{href:Cs.venueInkInstagramDmUrl,className:pe(He({variant:"primary"}),"w-full no-underline"),onClick:()=>a(!1),children:[t.jsx(Ns,{size:20}),"DM us on Instagram"]}),e[6]=c):c=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(we,{showClose:!1,children:[d,r,t.jsxs(Ae,{children:[c,t.jsx(kn,{asChild:!0,children:t.jsx(Z,{variant:"secondary",children:"Never mind"})})]})]}),e[7]=i):i=e[7];let f;return e[8]!==l||e[9]!==o?(f=t.jsxs(Ce,{open:l,onOpenChange:a,children:[o,i]}),e[8]=l,e[9]=o,e[10]=f):f=e[10],f}function Vn(s){const e=W.c(26),{useTypeformForCustomRequests:n,bookSettings:l}=s,a=l.customForm?.id;let u;e[0]!==l.isGuestBook||e[1]!==a||e[2]!==n?(u=Fs({customFormId:a,isGuestBook:l.isGuestBook},n),e[0]=l.isGuestBook,e[1]=a,e[2]=n,e[3]=u):u=e[3];const o=u==="typeform",d=!o&&!!l.customForm,r=!!l.flashForm,c=!o&&!l.customForm,i=!l.flashForm;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx($e,{size:"xl",className:"px-1",children:"Forms"}),e[4]=f):f=e[4];let m;e[5]!==l.customForm||e[6]!==d?(m=d&&t.jsx(Ze,{icon:pt,to:"edit-custom-form",title:l.customForm.title,lastUpdatedAtUtc:l.customForm.lastUpdatedAtUtc,eyebrow:"Intake form"}),e[5]=l.customForm,e[6]=d,e[7]=m):m=e[7];let g;e[8]!==c?(g=c&&t.jsx(Ze,{icon:pt,to:"edit-custom-form",title:"Intake form"}),e[8]=c,e[9]=g):g=e[9];let x;e[10]!==o?(x=o&&t.jsx(qn,{children:t.jsx("button",{type:"button",className:gs,children:t.jsx(ys,{icon:pt,title:"Intake form"})})}),e[10]=o,e[11]=x):x=e[11];let h;e[12]!==l.flashForm||e[13]!==r?(h=r&&t.jsx(Ze,{icon:Ht,to:"edit-form",title:l.flashForm.title,lastUpdatedAtUtc:l.flashForm.lastUpdatedAtUtc,eyebrow:"Flash intake"}),e[12]=l.flashForm,e[13]=r,e[14]=h):h=e[14];let y;e[15]!==i?(y=i&&t.jsx(Ze,{icon:Ht,to:"edit-form",title:"Flash intake"}),e[15]=i,e[16]=y):y=e[16];let j;e[17]!==l.consentForm?(j=l.consentForm?t.jsx(Ze,{icon:Lt,to:"edit-consent-form",title:l.consentForm.title,lastUpdatedAtUtc:l.consentForm.lastUpdatedAtUtc,eyebrow:"Consent form"}):t.jsx(Ze,{icon:Lt,to:"edit-consent-form",title:"No consent form added",eyebrow:"Consent form"}),e[17]=l.consentForm,e[18]=j):j=e[18];let k;return e[19]!==m||e[20]!==g||e[21]!==x||e[22]!==h||e[23]!==y||e[24]!==j?(k=t.jsxs("div",{className:"flex flex-col gap-4",children:[f,m,g,x,h,y,j]}),e[19]=m,e[20]=g,e[21]=x,e[22]=h,e[23]=y,e[24]=j,e[25]=k):k=e[25],k}const gs=pe("no-underline flex items-center gap-5 rounded-3xl border border-ink-black/10 dark:border-ink-white/10 p-5 text-left w-full","bg-ink-paper dark:bg-ink-white/5");function ys(s){const e=W.c(16),{icon:n,title:l,lastUpdatedAtUtc:a,eyebrow:u}=s;let o;e[0]!==n?(o=t.jsx("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-xl bg-ink-black/10 dark:bg-ink-white/10",children:t.jsx(n,{className:"size-6 text-ink-black dark:text-ink-white"})}),e[0]=n,e[1]=o):o=e[1];let d;e[2]!==u?(d=u&&t.jsx(ie,{size:"xs",variant:"label",inactive:!0,children:u}),e[2]=u,e[3]=d):d=e[3];let r;e[4]!==l?(r=t.jsx($e,{size:"lg",className:"truncate",children:l}),e[4]=l,e[5]=r):r=e[5];let c;e[6]!==a?(c=a&&t.jsxs(ie,{size:"sm",inactive:!0,children:["Updated ",jn(a)," ago"]}),e[6]=a,e[7]=c):c=e[7];let i;e[8]!==d||e[9]!==r||e[10]!==c?(i=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[d,r,c]}),e[8]=d,e[9]=r,e[10]=c,e[11]=i):i=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Nt,{className:"size-6 shrink-0 text-ink-black dark:text-ink-white"}),e[12]=f):f=e[12];let m;return e[13]!==o||e[14]!==i?(m=t.jsxs(t.Fragment,{children:[o,i,f]}),e[13]=o,e[14]=i,e[15]=m):m=e[15],m}function Ze(s){const e=W.c(8);let n,l;e[0]!==s?({to:l,...n}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let a;e[3]!==n?(a=t.jsx(ys,{...n}),e[3]=n,e[4]=a):a=e[4];let u;return e[5]!==a||e[6]!==l?(u=t.jsx(_e,{to:l,preventScrollReset:!0,viewTransition:!0,className:gs,children:a}),e[5]=a,e[6]=l,e[7]=u):u=e[7],u}function Gn(s){const e=W.c(17),{bookSettings:n,hostStudioProfile:l,isStudioProfileLoading:a}=s,u=tt(),{handle:o,personId:d}=Oe();let r;e[0]!==l?.galleryImageUrls||e[1]!==a?(r=a?t.jsx(Mt,{className:"h-25 w-30 shrink-0 rounded-2xl"}):t.jsx("div",{className:"relative h-25 w-30 shrink-0 overflow-hidden rounded-2xl",children:(l?.galleryImageUrls||[]).length>0?t.jsx("img",{src:l?.galleryImageUrls[0],alt:"",className:"absolute inset-0 size-full object-cover"}):t.jsx("div",{className:"flex size-full items-center justify-center bg-ink-black-50/50",children:t.jsx(Ys,{className:"size-6 text-ink-black/20 dark:text-ink-white/20"})})}),e[0]=l?.galleryImageUrls,e[1]=a,e[2]=r):r=e[2];let c;e[3]!==l?.name||e[4]!==a?(c=t.jsxs(ie,{size:"base",children:["This is your dedicated book for guesting at"," ",a?t.jsx(Mt,{className:"inline-block w-22"}):t.jsx("strong",{className:"font-bold",children:l?.name||"the studio"})]}),e[3]=l?.name,e[4]=a,e[5]=c):c=e[5];let i;e[6]!==n.guestSpotApplicationId||e[7]!==u||e[8]!==o||e[9]!==d?(i=n.guestSpotApplicationId&&t.jsx(_e,{to:u("guestSpotApplication",{handle:o,personId:d,applicationId:n.guestSpotApplicationId}),className:He({variant:"secondary",size:"sm",className:"text-center"}),children:"View your spot"}),e[6]=n.guestSpotApplicationId,e[7]=u,e[8]=o,e[9]=d,e[10]=i):i=e[10];let f;e[11]!==c||e[12]!==i?(f=t.jsxs("div",{className:"flex flex-col gap-4",children:[c,i]}),e[11]=c,e[12]=i,e[13]=f):f=e[13];let m;
1return e[14]!==r||e[15]!==f?(m=t.jsx(As,{className:"bg-ink-paper rounded-3xl",children:t.jsxs("div",{className:"flex flex-row gap-4 justify-between items-center",children:[r,f]})}),e[14]=r,e[15]=f,e[16]=m):m=e[16],m}function Yn(s){const e=W.c(16),{bookSettings:n}=s,l=n.name||"Untitled book";let a;e[0]!==l?(a=t.jsx($e,{size:"2xl",className:"min-w-0 break-words group-hover:underline",children:l}),e[0]=l,e[1]=a):a=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(os,{className:"size-5 text-ink-black-400 shrink-0"}),e[2]=u):u=e[2];let o;e[3]!==a?(o=t.jsxs(_e,{to:"edit-name",viewTransition:!0,preventScrollReset:!0,className:"no-underline group flex items-center gap-3 min-w-0",children:[a,u]}),e[3]=a,e[4]=o):o=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=pe("no-underline flex items-center gap-2 rounded-full px-3 py-1.5","bg-ink-black/5 dark:bg-ink-white/5"),e[5]=d):d=e[5];let r;e[6]!==n.tagColor?(r=t.jsx(Ks,{className:"size-3.5",style:{fill:n.tagColor,color:n.tagColor}}),e[6]=n.tagColor,e[7]=r):r=e[7];let c;e[8]!==n.tag?(c=t.jsx(ie,{variant:"label",size:"xs",inactive:!0,children:n.tag}),e[8]=n.tag,e[9]=c):c=e[9];let i;e[10]!==r||e[11]!==c?(i=t.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 shrink-0",children:t.jsxs(_e,{to:"edit-tag",viewTransition:!0,preventScrollReset:!0,className:d,children:[r,c]})}),e[10]=r,e[11]=c,e[12]=i):i=e[12];let f;return e[13]!==o||e[14]!==i?(f=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[13]=o,e[14]=i,e[15]=f):f=e[15],f}function Kn(s){const e=W.c(13),{studioName:n,href:l}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Zs,{className:"size-5 shrink-0 text-ink-black dark:text-ink-white"}),e[0]=a):a=e[0];let u;e[1]!==n?(u=t.jsx($e,{size:"base",className:"truncate leading-tight",children:n}),e[1]=n,e[2]=u):u=e[2];let o;e[3]!==l?(o=!!l&&t.jsx(ie,{size:"sm",inactive:!0,className:"underline leading-tight",children:"Change studio"}),e[3]=l,e[4]=o):o=e[4];let d;e[5]!==u||e[6]!==o?(d=t.jsxs(t.Fragment,{children:[a,t.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[u,o]})]}),e[5]=u,e[6]=o,e[7]=d):d=e[7];const r=d;if(!l){let i;return e[8]!==r?(i=t.jsx("div",{className:"inline-flex items-center gap-3 self-start no-underline",children:r}),e[8]=r,e[9]=i):i=e[9],i}let c;return e[10]!==r||e[11]!==l?(c=t.jsx(_e,{to:l,viewTransition:!0,preventScrollReset:!0,className:"inline-flex items-center gap-3 self-start no-underline",children:r}),e[10]=r,e[11]=l,e[12]=c):c=e[12],c}function it(s){const e=W.c(7),{label:n,children:l}=s;let a;e[0]!==n?(a=t.jsx(ie,{size:"sm",variant:"label",inactive:!0,className:"px-1",children:n}),e[0]=n,e[1]=a):a=e[1];let u;e[2]!==l?(u=t.jsx("div",{className:"flex flex-col",children:l}),e[2]=l,e[3]=u):u=e[3];let o;return e[4]!==a||e[5]!==u?(o=t.jsxs("div",{className:"flex flex-col gap-1",children:[a,u]}),e[4]=a,e[5]=u,e[6]=o):o=e[6],o}function ge(s){const e=W.c(37),{icon:n,label:l,subtext:a,value:u,isLast:o,disabled:d,href:r,externalHref:c,preventScrollReset:i}=s,f=!!r&&!d,m=u!=null&&u!=="",g=!!a;let x;e[0]!==n?(x=t.jsx(n,{className:"size-6 shrink-0 text-ink-black dark:text-ink-white"}),e[0]=n,e[1]=x):x=e[1];let h;e[2]!==l?(h=t.jsx($e,{size:"lg",children:l}),e[2]=l,e[3]=h):h=e[3];let y;e[4]!==m||e[5]!==u?(y=m&&t.jsx(ie,{size:"sm",inactive:!0,className:"truncate",children:u}),e[4]=m,e[5]=u,e[6]=y):y=e[6];let j;e[7]!==g||e[8]!==a?(j=g&&(typeof a=="string"?t.jsx(ie,{size:"sm",inactive:!0,className:"truncate",children:a}):a),e[7]=g,e[8]=a,e[9]=j):j=e[9];let k;e[10]!==h||e[11]!==y||e[12]!==j?(k=t.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[h,y,j]}),e[10]=h,e[11]=y,e[12]=j,e[13]=k):k=e[13];let b;e[14]!==x||e[15]!==k?(b=t.jsxs("div",{className:"flex flex-1 items-center gap-5 min-w-0",children:[x,k]}),e[14]=x,e[15]=k,e[16]=b):b=e[16];let p;e[17]!==f?(p=f&&t.jsx(Nt,{className:"size-6 shrink-0 text-ink-black dark:text-ink-white"}),e[17]=f,e[18]=p):p=e[18];let v;e[19]!==b||e[20]!==p?(v=t.jsxs(t.Fragment,{children:[b,p]}),e[19]=b,e[20]=p,e[21]=v):v=e[21];const S=v,w=!o&&"border-b border-ink-black/10",C=d&&"opacity-50";let A;e[22]!==C||e[23]!==w?(A=pe("flex w-full items-center gap-4 py-5 text-left no-underline",w,C),e[22]=C,e[23]=w,e[24]=A):A=e[24];const F=A;
1if(c&&!d){let D;return e[25]!==F||e[26]!==S||e[27]!==c?(D=t.jsx("a",{href:c,target:"_blank",rel:"noreferrer",className:F,children:S}),e[25]=F,e[26]=S,e[27]=c,e[28]=D):D=e[28],D}if(r&&!d){let D;return e[29]!==F||e[30]!==S||e[31]!==r||e[32]!==i?(D=t.jsx(_e,{to:r,viewTransition:!0,preventScrollReset:i,className:F,children:S}),e[29]=F,e[30]=S,e[31]=r,e[32]=i,e[33]=D):D=e[33],D}let N;return e[34]!==F||e[35]!==S?(N=t.jsx("div",{className:F,children:S}),e[34]=F,e[35]=S,e[36]=N):N=e[36],N}function Zn(s){const e=W.c(118),{bookSettings:n,weekStartDay:l,useTypeformForCustomRequests:a,hideArchiveButton:u}=s,{data:o}=U.getPaymentSettings.useQuery(n.providerId),d=n.hostStudioId??"";let r;e[0]!==d?(r={studioOrManagerPersonId:d},e[0]=d,e[1]=r):r=e[1];const c=!!n.hostStudioId;let i;e[2]!==c?(i={enabled:c},e[2]=c,e[3]=i):i=e[3];const{data:f,isLoading:m}=U.getStudioProfile.useQuery(r,i),{isEnabled:g}=Zt("terminal-reader-payments",n.providerId),x=!!n.flashEventId,h=!!n.isGuestBook,y=!!n.defaultClientSelectsTime,j=n.defaultDepositAmountCents??0,k=n.defaultDepositCurrency??"USD";let b;e[4]!==j||e[5]!==k?(b=Xt(j,k),e[4]=j,e[5]=k,e[6]=b):b=e[6];const p=b,v=n.defaultDepositClientPaysFeePercent??0,S=v===100?"Client pays":v===0?"Artist pays":v===50?"Split":v>50?"Client pays":"Artist pays";let w;e[7]!==o?(w=o?.isGratuityEnabled?[o.gratuity1BasisPoints,o.gratuity2BasisPoints,o.gratuity3BasisPoints].map(Xn).join(", "):"Disabled",e[7]=o,e[8]=w):w=e[8];const C=w;let A;e[9]!==x?(A=x&&t.jsx(Jt,{className:"bg-ink-black-50 dark:bg-ink-black-800",children:t.jsxs(ie,{element:"p",size:"sm",className:"text-ink-black-600",children:[t.jsx("strong",{children:"Staff Only:"})," This is a flash event book. Some settings are managed by the flash event configuration and cannot be edited here."]})}),e[9]=x,e[10]=A):A=e[10];let F;e[11]!==n?(F=t.jsx(Yn,{bookSettings:n}),e[11]=n,e[12]=F):F=e[12];const N=x||h?void 0:"edit-studio";let D;e[13]!==n.studio.name||e[14]!==N?(D=t.jsx(Kn,{studioName:n.studio.name,href:N}),e[13]=n.studio.name,e[14]=N,e[15]=D):D=e[15];let T;e[16]!==n||e[17]!==f||e[18]!==h||e[19]!==m?(T=h&&t.jsx(Gn,{bookSettings:n,hostStudioProfile:f??null,isStudioProfileLoading:m}),e[16]=n,e[17]=f,e[18]=h,e[19]=m,e[20]=T):T=e[20];let _;e[21]!==n?(_=t.jsx(Wn,{bookSettings:n}),e[21]=n,e[22]=_):_=e[22];let O;e[23]!==n||e[24]!==a?(O=t.jsx(Vn,{useTypeformForCustomRequests:a,bookSettings:n}),e[23]=n,e[24]=a,e[25]=O):O=e[25];let B;e[26]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx($e,{size:"xl",className:"px-1",children:"Settings"}),e[26]=B):B=e[26];let I;e[27]!==n.workingHoursMinutesOfDay||e[28]!==l?(I=t.jsx(hn,{availableDays:n.workingHoursMinutesOfDay,weekStartDay:l}),e[27]=n.workingHoursMinutesOfDay,e[28]=l,e[29]=I):I=e[29];const $=x?void 0:"edit-daily-working-hours";let M;e[30]!==x||e[31]!==I||e[32]!==$?(M=t.jsx(ge,{icon:tn,label:"Working hours",value:I,href:$,isLast:!1,preventScrollReset:!0,disabled:x}),e[30]=x,e[31]=I,e[32]=$,e[33]=M):M=e[33];let R;e[34]!==n.maxAppointmentDate||e[35]!==n.maxAppointmentTimeFromTodayQuantity||e[36]!==n.maxAppointmentTimeFromTodayUnit||e[37]!==n.minAppointmentDate?(R=t.jsx(Un,{minDate:n.minAppointmentDate,maxDate:n.maxAppointmentDate,quantity:n.maxAppointmentTimeFromTodayQuantity,unit:n.maxAppointmentTimeFromTodayUnit}),e[34]=n.maxAppointmentDate,e[35]=n.maxAppointmentTimeFromTodayQuantity,e[36]=n.maxAppointmentTimeFromTodayUnit,e[37]=n.minAppointmentDate,e[38]=R):R=e[38];const E=x?void 0:"edit-booking-range";let H;e[39]!==x||e[40]!==R||e[41]!==E?(H=t.jsx(ge,{icon:sn,label:"Booking range",value:R,href:E,isLast:!1,preventScrollReset:!0,disabled:x}),e[39]=x,e[40]=R,e[41]=E,e[42]=H):H=e[42];let z;e[43]!==n.minAppointmentTimeFromTodayQuantity||e[44]!==n.minAppointmentTimeFromTodayUnit?(z=t.jsx(zn,{quantity:n.minAppointmentTimeFromTodayQuantity,unit:n.minAppointmentTimeFromTodayUnit}),e[43]=n.minAppointmentTimeFromTodayQuantity,e[44]=n.minAppointmentTimeFromTodayUnit,e[45]=z):z=e[45];const L=x?void 0:"edit-minimum-notice";let Q;e[46]!==x||e[47]!==z||e[48]!==L?(Q=t.jsx(ge,{icon:_s,label:"Minimum notice",value:z,href:L,isLast:!1,preventScrollReset:!0,disabled:x}),e[46]=x,e[47]=z,e[48]=L,e[49]=Q):Q=e[49];const q=`${n.startTimeIncrementMinutes} minutes`,G=x?void 0:"edit-time-selection";let V;e[50]!==x||e[51]!==q||e[52]!==G?(V=t.jsx(ge,{icon:yt,label:"Time selection",value:q,href:G,isLast:!1,preventScrollReset:!0,disabled:x}),e[50]=x,e[51]=q,e[52]=G,e[53]=V):V=e[53];let Y;e[54]!==n.clientReschedule||e[55]!==y||e[56]!==x?(Y=y&&!x&&t.jsxs(t.Fragment,{children:[t.jsx(ge,{icon:Xs,label:"Starting times",value:"Configure",href:"edit-time-slots",isLast:!1,preventScrollReset:!0}),t.jsx(ge,{icon:as,label:"Allow client to reschedule",value:n.clientReschedule.enabled?"Enabled":"Disabled",href:"edit-allow-client-reschedule",isLast:!1,preventScrollReset:!0})]}),e[54]=n.clientReschedule,e[55]=y,e[56]=x,e[57]=Y):Y=e[57];const K=y?"Direct book":"Send dates",ne=x?void 0:"edit-booking-method";let te;
1e[58]!==x||e[59]!==K||e[60]!==ne?(te=t.jsx(ge,{icon:nn,label:"Booking method",value:K,href:ne,isLast:!0,preventScrollReset:!0,disabled:x}),e[58]=x,e[59]=K,e[60]=ne,e[61]=te):te=e[61];let X;e[62]!==M||e[63]!==H||e[64]!==Q||e[65]!==V||e[66]!==Y||e[67]!==te?(X=t.jsxs(it,{label:"Scheduling",children:[M,H,Q,V,Y,te]}),e[62]=M,e[63]=H,e[64]=Q,e[65]=V,e[66]=Y,e[67]=te,e[68]=X):X=e[68];let le;e[69]!==n.depositLabel?(le=St(n.depositLabel),e[69]=n.depositLabel,e[70]=le):le=e[70];const J=`Default ${le.lower}`;let ee;e[71]!==p||e[72]!==J?(ee=t.jsx(ge,{icon:jt,label:J,subtext:"Amount and what clients call it",value:p,href:"edit-deposit-amount",isLast:!1,preventScrollReset:!0}),e[71]=p,e[72]=J,e[73]=ee):ee=e[73];const ue=n.defaultDepositCurrency??"";let ae;e[74]!==ue?(ae=t.jsx(ge,{icon:kt,label:"Currency",value:ue,href:"edit-deposit-currency",isLast:!1,preventScrollReset:!0}),e[74]=ue,e[75]=ae):ae=e[75];let re;e[76]!==S?(re=t.jsx(ge,{icon:zt,label:"Booking fee",value:S,href:"edit-fee-payer",isLast:!0,preventScrollReset:!0}),e[76]=S,e[77]=re):re=e[77];let oe;e[78]!==ee||e[79]!==ae||e[80]!==re?(oe=t.jsxs(it,{label:"Pricing",children:[ee,ae,re]}),e[78]=ee,e[79]=ae,e[80]=re,e[81]=oe):oe=e[81];const de=`${n.defaultSalesTaxPercentage}%`;let fe;e[82]!==de?(fe=t.jsx(ge,{icon:zt,label:"Sales tax",value:de,href:"edit-sales-tax",isLast:!1,preventScrollReset:!0}),e[82]=de,e[83]=fe):fe=e[83];let xe;e[84]!==C?(xe=t.jsx(ge,{icon:kt,label:"Tips",value:C,href:"edit-tip-amounts",isLast:!1,preventScrollReset:!0}),e[84]=C,e[85]=xe):xe=e[85];let ye;e[86]!==g?(ye=g&&t.jsx(ge,{icon:rs,label:"Card readers",href:"terminal-readers",isLast:!1,preventScrollReset:!0}),e[86]=g,e[87]=ye):ye=e[87];const ke=n.bookingTerms.showTerms?"On":"Off";let je;e[88]!==ke?(je=t.jsx(ge,{icon:ln,label:"Terms and conditions",value:ke,href:"edit-terms",isLast:!0,preventScrollReset:!0}),e[88]=ke,e[89]=je):je=e[89];let ce;e[90]!==fe||e[91]!==xe||e[92]!==ye||e[93]!==je?(ce=t.jsxs(it,{label:"Payments",children:[fe,xe,ye,je]}),e[90]=fe,e[91]=xe,e[92]=ye,e[93]=je,e[94]=ce):ce=e[94];let me;e[95]!==n.consentFormId||e[96]!==n.consentFormNotes||e[97]!==n.consentFormSubmissionWindowHours?(me=n.consentFormId&&t.jsxs(it,{label:"Consent form settings",children:[t.jsx(ge,{icon:Js,label:"Lot numbers",value:n.consentFormNotes?t.jsx("span",{className:"inline-block max-w-[150px] truncate",children:n.consentFormNotes}):"None",href:"edit-consent-form-lot-numbers",isLast:!1,preventScrollReset:!0}),t.jsx(ge,{icon:yt,label:"Availability",value:n.consentFormSubmissionWindowHours===null?"Anytime":`${n.consentFormSubmissionWindowHours}h before`,href:"edit-consent-form-submission-window",isLast:!0,preventScrollReset:!0})]}),e[95]=n.consentFormId,e[96]=n.consentFormNotes,e[97]=n.consentFormSubmissionWindowHours,e[98]=me):me=e[98];let he;e[99]!==n.isArchived||e[100]!==u||e[101]!==h?(he=!u&&!n.isArchived&&t.jsxs(_e,{to:"archive-book",preventScrollReset:!0,className:"no-underline flex items-center justify-center gap-2 rounded-full border border-ink-black-100 dark:border-ink-black-800 py-3 text-ink-destructive",children:[t.jsx(en,{className:"size-5"}),t.jsx(ie,{variant:"heading",size:"base",className:"text-ink-destructive",children:h?"Cancel guest spot and archive book":"Archive book"})]}),e[99]=n.isArchived,e[100]=u,e[101]=h,e[102]=he):he=e[102];let Se;e[103]!==n?(Se=t.jsx(Jn,{bookSettings:n}),e[103]=n,e[104]=Se):Se=e[104];let Ne;return e[105]!==F||e[106]!==D||e[107]!==T||e[108]!==_||e[109]!==O||e[110]!==X||e[111]!==oe||e[112]!==ce||e[113]!==me||e[114]!==he||e[115]!==Se||e[116]!==A?(Ne=t.jsxs("div",{className:"flex flex-col gap-8 p-5",children:[A,F,D,T,_,O,B,X,oe,ce,me,he,Se]}),e[105]=F,e[106]=D,e[107]=T,e[108]=_,e[109]=O,e[110]=X,e[111]=oe,e[112]=ce,e[113]=me,e[114]=he,e[115]=Se,e[116]=A,e[117]=Ne):Ne=e[117],Ne}function Xn(s){return`${Math.floor(s/100)}%`}function Jn(s){const e=W.c(19),{bookSettings:n}=s;let l;e[0]!==n.isArchived?(l=n.isArchived&&t.jsx(ge,{icon:on,label:"Unarchive book",subtext:"Restore this archived book so the artist can take bookings again.",href:"unarchive-book",isLast:!1,preventScrollReset:!0}),e[0]=n.isArchived,e[1]=l):l=e[1];const a=`https://admin.typeform.com/form/${n.requestTypeformFormId}/create`;let u;e[2]!==a?(u=t.jsx(ge,{icon:cn,label:"Edit Request Typeform",externalHref:a,isLast:!1}),e[2]=a,e[3]=u):u=e[3];let o,d;e[4]!==n.waiverTypeformFormId?(o=t.jsx(ge,{icon:an,label:"Waiver Typeform Form ID",value:n.waiverTypeformFormId,href:"edit-waiver-typeform-form-id",isLast:!1,preventScrollReset:!0}),d=n.waiverTypeformFormId&&t.jsx(ge,{icon:rn,label:"Edit Waiver Typeform",externalHref:`https://admin.typeform.com/form/${n.waiverTypeformFormId}/create`,isLast:!1}),e[4]=n.waiverTypeformFormId,e[5]=o,e[6]=d):(o=e[5],d=e[6]);let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ge,{icon:os,label:"Edit service title and description",href:"edit-service-title-and-description",isLast:!1,preventScrollReset:!0}),e[7]=r):r=e[7];const c=n.maxAppointmentDurationMinutes===null?"No limit":`${n.maxAppointmentDurationMinutes} minutes`;let i;e[8]!==c?(i=t.jsx(ge,{icon:yt,label:"Max. appointment duration",value:c,href:"edit-max-appointment-duration",isLast:!1,preventScrollReset:!0}),e[8]=c,e[9]=i):i=e[9];const f=n.zeroDollarDepositsDisallowedAt===null?"Always allowed":"Restricted";let m;e[10]!==f?(m=t.jsx(ge,{icon:dn,label:"$0 deposits",value:f,href:"edit-zero-dollar-deposit-disallowed-at",isLast:!0,preventScrollReset:!0}
1),e[10]=f,e[11]=m):m=e[11];let g;return e[12]!==l||e[13]!==m||e[14]!==u||e[15]!==o||e[16]!==d||e[17]!==i?(g=t.jsx(Jt,{children:t.jsxs(it,{label:"Venue staff",children:[l,u,o,d,r,i,m]})}),e[12]=l,e[13]=m,e[14]=u,e[15]=o,e[16]=d,e[17]=i,e[18]=g):g=e[18],g}function ei(s){const e=W.c(17),{children:n}=s,{bookId:l}=st(),a=!!l;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(l,u),{personId:r,isLoading:c}=Oe(),i=!!r;let f;e[2]!==i?(f={enabled:i},e[2]=i,e[3]=f):f=e[3];const{data:m,isLoading:g}=U.getPersonSettings.useQuery(r,f);if(d||c||g){let p;return e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(lt,{}),e[4]=p):p=e[4],p}if(!l){let p;return e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Be,{code:Ie.hookUseParams_bookId}),e[5]=p):p=e[5],p}if(!r){let p;return e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Be,{code:Ie.hookUseProviderFromRoute}),e[6]=p):p=e[6],p}if(!o){let p;return e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Be,{code:Ie.getBookSettings}),e[7]=p):p=e[7],p}let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(es,{backHref:"..",relative:"route",className:"border-b-transparent"}),e[8]=x):x=e[8];const h=m?.weekStartDay??0,y=m?.useTypeformForCustomRequests??!0,j=!o.hasMultipleBooks;let k;e[9]!==o||e[10]!==h||e[11]!==y||e[12]!==j?(k=t.jsx(Zn,{bookSettings:o,weekStartDay:h,useTypeformForCustomRequests:y,hideArchiveButton:j}),e[9]=o,e[10]=h,e[11]=y,e[12]=j,e[13]=k):k=e[13];let b;return e[14]!==n||e[15]!==k?(b=t.jsx(ts,{headerSlot:x,children:t.jsxs(ss,{children:[k,n]})}),e[14]=n,e[15]=k,e[16]=b):b=e[16],b}function jo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ei,{children:t.jsx(cs,{})}),s[0]=e):e=s[0],e}function ti(s){const e=W.c(4);let n;e[0]!==s?({...n}=s,e[0]=s,e[1]=n):n=e[1];let l;return e[2]!==n?(l=t.jsx(Is,{inverted:!0,...n}),e[2]=n,e[3]=l):l=e[3],l}
1function si(s){const e=W.c(40),{bookSettings:n}=s,{handle:l}=Oe(),a=!!n?.providerId;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o}=U.getPaymentSettings.useQuery(n.providerId,u),{isEnabled:d}=Zt("terminal-reader-payments",n?.providerId),r=tt();if(!n||!o)return null;let c;const i=n.defaultDepositClientPaysFeePercent;i===100?c="Client pays":i===0?c="Artist pays":i===50?c="Split":c=i>50?"Client pays":"Artist pays";let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ds,{children:"Payments"}),e[2]=f):f=e[2];const m=n.defaultDepositCurrency||"";let g;e[3]!==m?(g=t.jsx(Ue,{hasChevron:!0,icon:kt,label:"Currency",href:"edit-deposit-currency",value:m,preventScrollReset:!0}),e[3]=m,e[4]=g):g=e[4];let x;e[5]!==n.depositLabel?(x=St(n.depositLabel),e[5]=n.depositLabel,e[6]=x):x=e[6];const h=`${x.noun} amount`,y=n.defaultDepositAmountCents||0,j=n.defaultDepositCurrency||"USD";let k;e[7]!==y||e[8]!==j?(k=Xt(y,j),e[7]=y,e[8]=j,e[9]=k):k=e[9];let b;e[10]!==k||e[11]!==h?(b=t.jsx(Ue,{hasChevron:!0,icon:jt,label:h,href:"edit-deposit-amount",value:k,preventScrollReset:!0}),e[10]=k,e[11]=h,e[12]=b):b=e[12];const p=`${n.defaultSalesTaxPercentage}%`;let v;e[13]!==p?(v=t.jsx(Ue,{hasChevron:!0,icon:Ts,label:"Sales tax",value:p,href:"edit-sales-tax",preventScrollReset:!0}),e[13]=p,e[14]=v):v=e[14];let S;e[15]!==c?(S=t.jsx(Ue,{hasChevron:!0,icon:ti,label:"Booking fee",href:"edit-fee-payer",value:c,preventScrollReset:!0}),e[15]=c,e[16]=S):S=e[16];let w;e[17]!==o.gratuity1BasisPoints||e[18]!==o.gratuity2BasisPoints||e[19]!==o.gratuity3BasisPoints||e[20]!==o.isGratuityEnabled?(w=o.isGratuityEnabled?[o.gratuity1BasisPoints,o.gratuity2BasisPoints,o.gratuity3BasisPoints].map(ni).join(", ").concat("%"):"Disabled",e[17]=o.gratuity1BasisPoints,e[18]=o.gratuity2BasisPoints,e[19]=o.gratuity3BasisPoints,e[20]=o.isGratuityEnabled,e[21]=w):w=e[21];let C;e[22]!==w?(C=t.jsx(Ue,{hasChevron:!0,icon:xn,label:"Tip amounts",href:"edit-tip-amounts",value:w,preventScrollReset:!0}),e[22]=w,e[23]=C):C=e[23];let A;e[24]!==n.providerId||e[25]!==r||e[26]!==l?(A=r("paymentMethods",{personId:n.providerId,handle:l}),e[24]=n.providerId,e[25]=r,e[26]=l,e[27]=A):A=e[27];let F;e[28]!==A?(F=t.jsx(Ue,{hasChevron:!0,icon:jt,label:"Payment methods",href:A}),e[28]=A,e[29]=F):F=e[29];let N;e[30]!==d?(N=d&&t.jsx(Ue,{hasChevron:!0,icon:rs,label:"Card readers",href:"terminal-readers",preventScrollReset:!0}),e[30]=d,e[31]=N):N=e[31];let D;return e[32]!==b||e[33]!==v||e[34]!==S||e[35]!==C||e[36]!==F||e[37]!==N||e[38]!==g?(D=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[f,t.jsxs(Bs,{children:[g,b,v,S,C,F,N]})]}),e[32]=b,e[33]=v,e[34]=S,e[35]=C,e[36]=F,e[37]=N,e[38]=g,e[39]=D):D=e[39],D}function ni(s){return Math.floor(s/100)}function ii(s){const e=W.c(11),{children:n}=s,{bookId:l}=st(),a=!!l;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(l,u);if(d){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(lt,{}),e[2]=f):f=e[2],f}if(!l){let f;return e[3]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{code:Ie.hookUseParams_bookId}),e[3]=f):f=e[3],f}if(!o){let f;return e[4]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{code:Ie.getBookSettings}),e[4]=f):f=e[4],f}let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"bg-ink-white dark:bg-ink-black-900",children:t.jsx(es,{backHref:"..",relative:"route",children:"Payment"})}),e[5]=r):r=e[5];let c;e[6]!==o?(c=t.jsx(si,{bookSettings:o}),e[6]=o,e[7]=c):c=e[7];let i;return e[8]!==n||e[9]!==c?(i=t.jsx(ts,{headerSlot:r,children:t.jsxs(ss,{className:"px-4 pt-4",children:[c,n]})}),e[8]=n,e[9]=c,e[10]=i):i=e[10],i}function vo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ii,{children:t.jsx(cs,{})}),s[0]=e):e=s[0],e}const li=se.object({bookId:se.string(),enabled:se.boolean(),amountOfNotice:se.number().int().min(0).max(32767).nullable()}).refine(s=>!s.enabled||s.amountOfNotice!==null,{message:"Required",path:["amountOfNotice"]});function oi(s){const e=Number.parseInt(s,10);if(isNaN(e)||e<0)return"";if(e===0)return"Client can reschedule anytime";const n=Math.floor(e/24),l=e%24;let a="Client can reschedule up to";return n>0&&(a+=` ${n} ${n>1?"days":"day"}`),l>0&&(a+=` ${n>0?"and":""} ${l} ${l>1?"hours":"hour"}`),a+=" before",a}function ai(s){const e=W.c(57),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(n,u),[r,c]=P.useState(!0),[i,f]=P.useState(!1),[m,g]=P.useState(o?.clientReschedule.enabled||!1);let x;e[2]!==o?.clientReschedule.amountOfNotice?(x=o?.clientReschedule.amountOfNotice?.toString()||"",e[2]=o?.clientReschedule.amountOfNotice,e[3]=x):x=e[3];const[h,y]=P.useState(x),j=U.useUtils();let k;e[4]!==n||e[5]!==j?(k={onSuccess:async()=>{await j.getBookSettings.invalidate(n)}},e[4]=n,e[5]=j,e[6]=k):k=e[6];const{mutateAsync:b}=U.updateBookClientReschedule.useMutation(k);let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={},e[7]=p):p=e[7];const[v,S]=P.useState(p);let w,C;e[8]!==o?(w=()=>{o&&(g(o.clientReschedule.enabled),y(o.clientReschedule.amountOfNotice?.toString()||"48"))},C=[o],e[8]=o,e[9]=w,e[10]=C):(w=e[9],C=e[10]),P.useEffect(w,C);let A;e[11]!==l?(A=()=>{c(!1),l()},e[11]=l,e[12]=A):A=e[12];const F=A;let N;e[13]!==h||e[14]!==o||e[15]!==F||e[16]!==m||e[17]!==b?(N=async Y=>{if(Y.preventDefault(),!o)return;f(!0);const K=li.safeParse({bookId:o?.id,enabled:m,amountOfNotice:isNaN(Number.parseInt(h))?null:Number.parseInt(h)});if(!K.success){S(K.error.flatten().fieldErrors),f(!1);return}await b({bookId:K.data.bookId,enabled:K.data.enabled,amountOfNotice:K.data.amountOfNotice??48}),f(!1),F()},e[13]=h,e[14]=o,e[15]=F,e[16]=m,e[17]=b,e[18]=N):N=e[18];const D=N;if(d)return null;let T;e[19]!==F?(T=Y=>{Y||F()},e[19]=F,e[20]=T):T=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ve,{children:"Client Reschedule"}),e[21]=_):_=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ie,{size:"base",className:"leading-snug text-ink-black",children:"Allow client to reschedule"}),t.jsx(ie,{size:"sm",className:"text-ink-black-600",children:"Clients can reschedule on their own"})]}),e[22]=O):O=e[22];let B;e[23]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{g(ri)},e[23]=B):B=e[23];let I;e[24]!==m?(I=t.jsxs("div",{className:"flex flex-row justify-between",children:[O,t.jsx(fs,{checked:m,onCheckedChange:B})]}),e[24]=m,e[25]=I):I=e[25];const $=!m;let M;
1e[26]!==h||e[27]!==$?(M=t.jsx(et,{label:"Amount of notice",type:"number",inputMode:"decimal",onChangeValue:y,value:h,disabled:$}),e[26]=h,e[27]=$,e[28]=M):M=e[28];let R;e[29]!==v.amountOfNotice?(R=t.jsx(ot,{errors:v.amountOfNotice,className:"pt-2"}),e[29]=v.amountOfNotice,e[30]=R):R=e[30];let E;e[31]!==h||e[32]!==m||e[33]!==v.amountOfNotice?(E=!v.amountOfNotice&&m&&t.jsx(ie,{element:"span",size:"xs",className:"leading-tighter text-ink-black-600",children:oi(h)}),e[31]=h,e[32]=m,e[33]=v.amountOfNotice,e[34]=E):E=e[34];let H;e[35]!==M||e[36]!==R||e[37]!==E?(H=t.jsxs("div",{className:"flex flex-col gap-3 rounded-lg",children:[M,R,E]}),e[35]=M,e[36]=R,e[37]=E,e[38]=H):H=e[38];let z;e[39]!==I||e[40]!==H?(z=t.jsxs("div",{className:"flex flex-col p-5 gap-5",children:[I,H]}),e[39]=I,e[40]=H,e[41]=z):z=e[41];let L;e[42]!==F?(L=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:F,children:"Cancel"}),e[42]=F,e[43]=L):L=e[43];let Q;e[44]!==i?(Q=t.jsx(Z,{variant:"primary",fullWidth:!0,disabled:i,submit:!0,children:"Update"}),e[44]=i,e[45]=Q):Q=e[45];let q;e[46]!==L||e[47]!==Q?(q=t.jsxs(Ae,{variant:"inline",children:[L,Q]}),e[46]=L,e[47]=Q,e[48]=q):q=e[48];let G;e[49]!==D||e[50]!==z||e[51]!==q?(G=t.jsxs(we,{showClose:!1,children:[_,t.jsxs("form",{onSubmit:D,children:[z,q]})]}),e[49]=D,e[50]=z,e[51]=q,e[52]=G):G=e[52];let V;return e[53]!==r||e[54]!==T||e[55]!==G?(V=t.jsx(Ce,{open:r,onOpenChange:T,children:G}),e[53]=r,e[54]=T,e[55]=G,e[56]=V):V=e[56],V}function ri(s){return!s}function be(s){const e=W.c(8),{sheet:n}=s,{bookId:l}=st(),a=Le(),u=Ft();if(!l){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Be,{code:Ie.hookUseParams_bookId}),e[0]=r):r=e[0],r}let o;e[1]!==u.state||e[2]!==a?(o=()=>{u.state?.returnTo?a(u.state.returnTo,{preventScrollReset:!0}):a("../",{preventScrollReset:!0})},e[1]=u.state,e[2]=a,e[3]=o):o=e[3];let d;return e[4]!==n||e[5]!==l||e[6]!==o?(d=t.jsx(n,{bookId:l,onHidden:o},l),e[4]=n,e[5]=l,e[6]=o,e[7]=d):d=e[7],d}function So(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:ai}),s[0]=e):e=s[0],e}function ci({bookId:s,onHidden:e}){const{data:n,isLoading:l}=U.getBookSettings.useQuery(s),a=U.useUtils(),{toast:u}=De(),[o,d]=P.useState(!0),[r,c]=P.useState(null),[i,f]=P.useState(0),[m,g]=P.useState(!1),[x,h]=P.useState(!1),y=U.countActiveAutoSchedulingOffers.useQuery({bookId:s},{enabled:!1}),{mutateAsync:j,isPending:k}=U.updateBook.useMutation({onSuccess:()=>a.getBookSettings.invalidate(),onError:()=>{u({title:"Couldn't update booking method",description:"Please try again.",variant:"error"})}}),b=()=>{d(!1),e()},p=!!n?.defaultClientSelectsTime,v=r??p,S=async(A,F)=>{await j({bookId:s,defaultClientSelectsTime:A,...F?.expireAutoSchedulingOffers?{expireAutoSchedulingOffers:!0}:{}})},w=async()=>{if(v===p){b();return}if(p&&!v){h(!0);try{const A=await y.refetch();if(A.error){u({title:"Couldn't check active booking links",description:"Please try again.",variant:"error"});return}const F=A.data?.count??0;if(F>0){f(F),g(!0);return}}finally{h(!1)}}await S(v),b()};if(l||!n)return null;const C=k||x||n.isArchived;return t.jsxs(t.Fragment,{children:[t.jsx(Ce,{open:o,onOpenChange:A=>{A||b()},children:t.jsxs(we,{showClose:!1,children:[t.jsx(ve,{children:"Booking method"}),t.jsxs("div",{className:"flex flex-col gap-3 px-5 pt-4 pb-2",children:[t.jsx(Vt,{selected:!v,title:"Send dates",subtitle:"You review requests and send multiple dates to clients (aka managed scheduling)",onClick:()=>c(!1)}),t.jsx(Vt,{selected:v,title:"Direct book",subtitle:"You review requests and clients pick a time to book directly (aka auto-scheduling)",onClick:()=>c(!0)})]}),t.jsxs(Ae,{variant:"inline",children:[t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:b,children:"Cancel"}),t.jsx(Z,{variant:"primary",fullWidth:!0,disabled:C,onClick:()=>{w().catch(()=>{})},children:"Apply"})]})]})}),t.jsx(Ke,{open:m,onOpenChange:A=>{A||g(!1)},children:t.jsxs(Ye,{showClose:!1,children:[t.jsxs(Ve,{children:[t.jsxs(Qe,{children:["You have ",i," active booking"," ",i===1?"link":"links"," on Direct book"]}),t.jsx(qe,{children:"Would you like to archive them or leave them as direct-book links?"})]}),t.jsxs(Ge,{children:[t.jsx(Z,{variant:"secondary",disabled:k,onClick:()=>{S(!1).then(()=>{g(!1),b()}).catch(()=>{})},children:"Leave them"}),t.jsx(Z,{variant:"primary",disabled:k,onClick:()=>{S(!1,{expireAutoSchedulingOffers:!0}).then(()=>{g(!1),b()}).catch(()=>{})},children:"Archive them"})]})]})})]})}
1function Vt(s){const e=W.c(18),{selected:n,title:l,subtitle:a,onClick:u}=s,o=n?"border-ink-black dark:border-ink-white":"border-ink-black/10 dark:border-ink-white/10 text-ink-black/60 dark:text-ink-white/60";let d;e[0]!==o?(d=pe("flex w-full rounded-3xl border-2 p-5 text-left font-sans transition-colors",o),e[0]=o,e[1]=d):d=e[1];let r;e[2]!==n?(r=t.jsx("div",{className:"flex shrink-0 items-center",children:n?t.jsx(Ee,{size:24}):t.jsx("div",{className:"size-6 rounded-full border-2 border-ink-black/20 dark:border-ink-white/20"})}),e[2]=n,e[3]=r):r=e[3];let c;e[4]!==l?(c=t.jsx(ie,{variant:"heading",children:l}),e[4]=l,e[5]=c):c=e[5];let i;e[6]!==a?(i=t.jsx(ie,{size:"xs",variant:"body",children:a}),e[6]=a,e[7]=i):i=e[7];let f;e[8]!==c||e[9]!==i?(f=t.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[c,i]}),e[8]=c,e[9]=i,e[10]=f):f=e[10];let m;e[11]!==r||e[12]!==f?(m=t.jsxs("div",{className:"flex w-full flex-row items-center gap-5",children:[r,f]}),e[11]=r,e[12]=f,e[13]=m):m=e[13];let g;return e[14]!==u||e[15]!==d||e[16]!==m?(g=t.jsx("button",{type:"button",onClick:u,className:d,children:m}),e[14]=u,e[15]=d,e[16]=m,e[17]=g):g=e[17],g}function wo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:ci}),s[0]=e):e=s[0],e}const di=[{value:"DAYS",label:"Days ahead"},{value:"WEEKS",label:"Weeks ahead"},{value:"MONTHS",label:"Months ahead"}],ui={DAYS:"Days",WEEKS:"Weeks",MONTHS:"Months"};function fi({bookId:s,onHidden:e}){const{personId:n}=Oe(),{data:l}=U.getPersonSettings.useQuery(n,{enabled:!!n}),a=l?.weekStartDay??0,{data:u,isLoading:o}=U.getBookSettings.useQuery(s,{enabled:!!s}),d=U.useUtils(),{toast:r}=De(),{mutateAsync:c}=U.updateBookBookingRange.useMutation({onSuccess:async()=>{await d.getBookSettings.invalidate(),await d.findFirstDateWithAvailability.invalidate(),await d.getCalendarWeeklyAvailability.invalidate()},onError:()=>{r({title:"Failed to update booking range",description:"Please try again",variant:"error"})}}),[i,f]=P.useState(!0),[m,{height:g}]=Os(),[x,h]=P.useState("main"),[y,j]=P.useState("indefinitely"),[k,b]=P.useState(!1),[p,v]=P.useState(3),[S,w]=P.useState("MONTHS"),[C,A]=P.useState(!1),[F,N]=P.useState(3),[D,T]=P.useState("MONTHS"),[_,O]=P.useState(null),[B,I]=P.useState(null),[$,M]=P.useState(!1),[R,E]=P.useState(null),[H,z]=P.useState(null),[L,Q]=P.useState(u);u!==L&&(Q(u),u&&(u.minAppointmentDate||u.maxAppointmentDate?(j("set-dates"),O(u.minAppointmentDate),I(u.maxAppointmentDate),M(!0)):u.maxAppointmentTimeFromTodayQuantity?(j("rolling"),v(u.maxAppointmentTimeFromTodayQuantity),w(u.maxAppointmentTimeFromTodayUnit??"MONTHS"),A(!0)):j("indefinitely")));const q=()=>{f(!1),e()},G=async()=>{b(!0);try{let K;y==="indefinitely"?K={option:"indefinitely"}:y==="rolling"?K={option:"rolling",quantity:p,unit:S}:K={option:"set-dates",minDate:_,maxDate:B},await c({bookId:s,...K}),q()}finally{b(!1)}};if(o)return null;const Y=k||!(y==="indefinitely"||y==="rolling"&&C||y==="set-dates"&&$);return t.jsx(Ce,{open:i,onOpenChange:K=>{K||q()},children:t.jsx(we,{showClose:!1,children:t.jsx(ct.div,{animate:{height:g||"auto"},transition:{type:"spring",bounce:0,duration:.3},className:"overflow-hidden",children:t.jsxs("div",{ref:m,children:[x==="main"&&t.jsx(hi,{selectedOption:y,onSelectOption:j,isRollingConfigured:C,isSetDatesConfigured:$,setDatesMinDate:_,setDatesMaxDate:B,rollingQuantity:p,rollingUnit:S,onConfigure:K=>{K==="rolling"?(N(p),T(S),h("up-to-a-point")):K==="set-dates"&&(E(_),z(B),h("custom-dates"))},isApplyDisabled:Y,onApply:G,onCancel:q}),x==="up-to-a-point"&&t.jsx(pi,{quantity:F,unit:D,onQuantityChange:N,onUnitChange:T,onApply:()=>{v(F),w(D),A(!0),h("main")},onCancel:()=>h("main")}),x==="custom-dates"&&t.jsx(bi,{weekStartsOn:a,minDate:R,maxDate:H,onApply:(K,ne)=>{O(K),I(ne),M(!0),h("main")},onCancel:()=>h("main")})]})})})})}function bt(s){const e=W.c(25),{selected:n,title:l,subtitle:a,actionButton:u,onClick:o}=s,d=n?"border-ink-black dark:border-ink-white":"border-ink-black/10 dark:border-ink-white/10 text-ink-black/60 dark:text-ink-white/60";let r;e[0]!==d?(r=pe("relative flex w-full rounded-3xl border-2 p-5 text-left font-sans transition-colors",d),e[0]=d,e[1]=r):r=e[1];let c;e[2]!==o||e[3]!==n||e[4]!==l?(c=t.jsx("button",{type:"button",onClick:o,"aria-label":l,"aria-pressed":n,className:"absolute inset-0 rounded-3xl"}),e[2]=o,e[3]=n,e[4]=l,e[5]=c):c=e[5];let i;e[6]!==n?(i=t.jsx("div",{className:"flex shrink-0 items-center",children:n?t.jsx(Ee,{size:24}):t.jsx("div",{className:"size-6 rounded-full border-2 border-ink-black/20 dark:border-ink-white/20"})}),e[6]=n,e[7]=i):i=e[7];let f;
1e[8]!==l?(f=t.jsx(ie,{variant:"heading",children:l}),e[8]=l,e[9]=f):f=e[9];let m;e[10]!==a?(m=t.jsx(ie,{size:"xs",variant:"body",children:a}),e[10]=a,e[11]=m):m=e[11];let g;e[12]!==f||e[13]!==m?(g=t.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[f,m]}),e[12]=f,e[13]=m,e[14]=g):g=e[14];let x;e[15]!==u?(x=u&&t.jsx("div",{className:"relative z-10 shrink-0",children:u}),e[15]=u,e[16]=x):x=e[16];let h;e[17]!==i||e[18]!==g||e[19]!==x?(h=t.jsxs("div",{className:"flex w-full flex-row items-center gap-5",children:[i,g,x]}),e[17]=i,e[18]=g,e[19]=x,e[20]=h):h=e[20];let y;return e[21]!==r||e[22]!==c||e[23]!==h?(y=t.jsxs("div",{className:r,children:[c,h]}),e[21]=r,e[22]=c,e[23]=h,e[24]=y):y=e[24],y}function mi(s,e){if(!s||!e)return null;const n=vt(Wt(s),"MMM d"),l=vt(Wt(e),"MMM d");return`${n} â ${l}`}function hi(s){const e=W.c(49),{selectedOption:n,onSelectOption:l,isRollingConfigured:a,isSetDatesConfigured:u,setDatesMinDate:o,setDatesMaxDate:d,rollingQuantity:r,rollingUnit:c,onConfigure:i,isApplyDisabled:f,onApply:m,onCancel:g}=s;let x;e[0]!==u||e[1]!==i||e[2]!==n||e[3]!==d||e[4]!==o?(x=()=>{if(n!=="set-dates")return t.jsx(Z,{variant:"tertiary",size:"sm",disabled:!0,onClick:()=>i("set-dates"),children:"Configure"});const M=u?mi(o,d):null;return t.jsx(Z,{variant:"tertiary",size:"sm",onClick:()=>i("set-dates"),children:M??"Configure"})},e[0]=u,e[1]=i,e[2]=n,e[3]=d,e[4]=o,e[5]=x):x=e[5];const h=x;let y;e[6]!==a||e[7]!==i||e[8]!==r||e[9]!==c||e[10]!==n?(y=()=>n!=="rolling"?t.jsx(Z,{variant:"tertiary",size:"sm",disabled:!0,onClick:()=>i("rolling"),children:"Configure"}):t.jsx(Z,{variant:"tertiary",size:"sm",onClick:()=>i("rolling"),children:a?`${r} ${ui[c]??c}`:"Configure"}),e[6]=a,e[7]=i,e[8]=r,e[9]=c,e[10]=n,e[11]=y):y=e[11];const j=y;let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ve,{children:"Booking Range"}),e[12]=k):k=e[12];const b=n==="indefinitely";let p;e[13]!==l?(p=()=>l("indefinitely"),e[13]=l,e[14]=p):p=e[14];let v;e[15]!==b||e[16]!==p?(v=t.jsx(bt,{selected:b,title:"Indefinitely",subtitle:"Clients can book you any time in the future",onClick:p}),e[15]=b,e[16]=p,e[17]=v):v=e[17];const S=n==="set-dates";let w;e[18]!==h?(w=h(),e[18]=h,e[19]=w):w=e[19];let C;e[20]!==l?(C=()=>l("set-dates"),e[20]=l,e[21]=C):C=e[21];let A;e[22]!==S||e[23]!==w||e[24]!==C?(A=t.jsx(bt,{selected:S,title:"Custom dates",subtitle:"Choose a start and end date",actionButton:w,onClick:C}),e[22]=S,e[23]=w,e[24]=C,e[25]=A):A=e[25];const F=n==="rolling";let N;e[26]!==j?(N=j(),e[26]=j,e[27]=N):N=e[27];let D;e[28]!==l?(D=()=>l("rolling"),e[28]=l,e[29]=D):D=e[29];let T;e[30]!==F||e[31]!==N||e[32]!==D?(T=t.jsx(bt,{selected:F,title:"Up to a point",subtitle:"Limit how far ahead clients can book",actionButton:N,onClick:D}),e[30]=F,e[31]=N,e[32]=D,e[33]=T):T=e[33];let _;e[34]!==A||e[35]!==T||e[36]!==v?(_=t.jsxs("div",{className:"flex flex-col gap-3 px-5 pt-4 pb-2",children:[v,A,T]}),e[34]=A,e[35]=T,e[36]=v,e[37]=_):_=e[37];let O;e[38]!==g?(O=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:g,children:"Cancel"}),e[38]=g,e[39]=O):O=e[39];let B;e[40]!==f||e[41]!==m?(B=t.jsx(Z,{variant:"primary",fullWidth:!0,disabled:f,onClick:m,children:"Apply"}),e[40]=f,e[41]=m,e[42]=B):B=e[42];let I;e[43]!==O||e[44]!==B?(I=t.jsxs(Ae,{variant:"inline",children:[O,B]}),e[43]=O,e[44]=B,e[45]=I):I=e[45];let $;return e[46]!==_||e[47]!==I?($=t.jsxs(t.Fragment,{children:[k,_,I]}),e[46]=_,e[47]=I,e[48]=$):$=e[48],$}function pi(s){const e=W.c(28),{quantity:n,unit:l,onQuantityChange:a,onUnitChange:u,onApply:o,onCancel:d}=s,r=n>=1;let c;e[0]!==d?(c=t.jsx(ve,{onBackButton:d,children:"Up to a point"}),e[0]=d,e[1]=c):c=e[1];let i;e[2]!==a?(i=S=>{const w=parseInt(S.target.value,10);a(isNaN(w)?0:w)},e[2]=a,e[3]=i):i=e[3];let f;e[4]!==n||e[5]!==i?(f=t.jsx(et,{variant:"modern",label:"Quantity",type:"number",inputMode:"numeric",value:n,onChange:i,className:"flex-1"}),e[4]=n,e[5]=i,e[6]=f):f=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ie,{variant:"label",size:"sm",className:"absolute left-4 top-3 z-10 text-ink-black/60 pointer-events-none",children:"Timeframe"}),e[7]=m):m=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(hs,{className:"min-h-16 w-full rounded-2xl pt-5",children:t.jsx(ps,{placeholder:"Timeframe"})}),e[8]=g):g=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ms,{children:di.map(xi)}),e[9]=x):x=e[9];let h;e[10]!==u||e[11]!==l?(h=t.jsxs("div",{className:"relative flex-1",children:[m,t.jsxs(xs,{value:l,onValueChange:u,children:[g,x]})]}),e[10]=u,e[11]=l,e[12]=h):h=e[12];let y;e[13]!==f||e[14]!==h?(y=t.jsxs("div",{className:"flex flex-row gap-4 px-5 pt-4 pb-2",children:[f,h]}),e[13]=f,e[14]=h,e[15]=y):y=e[15];let j;e[16]!==d?(j=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:d,children:"Cancel"}),e[16]=d,e[17]=j):j=e[17];const k=!r;let b;e[18]!==o||e[19]!==k?(b=t.jsx(Z,{variant:"primary",fullWidth:!0,disabled:k,onClick:o,children:"Apply"}),e[18]=o,e[19]=k,e[20]=b):b=e[20];let p;e[21]!==b||e[22]!==j?(p=t.jsxs(Ae,{variant:"inline",children:[j,b]}),e[21]=b,e[22]=j,e[23]=p):p=e[23];let v;
1return e[24]!==c||e[25]!==p||e[26]!==y?(v=t.jsxs(t.Fragment,{children:[c,y,p]}),e[24]=c,e[25]=p,e[26]=y,e[27]=v):v=e[27],v}function xi(s){const{value:e,label:n}=s;return t.jsx(Xe,{value:e,children:n},e)}function bi(s){const e=W.c(26),{weekStartsOn:n,minDate:l,maxDate:a,onApply:u,onCancel:o}=s;let d;e[0]!==a||e[1]!==l?(d=l&&a?{min:l,max:a}:void 0,e[0]=a,e[1]=l,e[2]=d):d=e[2];const[r,c]=P.useState(d);let i;e[3]!==o?(i=t.jsx(ve,{onBackButton:o,children:"Custom dates"}),e[3]=o,e[4]=i):i=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=p=>{c({min:p[0],max:p[p.length-1]})},e[5]=f):f=e[5];let m;e[6]!==r?(m=r?[r.min,r.max]:void 0,e[6]=r,e[7]=m):m=e[7];let g;e[8]!==m||e[9]!==n?(g=t.jsx("div",{className:"px-5 pt-4 pb-2",children:t.jsx(Ms,{selectionMode:"range",weekStartsOn:n,onChangeValue:f,value:m})}),e[8]=m,e[9]=n,e[10]=g):g=e[10];let x;e[11]!==o?(x=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:o,children:"Cancel"}),e[11]=o,e[12]=x):x=e[12];const h=!r;let y;e[13]!==u||e[14]!==r?(y=()=>{r&&u(r.min,r.max)},e[13]=u,e[14]=r,e[15]=y):y=e[15];let j;e[16]!==h||e[17]!==y?(j=t.jsx(Z,{variant:"primary",fullWidth:!0,disabled:h,onClick:y,children:"Apply"}),e[16]=h,e[17]=y,e[18]=j):j=e[18];let k;e[19]!==x||e[20]!==j?(k=t.jsxs(Ae,{variant:"inline",children:[x,j]}),e[19]=x,e[20]=j,e[21]=k):k=e[21];let b;return e[22]!==k||e[23]!==i||e[24]!==g?(b=t.jsxs(t.Fragment,{children:[i,g,k]}),e[22]=k,e[23]=i,e[24]=g,e[25]=b):b=e[25],b}function Co(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:fi}),s[0]=e):e=s[0],e}function No(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:wn}),s[0]=e):e=s[0],e}const Gt=2e3;function gi(s){const e=W.c(42),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(n,u),r=U.useUtils();let c;e[2]!==r?(c={onSuccess:async()=>{await r.getBookSettings.invalidate()}},e[2]=r,e[3]=c):c=e[3];const{mutateAsync:i}=U.updateBook.useMutation(c),[f,m]=P.useState(!0),g=o?.consentFormNotes??"";let x;e[4]!==g?(x={notes:g},e[4]=g,e[5]=x):x=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h={onChange:se.object({notes:se.string().max(Gt)})},e[6]=h):h=e[6];let y;e[7]!==n||e[8]!==i?(y=async B=>{const{value:I}=B;await i({bookId:n,consentFormNotes:I.notes||null}),m(!1)},e[7]=n,e[8]=i,e[9]=y):y=e[9];let j;e[10]!==x||e[11]!==y?(j={defaultValues:x,validators:h,onSubmit:y},e[10]=x,e[11]=y,e[12]=j):j=e[12];const k=Te(j);let b;e[13]!==l||e[14]!==f?(b=()=>{f||l()},e[13]=l,e[14]=f,e[15]=b):b=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Dt,{children:t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Lot numbers"})}),e[16]=p):p=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs(Tt,{children:[p,t.jsx(Bt,{children:t.jsx(ht,{children:"Default notes included on every consent form PDF."})})]}),e[17]=v):v=e[17];let S;e[18]!==k?(S=B=>{B.preventDefault(),k.handleSubmit()},e[18]=k,e[19]=S):S=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(ie,{size:"sm",className:"text-ink-black-600",children:"These notes will appear on every consent form PDF generated for this book. Use them for default information like ink brands or standard materials."}),e[20]=w):w=e[20];let C;e[21]!==d?(C=B=>t.jsxs("div",{className:"flex flex-col flex-1 gap-2",children:[t.jsx("textarea",{disabled:d,onChange:I=>B.handleChange(I.target.value),onBlur:B.handleBlur,value:B.state.value,placeholder:"e.g., All inks used are Eternal Ink brand, FDA-compliant.",className:"flex-1 min-h-[200px] rounded-lg border border-ink-black-200 p-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-ink-black-900"}),t.jsxs("div",{className:"text-xs text-ink-black-400 text-right",children:[B.state.value.length,"/",Gt]}),t.jsx(ot,{errors:nt(B)})]}),e[21]=d,e[22]=C):C=e[22];let A;e[23]!==k.Field||e[24]!==C?(A=t.jsxs(At,{className:"flex-1 p-5 flex flex-col gap-5",children:[w,t.jsx(k.Field,{name:"notes",children:C})]}),e[23]=k.Field,e[24]=C,e[25]=A):A=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(bs,{asChild:!0,children:t.jsx(Z,{variant:"secondary",children:"Cancel"})}
1),e[26]=F):F=e[26];let N;e[27]!==k.SubmitButton?(N=t.jsx(k.SubmitButton,{submit:!0,children:"Save"}),e[27]=k.SubmitButton,e[28]=N):N=e[28];let D;e[29]!==k.AppForm||e[30]!==N?(D=t.jsxs(_t,{children:[F,t.jsx(k.AppForm,{children:N})]}),e[29]=k.AppForm,e[30]=N,e[31]=D):D=e[31];let T;e[32]!==S||e[33]!==A||e[34]!==D?(T=t.jsxs("form",{onSubmit:S,className:"flex flex-col h-full overflow-hidden",children:[A,D]}),e[32]=S,e[33]=A,e[34]=D,e[35]=T):T=e[35];let _;e[36]!==T||e[37]!==b?(_=t.jsxs(It,{side:"right",onAnimationEndCapture:b,children:[v,T]}),e[36]=T,e[37]=b,e[38]=_):_=e[38];let O;return e[39]!==f||e[40]!==_?(O=t.jsx(Ot,{open:f,onOpenChange:m,children:_}),e[39]=f,e[40]=_,e[41]=O):O=e[41],O}function Fo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:gi}),s[0]=e):e=s[0],e}function yi({bookId:s,onHidden:e}){const{data:n,isLoading:l}=U.getBookSettings.useQuery(s,{enabled:!!s}),a=U.useUtils(),{toast:u}=De(),{mutateAsync:o}=U.updateBook.useMutation({onSuccess:async()=>{await a.getBookSettings.invalidate()},onError:()=>{u({title:"Failed to update form availability",description:"Please try again",variant:"error"})}}),[d,r]=P.useState(!0),[c,i]=P.useState("anytime"),[f,m]=P.useState(!1);P.useEffect(()=>{n&&i(n.consentFormSubmissionWindowHours===24?"24h":"anytime")},[n]);const g=()=>{r(!1),e()},x=async()=>{m(!0);try{await o({bookId:s,consentFormSubmissionWindowHours:c==="24h"?24:null}),g()}finally{m(!1)}};return l?null:t.jsx(Ce,{open:d,onOpenChange:h=>{h||g()},children:t.jsxs(we,{showClose:!1,children:[t.jsx(ve,{children:"Form availability"}),t.jsxs("div",{className:"flex flex-col gap-3 px-5 pt-4 pb-2",children:[t.jsx(Yt,{selected:c==="anytime",title:"Anytime",subtitle:"Clients can submit their consent form as soon as the appointment is booked.",onClick:()=>i("anytime")}),t.jsx(Yt,{selected:c==="24h",title:"24 hours before appointment",subtitle:"Clients can submit starting 24 hours before their appointment. Good for keeping time-sensitive answers (pregnancy, antibiotics) accurate.",onClick:()=>i("24h")})]}),t.jsxs(Ae,{variant:"inline",children:[t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:g,children:"Cancel"}),t.jsx(Z,{variant:"primary",fullWidth:!0,disabled:f,onClick:x,children:"Apply"})]})]})})}function Yt(s){const e=W.c(18),{selected:n,title:l,subtitle:a,onClick:u}=s,o=n?"border-ink-black dark:border-ink-white":"border-ink-black/10 dark:border-ink-white/10 text-ink-black/60 dark:text-ink-white/60";let d;e[0]!==o?(d=pe("flex w-full rounded-3xl border-2 p-5 text-left font-sans transition-colors",o),e[0]=o,e[1]=d):d=e[1];let r;e[2]!==n?(r=t.jsx("div",{className:"flex shrink-0 items-center",children:n?t.jsx(Ee,{size:24}):t.jsx("div",{className:"size-6 rounded-full border-2 border-ink-black/20 dark:border-ink-white/20"})}),e[2]=n,e[3]=r):r=e[3];let c;e[4]!==l?(c=t.jsx(ie,{variant:"heading",children:l}),e[4]=l,e[5]=c):c=e[5];let i;e[6]!==a?(i=t.jsx(ie,{size:"xs",variant:"body",children:a}),e[6]=a,e[7]=i):i=e[7];let f;e[8]!==c||e[9]!==i?(f=t.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[c,i]}),e[8]=c,e[9]=i,e[10]=f):f=e[10];let m;e[11]!==r||e[12]!==f?(m=t.jsxs("div",{className:"flex w-full flex-row items-center gap-5",children:[r,f]}),e[11]=r,e[12]=f,e[13]=m):m=e[13];let g;return e[14]!==u||e[15]!==d||e[16]!==m?(g=t.jsx("button",{type:"button",onClick:u,className:d,children:m}),e[14]=u,e[15]=d,e[16]=m,e[17]=g):g=e[17],g}function Ao(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:yi}),s[0]=e):e=s[0],e}function ki(s){const e=W.c(121),{bookId:n,onHidden:l}=s,a=tt(),{personId:u,handle:o}=Oe(),{isAdmin:d}=P.useContext(wt),r=Ft(),c=Le(),{data:i,isLoading:f}=U.getBookSettings.useQuery(n);let m;e[0]!==n?(m={bookId:n,limit:12,purpose:"CUSTOM_REQUEST"},e[0]=n,e[1]=m):m=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g={getNextPageParam:wi},e[2]=g):g=e[2];const{data:x,fetchNextPage:h,isLoading:y,isFetchingNextPage:j}=U.forms.getPageOfPublishedFormsForBook.useInfiniteQuery(m,g);let k;e[3]!==h?(k=()=>{h()},e[3]=h,e[4]=k):k=e[4];const b=k,p=U.useUtils(),{mutateAsync:v,isPending:S}=U.updateBook.useMutation(),[w,C]=P.useState(!0);let A;e[5]!==l?(A=()=>{C(!1),l()},e[5]=l,e[6]=A):A=e[6];const F=A,[N,D]=P.useState(null);let T;e[7]!==i||e[8]!==r.state||e[9]!==c?(T=()=>{i&&r.state?.promptAssignFormId&&r.state?.promptFormKind==="custom"&&(i.customForm?.id!==r.
1state.promptAssignFormId&&D({formId:r.state.promptAssignFormId,formTitle:r.state.promptFormTitle}),c(".",{replace:!0,state:{returnTo:r.state?.returnTo}}))},e[7]=i,e[8]=r.state,e[9]=c,e[10]=T):T=e[10];const _=r.state?.promptAssignFormId,O=r.state?.promptFormKind,B=r.state?.promptFormTitle,I=r.state?.returnTo,$=i?.customForm?.id;let M;e[11]!==i||e[12]!==c||e[13]!==$||e[14]!==_||e[15]!==O||e[16]!==B||e[17]!==I?(M=[_,O,B,I,i,$,c],e[11]=i,e[12]=c,e[13]=$,e[14]=_,e[15]=O,e[16]=B,e[17]=I,e[18]=M):M=e[18],P.useEffect(T,M);let R,E,H,z,L,Q,q,G,V,Y,K;if(e[19]!==F||e[20]!==i||e[21]!==a||e[22]!==o||e[23]!==d||e[24]!==f||e[25]!==w||e[26]!==y||e[27]!==S||e[28]!==x?.pages||e[29]!==v||e[30]!==p){K=Symbol.for("react.early_return_sentinel");e:{const Fe=x?.pages??[];if(H=Fe[Fe.length-1]?.hasMore===!0,f||y||!i){K=null;break e}E=Ce,V=w,e[42]!==F?(Y=Pe=>{Pe||F()},e[42]=F,e[43]=Y):Y=e[43],R=we,q=!1,e[44]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ve,{children:"Choose a custom form"}),e[44]=G):G=e[44],Q="flex flex-col p-3 pb-safe-or-3 overflow-hidden",z="flex flex-col gap-3 overflow-y-auto max-h-76";let at;e[45]!==F||e[46]!==i.customForm?.id||e[47]!==i.id||e[48]!==a||e[49]!==o||e[50]!==d||e[51]!==S||e[52]!==v||e[53]!==p?(at=Pe=>t.jsxs("button",{className:"w-full flex flex-row text-left justify-between hover:bg-ink-black-100 px-4 py-4 rounded-3xl shrink-0 border border-ink-black-100",onClick:async()=>{await v({bookId:i.id,customFormId:Pe.id}),await p.getBookSettings.invalidate(i.id),F()},disabled:S,children:[t.jsxs("div",{className:"flex flex-col gap-1 leading-tighter",children:[t.jsx(ie,{size:"lg",children:Pe.title}),t.jsxs("div",{className:"flex flex-row gap-2 align-center",children:[t.jsxs(ie,{size:"sm",children:["Updated"," ",us(Pe.lastUpdatedAt,{addSuffix:!0})]}),t.jsx(_e,{className:pe(He({variant:"link"}),"p-0 min-h-0 text-xs font-light font-emphasis"),to:a("form",{handle:o,formId:Pe.id}),state:{assignFormAfterPublish:{bookId:i.id,formKind:"custom"}},onClick:vi,viewTransition:!0,children:"Edit"}),d&&t.jsx(_e,{className:pe(He({variant:"link"}),"p-0 min-h-0 text-xs font-light font-emphasis"),to:a("formStaff",{handle:o,formId:Pe.id}),onClick:ji,viewTransition:!0,children:"Staff Edit"})]})]}),Pe.id===i.customForm?.id&&t.jsx("div",{children:t.jsx(Ee,{size:24})})]},Pe.id),e[45]=F,e[46]=i.customForm?.id,e[47]=i.id,e[48]=a,e[49]=o,e[50]=d,e[51]=S,e[52]=v,e[53]=p,e[54]=at):at=e[54],L=Fe.flatMap(Si).map(at)}e[19]=F,e[20]=i,e[21]=a,e[22]=o,e[23]=d,e[24]=f,e[25]=w,e[26]=y,e[27]=S,e[28]=x?.pages,e[29]=v,e[30]=p,e[31]=R,e[32]=E,e[33]=H,e[34]=z,e[35]=L,e[36]=Q,e[37]=q,e[38]=G,e[39]=V,e[40]=Y,e[41]=K}else R=e[31],E=e[32],H=e[33],z=e[34],L=e[35],Q=e[36],q=e[37],G=e[38],V=e[39],Y=e[40],K=e[41];if(K!==Symbol.for("react.early_return_sentinel"))return K;let ne;e[55]!==j?(ne=j&&t.jsx("div",{className:"px-4 py-3 text-center shrink-0",children:"Loading..."}
1),e[55]=j,e[56]=ne):ne=e[56];let te;e[57]!==b||e[58]!==H||e[59]!==j?(te=!j&&H&&t.jsx(Z,{fullWidth:!0,variant:"tertiary",size:"sm",className:"font-emphasis shrink-0",onClick:b,children:"More"}),e[57]=b,e[58]=H,e[59]=j,e[60]=te):te=e[60];let X;e[61]!==z||e[62]!==L||e[63]!==ne||e[64]!==te?(X=t.jsxs("div",{className:z,children:[L,ne,te]}),e[61]=z,e[62]=L,e[63]=ne,e[64]=te,e[65]=X):X=e[65];let le;e[66]===Symbol.for("react.memo_cache_sentinel")?(le=pe(He({variant:"secondary"}),"font-emphasis font-light text-base"),e[66]=le):le=e[66];let J;e[67]!==a||e[68]!==o||e[69]!==u?(J=a("newForm",{personId:u,handle:o,templateContext:"custom"}),e[67]=a,e[68]=o,e[69]=u,e[70]=J):J=e[70];let ee;e[71]!==i.id?(ee={assignFormAfterPublish:{bookId:i.id,formKind:"custom"}},e[71]=i.id,e[72]=ee):ee=e[72];let ue;e[73]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ns,{size:20}),e[73]=ue):ue=e[73];let ae;e[74]!==le||e[75]!==J||e[76]!==ee?(ae=t.jsxs(_e,{className:le,to:J,state:ee,viewTransition:!0,children:[ue," Create a new form"]}),e[74]=le,e[75]=J,e[76]=ee,e[77]=ae):ae=e[77];let re;e[78]!==F||e[79]!==i.customForm||e[80]!==i.id||e[81]!==d||e[82]!==S||e[83]!==v||e[84]!==p?(re=d&&i.customForm&&t.jsx(Z,{fullWidth:!0,variant:"tertiary",size:"sm",className:"font-emphasis text-ink-destructive",onClick:async()=>{await v({bookId:i.id,customFormId:null}),await p.getBookSettings.invalidate(i.id),F()},disabled:S,children:"Clear selected form"}),e[78]=F,e[79]=i.customForm,e[80]=i.id,e[81]=d,e[82]=S,e[83]=v,e[84]=p,e[85]=re):re=e[85];let oe;e[86]!==ae||e[87]!==re?(oe=t.jsxs("div",{className:"flex flex-col gap-3 pt-3",children:[ae,re]}),e[86]=ae,e[87]=re,e[88]=oe):oe=e[88];let de;e[89]!==Q||e[90]!==X||e[91]!==oe?(de=t.jsxs("div",{className:Q,children:[X,oe]}),e[89]=Q,e[90]=X,e[91]=oe,e[92]=de):de=e[92];let fe;e[93]!==R||e[94]!==q||e[95]!==G||e[96]!==de?(fe=t.jsxs(R,{showClose:q,children:[G,de]}),e[93]=R,e[94]=q,e[95]=G,e[96]=de,e[97]=fe):fe=e[97];const xe=N!==null;let ye;e[98]===Symbol.for("react.memo_cache_sentinel")?(ye=Fe=>{Fe||D(null)},e[98]=ye):ye=e[98];let ke;e[99]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(Qe,{children:"Use this form?"}),e[99]=ke):ke=e[99];const je=N?.formTitle??"this form";let ce;e[100]!==i.name||e[101]!==je?(ce=t.jsxs(Ve,{children:[ke,t.jsxs(qe,{children:["Do you want to use ",je," for"," ",i.name,"?"]})]}),e[100]=i.name,e[101]=je,e[102]=ce):ce=e[102];let me;e[103]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(Z,{variant:"secondary",onClick:()=>{D(null)},children:"Do this later"}),e[103]=me):me=e[103];let he;e[104]!==N||e[105]!==i.id||e[106]!==v||e[107]!==p?(he=t.jsxs(Ge,{children:[me,t.jsx(Z,{variant:"primary",onClick:async()=>{N&&(await v({bookId:i.id,customFormId:N.formId}),await p.getBookSettings.invalidate(i.id),D(null))},children:"Use this form"})]}),e[104]=N,e[105]=i.id,e[106]=v,e[107]=p,e[108]=he):he=e[108];let Se;e[109]!==ce||e[110]!==he?(Se=t.jsxs(Ye,{showClose:!1,children:[ce,he]}),e[109]=ce,e[110]=he,e[111]=Se):Se=e[111];let Ne;e[112]!==xe||e[113]!==Se?(Ne=t.jsx(Ke,{open:xe,onOpenChange:ye,children:Se}),e[112]=xe,e[113]=Se,e[114]=Ne):Ne=e[114];let Re;return e[115]!==E||e[116]!==V||e[117]!==Y||e[118]!==fe||e[119]!==Ne?(Re=t.jsxs(E,{open:V,onOpenChange:Y,children:[fe,Ne]}),e[115]=E,e[116]=V,e[117]=Y,e[118]=fe,e[119]=Ne,e[120]=Re):Re=e[120],Re}function ji(s){return s.stopPropagation()}function vi(s){return s.stopPropagation()}function Si(s){return s.items}function wi(s){return s.hasMore?s.items[s.items.length-1].id:null}function _o(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:ki}),s[0]=e):e=s[0],e}const ks="10:00",js="18:00",Kt=[{day:"sunday",label:"SUN"},{day:"monday",label:"MON"},{day:"tuesday",label:"TUE"},{day:"wednesday",label:"WED"},{day:"thursday",label:"THU"},{day:"friday",label:"FRI"},{day:"saturday",label:"SAT"}];function Ci(s){return[...Kt.slice(s),...Kt.slice(0,s)]}function ze(s){const[e]=s;return e?{available:!0,start:Pt(e.start),end:e.end===1440?"00:00":Pt(e.end)}:{available:!1,start:ks,end:js}}function We(s){return s.available?{available:!0,start:Et(s.start),end:s.end==="00:00"?1440:Et(s.end)}:{available:!1}}function vs(s){return{sunday:We(s.sunday),monday:We(s.monday),tuesday:We(s.tuesday),wednesday:We(s.wednesday),thursday:We(s.thursday),friday:We(s.friday),saturday:We(s.saturday)}}function Ni(s){const e=An.safeParse(vs(s));if(e.success)return;const n=e.error.flatten(),[l]=n.formErrors,a=Object.values(n.fieldErrors).find(u=>u&&u.length>0)?.[0];return l||a||"Validation error"}function Fi(s){const e=W.c(88),{bookId:n,onHidden:l,bookSettings:a,weekStartDay:u}=s,o=u===void 0?0:u;let d;e[0]!==a.workingHours.available||e[1]!==a.workingHours.end||e[2]!==a.workingHours.start?(d=a.workingHours.available?{start:a.workingHours.start,end:a.workingHours.end}:{start:ks,end:js},e[0]=a.workingHours.available,e[1]=a.workingHours.end,e[2]=a.workingHours.start,e[3]=d):d=e[3];const[r,c]=P.useState(d),i=U.useUtils();let f;e[4]!==i?(f={onSuccess:async()=>{await i.getBookSettings.invalidate()}},e[4]=i,e[5]=f):f=e[5];const{mutateAsync:m}=U.updateBookDailyWorkingHours.useMutation(f),[g,x]=P.useState(!0),h=P.useRef(null);let y;e[6]!==l?(y=()=>{x(!1),l()},e[6]=l,e[7]=y):y=e[7];const j=y;let k;e[8]!==a.workingHoursMinutesOfDay.sunday?(k=ze(a.workingHoursMinutesOfDay.sunday),e[8]=a.workingHoursMinutesOfDay.sunday,e[9]=k):k=e[9];let b;
1e[10]!==a.workingHoursMinutesOfDay.monday?(b=ze(a.workingHoursMinutesOfDay.monday),e[10]=a.workingHoursMinutesOfDay.monday,e[11]=b):b=e[11];let p;e[12]!==a.workingHoursMinutesOfDay.tuesday?(p=ze(a.workingHoursMinutesOfDay.tuesday),e[12]=a.workingHoursMinutesOfDay.tuesday,e[13]=p):p=e[13];let v;e[14]!==a.workingHoursMinutesOfDay.wednesday?(v=ze(a.workingHoursMinutesOfDay.wednesday),e[14]=a.workingHoursMinutesOfDay.wednesday,e[15]=v):v=e[15];let S;e[16]!==a.workingHoursMinutesOfDay.thursday?(S=ze(a.workingHoursMinutesOfDay.thursday),e[16]=a.workingHoursMinutesOfDay.thursday,e[17]=S):S=e[17];let w;e[18]!==a.workingHoursMinutesOfDay.friday?(w=ze(a.workingHoursMinutesOfDay.friday),e[18]=a.workingHoursMinutesOfDay.friday,e[19]=w):w=e[19];let C;e[20]!==a.workingHoursMinutesOfDay.saturday?(C=ze(a.workingHoursMinutesOfDay.saturday),e[20]=a.workingHoursMinutesOfDay.saturday,e[21]=C):C=e[21];let A;e[22]!==w||e[23]!==C||e[24]!==k||e[25]!==b||e[26]!==p||e[27]!==v||e[28]!==S?(A={sunday:k,monday:b,tuesday:p,wednesday:v,thursday:S,friday:w,saturday:C},e[22]=w,e[23]=C,e[24]=k,e[25]=b,e[26]=p,e[27]=v,e[28]=S,e[29]=A):A=e[29];const F=A;let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N={onChange:Ti},e[30]=N):N=e[30];let D;e[31]!==n||e[32]!==j||e[33]!==m?(D=async ee=>{const{value:ue}=ee;await m({bookId:n,availableDays:vs(ue)}),j()},e[31]=n,e[32]=j,e[33]=m,e[34]=D):D=e[34];let T;e[35]!==F||e[36]!==D?(T={defaultValues:F,validators:N,onSubmit:D},e[35]=F,e[36]=D,e[37]=T):T=e[37];const _=Te(T);let O;e[38]!==_||e[39]!==r?(O=ee=>{_.setFieldValue(ee,{available:!0,start:r.start,end:r.end})},e[38]=_,e[39]=r,e[40]=O):O=e[40];const B=O;let I;e[41]!==_?(I=ee=>{_.setFieldValue(ee,Di)},e[41]=_,e[42]=I):I=e[42];const $=I;let M;e[43]!==j?(M=ee=>{ee||j()},e[43]=j,e[44]=M):M=e[44];let R;e[45]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(ve,{children:"Working Hours"}),e[45]=R):R=e[45];let E;e[46]!==_?(E=ee=>{ee.preventDefault(),_.handleSubmit()},e[46]=_,e[47]=E):E=e[47];let H,z,L;e[48]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx("div",{}),z=t.jsx("div",{className:"text-center",children:"Start"}),L=t.jsx("div",{className:"text-center",children:"End"}),e[48]=H,e[49]=z,e[50]=L):(H=e[48],z=e[49],L=e[50]);let Q;
1if(e[51]!==$||e[52]!==B||e[53]!==_.Field||e[54]!==_.Subscribe||e[55]!==o){let ee;e[57]!==$||e[58]!==B||e[59]!==_.Field||e[60]!==_.Subscribe?(ee=ue=>{const{day:ae,label:re}=ue;return t.jsxs(P.Fragment,{children:[t.jsxs("label",{htmlFor:`${ae}.available.checkbox`,className:"flex flex-row items-center gap-3 hover:cursor-pointer",children:[t.jsx(_.Field,{name:`${ae}.available`,children:oe=>t.jsx("div",{className:"flex flex-col gap-2",children:t.jsx(Fn,{id:`${ae}.available.checkbox`,checked:oe.state.value,onChangeChecked:de=>de?B(ae):$(ae),onBlur:oe.handleBlur})})}),t.jsx("div",{className:"text-ink-black font-medium",children:re})]}),t.jsx(_.Subscribe,{selector:oe=>!oe.values[ae].available,children:oe=>t.jsxs(t.Fragment,{children:[t.jsx("div",{children:t.jsx(_.Field,{name:`${ae}.start`,children:de=>t.jsx(Qt,{onBlur:de.handleBlur,onChange:fe=>{c(xe=>({...xe,start:fe.target.value})),de.handleChange(fe.target.value)},value:oe?"":de.state.value||"",disabled:oe})})}),t.jsx("div",{children:t.jsx(_.Field,{name:`${ae}.end`,children:de=>t.jsx(Qt,{onBlur:de.handleBlur,onChange:fe=>{c(xe=>({...xe,end:fe.target.value})),de.handleChange(fe.target.value)},value:oe?"":de.state.value||"",disabled:oe})})})]})})]},ae)},e[57]=$,e[58]=B,e[59]=_.Field,e[60]=_.Subscribe,e[61]=ee):ee=e[61],Q=Ci(o).map(ee),e[51]=$,e[52]=B,e[53]=_.Field,e[54]=_.Subscribe,e[55]=o,e[56]=Q}else Q=e[56];let q;e[62]!==Q?(q=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-[auto_1fr_1fr] gap-2",children:[H,z,L,Q]})}),e[62]=Q,e[63]=q):q=e[63];let G;e[64]!==E||e[65]!==q?(G=t.jsx("form",{onSubmit:E,ref:h,children:q}),e[64]=E,e[65]=q,e[66]=G):G=e[66];let V;e[67]!==_.Subscribe?(V=t.jsx(_.Subscribe,{selector:_i,children:Ai}),e[67]=_.Subscribe,e[68]=V):V=e[68];let Y;e[69]!==j?(Y=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:j,children:"Cancel"}),e[69]=j,e[70]=Y):Y=e[70];let K;e[71]===Symbol.for("react.memo_cache_sentinel")?(K=()=>Me(h),e[71]=K):K=e[71];let ne;e[72]!==_.SubmitButton?(ne=t.jsx(_.SubmitButton,{fullWidth:!0,onClick:K,children:"Apply"}),e[72]=_.SubmitButton,e[73]=ne):ne=e[73];let te;e[74]!==_.AppForm||e[75]!==ne?(te=t.jsx(_.AppForm,{children:ne}),e[74]=_.AppForm,e[75]=ne,e[76]=te):te=e[76];let X;e[77]!==Y||e[78]!==te?(X=t.jsxs(Ae,{variant:"inline",children:[Y,te]}),e[77]=Y,e[78]=te,e[79]=X):X=e[79];let le;e[80]!==G||e[81]!==V||e[82]!==X?(le=t.jsxs(we,{showClose:!1,children:[R,G,V,X]}),e[80]=G,e[81]=V,e[82]=X,e[83]=le):le=e[83];let J;return e[84]!==g||e[85]!==M||e[86]!==le?(J=t.jsx(Ce,{open:g,onOpenChange:M,children:le}),e[84]=g,e[85]=M,e[86]=le,e[87]=J):J=e[87],J}function Ai(s){return s?t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:"text-red-500 text-sm",children:String(s)})}):null}function _i(s){return s.errorMap.onChange}function Di(s){return{...s,available:!1}}function Ti(s){const{value:e}=s;return Ni(e)}function Bi(s){const e=W.c(9),{bookId:n,onHidden:l}=s,{personId:a}=Oe(),u=!!a;let o;e[0]!==u?(o={enabled:u},e[0]=u,e[1]=o):o=e[1];const{data:d}=U.getPersonSettings.useQuery(a,o),r=!!n;let c;e[2]!==r?(c={enabled:r},e[2]=r,e[3]=c):c=e[3];const{data:i,isLoading:f}=U.getBookSettings.useQuery(n,c);if(f||!i)return null;const m=d?.weekStartDay??0;let g;return e[4]!==n||e[5]!==i||e[6]!==l||e[7]!==m?(g=t.jsx(Fi,{bookId:n,onHidden:l,bookSettings:i,weekStartDay:m}),e[4]=n,e[5]=i,e[6]=l,e[7]=m,e[8]=g):g=e[8],g}function Do(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Bi}),s[0]=e):e=s[0],e}function Ii(s){const e=W.c(92),{bookId:n,onHidden:l}=s,{isAdmin:a}=P.useContext(wt),u=!!n;let o;e[0]!==u?(o={enabled:u},e[0]=u,e[1]=o):o=e[1];const{data:d,isLoading:r}=U.getBookSettings.useQuery(n,o),c=U.useUtils(),{toast:i}=De();let f;e[2]!==c?(f=async()=>{await c.getBookSettings.invalidate()},e[2]=c,e[3]=f):f=e[3];let m;e[4]!==d?.isArchived||e[5]!==i?(m=()=>{d?.isArchived&&i({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"})},e[4]=d?.isArchived,e[5]=i,e[6]=m):m=e[6];let g;e[7]!==f||e[8]!==m?(g={onSuccess:f,onError:m},e[7]=f,e[8]=m,e[9]=g):g=e[9];const{mutateAsync:x}=U.updateBook.useMutation(g),[h,y]=P.useState(!0),j=P.useRef(null),[k,b]=P.useState(null),[p,v]=P.useState(!1),S=k??d?.depositLabel??"DEPOSIT",w=d?.depositLabel;let C;e[10]!==w?(C=St(w),e[10]=w,e[11]=C):C=e[11];const A=C.noun;let F;
1e[12]!==l?(F=()=>{y(!1),l()},e[12]=l,e[13]=F):F=e[13];const N=F,D=d?.defaultDepositAmountCents??"";let T;e[14]!==D?(T=D.toString(),e[14]=D,e[15]=T):T=e[15];let _;e[16]!==T?(_={amountCents:T},e[16]=T,e[17]=_):_=e[17];let O;e[18]!==d?.defaultDepositCurrency||e[19]!==a?(O=se.object({amountCents:se.string().transform(Oi).pipe(a?_n:Dn(d?.defaultDepositCurrency||"USD"))}),e[18]=d?.defaultDepositCurrency,e[19]=a,e[20]=O):O=e[20];let B;e[21]!==O?(B={onChange:O},e[21]=O,e[22]=B):B=e[22];let I;e[23]!==n||e[24]!==N||e[25]!==x||e[26]!==S?(I=async ce=>{const{value:me}=ce;await x({bookId:n,defaultDepositAmountCents:Number(me.amountCents),depositLabel:S}),N()},e[23]=n,e[24]=N,e[25]=x,e[26]=S,e[27]=I):I=e[27];let $;e[28]!==_||e[29]!==B||e[30]!==I?($={defaultValues:_,validators:B,onSubmit:I},e[28]=_,e[29]=B,e[30]=I,e[31]=$):$=e[31];const M=Te($);let R;e[32]!==N?(R=ce=>{ce||N()},e[32]=N,e[33]=R):R=e[33];let E;e[34]!==A?(E=t.jsx(ve,{children:A}),e[34]=A,e[35]=E):E=e[35];let H;e[36]!==M?(H=ce=>{ce.preventDefault(),M.handleSubmit()},e[36]=M,e[37]=H):H=e[37];let z;e[38]!==a?(z=a&&t.jsx("div",{className:"rounded-3xl border border-ink-destructive bg-mix-ink-destructive-10 px-3 py-2 text-ink-destructive text-sm text-center font-light",children:"Admins are permitted to set book default to $0 if desired."}),e[38]=a,e[39]=z):z=e[39];let L;e[40]!==d?.defaultDepositCurrency||e[41]!==r?(L=ce=>{const[me]=nt(ce);return t.jsxs(t.Fragment,{children:[t.jsx("div",{children:t.jsx(Nn,{disabled:r,fullWidth:!0,invalid:!!me,label:"Amount",onBlur:ce.handleBlur,onChangeValue:he=>ce.handleChange(he),value:ce.state.value})}),me&&t.jsx("div",{className:"text-red-500",children:me.startsWith("Deposit must be at least")?`To reduce no shows, deposit minimums are ${Ps(Es,d?.defaultDepositCurrency||"USD")}`:me})]})},e[40]=d?.defaultDepositCurrency,e[41]=r,e[42]=L):L=e[42];let Q;e[43]!==M.Field||e[44]!==L?(Q=t.jsx("div",{className:"flex flex-col gap-2",children:t.jsx(M.Field,{name:"amountCents",children:L})}),e[43]=M.Field,e[44]=L,e[45]=Q):Q=e[45];let q;e[46]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(ie,{size:"sm",className:"text-ink-black text-left pl-2",children:"How much should the client prepay to save the date."}),e[46]=q):q=e[46];let G;e[47]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx($e,{size:"base",children:"Label"}),e[47]=G):G=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(ie,{size:"sm",className:"tracking-tight",children:"In some places âdepositâ means money held and returned on request, so artists taking a payment that is not refundable use another word for it. Renaming it here does not change your terms."}),e[48]=V):V=e[48];let Y;e[49]!==p?(Y=ce=>{ce.preventDefault(),ce.stopPropagation(),v(!p)},e[49]=p,e[50]=Y):Y=e[50];const K=p?"text-ink-forest":"text-ink-black-300";let ne;e[51]!==K?(ne=pe(K),e[51]=K,e[52]=ne):ne=e[52];let te;e[53]!==ne?(te=t.jsx(dt,{size:16,className:ne}),e[53]=ne,e[54]=te):te=e[54];let X;e[55]!==Y||e[56]!==te?(X=t.jsx("button",{type:"button","aria-label":"Why the name matters",onClick:Y,children:te}),e[55]=Y,e[56]=te,e[57]=X):X=e[57];let le;e[58]!==p||e[59]!==X?(le=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2 pl-2 pt-2",children:[G,t.jsx(rt,{content:V,open:p,onOpenChange:v,className:"w-64",placement:"top-end",children:X})]}),e[58]=p,e[59]=X,e[60]=le):le=e[60];let J;e[61]!==S?(J=$s.map(ce=>{const me=Rs[ce],he=S===ce;return t.jsxs("button",{type:"button","aria-pressed":he,className:pe("w-full flex items-center gap-5 p-5 rounded-3xl text-left",he?"border-2 border-ink-black dark:border-ink-white":"border border-ink-black/15 dark:border-ink-white/15"),onClick:()=>b(ce),children:[he?t.jsx("div",{className:"w-5 h-5 rounded-full bg-ink-black dark:bg-ink-white flex items-center justify-center flex-shrink-0",children:t.jsx(un,{className:"stroke-ink-white dark:stroke-ink-black size-3.5"})}):t.jsx("div",{className:"w-5 h-5 rounded-full border border-ink-black/25 dark:border-ink-white/25 flex-shrink-0"}),t.jsxs("div",{className:"flex flex-1 flex-col gap-1.5 min-w-0",children:[t.jsx($e,{size:"base",inactive:!he,children:me.noun}),t.jsx(ie,{size:"xs",inactive:!he,children:me.purpose})]})]},ce)}),e[61]=S,e[62]=J):J=e[62];let ee;e[63]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(ie,{size:"sm",className:"text-ink-black text-left pl-2",children:"Clients see this wherever they pay. Appointments already paid keep the name they were booked under."}),e[63]=ee):ee=e[63];let ue;e[64]!==z||e[65]!==Q||e[66]!==le||e[67]!==J?(ue=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"flex flex-col gap-3",children:[z,Q,q,le,J,ee]})}),e[64]=z,e[65]=Q,e[66]=le,e[67]=J,e[68]=ue):ue=e[68];let ae;e[69]!==H||e[70]!==ue?(ae=t.jsx("form",{onSubmit:H,ref:j,children:ue}),e[69]=H,e[70]=ue,e[71]=ae):ae=e[71];let re;e[72]!==N?(re=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:N,children:"Cancel"}),e[72]=N,e[73]=re):re=e[73];const oe=!d;let de;e[74]===Symbol.for("react.memo_cache_sentinel")?(de=()=>Me(j),e[74]=de):de=e[74];let fe;
1e[75]!==M.SubmitButton||e[76]!==oe?(fe=t.jsx(M.SubmitButton,{fullWidth:!0,disabled:oe,onClick:de,children:"Apply"}),e[75]=M.SubmitButton,e[76]=oe,e[77]=fe):fe=e[77];let xe;e[78]!==M.AppForm||e[79]!==fe?(xe=t.jsx(M.AppForm,{children:fe}),e[78]=M.AppForm,e[79]=fe,e[80]=xe):xe=e[80];let ye;e[81]!==re||e[82]!==xe?(ye=t.jsxs(Ae,{variant:"inline",children:[re,xe]}),e[81]=re,e[82]=xe,e[83]=ye):ye=e[83];let ke;e[84]!==E||e[85]!==ae||e[86]!==ye?(ke=t.jsxs(we,{showClose:!1,children:[E,ae,ye]}),e[84]=E,e[85]=ae,e[86]=ye,e[87]=ke):ke=e[87];let je;return e[88]!==h||e[89]!==R||e[90]!==ke?(je=t.jsx(Ce,{open:h,onOpenChange:R,children:ke}),e[88]=h,e[89]=R,e[90]=ke,e[91]=je):je=e[91],je}function Oi(s){return Number(s)}function To(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Ii}),s[0]=e):e=s[0],e}function Mi(s){const e=W.c(50),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o}=U.getBookSettings.useQuery(n,u),d=U.useUtils(),{toast:r}=De();let c;e[2]!==d?(c=async()=>{await d.getBookSettings.invalidate()},e[2]=d,e[3]=c):c=e[3];let i;e[4]!==o?.isArchived||e[5]!==r?(i=()=>{o?.isArchived&&r({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"})},e[4]=o?.isArchived,e[5]=r,e[6]=i):i=e[6];let f;e[7]!==c||e[8]!==i?(f={onSuccess:c,onError:i},e[7]=c,e[8]=i,e[9]=f):f=e[9];const{mutateAsync:m}=U.updateBook.useMutation(f),[g,x]=P.useState(!0),h=P.useRef(null);let y;e[10]!==l?(y=()=>{x(!1),l()},e[10]=l,e[11]=y):y=e[11];const j=y,k=o?.defaultDepositCurrency??"";let b;e[12]!==k?(b={currency:k},e[12]=k,e[13]=b):b=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p={onChange:se.object({currency:Tn})},e[14]=p):p=e[14];let v;e[15]!==n||e[16]!==j||e[17]!==m?(v=async R=>{const{value:E}=R;await m({bookId:n,defaultDepositCurrency:E.currency}),j()},e[15]=n,e[16]=j,e[17]=m,e[18]=v):v=e[18];let S;e[19]!==v||e[20]!==b?(S={defaultValues:b,validators:p,onSubmit:v},e[19]=v,e[20]=b,e[21]=S):S=e[21];const w=Te(S);let C;e[22]!==j?(C=R=>{R||j()},e[22]=j,e[23]=C):C=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ve,{children:"Currency"}),e[24]=A):A=e[24];let F;e[25]!==w?(F=R=>{R.preventDefault(),w.handleSubmit()},e[25]=w,e[26]=F):F=e[26];let N;e[27]!==w.Field?(N=t.jsx("div",{className:"p-4",children:t.jsx("div",{className:"flex flex-col gap-2",children:t.jsx("div",{children:t.jsx(w.Field,{name:"currency",children:$i})})})}),e[27]=w.Field,e[28]=N):N=e[28];let D;e[29]!==F||e[30]!==N?(D=t.jsx("form",{onSubmit:F,ref:h,children:N}),e[29]=F,e[30]=N,e[31]=D):D=e[31];let T;e[32]!==j?(T=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:j,children:"Cancel"}),e[32]=j,e[33]=T):T=e[33];let _;e[34]===Symbol.for("react.memo_cache_sentinel")?(_=()=>Me(h),e[34]=_):_=e[34];let O;e[35]!==w.SubmitButton?(O=t.jsx(w.SubmitButton,{fullWidth:!0,onClick:_,children:"Apply"}),e[35]=w.SubmitButton,e[36]=O):O=e[36];let B;e[37]!==w.AppForm||e[38]!==O?(B=t.jsx(w.AppForm,{children:O}),e[37]=w.AppForm,e[38]=O,e[39]=B):B=e[39];let I;e[40]!==T||e[41]!==B?(I=t.jsxs(Ae,{variant:"inline",children:[T,B]}),e[40]=T,e[41]=B,e[42]=I):I=e[42];let $;e[43]!==D||e[44]!==I?($=t.jsxs(we,{showClose:!1,children:[A,D,I]}),e[43]=D,e[44]=I,e[45]=$):$=e[45];let M;return e[46]!==g||e[47]!==C||e[48]!==$?(M=t.jsx(Ce,{open:g,onOpenChange:C,children:$}),e[46]=g,e[47]=C,e[48]=$,e[49]=M):M=e[49],M}function $i(s){const e=nt(s);return t.jsxs(t.Fragment,{children:[t.jsx(pn,{value:s.state.value,onValueChange:n=>s.handleChange(n),onBlur:s.handleBlur,invalid:e.length>0,format:"long",className:"w-full"}),t.jsx(ot,{errors:e})]})}function Bo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Mi}),s[0]=e):e=s[0],e}const Ri=s=>s===100?"Client pays":s===0?"Artist pays":s===50?"Split":"Unknown";function Pi(s){const e=W.c(27),{open:n,onOpenChange:l,onConfirm:a,feePercentage:u,isPending:o}=s;let d;e[0]!==u?(d=Ri(u),e[0]=u,e[1]=d):d=e[1];const r=d;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Qe,{children:"Change booking fee preference?"}),e[2]=c):c=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(Ve,{children:[c,t.jsx(ht,{children:t.jsx(qe,{children:"Confirm your booking fee preference change"})})]}),e[3]=i):i=e[3];let f;e[4]!==r?(f=t.jsx("div",{className:"py-4",children:t.jsxs(ie,{element:"p",size:"base",className:"text-center",children:["Once you confirm, all pending deposits and all upcoming payments will be updated to"," ",t.jsx("span",{className:"font-semibold",children:r}),"."]})}),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==l?(m=()=>l(!1),e[6]=l,e[7]=m):m=e[7];let g;e[8]!==o||e[9]!==m?(g=t.jsx(Z,{variant:"secondary",onClick:m,disabled:o,children:"Cancel"}),e[8]=o,e[9]=m,e[10]=g):g=e[10];let x;e[11]!==o?(x=o&&t.jsx(as,{className:"mr-2 h-4 w-4 animate-spin"}),e[11]=o,e[12]=x):x=e[12];let h;e[13]!==o||e[14]!==a||e[15]!==x?(h=t.jsxs(Z,{onClick:a,disabled:o,children:[x,"Confirm"]}),e[13]=o,e[14]=a,e[15]=x,e[16]=h):h=e[16];let y;e[17]!==g||e[18]!==h?(y=t.jsxs(Ge,{children:[g,h]}),e[17]=g,e[18]=h,e[19]=y):y=e[19];let j;e[20]!==f||e[21]!==y?(j=t.jsxs(Ye,{showClose:!1,children:[i,f,y]}),e[20]=f,e[21]=y,e[22]=j):j=e[22];let k;return e[23]!==l||e[24]!==n||e[25]!==j?(k=t.jsx(Ke,{open:n,onOpenChange:l,children:j}),e[23]=l,e[24]=n,e[25]=j,e[26]=k):k=e[26],k}function Ei(s){const e=W.c(57),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(n,u),r=U.useUtils(),{toast:c}=De();let i;e[2]!==r?(i=async()=>{await r.getBookSettings.invalidate()},e[2]=r,e[3]=i):i=e[3];let f;e[4]!==o?.isArchived||e[5]!==c?(f=()=>{o?.isArchived&&c({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"})},e[4]=o?.isArchived,e[5]=c,e[6]=f):f=e[6];let m;e[7]!==i||e[8]!==f?(m={onSuccess:i,onError:f},e[7]=i,e[8]=f,e[9]=m):m=e[9];const{mutateAsync:g,isPending:x}=U.updateBook.useMutation(m),[h,y]=P.useState(!0),[j,k]=P.useState(!1),[b,p]=P.useState(null),[v,S]=P.useState(100);let w;e[10]!==l?(w=()=>{y(!1),l()},e[10]=l,e[11]=w):w=e[11];const C=w;let A,F;if(e[12]!==o?(A=()=>{if(!o)return;const X=o.defaultDepositClientPaysFeePercent??100;S(X)},F=[o],e[12]=o,e[13]=A,e[14]=F):(A=e[13],F=e[14]),P.useEffect(A,F),d||!o)return null;let N;e[15]!==o.defaultDepositCurrency||e[16]!==o.defaultFeeAmountInCents?(N=$t(o.defaultFeeAmountInCents,o.defaultDepositCurrency),e[15]=o.defaultDepositCurrency,e[16]=o.defaultFeeAmountInCents,e[17]=N):N=e[17];const D=N;let T;e[18]!==o.defaultDepositCurrency||e[19]!==o.defaultFeeAmountInCents?(T=$t(Math.round(o.defaultFeeAmountInCents/2),o.defaultDepositCurrency),e[18]=o.defaultDepositCurrency,e[19]=o.defaultFeeAmountInCents,e[20]=T):T=e[20];const _=T,O=`${D} will be added to client's total.`;let B;e[21]!==O?(B={percentage:100,displayName:"Client pays",description:O},e[21]=O,e[22]=B):B=e[22];const I=`${D} will be deducted from payout.`;let $;e[23]!==I?($={percentage:0,displayName:"Artist pays",description:I},e[23]=I,e[24]=$):$=e[24];const M=`Evenly split between you and your client. ${_} added to your client's total and ${_} deducted from your payouts.`;let R;e[25]!==M?(R={percentage:50,displayName:"Split",description:M},e[25]=M,e[26]=R):R=e[26];let E;
1e[27]!==B||e[28]!==$||e[29]!==R?(E=[B,$,R],e[27]=B,e[28]=$,e[29]=R,e[30]=E):E=e[30];const H=E;let z;e[31]!==v?(z=X=>{X!==v&&(p(X),k(!0))},e[31]=v,e[32]=z):z=e[32];const L=z;let Q;e[33]!==n||e[34]!==C||e[35]!==g||e[36]!==b?(Q=async()=>{b!==null&&(await g({bookId:n,clientPaysFeePercent:b}),S(b),k(!1),p(null),C())},e[33]=n,e[34]=C,e[35]=g,e[36]=b,e[37]=Q):Q=e[37];const q=Q;let G;e[38]!==C?(G=X=>{X||C()},e[38]=C,e[39]=G):G=e[39];let V;e[40]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(ve,{children:"Booking Fee"}),e[40]=V):V=e[40];let Y;e[41]!==v||e[42]!==H||e[43]!==L?(Y=t.jsxs(we,{showClose:!1,children:[V,t.jsx("div",{className:"p-5 pb-safe-or-5",children:t.jsx("div",{className:"flex flex-col gap-4",children:t.jsx("div",{className:"flex flex-col gap-4",children:H.map(X=>{const le=v===X.percentage;return t.jsx(Z,{variant:"secondary",onClick:()=>L(X.percentage),fullWidth:!0,className:pe("flex rounded-3xl border-2 p-5 text-left font-sans border-ink-black",!le&&"border-ink-black/10 text-ink-black/60 border-1"),children:t.jsxs("div",{className:"flex w-full flex-row justify-between gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"font-medium",children:X.displayName}),t.jsx("div",{className:"font-light text-xs leading-snug",children:X.description})]}),t.jsx("div",{className:"flex items-center",children:le&&t.jsx(Ee,{size:24})})]})},X.percentage)})})})})]}),e[41]=v,e[42]=H,e[43]=L,e[44]=Y):Y=e[44];let K;e[45]!==h||e[46]!==G||e[47]!==Y?(K=t.jsx(Ce,{open:h,onOpenChange:G,children:Y}),e[45]=h,e[46]=G,e[47]=Y,e[48]=K):K=e[48];let ne;e[49]!==q||e[50]!==x||e[51]!==b||e[52]!==j?(ne=b!==null&&t.jsx(Pi,{open:j,onOpenChange:X=>{X||(k(!1),p(null))},onConfirm:q,feePercentage:b,isPending:x}),e[49]=q,e[50]=x,e[51]=b,e[52]=j,e[53]=ne):ne=e[53];let te;return e[54]!==K||e[55]!==ne?(te=t.jsxs(t.Fragment,{children:[K,ne]}),e[54]=K,e[55]=ne,e[56]=te):te=e[56],te}function Io(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Ei}),s[0]=e):e=s[0],e}function Ui(s){const e=W.c(110),{bookId:n,onHidden:l}=s,a=tt(),{personId:u,handle:o}=Oe(),{isAdmin:d}=P.useContext(wt),r=Ft(),c=Le(),{data:i,isLoading:f}=U.getBookSettings.useQuery(n);let m;e[0]!==n?(m={bookId:n,limit:12,purpose:"FLASH_REQUEST"},e[0]=n,e[1]=m):m=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g={getNextPageParam:Wi},e[2]=g):g=e[2];const{data:x,fetchNextPage:h,isLoading:y,isFetchingNextPage:j}=U.forms.getPageOfPublishedFormsForBook.useInfiniteQuery(m,g);let k;e[3]!==h?(k=()=>{h()},e[3]=h,e[4]=k):k=e[4];const b=k,p=U.useUtils(),{mutateAsync:v,isPending:S}=U.updateBook.useMutation(),[w,C]=P.useState(!0),[A,F]=P.useState(null);let N;e[5]!==l?(N=()=>{C(!1),l()},e[5]=l,e[6]=N):N=e[6];const D=N;let T;e[7]!==i||e[8]!==r.state||e[9]!==c?(T=()=>{i&&r.state?.promptAssignFormId&&r.state?.promptFormKind==="flash"&&(i.flashForm?.id!==r.state.promptAssignFormId&&F({formId:r.state.promptAssignFormId,formTitle:r.state.promptFormTitle}),c(".",{replace:!0,state:{returnTo:r.state?.returnTo}}))},e[7]=i,e[8]=r.state,e[9]=c,e[10]=T):T=e[10];const _=r.state?.promptAssignFormId,O=r.state?.promptFormKind,B=r.state?.promptFormTitle,I=r.state?.returnTo,$=i?.flashForm?.id;let M;e[11]!==i||e[12]!==c||e[13]!==$||e[14]!==_||e[15]!==O||e[16]!==B||e[17]!==I?(M=[_,O,B,I,i,$,c],e[11]=i,e[12]=c,e[13]=$,e[14]=_,e[15]=O,e[16]=B,e[17]=I,e[18]=M):M=e[18],P.useEffect(T,M);let R,E,H,z,L,Q,q,G,V,Y,K;if(e[19]!==D||e[20]!==i||e[21]!==a||e[22]!==o||e[23]!==d||e[24]!==f||e[25]!==w||e[26]!==y||e[27]!==S||e[28]!==x?.pages||e[29]!==v||e[30]!==p){K=Symbol.for("react.early_return_sentinel");e:{const Ne=x?.pages??[];if(H=Ne[Ne.length-1]?.hasMore===!0,f||y||!i){K=null;break e}E=Ce,V=w,e[42]!==D?(Y=Fe=>{Fe||D()},e[42]=D,e[43]=Y):Y=e[43],R=we,q=!1,e[44]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ve,{children:"Choose a Flash form"}),e[44]=G):G=e[44],Q="flex flex-col p-3 overflow-hidden",z="flex flex-col gap-3 overflow-y-auto max-h-76";let Re;e[45]!==D||e[46]!==i.flashForm?.id||e[47]!==i.id||e[48]!==a||e[49]!==o||e[50]!==d||e[51]!==S||e[52]!==v||e[53]!==p?(Re=Fe=>t.jsxs("button",{className:"w-full flex flex-row text-left justify-between hover:bg-ink-black-100 px-4 py-4 rounded-3xl shrink-0 border border-ink-black-100",onClick:async()=>{await v({bookId:i.id,flashFormId:Fe.id}),await p.getBookSettings.invalidate(i.id),D()},disabled:S,children:[t.jsxs("div",{className:"flex flex-col gap-1 leading-tighter",children:[t.jsx(ie,{size:"lg",children:Fe.title}),t.jsxs("div",{className:"flex flex-row gap-2 align-center",children:[t.jsxs(ie,{size:"sm",children:["Updated"," ",us(Fe.lastUpdatedAt,{addSuffix:!0})]}),t.jsx(_e,{className:pe(He({variant:"link"}),"p-0 min-h-0 text-xs font-light font-emphasis"),to:a("form",{handle:o,formId:Fe.id}),state:{assignFormAfterPublish:{bookId:i.id,formKind:"flash"}},onClick:Li,viewTransition:!0,children:"Edit"}),d&&t.jsx(_e,{className:pe(He({variant:"link"}),"p-0 min-h-0 text-xs font-light font-emphasis"),to:a("formStaff",{handle:o,formId:Fe.id}),onClick:Hi,viewTransition:!0,children:"Staff Edit"})]})]}
1),Fe.id===i.flashForm?.id&&t.jsx("div",{children:t.jsx(Ee,{size:24})})]},Fe.id),e[45]=D,e[46]=i.flashForm?.id,e[47]=i.id,e[48]=a,e[49]=o,e[50]=d,e[51]=S,e[52]=v,e[53]=p,e[54]=Re):Re=e[54],L=Ne.flatMap(zi).map(Re)}e[19]=D,e[20]=i,e[21]=a,e[22]=o,e[23]=d,e[24]=f,e[25]=w,e[26]=y,e[27]=S,e[28]=x?.pages,e[29]=v,e[30]=p,e[31]=R,e[32]=E,e[33]=H,e[34]=z,e[35]=L,e[36]=Q,e[37]=q,e[38]=G,e[39]=V,e[40]=Y,e[41]=K}else R=e[31],E=e[32],H=e[33],z=e[34],L=e[35],Q=e[36],q=e[37],G=e[38],V=e[39],Y=e[40],K=e[41];if(K!==Symbol.for("react.early_return_sentinel"))return K;let ne;e[55]!==j?(ne=j&&t.jsx("div",{className:"px-4 py-3 text-center shrink-0",children:"Loading..."}),e[55]=j,e[56]=ne):ne=e[56];let te;e[57]!==b||e[58]!==H||e[59]!==j?(te=!j&&H&&t.jsx(Z,{fullWidth:!0,variant:"tertiary",size:"sm",className:"font-emphasis shrink-0",onClick:b,children:"More"}),e[57]=b,e[58]=H,e[59]=j,e[60]=te):te=e[60];let X;e[61]!==z||e[62]!==L||e[63]!==ne||e[64]!==te?(X=t.jsxs("div",{className:z,children:[L,ne,te]}),e[61]=z,e[62]=L,e[63]=ne,e[64]=te,e[65]=X):X=e[65];let le;e[66]===Symbol.for("react.memo_cache_sentinel")?(le=pe(He({variant:"secondary"}),"font-emphasis font-light text-base w-full"),e[66]=le):le=e[66];let J;e[67]!==a||e[68]!==o||e[69]!==u?(J=a("newForm",{personId:u,handle:o,templateContext:"flash"}),e[67]=a,e[68]=o,e[69]=u,e[70]=J):J=e[70];let ee;e[71]!==i.id?(ee={assignFormAfterPublish:{bookId:i.id,formKind:"flash"}},e[71]=i.id,e[72]=ee):ee=e[72];let ue;e[73]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ns,{size:20}),e[73]=ue):ue=e[73];let ae;e[74]!==le||e[75]!==J||e[76]!==ee?(ae=t.jsx("div",{className:"pt-3",children:t.jsxs(_e,{className:le,to:J,state:ee,viewTransition:!0,children:[ue," Create a new form"]})}),e[74]=le,e[75]=J,e[76]=ee,e[77]=ae):ae=e[77];let re;e[78]!==Q||e[79]!==X||e[80]!==ae?(re=t.jsxs("div",{className:Q,children:[X,ae]}),e[78]=Q,e[79]=X,e[80]=ae,e[81]=re):re=e[81];let oe;e[82]!==R||e[83]!==q||e[84]!==G||e[85]!==re?(oe=t.jsxs(R,{showClose:q,children:[G,re]}),e[82]=R,e[83]=q,e[84]=G,e[85]=re,e[86]=oe):oe=e[86];const de=A!==null;let fe;e[87]===Symbol.for("react.memo_cache_sentinel")?(fe=Ne=>{Ne||F(null)},e[87]=fe):fe=e[87];let xe;e[88]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(Qe,{children:"Use this form?"}),e[88]=xe):xe=e[88];const ye=A?.formTitle??"this form";let ke;e[89]!==i.name||e[90]!==ye?(ke=t.jsxs(Ve,{children:[xe,t.jsxs(qe,{children:["Do you want to use ",ye," for"," ",i.name,"?"]})]}),e[89]=i.name,e[90]=ye,e[91]=ke):ke=e[91];let je;e[92]===Symbol.for("react.memo_cache_sentinel")?(je=t.jsx(Z,{variant:"secondary",onClick:()=>{F(null)},children:"Do this later"}),e[92]=je):je=e[92];let ce;e[93]!==A||e[94]!==i.id||e[95]!==v||e[96]!==p?(ce=t.jsxs(Ge,{children:[je,t.jsx(Z,{variant:"primary",onClick:async()=>{A&&(await v({bookId:i.id,flashFormId:A.formId}),await p.getBookSettings.invalidate(i.id),F(null))},children:"Use this form"})]}),e[93]=A,e[94]=i.id,e[95]=v,e[96]=p,e[97]=ce):ce=e[97];let me;e[98]!==ke||e[99]!==ce?(me=t.jsxs(Ye,{showClose:!1,children:[ke,ce]}),e[98]=ke,e[99]=ce,e[100]=me):me=e[100];let he;e[101]!==de||e[102]!==me?(he=t.jsx(Ke,{open:de,onOpenChange:fe,children:me}),e[101]=de,e[102]=me,e[103]=he):he=e[103];let Se;return e[104]!==E||e[105]!==V||e[106]!==Y||e[107]!==oe||e[108]!==he?(Se=t.jsxs(E,{open:V,onOpenChange:Y,children:[oe,he]}),e[104]=E,e[105]=V,e[106]=Y,e[107]=oe,e[108]=he,e[109]=Se):Se=e[109],Se}function Hi(s){return s.stopPropagation()}function Li(s){return s.stopPropagation()}function zi(s){return s.items}function Wi(s){return s.hasMore?s.items[s.items.length-1].id:null}function Oo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Ui}),s[0]=e):e=s[0],e}function Qi(s){const e=W.c(38),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(n,u),r=U.useUtils();let c;e[2]!==r?(c={onSuccess:async()=>{await r.getBookSettings.invalidate()}},e[2]=r,e[3]=c):c=e[3];const{mutateAsync:i}=U.updateBookLimits.useMutation(c),[f,m]=P.useState(!1),g=P.useRef(null);let x;e[4]!==o?.maxAppointmentDurationMinutes?(x=o?.maxAppointmentDurationMinutes?.toString()??"",e[4]=o?.maxAppointmentDurationMinutes,e[5]=x):x=e[5];let h;e[6]!==x?(h={maxAppointmentDurationMinutes:x}
1,e[6]=x,e[7]=h):h=e[7];let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y={onChange:se.object({maxAppointmentDurationMinutes:se.string().pipe(Bn.or(se.literal("")))})},e[8]=y):y=e[8];let j;e[9]!==n||e[10]!==i?(j=async O=>{const{value:B}=O;await i({bookId:n,maxAppointmentDurationMinutes:B.maxAppointmentDurationMinutes===""?null:Number(B.maxAppointmentDurationMinutes)}),m(!0)},e[9]=n,e[10]=i,e[11]=j):j=e[11];let k;e[12]!==h||e[13]!==j?(k={defaultValues:h,validators:y,onSubmit:j},e[12]=h,e[13]=j,e[14]=k):k=e[14];const b=Te(k);if(d)return null;let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Max. appointment duration"}),t.jsx(ut,{setHide:m})]}),e[15]=p):p=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Z,{variant:"secondary",onClick:()=>m(!0),children:"Cancel"}),e[16]=v):v=e[16];let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=()=>Me(g),e[17]=S):S=e[17];let w;e[18]!==b.SubmitButton?(w=t.jsx(b.SubmitButton,{onClick:S,children:"Apply"}),e[18]=b.SubmitButton,e[19]=w):w=e[19];let C;e[20]!==b.AppForm||e[21]!==w?(C=t.jsxs("div",{className:"flex flex-row justify-between",children:[v,t.jsx(b.AppForm,{children:w})]}),e[20]=b.AppForm,e[21]=w,e[22]=C):C=e[22];let A;e[23]!==b?(A=O=>{O.preventDefault(),b.handleSubmit()},e[23]=b,e[24]=A):A=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("div",{children:"What's the maximum time an appointment can go for? Leave blank for no limit."}),e[25]=F):F=e[25];let N;e[26]!==b.AppField?(N=t.jsx("div",{className:"p-5",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[F,t.jsx("div",{children:t.jsx(b.AppField,{name:"maxAppointmentDurationMinutes",children:qi})})]})}),e[26]=b.AppField,e[27]=N):N=e[27];let D;e[28]!==A||e[29]!==N?(D=t.jsx("form",{onSubmit:A,ref:g,children:N}),e[28]=A,e[29]=N,e[30]=D):D=e[30];let T;e[31]!==C||e[32]!==D?(T=t.jsx(ft,{headerSlot:p,footerSlot:C,children:D}),e[31]=C,e[32]=D,e[33]=T):T=e[33];let _;return e[34]!==f||e[35]!==l||e[36]!==T?(_=t.jsx(mt,{hide:f,onHidden:l,children:T}),e[34]=f,e[35]=l,e[36]=T,e[37]=_):_=e[37],_}function qi(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Duration (minutes)",type:"number",min:"0"})}function Mo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Qi}),s[0]=e):e=s[0],e}const Vi=se.object({bookId:se.string(),enabled:se.boolean(),quantity:se.coerce.number().int().min(1).max(32767).nullable()}).refine(s=>!s.enabled||s.quantity!==null,{message:"Required",path:["quantity"]});function Gi(s){const e=Number.parseInt(s,10);return isNaN(e)||e<1?"":`Clients cannot book within ${e} ${e===1?"day":"days"} of a tattoo start time`}function Yi(s){const e=W.c(57),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(n,u),[r,c]=P.useState(!0),[i,f]=P.useState(!1),[m,g]=P.useState(!!o?.minAppointmentTimeFromTodayQuantity);let x;e[2]!==o?.minAppointmentTimeFromTodayQuantity?(x=o?.minAppointmentTimeFromTodayQuantity?.toString()||"1",e[2]=o?.minAppointmentTimeFromTodayQuantity,e[3]=x):x=e[3];const[h,y]=P.useState(x),j=U.useUtils();let k;e[4]!==j?(k={onSuccess:async()=>{await j.getBookSettings.invalidate(),await j.findFirstDateWithAvailability.invalidate(),await j.getCalendarWeeklyAvailability.invalidate()}},e[4]=j,e[5]=k):k=e[5];const{mutateAsync:b}=U.updateBookMinimumNotice.useMutation(k);let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={},e[6]=p):p=e[6];const[v,S]=P.useState(p);let w,C;e[7]!==o?(w=()=>{o&&(g(!!o.minAppointmentTimeFromTodayQuantity),y(o.minAppointmentTimeFromTodayQuantity?.toString()||"1"))},C=[o],e[7]=o,e[8]=w,e[9]=C):(w=e[8],C=e[9]),P.useEffect(w,C);let A;e[10]!==l?(A=()=>{c(!1),l()},e[10]=l,e[11]=A):A=e[11];const F=A;let N;e[12]!==n||e[13]!==o||e[14]!==F||e[15]!==m||e[16]!==h||e[17]!==b?(N=async Y=>{if(Y.preventDefault(),!o)return;f(!0);const K=Vi.safeParse({bookId:o.id,enabled:m,quantity:isNaN(Number.parseInt(h))?null:Number.parseInt(h)});if(!K.success){S(K.error.flatten().fieldErrors),f(!1);return}
1await b({bookId:n,option:K.data.enabled?"time-restricted":"disabled",quantity:K.data.quantity??1,unit:"DAYS"}),f(!1),F()},e[12]=n,e[13]=o,e[14]=F,e[15]=m,e[16]=h,e[17]=b,e[18]=N):N=e[18];const D=N;if(d)return null;let T;e[19]!==F?(T=Y=>{Y||F()},e[19]=F,e[20]=T):T=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ve,{children:"Minimum Notice"}),e[21]=_):_=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ie,{size:"base",className:"leading-snug text-ink-black",children:"Minimum notice"}),t.jsx(ie,{size:"sm",className:"text-ink-black-600",children:"Restrict how close to a start time clients can book"})]}),e[22]=O):O=e[22];let B;e[23]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{g(Ki)},e[23]=B):B=e[23];let I;e[24]!==m?(I=t.jsxs("div",{className:"flex flex-row justify-between",children:[O,t.jsx(fs,{checked:m,onCheckedChange:B})]}),e[24]=m,e[25]=I):I=e[25];const $=!m;let M;e[26]!==h||e[27]!==$?(M=t.jsx(et,{label:"Days",type:"number",inputMode:"numeric",onChangeValue:y,value:h,disabled:$}),e[26]=h,e[27]=$,e[28]=M):M=e[28];let R;e[29]!==v.quantity?(R=t.jsx(ot,{errors:v.quantity,className:"pt-2"}),e[29]=v.quantity,e[30]=R):R=e[30];let E;e[31]!==m||e[32]!==v.quantity||e[33]!==h?(E=!v.quantity&&m&&t.jsx(ie,{element:"span",size:"xs",className:"leading-tighter text-ink-black-600",children:Gi(h)}),e[31]=m,e[32]=v.quantity,e[33]=h,e[34]=E):E=e[34];let H;e[35]!==M||e[36]!==R||e[37]!==E?(H=t.jsxs("div",{className:"flex flex-col gap-3 rounded-lg",children:[M,R,E]}),e[35]=M,e[36]=R,e[37]=E,e[38]=H):H=e[38];let z;e[39]!==I||e[40]!==H?(z=t.jsxs("div",{className:"flex flex-col p-5 gap-5",children:[I,H]}),e[39]=I,e[40]=H,e[41]=z):z=e[41];let L;e[42]!==F?(L=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:F,children:"Cancel"}),e[42]=F,e[43]=L):L=e[43];let Q;e[44]!==i?(Q=t.jsx(Z,{variant:"primary",fullWidth:!0,disabled:i,submit:!0,children:"Update"}),e[44]=i,e[45]=Q):Q=e[45];let q;e[46]!==L||e[47]!==Q?(q=t.jsxs(Ae,{variant:"inline",children:[L,Q]}),e[46]=L,e[47]=Q,e[48]=q):q=e[48];let G;e[49]!==D||e[50]!==z||e[51]!==q?(G=t.jsxs(we,{showClose:!1,children:[_,t.jsxs("form",{onSubmit:D,children:[z,q]})]}),e[49]=D,e[50]=z,e[51]=q,e[52]=G):G=e[52];let V;return e[53]!==r||e[54]!==T||e[55]!==G?(V=t.jsx(Ce,{open:r,onOpenChange:T,children:G}),e[53]=r,e[54]=T,e[55]=G,e[56]=V):V=e[56],V}function Ki(s){return!s}function $o(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Yi}),s[0]=e):e=s[0],e}function Zi(s){const e=W.c(48),{bookId:n,onHidden:l}=s,{data:a,isLoading:u}=U.getBookSettings.useQuery(n),o=U.useUtils(),{toast:d}=De();let r;e[0]!==o?(r=async()=>{await o.getPersonSettings.invalidate(),await o.getBookSettings.invalidate()},e[0]=o,e[1]=r):r=e[1];let c;e[2]!==a?.isArchived||e[3]!==d?(c=()=>{a?.isArchived&&d({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"})},e[2]=a?.isArchived,e[3]=d,e[4]=c):c=e[4];let i;e[5]!==r||e[6]!==c?(i={onSuccess:r,onError:c},e[5]=r,e[6]=c,e[7]=i):i=e[7];const{mutateAsync:f}=U.updateBook.useMutation(i),[m,g]=P.useState(!0),x=P.useRef(null);let h;e[8]!==l?(h=()=>{g(!1),l()},e[8]=l,e[9]=h):h=e[9];const y=h,j=a?.name??"";let k;e[10]!==j?(k={name:j},e[10]=j,e[11]=k):k=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b={onChange:se.object({name:se.string()})},e[12]=b):b=e[12];let p;e[13]!==n||e[14]!==y||e[15]!==f?(p=async M=>{const{value:R}=M;await f({bookId:n,name:R.name}),y()},e[13]=n,e[14]=y,e[15]=f,e[16]=p):p=e[16];let v;e[17]!==k||e[18]!==p?(v={defaultValues:k,validators:b,onSubmit:p},e[17]=k,e[18]=p,e[19]=v):v=e[19];const S=Te(v);if(u)return null;let w;e[20]!==y?(w=M=>{M||y()},e[20]=y,e[21]=w):w=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ve,{children:"Name"}),e[22]=C):C=e[22];let A;e[23]!==S?(A=M=>{M.preventDefault(),S.handleSubmit()},e[23]=S,e[24]=A):A=e[24];let F;e[25]!==S.AppField?(F=t.jsx("div",{className:"p-5 pb-safe-or-5",children:t.jsx("div",{className:"flex flex-col gap-2",children:t.jsx(S.AppField,{name:"name",children:Xi}
1)})}),e[25]=S.AppField,e[26]=F):F=e[26];let N;e[27]!==A||e[28]!==F?(N=t.jsx("form",{onSubmit:A,ref:x,children:F}),e[27]=A,e[28]=F,e[29]=N):N=e[29];let D;e[30]!==y?(D=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:y,children:"Cancel"}),e[30]=y,e[31]=D):D=e[31];let T;e[32]===Symbol.for("react.memo_cache_sentinel")?(T=()=>Me(x),e[32]=T):T=e[32];let _;e[33]!==S.SubmitButton?(_=t.jsx(S.SubmitButton,{fullWidth:!0,onClick:T,children:"Apply"}),e[33]=S.SubmitButton,e[34]=_):_=e[34];let O;e[35]!==S.AppForm||e[36]!==_?(O=t.jsx(S.AppForm,{children:_}),e[35]=S.AppForm,e[36]=_,e[37]=O):O=e[37];let B;e[38]!==D||e[39]!==O?(B=t.jsxs(Ae,{variant:"inline",children:[D,O]}),e[38]=D,e[39]=O,e[40]=B):B=e[40];let I;e[41]!==N||e[42]!==B?(I=t.jsxs(we,{showClose:!1,children:[C,N,B]}),e[41]=N,e[42]=B,e[43]=I):I=e[43];let $;return e[44]!==m||e[45]!==w||e[46]!==I?($=t.jsx(Ce,{open:m,onOpenChange:w,children:I}),e[44]=m,e[45]=w,e[46]=I,e[47]=$):$=e[47],$}function Xi(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Name"})}function Ro(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Zi}),s[0]=e):e=s[0],e}function Po(){const s=W.c(10),{bookId:e}=st(),n=!!e;let l;s[0]!==n?(l={enabled:n},s[0]=n,s[1]=l):l=s[1];const{data:a,isLoading:u}=U.getBookSettings.useQuery(e,l),o=Le();if(u){let c;return s[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(lt,{}),s[2]=c):c=s[2],c}if(!e){let c;return s[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Be,{code:Ie.hookUseParams_bookId}),s[3]=c):c=s[3],c}if(!a){let c;return s[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Be,{code:Ie.getBookSettings}),s[4]=c):c=s[4],c}let d;s[5]!==o?(d=()=>{o("../",{preventScrollReset:!0})},s[5]=o,s[6]=d):d=s[6];let r;return s[7]!==a||s[8]!==d?(r=t.jsx(Cn,{bookSettings:a,onHidden:d}),s[7]=a,s[8]=d,s[9]=r):r=s[9],r}function Ji(s){const e=W.c(48),{bookId:n,onHidden:l}=s,{data:a}=U.getBookSettings.useQuery(n),u=U.useUtils(),{toast:o}=De();let d;e[0]!==u?(d=async()=>{await u.getPersonSettings.invalidate(),await u.getBookSettings.invalidate()},e[0]=u,e[1]=d):d=e[1];let r;e[2]!==a?.isArchived||e[3]!==o?(r=()=>{a?.isArchived&&o({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"})},e[2]=a?.isArchived,e[3]=o,e[4]=r):r=e[4];let c;e[5]!==d||e[6]!==r?(c={onSuccess:d,onError:r},e[5]=d,e[6]=r,e[7]=c):c=e[7];const{mutateAsync:i}=U.updateBook.useMutation(c),[f,m]=P.useState(!1),g=P.useRef(null),x=a?.customFormTitle??"",h=a?.customFormDescription??"",y=a?.flashTitle??"",j=a?.flashDescription??"";let k;e[8]!==x||e[9]!==h||e[10]!==y||e[11]!==j?(k={customFormTitle:x,customFormDescription:h,flashTitle:y,flashDescription:j},e[8]=x,e[9]=h,e[10]=y,e[11]=j,e[12]=k):k=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={onChange:se.object({customFormTitle:se.string().max(128),customFormDescription:se.string().max(128),flashTitle:se.string().max(128),flashDescription:se.string().max(128)})},e[13]=b):b=e[13];let p;e[14]!==n||e[15]!==i?(p=async R=>{const{value:E}=R;await i({bookId:n,customFormTitle:E.customFormTitle,customFormDescription:E.customFormDescription,flashTitle:E.flashTitle,flashDescription:E.flashDescription}),m(!0)},e[14]=n,e[15]=i,e[16]=p):p=e[16];let v;e[17]!==p||e[18]!==k?(v={defaultValues:k,validators:b,onSubmit:p},e[17]=p,e[18]=k,e[19]=v):v=e[19];const S=Te(v);let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Edit service title and description"}),t.jsx(ut,{setHide:m})]}),e[20]=w):w=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Z,{variant:"secondary",onClick:()=>m(!0),children:"Cancel"}),e[21]=C):C=e[21];let A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=()=>Me(g),e[22]=A):A=e[22];let F;e[23]!==S.SubmitButton?(F=t.jsx(S.SubmitButton,{onClick:A,children:"Apply"}),e[23]=S.SubmitButton,e[24]=F):F=e[24];let N;e[25]!==S.AppForm||e[26]!==F?(N=t.jsxs("div",{className:"flex flex-row justify-between",children:[C,t.jsx(S.AppForm,{children:F})]}),e[25]=S.AppForm,e[26]=F,e[27]=N):N=e[27];let D;e[28]!==S?(D=R=>{R.preventDefault(),S.handleSubmit()},e[28]=S,e[29]=D):D=e[29];let T,_,O,B;e[30]!==S.AppField?(T=t.jsx(S.AppField,{name:"customFormTitle",children:nl}),_=t.jsx(S.AppField,{name:"customFormDescription",children:sl}),O=t.jsx(S.AppField,{name:"flashTitle",children:tl}),B=t.jsx(S.AppField,{name:"flashDescription",children:el}),e[30]=S.AppField,e[31]=T,e[32]=_,e[33]=O,e[34]=B):(T=e[31],_=e[32],O=e[33],B=e[34]);let I;e[35]!==D||e[36]!==T||e[37]!==_||e[38]!==O||e[39]!==B?(I=t.jsxs("form",{className:"space-y-4 p-4",onSubmit:D,ref:g,children:[T,_,O,B]}
1),e[35]=D,e[36]=T,e[37]=_,e[38]=O,e[39]=B,e[40]=I):I=e[40];let $;e[41]!==N||e[42]!==I?($=t.jsx(ft,{headerSlot:w,footerSlot:N,children:I}),e[41]=N,e[42]=I,e[43]=$):$=e[43];let M;return e[44]!==f||e[45]!==l||e[46]!==$?(M=t.jsx(mt,{hide:f,onHidden:l,children:$}),e[44]=f,e[45]=l,e[46]=$,e[47]=M):M=e[47],M}function el(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Flash description"})}function tl(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Flash title"})}function sl(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Custom form description"})}function nl(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Custom form title"})}function Eo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Ji}),s[0]=e):e=s[0],e}function il({bookId:s,onHidden:e}){const{data:n,isLoading:l}=U.getBookSettings.useQuery(s),[a,u]=P.useState(!1),[o,d]=P.useState(!1),r=U.useUtils(),{toast:c}=De(),{mutateAsync:i,isPending:f}=U.updateBook.useMutation(),m=P.useMemo(()=>n?n.isOpen&&n.isFlashEnabled&&!n.isCustomTattooEnabled?"open-flash-only":n.isOpen&&n.isCustomTattooEnabled?"open":"closed":null,[n]),[g,x]=P.useState(!0),h=()=>{x(!1),e()},y=async v=>{try{if(m!==v){switch(v){case"open":await i({bookId:s,isCustomTattooEnabled:!0,isOpen:!0});break;case"open-flash-only":await i({bookId:s,isCustomTattooEnabled:!1,isOpen:!0});break;case"closed":await i({bookId:s,isOpen:!1,isCustomTattooEnabled:!0});break;default:throw new Error(`Invalid status: ${v}`)}await r.getBookSettings.invalidate(),await r.getBooksTypeformInfo.invalidate(),await r.getPersonSettings.invalidate()}h()}catch(S){if(console.error("Error updating status:",S),n?.isArchived){c({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"});return}c({title:"Couldn't update your book",description:S instanceof Error&&S.message?S.message:"Please try again.",variant:"error"})}};if(l||!n)return null;const j=!!n.customForm||!!n.requestTypeformFormId,k=f||!j,b=!n.isFlashEnabled||f,p=f;return t.jsx(Ce,{open:g,onOpenChange:v=>{v||h()},children:t.jsxs(we,{showClose:!1,children:[t.jsx(ve,{children:"Book Status"}),t.jsx("div",{className:"px-3 py-3",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"relative",children:[t.jsxs(Z,{className:"w-full text-left text-lg font-sans font-semibold pr-3",disabled:k,onClick:()=>{y("open")},variant:"transparent",children:[t.jsxs("div",{className:"flex-1",children:[n.isFlashEnabled&&t.jsxs(t.Fragment,{children:["Open"," ",t.jsxs("span",{className:"font-emphasis text-sm font-normal",children:[" ","(Flash + Custom)"]})]}),!n.isFlashEnabled&&t.jsx(t.Fragment,{children:"Open"})]}),m==="open"&&t.jsx(Ee,{size:24})]}),!j&&t.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2",children:t.jsx(rt,{content:"Add an intake form to take custom requests",open:o,onOpenChange:d,className:"w-48",children:t.jsx("button",{type:"button","aria-label":"Why is this unavailable? Add an intake form to take custom requests","aria-expanded":o,onClick:v=>{v.preventDefault(),v.stopPropagation(),d(!o)},children:t.jsx(dt,{size:16,className:pe("stroke-none",o?"text-ink-black":"text-ink-black-300")})})})})]}),t.jsxs("div",{className:"relative",children:[t.jsxs(Z,{className:"w-full text-left text-lg font-sans font-semibold pr-3",disabled:b,onClick:()=>{y("open-flash-only")},variant:"transparent",children:[t.jsxs("div",{className:"flex-1",children:["Open"," ",t.jsxs("span",{className:"font-emphasis text-sm font-normal",children:[" ","(Flash only)"]})]}),m==="open-flash-only"&&t.jsx(Ee,{size:24})]}),!n.isFlashEnabled&&t.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2",children:t.jsx(rt,{content:"Upload flash and make it bookable to enable",open:a,onOpenChange:u,className:"w-48",children:t.jsx("button",{onClick:v=>{v.preventDefault(),v.stopPropagation(),u(!a)},children:t.jsx(dt,{size:16,className:pe("stroke-none",a?"text-ink-black":"text-ink-black-300")})})})})]}),t.jsxs(Z,{className:"text-left text-lg font-sans font-semibold pr-3",disabled:p,onClick:()=>{y("closed")},variant:"transparent",children:[t.jsx("div",{className:"flex-1",children:"Closed"}),m==="closed"&&t.jsx(Ee,{size:24})]})]})})]})})}function Uo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:il}),s[0]=e):e=s[0],e}function ll(s){const e=W.c(23),{bookId:n,onHidden:l}=s,{data:a,isLoading:u}=U.getBookSettings.useQuery(n),o=U.useUtils(),{toast:d}=De();let r;e[0]!==o?(r=async()=>{await Promise.all([o.getPersonSettings.invalidate(),o.getBookSettings.invalidate()])},e[0]=o,e[1]=r):r=e[1];let c;e[2]!==a?.isArchived||e[3]!==d?(c=()=>{a?.isArchived?d({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"}):d({title:"Failed to update book location",variant:"error"})},e[2]=a?.isArchived,e[3]=d,e[4]=c):c=e[4];let i;e[5]!==r||e[6]!==c?(i={onSuccess:r,onError:c},e[5]=r,e[6]=c,e[7]=i):i=e[7];const{mutateAsync:f}=U.updateBook.useMutation(i),[m,g]=P.useState(!0),x=P.useRef(!1),h=P.useRef(!1);let y;
1e[8]!==l?(y=()=>{h.current||(h.current=!0,g(!1),l())},e[8]=l,e[9]=y):y=e[9];const j=y;if(u)return null;let k;e[10]!==j?(k=S=>{!S&&!x.current&&j()},e[10]=j,e[11]=k):k=e[11];let b;e[12]!==n||e[13]!==j||e[14]!==f?(b=async S=>{if(!x.current){x.current=!0;try{await f({bookId:n,defaultStudioId:S}),j()}catch{x.current=!1}}},e[12]=n,e[13]=j,e[14]=f,e[15]=b):b=e[15];let p;e[16]!==a?(p=a?{id:a.studio.id,name:a.studio.name,address:Us(a.studio)}:void 0,e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==m||e[19]!==k||e[20]!==b||e[21]!==p?(v=t.jsx(In,{isOpen:m,onOpenChange:k,onLocationSelected:b,currentLocation:p,title:"Studio",description:"Choose a location for this book, or add a new one.",showPrivacyStep:!1}),e[18]=m,e[19]=k,e[20]=b,e[21]=p,e[22]=v):v=e[22],v}function Ho(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:ll}),s[0]=e):e=s[0],e}function ol(s){const e=W.c(57),{bookId:n,onHidden:l}=s,{data:a,isLoading:u}=U.getBookSettings.useQuery(n),o=U.useUtils(),{toast:d}=De();let r;e[0]!==o?(r=async()=>{await o.getPersonSettings.invalidate(),await o.getBookSettings.invalidate()},e[0]=o,e[1]=r):r=e[1];let c;e[2]!==a?.isArchived||e[3]!==d?(c=()=>{a?.isArchived&&d({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"})},e[2]=a?.isArchived,e[3]=d,e[4]=c):c=e[4];let i;e[5]!==r||e[6]!==c?(i={onSuccess:r,onError:c},e[5]=r,e[6]=c,e[7]=i):i=e[7];const{mutateAsync:f}=U.updateBook.useMutation(i),[m,g]=P.useState(!0),x=P.useRef(null);let h;e[8]!==l?(h=()=>{g(!1),l()},e[8]=l,e[9]=h):h=e[9];const y=h,j=a?.tag??"",k=a?.tagColor??"#b2dd31";let b;e[10]!==j||e[11]!==k?(b={tag:j,tagColor:k},e[10]=j,e[11]=k,e[12]=b):b=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p={onChange:se.object({tag:se.string().max(12),tagColor:se.string().max(7)})},e[13]=p):p=e[13];let v;e[14]!==n||e[15]!==y||e[16]!==f?(v=async L=>{const{value:Q}=L;await f({bookId:n,tag:Q.tag,tagColor:Q.tagColor}),y()},e[14]=n,e[15]=y,e[16]=f,e[17]=v):v=e[17];let S;e[18]!==b||e[19]!==v?(S={defaultValues:b,validators:p,onSubmit:v},e[18]=b,e[19]=v,e[20]=S):S=e[20];const w=Te(S);if(u)return null;let C;e[21]!==y?(C=L=>{L||y()},e[21]=y,e[22]=C):C=e[22];let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ve,{children:"Book Tag"}),e[23]=A):A=e[23];let F;e[24]!==w?(F=L=>{L.preventDefault(),w.handleSubmit()},e[24]=w,e[25]=F):F=e[25];let N;e[26]!==w.Field?(N=t.jsx("div",{children:t.jsx(w.Field,{name:"tagColor",children:rl})}),e[26]=w.Field,e[27]=N):N=e[27];let D;e[28]!==w.AppField?(D=t.jsx("div",{className:"flex flex-col gap-2 flex-1",children:t.jsx(w.AppField,{name:"tag",children:al})}),e[28]=w.AppField,e[29]=D):D=e[29];let T;e[30]!==N||e[31]!==D?(T=t.jsxs("div",{className:"flex flex-row gap-2",children:[N,D]}),e[30]=N,e[31]=D,e[32]=T):T=e[32];let _;e[33]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ie,{size:"sm",children:"Shown in your Inbox and Calendar, keep it short and sweet."}),e[33]=_):_=e[33];let O;e[34]!==T?(O=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[T,_]})}),e[34]=T,e[35]=O):O=e[35];let B;e[36]!==F||e[37]!==O?(B=t.jsx("form",{onSubmit:F,ref:x,children:O}),e[36]=F,e[37]=O,e[38]=B):B=e[38];let I;e[39]!==y?(I=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:y,children:"Cancel"}),e[39]=y,e[40]=I):I=e[40];let $;e[41]===Symbol.for("react.memo_cache_sentinel")?($=()=>Me(x),e[41]=$):$=e[41];let M;e[42]!==w.SubmitButton?(M=t.jsx(w.SubmitButton,{fullWidth:!0,onClick:$,children:"Apply"}),e[42]=w.SubmitButton,e[43]=M):M=e[43];let R;e[44]!==w.AppForm||e[45]!==M?(R=t.jsx(w.AppForm,{children:M}),e[44]=w.AppForm,e[45]=M,e[46]=R):R=e[46];let E;e[47]!==I||e[48]!==R?(E=t.jsxs(Ae,{variant:"inline",children:[I,R]}),e[47]=I,e[48]=R,e[49]=E):E=e[49];let H;e[50]!==B||e[51]!==E?(H=t.jsxs(we,{showClose:!1,children:[A,B,E]}),e[50]=B,e[51]=E,e[52]=H):H=e[52];let z;return e[53]!==m||e[54]!==C||e[55]!==H?(z=t.jsx(Ce,{open:m,onOpenChange:C,children:H}),e[53]=m,e[54]=C,e[55]=H,e[56]=z):z=e[56],z}function al(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Tag",maxLength:12})}function rl(s){return t.jsxs("div",{className:"flex flex-col gap-2 border border-ink-black-100 rounded-xl p-2 bg-ink-
1paper",children:[t.jsx(ie,{size:"xs",className:"text-nowrap text-ink-black-600",children:"Color"}),t.jsx("div",{children:t.jsx("input",{type:"color",onBlur:s.handleBlur,onChange:e=>s.handleChange(e.target.value),value:s.state.value})}),t.jsx(ot,{errors:nt(s)})]})}function Lo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:ol}),s[0]=e):e=s[0],e}function cl(s){const e=W.c(51),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(n,u),r=U.useUtils();let c;e[2]!==r?(c={onSuccess:async()=>{await r.getBookSettings.invalidate()}},e[2]=r,e[3]=c):c=e[3];const{mutateAsync:i}=U.updateBookTerms.useMutation(c),[f,m]=P.useState(!0),g=o?.bookingTerms.showTerms??!1,x=o?.bookingTerms.mustAgree??!1,h=o?.bookingTerms.terms??"";let y;e[4]!==g||e[5]!==x||e[6]!==h?(y={showTerms:g,mustAgree:x,terms:h},e[4]=g,e[5]=x,e[6]=h,e[7]=y):y=e[7];let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j={onChange:se.object({showTerms:se.boolean(),mustAgree:se.boolean(),terms:se.string()})},e[8]=j):j=e[8];let k;e[9]!==n||e[10]!==i?(k=async R=>{const{value:E}=R;await i({bookId:n,defaultBookingTermsAcceptanceRequired:E.mustAgree,defaultBookingTerms:E.terms,defaultBookingTermsEnabled:E.showTerms}),m(!1)},e[9]=n,e[10]=i,e[11]=k):k=e[11];let b;e[12]!==y||e[13]!==k?(b={defaultValues:y,validators:j,onSubmit:k},e[12]=y,e[13]=k,e[14]=b):b=e[14];const p=Te(b);if(d)return null;let v;e[15]!==l||e[16]!==f?(v=()=>{f||l()},e[15]=l,e[16]=f,e[17]=v):v=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Dt,{children:t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Booking terms"})}),e[18]=S):S=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs(Tt,{children:[S,t.jsx(Bt,{children:t.jsx(ht,{children:"Update the booking terms for your book."})})]}),e[19]=w):w=e[19];let C;e[20]!==p?(C=R=>{R.preventDefault(),p.handleSubmit()},e[20]=p,e[21]=C):C=e[21];let A;e[22]!==p.AppField?(A=t.jsx("div",{className:"flex flex-row gap-4 text-left border-b border-b-muted pb-6 justify-between",children:t.jsx(p.AppField,{name:"showTerms",children:fl})}),e[22]=p.AppField,e[23]=A):A=e[23];let F;e[24]!==p.Subscribe?(F=R=>t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:pe("flex flex-col gap-3"),children:[t.jsx("div",{className:"text-base font-medium",children:"Require confirmation"}),t.jsx("div",{className:"text-sm text-ink-black",children:"When enabled, the client needs to click a checkbox before paying."})]}),t.jsx("div",{children:t.jsx(p.Subscribe,{selector:ul,children:E=>t.jsx(R.SwitchField,{disabled:!E})})})]}),e[24]=p.Subscribe,e[25]=F):F=e[25];let N;e[26]!==p.AppField||e[27]!==F?(N=t.jsx("div",{className:"flex flex-row gap-4 text-left border-b border-b-muted pb-6 justify-between",children:t.jsx(p.AppField,{name:"mustAgree",children:F})}),e[26]=p.AppField,e[27]=F,e[28]=N):N=e[28];let D;e[29]!==p.AppField?(D=t.jsx("div",{className:"flex flex-col flex-1",children:t.jsx(p.AppField,{name:"terms",children:dl})}),e[29]=p.AppField,e[30]=D):D=e[30];let T;e[31]!==A||e[32]!==N||e[33]!==D?(T=t.jsxs(At,{className:"flex-1 p-5 flex flex-col gap-5",children:[A,N,D]}),e[31]=A,e[32]=N,e[33]=D,e[34]=T):T=e[34];let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(bs,{asChild:!0,children:t.jsx(Z,{variant:"secondary",children:"Cancel"})}),e[35]=_):_=e[35];let O;e[36]!==p.SubmitButton?(O=t.jsx(p.SubmitButton,{submit:!0,children:"Apply"}),e[36]=p.SubmitButton,e[37]=O):O=e[37];let B;e[38]!==p.AppForm||e[39]!==O?(B=t.jsxs(_t,{children:[_,t.jsx(p.AppForm,{children:O})]}),e[38]=p.AppForm,e[39]=O,e[40]=B):B=e[40];let I;e[41]!==C||e[42]!==T||e[43]!==B?(I=t.jsxs("form",{onSubmit:C,className:"flex flex-col h-full overflow-hidden",children:[T,B]}),e[41]=C,e[42]=T,e[43]=B,e[44]=I):I=e[44];let $;e[45]!==v||e[46]!==I?($=t.jsxs(It,{side:"right",onAnimationEndCapture:v,children:[w,I]}),e[45]=v,e[46]=I,e[47]=$):$=e[47];let M;return e[48]!==f||e[49]!==$?(M=t.jsx(Ot,{open:f,onOpenChange:m,children:$}),e[48]=f,e[49]=$,e[50]=M):M=e[50],M}function dl(s){return t.jsx(s.RichTextField,{placeholder:"Include any booking T&Cs to show before a client books with you."})}function ul(s){return s.values.showTerms}function fl(s){return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ie,{size:"base",variant:"heading",children:"Booking terms"}),t.jsx("div",{className:"text-sm text-ink-black",children:"Show terms before the client pays their deposit."})]}),t.jsx("div",{children:t.jsx(s.SwitchField,{})})]})}function zo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:cl}),s[0]=e):e=s[0],e}function ml(s){const e=W.c(53),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o}=U.getBookSettings.useQuery(n,u),d=U.useUtils(),{toast:r}=De();let c;e[2]!==d?(c=async()=>{await d.getBookSettings.invalidate()},e[2]=d,e[3]=c):c=e[3];let i;e[4]!==o?.isArchived||e[5]!==r?(i=()=>{o?.isArchived&&r({title:"Cannot update an archived book",description:"Please unarchive the book first",variant:"error"})},e[4]=o?.isArchived,e[5]=r,e[6]=i):i=e[6];let f;e[7]!==c||e[8]!==i?(f={onSuccess:c,onError:i},e[7]=c,e[8]=i,e[9]=f):f=e[9];const{mutateAsync:m}=U.updateBook.useMutation(f),[g,x]=P.useState(!0),h=P.useRef(null);let y;e[10]!==l?(y=()=>{x(!1),l()},e[10]=l,e[11]=y):y=e[11];const j=y,k=o?.startTimeIncrementMinutes??30;let b;e[12]!==k?(b=k.toString(),e[12]=k,e[13]=b):b=e[13];let p;e[14]!==b?(p={startTimeIncrementMinutes:b},e[14]=b,e[15]=p):p=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v={onChange:se.object({startTimeIncrementMinutes:se.enum(["5","15","20","30"])})},e[16]=v):v=e[16];let S;e[17]!==n||e[18]!==j||e[19]!==m?(S=async H=>{const{value:z}=H;await m({bookId:n,startTimeIncrementMinutes:Number(z.startTimeIncrementMinutes)}),j()},e[17]=n,e[18]=j,e[19]=m,e[20]=S):S=e[20];let w;e[21]!==S||e[22]!==p?(w={defaultValues:p,validators:v,onSubmit:S},e[21]=S,e[22]=p,e[23]=w):w=e[23];const C=Te(w);let A;e[24]!==j?(A=H=>{H||j()},e[24]=j,e[25]=A):A=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ve,{children:"Time Selection"}
1),e[26]=F):F=e[26];let N;e[27]!==C?(N=H=>{H.preventDefault(),C.handleSubmit()},e[27]=C,e[28]=N):N=e[28];let D;e[29]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{children:"How often should appointment time slots be available?"}),e[29]=D):D=e[29];let T;e[30]!==C.AppField?(T=t.jsx("div",{className:"p-5 pb-safe-or-5",children:t.jsxs("div",{className:"flex flex-col gap-3",children:[D,t.jsx("div",{children:t.jsx(C.AppField,{name:"startTimeIncrementMinutes",children:hl})})]})}),e[30]=C.AppField,e[31]=T):T=e[31];let _;e[32]!==N||e[33]!==T?(_=t.jsx("form",{onSubmit:N,ref:h,children:T}),e[32]=N,e[33]=T,e[34]=_):_=e[34];let O;e[35]!==j?(O=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:j,children:"Cancel"}),e[35]=j,e[36]=O):O=e[36];let B;e[37]===Symbol.for("react.memo_cache_sentinel")?(B=()=>Me(h),e[37]=B):B=e[37];let I;e[38]!==C.SubmitButton?(I=t.jsx(C.SubmitButton,{fullWidth:!0,onClick:B,children:"Apply"}),e[38]=C.SubmitButton,e[39]=I):I=e[39];let $;e[40]!==C.AppForm||e[41]!==I?($=t.jsx(C.AppForm,{children:I}),e[40]=C.AppForm,e[41]=I,e[42]=$):$=e[42];let M;e[43]!==O||e[44]!==$?(M=t.jsxs(Ae,{variant:"inline",children:[O,$]}),e[43]=O,e[44]=$,e[45]=M):M=e[45];let R;e[46]!==_||e[47]!==M?(R=t.jsxs(we,{showClose:!1,children:[F,_,M]}),e[46]=_,e[47]=M,e[48]=R):R=e[48];let E;return e[49]!==g||e[50]!==A||e[51]!==R?(E=t.jsx(Ce,{open:g,onOpenChange:A,children:R}),e[49]=g,e[50]=A,e[51]=R,e[52]=E):E=e[52],E}function hl(s){return t.jsxs(s.SelectField,{className:"h-full",children:[t.jsx(Xe,{value:"5",children:"every 5 minutes"}),t.jsx(Xe,{value:"15",children:"every 15 minutes"}),t.jsx(Xe,{value:"20",children:"every 20 minutes"}),t.jsx(Xe,{value:"30",children:"every 30 minutes"})]})}function Wo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:ml}),s[0]=e):e=s[0],e}function pl(s){const e=W.c(18),{day:n,subtitle:l,isEmpty:a,isSelected:u,onSelect:o}=s,d=u&&"bg-ink-black text-ink-white",r=a&&"opacity-50";let c;e[0]!==d||e[1]!==r?(c=pe("flex flex-col items-center gap-1 px-2 py-3 rounded-lg",d,r),e[0]=d,e[1]=r,e[2]=c):c=e[2];const i=u&&"font-normal";let f;e[3]!==i?(f=pe("text-2xl font-light capitalize",i),e[3]=i,e[4]=f):f=e[4];let m;e[5]!==n?(m=n.slice(0,3),e[5]=n,e[6]=m):m=e[6];let g;e[7]!==f||e[8]!==m?(g=t.jsx("div",{className:f,children:m}),e[7]=f,e[8]=m,e[9]=g):g=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=pe("text-xs font-normal"),e[10]=x):x=e[10];let h;e[11]!==l?(h=t.jsx("div",{className:x,children:l}),e[11]=l,e[12]=h):h=e[12];let y;return e[13]!==o||e[14]!==c||e[15]!==g||e[16]!==h?(y=t.jsxs("button",{type:"button",className:c,onClick:o,children:[g,h]}),e[13]=o,e[14]=c,e[15]=g,e[16]=h,e[17]=y):y=e[17],y}const gt=s=>s.length===0?[]:s[0].startTimes,xl=(s,e)=>s.length===0?[]:s.length===1?[{...s[0],startTimes:e}]:s;function bl(s){const e=W.c(80),{bookId:n,bookSettings:l,onHidden:a}=s,{use24h:u}=On();let o;e[0]!==l.workingHoursMinutesOfDay?(o=Ut.find(q=>l.workingHoursMinutesOfDay[q].length>0)??"sunday",e[0]=l.workingHoursMinutesOfDay,e[1]=o):o=e[1];const[d,r]=P.useState(o),c=l.workingHoursMinutesOfDay[d];let i;e[2]!==c?(i=gt(c),e[2]=c,e[3]=i):i=e[3];const[f,m]=P.useState(i),g=U.useUtils();let x;e[4]!==g?(x={onSuccess:async()=>{await g.getBookSettings.invalidate()}},e[4]=g,e[5]=x):x=e[5];const{mutateAsync:h}=U.updateBookTimeSlots.useMutation(x),[y,j]=P.useState(!0),k=l.timeZone;let b;e[6]!==n||e[7]!==h||e[8]!==f||e[9]!==d?(b=async()=>{await h({bookId:n,weekDay:d,startTimes:f})},e[6]=n,e[7]=h,e[8]=f,e[9]=d,e[10]=b):b=e[10];const p=b;let v;e[11]!==l.workingHoursMinutesOfDay||e[12]!==d?(v=()=>{m(gt(l.workingHoursMinutesOfDay[d]))},e[11]=l.workingHoursMinutesOfDay,e[12]=d,e[13]=v):v=e[13];const S=v;let w,C,A,F,N,D,T,_,O,B,I,$,M;if(e[14]!==l.startTimeIncrementMinutes||e[15]!==l.workingHoursMinutesOfDay||e[16]!==a||e[17]!==y||e[18]!==f||e[19]!==k||e[20]!==u||e[21]!==d){const q=Qs(l.workingHoursMinutesOfDay[d],k,l.startTimeIncrementMinutes);let G;e[35]!==l.workingHoursMinutesOfDay||e[36]!==f||e[37]!==d?(G=Hs(f,gt(l.workingHoursMinutesOfDay[d])),e[35]=l.workingHoursMinutesOfDay,e[36]=f,e[37]=d,e[38]=G):G=e[38],F=!G;let V;e[39]!==l.startTimeIncrementMinutes||e[40]!==l.workingHoursMinutesOfDay||e[41]!==f||e[42]!==k||e[43]!==d?(V=J=>{const ee=$n(vn(J.startedAt,k,"HH:mm")),ae=l.workingHoursMinutesOfDay[d].flatMap(re=>{const oe=[];for(let de=re.start;de<=re.end-l.startTimeIncrementMinutes;de=de+l.startTimeIncrementMinutes,de)oe.push(de);return oe});if(f.length===0){const re=ae.filter(oe=>oe!==ee);m(re)}else if(f.includes(ee)){const re=f.filter(oe=>oe!==ee);m(re)}else{const re=[...f,ee].sort(yl);re.length===ae.length?m([]):m(re)}},e[39]=l.startTimeIncrementMinutes,e[40]=l.workingHoursMinutesOfDay,e[41]=f,e[42]=k,e[43]=d,e[44]=V):V=e[44];const Y=V,K=l.workingHoursMinutesOfDay[d],ne=f.length===0?K.flatMap(J=>{const ee=[];for(let ue=J.start;ue<=J.end-l.startTimeIncrementMinutes;ue=ue+l.startTimeIncrementMinutes,ue)ee.push(ue);return ee}):f,te=Mn(vt(new Date,"yyyy-MM-dd"),xl(K,ne),l.startTimeIncrementMinutes,k,[],"artist",void 0,void 0,l.startTimeIncrementMinutes),X=gl;A=Ot,O=y,B=j,C=It,N="bg-ink-white pt-0 flex flex-col gap-0",D="right",e[45]!==a||e[46]!==y?(T=()=>{y||a()},e[45]=a,e[46]=y,e[47]=T):T=e[47],e[48]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(Tt,{children:[t.jsx(Dt,{className:"text-lg leading-tighter font-medium text-center",children:"Starting Times"}),t.jsx(Bt,{children:"Select start times that clients can book you."})]}),e[48]=_):_=e[48];let le;e[49]!==l.workingHoursMinutesOfDay||e[50]!==d?(le=Ut.map(J=>t.jsx(pl,{day:J,isEmpty:l.workingHoursMinutesOfDay[J].length===0,isSelected:J===d,onSelect:()=>{r(J),m(l.workingHoursMinutesOfDay[J][0]?.startTimes??[])},subtitle:X(l.workingHoursMinutesOfDay[J])},J)),e[49]=l.workingHoursMinutesOfDay,e[50]=d,e[51]=le):le=e[51],e[52]!==le?(M=t.jsx("div",{className:"py-1 px-2 border-b border-ink-black-100 grid grid-cols-7",children:le}),e[52]=le,e[53]=M):M=e[53],w=At,I="flex-1 pt-8",$=te.length>0?t.jsxs("div",{className:"calendar-grid relative",style:{gridTemplateColumns:"18% repeat(1, minmax(7rem, 1fr))",gridTemplateRows:Gs(q)},children:[te.map(J=>t.jsx(qs,{timeSlot:J,scale:q,onClick:()=>Y(J),isSelected:J.tag==="Starting Time",columnOffset:0,studioTimeZone:k},`available-${J.startedAt.toISOString()}`)),q.slots.map((J,ee)=>t.jsx(Vs,{index:ee,slot:J,numberOfColumns:2,studioTimeZone:k,use24h:u},`scale-${J.toISOString()}`))]}):t.jsx("div",{className:"text-center text-ink-black",children:"No working hours set for this week day."}),e[14]=l.startTimeIncrementMinutes,e[15]=l.workingHoursMinutesOfDay,e[16]=a,e[17]=y,e[18]=f,e[19]=k,e[20]=u,e[21]=d,e[22]=w,e[23]=C,e[24]=A,e[25]=F,e[26]=N,e[27]=D,e[28]=T,e[29]=_,e[30]=O,e[31]=B,e[32]=I,e[33]=$,e[34]=M}else w=e[22],C=e[23],A=e[24],F=e[25],N=e[26],D=e[27],T=e[28],_=e[29],O=e[30],B=e[31],I=e[32],$=e[33],M=e[34];let R;e[54]!==w||e[55]!==I||e[56]!==$?(R=t.jsx(w,{className:I,children:$}),e[54]=w,e[55]=I,e[56]=$,e[57]=R):R=e[57];let E;e[58]!==R||e[59]!==M?(E=t.jsxs(t.Fragment,{children:[M,R]}),e[58]=R,e[59]=M,e[60]=E):E=e[60];let H;e[61]!==S||e[62]!==p||e[63]!==F?(H=F&&t.jsx(ct.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},children:t.jsxs(_t,{children:[t.jsx(Z,{variant:"secondary",className:"w-full select-none",onClick:S,children:"Cancel"}),t.jsx(Z,{variant:"primary",className:"w-full select-none",onClick:p,children:"Apply"})]})}),e[61]=S,e[62]=p,e[63]=F,e[64]=H):H=e[64];let z;e[65]!==H?(z=t.jsx(fn,{children:H}),e[65]=H,e[66]=z):z=e[66];let L;e[67]!==C||e[68]!==N||e[69]!==D||e[70]!==T||e[71]!==_||e[72]!==E||e[73]!==z?(L=t.jsxs(C,{className:N,side:D,onAnimationEndCapture:T,children:[_,E,z]}),e[67]=C,e[68]=N,e[69]=D,e[70]=T,e[71]=_,e[72]=E,e[73]=z,e[74]=L):L=e[74];let Q;return e[75]!==A||e[76]!==O||e[77]!==B||e[78]!==L?(Q=t.jsx(A,{open:O,onOpenChange:B,children:L}),e[75]=A,e[76]=O,e[77]=B,e[78]=L,e[79]=Q):Q=e[79],Q}function gl(s){if(s.length===0)return"Day off";if(s.length===1){const e=s[0].startTimes.length;return e===0?"All times":e===1?"1 time":`${e} times`}return""}function yl(s,e){return s-e}function kl(s){const e=W.c(6),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getBookSettings.useQuery(n,u);if(d||!o)return null;let r;return e[2]!==n||e[3]!==o||e[4]!==l?(r=t.jsx(bl,{bookId:n,bookSettings:o,onHidden:l}),e[2]=n,e[3]=o,e[4]=l,e[5]=r):r=e[5],r}function Qo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:kl}),s[0]=e):e=s[0],e}const jl=s=>{const e=parseInt(s);return!isNaN(e)&&e>=0&&e<=is},Ss=`Please enter a number between 0 and ${is}`,vl=[{name:"optionA",label:"Option A"},{name:"optionB",label:"Option B"},{name:"optionC",label:"Option C"}];function Sl(s){const e=W.c(64),{onHidden:n}=s,{personId:l}=Oe(),a=!!l;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o,isLoading:d}=U.getPaymentSettings.useQuery(l,u),r=U.useUtils();let c;e[2]!==r?(c={onSuccess:async()=>{await r.getPaymentSettings.invalidate()}},e[2]=r,e[3]=c):c=e[3];const{mutateAsync:i}=U.updateGratuitySettings.useMutation(c),[f,m]=P.useState(!0),g=P.useRef(null);let x;e[4]!==n?(x=()=>{m(!1),n()},e[4]=n,e[5]=x):x=e[5];const h=x,y=String(Math.floor((o?.gratuity1BasisPoints??1500)/100)),j=String(Math.floor((o?.gratuity2BasisPoints??1800)/100)),k=String(Math.floor((o?.gratuity3BasisPoints??2e3)/100)),b=o?.isGratuityEnabled??!0;let p;e[6]!==y||e[7]!==j||e[8]!==k||e[9]!==b?(p={optionA:y,optionB:j,optionC:k,isGratuityEnabled:b},e[6]=y,e[7]=j,e[8]=k,e[9]=b,e[10]=p):p=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v={onChange:se.object({optionA:se.string(),optionB:se.string(),optionC:se.string(),isGratuityEnabled:se.boolean()}).superRefine(Fl)},e[11]=v):v=e[11];let S;e[12]!==h||e[13]!==l||e[14]!==i?(S=async V=>{const{value:Y}=V;await i({personId:l,gratuity1BasisPoints:parseInt(Y.optionA)*100,gratuity2BasisPoints:parseInt(Y.optionB)*100,gratuity3BasisPoints:parseInt(Y.optionC)*100,isGratuityEnabled:Y.isGratuityEnabled}),h()},e[12]=h,e[13]=l,e[14]=i,e[15]=S):S=e[15];let w;e[16]!==S||e[17]!==p?(w={defaultValues:p,validators:v,onSubmit:S},e[16]=S,e[17]=p,e[18]=w):w=e[18];const C=Te(w);let A;e[19]!==h?(A=V=>
1{V||h()},e[19]=h,e[20]=A):A=e[20];let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ve,{children:"Tip Defaults"}),e[21]=F):F=e[21];let N;e[22]!==C?(N=V=>{V.preventDefault(),C.handleSubmit()},e[22]=C,e[23]=N):N=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsxs("div",{children:[t.jsx(ie,{size:"base",variant:"heading",className:"text-ink-black",children:"Enable tipping"}),t.jsx(ie,{size:"sm",className:"text-ink-black-600 mt-1",children:"When enabled, clients will be prompted to add a tip during checkout"})]}),e[24]=D):D=e[24];let T;e[25]!==d?(T=V=>t.jsx(V.SwitchField,{disabled:d}),e[25]=d,e[26]=T):T=e[26];let _;e[27]!==C.AppField||e[28]!==T?(_=t.jsx("div",{className:"flex flex-col gap-4 px-4 py-4 border-b border-ink-black-100",children:t.jsxs("div",{className:"flex items-center justify-between",children:[D,t.jsx(C.AppField,{name:"isGratuityEnabled",children:T})]})}),e[27]=C.AppField,e[28]=T,e[29]=_):_=e[29];let O;e[30]!==C.Field||e[31]!==d?(O=V=>t.jsxs("div",{className:pe("flex flex-col gap-2 px-4 transition-opacity",!V&&"opacity-50 pointer-events-none"),children:[t.jsx(ie,{size:"sm",variant:"heading",className:"text-ink-black mb-2",children:"Tip options"}),vl.map(Y=>{const{name:K,label:ne}=Y;return t.jsx(C.Field,{name:K,children:te=>t.jsxs("div",{className:pe("flex-1 border border-ink-black-100 rounded-lg p-2 focus-within:border-ink-forest transition-all",nt(te).length>0&&"border-red-500"),children:[t.jsx(ie,{size:"sm",className:"text-ink-black-600",children:ne}),t.jsx(Rn,{variant:"small",className:"focus:outline-none",disabled:d,onBlur:te.handleBlur,onChange:X=>te.handleChange(X.target.value),value:te.state.value,suffix:"%",type:"text",inputMode:"numeric",maxLength:3})]})},K)}),t.jsx("div",{className:"flex-1 border border-ink-black-100 rounded-lg transition-all bg-ink-black-50 cursor-not-allowed",children:t.jsx("div",{className:"text-ink-black-600 text-sm p-2 h-[52px] flex items-center justify-center",children:"Custom"})}),t.jsx("div",{className:"flex-1 border border-ink-black-100 rounded-lg transition-all bg-ink-black-50 cursor-not-allowed",children:t.jsx("div",{className:"text-ink-black-600 text-sm p-2 h-[52px] flex items-center justify-center",children:"No tip"})})]}),e[30]=C.Field,e[31]=d,e[32]=O):O=e[32];let B;e[33]!==C.Subscribe||e[34]!==O?(B=t.jsx(C.Subscribe,{selector:Nl,children:O}),e[33]=C.Subscribe,e[34]=O,e[35]=B):B=e[35];let I;e[36]!==C.Subscribe?(I=t.jsx(C.Subscribe,{selector:Cl,children:wl}),e[36]=C.Subscribe,e[37]=I):I=e[37];let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ie,{size:"sm",className:"text-ink-black-600 text-center px-4 pb-4",children:"The average client using Venue leaves an 18% tip."}),e[38]=$):$=e[38];let M;e[39]!==_||e[40]!==B||e[41]!==I?(M=t.jsxs("div",{className:"flex flex-col gap-4",children:[_,B,I,$]}),e[39]=_,e[40]=B,e[41]=I,e[42]=M):M=e[42];let R;e[43]!==N||e[44]!==M?(R=t.jsx("form",{onSubmit:N,ref:g,children:M}),e[43]=N,e[44]=M,e[45]=R):R=e[45];let E;e[46]!==h?(E=t.jsx(Z,{variant:"secondary",fullWidth:!0,onClick:h,children:"Cancel"}),e[46]=h,e[47]=E):E=e[47];let H;e[48]===Symbol.for("react.memo_cache_sentinel")?(H=()=>Me(g),e[48]=H):H=e[48];let z;e[49]!==C.SubmitButton?(z=t.jsx(C.SubmitButton,{fullWidth:!0,onClick:H,children:"Update"}),e[49]=C.SubmitButton,e[50]=z):z=e[50];let L;e[51]!==C.AppForm||e[52]!==z?(L=t.jsx(C.AppForm,{children:z}),e[51]=C.AppForm,e[52]=z,e[53]=L):L=e[53];let Q;e[54]!==E||e[55]!==L?(Q=t.jsxs(Ae,{variant:"inline",children:[E,L]}),e[54]=E,e[55]=L,e[56]=Q):Q=e[56];let q;e[57]!==R||e[58]!==Q?(q=t.jsxs(we,{showClose:!1,children:[F,R,Q]}),e[57]=R,e[58]=Q,e[59]=q):q=e[59];let G;return e[60]!==f||e[61]!==A||e[62]!==q?(G=t.jsx(Ce,{open:f,onOpenChange:A,children:q}),e[60]=f,e[61]=A,e[62]=q,e[63]=G):G=e[63],G}function wl(s){return s?t.jsx("div",{className:"text-red-500 text-sm text-left px-4",children:Ss}):null}function Cl(s){return!!(s.fieldMeta.optionA?.errors.length||s.fieldMeta.optionB?.errors.length||s.fieldMeta.optionC?.errors.length)}function Nl(s){return s.values.isGratuityEnabled}function Fl(s,e){if(s.isGratuityEnabled)for(const n of["optionA","optionB","optionC"])jl(s[n])||e.addIssue({code:se.ZodIssueCode.custom,path:[n],message:Ss})}function qo(){const s=W.c(2),e=Le();let n;return s[0]!==e?(n=t.jsx(Sl,{onHidden:()=>{e("../",{preventScrollReset:!0})}}),s[0]=e,s[1]=n):n=s[1],n}const Al=s=>{if(!s)return"";const e=/(?:https?:\/\/)?(?:admin\.|form\.)?typeform\.com\/(?:to|form)\/([a-zA-Z0-9]{8})/;return s.match(e)?.[1]??""};function _l(s){const e=W.c(48),{bookId:n,onHidden:l}=s,{data:a,isLoading:u}=U.getBookSettings.useQuery(n),o=U.useUtils(),[d,r]=P.useState(null);let c;e[0]!==o?(c=async()=>{await o.getBookSettings.invalidate()},e[0]=o,e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=L=>{Ls(L)&&r(L.message)},e[2]=i):i=e[2];let f;e[3]!==c?(f={onSuccess:c,onError:i},e[3]=c,e[4]=f):f=e[4];const{mutateAsync:m}=U.updateBookInternal.useMutation(f),[g,x]=P.useState(!1),[h,y]=P.useState(null),j=P.useRef(null),k=a?.waiverTypeformFormId||"";let b;e[5]!==k?(b={waiverTypeformFormId:k},e[5]=k,e[6]=b):b=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={onChange:se.object({waiverTypeformFormId:se.string().length(8).or(se.literal(""))})},e[7]=p):p=e[7];let v;e[8]!==n||e[9]!==m?(v=async L=>{const{value:Q}=L;r(null),await m({bookId:n,waiverTypeformFormId:Q.waiverTypeformFormId}),x(!0)},e[8]=n,e[9]=m,e[10]=v):v=e[10];let S;e[11]!==b||e[12]!==v?(S={defaultValues:b,validators:p,onSubmit:v},e[11]=b,e[12]=v,e[13]=S):S=e[13];const w=Te(S);let C,A;e[14]!==w||e[15]!==h?(A=()=>{if(!h)return;const L=Q=>{const q=Q.clipboardData?.getData("text")??"",G=Al(q);G&&(Q.preventDefault(),w.setFieldValue("waiverTypeformFormId",G))};
1return h.addEventListener("paste",L),()=>{h.removeEventListener("paste",L)}},C=[h,w],e[14]=w,e[15]=h,e[16]=C,e[17]=A):(C=e[16],A=e[17]),P.useEffect(A,C);let F;e[18]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsxs("div",{className:"font-semibold text-2xl font-impactful",children:["Book",t.jsx(Nt,{className:"inline-block size-4"}),"Waiver Typeform Form ID"]}),t.jsx(ut,{setHide:x})]}),e[18]=F):F=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Z,{variant:"secondary",onClick:()=>x(!0),children:"Cancel"}),e[19]=N):N=e[19];let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=()=>Me(j),e[20]=D):D=e[20];let T;e[21]!==w.SubmitButton?(T=t.jsx(w.SubmitButton,{onClick:D,children:"Apply"}),e[21]=w.SubmitButton,e[22]=T):T=e[22];let _;e[23]!==w.AppForm||e[24]!==T?(_=t.jsxs("div",{className:"flex flex-row justify-between",children:[N,t.jsx(w.AppForm,{children:T})]}),e[23]=w.AppForm,e[24]=T,e[25]=_):_=e[25];let O;e[26]!==w?(O=L=>{L.preventDefault(),w.handleSubmit()},e[26]=w,e[27]=O):O=e[27];let B;e[28]!==u||e[29]!==d?(B=L=>{const[Q]=nt(L),q=Q??d;return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{children:t.jsx(et,{disabled:u,fullWidth:!0,invalid:!!q,label:"Waiver Typeform Form ID",onBlur:L.handleBlur,onChangeValue:G=>{L.handleChange(G),r(null)},ref:y,value:L.state.value})}),q&&t.jsx("div",{className:"text-red-500",children:q})]})},e[28]=u,e[29]=d,e[30]=B):B=e[30];let I;e[31]!==w.Field||e[32]!==B?(I=t.jsx("div",{children:t.jsx(w.Field,{name:"waiverTypeformFormId",children:B})}),e[31]=w.Field,e[32]=B,e[33]=I):I=e[33];let $;e[34]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("br",{}),e[34]=$):$=e[34];let M;e[35]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsxs("div",{className:"text-ink-black text-sm text-left pl-2 flex flex-col gap-2",children:["The ID is 8 characters long and you can find it in the URL.",$,"You can also paste the URL and the ID will be extracted, example of valid URLs:",t.jsxs("ul",{className:"list-disc font-mono",children:[t.jsx("li",{children:"https://admin.typeform.com/form/tikvBs3M/create..."}),t.jsx("li",{children:"https://form.typeform.com/to/HK1I9Ihv"})]})]}),e[35]=M):M=e[35];let R;e[36]!==I?(R=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[I,M]})}),e[36]=I,e[37]=R):R=e[37];let E;e[38]!==O||e[39]!==R?(E=t.jsx("form",{onSubmit:O,ref:j,children:R}),e[38]=O,e[39]=R,e[40]=E):E=e[40];let H;e[41]!==_||e[42]!==E?(H=t.jsx(ft,{headerSlot:F,footerSlot:_,children:E}),e[41]=_,e[42]=E,e[43]=H):H=e[43];let z;return e[44]!==g||e[45]!==l||e[46]!==H?(z=t.jsx(mt,{hide:g,onHidden:l,children:H}),e[44]=g,e[45]=l,e[46]=H,e[47]=z):z=e[47],z}function Vo(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:_l}),s[0]=e):e=s[0],e}function Dl(s){const e=W.c(48),{bookId:n,onHidden:l}=s,a=!!n;let u;e[0]!==a?(u={enabled:a},e[0]=a,e[1]=u):u=e[1];const{data:o}=U.getBookSettings.useQuery(n,u),d=U.useUtils();let r;e[2]!==d?(r={onSuccess:async()=>{await d.getBookSettings.invalidate()}},e[2]=d,e[3]=r):r=e[3];const{mutateAsync:c}=U.updateBookLimits.useMutation(r),[i,f]=P.useState(!1),m=P.useRef(null),g=o?.zeroDollarDepositsDisallowedAt?Sn(o.zeroDollarDepositsDisallowedAt,o.createdAt)?"atTime":"always":"never";let x;e[4]!==o?(x=o?.zeroDollarDepositsDisallowedAt?zs(o.zeroDollarDepositsDisallowedAt,Rt(),"yyyy-MM-dd'T'HH:mm:ss"):"",e[4]=o,e[5]=x):x=e[5];let h;e[6]!==g||e[7]!==x?(h={disallowedMode:g,zeroDollarDepositsDisallowedAt:x},e[6]=g,e[7]=x,e[8]=h):h=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y={onChange:se.object({disallowedMode:se.enum(["never","always","atTime"]),zeroDollarDepositsDisallowedAt:se.string()}).superRefine(Ol)},e[9]=y):y=e[9];let j;e[10]!==n||e[11]!==o?.createdAt||e[12]!==c?(j=async $=>{const{value:M}=$;await c({bookId:n,zeroDollarDepositsDisallowedAtUtc:M.disallowedMode==="never"?null:M.disallowedMode==="always"?o?.createdAt:new Date(M.zeroDollarDepositsDisallowedAt)}),f(!0)},e[10]=n,e[11]=o?.createdAt,e[12]=c,e[13]=j):j=e[13];let k;e[14]!==h||e[15]!==j?(k={defaultValues:h,validators:y,onSubmit:j},e[14]=h,e[15]=j,e[16]=k):k=e[16];const b=Te(k);let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"$0 deposits"}),t.jsx(ut,{setHide:f})]}),e[17]=p):p=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Z,{variant:"secondary",onClick:()=>f(!0),children:"Cancel"}),e[18]=v):v=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=()=>Me(m),e[19]=S):S=e[19];let w;e[20]!==b.SubmitButton?(w=t.jsx(b.SubmitButton,{onClick:S,children:"Apply"}),e[20]=b.SubmitButton,e[21]=w):w=e[21];let C;e[22]!==b.AppForm||e[23]!==w?(C=t.jsxs("div",{className:"flex flex-row justify-between",children:[v,t.jsx(b.AppForm,{children:w})]}),e[22]=b.AppForm,e[23]=w,e[24]=C):C=e[24];let A;e[25]!==b?(A=$=>{$.preventDefault(),b.handleSubmit()},e[25]=b,e[26]=A):A=e[26];let F;e[27]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("div",{children:"When should they be prevented from making $0 deposits?"}),e[27]=F):F=e[27];let N;e[28]!==b.AppField?(N=t.jsx("div",{children:t.jsx(b.AppField,{name:"disallowedMode",children:Bl})}),e[28]=b.AppField,e[29]=N):N=e[29];let D;e[30]!==b.AppField?(D=$=>t.jsx(b.AppField,{name:"zeroDollarDepositsDisallowedAt",children:M=>t.jsx(M.TextField,{fullWidth:!0,label:`Prevent $0 deposits at (in your browser's local time of ${Rt()})`,type:"datetime-local",disabled:$!=="atTime"})}),e[30]=b.AppField,e[31]=D):D=e[31];let T;e[32]!==b.Subscribe||e[33]!==D?(T=t.jsx("div",{children:t.jsx(b.Subscribe,{selector:Tl,children:D})}),e[32]=b.Subscribe,e[33]=D,e[34]=T):T=e[34];let _;e[35]!==N||e[36]!==T?(_=t.jsx("div",{className:"p-5",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[F,N,T]})}
1),e[35]=N,e[36]=T,e[37]=_):_=e[37];let O;e[38]!==A||e[39]!==_?(O=t.jsx("form",{onSubmit:A,ref:m,children:_}),e[38]=A,e[39]=_,e[40]=O):O=e[40];let B;e[41]!==C||e[42]!==O?(B=t.jsx(ft,{headerSlot:p,footerSlot:C,children:O}),e[41]=C,e[42]=O,e[43]=B):B=e[43];let I;return e[44]!==i||e[45]!==l||e[46]!==B?(I=t.jsx(mt,{hide:i,onHidden:l,children:B}),e[44]=i,e[45]=l,e[46]=B,e[47]=I):I=e[47],I}function Tl(s){return s.values.disallowedMode}function Bl(s){return t.jsx(s.RadioGroupField,{name:"dateTimeOption",className:"flex flex-col gap-2",children:["never","always","atTime"].map(Il)})}function Il(s){return t.jsxs(Ws,{htmlFor:`dto${s}`,className:"flex flex-row gap-1 items-center",children:[t.jsx(Pn,{id:`dto${s}`,value:s}),s==="never"?"Always allow $0 deposits":s==="always"?"Never allow $0 deposits":"Allow $0 deposits until a set time:"]},s)}function Ol(s,e){s.disallowedMode==="atTime"&&Number.isNaN(new Date(s.zeroDollarDepositsDisallowedAt).getTime())&&e.addIssue({code:se.ZodIssueCode.custom,path:["zeroDollarDepositsDisallowedAt"],message:"Please choose a valid date and time"})}function Go(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{sheet:Dl}),s[0]=e):e=s[0],e}function Ml(s){const e=W.c(37),{reader:n,personId:l,onHidden:a}=s,[u,o]=P.useState(!0),d=U.useUtils();let r;e[0]!==l||e[1]!==d?(r=()=>{Je({title:"Card reader removed",description:"The card reader has been removed"}),d.terminalReaders.getPageOfTerminalReaders.invalidate(l),o(!1)},e[0]=l,e[1]=d,e[2]=r):r=e[2];const{mutateAsync:c,isPending:i}=U.terminalReaders.deleteTerminalReader.useMutation({onSuccess:r,onError:_=>{const O=ls(_);g(O||_.message)}}),[f,m]=P.useState(void 0),g=m;let x;e[3]!==c||e[4]!==n.id||e[5]!==g?(x=async()=>{g(void 0),await c({terminalReaderId:n.id})},e[3]=c,e[4]=n.id,e[5]=g,e[6]=x):x=e[6];const h=x;let y;e[7]!==a||e[8]!==u?(y=()=>{u||a()},e[7]=a,e[8]=u,e[9]=y):y=e[9];const j=`"${n.label??n.id}"`;let k;e[10]!==j?(k=t.jsxs(Qe,{children:["Remove ",j,"?"]}),e[10]=j,e[11]=k):k=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ht,{children:t.jsx(qe,{children:"This action will permanently remove the card reader."})}),e[12]=b):b=e[12];let p;e[13]!==k?(p=t.jsxs(Ve,{children:[k,b]}),e[13]=k,e[14]=p):p=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs("ul",{className:"list-disc list-inside text-left text-sm",children:[t.jsx("li",{children:"The card reader will be unregistered from Stripe"}),t.jsx("li",{children:"You will no longer be able to process payments with this reader"}),t.jsx("li",{children:"You may register the card reader again at a later date"})]}),e[15]=v):v=e[15];let S;e[16]!==f?(S=f&&t.jsx("div",{className:"font-medium text-center text-ink-destructive mt-4",children:f}),e[16]=f,e[17]=S):S=e[17];let w;e[18]!==S?(w=t.jsxs("div",{children:[v,S]}),e[18]=S,e[19]=w):w=e[19];let C;e[20]!==i?(C=t.jsx(Ct,{asChild:!0,children:t.jsx(Z,{variant:"secondary",disabled:i,children:"Cancel"})}),e[20]=i,e[21]=C):C=e[21];const A=i?"Removing...":"Remove card reader";let F;e[22]!==h||e[23]!==i||e[24]!==A?(F=t.jsx(Z,{variant:"destructive",onClick:h,disabled:i,children:A}),e[22]=h,e[23]=i,e[24]=A,e[25]=F):F=e[25];let N;e[26]!==C||e[27]!==F?(N=t.jsxs(Ge,{children:[C,F]}),e[26]=C,e[27]=F,e[28]=N):N=e[28];let D;e[29]!==w||e[30]!==N||e[31]!==y||e[32]!==p?(D=t.jsxs(Ye,{showClose:!1,onAnimationEndCapture:y,children:[p,w,N]}),e[29]=w,e[30]=N,e[31]=y,e[32]=p,e[33]=D):D=e[33];let T;return e[34]!==u||e[35]!==D?(T=t.jsx(Ke,{open:u,onOpenChange:o,children:D}),e[34]=u,e[35]=D,e[36]=T):T=e[36],T}function Yo(){const s=W.c(48),[e,n]=P.useState(!0),[l,a]=P.useState(!1),{personId:u}=Oe(),o=!!u;let d;s[0]!==o?(d={enabled:o},s[0]=o,s[1]=d):d=s[1];const{data:r,isLoading:c,isError:i}=U.terminalReaders.getPageOfTerminalReaders.useQuery(u,d),f=U.useUtils(),{mutateAsync:m,isPending:g}=U.terminalReaders.createTerminalReader.useMutation({onSuccess:()=>{Je({title:"Terminal reader created",description:"The terminal reader has been created"}),f.terminalReaders.getPageOfTerminalReaders.invalidate(u),k(""),v(""),C(""),N(void 0),a(!1)},onError:V=>{const Y=ls(V);N(Y||V.message)}}),[x,h]=P.useState(null),[y,j]=P.useState(""),k=j,[b,p]=P.useState(""),v=p,[S,w]=P.useState(""),C=w,[A,F]=P.useState(void 0),N=F,D=!!u;let T;s[2]!==D?(T={enabled:D},s[2]=D,s[3]=T):T=s[3];const{data:_}=U.getStudioOptions.useQuery(u,T),O=Le();let B;s[4]!==r?.length?(B=()=>{r?.length===0&&a(!0)},s[4]=r?.length,s[5]=B):B=s[5];let I;s[6]!==r?(I=[r],s[6]=r,s[7]=I):I=s[7],P.useEffect(B,I);let $;s[8]!==O||s[9]!==e?($=()=>{e||O("../",{preventScrollReset:!0})},s[8]=O,s[9]=e,s[10]=$):$=s[10];let M;s[11]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ve,{children:"Card readers"}),s[11]=M):M=s[11];let R;s[12]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(ds,{className:"text-center",children:"Take payments from your clients using a card reader."}),s[12]=R):R=s[12];let E;s[13]!==i||s[14]!==c||s[15]!==h||s[16]!==r?(E=i?t.jsx("div",{className:"text-center text-ink-destructive",children:"Error loading card readers"}):c?t.jsx("div",{children:"Loading..."}):r&&r.length>0?r.map(V=>t.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[t.jsx("div",{children:V.label}),t.jsx(Z,{variant:"destructive",size:"sm",onClick:()=>h({id:V.id,label:V.label}),children:"Remove reader"})]},V.id)):t.jsx("div",{className:"text-center text-ink-black-700",children:"You have no card readers registered. Please register one to start taking in-person payments."}),s[13]=i,s[14]=c,s[15]=h,s[16]=r,s[17]=E):E=s[17];let H;s[18]!==E?(H=t.jsx("div",{className:"flex flex-col gap-2",children:E}),s[18]=E,s[19]=H):H=s[19];let z;s[20]!==m||s[21]!==A||s[22]!==g||s[23]!==S||s[24]!==y||s[25]!==_||s[26]!==b||s[27]!==u||s[28]!==N||s[29]!==C||s[30]!==k||s[31]!==v||s[32]!==l?(z=l?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{children:t.jsxs(xs,{value:y,onValueChange:V=>{k(V),N(void 0)},children:[t.jsx(hs,{children:t.jsx(ps,{placeholder:"Select a location"})}),t.jsx(ms,{children:_?.map($l)})]})}),t.jsx("div",{children:t.jsx(et,{label:"Pairing code",value:b,onChangeValue:V=>{v(V),N(void 0)}})}),t.jsx("div",{children:t.jsx(et,{label:"Label",value:S,onChangeValue:V=>{C(V),N(void 0)}})}),A&&t.jsx("div",{className:"font-medium text-center text-ink-destructive",children:A}),t.jsxs("div",{className:"flex flex-row gap-2",children:[t.jsx(Z,{variant:"secondary",onClick:()=>a(!1),children:"Cancel"}),t.jsx(Z,{fullWidth:!0,disabled:g,onClick:()=>m({personId:u,label:S,locationId:y,pairingCode:b}),children:g?"Registering...":"Register reader"})]})]}):t.jsx("div",{children:t.jsx(Z,{onClick:()=>a(!0),fullWidth:!0,children:"Add a reader"})}),s[20]=m,s[21]=A,s[22]=g,s[23]=S,s[24]=y,s[25]=_,s[26]=b,s[27]=u,s[28]=N,s[29]=C,s[30]=k,s[31]=v,s[32]=l,s[33]=z):z=s[33];let L;s[34]!==H||s[35]!==z?(L=t.jsxs("div",{className:"flex flex-col gap-4 px-4 pt-4 pb-safe-or-5",children:[R,H,z]}),s[34]=H,s[35]=z,s[36]=L):L=s[36];let Q;s[37]!==$||s[38]!==L?(Q=t.jsxs(we,{onAnimationEndCapture:$,showClose:!1,children:[M,L]}),s[37]=$,s[38]=L,s[39]=Q):Q=s[39];let q;s[40]!==u||s[41]!==x||s[42]!==h?(q=x&&u&&t.jsx(Ml,{reader:x,personId:u,onHidden:()=>h(null)}),s[40]=u,s[41]=x,s[42]=h,s[43]=q):q=s[43];let G;return s[44]!==e||s[45]!==Q||s[46]!==q?(G=t.jsxs(Ce,{open:e,onOpenChange:n,children:[Q,q]}
1),s[44]=e,s[45]=Q,s[46]=q,s[47]=G):G=s[47],G}function $l(s){return t.jsx(Xe,{value:s.id,children:s.name},s.id)}function Rl(s){const e=W.c(36),{bookId:n,bookName:l,onRedirect:a,onHidden:u}=s,o=U.useUtils(),[d,r]=P.useState(null);let c;e[0]!==l||e[1]!==a||e[2]!==o?(c=async()=>{Je({title:`Book ${l} unarchived`,variant:"success"}),await o.getPersonSettings.invalidate(),await o.getBookSettings.invalidate(),a()},e[0]=l,e[1]=a,e[2]=o,e[3]=c):c=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=D=>{r(D.message),Je({title:"Unable to unarchive book",description:D.message,variant:"error"})},e[4]=i):i=e[4];let f;e[5]!==c?(f={onSuccess:c,onError:i},e[5]=c,e[6]=f):f=e[6];const{mutateAsync:m,isPending:g}=U.unarchiveBook.useMutation(f),[x,h]=P.useState(!0);let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=()=>h(!1),e[7]=y):y=e[7];let j;e[8]!==u||e[9]!==x?(j=()=>{x||u()},e[8]=u,e[9]=x,e[10]=j):j=e[10];let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Qe,{children:"Unarchive book?"}),e[11]=k):k=e[11];let b;e[12]!==l?(b=t.jsxs(Ve,{children:[k,t.jsxs(qe,{className:"leading-snug",children:["This restores ",l," and the requests archived with it so the artist can take bookings again."]})]}),e[12]=l,e[13]=b):b=e[13];let p;e[14]!==d?(p=d&&t.jsx("div",{className:"rounded-lg border border-ink-black-200 p-3 dark:border-ink-black-800",children:t.jsx(ie,{element:"p",size:"sm",className:"whitespace-pre-wrap break-words text-ink-destructive",children:d})}),e[14]=d,e[15]=p):p=e[15];const v=d?"Close":"No, never mind";let S;e[16]!==v?(S=t.jsx(Ct,{asChild:!0,children:t.jsx(Z,{variant:"secondary",children:v})}),e[16]=v,e[17]=S):S=e[17];let w;e[18]!==n||e[19]!==g||e[20]!==m?(w=()=>{g||(r(null),m(n))},e[18]=n,e[19]=g,e[20]=m,e[21]=w):w=e[21];let C;e[22]!==g||e[23]!==w?(C=t.jsx(Z,{variant:"primary",disabled:g,isLoading:g,onClick:w,children:"Yes, unarchive book"}),e[22]=g,e[23]=w,e[24]=C):C=e[24];let A;e[25]!==S||e[26]!==C?(A=t.jsxs(Ge,{children:[S,C]}),e[25]=S,e[26]=C,e[27]=A):A=e[27];let F;e[28]!==A||e[29]!==j||e[30]!==b||e[31]!==p?(F=t.jsxs(Ye,{showClose:!1,onAnimationEndCapture:j,children:[b,p,A]}),e[28]=A,e[29]=j,e[30]=b,e[31]=p,e[32]=F):F=e[32];let N;return e[33]!==x||e[34]!==F?(N=t.jsx(Ke,{open:x,onOpenChange:y,children:F}),e[33]=x,e[34]=F,e[35]=N):N=e[35],N}function Ko(){const s=W.c(16),{personId:e}=Oe(),{bookId:n}=st(),l=!!n;let a;s[0]!==l?(a={enabled:l},s[0]=l,s[1]=a):a=s[1];const{data:u,isLoading:o}=U.getBookSettings.useQuery(n,a),d=Le(),r=tt();if(o){let m;return s[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(lt,{}),s[2]=m):m=s[2],m}if(!n){let m;return s[3]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Be,{code:Ie.hookUseParams_bookId}),s[3]=m):m=s[3],m}if(!u){let m;return s[4]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Be,{code:Ie.getBookSettings}),s[4]=m):m=s[4],m}let c;s[5]!==r||s[6]!==d||s[7]!==e?(c=()=>{d(r("personSettings",{personId:e}))},s[5]=r,s[6]=d,s[7]=e,s[8]=c):c=s[8];let i;s[9]!==d?(i=()=>{d("../",{preventScrollReset:!0})},s[9]=d,s[10]=i):i=s[10];let f;return s[11]!==n||s[12]!==u.name||s[13]!==c||s[14]!==i?(f=t.jsx(Rl,{bookId:n,bookName:u.name,onRedirect:c,onHidden:i}),s[11]=n,s[12]=u.name,s[13]=c,s[14]=i,s[15]=f):f=s[15],f}export{ko as ArchiveBook,jo as BookId,vo as BookIdPayment,So as EditAllowClientReschedule,wo as EditBookingMethod,Co as EditBookingRange,No as EditConsentForm,Fo as EditConsentFormLotNumbers,Ao as EditConsentFormSubmissionWindow,_o as EditCustomForm,Do as EditDailyWorkingHours,To as EditDepositAmount,Bo as EditDepositCurrency,Io as EditFeePayer,Oo as EditForm,Mo as EditMaxAppointmentDuration,$o as EditMinimumNotice,Ro as EditName,Po as EditSalesTax,Eo as EditServiceTitleAndDescription,Uo as EditStatus,Ho as EditStudio,Lo as EditTag,zo as EditTerms,Wo as EditTimeSelection,Qo as EditTimeSlots,qo as EditTipAmounts,Vo as EditWaiverTypeformFormId,Go as EditZeroDollarDepositDisallowedAt,Yo as TerminalReaders,Ko as UnarchiveBook}; 2 3//# chunkId=01a0f45b-c744-7f83-9179-186e69b4fbfc
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.